summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:48:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:48:22 +0000
commit7373ce3d6988706388f136e1c06afd20a3e8d5be (patch)
treee9ae5af7d102667e5706187646db45de8238e8c4
parentInitial commit. (diff)
downloadmonitoring-plugins-7373ce3d6988706388f136e1c06afd20a3e8d5be.tar.xz
monitoring-plugins-7373ce3d6988706388f136e1c06afd20a3e8d5be.zip
Adding upstream version 2.3.5.upstream/2.3.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--ABOUT-NLS1111
-rw-r--r--ACKNOWLEDGEMENTS39
-rw-r--r--AUTHORS26
-rw-r--r--CODING116
-rw-r--r--COPYING674
-rw-r--r--ChangeLog1
-rw-r--r--FAQ55
-rw-r--r--INSTALL368
-rw-r--r--Makefile.am63
-rw-r--r--Makefile.in2325
-rw-r--r--NEWS713
-rwxr-xr-xNP-VERSION-GEN53
-rw-r--r--NPTest.pm646
-rw-r--r--README98
-rw-r--r--REQUIREMENTS111
-rw-r--r--SUPPORT76
-rw-r--r--THANKS425
-rw-r--r--acinclude.m477
-rw-r--r--aclocal.m44652
-rwxr-xr-xbuild-aux/config.guess1480
-rwxr-xr-xbuild-aux/config.rpath684
-rwxr-xr-xbuild-aux/config.sub1801
-rwxr-xr-xbuild-aux/depcomp791
-rwxr-xr-xbuild-aux/install-sh541
-rw-r--r--build-aux/ltmain.sh9661
-rwxr-xr-xbuild-aux/missing215
-rwxr-xr-xbuild-aux/mkinstalldirs162
-rwxr-xr-xbuild-aux/test-driver150
-rw-r--r--config.h.in2875
-rwxr-xr-xconfig.rpath660
-rw-r--r--config_test/Makefile12
-rw-r--r--config_test/child_test.c77
-rwxr-xr-xconfig_test/run_tests30
-rwxr-xr-xconfigure54320
-rw-r--r--configure.ac1966
-rw-r--r--gl/Makefile.am3024
-rw-r--r--gl/Makefile.in6317
-rw-r--r--gl/_Noreturn.h50
-rw-r--r--gl/af_alg.c213
-rw-r--r--gl/af_alg.h115
-rw-r--r--gl/alloca.in.h72
-rw-r--r--gl/arg-nonnull.h26
-rw-r--r--gl/arpa_inet.in.h150
-rw-r--r--gl/asnprintf.c34
-rw-r--r--gl/asprintf.c39
-rw-r--r--gl/assert.in.h27
-rw-r--r--gl/attribute.h226
-rw-r--r--gl/base64.c598
-rw-r--r--gl/base64.h65
-rw-r--r--gl/basename-lgpl.c70
-rw-r--r--gl/basename-lgpl.h78
-rw-r--r--gl/basename.c64
-rw-r--r--gl/btowc.c39
-rw-r--r--gl/byteswap.in.h44
-rw-r--r--gl/c++defs.h331
-rw-r--r--gl/calloc.c55
-rw-r--r--gl/cdefs.h707
-rw-r--r--gl/cloexec.c83
-rw-r--r--gl/cloexec.h34
-rw-r--r--gl/close.c75
-rw-r--r--gl/dirname-lgpl.c86
-rw-r--r--gl/dirname.c38
-rw-r--r--gl/dirname.h53
-rw-r--r--gl/dup2.c189
-rw-r--r--gl/dynarray.h284
-rw-r--r--gl/errno.in.h279
-rw-r--r--gl/error.c411
-rw-r--r--gl/error.h66
-rw-r--r--gl/exitfail.c24
-rw-r--r--gl/exitfail.h18
-rw-r--r--gl/fcntl.c629
-rw-r--r--gl/fcntl.in.h445
-rw-r--r--gl/fd-hook.c116
-rw-r--r--gl/fd-hook.h119
-rw-r--r--gl/fflush.c233
-rw-r--r--gl/filename.h112
-rw-r--r--gl/float+.h147
-rw-r--r--gl/float.c33
-rw-r--r--gl/float.in.h194
-rw-r--r--gl/floor.c105
-rw-r--r--gl/floorf.c20
-rw-r--r--gl/fopen.c229
-rw-r--r--gl/fpurge.c150
-rw-r--r--gl/freading.c76
-rw-r--r--gl/freading.h54
-rw-r--r--gl/free.c53
-rw-r--r--gl/fseek.c30
-rw-r--r--gl/fseeko.c164
-rw-r--r--gl/fstat.c94
-rw-r--r--gl/fsusage.c233
-rw-r--r--gl/fsusage.h39
-rw-r--r--gl/ftell.c37
-rw-r--r--gl/ftello.c157
-rw-r--r--gl/gai_strerror.c92
-rw-r--r--gl/getaddrinfo.c503
-rw-r--r--gl/getdelim.c147
-rw-r--r--gl/getdtablesize.c124
-rw-r--r--gl/gethostname.c104
-rw-r--r--gl/getline.c27
-rw-r--r--gl/getloadavg.c943
-rw-r--r--gl/getopt-cdefs.in.h66
-rw-r--r--gl/getopt-core.h96
-rw-r--r--gl/getopt-ext.h77
-rw-r--r--gl/getopt-pfx-core.h66
-rw-r--r--gl/getopt-pfx-ext.h70
-rw-r--r--gl/getopt.c811
-rw-r--r--gl/getopt.in.h61
-rw-r--r--gl/getopt1.c159
-rw-r--r--gl/getopt_int.h118
-rw-r--r--gl/getprogname.c302
-rw-r--r--gl/getprogname.h40
-rw-r--r--gl/gettext.h300
-rw-r--r--gl/gl_openssl.h116
-rw-r--r--gl/glthread/lock.c749
-rw-r--r--gl/glthread/lock.h791
-rw-r--r--gl/glthread/threadlib.c108
-rw-r--r--gl/hard-locale.c35
-rw-r--r--gl/hard-locale.h26
-rw-r--r--gl/ialloc.c21
-rw-r--r--gl/ialloc.h100
-rw-r--r--gl/idpriv-droptemp.c208
-rw-r--r--gl/idpriv.h116
-rw-r--r--gl/idx.h134
-rw-r--r--gl/inet_ntop.c260
-rw-r--r--gl/intprops-internal.h392
-rw-r--r--gl/intprops.h335
-rw-r--r--gl/inttypes.in.h1002
-rw-r--r--gl/itold.c28
-rw-r--r--gl/langinfo.in.h222
-rw-r--r--gl/lc-charset-dispatch.c82
-rw-r--r--gl/lc-charset-dispatch.h40
-rw-r--r--gl/libc-config.h202
-rw-r--r--gl/limits.in.h131
-rw-r--r--gl/localcharset.c1159
-rw-r--r--gl/localcharset.h137
-rw-r--r--gl/locale.in.h305
-rw-r--r--gl/localeconv.c103
-rw-r--r--gl/lseek.c89
-rw-r--r--gl/m4/00gnulib.m485
-rw-r--r--gl/m4/__inline.m422
-rw-r--r--gl/m4/absolute-header.m4100
-rw-r--r--gl/m4/af_alg.m457
-rw-r--r--gl/m4/alloca.m4106
-rw-r--r--gl/m4/arpa_inet_h.m474
-rw-r--r--gl/m4/assert_h.m467
-rw-r--r--gl/m4/base64.m415
-rw-r--r--gl/m4/btowc.m4105
-rw-r--r--gl/m4/builtin-expect.m449
-rw-r--r--gl/m4/byteswap.m417
-rw-r--r--gl/m4/c-bool.m451
-rw-r--r--gl/m4/calloc.m483
-rw-r--r--gl/m4/close.m435
-rw-r--r--gl/m4/codeset.m424
-rw-r--r--gl/m4/double-slash-root.m438
-rw-r--r--gl/m4/dup2.m4105
-rw-r--r--gl/m4/eealloc.m431
-rw-r--r--gl/m4/environ.m446
-rw-r--r--gl/m4/errno_h.m4131
-rw-r--r--gl/m4/error.m431
-rw-r--r--gl/m4/exponentd.m4116
-rw-r--r--gl/m4/extensions.m4232
-rw-r--r--gl/m4/extern-inline.m4130
-rw-r--r--gl/m4/fcntl-o.m4140
-rw-r--r--gl/m4/fcntl.m4151
-rw-r--r--gl/m4/fcntl_h.m470
-rw-r--r--gl/m4/fflush.m4100
-rw-r--r--gl/m4/float_h.m4106
-rw-r--r--gl/m4/floorf.m4113
-rw-r--r--gl/m4/fopen.m4149
-rw-r--r--gl/m4/fpurge.m473
-rw-r--r--gl/m4/freading.m411
-rw-r--r--gl/m4/free.m452
-rw-r--r--gl/m4/fseek.m415
-rw-r--r--gl/m4/fseeko.m477
-rw-r--r--gl/m4/fstat.m440
-rw-r--r--gl/m4/fstypename.m423
-rw-r--r--gl/m4/fsusage.m4306
-rw-r--r--gl/m4/ftell.m415
-rw-r--r--gl/m4/ftello.m4151
-rw-r--r--gl/m4/getaddrinfo.m4238
-rw-r--r--gl/m4/getdelim.m4111
-rw-r--r--gl/m4/getdtablesize.m463
-rw-r--r--gl/m4/gethostname.m4107
-rw-r--r--gl/m4/getline.m4109
-rw-r--r--gl/m4/getloadavg.m4161
-rw-r--r--gl/m4/getopt.m4381
-rw-r--r--gl/m4/getprogname.m443
-rw-r--r--gl/m4/gl-openssl.m476
-rw-r--r--gl/m4/gnulib-cache.m4101
-rw-r--r--gl/m4/gnulib-common.m41151
-rw-r--r--gl/m4/gnulib-comp.m41354
-rw-r--r--gl/m4/hostent.m449
-rw-r--r--gl/m4/idpriv.m414
-rw-r--r--gl/m4/include_next.m4224
-rw-r--r--gl/m4/inet_ntop.m470
-rw-r--r--gl/m4/intmax_t.m459
-rw-r--r--gl/m4/inttypes.m4180
-rw-r--r--gl/m4/inttypes_h.m429
-rw-r--r--gl/m4/langinfo_h.m4137
-rw-r--r--gl/m4/largefile.m4376
-rw-r--r--gl/m4/libtool.m47983
-rw-r--r--gl/m4/limits-h.m441
-rw-r--r--gl/m4/localcharset.m411
-rw-r--r--gl/m4/locale-fr.m4253
-rw-r--r--gl/m4/locale-ja.m4143
-rw-r--r--gl/m4/locale-zh.m4137
-rw-r--r--gl/m4/locale_h.m4174
-rw-r--r--gl/m4/localeconv.m422
-rw-r--r--gl/m4/lock.m447
-rw-r--r--gl/m4/lseek.m478
-rw-r--r--gl/m4/ltoptions.m4384
-rw-r--r--gl/m4/ltsugar.m4123
-rw-r--r--gl/m4/ltversion.m423
-rw-r--r--gl/m4/lt~obsolete.m498
-rw-r--r--gl/m4/malloc.m4175
-rw-r--r--gl/m4/malloca.m414
-rw-r--r--gl/m4/math_h.m4391
-rw-r--r--gl/m4/mbrtowc.m4790
-rw-r--r--gl/m4/mbsinit.m444
-rw-r--r--gl/m4/mbstate_t.m434
-rw-r--r--gl/m4/mbtowc.m424
-rw-r--r--gl/m4/memchr.m4106
-rw-r--r--gl/m4/minmax.m444
-rw-r--r--gl/m4/mktime.m4319
-rw-r--r--gl/m4/mmap-anon.m455
-rw-r--r--gl/m4/mode_t.m426
-rw-r--r--gl/m4/mountlist.m4338
-rw-r--r--gl/m4/msvc-inval.m419
-rw-r--r--gl/m4/msvc-nothrow.m410
-rw-r--r--gl/m4/multiarch.m465
-rw-r--r--gl/m4/netdb_h.m459
-rw-r--r--gl/m4/netinet_in_h.m429
-rw-r--r--gl/m4/nl_langinfo.m477
-rw-r--r--gl/m4/nocrash.m4131
-rw-r--r--gl/m4/off_t.m418
-rw-r--r--gl/m4/open-cloexec.m421
-rw-r--r--gl/m4/open-slash.m460
-rw-r--r--gl/m4/open.m456
-rw-r--r--gl/m4/pathmax.m442
-rw-r--r--gl/m4/pid_t.m438
-rw-r--r--gl/m4/printf.m41728
-rw-r--r--gl/m4/pthread_rwlock_rdlock.m4185
-rw-r--r--gl/m4/realloc.m463
-rw-r--r--gl/m4/reallocarray.m423
-rw-r--r--gl/m4/regex.m4396
-rw-r--r--gl/m4/servent.m451
-rw-r--r--gl/m4/setenv.m4166
-rw-r--r--gl/m4/setlocale_null.m498
-rw-r--r--gl/m4/sha256.m414
-rw-r--r--gl/m4/size_max.m475
-rw-r--r--gl/m4/snprintf.m462
-rw-r--r--gl/m4/socketlib.m496
-rw-r--r--gl/m4/sockets.m417
-rw-r--r--gl/m4/socklen.m476
-rw-r--r--gl/m4/sockpfaf.m484
-rw-r--r--gl/m4/ssize_t.m423
-rw-r--r--gl/m4/stat-time.m483
-rw-r--r--gl/m4/stat.m485
-rw-r--r--gl/m4/std-gnu11.m4829
-rw-r--r--gl/m4/stdalign.m4138
-rw-r--r--gl/m4/stddef_h.m4104
-rw-r--r--gl/m4/stdint.m4531
-rw-r--r--gl/m4/stdint_h.m427
-rw-r--r--gl/m4/stdio_h.m4225
-rw-r--r--gl/m4/stdlib_h.m4200
-rw-r--r--gl/m4/strcase.m445
-rw-r--r--gl/m4/strcasestr.m4155
-rw-r--r--gl/m4/strerror.m4102
-rw-r--r--gl/m4/string_h.m4148
-rw-r--r--gl/m4/strings_h.m462
-rw-r--r--gl/m4/strsep.m423
-rw-r--r--gl/m4/strstr.m4149
-rw-r--r--gl/m4/sys_socket_h.m4206
-rw-r--r--gl/m4/sys_stat_h.m4129
-rw-r--r--gl/m4/sys_types_h.m470
-rw-r--r--gl/m4/sys_uio_h.m446
-rw-r--r--gl/m4/threadlib.m4666
-rw-r--r--gl/m4/time_h.m4183
-rw-r--r--gl/m4/time_r.m499
-rw-r--r--gl/m4/timegm.m426
-rw-r--r--gl/m4/ungetc.m473
-rw-r--r--gl/m4/unistd_h.m4270
-rw-r--r--gl/m4/unlocked-io.m436
-rw-r--r--gl/m4/vararrays.m472
-rw-r--r--gl/m4/vasnprintf.m4298
-rw-r--r--gl/m4/vasprintf.m446
-rw-r--r--gl/m4/visibility.m482
-rw-r--r--gl/m4/vsnprintf.m462
-rw-r--r--gl/m4/warn-on-use.m462
-rw-r--r--gl/m4/wchar_h.m4257
-rw-r--r--gl/m4/wchar_t.m424
-rw-r--r--gl/m4/wcrtomb.m4146
-rw-r--r--gl/m4/wctype_h.m4200
-rw-r--r--gl/m4/wint_t.m457
-rw-r--r--gl/m4/xalloc.m47
-rw-r--r--gl/m4/xsize.m412
-rw-r--r--gl/m4/zzgnulib.m423
-rw-r--r--gl/malloc.c51
-rw-r--r--gl/malloc/dynarray-skeleton.c528
-rw-r--r--gl/malloc/dynarray.h177
-rw-r--r--gl/malloc/dynarray_at_failure.c40
-rw-r--r--gl/malloc/dynarray_emplace_enlarge.c77
-rw-r--r--gl/malloc/dynarray_finalize.c66
-rw-r--r--gl/malloc/dynarray_resize.c68
-rw-r--r--gl/malloc/dynarray_resize_clear.c39
-rw-r--r--gl/malloca.c112
-rw-r--r--gl/malloca.h126
-rw-r--r--gl/math.c22
-rw-r--r--gl/math.in.h2727
-rw-r--r--gl/mbrtowc-impl-utf8.h138
-rw-r--r--gl/mbrtowc-impl.h262
-rw-r--r--gl/mbrtowc.c157
-rw-r--r--gl/mbsinit.c69
-rw-r--r--gl/mbtowc-impl.h44
-rw-r--r--gl/mbtowc-lock.c150
-rw-r--r--gl/mbtowc-lock.h125
-rw-r--r--gl/mbtowc.c26
-rw-r--r--gl/memchr.c172
-rw-r--r--gl/memchr.valgrind30
-rw-r--r--gl/minmax.h60
-rw-r--r--gl/mktime-internal.h79
-rw-r--r--gl/mktime.c578
-rw-r--r--gl/mountlist.c1120
-rw-r--r--gl/mountlist.h43
-rw-r--r--gl/msvc-inval.c129
-rw-r--r--gl/msvc-inval.h222
-rw-r--r--gl/msvc-nothrow.c51
-rw-r--r--gl/msvc-nothrow.h43
-rw-r--r--gl/netdb.in.h295
-rw-r--r--gl/netinet_in.in.h47
-rw-r--r--gl/nl_langinfo-lock.c150
-rw-r--r--gl/nl_langinfo.c572
-rw-r--r--gl/open.c209
-rw-r--r--gl/pathmax.h83
-rw-r--r--gl/printf-args.c183
-rw-r--r--gl/printf-args.h150
-rw-r--r--gl/printf-parse.c623
-rw-r--r--gl/printf-parse.h193
-rw-r--r--gl/realloc.c63
-rw-r--r--gl/reallocarray.c38
-rw-r--r--gl/regcomp.c3788
-rw-r--r--gl/regex.c84
-rw-r--r--gl/regex.h699
-rw-r--r--gl/regex_internal.c1711
-rw-r--r--gl/regex_internal.h834
-rw-r--r--gl/regexec.c4221
-rw-r--r--gl/setenv.c390
-rw-r--r--gl/setlocale-lock.c150
-rw-r--r--gl/setlocale_null.c411
-rw-r--r--gl/setlocale_null.h82
-rw-r--r--gl/sha256-stream.c145
-rw-r--r--gl/sha256.c432
-rw-r--r--gl/sha256.h121
-rw-r--r--gl/size_max.h30
-rw-r--r--gl/snprintf.c71
-rw-r--r--gl/sockets.c161
-rw-r--r--gl/sockets.h66
-rw-r--r--gl/stat-time.c21
-rw-r--r--gl/stat-time.h251
-rw-r--r--gl/stat-w32.c460
-rw-r--r--gl/stat-w32.h37
-rw-r--r--gl/stat.c438
-rw-r--r--gl/stdalign.in.h137
-rw-r--r--gl/stdckdint.in.h35
-rw-r--r--gl/stddef.in.h147
-rw-r--r--gl/stdint.in.h740
-rw-r--r--gl/stdio-impl.h218
-rw-r--r--gl/stdio-read.c168
-rw-r--r--gl/stdio-write.c206
-rw-r--r--gl/stdio.in.h1711
-rw-r--r--gl/stdlib.in.h1563
-rw-r--r--gl/str-two-way.h452
-rw-r--r--gl/strcasecmp.c62
-rw-r--r--gl/strcasestr.c81
-rw-r--r--gl/streq.h176
-rw-r--r--gl/strerror-override.c306
-rw-r--r--gl/strerror-override.h57
-rw-r--r--gl/strerror.c70
-rw-r--r--gl/string.in.h1322
-rw-r--r--gl/strings.in.h122
-rw-r--r--gl/stripslash.c45
-rw-r--r--gl/strncasecmp.c62
-rw-r--r--gl/strsep.c57
-rw-r--r--gl/strstr.c76
-rw-r--r--gl/sys-limits.h42
-rw-r--r--gl/sys_socket.c22
-rw-r--r--gl/sys_socket.in.h733
-rw-r--r--gl/sys_stat.in.h954
-rw-r--r--gl/sys_types.in.h106
-rw-r--r--gl/sys_uio.in.h63
-rw-r--r--gl/time.in.h457
-rw-r--r--gl/time_r.c44
-rw-r--r--gl/timegm.c58
-rw-r--r--gl/unistd.c22
-rw-r--r--gl/unistd.in.h2329
-rw-r--r--gl/unlocked-io.h136
-rw-r--r--gl/unsetenv.c127
-rw-r--r--gl/vasnprintf.c5741
-rw-r--r--gl/vasnprintf.h72
-rw-r--r--gl/vasprintf.c50
-rw-r--r--gl/verify.h350
-rw-r--r--gl/vsnprintf.c70
-rw-r--r--gl/w32sock.h140
-rw-r--r--gl/warn-on-use.h149
-rw-r--r--gl/wchar.in.h1363
-rw-r--r--gl/wcrtomb.c80
-rw-r--r--gl/wctype-h.c23
-rw-r--r--gl/wctype.in.h732
-rw-r--r--gl/windows-initguard.h35
-rw-r--r--gl/windows-mutex.c95
-rw-r--r--gl/windows-mutex.h51
-rw-r--r--gl/windows-once.c62
-rw-r--r--gl/windows-once.h47
-rw-r--r--gl/windows-recmutex.c127
-rw-r--r--gl/windows-recmutex.h57
-rw-r--r--gl/windows-rwlock.c377
-rw-r--r--gl/windows-rwlock.h68
-rw-r--r--gl/xalloc-die.c41
-rw-r--r--gl/xalloc-oversized.h65
-rw-r--r--gl/xalloc.h211
-rw-r--r--gl/xmalloc.c340
-rw-r--r--gl/xsize.c21
-rw-r--r--gl/xsize.h108
-rw-r--r--lib/Makefile.am19
-rw-r--r--lib/Makefile.in2179
-rw-r--r--lib/extra_opts.c135
-rw-r--r--lib/extra_opts.h23
-rw-r--r--lib/maxfd.c26
-rw-r--r--lib/maxfd.h9
-rw-r--r--lib/parse_ini.c396
-rw-r--r--lib/parse_ini.h22
-rw-r--r--lib/tests/Makefile.am39
-rw-r--r--lib/tests/Makefile.in2545
-rw-r--r--lib/tests/README5
-rw-r--r--lib/tests/config-dos.ini24
-rw-r--r--lib/tests/config-opts.ini14
-rw-r--r--lib/tests/config-tiny.ini24
-rw-r--r--lib/tests/plugin.ini24
-rw-r--r--lib/tests/plugins.ini17
-rw-r--r--lib/tests/test_base64.c349
-rwxr-xr-xlib/tests/test_base64.t6
-rw-r--r--lib/tests/test_cmd.c233
-rw-r--r--lib/tests/test_cmd.t6
-rw-r--r--lib/tests/test_disk.c224
-rwxr-xr-xlib/tests/test_disk.t6
-rw-r--r--lib/tests/test_ini1.c109
-rwxr-xr-xlib/tests/test_ini1.t6
-rw-r--r--lib/tests/test_ini3.c33
-rwxr-xr-xlib/tests/test_ini3.t34
-rw-r--r--lib/tests/test_opts1.c139
-rwxr-xr-xlib/tests/test_opts1.t6
-rw-r--r--lib/tests/test_opts2.c121
-rwxr-xr-xlib/tests/test_opts2.t7
-rw-r--r--lib/tests/test_opts3.c31
-rwxr-xr-xlib/tests/test_opts3.t40
-rw-r--r--lib/tests/test_tcp.c58
-rwxr-xr-xlib/tests/test_tcp.t6
-rw-r--r--lib/tests/test_utils.c510
-rwxr-xr-xlib/tests/test_utils.t6
-rw-r--r--lib/tests/var/.gitignore2
-rw-r--r--lib/tests/var/baddate5
-rw-r--r--lib/tests/var/missingdataline4
-rw-r--r--lib/tests/var/oldformat5
-rw-r--r--lib/tests/var/statefile5
-rw-r--r--lib/utils_base.c727
-rw-r--r--lib/utils_base.h119
-rw-r--r--lib/utils_cmd.c405
-rw-r--r--lib/utils_cmd.h39
-rw-r--r--lib/utils_disk.c270
-rw-r--r--lib/utils_disk.h52
-rw-r--r--lib/utils_tcp.c75
-rw-r--r--lib/utils_tcp.h22
-rw-r--r--m4/libcurl.m4272
-rw-r--r--m4/np_mysqlclient.m493
-rw-r--r--m4/uriparser.m4140
-rwxr-xr-xmkinstalldirs158
-rw-r--r--pkg/fedora/requires33
-rw-r--r--pkg/redhat/requires35
-rw-r--r--pkg/solaris/pkginfo12
-rw-r--r--pkg/solaris/pkginfo.in12
-rwxr-xr-xpkg/solaris/preinstall35
-rwxr-xr-xpkg/solaris/solpkg90
-rw-r--r--plugins-root/Makefile.am97
-rw-r--r--plugins-root/Makefile.in2504
-rw-r--r--plugins-root/check_dhcp.c1412
-rw-r--r--plugins-root/check_icmp.c2109
-rw-r--r--plugins-root/pst3.c262
-rw-r--r--plugins-root/t/check_dhcp.t74
-rw-r--r--plugins-root/t/check_icmp.t142
-rw-r--r--plugins-scripts/Makefile.am60
-rw-r--r--plugins-scripts/Makefile.in2331
-rwxr-xr-xplugins-scripts/check_breeze.pl89
-rw-r--r--plugins-scripts/check_disk_smb.pl349
-rwxr-xr-xplugins-scripts/check_file_age.pl161
-rwxr-xr-xplugins-scripts/check_flexlm.pl245
-rwxr-xr-xplugins-scripts/check_ifoperstatus.pl478
-rwxr-xr-xplugins-scripts/check_ifstatus.pl448
-rwxr-xr-xplugins-scripts/check_ircd.pl238
-rwxr-xr-xplugins-scripts/check_log.sh244
-rwxr-xr-xplugins-scripts/check_mailq.pl719
-rwxr-xr-xplugins-scripts/check_mssql.pl145
-rwxr-xr-xplugins-scripts/check_oracle.sh304
-rwxr-xr-xplugins-scripts/check_rpc.pl376
-rwxr-xr-xplugins-scripts/check_sensors.sh70
-rwxr-xr-xplugins-scripts/check_uptime.pl328
-rwxr-xr-xplugins-scripts/check_wave.pl124
-rw-r--r--plugins-scripts/t/check_disk_smb.t96
-rw-r--r--plugins-scripts/t/check_file_age.t109
-rw-r--r--plugins-scripts/t/check_ifoperstatus.t93
-rw-r--r--plugins-scripts/t/check_ifstatus.t67
-rw-r--r--plugins-scripts/t/check_log.t82
-rw-r--r--plugins-scripts/t/check_rpc.t21
-rw-r--r--plugins-scripts/t/check_uptime.t135
-rw-r--r--plugins-scripts/t/utils.t51
-rw-r--r--plugins-scripts/utils.pm.in69
-rw-r--r--plugins-scripts/utils.sh.in111
-rw-r--r--plugins/Makefile.am144
-rw-r--r--plugins/Makefile.in3232
-rw-r--r--plugins/check_apt.c561
-rw-r--r--plugins/check_by_ssh.c496
-rw-r--r--plugins/check_cluster.c289
-rw-r--r--plugins/check_curl.c2704
-rw-r--r--plugins/check_dbi.c826
-rw-r--r--plugins/check_dig.c380
-rw-r--r--plugins/check_disk.c1170
-rw-r--r--plugins/check_dns.c619
-rw-r--r--plugins/check_dummy.c124
-rw-r--r--plugins/check_fping.c527
-rw-r--r--plugins/check_game.c348
-rw-r--r--plugins/check_hpjd.c442
-rw-r--r--plugins/check_http.c1895
-rw-r--r--plugins/check_ide_smart.c608
-rw-r--r--plugins/check_ldap.c517
-rw-r--r--plugins/check_load.c417
-rw-r--r--plugins/check_mrtg.c385
-rw-r--r--plugins/check_mrtgtraf.c381
-rw-r--r--plugins/check_mysql.c612
-rw-r--r--plugins/check_mysql_query.c354
-rw-r--r--plugins/check_nagios.c325
-rw-r--r--plugins/check_nt.c801
-rw-r--r--plugins/check_ntp.c900
-rw-r--r--plugins/check_ntp_peer.c756
-rw-r--r--plugins/check_ntp_time.c654
-rw-r--r--plugins/check_nwstat.c1687
-rw-r--r--plugins/check_overcr.c469
-rw-r--r--plugins/check_pgsql.c636
-rw-r--r--plugins/check_ping.c620
-rw-r--r--plugins/check_procs.c834
-rw-r--r--plugins/check_radius.c416
-rw-r--r--plugins/check_real.c454
-rw-r--r--plugins/check_smtp.c929
-rw-r--r--plugins/check_snmp.c1379
-rw-r--r--plugins/check_ssh.c328
-rw-r--r--plugins/check_swap.c610
-rw-r--r--plugins/check_tcp.c715
-rw-r--r--plugins/check_time.c374
-rw-r--r--plugins/check_ups.c665
-rw-r--r--plugins/check_users.c277
-rw-r--r--plugins/common.h228
-rw-r--r--plugins/negate.c275
-rw-r--r--plugins/netutils.c379
-rw-r--r--plugins/netutils.h120
-rw-r--r--plugins/picohttpparser/Makefile.am3
-rw-r--r--plugins/picohttpparser/Makefile.in2026
-rw-r--r--plugins/picohttpparser/picohttpparser.c651
-rw-r--r--plugins/picohttpparser/picohttpparser.h87
-rw-r--r--plugins/popen.c294
-rw-r--r--plugins/popen.h13
-rw-r--r--plugins/runcmd.c342
-rw-r--r--plugins/runcmd.h43
-rw-r--r--plugins/sslutils.c330
-rw-r--r--plugins/t/check_apt.t106
-rw-r--r--plugins/t/check_apt_input/debian14
-rw-r--r--plugins/t/check_apt_input/debian237
-rw-r--r--plugins/t/check_apt_input/debian342
-rw-r--r--plugins/t/check_apt_input/ubuntu114
-rw-r--r--plugins/t/check_apt_input/ubuntu254
-rw-r--r--plugins/t/check_by_ssh.t153
-rw-r--r--plugins/t/check_cluster.t82
-rw-r--r--plugins/t/check_curl.t213
-rw-r--r--plugins/t/check_dbi.t103
-rw-r--r--plugins/t/check_dig.t98
-rw-r--r--plugins/t/check_disk.t378
-rw-r--r--plugins/t/check_dns.t115
-rw-r--r--plugins/t/check_dummy.t54
-rw-r--r--plugins/t/check_fping.t34
-rw-r--r--plugins/t/check_ftp.t28
-rw-r--r--plugins/t/check_hpjd.t71
-rw-r--r--plugins/t/check_http.t190
-rw-r--r--plugins/t/check_imap.t38
-rw-r--r--plugins/t/check_jabber.t50
-rw-r--r--plugins/t/check_ldap.t71
-rw-r--r--plugins/t/check_load.t43
-rw-r--r--plugins/t/check_mysql.t74
-rw-r--r--plugins/t/check_mysql_query.t58
-rw-r--r--plugins/t/check_nagios.nagios1.status.log5
-rw-r--r--plugins/t/check_nagios.nagios2.status.dat127
-rw-r--r--plugins/t/check_nagios.t92
-rw-r--r--plugins/t/check_ntp.t110
-rw-r--r--plugins/t/check_ping.t109
-rw-r--r--plugins/t/check_pop.t55
-rw-r--r--plugins/t/check_procs.t49
-rw-r--r--plugins/t/check_smtp.t84
-rw-r--r--plugins/t/check_snmp.t176
-rw-r--r--plugins/t/check_ssh.t41
-rw-r--r--plugins/t/check_swap.t31
-rw-r--r--plugins/t/check_tcp.t55
-rw-r--r--plugins/t/check_time.t36
-rw-r--r--plugins/t/check_udp.t71
-rw-r--r--plugins/t/check_users.t30
-rw-r--r--plugins/t/negate.t90
-rw-r--r--plugins/tests/certs/.gitignore2
-rw-r--r--plugins/tests/certs/client-cert.pem22
-rw-r--r--plugins/tests/certs/client-key.pem28
-rw-r--r--plugins/tests/certs/clientca-cert.pem25
-rw-r--r--plugins/tests/certs/clientca-key.pem28
-rw-r--r--plugins/tests/certs/clientchain-cert.pem45
-rw-r--r--plugins/tests/certs/clientchain-key.pem28
-rw-r--r--plugins/tests/certs/clientintermediate-cert.pem23
-rw-r--r--plugins/tests/certs/clientintermediate-key.pem28
-rw-r--r--plugins/tests/certs/expired-cert.pem24
-rw-r--r--plugins/tests/certs/expired-key.pem28
-rw-r--r--plugins/tests/certs/ext.cnf2
-rwxr-xr-xplugins/tests/certs/generate-certs.sh63
-rw-r--r--plugins/tests/certs/server-cert.pem24
-rw-r--r--plugins/tests/certs/server-key.pem28
-rwxr-xr-xplugins/tests/check_curl.t526
-rwxr-xr-xplugins/tests/check_http.t581
-rwxr-xr-xplugins/tests/check_nt.t80
-rwxr-xr-xplugins/tests/check_procs.t148
-rwxr-xr-xplugins/tests/check_snmp.t286
-rw-r--r--plugins/tests/check_snmp_agent.pl111
-rw-r--r--plugins/tests/conf/snmpd.conf23
-rw-r--r--plugins/tests/var/ps-axwo.darwin96
-rw-r--r--plugins/tests/var/ps-axwo.debian219
-rw-r--r--plugins/tests/var/root1
-rw-r--r--plugins/urlize.c198
-rw-r--r--plugins/utils.c806
-rw-r--r--plugins/utils.h198
-rw-r--r--po/ChangeLog11
-rw-r--r--po/LINGUAS2
-rw-r--r--po/Makefile.in.in395
-rw-r--r--po/Makevars29
-rw-r--r--po/POTFILES.in44
-rw-r--r--po/de.gmobin0 -> 7618 bytes
-rw-r--r--po/de.po5447
-rw-r--r--po/fr.gmobin0 -> 88706 bytes
-rw-r--r--po/fr.po5445
-rw-r--r--po/monitoring-plugins.pot4982
-rw-r--r--po/remove-potcdate.sin19
-rw-r--r--po/stamp-po1
-rw-r--r--release1
-rw-r--r--tap/Makefile.am13
-rw-r--r--tap/Makefile.in2094
-rw-r--r--tap/README11
-rw-r--r--tap/tap.c435
-rw-r--r--tap/tap.h91
-rwxr-xr-xtest.pl.in52
-rwxr-xr-xtools/build_perl_modules290
-rwxr-xr-xtools/tinderbox_build290
660 files changed, 280146 insertions, 0 deletions
diff --git a/ABOUT-NLS b/ABOUT-NLS
new file mode 100644
index 0000000..3575535
--- /dev/null
+++ b/ABOUT-NLS
@@ -0,0 +1,1111 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+ When reporting bugs in the `intl/' directory or bugs which may be
+related to internationalization, you should tell about the version of
+`gettext' which is used. The information can be found in the
+`intl/VERSION' file, in internationalized packages.
+
+1.1 Quick configuration advice
+==============================
+
+If you want to exploit the full power of internationalization, you
+should configure it using
+
+ ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed. So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation. Future versions of GNU `gettext' will
+very likely convey even more functionality. So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+ So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+1.2 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. If not, the included GNU
+`gettext' library will be used. This library is wholly contained
+within this package, usually in the `intl/' subdirectory, so prior
+installation of the GNU `gettext' package is _not_ required.
+Installers may use special options at configuration time for changing
+the default behaviour. The commands:
+
+ ./configure --with-included-gettext
+ ./configure --disable-nls
+
+will, respectively, bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this. This might not be desirable. You should use
+the more recent version of the GNU `gettext' library. I.e. if the file
+`intl/VERSION' shows that the library which comes with this package is
+more recent, you should use
+
+ ./configure --with-included-gettext
+
+to prevent auto-detection.
+
+ The configuration process will not test for the `catgets' function
+and therefore it will not be used. The reason is that even an
+emulation of `gettext' on top of `catgets' could not provide all the
+extensions of the GNU `gettext' library.
+
+ Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.3 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
+and `CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.4 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
+area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `translation@iro.umontreal.ca' to reach the
+coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skill are praised more than
+programming skill, here.
+
+1.5 Available Packages
+======================
+
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of July
+2006. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo
+ +----------------------------------------------------+
+ GNUnet | [] |
+ a2ps | [] [] [] [] [] |
+ aegis | () |
+ ant-phone | () |
+ anubis | [] |
+ ap-utils | |
+ aspell | [] [] [] [] |
+ bash | [] [] [] |
+ batchelor | [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] |
+ bison | [] [] |
+ bison-runtime | [] |
+ bluez-pin | [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ console-tools | [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cpplib | [] [] [] |
+ cryptonit | [] |
+ darkstat | [] () [] |
+ dialog | [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] [] () [] |
+ fileutils | [] [] |
+ findutils | [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | |
+ gawk | [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] [] [] |
+ gip | [] |
+ gliv | [] |
+ glunarclock | [] |
+ gmult | [] [] |
+ gnubiff | () |
+ gnucash | () () [] |
+ gnucash-glossary | [] () |
+ gnuedu | |
+ gnulib | [] [] [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | [] [] |
+ gpe-clock | [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | |
+ gpe-edit | [] |
+ gpe-filemanager | |
+ gpe-go | [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] |
+ gpe-taskmanager | [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] [] |
+ gpe-todo | |
+ gphoto2 | [] [] [] [] |
+ gprof | [] [] |
+ gpsdrive | () () |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] |
+ gretl | |
+ gsasl | |
+ gss | |
+ gst-plugins | [] [] [] [] |
+ gst-plugins-base | [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] [] [] |
+ gtick | [] () |
+ gtkam | [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] |
+ id-utils | [] [] |
+ impost | |
+ indent | [] [] [] |
+ iso_3166 | [] [] |
+ iso_3166_1 | [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_3166_3 | [] |
+ iso_4217 | [] |
+ iso_639 | [] [] |
+ jpilot | [] |
+ jtag | |
+ jwhois | |
+ kbd | [] [] [] [] |
+ keytouch | |
+ keytouch-editor | |
+ keytouch-keyboa... | |
+ latrine | () |
+ ld | [] |
+ leafpad | [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | |
+ libiconv | [] [] |
+ libidn | [] [] |
+ lifelines | [] () |
+ lilypond | [] |
+ lingoteach | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] |
+ make | [] [] |
+ man-db | [] () [] [] |
+ minicom | [] [] [] |
+ mysecretdiary | [] [] |
+ nano | [] [] () [] |
+ nano_1_0 | [] () [] [] |
+ opcodes | [] |
+ parted | |
+ pilot-qof | [] |
+ psmisc | [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] |
+ sh-utils | [] [] |
+ shared-mime-info | [] [] [] |
+ sharutils | [] [] [] [] [] [] |
+ shishi | |
+ silky | |
+ skencil | [] () |
+ sketch | [] () |
+ solfege | |
+ soundtracker | [] [] |
+ sp | [] |
+ stardict | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] |
+ tin | () () |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ vorbis-tools | [] [] [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] |
+ wget | [] [] |
+ xchat | [] [] [] [] [] |
+ xkeyboard-config | |
+ xpad | [] [] |
+ +----------------------------------------------------+
+ af am ar az be bg bs ca cs cy da de el en en_GB eo
+ 11 0 1 2 8 21 1 42 43 2 62 99 18 1 16 16
+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ +--------------------------------------------------+
+ GNUnet | |
+ a2ps | [] [] [] () |
+ aegis | |
+ ant-phone | [] |
+ anubis | [] |
+ ap-utils | [] [] |
+ aspell | [] [] [] |
+ bash | [] [] [] |
+ batchelor | [] [] |
+ bfd | [] |
+ bibshelf | [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] [] [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ cflow | |
+ clisp | [] [] |
+ console-tools | |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] [] |
+ cryptonit | [] |
+ darkstat | [] () [] [] [] |
+ dialog | [] [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ error | [] [] [] [] [] |
+ fetchmail | [] |
+ fileutils | [] [] [] [] [] [] |
+ findutils | [] [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | [] [] |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] |
+ gliv | () |
+ glunarclock | [] [] [] |
+ gmult | [] [] [] |
+ gnubiff | () () |
+ gnucash | () () () |
+ gnucash-glossary | [] [] |
+ gnuedu | [] |
+ gnulib | [] [] [] [] [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] [] [] [] |
+ gpe-filemanager | [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] |
+ gphoto2 | [] [] [] [] [] |
+ gprof | [] [] [] [] |
+ gpsdrive | () () [] () |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] [] [] [] [] [] [] |
+ gretl | [] [] [] |
+ gsasl | [] |
+ gss | [] |
+ gst-plugins | [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] [] |
+ gstreamer | [] [] [] |
+ gtick | [] [] [] [] [] |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] [] [] |
+ impost | [] [] |
+ indent | [] [] [] [] [] [] [] [] [] [] |
+ iso_3166 | [] [] [] |
+ iso_3166_1 | [] [] [] [] [] [] [] |
+ iso_3166_2 | [] |
+ iso_3166_3 | [] |
+ iso_4217 | [] [] [] [] |
+ iso_639 | [] [] [] [] [] |
+ jpilot | [] [] |
+ jtag | [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | [] [] [] |
+ ld | [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] [] [] |
+ libgpg-error | |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | [] [] |
+ libiconv | [] |
+ libidn | [] [] |
+ lifelines | () |
+ lilypond | [] |
+ lingoteach | [] [] [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] |
+ man-db | () |
+ minicom | [] [] [] [] |
+ mysecretdiary | [] [] [] |
+ nano | [] () [] [] [] [] |
+ nano_1_0 | [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] [] |
+ pilot-qof | |
+ psmisc | [] [] [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] [] [] [] |
+ sh-utils | [] [] [] [] [] [] [] |
+ shared-mime-info | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] [] |
+ shishi | |
+ silky | [] |
+ skencil | [] [] |
+ sketch | [] [] |
+ solfege | [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ stardict | [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] [] [] |
+ texinfo | [] [] |
+ textutils | [] [] [] [] [] |
+ tin | [] () |
+ tp-robot | [] [] [] [] |
+ tuxpaint | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux | [] [] [] [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] [] [] [] [] |
+ wget | [] [] [] [] [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ es et eu fa fi fr ga gl gu he hi hr hu id is it
+ 89 21 16 2 41 119 61 14 1 8 1 6 61 30 0 53
+
+ ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
+ +--------------------------------------------------+
+ GNUnet | |
+ a2ps | () [] [] () |
+ aegis | () |
+ ant-phone | [] |
+ anubis | [] [] [] |
+ ap-utils | [] |
+ aspell | [] [] |
+ bash | [] |
+ batchelor | [] [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] |
+ bluez-pin | [] [] [] |
+ cflow | |
+ clisp | [] |
+ console-tools | |
+ coreutils | [] |
+ cpio | |
+ cpplib | [] |
+ cryptonit | [] |
+ darkstat | [] [] |
+ dialog | [] [] |
+ diffutils | [] [] [] |
+ doodle | |
+ e2fsprogs | [] |
+ enscript | [] |
+ error | [] |
+ fetchmail | [] [] |
+ fileutils | [] [] |
+ findutils | [] |
+ flex | [] [] |
+ fslint | [] [] |
+ gas | |
+ gawk | [] [] |
+ gbiff | [] |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] |
+ gettext-runtime | [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] |
+ gip | [] [] |
+ gliv | [] |
+ glunarclock | [] [] |
+ gmult | [] [] |
+ gnubiff | |
+ gnucash | () () |
+ gnucash-glossary | [] |
+ gnuedu | |
+ gnulib | [] [] [] [] |
+ gnunet-gtk | |
+ gnutls | |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | [] |
+ gpe-edit | [] [] |
+ gpe-filemanager | [] |
+ gpe-go | [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] |
+ gpe-package | [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] |
+ gpe-taskmanager | [] [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] |
+ gpe-todo | |
+ gphoto2 | [] [] |
+ gprof | |
+ gpsdrive | () () () |
+ gramadoir | () |
+ grep | [] [] [] |
+ gretl | |
+ gsasl | [] |
+ gss | |
+ gst-plugins | [] |
+ gst-plugins-base | |
+ gst-plugins-good | [] |
+ gstreamer | [] |
+ gtick | [] |
+ gtkam | [] |
+ gtkorphan | [] |
+ gtkspell | [] [] |
+ gutenprint | |
+ hello | [] [] [] [] [] [] [] [] |
+ id-utils | [] |
+ impost | |
+ indent | [] [] |
+ iso_3166 | [] |
+ iso_3166_1 | [] [] |
+ iso_3166_2 | [] |
+ iso_3166_3 | [] |
+ iso_4217 | [] [] [] |
+ iso_639 | [] [] |
+ jpilot | () () () |
+ jtag | |
+ jwhois | [] |
+ kbd | [] |
+ keytouch | [] |
+ keytouch-editor | |
+ keytouch-keyboa... | |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] |
+ libc | [] [] [] [] [] |
+ libexif | |
+ libextractor | |
+ libgpewidget | [] |
+ libgpg-error | |
+ libgphoto2 | [] |
+ libgphoto2_port | [] |
+ libgsasl | [] |
+ libiconv | |
+ libidn | [] [] |
+ lifelines | [] |
+ lilypond | |
+ lingoteach | [] |
+ lynx | [] [] |
+ m4 | [] [] |
+ mailutils | |
+ make | [] [] [] |
+ man-db | () |
+ minicom | [] |
+ mysecretdiary | [] |
+ nano | [] [] [] |
+ nano_1_0 | [] [] [] |
+ opcodes | [] |
+ parted | [] [] |
+ pilot-qof | |
+ psmisc | [] [] [] |
+ pwdutils | |
+ python | |
+ qof | |
+ radius | |
+ recode | [] |
+ rpm | [] [] |
+ screem | [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] |
+ sh-utils | [] [] |
+ shared-mime-info | [] [] [] [] [] |
+ sharutils | [] [] |
+ shishi | |
+ silky | [] |
+ skencil | |
+ sketch | |
+ solfege | |
+ soundtracker | |
+ sp | () |
+ stardict | [] [] |
+ system-tools-ba... | [] [] [] [] |
+ tar | [] [] [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] |
+ tin | |
+ tp-robot | [] |
+ tuxpaint | [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] |
+ vorbis-tools | [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] |
+ xchat | [] [] [] [] |
+ xkeyboard-config | [] |
+ xpad | [] [] [] |
+ +--------------------------------------------------+
+ ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no
+ 40 24 2 1 1 3 1 2 3 21 0 15 1 101 5 3
+
+ nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ +------------------------------------------------------+
+ GNUnet | |
+ a2ps | () [] [] [] [] [] [] |
+ aegis | () () |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ ap-utils | () |
+ aspell | [] [] |
+ bash | [] [] [] |
+ batchelor | [] [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] [] |
+ bison | [] [] [] [] [] |
+ bison-runtime | [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] [] |
+ cflow | [] |
+ clisp | [] |
+ console-tools | [] |
+ coreutils | [] [] [] [] |
+ cpio | [] [] [] |
+ cpplib | [] |
+ cryptonit | [] [] |
+ darkstat | [] [] [] [] [] [] |
+ dialog | [] [] [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] [] [] |
+ fileutils | [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ fslint | [] [] [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] [] |
+ gliv | [] [] [] [] |
+ glunarclock | [] [] [] [] [] [] |
+ gmult | [] [] [] [] |
+ gnubiff | () |
+ gnucash | () [] |
+ gnucash-glossary | [] [] [] |
+ gnuedu | |
+ gnulib | [] [] [] [] [] |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-calendar | [] [] [] [] [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] [] [] [] [] [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] [] [] [] |
+ gpe-login | [] [] [] [] [] [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] |
+ gphoto2 | [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] [] [] |
+ gretl | [] |
+ gsasl | [] [] |
+ gss | [] [] [] |
+ gst-plugins | [] [] [] [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] [] [] [] |
+ gstreamer | [] [] [] |
+ gtick | [] [] [] |
+ gtkam | [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] |
+ gutenprint | [] |
+ hello | [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] [] |
+ impost | [] |
+ indent | [] [] [] [] [] [] |
+ iso_3166 | [] [] [] [] [] [] |
+ iso_3166_1 | [] [] [] [] |
+ iso_3166_2 | |
+ iso_3166_3 | [] [] [] [] |
+ iso_4217 | [] [] [] [] |
+ iso_639 | [] [] [] [] |
+ jpilot | |
+ jtag | [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ latrine | [] [] |
+ ld | [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | [] [] |
+ libgpewidget | [] [] [] [] [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] |
+ libiconv | |
+ libidn | [] [] () |
+ lifelines | [] [] |
+ lilypond | |
+ lingoteach | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailutils | [] [] [] [] |
+ make | [] [] [] [] |
+ man-db | [] [] |
+ minicom | [] [] [] [] [] |
+ mysecretdiary | [] [] [] [] |
+ nano | [] [] |
+ nano_1_0 | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] |
+ pilot-qof | [] |
+ psmisc | [] [] |
+ pwdutils | [] [] |
+ python | |
+ qof | [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] |
+ rpm | [] [] [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] |
+ shared-mime-info | [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ silky | [] |
+ skencil | [] [] [] |
+ sketch | [] [] [] |
+ solfege | [] |
+ soundtracker | [] [] |
+ sp | |
+ stardict | [] [] [] |
+ system-tools-ba... | [] [] [] [] [] [] [] [] [] |
+ tar | [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ textutils | [] [] [] |
+ tin | () |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | |
+ wdiff | [] [] [] [] [] [] |
+ wget | [] [] [] [] |
+ xchat | [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] |
+ xpad | [] [] [] |
+ +------------------------------------------------------+
+ nso or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
+ 0 2 3 58 31 53 5 76 72 5 42 48 12 51 130 2
+
+ tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ +---------------------------------------------------+
+ GNUnet | [] | 2
+ a2ps | [] [] [] | 19
+ aegis | | 0
+ ant-phone | [] [] | 6
+ anubis | [] [] [] | 11
+ ap-utils | () [] | 4
+ aspell | [] [] [] | 14
+ bash | [] | 11
+ batchelor | [] [] | 9
+ bfd | | 1
+ bibshelf | [] | 7
+ binutils | [] [] [] | 9
+ bison | [] [] [] | 19
+ bison-runtime | [] [] [] | 16
+ bluez-pin | [] [] [] [] [] [] | 28
+ cflow | [] [] | 4
+ clisp | | 6
+ console-tools | [] [] | 5
+ coreutils | [] [] | 17
+ cpio | [] [] [] | 9
+ cpplib | [] [] [] [] | 11
+ cryptonit | | 5
+ darkstat | [] () () | 15
+ dialog | [] [] [] [] [] | 30
+ diffutils | [] [] [] [] | 28
+ doodle | [] | 6
+ e2fsprogs | [] [] | 10
+ enscript | [] [] [] | 16
+ error | [] [] [] [] | 18
+ fetchmail | [] [] | 12
+ fileutils | [] [] [] | 18
+ findutils | [] [] [] | 17
+ flex | [] [] | 15
+ fslint | [] | 9
+ gas | [] | 3
+ gawk | [] [] | 15
+ gbiff | [] | 5
+ gcal | [] | 5
+ gcc | [] [] [] | 6
+ gettext-examples | [] [] [] [] [] [] | 26
+ gettext-runtime | [] [] [] [] [] [] | 28
+ gettext-tools | [] [] [] [] [] | 19
+ gimp-print | [] [] | 12
+ gip | [] [] | 12
+ gliv | [] [] | 8
+ glunarclock | [] [] [] | 15
+ gmult | [] [] [] [] | 15
+ gnubiff | [] | 1
+ gnucash | () | 2
+ gnucash-glossary | [] [] | 9
+ gnuedu | [] | 2
+ gnulib | [] [] [] [] [] | 28
+ gnunet-gtk | | 1
+ gnutls | | 2
+ gpe-aerial | [] [] | 14
+ gpe-beam | [] [] | 14
+ gpe-calendar | [] [] [] [] | 19
+ gpe-clock | [] [] [] [] | 20
+ gpe-conf | [] [] | 14
+ gpe-contacts | [] [] | 10
+ gpe-edit | [] [] [] [] | 19
+ gpe-filemanager | [] | 5
+ gpe-go | [] [] | 14
+ gpe-login | [] [] [] [] [] | 20
+ gpe-ownerinfo | [] [] [] [] | 20
+ gpe-package | [] | 5
+ gpe-sketchbook | [] [] | 16
+ gpe-su | [] [] [] | 19
+ gpe-taskmanager | [] [] [] | 19
+ gpe-timesheet | [] [] [] [] | 18
+ gpe-today | [] [] [] [] [] | 20
+ gpe-todo | [] | 6
+ gphoto2 | [] [] [] [] | 20
+ gprof | [] [] | 11
+ gpsdrive | | 4
+ gramadoir | [] | 7
+ grep | [] [] [] [] | 33
+ gretl | | 4
+ gsasl | [] [] | 6
+ gss | [] | 5
+ gst-plugins | [] [] [] | 15
+ gst-plugins-base | [] [] [] | 9
+ gst-plugins-good | [] [] [] | 18
+ gstreamer | [] [] [] | 17
+ gtick | [] | 11
+ gtkam | [] | 13
+ gtkorphan | [] | 7
+ gtkspell | [] [] [] [] [] [] | 26
+ gutenprint | | 3
+ hello | [] [] [] [] [] | 39
+ id-utils | [] [] | 14
+ impost | [] | 4
+ indent | [] [] [] [] | 25
+ iso_3166 | [] [] [] | 15
+ iso_3166_1 | [] [] | 20
+ iso_3166_2 | | 2
+ iso_3166_3 | [] [] | 9
+ iso_4217 | [] [] | 14
+ iso_639 | [] | 14
+ jpilot | [] [] [] [] | 7
+ jtag | [] | 3
+ jwhois | [] [] [] | 13
+ kbd | [] [] | 12
+ keytouch | [] | 4
+ keytouch-editor | | 2
+ keytouch-keyboa... | | 2
+ latrine | [] [] | 8
+ ld | [] [] [] [] | 8
+ leafpad | [] [] [] [] | 23
+ libc | [] [] [] | 23
+ libexif | [] | 4
+ libextractor | [] | 5
+ libgpewidget | [] [] [] | 19
+ libgpg-error | [] | 4
+ libgphoto2 | [] | 8
+ libgphoto2_port | [] [] [] | 11
+ libgsasl | [] | 8
+ libiconv | [] | 4
+ libidn | [] [] | 10
+ lifelines | | 4
+ lilypond | | 2
+ lingoteach | [] | 6
+ lynx | [] [] [] | 15
+ m4 | [] [] [] | 18
+ mailutils | [] | 8
+ make | [] [] [] | 20
+ man-db | [] | 6
+ minicom | [] | 14
+ mysecretdiary | [] [] | 12
+ nano | [] [] | 15
+ nano_1_0 | [] [] [] | 18
+ opcodes | [] [] | 10
+ parted | [] [] [] | 10
+ pilot-qof | [] | 3
+ psmisc | [] | 10
+ pwdutils | [] | 3
+ python | | 0
+ qof | [] | 2
+ radius | [] | 6
+ recode | [] [] [] | 25
+ rpm | [] [] [] [] | 14
+ screem | [] | 2
+ scrollkeeper | [] [] [] [] | 26
+ sed | [] [] [] | 22
+ sh-utils | [] | 15
+ shared-mime-info | [] [] [] [] | 23
+ sharutils | [] [] [] | 23
+ shishi | | 1
+ silky | [] | 4
+ skencil | [] | 7
+ sketch | | 6
+ solfege | | 2
+ soundtracker | [] [] | 9
+ sp | [] | 3
+ stardict | [] [] [] [] | 11
+ system-tools-ba... | [] [] [] [] [] [] [] | 37
+ tar | [] [] [] [] | 19
+ texinfo | [] [] [] | 15
+ textutils | [] [] [] | 17
+ tin | | 1
+ tp-robot | [] [] [] | 10
+ tuxpaint | [] [] [] | 16
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux | [] [] [] | 20
+ vorbis-tools | [] [] | 11
+ wastesedge | | 1
+ wdiff | [] [] | 22
+ wget | [] [] [] | 19
+ xchat | [] [] [] [] | 28
+ xkeyboard-config | [] [] [] [] | 11
+ xpad | [] [] [] | 14
+ +---------------------------------------------------+
+ 77 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ 172 domains 0 1 1 78 39 0 135 13 1 50 3 54 0 2054
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If July 2006 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
+matrix with full percentage details can be found at
+`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
+
+1.6 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`translation@iro.umontreal.ca' to make the `.pot' files available to
+the translation teams.
+
diff --git a/ACKNOWLEDGEMENTS b/ACKNOWLEDGEMENTS
new file mode 100644
index 0000000..af29c15
--- /dev/null
+++ b/ACKNOWLEDGEMENTS
@@ -0,0 +1,39 @@
+This file contains the origin of code copied verbatim into some or all of the Monitoring Plugins.
+
+The Monitoring Plugins team thanks the original authors.
+
+Copied code is cited in the source by indented comments of the form
+
+ .. indent level .. /* Author YYYY sub-citation see ACKNOWLEDGEMENTS */
+
+.. copied code
+ /* Author YYYY sub-citation */
+
+King, Alecs 2004
+getmac.c posted at http://lists.freebsd.org/pipermail/freebsd-hackers/2004-June/007415.html
+The sysctl interface to the *BSD kernel is used to get the host MAC address in check_dhcp.c
+
+Kompf, Martin 200-2003 Copyright the author
+http://cplus.kompf.de/macaddr.html
+Using the DLPI support on SysV systems to get the host MAC address in check_dhcp.c
+
+Stenberg, Daniel
+Copyright (c) 1996 - 2004, Daniel Stenberg, <daniel@haxx.se>
+http://curl.haxx.se/
+Use of duplication of macros in m4/np_curl.m4 (slightly adapted for m4/uriparser.m4 too)
+
+Coreutils team
+Copyright (C) 91, 1995-2004 Free Software Foundation, Inc.
+http://www.gnu.org/software/coreutils/
+Use of macros and lib files in m4/np_coreutils.m4 and lib/. Setuid installs in plugins-root
+
+Gnulib team
+Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc
+http://www.gnu.org/software/gnulib/
+Use of lib files that originally were used from coreutils
+
+Copyright (c) 2009-2014 Kazuho Oku, Tokuhiro Matsuno, Daisuke Murase,
+ Shigeo Mitsunari
+picohttpparser
+https://github.com/h2o/picohttpparser
+Use of the library for HTTP header parsing in check_curl.
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..1b1a036
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,26 @@
+The Monitoring Plugins are brought to you by the Monitoring Plugins Development Team.
+
+Jeremy T. Bouse
+Peter Bray
+Gavin Carr
+Karl DeBisschop
+Matthias Eble
+Ethan Galstad
+Sean Finney
+Subhendu Ghosh
+Thomas Guyot-Sionnest
+Stanley Hopcroft
+Matthew Kent
+Sam Kottler
+Harper Mann
+Benoit Mortier
+Sven Nierlein
+Eric Stanley
+Nathan Vonnahme
+Ton Voon
+Jan Wagner
+Holger Weiss
+Michael Wirtgen
+Oliver Skibbe
+Andreas Baumann
+Lorenz Kästle
diff --git a/CODING b/CODING
new file mode 100644
index 0000000..74438e7
--- /dev/null
+++ b/CODING
@@ -0,0 +1,116 @@
+The following guidelines are intended to aid programmers in creating
+code that is consistent with the existing core plugins.
+
+The primary goals of these standards are internal consistency, and
+readability in a wide range of environments.
+
+
+1. C Language Programming
+
+All code should comply with the requirements of the Free Software
+Foundation Coding standards (which are currently available at
+http://www.gnu.org/prep/standards_toc.html). We also follow most of
+the FSF guidelines. Developers may suggest deviations from the FSF
+style recommendations, which will be considered by open discussion on
+the Monitoring Plugins devel mailing list. Any such deviations will
+apply to the entire code base to ensure consistency.
+
+Currently, the exceptions to FSF recommendations are roughly equivalent
+to GNU indent with invoked as 'indent -ts 2 -br'. Specifically, the
+exceptions are as follows:
+
+a) leading white space for a statement should be formatted as tabs,
+with one tab for each code indentation level.
+
+b) in statement continuation lines, format whitespace up to the column
+starting the statement as tabs, format the rest as spaces (this
+results in code that is legible regardless of tab-width setting).
+
+c) with the exception of the above, tabs should generally be avoided
+
+d) when tab width is 2 spaces, line-length should not exceed 80
+characters
+
+e) The opening brace of an if or while block is on the same line as
+the end of the conditional expression (the '-br' option).
+
+
+2. Perl Language Programming
+
+Taken from the O'Reilly book "Programming Perl" (3rd edition, pages 604-606) with
+modifications for clarity and to cohere with C coding standards.
+
+*) Always check the return code of system calls.
+
+a) Use tab indentation.
+
+b) Put space before the opening brace of a multiline block.
+
+c) A short block may be put on one line, including braces.
+
+d) Never omit the semicolon.
+
+e) Surround most operators with space.
+
+ $x = 5; # do this
+ $y=5; # don't do this
+
+f) Surround a "complex" subscript (inside brackets) with space.
+
+g) Put empty lines between chunks of code that do different things.
+
+*) Always check the return code of system calls.
+
+h) Put a newline between closing brace and else or elsif.
+
+i) Do not put space between a function name and its opening parenthesis.
+
+j) Do not put space before a semicolon.
+
+k) Put space after each comma.
+
+l) Break long lines after an operator (but before 'and' and 'or', even when
+spelled as && and ||)).
+
+*) Always check the return code of system calls.
+
+m) Line up corresponding items vertically.
+
+n) Use redundant parentheses only where it increases readability.
+
+o) An opening brace should be put on the same line as its preceding keyword,
+if possible; otherwise, line them up vertically.
+
+ while ($condition) {
+ # do something
+ }
+
+ while ($this_condition and $that_condition and $some_other_condition
+ and $this_really_really_really_long_condition)
+ {
+ # do something
+ }
+
+p) Do things the most readable way. For instance:
+
+ open(FOO, $foo) or die "Can't open $foo: $!";
+
+is better than
+
+ die "Can't open $foo: $!" unless open(FOO, $foo);
+
+because the second way hides the main point of the statement in a modifier.
+
+q) Just because an operator lets you assume default arguments doesn't mean
+that you should always use them. The defaults are there for lazy programmers
+writing one-shot, non-shared programs. If you want your program to be readable,
+consider supplying the argument.
+
+r) Choose mnemonic identifiers. That is, don't name your variables $h, $c
+and $w. Try $hostaddress, $critical and $warning instead ($host, $crit and
+$warn is OK too).
+
+s) Use underscore to split words in long identifiers. That is, use
+$service_port instead of $ServicePort as the former is much more readable.
+
+*) Always check the return code of system calls.
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..1e3d4bb
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1 @@
+Not a Git repository, so I won't update the ChangeLog.
diff --git a/FAQ b/FAQ
new file mode 100644
index 0000000..be8e7af
--- /dev/null
+++ b/FAQ
@@ -0,0 +1,55 @@
+Frequently Asked Questions
+**************************
+
+Q: Where can I find documentation for <insert name> plugin?
+
+A: All plugins that comply with minimal development guideline for
+ this project include internal documentation. The documentation
+ can be read executing plugin with the -h or --help option. If
+ the '-h' option does not work, that is a bug.
+
+
+Q: What version of <insert name> plugin am I running?
+
+A: All plugins that comply with minimal development guideline for
+ this project include detailed version information. When executed
+ with the '-V' option, a version string will be printed:
+
+ check_radius v1.4.16 (monitoring-plugins 1.4.16)
+
+ All bug reports and help requests should reference this
+ information.
+
+
+Q: What information do I need to include when asking for help or
+ submitting a bug report?
+
+A: At a minimum, the output from 'uname -a' and the version string
+ from '<plugin_name> -V' and, of course, a description of the
+ problem and any solution/patch.
+
+
+Q: I get an error like
+
+ Warning: Return code of 127 for check of service 'PING' on host 'anyhost' was out of bounds.
+
+ when I run Nagios. (Often check_ping runs just fine on the
+ command line).
+
+A: Commonly, system administrators will make security as tight as
+ possible on the monitoring system. Sometimes this includes OS
+ options or hardening scripts that prevent unprivileged users from
+ running the ping command. Nagios runs with no more privileges
+ than 'nobody' -- check to be sure that the nagios user can
+ actually run check ping. (This can also happen with other binaries
+ executed by nagios, but ping seems to be far and away the biggest
+ offender.)
+
+
+Q: I have a plugin to offer. What can I do?
+
+A: You can make it available on MonitoringExchange (http://monitoringexchange.org)
+ where other people can find it for use.
+
+ You can also get feedback on improving the plugin via the
+ devel@monitoring-plugins.org mailing list.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..8865734
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,368 @@
+Installation Instructions
+*************************
+
+ Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
+Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
+
+Basic Installation
+==================
+
+ Briefly, the shell command './configure && make && make install'
+should configure, build, and install this package. The following
+more-detailed instructions are generic; see the 'README' file for
+instructions specific to this package. Some packages provide this
+'INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+ The 'configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a 'Makefile' in each directory of the package.
+It may also create one or more '.h' files containing system-dependent
+definitions. Finally, it creates a shell script 'config.status' that
+you can run in the future to recreate the current configuration, and a
+file 'config.log' containing compiler output (useful mainly for
+debugging 'configure').
+
+ It can also use an optional file (typically called 'config.cache' and
+enabled with '--cache-file=config.cache' or simply '-C') that saves the
+results of its tests to speed up reconfiguring. Caching is disabled by
+default to prevent problems with accidental use of stale cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how 'configure' could check whether to do them, and mail
+diffs or instructions to the address given in the 'README' so they can
+be considered for the next release. If you are using the cache, and at
+some point 'config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file 'configure.ac' (or 'configure.in') is used to create
+'configure' by a program called 'autoconf'. You need 'configure.ac' if
+you want to change it or regenerate 'configure' using a newer version of
+'autoconf'.
+
+ The simplest way to compile this package is:
+
+ 1. 'cd' to the directory containing the package's source code and type
+ './configure' to configure the package for your system.
+
+ Running 'configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type 'make' to compile the package.
+
+ 3. Optionally, type 'make check' to run any self-tests that come with
+ the package, generally using the just-built uninstalled binaries.
+
+ 4. Type 'make install' to install the programs and any data files and
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the 'make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type 'make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior 'make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing 'make clean'. To also remove the
+ files that 'configure' created (so you can compile the package for
+ a different kind of computer), type 'make distclean'. There is
+ also a 'make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 7. Often, you can also type 'make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide 'make
+ distcheck', which can by used by developers to test that all other
+ targets like 'make install' and 'make uninstall' work correctly.
+ This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the 'configure' script does not know about. Run './configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give 'configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here is
+an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU 'make'. 'cd' to the
+directory where you want the object files and executables to go and run
+the 'configure' script. 'configure' automatically checks for the source
+code in the directory that 'configure' is in and in '..'. This is known
+as a "VPATH" build.
+
+ With a non-GNU 'make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use 'make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple '-arch' options to the
+compiler but only a single '-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the 'lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, 'make install' installs the package's commands under
+'/usr/local/bin', include files under '/usr/local/include', etc. You
+can specify an installation prefix other than '/usr/local' by giving
+'configure' the option '--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like '--bindir=DIR' to specify different values for particular
+kinds of files. Run 'configure --help' for a list of the directories
+you can set and what kinds of files go in them. In general, the default
+for these options is expressed in terms of '${prefix}', so that
+specifying just '--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to 'configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+'make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, 'make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+'${prefix}'. Any directories that were specified during 'configure',
+but not in terms of '${prefix}', must each be overridden at install time
+for the entire installation to be relocated. The approach of makefile
+variable overrides for each directory variable is required by the GNU
+Coding Standards, and ideally causes no recompilation. However, some
+platforms have known limitations with the semantics of shared libraries
+that end up requiring recompilation when using this method, particularly
+noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the 'DESTDIR' variable. For
+example, 'make install DESTDIR=/alternate/directory' will prepend
+'/alternate/directory' before all installation names. The approach of
+'DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of '${prefix}'
+at 'configure' time.
+
+Optional Features
+=================
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving 'configure' the
+option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
+
+ Some packages pay attention to '--enable-FEATURE' options to
+'configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to '--with-PACKAGE' options, where PACKAGE
+is something like 'gnu-as' or 'x' (for the X Window System). The
+'README' should mention any '--enable-' and '--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, 'configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the 'configure' options '--x-includes=DIR' and
+'--x-libraries=DIR' to specify their locations.
+
+ Some packages offer the ability to configure how verbose the
+execution of 'make' will be. For these packages, running './configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with 'make V=1'; while running './configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with 'make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
+is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ HP-UX 'make' updates targets which have the same time stamps as their
+prerequisites, which makes it generally unusable when shipped generated
+files such as 'configure' are involved. Use GNU 'make' instead.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
+workaround. If GNU CC is not installed, it is therefore recommended to
+try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
+in your 'PATH', put it _after_ '/usr/bin'.
+
+ On Haiku, software installed for all users goes in '/boot/common',
+not '/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features 'configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, 'configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+'--build=TYPE' option. TYPE can either be a short name for the system
+type, such as 'sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file 'config.sub' for the possible values of each field. If
+'config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option '--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with '--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for 'configure' scripts to share,
+you can create a site shell script called 'config.site' that gives
+default values for variables like 'CC', 'cache_file', and 'prefix'.
+'configure' looks for 'PREFIX/share/config.site' if it exists, then
+'PREFIX/etc/config.site' if it exists. Or, you can set the
+'CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all 'configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to 'configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the 'configure' command line, using 'VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified 'gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
+Autoconf limitation. Until the limitation is lifted, you can use this
+workaround:
+
+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+'configure' Invocation
+======================
+
+ 'configure' recognizes the following options to control how it
+operates.
+
+'--help'
+'-h'
+ Print a summary of all of the options to 'configure', and exit.
+
+'--help=short'
+'--help=recursive'
+ Print a summary of the options unique to this package's
+ 'configure', and exit. The 'short' variant lists options used only
+ in the top level, while the 'recursive' variant lists options also
+ present in any nested packages.
+
+'--version'
+'-V'
+ Print the version of Autoconf used to generate the 'configure'
+ script, and exit.
+
+'--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally 'config.cache'. FILE defaults to '/dev/null' to
+ disable caching.
+
+'--config-cache'
+'-C'
+ Alias for '--cache-file=config.cache'.
+
+'--quiet'
+'--silent'
+'-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to '/dev/null' (any error
+ messages will still be shown).
+
+'--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ 'configure' can determine that directory automatically.
+
+'--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names:: for
+ more details, including other options available for fine-tuning the
+ installation locations.
+
+'--no-create'
+'-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+'configure' also accepts some other, not widely useful, options. Run
+'configure --help' for more details.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..fe9c564
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,63 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = gl tap lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@
+
+EXTRA_DIST = config.rpath \
+ ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ NEWS \
+ NP-VERSION-GEN REQUIREMENTS SUPPORT THANKS \
+ NPTest.pm pkg \
+ config_test/Makefile config_test/run_tests config_test/child_test.c \
+ tools/build_perl_modules \
+ tools/tinderbox_build
+
+ACLOCAL_AMFLAGS = -I gl/m4 -I m4
+
+localedir = $(datadir)/locale
+DEFS = -DLOCALEDIR=\"$(localedir)\"
+
+#
+# The ChangeLog file is auto-generated from the Git history. We let it depend
+# on NP-VERSION-GEN, as we bump our version number in that file.
+#
+ChangeLog: NP-VERSION-GEN
+ $(top_srcdir)/tools/generate-change-log > $@
+
+dist-hook:
+ $(MAKE) THANKS
+ echo ${VERSION} >$(distdir)/release
+
+install-root:
+ cd plugins-root && $(MAKE) $@
+
+test test-debug:
+ cd lib && $(MAKE) $@
+ if test "$(PERLMODS_DIR)" != ""; then cd && $(MAKE) $@; fi
+ cd plugins && $(MAKE) $@
+ cd plugins-scripts && $(MAKE) $@
+ cd plugins-root && $(MAKE) $@
+
+# Solaris pkgmk
+BUILDDIR = build-solaris
+PACKDIR = build-pkg
+PKGSCRIPT = pkg/solaris/solpkg
+
+solpkg:
+ if [ ! -d $(BUILDDIR) ] ; then mkdir $(BUILDDIR); fi
+ if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
+ $(MAKE) all
+ $(MAKE) DESTDIR=$$PWD/$(BUILDDIR) install
+ $(INSTALL) plugins-root/pst3 $(BUILDDIR)$(libexecdir)
+ $(INSTALL) pkg/solaris/pkginfo $(BUILDDIR)
+ $(INSTALL) pkg/solaris/preinstall $(BUILDDIR)
+ cd $(BUILDDIR) && $(PERL) ../$(PKGSCRIPT) ../$(PACKDIR)
+
+THANKS: THANKS.in
+ @echo "This software is brought to you by the Monitoring Plugins Development Team. However," > $@
+ @echo "there have been many contributors to this project. Everyone below has helped in " >> $@
+ @echo "raising bug reports, creating patches or contributing new plugins." >> $@
+ @echo "" >> $@
+ perl -e ' while (<>) { print STDERR "Duplicate: $$_",$$/ if ($$a{$$_}) ; $$a{$$_}++}; print sort by_last_field (keys %a); sub by_last_field { ($$a1) = $$a =~ /\s(\w+)$$/; ($$b1) = $$b =~ /\s(\w+)$$/; $$a1 cmp $$b1}' $? >> $@
+
+pkgclean:
+ rm -rf $(BUILDDIR) $(PACKDIR)
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..4ec5c1c
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,2325 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = test.pl pkg/solaris/pkginfo
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope distdir distdir-am dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+ config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/test.pl.in $(top_srcdir)/build-aux/config.guess \
+ $(top_srcdir)/build-aux/config.rpath \
+ $(top_srcdir)/build-aux/config.sub \
+ $(top_srcdir)/build-aux/install-sh \
+ $(top_srcdir)/build-aux/ltmain.sh \
+ $(top_srcdir)/build-aux/missing \
+ $(top_srcdir)/build-aux/mkinstalldirs \
+ $(top_srcdir)/pkg/solaris/pkginfo.in ABOUT-NLS AUTHORS COPYING \
+ ChangeLog INSTALL NEWS README THANKS build-aux/config.guess \
+ build-aux/config.rpath build-aux/config.sub \
+ build-aux/install-sh build-aux/ltmain.sh build-aux/missing \
+ build-aux/mkinstalldirs config.rpath mkinstalldirs
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = -DLOCALEDIR=\"$(localedir)\"
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = $(datadir)/locale
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+SUBDIRS = gl tap lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@
+EXTRA_DIST = config.rpath \
+ ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ NEWS \
+ NP-VERSION-GEN REQUIREMENTS SUPPORT THANKS \
+ NPTest.pm pkg \
+ config_test/Makefile config_test/run_tests config_test/child_test.c \
+ tools/build_perl_modules \
+ tools/tinderbox_build
+
+ACLOCAL_AMFLAGS = -I gl/m4 -I m4
+
+# Solaris pkgmk
+BUILDDIR = build-solaris
+PACKDIR = build-pkg
+PKGSCRIPT = pkg/solaris/solpkg
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+test.pl: $(top_builddir)/config.status $(srcdir)/test.pl.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+pkg/solaris/pkginfo: $(top_builddir)/config.status $(top_srcdir)/pkg/solaris/pkginfo.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=../.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-cscope clean-generic \
+ clean-libtool cscope cscopelist-am ctags ctags-am dist \
+ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
+ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+#
+# The ChangeLog file is auto-generated from the Git history. We let it depend
+# on NP-VERSION-GEN, as we bump our version number in that file.
+#
+ChangeLog: NP-VERSION-GEN
+ $(top_srcdir)/tools/generate-change-log > $@
+
+dist-hook:
+ $(MAKE) THANKS
+ echo ${VERSION} >$(distdir)/release
+
+install-root:
+ cd plugins-root && $(MAKE) $@
+
+test test-debug:
+ cd lib && $(MAKE) $@
+ if test "$(PERLMODS_DIR)" != ""; then cd && $(MAKE) $@; fi
+ cd plugins && $(MAKE) $@
+ cd plugins-scripts && $(MAKE) $@
+ cd plugins-root && $(MAKE) $@
+
+solpkg:
+ if [ ! -d $(BUILDDIR) ] ; then mkdir $(BUILDDIR); fi
+ if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
+ $(MAKE) all
+ $(MAKE) DESTDIR=$$PWD/$(BUILDDIR) install
+ $(INSTALL) plugins-root/pst3 $(BUILDDIR)$(libexecdir)
+ $(INSTALL) pkg/solaris/pkginfo $(BUILDDIR)
+ $(INSTALL) pkg/solaris/preinstall $(BUILDDIR)
+ cd $(BUILDDIR) && $(PERL) ../$(PKGSCRIPT) ../$(PACKDIR)
+
+THANKS: THANKS.in
+ @echo "This software is brought to you by the Monitoring Plugins Development Team. However," > $@
+ @echo "there have been many contributors to this project. Everyone below has helped in " >> $@
+ @echo "raising bug reports, creating patches or contributing new plugins." >> $@
+ @echo "" >> $@
+ perl -e ' while (<>) { print STDERR "Duplicate: $$_",$$/ if ($$a{$$_}) ; $$a{$$_}++}; print sort by_last_field (keys %a); sub by_last_field { ($$a1) = $$a =~ /\s(\w+)$$/; ($$b1) = $$b =~ /\s(\w+)$$/; $$a1 cmp $$b1}' $? >> $@
+
+pkgclean:
+ rm -rf $(BUILDDIR) $(PACKDIR)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..5ddadf4
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,713 @@
+This file documents the major additions and syntax changes between releases.
+
+2.3.5 18th Oct 2023
+ FIXES
+ * Include maxfd.h in lib Makefile
+
+2.3.4 18th Oct 2023
+ ENHANCEMENTS
+ * check_curl: added --cookie-jar and doing proper cleanup of libcurl
+ * check_curl: Include all IPs from getaddrinfo() in curl DNS cache
+ * check_dhcp: Add dhcp rogue detection
+ * check_disk: add ignore-missing option to return OK for missing fs
+ * check_disk_smb: allow checking 0-sized resource (ex. IPC$)
+ * check_disk: The options to include or exclude specific file systems now allow the usage of regex(7)
+ * check_icmp: Add support to Jitter, MOS and Score
+ * check_mysql: Detect running mysqldump and handle it more gracefully
+ * check_procs: Implement --exclude-process to exclude specific processes
+ * check_smtp: add new longoption --tls
+ * check_smtp: Add option to prefix PROXY header
+ * check_smtp: Add support for SMTP over TLS
+ * check_smtp: Add support for SNI
+ * check_snmp: Implement option to ignore mib file parsing errors
+ * check_users: prefer systemd-logind over utmp
+
+ FIXES
+ * check_disk: Display SI units correctly
+ * check_ircd: use pack_sockaddr_in rather than hand-rolled
+ * check_log/check_oracle/check_sensors: fixed the outputs of the help functionality
+ * check_mysql: Add mysql_close to avoid spamming the server logs
+ * check_smtp: add missing -r option in usage
+ * check_snmp: disable multiplier when unused
+ * check_wave: Use compile time determined path to snmpget
+
+ GENERAL
+ * Sync with the Gnulib code 668c0b8ffa
+ * Set autoconf prerequisite version to 2.64
+ * Remove sha1 and use sha256 in some parts of the plugin structure
+ * A lot of compiler warnings were fixed
+ * Some code was refactored a little bit
+
+2.3.3 2nd Feb 2023
+ ENHANCEMENTS
+ using PRId64 and PRIu64 instead of %ld directly
+ check_http: Make faster with larger files
+ check_snmp: add 'multiplier' to modify current value
+ check_http: Implement chunked encoding decoding
+ check_http/check_curl: add chunked encoding test
+ check_log: Added --exclude to exclude patterns
+ check_log: Add tests
+ check_disk: Clarify usage possibilities
+
+ FIXES
+ fixed two PRId64 to PRIu64 in perfdata_uint64
+ check_pgsql: Removing is_pg_dbname altogether,using postgres API.
+ check_http: Remove superfluous CRLF in HTTP-Requests
+ check_curl: detect ipv6
+ check_icmp: fix parsing help/version long options
+ check_http: fix test plan
+ check_disk: Find accessible mount path if multiple are available
+ check_apt: Fix unknown escape sequence error output
+ check_curl: fix checking large bodys
+ check_snmp: Improve tests for check_snmp & multiply option
+ check_snmp: always apply format when applying multiplier
+ check_http: Use real booleans instead of ints
+ check_http: Document process_arguments a little bit better
+ check_http: Remove dead code
+ check_http: Fix several bug in the implementation of unchunking
+ check_http: Reformat a part to increase readability
+ check_apt: Put upgrade options in the root sections
+ check_apt: Fix comment
+ check_apt: Use real booleans
+ check_mailq: Fixing nullmailer regex
+ check_snmp: Fix regex matches
+ check_log: Fixed a bug when using --all
+ check_log: Cleaned up duplicated code in the args
+ check_http: Fix memory reallocation error in chunk decoding logic
+ check_http: Add space for ending NULL byte in array for chunked encoding
+
+2.3.2 20th Oct 2022
+ GENERAL
+ Use netcat-openbsd for debian explicitly (by @RincewindsHat #1704)
+ Replace egrep with grep -E (by @RincewindsHat #1791)
+ Use silent automake by default (by @RincewindsHat #1747)
+
+ SINGLE PLUGINS
+ check_by_ssh: added option to exit with an warning, if there is output on STDERR (by @nafets #1301)
+ check_by_ssh: Add "-U" flag (#1123). (by @archiecobbs #1774)
+ check_by_ssh: Let ssh decide if a host is valid, enables usage of ssh .config file (by @RincewindsHat #1691)
+ check_curl: Add an option to check_curl to verify the peer certificate & host using the system CA's (by @bazzisoft #1669)
+ check_curl: fixed -ffollow for HTTP/2.0 (Fixes #1685): added major_version parsing to PicoHTTPParser (by @andreasbaumann #1742)
+ check_curl: fixes check_curl: "CRITICAL - Cannot retrieve certificate subject." (by @andreasbaumann #1689)
+ check_curl: fix if http header contains leading spaces (by @sni #1666)
+ check_curl: Update check_curl.c to display a specific human-readable error message where possible (by @bazzisoft #1668)
+ check_curl: verify certificates option should not force SSL to be used (by @bazzisoft #1688)
+ check_disk: Description for -M was the wrong way around (by @RincewindsHat #1746)
+ check_disk: Fixing the stuff that is broken on btrfs (by @waja #1388)
+ check_disk: Fix perfdata for big values for check disk (by @RincewindsHat #1714)
+ check_disk_smb: Add configfile feature (by @Napsty #1402)
+ check_disk_smb: Add timeout (by @cdruee #1770)
+ check_dns: Add --expect-nxdomain (by @Jonny007-MKD #1623)
+ check_dns: split multiple IP addresses passed in one -a argument (by @DerDakon #1649)
+ check_file_age: Make size parameter a little bit more intelligible (by @RincewindsHat #1730)
+ check_fping: Implements 'host-alive' mode (Closes. #1027) (by @waja #1740)
+ check_game: Update Url to qstat (by @RincewindsHat #1725)
+ check_http: changed 'STATE_CRITICAL' to 'STATE_WARNING' for infinite loop (by @xFuture603 #1690)
+ check_http: Increase regexp limit (by @hydrapolic #1566)
+ check_http: Support http redirect (by @waja #1449)
+ check_icmp: buffer offerflow (by @RincewindsHat #1733)
+ check_icmp: delay set_source_ip() until address_family is detected (by @ghciv6 #1735)
+ check_icmp: Fix "Invalid Argument" from sendmsg() under FreeBSD 13.1 and "setsockopt failed" for TTL setting (by @eriksejr #1771)
+ check_icmp: Fix pkt perfdata in check_host mode (by @sjoegren #1721)
+ check_ldap: Allows check_ldap to read password from environment variable (by @mullumaus #1724)
+ check_load: add LOAD prefix to load plugin (by @haraldj #1694)
+ check_load: Display total and scaled load values if check_load scales the values (by number of CPUs by @RincewindsHat #1778)
+ check_log: Missing oldlog now aborts check_log (by @RincewindsHat #1732)
+ check_mailq: Add mailq -C option for config dir or config file (by @leeclemens #1490)
+ check_mailq: Check mailq domain specific warnings (by @RincewindsHat #1731)
+ check_mailq: Fix regexp for nullmailer "mailq" output (by @darksoul42 #1493)
+ check_mysql: fix segfaults with mysql-connector-c #1562 (by @ghciv6 #1644)
+ check_pgsql: add --queryname parameter to check_pgsql (by @datamuc #1741)
+ check_ping: Do not show RTA if no connection was possible (by @RincewindsHat #1697)
+ check_ping: understang ping6 output from iputils package (by @glensc #1412)
+ check_proc: Fix check proc ps detection (by @sni #1712)
+ check_procs: exchange needle and haystack in strstr() for proper st… (by @wolfgangkarall #1654)
+ check_smtp: add -L flag to support LMTP (LHLO instead of HELO/EHLO). (by @ghen2 #1715)
+ check_snmp: Added option for null zero length string exit codes (by @FracKenA #1496)
+ check_snmp: fix performance thresholds when using multiple oids (by @sni #1722)
+ check_snmp fix segfaults (by @adrb #1589)
+ check_snmp: put the "c" (to mark a counter) after the perfdata value (by @lausser #1465)
+ check_swap: fix parsing swap values (by @sni #1780)
+ check_swap: Fix perfdata for check swap (by @RincewindsHat #1707)
+ check_swap: Fix unit for total in perfdata (by @RincewindsHat #1779)
+ check_swap: Handle cached swap (by @mdavranche #1642)
+ check_swap: Small fix to threshold validation and style (indentation) fixes (by @RincewindsHat #1723)
+ check_ups: Fix possible overflow in check_ups (by @phibos #1727)
+ check_uptime: Add option to report uptime in days instead of seconds (by @amotl #1750)
+ check_uptime: Fix/improve output message "Uptime is ..." (by @amotl #1751)
+
+ MULTIPLE PLUGINS
+ check_http, check_curl: added --max-redirs=N option (feature #1684) (by @andreasbaumann #1744)
+ check_http, check_curl: Enhancement --continue-after-certificate (backport from nagios-plugins) (by @andreasbaumann #1762)
+ check_http, check_curl: Remove check_http and check_curl test which are somehow always failing (by @RincewindsHat #1777)
+ check_log, check_oracle, check_sensors: Several fixes shellcheck complaining about (by @waja #1459)
+ sslutils: use chain from client certificates (by @tobiaswiese #1664)
+
+ NON FUNCTIONAL CHANGES
+ Trivial source code whitespace formatting fixes to standard. (by @ziesemer #1424)
+ docs: fix simple typo, conspicuosly -> conspicuously (by @timgates42 #1652)
+ Migrate to GitHub actions (by @jacobbaungard #1686)
+ Point to Icinga Exchange instead of dead Monitoring Exchange (by @RincewindsHat #1737)
+ github actions: fix check_users test case (by @sni #1713)
+ Add CodeQL checks (by @phibos #1682)
+ Fix some QL problems (by @RincewindsHat #1729)
+ Update CodeQL and update runner before installing (by @RincewindsHat #1775)
+ check_disk: Check disk compiler warnings (by @RincewindsHat #1758)
+ check_disk: Trivial printf fix and a little bit of code style (by @RincewindsHat #1695)
+ check_http: Docs: make -C obvious (by @stblassitude #1554)
+ check_ifoperstatus: Re-attach a comment to where it actually belongs (by @peternewman #1699)
+ check_ircd: Restrict the nickname length of the test user for check_ircd (by @RincewindsHat #1710)
+ check_load: Check load compiler warnings (by @RincewindsHat #1759)
+ check_log: Modernize check log (by @RincewindsHat #1692)
+ check_mailq: remove duplicate W=i/C=i args in check_mailq.pl (by @ichdasich #1755)
+ check_ntp: Check ntp remove unused variables (by @RincewindsHat #1781)
+ check_pgsql: Using snprintf which honors the buffers size and guarantees null termination. (Closes: #1601) (by @waja #1663)
+ check_procs: Fix double percentage sign in usage (by @RincewindsHat #1743)
+ check_sensors.sh: Make shellcheck happier (by @RincewindsHat #1679)
+ check_snmp: Fixed option description authpassword -> authpasswd + whitespaces (by @RincewindsHat #1676)
+ check_swap: Check swap compiler warnings (by @RincewindsHat #1756)
+
+2.3.1 10 April 2021
+ ENHANCEMENTS
+ check_curl: Add an option to verify the peer certificate & host using the system CA's
+
+ FIXES
+ check_icmp: fix simple typo, conspicuosly -> conspicuously
+ check_curl: fixed help, usage and errors for TLS 1.3
+ check_curl: fixed a potential buffer overflow in url buffer
+ check_dns: split multiple IP addresses passed in one -a argument
+ check_curl: added string_statuscode function for printing HTTP/1.1 and HTTP/2 correctly
+ check_curl: fix crash if http header contains leading spaces
+ check_curl: display a specific human-readable error message where possible
+ check_pgsql: Using snprintf which honors the buffers size and guarantees null termination.
+ check_snmp: put the "c" (to mark a counter) after the perfdata value
+ check_http: Increase regexp limit
+ check_http: make -C obvious
+ check_curl: Increase regexp limit (to 1024 as in check_http)
+ check_curl: make -C obvious (from check_http)
+ check_curl: backported --show-body/-B to print body (from check_http)
+
+2.3 10th December 2020
+ ENHANCEMENTS
+ check_dns: allow 'expected address' (-a) to be specified in CIDR notation
+ (IPv4 only).
+ check_dns: allow for IPv6 RDNS
+ check_dns: Accept CIDR
+ check_dns: allow unsorted addresses
+ check_dns: allow forcing complete match of all addresses
+ check_dns: option to expect NXDOMAIN
+ check_apt: add --only-critical switch
+ check_apt: add -l/--list option to print packages
+ check_file_age: add range checking
+ check_file_age: enable to test for maximum file size
+ check_apt: adding packages-warning option
+ check_load: Adding top consuming processes option
+ check_http: Adding Proxy-Authorization and extra headers
+ check_snmp: make calculation of timeout value in help output more clear
+ check_uptime: new plugin for checking uptime to see how long the system is running
+ check_curl: check_http replacement based on libcurl
+ check_http: Allow user to specify HTTP method after proxy CONNECT
+ check_http: Add new flag --show-body/-B to print body
+ check_cluster: Added data argument validation
+ check_icmp: Add IPv6 support
+ check_icmp: Automatically detect IP protocol
+ check_icmp: emit error if multiple protocol version
+ check_disk: add support to display inodes usage in perfdata
+ check_hpjd: Added -D option to disable warning on 'out of paper'
+ check_http: support the --show-body/-B flag when --expect is used
+ check_mysql: allow mariadbclient to be used
+ check_tcp: add --sni
+ check_dns: detect unreachable dns service in nslookup output
+
+ FIXES
+ Fix regression where check_dhcp was rereading response in a tight loop
+ check_dns: fix error detection on sles nslookup
+ check_disk_smb: fix timeout issue
+ check_swap: repaired "-n" behaviour
+ check_icmp: Correctly set address_family on lookup
+ check_icmp: Do not overwrite -4,-6 on lookup
+ check_smtp: initializes n before it is used
+ check_dns: fix typo in parameter description
+ check_by_ssh: fix child process leak on timeouts
+ check_mysql: Allow sockets to be specified to -H
+ check_procs: improve command examples for 'at least' processes
+ check_swap: repaired "-n" behaviour
+ check_disk: include -P switch in help
+ check_mailq: restore accidentally removed options
+
+2.2 29th November 2016
+ ENHANCEMENTS
+ The check_http -S/--ssl option now accepts the arguments "1.1" and "1.2"
+ to force TLSv1.1 and TLSv1.2 connections, respectively
+ The check_http -S/--ssl option now allows for specifying the desired
+ protocol with a "+" suffix to also accept newer versions
+ Let check_http check HTTPS web sites via proxies
+ check_http: add timeout to performance data as max value
+ check_http: report certificate expiry date in UTC
+ check_snmp: add IPv6 support
+ check_snmp's performance data now also includes warning/critical
+ thresholds
+ New check_snmp -N option to specify SNMPv3 context name
+ Let check_smtp's -D option imply -S
+ Let check_smtp's -e option match against the full SMTP response
+ check_dig: expected response is now case-insensitive
+ New check_mailq -s option which tells the plugin to use sudo(8)
+ New check_nt -l parameters: seconds|minutes|hours|days
+ New -W/-C option for check_ldap to check number of entries
+ check_users: add support for range thresholds
+ check_fping now auto-detects IPv6 addresses
+ check_radius now supports the radcli library
+ Support OpenSSL 1.1
+
+ FIXES
+ check_http: fix host header port handling
+ Let check_real terminate lines with CRLF when talking to the server, as
+ mandated by RFC 2326
+ Fix check_procs on HP-UX
+ check_smtp's -e/--expect option can now be combined with -S/--starttls
+ Fix incorrect performance data thresholds emitted by check_ups
+ Don't let check_procs miss some processes on busy Solaris systems
+
+ WARNINGS
+ The format of the performance data emitted by check_mrtgtraf has been
+ changed to comply with the development guidelines
+ check_ssh now returns CRITICAL for protocol/version errors
+ If a plugin is invoked with -h/--help or -V/--version, the exit status
+ is now UNKNOWN
+ The superseded check_ntp.pl was removed, please use check_ntp_peer or
+ check_ntp_time instead
+
+2.1.2 16th October 2015
+ FIXES
+ Fix incorrect performance data thresholds emitted by check_ups
+ Fix check_dhcp's option parsing to not crash with certain arguments
+ Fix check_snmp using correct timeout
+
+2.1.1 2nd December 2014
+ FIXES
+ Fix check_ntp's jitter checking
+ Fix check_ntp's handling of invalid server responses
+ Fix check_apt's handling of invalid regular expressions
+ Fix check_real's server response processing
+ Fix backslash escaping in check_tcp's --help output
+
+2.1 15th October 2014
+ ENHANCEMENTS
+ New check_hpjd -p option for port specification
+ New ./configure --with-qmail-qstat-command option to specify the path to
+ qmail-qstat(8)
+ New check_ifstatus -n option to ignore interfaces by name
+ check_ntp_peer has now specific state output for each metric
+ New check_mysql -n option to ignore authentication failures
+ Added IP and port or socket name to error messages
+ New check_ntp_time -o option to add expected offset
+ check_disk shows now troubled partitions in verbose mode
+ check_dig has now support for drill and dig
+ check_dig has now support for -6 option
+ Add performance data to check_file_age
+
+ FIXES
+ Fix check_jabber to work with Openfire servers
+ Fix check_oracle bad string matching when testing TNS server
+ Fixed check_ifstatus performance data output
+ Fixed expire time output for sslutils
+ check_dns now verifies if the answer is returning from the queried
+ server
+ Fix check_by_ssh to accept --hostname as argument
+
+ WARNINGS
+ This release doesn't ship with an RPM spec file, please contribute to
+ PR #1283 if you are interested in it
+
+2.0 11th July 2014
+ ENHANCEMENTS
+ check_mailq now supports auto detection of qmail, postfix, exim and nullmailer with
+ fallback to sendmail
+ check_ide_smart now defaults to plugin output, original output appended with -v
+ Extra-Opts are now enabled by default, see:
+ https://www.monitoring-plugins.org/doc/extra-opts.html
+ check_swap now supports a configurable state when there is no swap
+ check_radius now supports the FreeRADIUS Client library
+ New check_mysql_query -f option to specify a client options file
+ New check_mysql_query -g option to specify a client options group
+ Add performance data to check_mysql_query
+ New check_file_age -i/--ignore-missing option to return OK on nonexistent files
+ Make check_ping, check_users, and check_disk work on Windows
+ New check_ssh -P option to specify the expected SSH protocol version
+ check_dns now emits the warning and critical thresholds with the performance data
+
+ FIXES
+ Don't let e.g. check_http's -C option reset SSL version if e.g. -S 1 -C 5 is specified
+ Don't have check_http's -N option expect an argument
+ check_ide_smart could disable offline auto tests but could not re-enable them.
+ For this reason all SMART command modes have been disabled.
+ check_dig: fix wrong IPv6 arguments order
+ check_dig: make sure not to give up too early when a timeout is specified with -t
+ check_log: don't stumble over log lines that include a "%" character
+ check_nt: add UPTIME to perfdata
+ Handle SNMPv3 noAuthNoPriv properly with check_snmp
+ Fix compilation with GnuTLS
+
+ WARNINGS
+ New default installation prefix: /usr/local instead of /usr/local/nagios
+ check_snmp now evaluates negative values properly, which means it might return CRITICAL
+ in cases where it used to return OK. If this is undesired, the warning/critical
+ threshold(s) must be fixed by specifying e.g. ~:100 instead of 100
+ check_procs now ignores its parent process to avoid unexpected results when invoked via
+ certain shells
+ utils.sh no longer defines ECH
+ check_ide_smart -q/--quiet and -n/--nagios (Nagios-compatible output) are now deprecated
+ but accepted for backward-compatibility
+ check_ide_smart -0/--auto-off, -1/--auto-on and -i/--immediate: options have
+ been disabled because they were broken
+ State retention: the NAGIOS_PLUGIN_STATE_DIRECTORY environment variable has been
+ renamed MP_STATE_PATH. The old variable will continue to work in v2.0.x
+ Add the UID of the invoking user to the state retention file path. This helps solving
+ permission issues when different users run the same plugin
+ check_swap used to allow returning OK on a system without swap when only percent thresholds
+ were used. This is no longer the case and one must now use -n/--no-swap=<state>
+ The Perl and Shell plugins now use the PATH specified via ./configure's --trusted-path
+ option, or "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" by default
+
+1.5 2nd October 2013
+ ENHANCEMENTS
+ New check_dbi plugin for checking an (SQL) database using DBI
+ Let OpenSSL load its configuration file (see the OPENSSL_config(3) man page)
+ Add performance data to check_apt
+ Add performance data to check_procs
+ Added -4/-6 options to check_dig
+ New check_oracle --connect option to perform real login
+ New check_nagios -t option to override the default timeout
+ New check_disk -f/--freespace-ignore-reserved option to ignore space reserved for root
+ New check_disk -N/--include-type option to limit the filesystem types to check
+ Allow for building the plugins in parallel
+ Add --without-{dbi,ldap,radius} options to ./configure
+ Made Verbose output of check_sensors compliant
+ New switch -E/--extended-perfdata for check_http to print additional performance data
+ New check_http -d option to specify a string to expect within the response headers
+ New check_http -J/-K options for client certificate authentication support
+ Add support for executing queries to check_pgsql
+ Let check_pgsql accept a UNIX socket directory as hostname
+ New check_pgsql -o option to specify additional connection parameters
+ New check_fping -S option to specify the source IP address
+ New check_fping -I option to specify the interface to bind to
+ Let check_fping support IPv6
+ New check_procs -k option to ignore kernel threads (on Linux)
+ Let check_procs use /proc/<PID>/exe (if available) instead of getpid(2), unless -T is specified
+ Let check_mysql support SSL
+ Let check_mysql add performance metrics for all checks
+ New check_mysql -f option to specify a client options file
+ New check_mysql -g option to specify a client options group
+ New check_snmp --offset option to allow for adding/subtracting an offset value to sensor data
+ Let check_snmp support an arbitrary number of OIDs
+ Let check_ide_smart support NetBSD
+
+ FIXES
+ Change the MAIL FROM command generated by check_smtp to be RFC compliant
+ Fix compilation of check_http without SSL support
+ Fix check_snmp reversed threshold ranges (backward-compatibility)
+ Fix check_snmp memory violation when using more than 8 oids
+ Fix check_apt security regular expression
+ Fix check_http handling extra header (-k) containing semicolons
+ Fix check_apt handling unknown exit codes from apt-get
+ Fix deprecated imports of check_nmap.py
+
+ WARNINGS
+ check_http behaviour of -k/--header changed since it does not separate multiple headers by semicolons anymore. Use multiple -k switches instead.
+ check_http's --proxy_authorization option is now called --proxy-authorization (it was always documented this way)
+ The contrib directory has been removed from this distribution
+
+1.4.16 27th June 2012
+ ENHANCEMENTS
+ check_nt UPTIME accepts warning/critical thresholds
+ check_disk_smb now allows spaces in share names (#990948, #1370031, Debian #601699)
+ check_http now uses standard threshold functions (enables floating point and ranges)
+ check_http now checks for and prints the certificate cn (hostname) in SSL certificate checks
+ check_http now supports an optional -S/--ssl value to choose the SSL protocol version (#3066166)
+ Add perfdata to check_ssh (#3244097)
+ New option to check_smtp to ignore failures when sending QUIT (#3358348)
+ New check_by_ssh -F option which allows for specifying an alternative ssh_config(5) file (#2895334)
+ check_sensors now detects faulty sensors unless --ignore-fault is specified
+ utils.sh now provides a check_range function
+ Improved the performance of check_users
+ Add perfdata to check_disk_smb (Debian #654259)
+ Updated Nagios::Plugin perl module
+ Add warning threshold to certificate expiration checks of check_tcp/http/smtp
+ Add --perf-oids option for check_snmp
+
+ FIXES
+ Fix check_disk free space calculation if blocksizes differ within a disk group (#2973603)
+ check_disk_smb now handles NT_STATUS_ACCESS_DENIED properly (Debian #601696)
+ Make check_snmp work more like v1.4.14 with regard to using special values (Timeticks, STRING) as numeric thresholds
+ Fix check_ldap overriding the port when --ssl was specified after -p
+ Fix check_procs where regex input of '|' would get displayed in output - now replaced with ','
+ Fix segfault in check_host when hostname returns multiple IP addresses
+ Fix check_smtp and check_tcp where duplicate messages were displayed for certificate errors
+ Fix check_ping's parsing of ping6(1) output (#1894850, Debian #514588, Debian #662638)
+ Fix a check_dhcp bug which was triggered by checking Windows 2003 DHCP servers (#3503921)
+ Disable RFC4507 support, to work around SSL negotiation issues with (at least) some Tomcat versions
+ Fix performance data label containing spaces in check_snmp
+
+1.4.15 27th July 2010
+ ENHANCEMENTS
+ New check_ntp_peer -m and -n options to check the number of usable time sources ("truechimers")
+ New check_disk_smb -a option which allows for specifying the IP address of the remote server
+ New check_radius -N option which allows for specifying the value of the NAS-IP-Address attribute
+ New check_snmp --rate option to store differences between invocations. Saves state in PREFIX/var/{plugin}
+ check_snmp -l label option now also changes the perfdata label. See WARNINGS
+ check_snmp has an --invert-search option which reverses status of the string and regexp searches
+ check_http now displays the missing search string and the URL in the output when failed (#2999924)
+ Updated Nagios::Plugin perl module
+ Updated gnulib to June 2010
+
+ FIXES
+ Fix check_ircd binding to wrong interface (#668778)
+ Add proxy-authorization option to check_http (#1323230, #2863925)
+ check_icmp now increment the sequence counter in each packet
+ Fix usage of repeated -o options in check_snmp
+ Try to detect arguments passed via --with-ping[6]-command and set options accordingly (#2908236)
+ Fix memory leak in check_http for large pages (#2957455)
+ Fix compilation with GCC 2.96 (#2977105)
+ Fix regression introduced in #1867716 where partially valid performance strings would not be printed anymore
+ Fix regression in check_http ssl checks on some servers - make SNI an option
+ Fix guest mode support in check_disk_smb
+ Fix check_disk_smb and check_ircd failures when run via ePN
+ check_ldap now allows for specifying an empty LDAP base
+ Fix compilation error of pst3 in Solaris 8
+ Fix check_radius returning OK on unexpected results (#2911752)
+ Fix translations when extra-opts aren't enabled (#2832884)
+ Fix parsing of multi-line strings in check_snmp (broken in 1.4.14) and enhance output in such case (#2832451)
+ Fix detection of pst3 64-bit compile flags with Sun CC
+ Fix cmd_run overwriting the environment, which would break some commands that needed it
+ Allow check_ifstatus to accept version=2c - used to only allow version=2
+ Fix examples in check_disk, where it implied was possible to suffix unit values to warn/crit parameters
+
+ WARNINGS
+ Updated developer documentation to say that performance labels should not have an equals sign or
+ single quote in the label
+ check_http 1.4.14 introduced SSL SNI support - you now have to enable it explicitly with "--sni"
+ check_snmp -l label option is also used for the performance label. This could change history from previous uses
+
+1.4.14 16th September 2009
+ check_http has options to specify the HTTP method (#2155152)
+ check_users thresholds were not working exactly as documented (>= rather than >)
+ Updated tinderbox_build script to point to new tinderbox server
+ check_ifoperstatus -n flag now works as expected (#1569488)
+ check_ifoperstatus now supports ifType based lookup for ifIndex
+ check_ups now sends a LOGOUT string (Debian #387001)
+ Extra-opts (C plugins) now allows both '#' and ';' for comments (like N::P)
+ Extra-opts (C plugins) does not allow trailing comments anymore (like N::P)
+ Fixed dependency issue on libtap when ./configure --enable-libtap used. Warning: will install libtap
+ Fixed segfault in extra-opts under some circumstance when reading multiple sections
+ Fix long options parsing in check_disk, check_dns, check_mrtg, check_mrtgtraf and check_tcp
+ Add missing long options for check_nt (for use with extra-opts)
+ check_icmp now reports min and max round trip time perfdata
+ Fixed check_http bug where additional headers with redirection caused a segfault (2089159)
+ check_disk: make autofs mount paths specified with -p before we determine the mount list
+ Fixed buffer overflow in check_ntp/check_ntp_peer (#1999319, Ubuntu #291265)
+ Re-bundled libtap as a built-in library (--enable-libtap): detects system library as pre-1.4.13 and does not install the built-in library anymore
+ Fixed check_mrtg returning UNKNOWN instead of OK (#2378068)
+ Fixed check_http behaviour: all check are now performed as long as a valid response is returned (#1460312)
+ check_http --onredirect=sticky follows using the same IP address (#2550208)
+ check_http --onredirect=stickyport also follows the same port
+ Fixed coredump from check_nt when invalid drive is specified (#2179754)
+ Fixed crash from check_nt when -H unspecified or given multiple times (#2731755, Debian #521097)
+ Fixed passing of quotes in OID for check_snmp (#1985230)
+ Fixed check_http sending HTTP/1.0 with v1.1 headers (#2638765)
+ Fixed check_http not timing-out on redirects
+ Fixed negate not printing the real timeout in ALRM handler when left to default
+ negate timeout result is now configurable
+ Fixed segfault in check_mysql with old slaves (#2696823)
+ check_nt can return UNKNOWN on timeouts (-u)
+ Fixed typos for check_disk
+ Fixed check_mysql* not using password set in my.cnf (#2531905) - Specify an empty password explicitly if you need to override it.
+ Fixed awk subst.in/subst script path error (#2722832)
+ check_http: Add SSL/TLS hostname extension support (SNI) - (#1939022)
+ Fixed wrong perfdata label for output traffic in check_mrtgtraf (#2654308)
+ Fixed check_by_ssh interpretation of quotes in -C parameter (#1985246, #2268675)
+ check_snmp now supports standard threshold ranges and doubles (floating numbers) in thresholds
+ check_fping now supports passing target timeout and interval to fping (#2347686)
+ Fixed SNMPv3 behaviour of check_ifoperstatus and check_ifstatus. Added -P to define privprotocol (#2343438)
+ check_ifoperstatus and check_ifstatus are now more user-friendly in case of missing arguments
+ pst3 compile fix for Sun Studio Compiler
+
+1.4.13 25th Sept 2008
+ Fix Debian bug #460097: check_http --max-age broken
+ Optimised pst3 for systems with large number of processes
+ Updated Nagios::Plugin to 0.27
+ Fix Debian bug #479013: check_dig's -l is mandatory now (#1986306)
+ check_dig now returns CRITICAL instead of WARNING when no answer section is found
+ check_procs now captures stderr in external command and adds to plugin output
+ check_snmp now only prints perfdata for non numeric values (#1867716)
+ check_icmp now supports packet size modification
+ check_http -e now accepts a comma-delimited list of expected status codes
+ libtap now included with this distribution for easier testing. Run ./configure with --enable-libtap
+ check_ntp_peer/check_ntp_time used to show port in --help but ignored the argument - now implemented
+ Fix possible segfault in check_ntp_peer with deliberately invalid packets
+
+1.4.12 27th May 2008
+ Added ./check_nt -v INSTANCES to count number of instances
+ New check_icmp -s option to specify the source IP address
+ check_dns now sorts addresses for testing results for more than one returned IP
+ Fix segfault in check_ntp_time and (deprecated) check_ntp (#1862300)
+ check_disk should now work with large file systems (2TB+) on all archs that supports it
+ Fixed check_disk disk usage calculation when using --group=NAME (related to #1348746)
+ Fix help text of check_ntp* (#1880095)
+ Fix bugs and flaws in best offset server selection of check_ntp_time and (deprecated) check_ntp
+ check_ntp_peer now checks for the LI_ALARM flag
+ Sync to latest Gnulib (includes new floorf function)
+ check_pgsql now successfully builds with postgres lib v8.3 (#1878972)
+ check_procs now accepts --ereg-argument-array for a regular expression match to the argument array
+ Reverted back to using pst3 for Solaris systems. Fixed issues re: -m64 needed to compile on 64bit systems
+ If applicable, Gettext linked dynamically instead of statically
+ check_dig can now pass arguments to dig by using -A/--dig-arguments (#1874041/#1889453)
+ check_ntp and check_ntp_peer now show proper jitter/stratum thresholds longopts in --help
+ check_dns now allow to repeat -a to match multiple possibly returned address (common with load balancers)
+ check_mysql and check_radius now try clearing password in processlist just like check_mysql_query
+ check_mysql and check_mysql_query now support sockets explicitly (-s, --socket)
+ negate now has the ability to replace the status text as well (-s, --substitute)
+ Added performance data to check_ping
+ Added support for --extra-opts in all C plugins (disabled by default, see configure --help)
+ Fixed passive option in check_by_ssh
+ On non-skipped stderr, check_by_ssh now returns UNKNOWN or worse (result from command) instead of always UNKNOWN.
+ Fix linking against OpenSSL where libdl is required
+
+1.4.11 13th December 2007
+ Fixed check_http regression in 1.4.10 where following redirects to
+ relative URLs on virtual hosts failed if both "-H" and "-I" were used
+ Merged two new checks that deprecates check_ntp: check_ntp_peer and check_ntp_time.
+ You should read the --help output so see which one is suitable for you. check_ntp_peer
+ implement stratum thresholds support (feature request #1703823).
+ check_ntp now returns UNKNOWN instead of WARNING if jitter is unavailable (jitter=-1.000000)
+ as long as the thresholds range include -1. If no offset threshold is specified
+ and the offset is unavailable, will return UNKNOWN as well.
+ NOTE: If jitter thresholds are specified as integers it will return CRITICAL if jitter
+ is "-1" as the default range starts at 0. See Examples in --help output.
+ Fixed broken usage2 in check_snmp and check_cluster
+ check_cluster now accepts all valid characters in its thresholds ("-", "@", "~")
+ Fixed check_disk reporting OK if disk usage grows over 100% (#1348746).
+ The problem happens to be in Gnulib but a workaround have been implemented in check_disk.c
+ Fixed check_load argument handling when not passing triplets (#1831890)
+ Fixed buffer overflow in check_snmp (CVE-2007-5623)
+ Tinderbox builds now runs tests in a verbose mode
+ Updated Nagios::Plugin to 0.22
+ VPATH problem fixed for compiling plugins-root
+
+1.4.10 28th September 2007
+ Fix check_http buffer overflow vulnerability when following HTTP redirects (CVE-2007-5198)
+ check_http now explicitly asks HTTP/1.1 servers to close the connection
+ after completion of the response
+ Check_ldaps' guessing which secure method to use (starttls vs. ssl on connect)
+ is now deprecated. See --help for further information.
+ Check_disk now calls stat() on all filesystems to check. (Old: only the ones selected using -p)
+ A meaningful error message (eg "Stale NFS Handle") is printed if stat fails.
+ New check_disk option -L: Only check local filesystems, but call stat() on remote ones, too.
+ Thus accessibility of remote filesystems can be checked without any threshold comparison.
+ Check_disk's --help now prints some examples for the new features introduced in 1.4.8
+ New check_disk -i/-I option to ignore paths/partitions based on regular expressions
+ New check_disk -A option to select all filesystems explicitly
+ WARNING: check_disk's -E option must now be passed before -p or -r/-R arguments
+ Passing -E after -p or -r results in UNKNOWN state, now
+ This is needed due to the new ignore feature
+ Fix check_disk bug when mixing case sensitive and case insensitive regex arguments
+ New check_dhcp -u/--unicast option for emulating a DHCP relay in order
+ to check DHCP servers on remote networks
+ New check_dhcp -m/--mac option which allows for specifying the MAC
+ address to use in the DHCP request
+ The check_dhcp -r and -s options now accept host names, too
+ Fix possible check_icmp bus errors on some (non-x86/AMD64) platforms
+ Fix check_smtp's handling of multiple-packet server responses
+ WARNING: Fix for negate which may break existing commands:
+ - stop evaluating command line options through shell twice
+ - enforce a full path for the command to run
+ The "negate" utility can now remap custom states
+ Check_radius now supports radiusclient-ng
+ The (undocumented) positional parameter parsing which check_radius used
+ instead of getopt(3) if 8 arguments were given is no longer available
+ Check_by_ssh now supports multiline output
+ IPv6 support can now be disabled using ./configure --without-ipv6
+ Fix check_ntp now honor ntp flags
+
+1.4.9 4th June 2007
+ Inclusion of contrib/check_cluster2 as check_cluster with some improvements
+ New/improved -E/--skip-stderr and -S/--skip-stdout options for check_by_ssh
+ check_snmp now supports Counter64
+ Fix compilation of check_ldap, check_radius and check_pgsql
+ check_load can optionally divide by number of cpus
+ Fix check_time returning wrong OK when time is before the epoch on some arch
+ Make check_http output more consistent
+ Fix possible check_http segfaults when following HTTP redirects
+ check_snmp don't warn anymore if something is printed on stderr
+ Fix check_tcp segfault when multiple expect strings are given
+ New option for check_tcp: -A/--all to test if all given expect strings match
+
+1.4.8 11th April 2007
+ Respects --without-world-permissions for setuid plugins
+ check_disk extra options for regex matching of filesystems and grouping of filesystems
+ for collective thresholds
+ Better configure test for mysqlclient availability
+ Various check_ntp fixes
+
+1.4.7 29th March 2007
+ check_procs uses /usr/ucb/ps if available - fixes pst3 problems on Solaris
+ Fixed MKINSTALLDIRS problem in po/
+ ./configure now detects if possible to compile check_mysql
+ Fixed broken HELO in check_smtp
+ check_icmp now allows to set a minimum number of hosts required for success (-m)
+ check_icmp fix for *BSD when running for long time
+ check_ping times out 1 second quicker if host is unreachable
+ Root plugins installed with world executable
+ check_sybase from contrib now maintained in MonitoringExchange
+ --with-nagios-user/group reinstated ./configure option
+ New --without-world-permissions ./configure option
+
+1.4.6 5th February 2007
+ Reduced number of DNS lookups in check_ping and netutils.c for IPv6 configurations
+ Fixed compile problems with *BSD re: alloca.h
+ Fixed Solaris problems with check_swap (tested on Solaris 9)
+ Fixed check_swap for HP/UX where swapinfo command was incorrect
+ Fixed check_disk inode threshold checks, regressed at r1.4.4.
+ Fixed crit/warn for check_disk perf data
+ Fixed buffer overflow in check_procs
+ Fixed error handling for UNIX sockets in netutils.c
+ New -q and -o options for check_by_ssh which are handed over to ssh(1) as is
+ Synced with latest GNUlib
+ Fixed check_jabber always returns warning
+
+1.4.5
+ Fixed bug in perl's is_hostname routine
+
+1.4.4
+ New C based check_ntp. The perl version is now deprecated.
+ New check_apt plugin
+ Notice: plugins in contrib/ will start to be removed from this distribution.
+ Please check at http://www.monitoringexchange.org for contributed plugins
+ Major bug fixes to check_disk where values were incorrectly calculated and alerted on.
+ check_udp2 removed. check_udp is now linked to check_tcp.c
+ check_mailq now errors if the sub-program run returns non-zero return code. This would appear
+ as if mailqs were okay when the nagios user could not query the mail-queues
+ Compile problems with check_snmp fixed
+
+1.4.3
+ Setuid plugins (check_dhcp, check_icmp) separated into plugins-root/. Run make install as root to install
+ SSL plugins work with gnutls as well as OpenSSL
+ check_mysql_query added to run arbitrary SQL commands, with threshold checking
+ libtool now required for development systems
+ Notice: check_udp (compiled from check_udp.c) will be deprecated in the next release.
+ check_udp2 should be used instead and will be renamed to check_udp
+
+1.4.2
+ Fix for Redhat ES4 for check_dns and check_dig
+
+1.4
+ IPv6 support in check_ping, check_by_ssh, check_http, check_ldap, check_smtp, check_tcp
+ Internationalisation support
+ Performance data added to most plugins
+ check_disk now using GNU coreutils code
+ New plugins - check_dhcp, check_icmp
+ contrib/check_citrix has been replaced by contrib/check_ica* (requires packet_utils.pm in libexec)
+ check_http --min changed to --pagesize, added max so min:max in check
+ check_vsz and check_rss deprecated - functionality moved into check_procs
+ check_swap % thresholds changed to measure amount free, instead of amount used
+ check_disk syntax changes for -p, -m/-M, defaults to MB instead of kB
+ check_procs -C expects no path for the command name
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN
new file mode 100755
index 0000000..2453774
--- /dev/null
+++ b/NP-VERSION-GEN
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# This is from the Git repository (GIT-VERSION-GEN with modifications)
+#
+
+SRC_ROOT=`dirname $0`
+
+NPVF=NP-VERSION-FILE
+DEF_VER=2.3.5
+
+LF='
+'
+
+# First try git-describe, then svn info, then default.
+if test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git &&
+ VN=`cd $SRC_ROOT; git describe --abbrev=4 HEAD 2>/dev/null` &&
+ case "$VN" in
+ *$LF*) (exit 1) ;;
+ release-[0-9]*)
+ git update-index -q --refresh
+ test -z "`git diff-index --name-only HEAD --`" ||
+ VN="$VN-dirty" ;;
+ esac
+then
+ VN=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`;
+elif test -d $SRC_ROOT/.svn -o -f $SRC_ROOT/.svn &&
+ VN=`cd $SRC_ROOT; svn info 2>/dev/null | grep '^Revision'` &&
+ case "$VN" in
+ *$LF*) (exit 1) ;;
+ Revision:*)
+ VN=`echo $VN | awk '{print $NF}'`
+ test "`svn status 2>/dev/null | grep '^[AMD]' | wc -l | tr -d ' '`" = 0 ||
+ VN="$VN-dirty" ;;
+ esac
+then
+ VN=`echo "trunk.$VN" | sed -e 's/-/./g'`;
+else
+ VN="$DEF_VER"
+fi
+
+VN=`expr "$VN" : v*'\(.*\)'`
+
+if test -r $NPVF
+then
+ VC=`sed -e 's/^NP_VERSION = //' <$NPVF`
+else
+ VC=unset
+fi
+test "$VN" = "$VC" || {
+ echo >&2 "NP_VERSION = $VN"
+ echo "NP_VERSION = $VN" >$NPVF
+}
+
diff --git a/NPTest.pm b/NPTest.pm
new file mode 100644
index 0000000..9b25ac3
--- /dev/null
+++ b/NPTest.pm
@@ -0,0 +1,646 @@
+package NPTest;
+
+#
+# Helper Functions for testing Monitoring Plugins
+#
+
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT = qw(getTestParameter checkCmd skipMissingCmd skipMsg);
+@EXPORT_OK = qw(DetermineTestHarnessDirectory TestsFrom SetCacheFilename);
+
+use strict;
+use warnings;
+
+use Cwd;
+use File::Basename;
+
+use IO::File;
+use Data::Dumper;
+
+use Test;
+
+use vars qw($VERSION);
+$VERSION = "1556."; # must be all one line, for MakeMaker
+
+=head1 NAME
+
+NPTest - Simplify the testing of Monitoring Plugins
+
+=head1 DESCRIPTION
+
+This modules provides convenience functions to assist in the testing
+of Monitoring Plugins, making the testing code easier to read and write;
+hopefully encouraging the development of a more complete test suite for
+the Monitoring Plugins. It is based on the patterns of testing seen in the
+1.4.0 release, and continues to use the L<Test> module as the basis of
+testing.
+
+=head1 FUNCTIONS
+
+This module defines four public functions, C<getTestParameter(...)>,
+C<checkCmd(...)>, C<skipMissingCmd(...)> and C<skipMsg(...)>. These are exported by
+default via the C<use NPTest;> statement.
+
+=over
+
+=item getTestParameter( "ENV_VARIABLE", $brief_description, $default )
+
+$default is optional.
+
+This function allows the test harness
+developer to interactively request test parameter information from the
+user. The user can accept the developer's default value or reply "none"
+which will then be returned as "" for the test to skip if appropriate.
+
+If a parameter needs to be entered and the test is run without a tty
+attached (such as a cronjob), the parameter will be assigned as if it
+was "none". Tests can check for the parameter and skip if not set.
+
+Responses are stored in an external, file-based cache so subsequent test
+runs will use these values. The user is able to change the values by
+amending the values in the file /var/tmp/NPTest.cache, or by setting
+the appropriate environment variable before running the test.
+
+To facilitate quick testing setup, it is possible to accept all the
+developer provided defaults by setting the environment variable
+"NPTEST_ACCEPTDEFAULT" to "1" (or any other perl truth value). Note
+that, such defaults are not stored in the cache, as there is currently
+no mechanism to edit existing cache entries, save the use of text
+editor or removing the cache file completely.
+
+=item C<testCmd($command)>
+
+Call with NPTest->testCmd("./check_disk ...."). This returns a NPTest object
+which you can then run $object->return_code or $object->output against.
+
+Testing of results would be done in your test script, not in this module.
+
+=item C<checkCmd(...)>
+
+This function is obsolete. Use C<testCmd()> instead.
+
+This function attempts to encompass the majority of test styles used
+in testing Monitoring Plugins. As each plug-in is a separate command, the
+typical tests we wish to perform are against the exit status of the
+command and the output (if any) it generated. Simplifying these tests
+into a single function call, makes the test harness easier to read and
+maintain and allows additional functionality (such as debugging) to be
+provided without additional effort on the part of the test harness
+developer.
+
+It is possible to enable debugging via the environment variable
+C<NPTEST_DEBUG>. If this environment variable exists and its value in PERL's
+boolean context evaluates to true, debugging is enabled.
+
+The function prototype can be expressed as follows:
+
+ Parameter 1 : command => DEFINED SCALAR(string)
+ Parameter 2 : desiredExitStatus => ONE OF
+ SCALAR(integer)
+ ARRAYREF(integer)
+ HASHREF(integer,string)
+ UNDEFINED
+ Parameter 3 : desiredOutput => SCALAR(string) OR UNDEFINED
+ Parameter 4 : exceptions => HASH(integer,string) OR UNDEFINED
+ Returns : SCALAR(integer) as defined by Test::ok(...)
+
+The function treats the first parameter C<$command> as a command line
+to execute as part of the test, it is executed only once and its exit
+status (C<$?E<gt>E<gt>8>) and output are captured.
+
+At this point if debugging is enabled the command, its exit status and
+output are displayed to the tester.
+
+C<checkCmd(...)> allows the testing of either the exit status or the
+generated output or both, not testing either will result in neither
+the C<Test::ok(...)> or C<Test::skip(...)> functions being called,
+something you probably don't want. Note that each defined test
+(C<$desiredExitStatus> and C<$desiredOutput>) results in a invocation
+of either C<Test::ok(...)> or C<Test::skip(...)>, so remember this
+when counting the number of tests to place in the C<Test::plan(...)>
+call.
+
+Many Monitoring Plugins test network services, some of which may not be
+present on all systems. To cater for this, C<checkCmd(...)> allows the
+tester to define exceptions based on the command's exit status. These
+exceptions are provided to skip tests if the test case developer
+believes the service is not being provided. For example, if a site
+does not have a POP3 server, the test harness could map the
+appropriate exit status to a useful message the person running the
+tests, telling the reason the test is being skipped.
+
+Example:
+
+my %exceptions = ( 2 =E<gt> "No POP Server present?" );
+
+$t += checkCmd( "./check_pop I<some args>", 0, undef, %exceptions );
+
+Thus, in the above example, an exit status of 2 does not result in a
+failed test case (as the exit status is not the desired value of 0),
+but a skipped test case with the message "No POP Server present?"
+given as the reason.
+
+Sometimes the exit status of a command should be tested against a set
+of possible values, rather than a single value, this could especially
+be the case in failure testing. C<checkCmd(...)> support two methods
+of testing against a set of desired exit status values.
+
+=over
+
+=item *
+
+Firstly, if C<$desiredExitStatus> is a reference to an array of exit
+statuses, if the actual exit status of the command is present in the
+array, it is used in the call to C<Test::ok(...)> when testing the
+exit status.
+
+=item *
+
+Alternatively, if C<$desiredExitStatus> is a reference to a hash of
+exit statuses(mapped to the strings "continue" or "skip"), similar
+processing to the above occurs with the side affect of determining if
+any generated output testing should proceed. Note: only the string
+"skip" will result in generated output testing being skipped.
+
+=back
+
+=item C<skipMissingCmd(...)>
+
+If a command is missing and the test harness must C<Test::skip()> some
+or all of the tests in a given test harness this function provides a
+simple iterator to issue an appropriate message the requested number
+of times.
+
+=back
+
+=item C<skipMsg(...)>
+
+If for any reason the test harness must C<Test::skip()> some
+or all of the tests in a given test harness this function provides a
+simple iterator to issue an appropriate message the requested number
+of times.
+
+=back
+
+=head1 SEE ALSO
+
+L<Test>
+
+The rest of the code, as I have only commented on the major public
+functions that test harness writers will use, not all the code present
+in this helper module.
+
+=head1 AUTHOR
+
+Copyright (c) 2005 Peter Bray. All rights reserved.
+
+This package is free software and is provided "as is" without express
+or implied warranty. It may be used, redistributed and/or modified
+under the same terms as the Monitoring Plugins release.
+
+=cut
+
+#
+# Package Scope Variables
+#
+
+my( %CACHE ) = ();
+
+# I'm not really sure whether to house a site-specific cache inside
+# or outside of the extracted source / build tree - lets default to outside
+my( $CACHEFILENAME ) = ( exists( $ENV{'NPTEST_CACHE'} ) && $ENV{'NPTEST_CACHE'} )
+ ? $ENV{'NPTEST_CACHE'} : "/var/tmp/NPTest.cache"; # "../Cache.pdd";
+
+#
+# Testing Functions
+#
+
+sub checkCmd
+{
+ my( $command, $desiredExitStatus, $desiredOutput, %exceptions ) = @_;
+
+ my $result = NPTest->testCmd($command);
+
+ my $output = $result->output;
+ my $exitStatus = $result->return_code;
+
+ $output = "" unless defined( $output );
+ chomp( $output );
+
+ my $testStatus;
+
+ my $testOutput = "continue";
+
+ if ( defined( $desiredExitStatus ) )
+ {
+ if ( ref $desiredExitStatus eq "ARRAY" )
+ {
+ if ( scalar( grep { $_ == $exitStatus } @{$desiredExitStatus} ) )
+ {
+ $desiredExitStatus = $exitStatus;
+ }
+ else
+ {
+ $desiredExitStatus = -1;
+ }
+ }
+ elsif ( ref $desiredExitStatus eq "HASH" )
+ {
+ if ( exists( ${$desiredExitStatus}{$exitStatus} ) )
+ {
+ if ( defined( ${$desiredExitStatus}{$exitStatus} ) )
+ {
+ $testOutput = ${$desiredExitStatus}{$exitStatus};
+ }
+ $desiredExitStatus = $exitStatus;
+ }
+ else
+ {
+ $desiredExitStatus = -1;
+ }
+ }
+
+ if ( %exceptions && exists( $exceptions{$exitStatus} ) )
+ {
+ $testStatus += skip( $exceptions{$exitStatus}, $exitStatus, $desiredExitStatus );
+ $testOutput = "skip";
+ }
+ else
+ {
+ $testStatus += ok( $exitStatus, $desiredExitStatus );
+ }
+ }
+
+ if ( defined( $desiredOutput ) )
+ {
+ if ( $testOutput ne "skip" )
+ {
+ $testStatus += ok( $output, $desiredOutput );
+ }
+ else
+ {
+ $testStatus += skip( "Skipping output test as requested", $output, $desiredOutput );
+ }
+ }
+
+ return $testStatus;
+}
+
+
+sub skipMissingCmd
+{
+ my( $command, $count ) = @_;
+
+ my $testStatus;
+
+ for ( 1 .. $count )
+ {
+ $testStatus += skip( "Missing ${command} - tests skipped", 1 );
+ }
+
+ return $testStatus;
+}
+
+sub skipMsg
+{
+ my( $msg, $count ) = @_;
+
+ my $testStatus;
+
+ for ( 1 .. $count )
+ {
+ $testStatus += skip( $msg, 1 );
+ }
+
+ return $testStatus;
+}
+
+sub getTestParameter {
+ my($param, $description, $default) = @_;
+
+ if($param !~ m/^NP_[A-Z0-9_]+$/mx) {
+ die("parameter should be all uppercase and start with NP_ (requested from ".(caller(0))[1].")");
+ }
+
+ return $ENV{$param} if $ENV{$param};
+
+ my $cachedValue = SearchCache($param);
+ if(defined $cachedValue) {
+ return $cachedValue;
+ }
+
+ if($ENV{'NPTEST_ACCEPTDEFAULT'}) {
+ return $default if $default;
+ return "";
+ }
+
+ # Set "none" if no terminal attached (eg, tinderbox build servers when new variables set)
+ return "" unless (-t STDIN);
+
+ my $userResponse = "";
+ while($userResponse eq "") {
+ print STDERR "\n";
+ print STDERR "Test File : ".(caller(0))[1]."\n";
+ print STDERR "Test Parameter : $param\n";
+ print STDERR "Description : $description\n";
+ print STDERR "Enter value (or 'none') ", ($default ? "[${default}]" : "[]"), " => ";
+ $userResponse = <STDIN>;
+ $userResponse = "" if ! defined( $userResponse ); # Handle EOF
+ chomp($userResponse);
+ if($default && $userResponse eq "") {
+ $userResponse = $default;
+ }
+ }
+
+ print STDERR "\n";
+
+ if($userResponse =~ /^(na|none)$/) {
+ $userResponse = "";
+ }
+
+ # store user responses
+ SetCacheParameter($param, $userResponse);
+
+ return $userResponse;
+}
+
+#
+# Internal Cache Management Functions
+#
+
+sub SearchCache {
+ my($param) = @_;
+
+ LoadCache();
+
+ if(exists $CACHE{$param}) {
+ return $CACHE{$param};
+ }
+ return undef; # Need this to say "nothing found"
+}
+
+sub SetCacheParameter {
+ my($param, $value) = @_;
+ $CACHE{$param} = $value;
+ SaveCache();
+}
+
+sub LoadCache
+{
+ return if exists( $CACHE{'_cache_loaded_'} );
+
+ my $fileContents = "";
+ if ( -f $CACHEFILENAME )
+ {
+ my( $fileHandle ) = new IO::File;
+
+ if ( ! $fileHandle->open( "< ${CACHEFILENAME}" ) )
+ {
+ print STDERR "NPTest::LoadCache() : Problem opening ${CACHEFILENAME} : $!\n";
+ return;
+ }
+
+ $fileContents = join("", <$fileHandle>);
+ $fileHandle->close();
+
+ chomp($fileContents);
+ my( $contentsRef ) = eval $fileContents;
+ %CACHE = %{$contentsRef} if (defined($contentsRef));
+
+ }
+
+ $CACHE{'_cache_loaded_'} = 1;
+ $CACHE{'_original_cache'} = $fileContents;
+}
+
+
+sub SaveCache
+{
+ delete $CACHE{'_cache_loaded_'};
+ my $oldFileContents = delete $CACHE{'_original_cache'};
+
+ # clean up old style params
+ for my $key (keys %CACHE) {
+ delete $CACHE{$key} if $key !~ m/^NP_[A-Z0-9_]+$/mx;
+ }
+
+ my($dataDumper) = new Data::Dumper([\%CACHE]);
+ $dataDumper->Terse(1);
+ $dataDumper->Sortkeys(1);
+ my $data = $dataDumper->Dump();
+ $data =~ s/^\s+/ /gmx; # make sure all systems use same amount of whitespace
+ $data =~ s/^\s+}/}/gmx;
+ chomp($data);
+
+ if($oldFileContents ne $data) {
+ my($fileHandle) = new IO::File;
+ if (!$fileHandle->open( "> ${CACHEFILENAME}")) {
+ print STDERR "NPTest::SaveCache() : Problem saving ${CACHEFILENAME} : $!\n";
+ return;
+ }
+ print $fileHandle $data;
+ $fileHandle->close();
+ }
+
+ $CACHE{'_cache_loaded_'} = 1;
+ $CACHE{'_original_cache'} = $data;
+}
+
+#
+# (Questionable) Public Cache Management Functions
+#
+
+sub SetCacheFilename
+{
+ my( $filename ) = @_;
+
+ # Unfortunately we can not validate the filename
+ # in any meaningful way, as it may not yet exist
+ $CACHEFILENAME = $filename;
+}
+
+
+#
+# Test Harness Wrapper Functions
+#
+
+sub DetermineTestHarnessDirectory
+{
+ my( @userSupplied ) = @_;
+ my @dirs;
+
+ # User Supplied
+ if ( @userSupplied > 0 )
+ {
+ for my $u ( @userSupplied )
+ {
+ if ( -d $u )
+ {
+ push ( @dirs, $u );
+ }
+ }
+ }
+
+ # Simple Cases: "t" and tests are subdirectories of the current directory
+ if ( -d "./t" )
+ {
+ push ( @dirs, "./t");
+ }
+ if ( -d "./tests" )
+ {
+ push ( @dirs, "./tests");
+ }
+
+ if ( @dirs > 0 )
+ {
+ return @dirs;
+ }
+
+ # To be honest I don't understand which case satisfies the
+ # original code in test.pl : when $tstdir == `pwd` w.r.t.
+ # $tstdir =~ s|^(.*)/([^/]+)/?$|$1/$2|; and if (-d "../../$2/t")
+ # Assuming pwd is "/a/b/c/d/e" then we are testing for "/a/b/c/e/t"
+ # if I understand the code correctly (a big assumption)
+
+ # Simple Case : the current directory is "t"
+ my $pwd = cwd();
+
+ if ( $pwd =~ m|/t$| )
+ {
+ push ( @dirs, $pwd );
+
+ # The alternate that might work better is
+ # chdir( ".." );
+ # return "./t";
+ # As the current test harnesses assume the application
+ # to be tested is in the current directory (ie "./check_disk ....")
+ }
+
+ return @dirs;
+}
+
+sub TestsFrom
+{
+ my( $directory, $excludeIfAppMissing ) = @_;
+
+ $excludeIfAppMissing = 0 unless defined( $excludeIfAppMissing );
+
+ if ( ! opendir( DIR, $directory ) )
+ {
+ print STDERR "NPTest::TestsFrom() - Failed to open ${directory} : $!\n";
+ return ();
+ }
+
+ my( @tests ) = ();
+
+ my $filename;
+ my $application;
+
+ while ( $filename = readdir( DIR ) )
+ {
+ if ( $filename =~ m/\.t$/ )
+ {
+ if ( $excludeIfAppMissing )
+ {
+ $application = basename( $filename, ".t" );
+ if ( ! -e $application and ! -e $application.'.pm' )
+ {
+ print STDERR "No application (${application}) found for test harness (${filename})\n";
+ next;
+ }
+ }
+ push @tests, "${directory}/${filename}";
+ }
+ }
+
+ closedir( DIR );
+
+ return sort @tests;
+}
+
+# All the new object oriented stuff below
+
+sub new {
+ my $type = shift;
+ my $self = {};
+ return bless $self, $type;
+}
+
+# Accessors
+sub return_code {
+ my $self = shift;
+ if (@_) {
+ return $self->{return_code} = shift;
+ } else {
+ return $self->{return_code};
+ }
+}
+sub output {
+ my $self = shift;
+ if (@_) {
+ return $self->{output} = shift;
+ } else {
+ return $self->{output};
+ }
+}
+
+sub perf_output {
+ my $self = shift;
+ $_ = $self->{output};
+ /\|(.*)$/;
+ return $1 || "";
+}
+
+sub only_output {
+ my $self = shift;
+ $_ = $self->{output};
+ /(.*?)\|/;
+ return $1 || "";
+}
+
+sub testCmd {
+ my $class = shift;
+ my $command = shift or die "No command passed to testCmd";
+ my $timeout = shift || 120;
+ my $object = $class->new;
+
+ local $SIG{'ALRM'} = sub { die("timeout in command: $command"); };
+ alarm($timeout); # no test should take longer than 120 seconds
+
+ my $output = `$command`;
+ $object->return_code($? >> 8);
+ $_ = $? & 127;
+ if ($_) {
+ die "Got signal $_ for command $command";
+ }
+ chomp $output;
+ $object->output($output);
+
+ alarm(0);
+
+ my ($pkg, $file, $line) = caller(0);
+ print "Testing: $command", $/;
+ if ($ENV{'NPTEST_DEBUG'}) {
+ print "testCmd: Called from line $line in $file", $/;
+ print "Output: ", $object->output, $/;
+ print "Return code: ", $object->return_code, $/;
+ }
+
+ return $object;
+}
+
+# do we have ipv6
+sub has_ipv6 {
+ # assume ipv6 if a ping6 to labs.consol.de works
+ `ping6 -c 1 2a03:3680:0:2::21 2>&1`;
+ if($? == 0) {
+ return 1;
+ }
+ return;
+}
+
+1;
+#
+# End of File
+#
diff --git a/README b/README
new file mode 100644
index 0000000..71b4d37
--- /dev/null
+++ b/README
@@ -0,0 +1,98 @@
+Monitoring Plugins
+==================
+
+* For instructions on installing these plugins for use with your monitoring
+ system, see below. In addition, generic instructions for the GNU
+ toolchain can be found in the `INSTALL` file.
+
+* For major changes between releases, read the `NEWS` file.
+
+* For information on detailed changes that have been made or plugins
+ that have been added, read the `ChangeLog` file.
+
+* Some plugins require that you have additional programs or
+ libraries installed on your system before they can be used. Plugins that
+ are dependent on other programs/libraries that are missing are usually not
+ compiled. Read the `REQUIREMENTS` file for more information.
+
+* Individual plugins are self-documenting. All plugins that comply with
+ the basic guidelines for development will provide detailed help when
+ invoked with the `-h` or `--help` options.
+
+You can check the latest plugins at:
+
+* <https://www.monitoring-plugins.org/>
+
+Send an email to <help@monitoring-plugins.org> for assistance. Please
+include the OS type and version that you are using. Also, run the plugin
+with the `-vvv` option and provide the resulting version information. Of
+course, there may be additional diagnostic information required as well.
+Use good judgment.
+
+Send an email to <devel@monitoring-plugins.org> for developer discussions.
+
+For patch submissions and bug reports, please use the appropriate resources
+at:
+
+* <https://github.com/monitoring-plugins>
+
+
+Installation Instructions
+-------------------------
+
+1. If you are using the Git tree, you will need m4, gettext, automake, and
+ autoconf. To start out, run:
+
+ ./tools/setup
+
+ For more detail, see the developer guidelines at
+ <https://www.monitoring-plugins.org/doc/guidelines.html>.
+
+2. Run the configure script to initialize variables and create a Makefile,
+ etc.
+
+ ./configure --prefix=BASEDIRECTORY --with-cgiurl=SOMEURL
+
+ Replace `BASEDIRECTORY` with the path of the directory under which your
+ monitoring system is installed (default is `/usr/local`), and replace
+ `SOMEURL` with the path used to access the monitoring system CGIs with a
+ web browser (default is `/nagios/cgi-bin`).
+
+3. Compile the plugins with the following command:
+
+ make
+
+4. Install the compiled plugins and plugin scripts with the following
+ command:
+
+ make install
+
+ The installation procedure will attempt to place the plugins in a
+ `libexec/` subdirectory in the base directory you specified with the
+ `--prefix` argument to the configure script.
+
+5. There are some plugins that require setuid. If you run make install as
+ a non-root user, they will not be installed. To install, switch to root
+ and run:
+
+ make install-root
+
+That's it! If you have any problems or questions, feel free to send an
+email to <help@monitoring-plugins.org>.
+
+
+License Notice
+--------------
+
+You can redistribute and/or modify this software under the terms of the GNU
+General Public License as published by the Free Software Foundation; either
+version 3 of the License, or (at your option) any later version; with the
+additional exemption that compiling, linking, and/or using OpenSSL is
+allowed.
+
+This software is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+
+See the `COPYING` file for the complete text of the GNU General Public
+License, version 3.
diff --git a/REQUIREMENTS b/REQUIREMENTS
new file mode 100644
index 0000000..f3b1c01
--- /dev/null
+++ b/REQUIREMENTS
@@ -0,0 +1,111 @@
+Monitoring Plugins Requirements
+--------------------------
+
+Some plugins require that you have additional programs and/or
+libraries installed on your system before they can be used. Plugins
+that are dependent on other programs/libraries that are missing are
+usually not compiled. Requirements for various plugins are listed
+below...
+
+check_ldaps, check_http --ssl, check_tcp --ssl, check_smtp --starttls
+ - Requires openssl or gnutls libraries for SSL connections
+ http://www.openssl.org, http://www.gnu.org/software/gnutls
+
+check_curl:
+ - Requires libcurl 7.15.2 or later
+ http://www.haxx.se
+ - --ssl/-S and -C requires OpenSSL for certificate checks, otherwise
+ libcurl must be quite new to support CURLINFO_CERTINFO with
+ GnuTLS and NSS libraries:
+ - 7.42.0 or newer for GnuTLS
+ - 7.34.0 or newer for NSS
+ GnuTLS is known to create problems on some distributions with
+ self-signed certificate chains
+ http://www.openssl.org, http://www.gnu.org/software/gnutls,
+ http://www.mozilla.org/projects/security/pki/nss/,
+ other SSL implementations are currently not supported
+ - uriparser 0.7.5 or later
+ https://uriparser.github.io/
+
+check_fping:
+ - Requires the fping utility distributed with SATAN. Either
+ download and install SATAN or grab the fping program from
+ http://www.fping.com/
+ RPM: http://rpmfind.net/linux/rpm2html/search.php?query=fping
+ Note that the fping command must be setuid root to function.
+
+check_game:
+ - Requires the qstat utility available from
+ http://sourceforge.net/projects/qstat/
+ Last tested on qstat 2.3d BETA
+
+check_hpjd:
+ - Requires the NET-SNMP package available from
+ http://net-snmp.sourceforge.net/
+ The snmpget binary is all that is required.
+
+check_ldap:
+ - Requires the LDAP libraries available from
+ http://www.openldap.org/
+ Lib: libldap, liblber
+ Redhat Source: openldap-1.2.9-6.i386.rpm, openldap-devel-1.2.9-6.i386.rpm
+
+check_mysql, check_mysql_query:
+ - Requires the MySQL libraries available from
+ http://dev.mysql.com/downloads/
+ Lib: libmysql, libmysqlclient
+ Redhat Source (RHEL6, YUM): mysql-devel, mysql-libs
+ Must have mysql_config in PATH or specified with --with-mysql=DIR for DIR/bin/mysql_config
+
+check_pqsql:
+ - Requires the PostgreSQL libraries available from
+ http://www.postgresql.org/
+
+check_dbi:
+ - Requires the DBI libraries available from
+ http://libdbi.sourceforge.net/
+
+check_radius:
+ - Requires the radcli library available from:
+ http://radcli.github.io/radcli/
+ - As an alternative, the FreeRADIUS Client library may be used:
+ http://freeradius.org/freeradius-client/
+ - As another alternative, the radiusclient-ng library may be used:
+ http://sourceforge.net/projects/radiusclient-ng.berlios/
+ - This plugin also works with the original radiusclient library from
+ ftp://ftp.cityline.net/pub/radiusclient/
+ RPM (rpmfind): radiusclient 0.3.2, radiusclient-devel-0.3.2
+ However, you probably want to use either radcli or the FreeRADIUS
+ Client library, as both radiusclient and radiusclient-ng are
+ unmaintained and have known issues.
+
+check_snmp:
+ - Requires the NET-SNMP package available from
+ http://net-snmp.sourceforge.net/
+
+check_ifstatus/check_ifoperstatus
+ - Requires Net::SNMP perl module
+ http://www.perl.com/CPAN/modules/by-authors/id/D/DT/DTOWN/
+
+check_nwstat:
+ - Requires MRTGEXT NLM for Novell Servers
+ http://forge.novell.com/modules/xfmod/project/?mrtgext
+
+check_nt:
+ - Requires NSClient to run on the NT server to monitor
+ http://nsclient.ready2run.nl/
+
+check_ups:
+ - Requires Network UPS Tools (>= 1.4) to run on the server to monitor
+ http://www.networkupstools.org/
+
+check_ide_smart:
+ - Uses the Linux specific SMART interface [http://smartlinux.sourceforge.net/smart/index.php].
+
+OS Specific Issues
+------------------
+
+HP-UX 11.11
+You need to use the version of gcc provided by HP at version 3.3.3.
+Also, you need GNU make 3.8
+
diff --git a/SUPPORT b/SUPPORT
new file mode 100644
index 0000000..d2a2b7d
--- /dev/null
+++ b/SUPPORT
@@ -0,0 +1,76 @@
+SUPPORT
+
+Using the mailing lists and issue tracker at GitHub are the
+best ways to obtain direct support for the Monitoring Plugins. There may
+also be commercial support options available to you -- check
+http://www.nagios.org/ to track the current status of commercial
+support offerings.
+
+There are two mailing lists associated with Monitoring Plugins development:
+'help' (mailto:help@monitoring-plugins.org), and 'devel'
+(mailto:help@monitoring-plugins.org). Unless you are fairly
+certain you have found a bug or that you are requesting a new feature,
+please direct support requests to 'help'.
+
+Because these lists are handled entirely by volunteers, and because
+these same volunteers are often plugin developers who can also use
+their time to fix bug and provide feature requests, it is generally in
+you interest to do a modest amount of legwork before posting to either
+of these lists.
+
+Plugins that are in the contrib directories are provided as-is. We will
+try to help, but sometimes the plugins have dependencies that the monitoring-plugin
+developers do not have access to. You may be able to try the authors
+directly.
+
+In brief, always provide the version of the software that you are
+using, and when requesting features or reporting bugs, first check to
+see that the issue has not already been addressed in the current Git
+code.
+
+GETTING HELP
+
+Requests to 'help' require posting the version number of the
+plugin. The best place to include the version information is in the
+subject. A good post would have a subject like:
+
+ Can I use SSL with check_imap (monitoring-plugins 1.3.0-beta2) 1.12
+
+If you do not include the version of the plugin, you risk having your
+post silently ignored.
+
+Be advised that the core plugins (and in fact many of the contributed
+plugins) will provide a description of their use when invoked with the
+'--help' option. Please read the help carefully and in it's entirety
+before asking for support.
+
+REPORTING BUGS AND SUBMITTING PATCHES
+
+Bug reports, investigations of possible bugs, feature requests, and
+patch submissions should be submitted to the development list at
+mailto:devel@monitoring-plugins.org. Please raise an issue first
+in GitHub, otherwise your email is likely to be missed over time.
+
+You should identify the version, preferably in the subject line.
+However, to best use developer resources, it is suggested that you
+reference your report to one of the following sources:
+
+ 1) The most recent release, including beta's
+
+ 2) The current snapshots (there's a link provided on
+ https://www.monitoring-plugins.org/download.html)
+
+ 3) The current Git code from GitHub
+
+(This does not mean you should run any of these sources in a
+production environment - the latter two you clearly should
+not. However, if you find a bug, you should determine whether it is
+still present in one of these sources, preferably either (2) or (3)
+which are most recent.)
+
+From experience, I know that most bugs can be fixed with only a few
+more moments work than it takes to determine if the bug is still
+present in the Git tree. If you can save a developer the expense of
+that time, you ensure that bugs are fixed more rapidly, and thus you
+ensure your problem resolution is reflected in a stable release more
+quickly.
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..3376921
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,425 @@
+This software is brought to you by the Monitoring Plugins Development Team. However,
+there have been many contributors to this project. Everyone below has helped in
+raising bug reports, creating patches or contributing new plugins.
+
+Arkadiusz Miśkiewicz
+dag rob?le
+Matthias Döhler
+Marc Sánchez
+Wolfgang Karall-Ahlborn
+Thoralf Rickert-Wendt
+Diego Elio Pettenò
+Nicolai Søborg
+Elan Ruusamäe
+Matthias Hähnel
+fabiodds
+Aksel Sjögren
+Randy O'Meara
+Oskar Ahner
+Lance Albertson
+David Alden
+Patrick Allen
+Paul Allen
+Rodger Allen
+Felipe Gustavo de Almeida
+Michael Almond
+Michael Anthon
+Bernd Apfel
+Bernd Arnold
+Paula Arnold
+Kondoros Attila
+Daniel Austin
+Karol Babioch
+Markus Baertschi
+Bradley Baetz
+Michael Bakker
+Nobuhiro Ban
+John Barbuto
+Andreas Baumann
+Jeremy Baumgartner
+Marco Beck
+Rolf Eike Beer
+Andreas Behal
+Lutz Behnke
+Marlo Bell
+Simon Bellwood
+Hilko Bengen
+Jason Benguerel
+Allan Bennett
+Booker C. Bense
+Björn Berg
+Guy Van Den Bergh
+Andrew Berglund
+Jimmy Bergman
+Jochen Bern
+Tom Bertelston
+Stefan Bethke
+Gunnar Beutner
+Prathamesh Bhanuse
+Daniel Bimschas
+Jeffery Blank
+Tom De Blende
+Robert Bohne
+Eric Bollengier
+Aurelien Bompard
+Stéphane Bortzmeyer
+Alex Bradley
+Andy Brist
+Richard Brodie
+Dominique Broeglin
+Matthew Brown
+Tobias Brox
+Tilmann Bubeck
+Dick van den Burg
+Jason Burnett
+Lucas Bussey
+Grant Byers
+Carlos Canau
+Jethro Carr
+Jim Carroll
+Ian Cass
+Arnold Cavazos
+Patrick Cervicek
+Alex Chaffee
+Yannick Charton
+Stephane Chazelas
+Eric Chen
+Alwyn Cherrington
+Lee Clemens
+Ben Clewett
+Jean-Claude Computing
+Lionel Cons
+Ollie Cook
+Garry Cook
+Charlie Cook
+Luca Corti
+Greg Cox
+Jason Crawford
+David Croft
+Ken D
+Robert Dale
+Vincent Danjean
+Rok Debevc
+Marcos Della
+Phil Dibowitz
+Jason Dixon
+Paul Dlug
+Andy Doran
+Emmanuel Dreyfus
+Rainer Duffner
+Ian Duggan
+Daniël van Eeden
+Edwin Eefting
+Jason Ellison
+Andrew Elwell
+Mike Emigh
+Johannes Engel
+Hans Engelen
+Matthew Ericson
+Andreas Ericsson
+Heiti Ernits
+Ragnar Hojland Espinosa
+Klaus Ethgen
+O'Shaughnessy Evans
+Merijn Evertse
+Karl Ewald
+Mikael Falkvidd
+Guido Falsi
+Paul Farrall
+Reuben Farrelly
+Mark Favas
+Duncan Ferguson
+Juan Carlos Fernandez
+Paulo Afonso Graner Fessel
+Paulo Fessel
+James Fidell
+Tobias Fiebig
+Roman Fiedler
+Johan Fischer
+Bernhard Fischer
+Matthias Flacke
+Martin Foster
+Felix Frank
+Dann Frazier
+Rick Frey
+John C. Frickson
+Markus Frosch
+Matt Garrett
+Tim Gates
+Sven Geggus
+Jonas Genannt
+Robby Giffin
+Flo Gleixner
+Florian Gleixner
+Evgeni Golov
+Joseph Gooch
+Aravind Gottipati
+Kev Green
+Steve Greenland
+Roberto Greiner
+Olaf Greis
+Alex Griffin
+Chris Grim
+Steven Grimm
+Lorenz Gruenwald
+Sebastien Guay
+Linda Guo
+Jon Hallett
+Steve Hanselman
+Ask Bjoern Hansen
+Jacob Hansen
+Sebastian Harl
+Michael Haro
+Olli Hauer
+Gunnar Hellekson
+Stuart Henderson
+Geert Hendrickx
+Sebastian Herbszt
+Johannes Herlitz
+Ian Holsman
+Peter Hoogendijk
+Jason Hoos
+Richard Edward Horner
+Chester Hosey
+Marc Huffnagle
+Kostyantyn Hushchyn
+Bob Ingraham
+Cire Iriarte
+Bryan Irvine
+Valdimir Ivaschenko
+Harald Jenny
+Mark Jewiss
+Simon Kainz
+Nikita Kalabukhov
+Frank Kannemann
+Roy Sigurd Karlsbakk
+Anders Kaseorg
+Jason Kau
+Mark Keisler
+Ryan Kelly
+Matthew Kent
+Matthieu Kermagoret
+Bo Kersey
+Konstantin Khomoutov
+Serhan Kiymaz
+Alexander A. Klimov
+Denis Knauf
+Harald Koch
+Tilman Koschnick
+John Koyle
+Michael Kraus
+Steven Kreuzer
+Julius Kriukas
+Christoph Kron
+Frederic Krueger
+Claudio Kuenzler
+Marcel Kuiper
+Christian Kujau
+Thorsten Kukuk
+Alexander Kulak
+Bill Kunkel
+Thomas Kurschel
+Brian Landers
+Stephane Lapie
+Pascal Larisch
+Charles-Henri Larose
+Tim Laszlo
+Gerhard Lausser
+Lynne Lawrence
+Sakari Lehtonen
+William Leibzon
+Pedro Leite
+Richard Leitner
+Craig Leres
+Laurent Licour
+Oskar Liljeblad
+Joerg Linge
+Jan Lipphaus
+Anton Lofgren
+Florian Lohoff
+Larry Low
+Jacob Lundqvist
+Jason Lunn
+Davide Madrisan
+Guenther Mair
+Pawel Malachowski
+Gerardo Malazdrewicz
+Ricardo Maraschini
+Michael Markstaller
+John Marquart
+Jason Martin
+Ernst-Dieter Martin
+Christopher Maser
+Mathieu Masseboeuf
+Alexander Matey
+Ville Mattila
+Richard Mayhew
+Patrick McAndrew
+Patrick McCormick
+Mike McHenry
+Simon Meggle
+Stefan Meier
+Michael Melcher
+Jan-Piet Mens
+Sven Meyer
+Lars Michelsen
+Emil Michles
+Christian Mies
+Jonathan Milby
+Russell Miller
+Eric J. Mislivec
+Janos Mohacsi
+John Morrissey
+Andreas Motl
+Tomas Mozes
+Gerd Mueller
+Adrian Murphy
+Michael Musikhin
+Damian Myerscough
+Jan-Frode Myklebust
+Sivakumar Nellurandi
+Peter Newman
+Truongchinh Nguyen
+Wolfgang Nieder
+Simon L Nielsen
+Thomas Nilsen
+Sebastian Nohn
+Geoff Oakham
+Walbert Oberngruber
+Christopher Odenbach
+Craig Orsinger
+Vaclav Ovsik
+Remi Paulmier
+Tom Payerle
+Nick Peelman
+Fabian Pehla
+Chris Pepper
+Matt Perry
+Matthew Peters
+William Pietri
+Tomasz Pilat
+Myke Place
+Ari Pollak
+Iustin Pop
+Marc Poulin
+Matt Pounsett
+Peter Pramberger
+Joe Presbrey
+Will Preston
+Platon Pronko
+Arnaud Quette
+Darian Rackham
+Peter Radcliffe
+Steve Rader
+Olivier 'Babar' Raginel
+Jean-François Rameau
+Phil Randal
+Abid Rasheed
+Patrick Rauscher
+Jeremy Reed
+Spenser Reinhardt
+Marc Remy
+Alessandro Ren
+Joe Rhett
+Cliff Rice
+Alain Richard
+Didi Rieder
+Steve Rigler
+Josip Rodin
+Kenny Root
+Wolfgang Rosenauer
+John Rouillard
+Jonathan Rozes
+Fabio Rueda
+Sascha Runschke
+Dietmar Ruzicka
+Ralph Rye
+Alen Salamun
+Sven Schaffranneck
+Christoph Schell
+Thomas Schimpke
+Benjamin Schmid
+Christian Schmidt
+Sebastian Schmidt
+Henning Schmiedehausen
+Christian Schneemann
+Cove Schneider
+Enrico Scholz
+Sebastian Schubert
+Christopher Schultz
+Kristian Schuster
+Franz Schwartau
+Russell Scibetti
+Noel Sebastien
+Andreas Seemueller
+Lonny Selinger
+Nathan Shafer
+Tom Shields
+Barak Shohat
+Sean Shore
+Pall Sigurdsson
+Antony Simmonds
+John Sivak
+Nik Soggia
+Robin Sonefors
+Erwan Ben Souiden
+Bernard Spil
+Lars Stavholm
+Daniel Stirnimann
+Nikolay Sturm
+David Sullivan
+Kjell Sundtjonn
+Ziya Suzen
+Christian Tacke
+Stefan Taferner
+Danijel Tasov
+Michael Tiernan
+Ben Timby
+Ronald Tin
+Ibere Tizio
+Julien Touche
+Gabriele Tozzi
+Kyle Tucker
+Jerome Tytgat
+Daniel Uhlmann
+Patrick Uiterwijk
+Stéphane Urbanovski
+Matthias Urlichs
+Matteo HCE Valsasna
+Jon Vandegrift
+Gianluca Varisco
+Laurent Vaslin
+Matej Vela
+Carole Verdon
+Ludse Verhoeven
+Valentin Vidic
+Robert August Vincent
+Dave Viner
+Lars Vogdt
+Jan Wagner
+Dieter Van de Walle
+John Warburton
+Christian G Warden
+Erik Wasser
+Stuart Webster
+Steve Weinreich
+Erik Welch
+Torsten Werner
+Ben Whaley
+Andrew Widdersheim
+Adrian Wieczorek
+Tobias Wiese
+Sebastian Wiesinger
+Paul Wiggins
+Howard Wilkinson
+Shawn Wills
+Rob Windsor
+Mario Witte
+Alexander Wittig
+Tobias Wolf
+Brian De Wolf
+Eric Wunderlin
+Patric Wust
+Jamie Zawinski
+Vadim Zhukov
+andrew bezella
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..acee3e1
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,77 @@
+dnl @synopsis ACX_WHICH_GETHOSTBYNAME_R
+dnl
+dnl Provides a test to determine the correct way to call gethostbyname_r
+dnl
+dnl defines HAVE_GETHOSTBYNAME_R to the number of arguments required
+dnl
+dnl e.g. 6 arguments (linux)
+dnl e.g. 5 arguments (solaris)
+dnl e.g. 3 arguments (osf/1)
+dnl
+dnl @author Brian Stafford <brian@stafford.uklinux.net>
+dnl
+dnl based on version by Caolan McNamara <caolan@skynet.ie>
+dnl based on David Arnold's autoconf suggestion in the threads faq
+dnl
+AC_DEFUN([ACX_WHICH_GETHOSTBYNAME_R],
+[AC_CACHE_CHECK(number of arguments to gethostbyname_r,
+ acx_which_gethostbyname_r, [
+ AC_TRY_COMPILE([
+# include <netdb.h>
+ ], [
+
+ char *name;
+ struct hostent *he;
+ struct hostent_data data;
+ (void) gethostbyname_r(name, he, &data);
+
+ ],acx_which_gethostbyname_r=3,
+ [
+dnl acx_which_gethostbyname_r=0
+ AC_TRY_COMPILE([
+# include <netdb.h>
+ ], [
+ char *name;
+ struct hostent *he, *res;
+ char *buffer = NULL;
+ int buflen = 2048;
+ int h_errnop;
+ (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
+ ],acx_which_gethostbyname_r=6,
+
+ [
+dnl acx_which_gethostbyname_r=0
+ AC_TRY_COMPILE([
+# include <netdb.h>
+ ], [
+ char *name;
+ struct hostent *he;
+ char *buffer = NULL;
+ int buflen = 2048;
+ int h_errnop;
+ (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
+ ],acx_which_gethostbyname_r=5,acx_which_gethostbyname_r=0)
+
+ ]
+
+ )
+ ]
+ )
+ ])
+
+if test $acx_which_gethostbyname_r -gt 0 ; then
+ AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME_R], $acx_which_gethostbyname_r,
+ [Number of parameters to gethostbyname_r or 0 if not available])
+fi
+
+])
+
+dnl @synopsis ACX_HELP_STRING(OPTION,DESCRIPTION)
+AC_DEFUN([ACX_HELP_STRING],
+ [ $1 builtin([substr],[ ],len($1))[$2]])
+
+
+dnl @synopsis ACX_FEATURE(ENABLE_OR_WITH,NAME[,VALUE])
+AC_DEFUN([ACX_FEATURE],
+ [echo "builtin([substr],[ ],len(--$1-$2))--$1-$2: ifelse($3,,[$]translit($1-$2,-,_),$3)"])
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..fcedd2d
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,4652 @@
+# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
+
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# gettext.m4 serial 71 (gettext-0.20.2)
+dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
+dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and
+dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
+dnl If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl depending on --{enable,disable}-{shared,static} and on the presence of
+dnl AM-DISABLE-SHARED).
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl implementations (in libc or libintl) without the ngettext() function
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries. If empty,
+dnl the value '$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl and used.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl Catalog format: GNU --> install in $(datadir)
+dnl Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl Catalog format: none
+dnl Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+ dnl Argument checking.
+ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
+ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])
+ ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+ [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
+])])
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+ define([gt_included_intl],
+ ifelse([$1], [external], [no], [yes]))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
+
+ AC_REQUIRE([AM_PO_SUBDIRS])dnl
+ ifelse(gt_included_intl, yes, [
+ AC_REQUIRE([AM_INTL_SUBDIR])dnl
+ ])
+
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
+ dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
+ gt_INTL_MACOSX
+
+ dnl Set USE_NLS.
+ AC_REQUIRE([AM_NLS])
+
+ ifelse(gt_included_intl, yes, [
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ ])
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+ ifelse(gt_included_intl, yes, [
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH([included-gettext],
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ ])
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If GNU gettext is available we use this. Else we have
+ dnl to fall back to GNU NLS library.
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+ ]])],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ ifelse(gt_included_intl, yes, , [
+ AM_ICONV_LINK
+ ])
+ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+ dnl even if libiconv doesn't exist.
+ AC_LIB_LINKFLAGS_BODY([intl])
+ AC_CACHE_CHECK([for GNU gettext in libintl],
+ [$gt_func_gnugettext_libintl],
+ [gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ dnl Now see whether libintl exists and does not depend on libiconv.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+ ]])],
+ [eval "$gt_func_gnugettext_libintl=yes"],
+ [eval "$gt_func_gnugettext_libintl=no"])
+ dnl Now see whether libintl exists and depends on libiconv.
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+ ]])],
+ [LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+ ])
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"])
+ fi
+
+ dnl If an already present or preinstalled GNU gettext() is found,
+ dnl use it. But if this macro is used in GNU gettext, and GNU
+ dnl gettext is already preinstalled in libintl, we update this
+ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ dnl Reset the values set by searching for libintl.
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+ dnl GNU gettext is not found in the C library.
+ dnl Fall back on included GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ BUILD_INCLUDED_LIBINTL=yes
+ USE_INCLUDED_LIBINTL=yes
+ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ CATOBJEXT=
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions to use GNU gettext tools.
+ CATOBJEXT=.gmo
+ fi
+ ])
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Some extra flags are needed during linking.
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ AC_DEFINE([ENABLE_NLS], [1],
+ [Define to 1 if translation of program messages to the user's native language
+ is requested.])
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ AC_MSG_CHECKING([whether to use NLS])
+ AC_MSG_RESULT([$USE_NLS])
+ if test "$USE_NLS" = "yes"; then
+ AC_MSG_CHECKING([where the gettext function comes from])
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ AC_MSG_RESULT([$gt_source])
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ AC_MSG_CHECKING([how to link with libintl])
+ AC_MSG_RESULT([$LIBINTL])
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+ fi
+
+ dnl For backward compatibility. Some packages may be using this.
+ AC_DEFINE([HAVE_GETTEXT], [1],
+ [Define if the GNU gettext() function is already present or preinstalled.])
+ AC_DEFINE([HAVE_DCGETTEXT], [1],
+ [Define if the GNU dcgettext() function is already present or preinstalled.])
+ fi
+
+ dnl We need to process the po/ directory.
+ POSUB=po
+ fi
+
+ ifelse(gt_included_intl, yes, [
+ dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
+ dnl because some of the testsuite requires it.
+ BUILD_INCLUDED_LIBINTL=yes
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST([BUILD_INCLUDED_LIBINTL])
+ AC_SUBST([USE_INCLUDED_LIBINTL])
+ AC_SUBST([CATOBJEXT])
+ ])
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLLIBS="$LIBINTL"
+ AC_SUBST([INTLLIBS])
+
+ dnl Make all documented variables known to autoconf.
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ AC_SUBST([POSUB])
+])
+
+
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
+[
+ m4_divert_text([DEFAULTS], [gt_needs=])
+ m4_define([gt_NEEDS_INIT], [])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+
+
+dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
+
+# host-cpu-c-abi.m4 serial 13
+dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible and Sam Steingold.
+
+dnl Sets the HOST_CPU variable to the canonical name of the CPU.
+dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
+dnl C language ABI (application binary interface).
+dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
+dnl config.h.
+dnl
+dnl This canonical name can be used to select a particular assembly language
+dnl source file that will interoperate with C code on the given host.
+dnl
+dnl For example:
+dnl * 'i386' and 'sparc' are different canonical names, because code for i386
+dnl will not run on SPARC CPUs and vice versa. They have different
+dnl instruction sets.
+dnl * 'sparc' and 'sparc64' are different canonical names, because code for
+dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
+dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
+dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
+dnl mode, but not both.
+dnl * 'mips' and 'mipsn32' are different canonical names, because they use
+dnl different argument passing and return conventions for C functions, and
+dnl although the instruction set of 'mips' is a large subset of the
+dnl instruction set of 'mipsn32'.
+dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
+dnl different sizes for the C types like 'int' and 'void *', and although
+dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
+dnl * The same canonical name is used for different endiannesses. You can
+dnl determine the endianness through preprocessor symbols:
+dnl - 'arm': test __ARMEL__.
+dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
+dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
+dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
+dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
+dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
+dnl assembly language source files use such instructions, you will
+dnl need to make the distinction.
+dnl - Speed of execution of the common instruction set is reasonable across
+dnl the entire family of CPUs. If you have assembly language source files
+dnl that are optimized for particular CPU types (like GNU gmp has), you
+dnl will need to make the distinction.
+dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
+AC_DEFUN([gl_HOST_CPU_C_ABI],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_C_ASM])
+ AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
+ [case "$host_cpu" in
+
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=i386
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=x86_64-x32],
+ [gl_cv_host_cpu_c_abi=x86_64])],
+ [gl_cv_host_cpu_c_abi=i386])
+ ;;
+
+changequote(,)dnl
+ alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=alpha
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __aarch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=arm64-ilp32],
+ [gl_cv_host_cpu_c_abi=arm64])],
+ [# Don't distinguish little-endian and big-endian arm, since they
+ # don't require different machine code for simple operations and
+ # since the user can distinguish them through the preprocessor
+ # defines __ARMEL__ vs. __ARMEB__.
+ # But distinguish arm which passes floating-point arguments and
+ # return values in integer registers (r0, r1, ...) - this is
+ # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+ # passes them in float registers (s0, s1, ...) and double registers
+ # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+ # sets the preprocessor defines __ARM_PCS (for the first case) and
+ # __ARM_PCS_VFP (for the second case), but older GCC does not.
+ echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+ # Look for a reference to the register d0 in the .s file.
+ AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+ if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+ gl_cv_host_cpu_c_abi=armhf
+ else
+ gl_cv_host_cpu_c_abi=arm
+ fi
+ rm -f conftest*
+ ])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=hppa64],
+ [gl_cv_host_cpu_c_abi=hppa])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=ia64-ilp32],
+ [gl_cv_host_cpu_c_abi=ia64])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mips64],
+ [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+ # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (_MIPS_SIM == _ABIN32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mipsn32],
+ [gl_cv_host_cpu_c_abi=mips])])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# On powerpc64, there are two ABIs on Linux: The AIX compatible
+ # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _CALL_ELF && _CALL_ELF == 2
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
+ [gl_cv_host_cpu_c_abi=powerpc64])
+ ],
+ [gl_cv_host_cpu_c_abi=powerpc])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi=powerpc
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 2 architectures (with variants): rv32* and rv64*.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if __riscv_xlen == 64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [cpu=riscv64],
+ [cpu=riscv32])
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [main_abi=lp64],
+ [main_abi=ilp32])
+ # Float ABIs:
+ # __riscv_float_abi_double:
+ # 'float' and 'double' are passed in floating-point registers.
+ # __riscv_float_abi_single:
+ # 'float' are passed in floating-point registers.
+ # __riscv_float_abi_soft:
+ # No values are passed in floating-point registers.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_double
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=d],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_single
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=f],
+ [float_abi=''])
+ ])
+ gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=s390x],
+ [gl_cv_host_cpu_c_abi=s390])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=sparc64],
+ [gl_cv_host_cpu_c_abi=sparc])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi="$host_cpu"
+ ;;
+ esac
+ ])
+
+ dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
+ HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+ HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
+ AC_SUBST([HOST_CPU])
+ AC_SUBST([HOST_CPU_C_ABI])
+
+ # This was
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+ # earlier, but KAI C++ 3.2d doesn't like this.
+ sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
+#endif
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
+ AH_TOP([/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+])
+
+])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
+dnl one, or to 'unknown' if unknown.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+ [if test -n "$gl_cv_host_cpu_c_abi"; then
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown ;;
+ esac
+ else
+ case "$host_cpu" in
+
+ # CPUs that only support a 32-bit ABI.
+ arc \
+ | bfin \
+ | cris* \
+ | csky \
+ | epiphany \
+ | ft32 \
+ | h8300 \
+ | m68k \
+ | microblaze | microblazeel \
+ | nds32 | nds32le | nds32be \
+ | nios2 | nios2eb | nios2el \
+ | or1k* \
+ | or32 \
+ | sh | sh[1234] | sh[1234]e[lb] \
+ | tic6x \
+ | xtensa* )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ # CPUs that only support a 64-bit ABI.
+changequote(,)dnl
+ alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ | mmix )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
+
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64) \
+ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=yes],
+ [gl_cv_host_cpu_c_abi_32bit=no])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown
+ ;;
+ esac
+ fi
+ ])
+
+ HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
+
+# iconv.m4 serial 21
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed libiconv and not disabled its use
+ dnl via --without-libiconv-prefix, he wants to use it. The first
+ dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
+ am_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+ AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);]])],
+ [am_cv_func_iconv=yes])
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);]])],
+ [am_cv_lib_iconv=yes]
+ [am_cv_func_iconv=yes])
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
+ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+ dnl Solaris 10.
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ am_cv_func_iconv_works=no
+ for ac_iconv_const in '' 'const'; do
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+ ]],
+ [[int result = 0;
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 1;
+ iconv_close (cd_utf8_to_88591);
+ }
+ }
+ /* Test against Solaris 10 bug: Failures are not distinguishable from
+ successful returns. */
+ {
+ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+ if (cd_ascii_to_88591 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\263";
+ char buf[10];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_ascii_to_88591,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 2;
+ iconv_close (cd_ascii_to_88591);
+ }
+ }
+ /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+ result |= 4;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ result |= 8;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ {
+ /* Try standardized names. */
+ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+ /* Try IRIX, OSF/1 names. */
+ iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+ /* Try AIX names. */
+ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+ /* Try HP-UX names. */
+ iconv_t cd4 = iconv_open ("utf8", "eucJP");
+ if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+ && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+ result |= 16;
+ if (cd1 != (iconv_t)(-1))
+ iconv_close (cd1);
+ if (cd2 != (iconv_t)(-1))
+ iconv_close (cd2);
+ if (cd3 != (iconv_t)(-1))
+ iconv_close (cd3);
+ if (cd4 != (iconv_t)(-1))
+ iconv_close (cd4);
+ }
+ return result;
+]])],
+ [am_cv_func_iconv_works=yes], ,
+ [case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac])
+ test "$am_cv_func_iconv_works" = no || break
+ done
+ LIBS="$am_save_LIBS"
+ ])
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+ AC_DEFINE([HAVE_ICONV], [1],
+ [Define if you have the iconv() function and it works.])
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ AC_MSG_CHECKING([how to link with libiconv])
+ AC_MSG_RESULT([$LIBICONV])
+ else
+ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+ dnl either.
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+ AC_SUBST([LIBICONV])
+ AC_SUBST([LTLIBICONV])
+])
+
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
+dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl warnings.
+m4_define([gl_iconv_AC_DEFUN],
+ m4_version_prereq([2.64],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [m4_ifdef([gl_00GNULIB],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]])]))
+gl_iconv_AC_DEFUN([AM_ICONV],
+[
+ AM_ICONV_LINK
+ if test "$am_cv_func_iconv" = yes; then
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL([am_cv_proto_iconv], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+ ]],
+ [[]])],
+ [am_cv_proto_iconv_arg1=""],
+ [am_cv_proto_iconv_arg1="const"])
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([
+ $am_cv_proto_iconv])
+ else
+ dnl When compiling GNU libiconv on a system that does not have iconv yet,
+ dnl pick the POSIX compliant declaration without 'const'.
+ am_cv_proto_iconv_arg1=""
+ fi
+ AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+ [Define as const if the declaration of iconv() needs const.])
+ dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+ m4_ifdef([gl_ICONV_H_DEFAULTS],
+ [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test -n "$am_cv_proto_iconv_arg1"; then
+ ICONV_CONST="const"
+ fi
+ ])
+])
+
+# intlmacosx.m4 serial 8 (gettext-0.20.2)
+dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Checks for special options needed on Mac OS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
+[
+ dnl Check for API introduced in Mac OS X 10.4.
+ AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+ [gt_cv_func_CFPreferencesCopyAppValue],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <CoreFoundation/CFPreferences.h>]],
+ [[CFPreferencesCopyAppValue(NULL, NULL)]])],
+ [gt_cv_func_CFPreferencesCopyAppValue=yes],
+ [gt_cv_func_CFPreferencesCopyAppValue=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+ AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
+ [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+ fi
+ dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
+ dnl because in macOS 10.13.4 it has the following behaviour:
+ dnl When two or more languages are specified in the
+ dnl "System Preferences > Language & Region > Preferred Languages" panel,
+ dnl it returns en_CC where CC is the territory (even when English is not among
+ dnl the preferred languages!). What we want instead is what
+ dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
+ dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
+ dnl first among the preferred languages and CC is the territory.
+ AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <CoreFoundation/CFLocale.h>]],
+ [[CFLocaleCopyPreferredLanguages();]])],
+ [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
+ [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+ AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
+ [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
+ fi
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+ AC_SUBST([INTL_MACOSX_LIBS])
+])
+
+# lib-ld.m4 serial 9
+dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
+dnl collision with libtool.m4.
+
+dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes
+ ;;
+*)
+ acl_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-2.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld [default=no]])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+if test -n "$LD"; then
+ AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
+ AC_MSG_CHECKING([for ld used by $CC])
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+if test -n "$LD"; then
+ # Let the user override the test with a path.
+ :
+else
+ AC_CACHE_VAL([acl_cv_path_LD],
+ [
+ acl_cv_path_LD= # Final result of this test
+ ac_prog=ld # Program to search in $PATH
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $acl_output in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+ while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+ acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+ done
+ # Got the pathname. No search in PATH is needed.
+ acl_cv_path_LD="$acl_output"
+ ac_prog=
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+ fi
+ if test -n "$ac_prog"; then
+ # Search for $ac_prog in $PATH.
+ acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$acl_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_ifs"
+ fi
+ case $host in
+ *-*-aix*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# The compiler produces 64-bit code. Add option '-b64' so that the
+ # linker groks 64-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -b64 "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+ esac
+ ], [])
+ ;;
+ sparc64-*-netbsd*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [],
+ [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
+ # so that the linker groks 32-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -m elf32_sparc "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+ esac
+ ])
+ ;;
+ esac
+ ])
+ LD="$acl_cv_path_LD"
+fi
+if test -n "$LD"; then
+ AC_MSG_RESULT([$LD])
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([no acceptable ld found in \$PATH])
+fi
+AC_LIB_PROG_LD_GNU
+])
+
+# lib-link.m4 serial 31
+dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.61])
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+ dnl results of this search when this library appears as a dependency.
+ HAVE_LIB[]NAME=yes
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+
+ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+ dnl accordingly.
+ AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+ dnl because if the user has installed lib[]Name and not disabled its use
+ dnl via --without-lib[]Name-prefix, he wants to use it.
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+ ac_save_LIBS="$LIBS"
+ dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
+ dnl because these -l options might require -L options that are present in
+ dnl LIBS. -l options benefit only from the -L options listed before it.
+ dnl Otherwise, add it to the front of LIBS, because it may be a static
+ dnl library that depends on another static library that is present in LIBS.
+ dnl Static libraries benefit only from the static libraries listed after
+ dnl it.
+ case " $LIB[]NAME" in
+ *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
+ *) LIBS="$LIB[]NAME $LIBS" ;;
+ esac
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[$3]], [[$4]])],
+ [ac_cv_lib[]Name=yes],
+ [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib[]Name" = yes; then
+ HAVE_LIB[]NAME=yes
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
+ AC_MSG_CHECKING([how to link with lib[]$1])
+ AC_MSG_RESULT([$LIB[]NAME])
+ else
+ HAVE_LIB[]NAME=no
+ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+ dnl $INC[]NAME either.
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIB[]NAME=
+ LTLIB[]NAME=
+ LIB[]NAME[]_PREFIX=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl acl_libext,
+dnl acl_shlibext,
+dnl acl_libname_spec,
+dnl acl_library_names_spec,
+dnl acl_hardcode_libdir_flag_spec,
+dnl acl_hardcode_libdir_separator,
+dnl acl_hardcode_direct,
+dnl acl_hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ dnl Complain if config.rpath is missing.
+ AC_REQUIRE_AUX_FILE([config.rpath])
+ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
+ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
+ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+ AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+ ])
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE([rpath],
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
+])
+
+dnl AC_LIB_FROMPACKAGE(name, package)
+dnl declares that libname comes from the given package. The configure file
+dnl will then not have a --with-libname-prefix option but a
+dnl --with-package-prefix option. Several libraries can come from the same
+dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
+dnl macro call that searches for libname.
+AC_DEFUN([AC_LIB_FROMPACKAGE],
+[
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ define([acl_frompackage_]NAME, [$2])
+ popdef([NAME])
+ pushdef([PACK],[$2])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ define([acl_libsinpackage_]PACKUP,
+ m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
+ popdef([PACKUP])
+ popdef([PACK])
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+ ])
+ AC_ARG_WITH(PACK[-prefix],
+[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
+ --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ additional_libdir2="$withval/$acl_libdirstem2"
+ additional_libdir3="$withval/$acl_libdirstem3"
+ fi
+ fi
+])
+ if test "X$additional_libdir2" = "X$additional_libdir"; then
+ additional_libdir2=
+ fi
+ if test "X$additional_libdir3" = "X$additional_libdir"; then
+ additional_libdir3=
+ fi
+ dnl Search the library and its dependencies in $additional_libdir and
+ dnl $LDFLAGS. Using breadth-first-seach.
+ LIB[]NAME=
+ LTLIB[]NAME=
+ INC[]NAME=
+ LIB[]NAME[]_PREFIX=
+ dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+ dnl computed. So it has to be reset here.
+ HAVE_LIB[]NAME=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='$1 $2'
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+ dnl or AC_LIB_HAVE_LINKFLAGS call.
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+ else
+ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+ dnl that this library doesn't exist. So just drop it.
+ :
+ fi
+ else
+ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+ dnl and the already constructed $LIBNAME/$LTLIBNAME.
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+ if test "X$found_dir" = "X"; then
+ eval dir=\$$additional_libdir_variable
+ if test -n "$dir"; then
+ dnl The same code as in the loop below:
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ dnl Found the library.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ dnl Linking with a shared library. We attempt to hardcode its
+ dnl directory into the executable's runpath, unless it's the
+ dnl standard /usr/lib.
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
+ dnl No hardcoding is needed.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ dnl The hardcoding into $LIBNAME is system dependent.
+ if test "$acl_hardcode_direct" = yes; then
+ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+ dnl resulting binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode DIR into the resulting
+ dnl binary.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ dnl Rely on "-L$found_dir".
+ dnl But don't add it if it's already contained in the LDFLAGS
+ dnl or the already constructed $LIBNAME
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ else
+ dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
+ dnl here, because this doesn't fit in flags passed to the
+ dnl compiler. So give up. No hardcoding. This affects only
+ dnl very old systems.
+ dnl FIXME: Not sure whether we should use
+ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+ dnl here.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ dnl Linking with a static library.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+ else
+ dnl We shouldn't come here, but anyway it's good to have a
+ dnl fallback.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+ fi
+ fi
+ dnl Assume the include files are nearby.
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem3 | */$acl_libdirstem3/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ dnl Potentially add $additional_includedir to $INCNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 3. if it's already present in $CPPFLAGS or the already
+ dnl constructed $INCNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INC[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $INCNAME.
+ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ dnl Look for dependencies.
+ if test -n "$found_la"; then
+ dnl Read the .la file. It defines the variables
+ dnl dlname, library_names, old_library, dependency_libs, current,
+ dnl age, revision, installed, dlopen, dlpreopen, libdir.
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ dnl We use only dependency_libs.
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 3. if it's already present in $LDFLAGS or the already
+ dnl constructed $LIBNAME,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
+ haveit=
+ if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ dnl Handle this in the next round.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ dnl Handle this in the next round. Throw away the .la's
+ dnl directory; it is already contained in a preceding -L
+ dnl option.
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ dnl Most likely an immediate library name.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ dnl Didn't find the library; assume it is in the system directories
+ dnl known to the linker and runtime loader. (All the system
+ dnl directories known to the linker should also be known to the
+ dnl runtime loader, otherwise the system is severely misconfigured.)
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user must
+ dnl pass all path elements in one option. We can arrange that for a
+ dnl single library, but not when more than one $LIBNAMEs are used.
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ dnl When using libtool, the option that works for both libraries and
+ dnl executables is -R. The -R options are cumulative.
+ for found_dir in $ltrpathdirs; do
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+ done
+ fi
+ popdef([PACKLIBS])
+ popdef([PACKUP])
+ popdef([PACK])
+ popdef([NAME])
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+ for element in [$2]; do
+ haveit=
+ for x in $[$1]; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ [$1]="${[$1]}${[$1]:+ }$element"
+ fi
+ done
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+ AC_REQUIRE([AC_LIB_RPATH])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ $1=
+ if test "$enable_rpath" != no; then
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode directories into the resulting
+ dnl binary.
+ rpathdirs=
+ next=
+ for opt in $2; do
+ if test -n "$next"; then
+ dir="$next"
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next=
+ else
+ case $opt in
+ -L) next=yes ;;
+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next= ;;
+ *) next= ;;
+ esac
+ fi
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n ""$3""; then
+ dnl libtool is used for linking. Use -R options.
+ for dir in $rpathdirs; do
+ $1="${$1}${$1:+ }-R$dir"
+ done
+ else
+ dnl The linker is used for linking directly.
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user
+ dnl must pass all path elements in one option.
+ alldirs=
+ for dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="${$1}${$1:+ }$flag"
+ done
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([$1])
+])
+
+# lib-prefix.m4 serial 17
+dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ dnl By default, look in $includedir and $libdir.
+ use_additional=yes
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ AC_ARG_WITH([lib-prefix],
+[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir]],
+[
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+ AC_LIB_WITH_FINAL_PREFIX([
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ ])
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ fi
+ fi
+])
+ if test $use_additional = yes; then
+ dnl Potentially add $additional_includedir to $CPPFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/include,
+ dnl 2. if it's already present in $CPPFLAGS,
+ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ for x in $CPPFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ dnl Really add $additional_includedir to $CPPFLAGS.
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ dnl Potentially add $additional_libdir to $LDFLAGS.
+ dnl But don't add it
+ dnl 1. if it's the standard /usr/lib,
+ dnl 2. if it's already present in $LDFLAGS,
+ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
+ dnl 4. if it doesn't exist as a directory.
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+ haveit=
+ for x in $LDFLAGS; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ if test "X$x" = "X-L$additional_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux*) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ if test -d "$additional_libdir"; then
+ dnl Really add $additional_libdir to $LDFLAGS.
+ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+ fi
+ fi
+ fi
+ fi
+ fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+ dnl Unfortunately, prefix and exec_prefix get only finally determined
+ dnl at the end of configure.
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ $1
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates
+dnl - a function acl_is_expected_elfclass, that tests whether standard input
+dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
+dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
+dnl the basename of the libdir to try in turn, either "lib" or "lib64" or
+dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib, lib32, and lib64.
+ dnl On most glibc systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
+ dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
+ dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
+ dnl We determine the compiler's default mode by looking at the compiler's
+ dnl library search path. If at least one of its elements ends in /lib64 or
+ dnl points to a directory whose absolute pathname ends in /lib64, we use that
+ dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
+ dnl namely "lib".
+ dnl On Solaris systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
+ dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
+ AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
+ [AC_EGREP_CPP([Extensible Linking Format],
+ [#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_elf=yes],
+ [gl_cv_elf=no])
+ ])
+ if test $gl_cv_elf; then
+ # Extract the ELF class of a file (5th byte) in decimal.
+ # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+ if od -A x < /dev/null >/dev/null 2>/dev/null; then
+ # Use POSIX od.
+ func_elfclass ()
+ {
+ od -A n -t d1 -j 4 -N 1
+ }
+ else
+ # Use BSD hexdump.
+ func_elfclass ()
+ {
+ dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+ echo
+ }
+ fi
+changequote(,)dnl
+ case $HOST_CPU_C_ABI_32BIT in
+ yes)
+ # 32-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ test "`func_elfclass | sed -e 's/[ ]//g'`" = 1
+ }
+ ;;
+ no)
+ # 64-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ test "`func_elfclass | sed -e 's/[ ]//g'`" = 2
+ }
+ ;;
+ *)
+ # Unknown.
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ ;;
+ esac
+changequote([,])dnl
+ else
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ fi
+
+ dnl Allow the user to override the result by setting acl_cv_libdirstems.
+ AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
+ [acl_cv_libdirstems],
+ [dnl Try 'lib' first, because that's the default for libdir in GNU, see
+ dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ acl_libdirstem3=
+ case "$host_os" in
+ solaris*)
+ dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+ dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
+ dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+ dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+ dnl symlink is missing, so we set acl_libdirstem2 too.
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ acl_libdirstem2=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem3=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ dnl If $CC generates code for a 32-bit ABI, the libraries are
+ dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
+ dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
+ dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
+ dnl Find the compiler's search path. However, non-system compilers
+ dnl sometimes have odd library search paths. But we can't simply invoke
+ dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
+ dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
+ searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test $HOST_CPU_C_ABI_32BIT != no; then
+ # 32-bit or unknown ABI.
+ if test -d /usr/lib32; then
+ acl_libdirstem2=lib32
+ fi
+ fi
+ if test $HOST_CPU_C_ABI_32BIT != yes; then
+ # 64-bit or unknown ABI.
+ if test -d /usr/lib64; then
+ acl_libdirstem3=lib64
+ fi
+ fi
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64 ) acl_libdirstem3=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ if test $HOST_CPU_C_ABI_32BIT = yes; then
+ # 32-bit ABI.
+ acl_libdirstem3=
+ fi
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ # 64-bit ABI.
+ acl_libdirstem2=
+ fi
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+ test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+ acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+ ])
+ dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
+ dnl acl_libdirstem3.
+changequote(,)dnl
+ acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+ acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+ acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+changequote([,])dnl
+])
+
+# nls.m4 serial 6 (gettext-0.20.2)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free
+dnl Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_NLS],
+[
+ AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE([nls],
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT([$USE_NLS])
+ AC_SUBST([USE_NLS])
+])
+
+# po.m4 serial 31 (gettext-0.20.2)
+dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.60])
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+ AC_REQUIRE([AC_PROG_SED])dnl
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Release version of the gettext macros. This is used to ensure that
+ dnl the gettext macros and po/Makefile.in.in are in sync.
+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.20])
+
+ dnl Perform the following tests also if --disable-nls has been given,
+ dnl because they are needed for "make dist" to work.
+
+ dnl Search for GNU msgfmt in the PATH.
+ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+ dnl The second test excludes FreeBSD msgfmt.
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
+
+ dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([GMSGFMT_015])
+
+ dnl Search for GNU xgettext 0.12 or newer in the PATH.
+ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+ dnl The second test excludes FreeBSD xgettext.
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+ :)
+ dnl Remove leftover from FreeBSD xgettext call.
+ rm -f messages.po
+
+ dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([XGETTEXT_015])
+
+ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+ dnl Test whether it is GNU msgmerge >= 0.20.
+ if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
+ MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
+ else
+ dnl Test whether it is GNU msgmerge >= 0.12.
+ if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
+ MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
+ else
+ dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is
+ dnl slow. But this is not a big problem, as such old gettext versions are
+ dnl hardly in use any more.
+ MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
+ fi
+ fi
+ AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
+
+ dnl Support for AM_XGETTEXT_OPTION.
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+ AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
+
+ AC_CONFIG_COMMANDS([po-directories], [[
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ gt_tab=`printf '\t'`
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done]],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
+ OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+ # When this code is run, in config.status, two variables have already been
+ # set:
+ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+ # - LINGUAS is the value of the environment variable LINGUAS at configure
+ # time.
+
+changequote(,)dnl
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ # Find a way to echo strings without interpreting backslash.
+ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='echo'
+ else
+ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+ gt_echo='printf %s\n'
+ else
+ echo_func () {
+ cat <<EOT
+$*
+EOT
+ }
+ gt_echo='echo_func'
+ fi
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+ tab=`printf '\t'`
+ sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
+ # Seen the first line of the variable definition.
+ s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
+ ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+ # Set POTFILES to the value of the Makefile variable POTFILES.
+ sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+ # Compute POTFILES_DEPS as
+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+ POTFILES_DEPS=
+ for file in $POTFILES; do
+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+ done
+ POMAKEFILEDEPS=""
+
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+ ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ # Compute PROPERTIESFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties)
+ # Compute CLASSFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class)
+ # Compute QMFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+ # Compute MSGFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+ # Compute RESOURCESDLLFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ PROPERTIESFILES=
+ CLASSFILES=
+ QMFILES=
+ MSGFILES=
+ RESOURCESDLLFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties"
+ CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class"
+ QMFILES="$QMFILES $srcdirpre$lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ JAVACATALOGS=
+ QTCATALOGS=
+ TCLCATALOGS=
+ CSHARPCATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+ QTCATALOGS="$QTCATALOGS $lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ fi
+
+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+ tab=`printf '\t'`
+ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+ # Add dependencies that cannot be formulated as a simple suffix rule.
+ for lang in $ALL_LINGUAS; do
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if test -n "$POMAKEFILEDEPS"; then
+ cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+ fi
+ mv "$ac_file.tmp" "$ac_file"
+])
+
+dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
+AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
+[
+ XGETTEXT_EXTRA_OPTIONS=
+])
+
+dnl Registers an option to be passed to xgettext in the po subdirectory.
+AC_DEFUN([AM_XGETTEXT_OPTION],
+[
+ AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
+])
+
+# progtest.m4 serial 8 (gettext-0.20.2)
+dnl Copyright (C) 1996-2003, 2005, 2008-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+AC_PREREQ([2.50])
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL([ac_cv_path_$1],
+[case "[$]$1" in
+ [[\\/]]* | ?:[[\\/]]*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+ AC_MSG_RESULT([$][$1])
+else
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST([$1])dnl
+])
+
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.16'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.16.3], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.16.3])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_COND_IF -*- Autoconf -*-
+
+# Copyright (C) 2008-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_COND_IF
+# _AM_COND_ELSE
+# _AM_COND_ENDIF
+# --------------
+# These macros are only used for tracing.
+m4_define([_AM_COND_IF])
+m4_define([_AM_COND_ELSE])
+m4_define([_AM_COND_ENDIF])
+
+# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
+# ---------------------------------------
+# If the shell condition COND is true, execute IF-TRUE, otherwise execute
+# IF-FALSE. Allow automake to learn about conditional instantiating macros
+# (the AC_CONFIG_FOOS).
+AC_DEFUN([AM_COND_IF],
+[m4_ifndef([_AM_COND_VALUE_$1],
+ [m4_fatal([$0: no such condition "$1"])])dnl
+_AM_COND_IF([$1])dnl
+if test -z "$$1_TRUE"; then :
+ m4_n([$2])[]dnl
+m4_ifval([$3],
+[_AM_COND_ELSE([$1])dnl
+else
+ $3
+])dnl
+_AM_COND_ENDIF([$1])dnl
+fi[]dnl
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE="gmake" (or whatever is
+ necessary). You can also try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/libcurl.m4])
+m4_include([m4/np_mysqlclient.m4])
+m4_include([m4/uriparser.m4])
+m4_include([gl/m4/00gnulib.m4])
+m4_include([gl/m4/__inline.m4])
+m4_include([gl/m4/absolute-header.m4])
+m4_include([gl/m4/af_alg.m4])
+m4_include([gl/m4/alloca.m4])
+m4_include([gl/m4/arpa_inet_h.m4])
+m4_include([gl/m4/assert_h.m4])
+m4_include([gl/m4/base64.m4])
+m4_include([gl/m4/btowc.m4])
+m4_include([gl/m4/builtin-expect.m4])
+m4_include([gl/m4/byteswap.m4])
+m4_include([gl/m4/c-bool.m4])
+m4_include([gl/m4/calloc.m4])
+m4_include([gl/m4/close.m4])
+m4_include([gl/m4/codeset.m4])
+m4_include([gl/m4/double-slash-root.m4])
+m4_include([gl/m4/dup2.m4])
+m4_include([gl/m4/eealloc.m4])
+m4_include([gl/m4/environ.m4])
+m4_include([gl/m4/errno_h.m4])
+m4_include([gl/m4/error.m4])
+m4_include([gl/m4/exponentd.m4])
+m4_include([gl/m4/extensions.m4])
+m4_include([gl/m4/extern-inline.m4])
+m4_include([gl/m4/fcntl-o.m4])
+m4_include([gl/m4/fcntl.m4])
+m4_include([gl/m4/fcntl_h.m4])
+m4_include([gl/m4/fflush.m4])
+m4_include([gl/m4/float_h.m4])
+m4_include([gl/m4/floorf.m4])
+m4_include([gl/m4/fopen.m4])
+m4_include([gl/m4/fpurge.m4])
+m4_include([gl/m4/freading.m4])
+m4_include([gl/m4/free.m4])
+m4_include([gl/m4/fseek.m4])
+m4_include([gl/m4/fseeko.m4])
+m4_include([gl/m4/fstat.m4])
+m4_include([gl/m4/fstypename.m4])
+m4_include([gl/m4/fsusage.m4])
+m4_include([gl/m4/ftell.m4])
+m4_include([gl/m4/ftello.m4])
+m4_include([gl/m4/getaddrinfo.m4])
+m4_include([gl/m4/getdelim.m4])
+m4_include([gl/m4/getdtablesize.m4])
+m4_include([gl/m4/gethostname.m4])
+m4_include([gl/m4/getline.m4])
+m4_include([gl/m4/getloadavg.m4])
+m4_include([gl/m4/getopt.m4])
+m4_include([gl/m4/getprogname.m4])
+m4_include([gl/m4/gl-openssl.m4])
+m4_include([gl/m4/gnulib-common.m4])
+m4_include([gl/m4/gnulib-comp.m4])
+m4_include([gl/m4/hostent.m4])
+m4_include([gl/m4/idpriv.m4])
+m4_include([gl/m4/include_next.m4])
+m4_include([gl/m4/inet_ntop.m4])
+m4_include([gl/m4/intmax_t.m4])
+m4_include([gl/m4/inttypes.m4])
+m4_include([gl/m4/inttypes_h.m4])
+m4_include([gl/m4/langinfo_h.m4])
+m4_include([gl/m4/largefile.m4])
+m4_include([gl/m4/libtool.m4])
+m4_include([gl/m4/limits-h.m4])
+m4_include([gl/m4/localcharset.m4])
+m4_include([gl/m4/locale-fr.m4])
+m4_include([gl/m4/locale-ja.m4])
+m4_include([gl/m4/locale-zh.m4])
+m4_include([gl/m4/locale_h.m4])
+m4_include([gl/m4/localeconv.m4])
+m4_include([gl/m4/lock.m4])
+m4_include([gl/m4/lseek.m4])
+m4_include([gl/m4/ltoptions.m4])
+m4_include([gl/m4/ltsugar.m4])
+m4_include([gl/m4/ltversion.m4])
+m4_include([gl/m4/lt~obsolete.m4])
+m4_include([gl/m4/malloc.m4])
+m4_include([gl/m4/malloca.m4])
+m4_include([gl/m4/math_h.m4])
+m4_include([gl/m4/mbrtowc.m4])
+m4_include([gl/m4/mbsinit.m4])
+m4_include([gl/m4/mbstate_t.m4])
+m4_include([gl/m4/mbtowc.m4])
+m4_include([gl/m4/memchr.m4])
+m4_include([gl/m4/minmax.m4])
+m4_include([gl/m4/mktime.m4])
+m4_include([gl/m4/mmap-anon.m4])
+m4_include([gl/m4/mode_t.m4])
+m4_include([gl/m4/mountlist.m4])
+m4_include([gl/m4/msvc-inval.m4])
+m4_include([gl/m4/msvc-nothrow.m4])
+m4_include([gl/m4/multiarch.m4])
+m4_include([gl/m4/netdb_h.m4])
+m4_include([gl/m4/netinet_in_h.m4])
+m4_include([gl/m4/nl_langinfo.m4])
+m4_include([gl/m4/nocrash.m4])
+m4_include([gl/m4/off_t.m4])
+m4_include([gl/m4/open-cloexec.m4])
+m4_include([gl/m4/open-slash.m4])
+m4_include([gl/m4/open.m4])
+m4_include([gl/m4/pathmax.m4])
+m4_include([gl/m4/pid_t.m4])
+m4_include([gl/m4/printf.m4])
+m4_include([gl/m4/pthread_rwlock_rdlock.m4])
+m4_include([gl/m4/realloc.m4])
+m4_include([gl/m4/reallocarray.m4])
+m4_include([gl/m4/regex.m4])
+m4_include([gl/m4/servent.m4])
+m4_include([gl/m4/setenv.m4])
+m4_include([gl/m4/setlocale_null.m4])
+m4_include([gl/m4/sha256.m4])
+m4_include([gl/m4/size_max.m4])
+m4_include([gl/m4/snprintf.m4])
+m4_include([gl/m4/socketlib.m4])
+m4_include([gl/m4/sockets.m4])
+m4_include([gl/m4/socklen.m4])
+m4_include([gl/m4/sockpfaf.m4])
+m4_include([gl/m4/ssize_t.m4])
+m4_include([gl/m4/stat-time.m4])
+m4_include([gl/m4/stat.m4])
+m4_include([gl/m4/std-gnu11.m4])
+m4_include([gl/m4/stdalign.m4])
+m4_include([gl/m4/stddef_h.m4])
+m4_include([gl/m4/stdint.m4])
+m4_include([gl/m4/stdint_h.m4])
+m4_include([gl/m4/stdio_h.m4])
+m4_include([gl/m4/stdlib_h.m4])
+m4_include([gl/m4/strcase.m4])
+m4_include([gl/m4/strcasestr.m4])
+m4_include([gl/m4/strerror.m4])
+m4_include([gl/m4/string_h.m4])
+m4_include([gl/m4/strings_h.m4])
+m4_include([gl/m4/strsep.m4])
+m4_include([gl/m4/strstr.m4])
+m4_include([gl/m4/sys_socket_h.m4])
+m4_include([gl/m4/sys_stat_h.m4])
+m4_include([gl/m4/sys_types_h.m4])
+m4_include([gl/m4/sys_uio_h.m4])
+m4_include([gl/m4/threadlib.m4])
+m4_include([gl/m4/time_h.m4])
+m4_include([gl/m4/time_r.m4])
+m4_include([gl/m4/timegm.m4])
+m4_include([gl/m4/ungetc.m4])
+m4_include([gl/m4/unistd_h.m4])
+m4_include([gl/m4/unlocked-io.m4])
+m4_include([gl/m4/vararrays.m4])
+m4_include([gl/m4/vasnprintf.m4])
+m4_include([gl/m4/vasprintf.m4])
+m4_include([gl/m4/visibility.m4])
+m4_include([gl/m4/vsnprintf.m4])
+m4_include([gl/m4/warn-on-use.m4])
+m4_include([gl/m4/wchar_h.m4])
+m4_include([gl/m4/wchar_t.m4])
+m4_include([gl/m4/wcrtomb.m4])
+m4_include([gl/m4/wctype_h.m4])
+m4_include([gl/m4/wint_t.m4])
+m4_include([gl/m4/xalloc.m4])
+m4_include([gl/m4/xsize.m4])
+m4_include([gl/m4/zzgnulib.m4])
+m4_include([acinclude.m4])
diff --git a/build-aux/config.guess b/build-aux/config.guess
new file mode 100755
index 0000000..f50dcdb
--- /dev/null
+++ b/build-aux/config.guess
@@ -0,0 +1,1480 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2018 Free Software Foundation, Inc.
+
+timestamp='2018-02-24'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <config-patches@gnu.org>.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Options:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2018 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > "$dummy.c" ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "$UNAME_SYSTEM" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval "$set_cc_for_build"
+ cat <<-EOF > "$dummy.c"
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+ # If ldd exists, use it to detect musl libc.
+ if command -v ldd >/dev/null && \
+ ldd --version 2>&1 | grep -q ^musl
+ then
+ LIBC=musl
+ fi
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ "/sbin/$sysctl" 2>/dev/null || \
+ "/usr/sbin/$sysctl" 2>/dev/null || \
+ echo unknown)`
+ case "$UNAME_MACHINE_ARCH" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine="${arch}${endian}"-unknown
+ ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently (or will in the future) and ABI.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ os=netbsdelf
+ ;;
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval "$set_cc_for_build"
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # Determine ABI tags.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "$UNAME_VERSION" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "$machine-${os}${release}${abi}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
+ exit ;;
+ *:SolidBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:MirBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:Sortix:*:*)
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Redox:*:*)
+ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE=alpha ;;
+ "EV5 (21164)")
+ UNAME_MACHINE=alphaev5 ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE=alphaev56 ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE=alphapca56 ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE=alphapca57 ;;
+ "EV6 (21264)")
+ UNAME_MACHINE=alphaev6 ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE=alphaev67 ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE=alphaev69 ;;
+ "EV7 (21364)")
+ UNAME_MACHINE=alphaev7 ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE=alphaev79 ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo "$UNAME_MACHINE"-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo "$UNAME_MACHINE"-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix"$UNAME_RELEASE"
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux"$UNAME_RELEASE"
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval "$set_cc_for_build"
+ SUN_ARCH=i386
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH=x86_64
+ fi
+ fi
+ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos"$UNAME_RELEASE"
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos"$UNAME_RELEASE"
+ ;;
+ sun4)
+ echo sparc-sun-sunos"$UNAME_RELEASE"
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint"$UNAME_RELEASE"
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint"$UNAME_RELEASE"
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint"$UNAME_RELEASE"
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten"$UNAME_RELEASE"
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten"$UNAME_RELEASE"
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos"$UNAME_RELEASE"
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
+ then
+ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+ [ "$TARGET_BINARY_INTERFACE"x = x ]
+ then
+ echo m88k-dg-dgux"$UNAME_RELEASE"
+ else
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+ fi
+ else
+ echo i586-dg-dgux"$UNAME_RELEASE"
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ fi
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+ else
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ fi
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "$sc_cpu_version" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "$sc_kernel_bits" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "$HP_ARCH" = "" ]; then
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ "$HP_ARCH" = hppa2.0w ]
+ then
+ eval "$set_cc_for_build"
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH=hppa2.0w
+ else
+ HP_ARCH=hppa64
+ fi
+ fi
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux"$HPUX_REV"
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo "$UNAME_MACHINE"-unknown-osf1mk
+ else
+ echo "$UNAME_MACHINE"-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ *:BSD/OS:*:*)
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case "$UNAME_PROCESSOR" in
+ amd64)
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
+ esac
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
+ exit ;;
+ i*:CYGWIN*:*)
+ echo "$UNAME_MACHINE"-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo "$UNAME_MACHINE"-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo "$UNAME_MACHINE"-pc-mingw32
+ exit ;;
+ *:MSYS*:*)
+ echo "$UNAME_MACHINE"-pc-msys
+ exit ;;
+ i*:PW*:*)
+ echo "$UNAME_MACHINE"-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case "$UNAME_MACHINE" in
+ x86)
+ echo i586-pc-interix"$UNAME_RELEASE"
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ esac ;;
+ i*:UWIN*:*)
+ echo "$UNAME_MACHINE"-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
+ exit ;;
+ i*86:Minix:*:*)
+ echo "$UNAME_MACHINE"-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ arm*:Linux:*:*)
+ eval "$set_cc_for_build"
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
+ else
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ cris:Linux:*:*)
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ crisv32:Linux:*:*)
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ e2k:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ frv:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ hexagon:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:Linux:*:*)
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+ exit ;;
+ ia64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ k1om:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ m32r*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ m68*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+ test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
+ ;;
+ mips64el:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-"$LIBC"
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-"$LIBC"
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-"$LIBC"
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-"$LIBC"
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-"$LIBC"
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-"$LIBC"
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-"$LIBC"
+ exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
+ exit ;;
+ sh64*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ sh*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ tile*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ vax:Linux:*:*)
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
+ exit ;;
+ x86_64:Linux:*:*)
+ if objdump -f /bin/sh | grep -q elf32-x86-64; then
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
+ else
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+ fi
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo "$UNAME_MACHINE"-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo "$UNAME_MACHINE"-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo "$UNAME_MACHINE"-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo "$UNAME_MACHINE"-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ i*86:*DOS:*:*)
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
+ else
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
+ else
+ echo "$UNAME_MACHINE"-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configure will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv"$UNAME_RELEASE"
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo "$UNAME_MACHINE"-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo "$UNAME_MACHINE"-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux"$UNAME_RELEASE"
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv"$UNAME_RELEASE"
+ else
+ echo mips-unknown-sysv"$UNAME_RELEASE"
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
+ *:Rhapsody:*:*)
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval "$set_cc_for_build"
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = x86; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = 386; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo "$UNAME_MACHINE"-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux"$UNAME_RELEASE"
+ exit ;;
+ *:DragonFly:*:*)
+ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "$UNAME_MACHINE" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
+ exit ;;
+ i*86:rdos:*:*)
+ echo "$UNAME_MACHINE"-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo "$UNAME_MACHINE"-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo "$UNAME_MACHINE"-unknown-esx
+ exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+esac
+
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
+esac
+
+cat >&2 <<EOF
+
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
+
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+and
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-functions 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
new file mode 100755
index 0000000..1e2595f
--- /dev/null
+++ b/build-aux/config.rpath
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2023 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ haiku*)
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd2.[01]*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly* | midnightbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ *nto* | *qnx*)
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ freebsd* | dragonfly* | midnightbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ *nto* | *qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/build-aux/config.sub b/build-aux/config.sub
new file mode 100755
index 0000000..1d8e98b
--- /dev/null
+++ b/build-aux/config.sub
@@ -0,0 +1,1801 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2018 Free Software Foundation, Inc.
+
+timestamp='2018-02-22'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches to <config-patches@gnu.org>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+Canonicalize a configuration name.
+
+Options:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2018 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo "$1"
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+ kopensolaris*-gnu* | cloudabi*-eabi* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
+ if [ "$basic_machine" != "$1" ]
+ then os=`echo "$1" | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | ba \
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | epiphany \
+ | fido | fr30 | frv | ft32 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 | or1k | or1knd | or32 \
+ | pdp10 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pru \
+ | pyramid \
+ | riscv32 | riscv64 \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
+ | wasm32 \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | ba-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | e2k-* | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | or1k*-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pru-* \
+ | pyramid-* \
+ | riscv32-* | riscv64-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | visium-* \
+ | wasm32-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-pc
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ asmjs)
+ basic_machine=asmjs-unknown
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2*)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next)
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ nsv-tandem)
+ basic_machine=nsv-tandem
+ ;;
+ nsx-tandem)
+ basic_machine=nsx-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ x64)
+ basic_machine=x86_64-pc
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases that might get confused
+ # with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # es1800 is here to avoid being matched by es* (a different OS)
+ -es1800*)
+ os=-ose
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* | -cloudabi* | -sortix* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
+ | -midnightbsd*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -xray | -os68k* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2)
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $basic_machine in
+ arm*)
+ os=-eabi
+ ;;
+ *)
+ os=-elf
+ ;;
+ esac
+ ;;
+ -nacl*)
+ ;;
+ -ios)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ pru-*)
+ os=-elf
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next)
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo "$basic_machine$os"
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-functions 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/depcomp b/build-aux/depcomp
new file mode 100755
index 0000000..6b39162
--- /dev/null
+++ b/build-aux/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/install-sh b/build-aux/install-sh
new file mode 100755
index 0000000..ec298b5
--- /dev/null
+++ b/build-aux/install-sh
@@ -0,0 +1,541 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2020-11-14.01; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab=' '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
+ -s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -p) cpprog="$cpprog -p";;
+
+ -s) stripcmd=$stripprog;;
+
+ -S) backupsuffix="$2"
+ shift;;
+
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename.
+ if test -d "$dst"; then
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
+ dstdir_status=0
+ else
+ dstdir=`dirname "$dst"`
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ set -f
+ set fnord $dstdir
+ shift
+ set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ set +f &&
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
new file mode 100644
index 0000000..2e8548d
--- /dev/null
+++ b/build-aux/ltmain.sh
@@ -0,0 +1,9661 @@
+
+# libtool (GNU libtool) 2.4.2
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --no-warn don't display warning messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION="2.4.2 Debian-2.4.2-1.1"
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value returned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=${PATH_SEPARATOR-:}
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list in case some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-warning|--no-warn)
+ opt_warning=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (including dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link)
+ libs="$deplibs %DEPLIBS%"
+ test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+ ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$absdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ # correct linux to gnu/linux during the next big refactor
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ *)
+ func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux) # correct to gnu/linux during the next big refactor
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ # Remove ${wl} instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ func_resolve_sysroot "$deplib"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/build-aux/missing b/build-aux/missing
new file mode 100755
index 0000000..8d0eaad
--- /dev/null
+++ b/build-aux/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/mkinstalldirs b/build-aux/mkinstalldirs
new file mode 100755
index 0000000..c364f3d
--- /dev/null
+++ b/build-aux/mkinstalldirs
@@ -0,0 +1,162 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2020-07-26.22; # UTC
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+IFS=" "" $nl"
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the 'mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because '.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "umask 22"
+ umask 22
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+echo "umask 22"
+umask 22
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp=$pathcomp/
+ done
+
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $file"
+ chmod "$dirmode" "$file" || errstatus=$?
+ fi
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/test-driver b/build-aux/test-driver
new file mode 100755
index 0000000..9759384
--- /dev/null
+++ b/build-aux/test-driver
@@ -0,0 +1,150 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name NAME --log-file PATH --trs-file PATH
+ [--expect-failure {yes|no}] [--color-tests {yes|no}]
+ [--enable-hard-errors {yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
+END
+}
+
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ *) break;;
+ esac
+ shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='' # Red.
+ grn='' # Green.
+ lgn='' # Light green.
+ blu='' # Blue.
+ mgn='' # Magenta.
+ std='' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..6b0e5a5
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,2875 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to the number of bits in type 'ptrdiff_t'. */
+#undef BITSIZEOF_PTRDIFF_T
+
+/* Define to the number of bits in type 'sig_atomic_t'. */
+#undef BITSIZEOF_SIG_ATOMIC_T
+
+/* Define to the number of bits in type 'size_t'. */
+#undef BITSIZEOF_SIZE_T
+
+/* Define to the number of bits in type 'wchar_t'. */
+#undef BITSIZEOF_WCHAR_T
+
+/* Define to the number of bits in type 'wint_t'. */
+#undef BITSIZEOF_WINT_T
+
+/* URL of CGI programs */
+#undef CGIURL
+
+/* Define if 3-argument BSD swapctl exists */
+#undef CHECK_SWAP_SWAPCTL_BSD
+
+/* Define if 2-argument SVR4 swapctl exists */
+#undef CHECK_SWAP_SWAPCTL_SVR4
+
+/* Define to 1 if using 'alloca.c'. */
+#undef C_ALLOCA
+
+/* Define as the bit index in the word where to find bit 0 of the exponent of
+ 'double'. */
+#undef DBL_EXPBIT0_BIT
+
+/* Define as the word index where to find the exponent of 'double'. */
+#undef DBL_EXPBIT0_WORD
+
+/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
+#undef DGUX
+
+/* Define to 1 if // is a file system root distinct from /. */
+#undef DOUBLE_SLASH_IS_DISTINCT_ROOT
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
+
+/* Define this to 1 if F_DUPFD behavior does not match POSIX */
+#undef FCNTL_DUPFD_BUGGY
+
+/* Define to 1 if fopen() fails to recognize a trailing slash. */
+#undef FOPEN_TRAILING_SLASH_BUG
+
+/* Define to 1 if the system's ftello function has the Solaris bug. */
+#undef FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE
+
+/* Define to 1 if the system's ftello function has the macOS bug. */
+#undef FTELLO_BROKEN_AFTER_UNGETC
+
+/* Define to 1 if fflush is known to work on stdin as per POSIX.1-2008, 0 if
+ fflush is known to not work, -1 if unknown. */
+#undef FUNC_FFLUSH_STDIN
+
+/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */
+#undef FUNC_NL_LANGINFO_YESEXPR_WORKS
+
+/* Define to 1 if ungetc is broken when used on arbitrary bytes. */
+#undef FUNC_UNGETC_BROKEN
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module dirname shall be considered present. */
+#undef GNULIB_DIRNAME
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module fflush shall be considered present. */
+#undef GNULIB_FFLUSH
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module fopen-gnu shall be considered present. */
+#undef GNULIB_FOPEN_GNU
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module fscanf shall be considered present. */
+#undef GNULIB_FSCANF
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module lock shall be considered present. */
+#undef GNULIB_LOCK
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module msvc-nothrow shall be considered present. */
+#undef GNULIB_MSVC_NOTHROW
+
+/* Define to 1 if printf and friends should be labeled with attribute
+ "__gnu_printf__" instead of "__printf__" */
+#undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module reallocarray shall be considered present. */
+#undef GNULIB_REALLOCARRAY
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module scanf shall be considered present. */
+#undef GNULIB_SCANF
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module snprintf shall be considered present. */
+#undef GNULIB_SNPRINTF
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module strerror shall be considered present. */
+#undef GNULIB_STRERROR
+
+/* Define to 1 when the gnulib module btowc should be tested. */
+#undef GNULIB_TEST_BTOWC
+
+/* Define to 1 when the gnulib module calloc-gnu should be tested. */
+#undef GNULIB_TEST_CALLOC_GNU
+
+/* Define to 1 when the gnulib module calloc-posix should be tested. */
+#undef GNULIB_TEST_CALLOC_POSIX
+
+/* Define to 1 when the gnulib module cloexec should be tested. */
+#undef GNULIB_TEST_CLOEXEC
+
+/* Define to 1 when the gnulib module close should be tested. */
+#undef GNULIB_TEST_CLOSE
+
+/* Define to 1 when the gnulib module dup2 should be tested. */
+#undef GNULIB_TEST_DUP2
+
+/* Define to 1 when the gnulib module environ should be tested. */
+#undef GNULIB_TEST_ENVIRON
+
+/* Define to 1 when the gnulib module fcntl should be tested. */
+#undef GNULIB_TEST_FCNTL
+
+/* Define to 1 when the gnulib module fflush should be tested. */
+#undef GNULIB_TEST_FFLUSH
+
+/* Define to 1 when the gnulib module fgetc should be tested. */
+#undef GNULIB_TEST_FGETC
+
+/* Define to 1 when the gnulib module fgets should be tested. */
+#undef GNULIB_TEST_FGETS
+
+/* Define to 1 when the gnulib module floorf should be tested. */
+#undef GNULIB_TEST_FLOORF
+
+/* Define to 1 when the gnulib module fopen should be tested. */
+#undef GNULIB_TEST_FOPEN
+
+/* Define to 1 when the gnulib module fopen-gnu should be tested. */
+#undef GNULIB_TEST_FOPEN_GNU
+
+/* Define to 1 when the gnulib module fprintf should be tested. */
+#undef GNULIB_TEST_FPRINTF
+
+/* Define to 1 when the gnulib module fpurge should be tested. */
+#undef GNULIB_TEST_FPURGE
+
+/* Define to 1 when the gnulib module fputc should be tested. */
+#undef GNULIB_TEST_FPUTC
+
+/* Define to 1 when the gnulib module fputs should be tested. */
+#undef GNULIB_TEST_FPUTS
+
+/* Define to 1 when the gnulib module fread should be tested. */
+#undef GNULIB_TEST_FREAD
+
+/* Define to 1 when the gnulib module free-posix should be tested. */
+#undef GNULIB_TEST_FREE_POSIX
+
+/* Define to 1 when the gnulib module fscanf should be tested. */
+#undef GNULIB_TEST_FSCANF
+
+/* Define to 1 when the gnulib module fseek should be tested. */
+#undef GNULIB_TEST_FSEEK
+
+/* Define to 1 when the gnulib module fseeko should be tested. */
+#undef GNULIB_TEST_FSEEKO
+
+/* Define to 1 when the gnulib module fstat should be tested. */
+#undef GNULIB_TEST_FSTAT
+
+/* Define to 1 when the gnulib module ftell should be tested. */
+#undef GNULIB_TEST_FTELL
+
+/* Define to 1 when the gnulib module ftello should be tested. */
+#undef GNULIB_TEST_FTELLO
+
+/* Define to 1 when the gnulib module fwrite should be tested. */
+#undef GNULIB_TEST_FWRITE
+
+/* Define to 1 when the gnulib module getaddrinfo should be tested. */
+#undef GNULIB_TEST_GETADDRINFO
+
+/* Define to 1 when the gnulib module getc should be tested. */
+#undef GNULIB_TEST_GETC
+
+/* Define to 1 when the gnulib module getchar should be tested. */
+#undef GNULIB_TEST_GETCHAR
+
+/* Define to 1 when the gnulib module getdelim should be tested. */
+#undef GNULIB_TEST_GETDELIM
+
+/* Define to 1 when the gnulib module getdtablesize should be tested. */
+#undef GNULIB_TEST_GETDTABLESIZE
+
+/* Define to 1 when the gnulib module gethostname should be tested. */
+#undef GNULIB_TEST_GETHOSTNAME
+
+/* Define to 1 when the gnulib module getline should be tested. */
+#undef GNULIB_TEST_GETLINE
+
+/* Define to 1 when the gnulib module getloadavg should be tested. */
+#undef GNULIB_TEST_GETLOADAVG
+
+/* Define to 1 when the gnulib module getopt-posix should be tested. */
+#undef GNULIB_TEST_GETOPT_POSIX
+
+/* Define to 1 when the gnulib module localeconv should be tested. */
+#undef GNULIB_TEST_LOCALECONV
+
+/* Define to 1 when the gnulib module lseek should be tested. */
+#undef GNULIB_TEST_LSEEK
+
+/* Define to 1 when the gnulib module malloc-gnu should be tested. */
+#undef GNULIB_TEST_MALLOC_GNU
+
+/* Define to 1 when the gnulib module malloc-posix should be tested. */
+#undef GNULIB_TEST_MALLOC_POSIX
+
+/* Define to 1 when the gnulib module mbrtowc should be tested. */
+#undef GNULIB_TEST_MBRTOWC
+
+/* Define to 1 when the gnulib module mbsinit should be tested. */
+#undef GNULIB_TEST_MBSINIT
+
+/* Define to 1 when the gnulib module mbtowc should be tested. */
+#undef GNULIB_TEST_MBTOWC
+
+/* Define to 1 when the gnulib module memchr should be tested. */
+#undef GNULIB_TEST_MEMCHR
+
+/* Define to 1 when the gnulib module mktime should be tested. */
+#undef GNULIB_TEST_MKTIME
+
+/* Define to 1 when the gnulib module nl_langinfo should be tested. */
+#undef GNULIB_TEST_NL_LANGINFO
+
+/* Define to 1 when the gnulib module open should be tested. */
+#undef GNULIB_TEST_OPEN
+
+/* Define to 1 when the gnulib module printf should be tested. */
+#undef GNULIB_TEST_PRINTF
+
+/* Define to 1 when the gnulib module putc should be tested. */
+#undef GNULIB_TEST_PUTC
+
+/* Define to 1 when the gnulib module putchar should be tested. */
+#undef GNULIB_TEST_PUTCHAR
+
+/* Define to 1 when the gnulib module puts should be tested. */
+#undef GNULIB_TEST_PUTS
+
+/* Define to 1 when the gnulib module reallocarray should be tested. */
+#undef GNULIB_TEST_REALLOCARRAY
+
+/* Define to 1 when the gnulib module realloc-gnu should be tested. */
+#undef GNULIB_TEST_REALLOC_GNU
+
+/* Define to 1 when the gnulib module realloc-posix should be tested. */
+#undef GNULIB_TEST_REALLOC_POSIX
+
+/* Define to 1 when the gnulib module scanf should be tested. */
+#undef GNULIB_TEST_SCANF
+
+/* Define to 1 when the gnulib module setenv should be tested. */
+#undef GNULIB_TEST_SETENV
+
+/* Define to 1 when the gnulib module setlocale_null should be tested. */
+#undef GNULIB_TEST_SETLOCALE_NULL
+
+/* Define to 1 when the gnulib module snprintf should be tested. */
+#undef GNULIB_TEST_SNPRINTF
+
+/* Define to 1 when the gnulib module stat should be tested. */
+#undef GNULIB_TEST_STAT
+
+/* Define to 1 when the gnulib module strcasestr should be tested. */
+#undef GNULIB_TEST_STRCASESTR
+
+/* Define to 1 when the gnulib module strerror should be tested. */
+#undef GNULIB_TEST_STRERROR
+
+/* Define to 1 when the gnulib module strsep should be tested. */
+#undef GNULIB_TEST_STRSEP
+
+/* Define to 1 when the gnulib module strstr should be tested. */
+#undef GNULIB_TEST_STRSTR
+
+/* Define to 1 when the gnulib module timegm should be tested. */
+#undef GNULIB_TEST_TIMEGM
+
+/* Define to 1 when the gnulib module time_r should be tested. */
+#undef GNULIB_TEST_TIME_R
+
+/* Define to 1 when the gnulib module unsetenv should be tested. */
+#undef GNULIB_TEST_UNSETENV
+
+/* Define to 1 when the gnulib module vasprintf should be tested. */
+#undef GNULIB_TEST_VASPRINTF
+
+/* Define to 1 when the gnulib module vfprintf should be tested. */
+#undef GNULIB_TEST_VFPRINTF
+
+/* Define to 1 when the gnulib module vprintf should be tested. */
+#undef GNULIB_TEST_VPRINTF
+
+/* Define to 1 when the gnulib module vsnprintf should be tested. */
+#undef GNULIB_TEST_VSNPRINTF
+
+/* Define to 1 when the gnulib module wcrtomb should be tested. */
+#undef GNULIB_TEST_WCRTOMB
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module xalloc shall be considered present. */
+#undef GNULIB_XALLOC
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+ whether the gnulib module xalloc-die shall be considered present. */
+#undef GNULIB_XALLOC_DIE
+
+/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
+ may be supplied by this distribution. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <bp-sym.h> header file. */
+#undef HAVE_BP_SYM_H
+
+/* Define to 1 if you have the `btowc' function. */
+#undef HAVE_BTOWC
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+#undef HAVE_BYTESWAP_H
+
+/* Define to 1 if you have the Mac OS X function
+ CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
+
+/* Define to 1 if you have the <crtdefs.h> header file. */
+#undef HAVE_CRTDEFS_H
+
+/* Define to 1 if you have the <crypto.h> header file. */
+#undef HAVE_CRYPTO_H
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#undef HAVE_CTYPE_H
+
+/* Define to 1 if the alignas and alignof keywords work. */
+#undef HAVE_C_ALIGNASOF
+
+/* Define to 1 if bool, true and false work as per C2023. */
+#undef HAVE_C_BOOL
+
+/* Define to 1 if the static_assert keyword works. */
+#undef HAVE_C_STATIC_ASSERT
+
+/* Define to 1 if C supports variable-length arrays. */
+#undef HAVE_C_VARARRAYS
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
+
+/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't.
+ */
+#undef HAVE_DECL_ALARM
+
+/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_CLEARERR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `ecvt', and to 0 if you don't.
+ */
+#undef HAVE_DECL_ECVT
+
+/* Define to 1 if you have the declaration of `execvpe', and to 0 if you
+ don't. */
+#undef HAVE_DECL_EXECVPE
+
+/* Define to 1 if you have the declaration of `fcloseall', and to 0 if you
+ don't. */
+#undef HAVE_DECL_FCLOSEALL
+
+/* Define to 1 if you have the declaration of `fcvt', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FCVT
+
+/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
+ don't. */
+#undef HAVE_DECL_FEOF_UNLOCKED
+
+/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FERROR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FFLUSH_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FGETS_UNLOCKED
+
+/* Define to 1 if you have the declaration of `floorf', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FLOORF
+
+/* Define to 1 if you have the declaration of `fpurge', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FPURGE
+
+/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FPUTC_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FPUTS_UNLOCKED
+
+/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FREAD_UNLOCKED
+
+/* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you
+ don't. */
+#undef HAVE_DECL_FREEADDRINFO
+
+/* Define to 1 if you have the declaration of `fseeko', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FSEEKO
+
+/* Define to 1 if you have the declaration of `ftello', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FTELLO
+
+/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_FWRITE_UNLOCKED
+
+/* Define to 1 if you have the declaration of `gai_strerror', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GAI_STRERROR
+
+/* Define to 1 if you have the declaration of `gai_strerrorA', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GAI_STRERRORA
+
+/* Define to 1 if you have the declaration of `gcvt', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GCVT
+
+/* Define to 1 if you have the declaration of `getaddrinfo', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETADDRINFO
+
+/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_GETCHAR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETC_UNLOCKED
+
+/* Define to 1 if you have the declaration of `getdelim', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETDELIM
+
+/* Define to 1 if you have the declaration of `getdtablesize', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETDTABLESIZE
+
+/* Define to 1 if you have the declaration of `getline', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETLINE
+
+/* Define to 1 if you have the declaration of `getnameinfo', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETNAMEINFO
+
+/* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you
+ don't. */
+#undef HAVE_DECL_INET_NTOP
+
+/* Define to 1 if you have the declaration of `isblank', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ISBLANK
+
+/* Define to 1 if you have the declaration of `localtime_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_LOCALTIME_R
+
+/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MBRTOWC
+
+/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you
+ don't. */
+#undef HAVE_DECL_MBSINIT
+
+/* Define to 1 if you have the declaration of `program_invocation_name', and
+ to 0 if you don't. */
+#undef HAVE_DECL_PROGRAM_INVOCATION_NAME
+
+/* Define to 1 if you have the declaration of `program_invocation_short_name',
+ and to 0 if you don't. */
+#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+
+/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
+ you don't. */
+#undef HAVE_DECL_PUTCHAR_UNLOCKED
+
+/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
+ don't. */
+#undef HAVE_DECL_PUTC_UNLOCKED
+
+/* Define to 1 if you have the declaration of `setenv', and to 0 if you don't.
+ */
+#undef HAVE_DECL_SETENV
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRERROR_R
+
+/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRNCASECMP
+
+/* Define to 1 if you have the declaration of `swapctl', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SWAPCTL
+
+/* Define to 1 if you have the declaration of `sysconf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SYSCONF
+
+/* Define to 1 if you have the declaration of `towlower', and to 0 if you
+ don't. */
+#undef HAVE_DECL_TOWLOWER
+
+/* Define to 1 if you have the declaration of `unsetenv', and to 0 if you
+ don't. */
+#undef HAVE_DECL_UNSETENV
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_VSNPRINTF
+
+/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you
+ don't. */
+#undef HAVE_DECL_WCRTOMB
+
+/* Define to 1 if you have the declaration of `wcsdup', and to 0 if you don't.
+ */
+#undef HAVE_DECL_WCSDUP
+
+/* Define to 1 if you have the declaration of `_fseeki64', and to 0 if you
+ don't. */
+#undef HAVE_DECL__FSEEKI64
+
+/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL__SNPRINTF
+
+/* Define to 1 if you have the declaration of `__argv', and to 0 if you don't.
+ */
+#undef HAVE_DECL___ARGV
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `endmntent' function. */
+#undef HAVE_ENDMNTENT
+
+/* Define if you have the declaration of environ. */
+#undef HAVE_ENVIRON_DECL
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the <err.h> header file. */
+#undef HAVE_ERR_H
+
+/* Define to 1 if you have the `fcntl' function. */
+#undef HAVE_FCNTL
+
+/* Define to 1 if you have the <features.h> header file. */
+#undef HAVE_FEATURES_H
+
+/* Define to 1 if you have the `flockfile' function. */
+#undef HAVE_FLOCKFILE
+
+/* Define to 1 if you have the `floor' function. */
+#undef HAVE_FLOOR
+
+/* Define to 1 if you have the `fpurge' function. */
+#undef HAVE_FPURGE
+
+/* Define if the 'free' function is guaranteed to preserve errno. */
+#undef HAVE_FREE_POSIX
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the <fs_info.h> header file. */
+#undef HAVE_FS_INFO_H
+
+/* Define to 1 if you have the `fs_stat_dev' function. */
+#undef HAVE_FS_STAT_DEV
+
+/* Define to 1 if you have the `funlockfile' function. */
+#undef HAVE_FUNLOCKFILE
+
+/* Define to 1 if getaddrinfo exists, or to 0 otherwise. */
+#undef HAVE_GETADDRINFO
+
+/* Define to 1 if you have the `getdelim' function. */
+#undef HAVE_GETDELIM
+
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
+/* Define to 1 if you have the `getegid' function. */
+#undef HAVE_GETEGID
+
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define to 1 if you have the `getexecname' function. */
+#undef HAVE_GETEXECNAME
+
+/* Define to 1 if you have the `getgid' function. */
+#undef HAVE_GETGID
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the `getmntent' function. */
+#undef HAVE_GETMNTENT
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#undef HAVE_GETOPT_H
+
+/* Define to 1 if you have the `getopt_long_only' function. */
+#undef HAVE_GETOPT_LONG_ONLY
+
+/* Define to 1 if you have the `getprogname' function. */
+#undef HAVE_GETPROGNAME
+
+/* Define to 1 if you have the `getresgid' function. */
+#undef HAVE_GETRESGID
+
+/* Define to 1 if you have the `getresuid' function. */
+#undef HAVE_GETRESUID
+
+/* Define to 1 if you have the `getservbyname' function. */
+#undef HAVE_GETSERVBYNAME
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define if gettimeofday is found */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define to 1 if you have the <gnutls/openssl.h> header file. */
+#undef HAVE_GNUTLS_OPENSSL_H
+
+/* Define to 1 if you have the `hasmntopt' function. */
+#undef HAVE_HASMNTOPT
+
+/* Define if you have the iconv() function and it works. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
+/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
+#undef HAVE_INTMAX_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
+ declares uintmax_t. */
+#undef HAVE_INTTYPES_H_WITH_UINTMAX
+
+/* Define to 1 if <sys/socket.h> defines AF_INET. */
+#undef HAVE_IPV4
+
+/* Define to 1 if <sys/socket.h> defines AF_INET6. */
+#undef HAVE_IPV6
+
+/* Define to 1 if you have the `isblank' function. */
+#undef HAVE_ISBLANK
+
+/* Define to 1 if you have the `iswcntrl' function. */
+#undef HAVE_ISWCNTRL
+
+/* Define to 1 if you have the `iswctype' function. */
+#undef HAVE_ISWCTYPE
+
+/* Define to 1 if you have the <krb5.h> header file. */
+#undef HAVE_KRB5_H
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+#undef HAVE_LANGINFO_H
+
+/* Define to 1 if you have the `ldap_get_option' function. */
+#undef HAVE_LDAP_GET_OPTION
+
+/* Define to 1 if you have the `ldap_init' function. */
+#undef HAVE_LDAP_INIT
+
+/* Define to 1 if you have the `ldap_set_option' function. */
+#undef HAVE_LDAP_SET_OPTION
+
+/* Define to 1 if you have the `ldap_start_tls_s' function. */
+#undef HAVE_LDAP_START_TLS_S
+
+/* Define to 1 if you have the `crypt' library (-lcrypt). */
+#undef HAVE_LIBCRYPT
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#undef HAVE_LIBCRYPTO
+
+/* Define to 1 if you have a functional curl library. */
+#undef HAVE_LIBCURL
+
+/* Define to 1 if you have the `dbi' library (-ldbi). */
+#undef HAVE_LIBDBI
+
+/* Define to 1 if you have the `dgc' library (-ldgc). */
+#undef HAVE_LIBDGC
+
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
+
+/* Define to 1 if you have the `freeradius-client' library
+ (-lfreeradius-client). */
+#undef HAVE_LIBFREERADIUS_CLIENT
+
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define to 1 if you have the `kstat' library (-lkstat). */
+#undef HAVE_LIBKSTAT
+
+/* Define to 1 if you have the `ldap' library (-lldap). */
+#undef HAVE_LIBLDAP
+
+/* Define to 1 if you have the `perfstat' library (-lperfstat). */
+#undef HAVE_LIBPERFSTAT
+
+/* Define to 1 if you have the `pq' library (-lpq). */
+#undef HAVE_LIBPQ
+
+/* Define to 1 if you have the <libpq-fe.h> header file. */
+#undef HAVE_LIBPQ_FE_H
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Define to 1 if you have the `radcli' library (-lradcli). */
+#undef HAVE_LIBRADCLI
+
+/* Define to 1 if you have the `radiusclient' library (-lradiusclient). */
+#undef HAVE_LIBRADIUSCLIENT
+
+/* Define to 1 if you have the `radiusclient-ng' library (-lradiusclient-ng).
+ */
+#undef HAVE_LIBRADIUSCLIENT_NG
+
+/* Define to 1 if you have the `systemd' library (-lsystemd). */
+#undef HAVE_LIBSYSTEMD
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have 'struct sockaddr_alg' defined. */
+#undef HAVE_LINUX_IF_ALG_H
+
+/* Define to 1 if you have the `listmntent' function. */
+#undef HAVE_LISTMNTENT
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* Define to 1 if the system has the type 'long long int'. */
+#undef HAVE_LONG_LONG_INT
+
+/* Define to 1 if you have the `lstat' function. */
+#undef HAVE_LSTAT
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
+#undef HAVE_MACH_MACH_H
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if malloc, realloc, and calloc set errno on allocation failure. */
+#undef HAVE_MALLOC_POSIX
+
+/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
+ config.h and <sys/mman.h>. */
+#undef HAVE_MAP_ANONYMOUS
+
+/* Define to 1 if you have the <math.h> header file. */
+#undef HAVE_MATH_H
+
+/* Define to 1 if you have the `mbrtowc' function. */
+#undef HAVE_MBRTOWC
+
+/* Define to 1 if you have the `mbsinit' function. */
+#undef HAVE_MBSINIT
+
+/* Define to 1 if <wchar.h> declares mbstate_t. */
+#undef HAVE_MBSTATE_T
+
+/* Define to 1 if you have the `mbtowc' function. */
+#undef HAVE_MBTOWC
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <minix/config.h> header file. */
+#undef HAVE_MINIX_CONFIG_H
+
+/* Define to 1 if <limits.h> defines the MIN and MAX macros. */
+#undef HAVE_MINMAX_IN_LIMITS_H
+
+/* Define to 1 if <sys/param.h> defines the MIN and MAX macros. */
+#undef HAVE_MINMAX_IN_SYS_PARAM_H
+
+/* Define to 1 if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
+/* Define to 1 if you have the `mprotect' function. */
+#undef HAVE_MPROTECT
+
+/* Define to 1 if you have the <mp.h> header file. */
+#undef HAVE_MP_H
+
+/* Define to 1 on MSVC platforms that have the "invalid parameter handler"
+ concept. */
+#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
+/* Defined if mariadbclient is found and can compile */
+#undef HAVE_MYSQLCLIENT
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the `next_dev' function. */
+#undef HAVE_NEXT_DEV
+
+/* Define to 1 if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#undef HAVE_NL_LANGINFO
+
+/* Define to 1 if you have the <openssl/crypto.h> header file. */
+#undef HAVE_OPENSSL_CRYPTO_H
+
+/* Define to 1 if you have the <openssl/err.h> header file. */
+#undef HAVE_OPENSSL_ERR_H
+
+/* Define to 1 if you have the <openssl/pem.h> header file. */
+#undef HAVE_OPENSSL_PEM_H
+
+/* Define to 1 if you have the <openssl/rsa.h> header file. */
+#undef HAVE_OPENSSL_RSA_H
+
+/* Define to 1 if libcrypto is used for SHA256. */
+#undef HAVE_OPENSSL_SHA256
+
+/* Define to 1 if you have the <openssl/sha.h> header file. */
+#undef HAVE_OPENSSL_SHA_H
+
+/* Define to 1 if you have the <openssl/ssl.h> header file. */
+#undef HAVE_OPENSSL_SSL_H
+
+/* Define to 1 if you have the <openssl/x509.h> header file. */
+#undef HAVE_OPENSSL_X509_H
+
+/* Define to 1 if you have the <pem.h> header file. */
+#undef HAVE_PEM_H
+
+/* Define to 1 if you have the <pgsql/libpq-fe.h> header file. */
+#undef HAVE_PGSQL_LIBPQ_FE_H
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <postgresql/libpq-fe.h> header file. */
+#undef HAVE_POSTGRESQL_LIBPQ_FE_H
+
+/* Define if we have /proc/meminfo */
+#undef HAVE_PROC_MEMINFO
+
+/* Define to 1 if you have the `pstat_getdynamic' function. */
+#undef HAVE_PSTAT_GETDYNAMIC
+
+/* Define if you have the <pthread.h> header and the POSIX threads API. */
+#undef HAVE_PTHREAD_API
+
+/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
+#undef HAVE_PTHREAD_MUTEX_RECURSIVE
+
+/* Define if the POSIX multithreading library has read/write locks. */
+#undef HAVE_PTHREAD_RWLOCK
+
+/* Define if the 'pthread_rwlock_rdlock' function prefers a writer to a
+ reader. */
+#undef HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
+/* Define to 1 if you have the <rsa.h> header file. */
+#undef HAVE_RSA_H
+
+/* Define to 1 if the system has the type `sa_family_t'. */
+#undef HAVE_SA_FAMILY_T
+
+/* Define to 1 if you have the <sdkddkver.h> header file. */
+#undef HAVE_SDKDDKVER_H
+
+/* Define to 1 if you have the <search.h> header file. */
+#undef HAVE_SEARCH_H
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the `setdtablesize' function. */
+#undef HAVE_SETDTABLESIZE
+
+/* Define to 1 if you have the `setegid' function. */
+#undef HAVE_SETEGID
+
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define to 1 if you have the `seteuid' function. */
+#undef HAVE_SETEUID
+
+/* Define to 1 if you have the `setmntent' function. */
+#undef HAVE_SETMNTENT
+
+/* Define to 1 if you have the `setregid' function. */
+#undef HAVE_SETREGID
+
+/* Define to 1 if you have the `setresgid' function. */
+#undef HAVE_SETRESGID
+
+/* Define to 1 if you have the `setresuid' function. */
+#undef HAVE_SETRESUID
+
+/* Define to 1 if you have the `setreuid' function. */
+#undef HAVE_SETREUID
+
+/* Define to 1 if you have the `shutdown' function. */
+#undef HAVE_SHUTDOWN
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if 'sig_atomic_t' is a signed integer type. */
+#undef HAVE_SIGNED_SIG_ATOMIC_T
+
+/* Define to 1 if 'wchar_t' is a signed integer type. */
+#undef HAVE_SIGNED_WCHAR_T
+
+/* Define to 1 if 'wint_t' is a signed integer type. */
+#undef HAVE_SIGNED_WINT_T
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define if the return value of the snprintf function is the number of of
+ bytes (excluding the terminating NUL) that would have been produced if the
+ buffer had been large enough. */
+#undef HAVE_SNPRINTF_RETVAL_C99
+
+/* Define if the string produced by the snprintf function is always NUL
+ terminated. */
+#undef HAVE_SNPRINTF_TRUNCATION_C99
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define if SSL libraries are found */
+#undef HAVE_SSL
+
+/* Define to 1 if you have the <ssl.h> header file. */
+#undef HAVE_SSL_H
+
+/* Define to 1 if you have the `statvfs' function. */
+#undef HAVE_STATVFS
+
+/* Define to 1 if you have the <stdalign.h> header file. */
+#undef HAVE_STDALIGN_H
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define to 1 if you have the <stdbool.h> header file. */
+#undef HAVE_STDBOOL_H
+
+/* Define to 1 if you have the <stdckdint.h> header file. */
+#undef HAVE_STDCKDINT_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
+ uintmax_t. */
+#undef HAVE_STDINT_H_WITH_UINTMAX
+
+/* Define to 1 if you have the <stdio_ext.h> header file. */
+#undef HAVE_STDIO_EXT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strcasestr' function. */
+#undef HAVE_STRCASESTR
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strnlen' function. */
+#undef HAVE_STRNLEN
+
+/* Define to 1 if you have the `strsep' function. */
+#undef HAVE_STRSEP
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if the system has the type `struct addrinfo'. */
+#undef HAVE_STRUCT_ADDRINFO
+
+/* Define to 1 if `f_fstypename' is a member of `struct fsstat'. */
+#undef HAVE_STRUCT_FSSTAT_F_FSTYPENAME
+
+/* Define to 1 if `decimal_point' is a member of `struct lconv'. */
+#undef HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */
+#undef HAVE_STRUCT_NLIST_N_UN_N_NAME
+
+/* Define to 1 if `sa_len' is a member of `struct sockaddr'. */
+#undef HAVE_STRUCT_SOCKADDR_SA_LEN
+
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+
+/* Define to 1 if `f_fstypename' is a member of `struct statfs'. */
+#undef HAVE_STRUCT_STATFS_F_FSTYPENAME
+
+/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
+
+/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
+
+/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
+
+/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+
+/* Define to 1 if `st_birthtimensec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+
+/* Define to 1 if `st_birthtimespec.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+
+/* Define to 1 if `st_birthtim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC
+
+/* Define to 1 if `se_nblks' is a member of `struct swapent'. */
+#undef HAVE_STRUCT_SWAPENT_SE_NBLKS
+
+/* Define if we have a timeval structure */
+#undef HAVE_STRUCT_TIMEVAL
+
+/* Define if swap/swapinfo command is found */
+#undef HAVE_SWAP
+
+/* Define to 1 if the system has the type `swapent_t'. */
+#undef HAVE_SWAPENT_T
+
+/* Define to 1 if the system has the type `swaptbl_t'. */
+#undef HAVE_SWAPTBL_T
+
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
+/* Define if sysconf returns number of available cpus */
+#undef HAVE_SYSCONF__SC_NPROCESSORS_CONF
+
+/* Define if sysconf returns number of online cpus */
+#undef HAVE_SYSCONF__SC_NPROCESSORS_ONLN
+
+/* Define to 1 if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
+
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
+#undef HAVE_SYS_BITYPES_H
+
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
+#undef HAVE_SYS_CDEFS_H
+
+/* Define to 1 if you have the <sys/fs/s5param.h> header file. */
+#undef HAVE_SYS_FS_S5PARAM_H
+
+/* Define to 1 if you have the <sys/fs_types.h> header file. */
+#undef HAVE_SYS_FS_TYPES_H
+
+/* Define to 1 if you have the <sys/inttypes.h> header file. */
+#undef HAVE_SYS_INTTYPES_H
+
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
+#undef HAVE_SYS_LOADAVG_H
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define to 1 if you have the <sys/mntent.h> header file. */
+#undef HAVE_SYS_MNTENT_H
+
+/* Define to 1 if you have the <sys/mount.h> header file. */
+#undef HAVE_SYS_MOUNT_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define to 1 if you have the <sys/statfs.h> header file. */
+#undef HAVE_SYS_STATFS_H
+
+/* Define to 1 if you have the <sys/statvfs.h> header file. */
+#undef HAVE_SYS_STATVFS_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/swap.h> header file. */
+#undef HAVE_SYS_SWAP_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/ucred.h> header file. */
+#undef HAVE_SYS_UCRED_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <sys/unistd.h> header file. */
+#undef HAVE_SYS_UNISTD_H
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#undef HAVE_SYS_UN_H
+
+/* Define to 1 if you have the <sys/vfs.h> header file. */
+#undef HAVE_SYS_VFS_H
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the `thrd_create' function. */
+#undef HAVE_THRD_CREATE
+
+/* Define to 1 if you have the <threads.h> header file. */
+#undef HAVE_THREADS_H
+
+/* Define to 1 if you have the `timegm' function. */
+#undef HAVE_TIMEGM
+
+/* Define to 1 if you have the `towlower' function. */
+#undef HAVE_TOWLOWER
+
+/* Define to 1 if you have the `tsearch' function. */
+#undef HAVE_TSEARCH
+
+/* Define to 1 if you have the <uio.h> header file. */
+#undef HAVE_UIO_H
+
+/* Define to 1 if you have the `uname' function. */
+#undef HAVE_UNAME
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
+/* Define to 1 if the system has the type 'unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
+
+/* Define to 1 if you have a functional uriparser library. */
+#undef HAVE_URIPARSER
+
+/* Define to 1 if you have the <utmpx.h> header file. */
+#undef HAVE_UTMPX_H
+
+/* Define if you have a global __progname variable */
+#undef HAVE_VAR___PROGNAME
+
+/* Define to 1 if you have the `vasnprintf' function. */
+#undef HAVE_VASNPRINTF
+
+/* Define to 1 if you have the `vasprintf' function. */
+#undef HAVE_VASPRINTF
+
+/* Whether va_copy() is available */
+#undef HAVE_VA_COPY
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+ declarations. */
+#undef HAVE_VISIBILITY
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define if you have the 'wchar_t' type. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if you have the `wcrtomb' function. */
+#undef HAVE_WCRTOMB
+
+/* Define to 1 if you have the `wcslen' function. */
+#undef HAVE_WCSLEN
+
+/* Define to 1 if you have the `wcsnlen' function. */
+#undef HAVE_WCSNLEN
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Define to 1 if the compiler and linker support weak declarations of
+ symbols. */
+#undef HAVE_WEAK_SYMBOLS
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
+
+/* Define if you have the 'wint_t' type. */
+#undef HAVE_WINT_T
+
+/* Define to 1 if O_NOATIME works. */
+#undef HAVE_WORKING_O_NOATIME
+
+/* Define to 1 if O_NOFOLLOW works. */
+#undef HAVE_WORKING_O_NOFOLLOW
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#undef HAVE_WS2TCPIP_H
+
+/* Define to 1 if you have the <wtsapi32.h> header file. */
+#undef HAVE_WTSAPI32_H
+
+/* Define to 1 if you have the <x509.h> header file. */
+#undef HAVE_X509_H
+
+/* Define to 1 if you have the <xlocale.h> header file. */
+#undef HAVE_XLOCALE_H
+
+/* Define to 1 if you have the `_fseeki64' function. */
+#undef HAVE__FSEEKI64
+
+/* Define to 1 if you have the `_ftelli64' function. */
+#undef HAVE__FTELLI64
+
+/* Define to 1 if you have the `_set_invalid_parameter_handler' function. */
+#undef HAVE__SET_INVALID_PARAMETER_HANDLER
+
+/* Define to 1 if the compiler supports __builtin_expect,
+ and to 2 if <builtins.h> does. */
+#undef HAVE___BUILTIN_EXPECT
+#ifndef HAVE___BUILTIN_EXPECT
+# define __builtin_expect(e, c) (e)
+#elif HAVE___BUILTIN_EXPECT == 2
+# include <builtins.h>
+#endif
+
+
+/* Define to 1 if you have the `__fpurge' function. */
+#undef HAVE___FPURGE
+
+/* Define to 1 if you have the `__freading' function. */
+#undef HAVE___FREADING
+
+/* Define to 1 if ctype.h defines __header_inline. */
+#undef HAVE___HEADER_INLINE
+
+/* Please see the Gnulib manual for how to use these macros.
+
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
+
+ Suppress extern inline with Sun C in standards-conformance mode, as it
+ mishandles inline functions that call each other. E.g., for 'inline void f
+ (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+ 'reference to static identifier "f" in extern inline function'.
+ This bug was observed with Oracle Developer Studio 12.6
+ (Sun C 5.15 SunOS_sparc 2017/05/30).
+
+ Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+ on configurations that mistakenly use 'static inline' to implement
+ functions or macros in standard C headers like <ctype.h>. For example,
+ if isdigit is mistakenly implemented via a static inline function,
+ a program containing an extern inline function that calls isdigit
+ may not work since the C standard prohibits extern inline functions
+ from calling static functions (ISO C 99 section 6.7.4.(3).
+ This bug is known to occur on:
+
+ OS X 10.8 and earlier; see:
+ https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
+
+ DragonFly; see
+ http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
+
+ FreeBSD; see:
+ https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
+
+ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+ for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar.
+
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. It defines a macro
+ __GNUC_STDC_INLINE__ to indicate this situation or a macro
+ __GNUC_GNU_INLINE__ to indicate the opposite situation.
+ GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+ semantics but warns, unless -fgnu89-inline is used:
+ warning: C99 inline functions are not supported; using GNU89
+ warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+ It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
+#if (((defined __APPLE__ && defined __MACH__) \
+ || defined __DragonFly__ || defined __FreeBSD__) \
+ && (defined HAVE___HEADER_INLINE \
+ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+ && ! defined __clang__) \
+ : ((! defined _DONT_USE_CTYPE_INLINE_ \
+ && (defined __GNUC__ || defined __cplusplus)) \
+ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+ && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : (199901L <= __STDC_VERSION__ \
+ && !defined __HP_cc \
+ && !defined __PGI \
+ && !(defined __SUNPRO_C && __STDC__))) \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
+# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+# define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE _GL_UNUSED static
+# define _GL_EXTERN_INLINE _GL_UNUSED static
+#endif
+
+/* In GCC 4.6 (inclusive) to 5.1 (exclusive),
+ suppress bogus "no previous prototype for 'FOO'"
+ and "no previous declaration for 'FOO'" diagnostics,
+ when FOO is an inline function in the header; see
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
+#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+# define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+# define _GL_INLINE_HEADER_CONST_PRAGMA \
+ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+ _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif
+
+/* Define to 1 if the compiler supports the keyword '__inline'. */
+#undef HAVE___INLINE
+
+/* Whether __va_copy() is available */
+#undef HAVE___VA_COPY
+
+/* Define HOST_NAME_MAX when <limits.h> does not define it. */
+#undef HOST_NAME_MAX
+
+/* Defined if libcurl supports AsynchDNS */
+#undef LIBCURL_FEATURE_ASYNCHDNS
+
+/* Defined if libcurl supports IDN */
+#undef LIBCURL_FEATURE_IDN
+
+/* Defined if libcurl supports IPv6 */
+#undef LIBCURL_FEATURE_IPV6
+
+/* Defined if libcurl supports KRB4 */
+#undef LIBCURL_FEATURE_KRB4
+
+/* Defined if libcurl supports libz */
+#undef LIBCURL_FEATURE_LIBZ
+
+/* Defined if libcurl supports NTLM */
+#undef LIBCURL_FEATURE_NTLM
+
+/* Defined if libcurl supports SSL */
+#undef LIBCURL_FEATURE_SSL
+
+/* Defined if libcurl supports SSPI */
+#undef LIBCURL_FEATURE_SSPI
+
+/* Defined if libcurl supports DICT */
+#undef LIBCURL_PROTOCOL_DICT
+
+/* Defined if libcurl supports FILE */
+#undef LIBCURL_PROTOCOL_FILE
+
+/* Defined if libcurl supports FTP */
+#undef LIBCURL_PROTOCOL_FTP
+
+/* Defined if libcurl supports FTPS */
+#undef LIBCURL_PROTOCOL_FTPS
+
+/* Defined if libcurl supports HTTP */
+#undef LIBCURL_PROTOCOL_HTTP
+
+/* Defined if libcurl supports HTTPS */
+#undef LIBCURL_PROTOCOL_HTTPS
+
+/* Defined if libcurl supports IMAP */
+#undef LIBCURL_PROTOCOL_IMAP
+
+/* Defined if libcurl supports LDAP */
+#undef LIBCURL_PROTOCOL_LDAP
+
+/* Defined if libcurl supports POP3 */
+#undef LIBCURL_PROTOCOL_POP3
+
+/* Defined if libcurl supports RTSP */
+#undef LIBCURL_PROTOCOL_RTSP
+
+/* Defined if libcurl supports SMTP */
+#undef LIBCURL_PROTOCOL_SMTP
+
+/* Defined if libcurl supports TELNET */
+#undef LIBCURL_PROTOCOL_TELNET
+
+/* Defined if libcurl supports TFTP */
+#undef LIBCURL_PROTOCOL_TFTP
+
+/* Define to 1 if lseek does not detect pipes. */
+#undef LSEEK_PIPE_BROKEN
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+ */
+#undef MAJOR_IN_MKDEV
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+ <sysmacros.h>. */
+#undef MAJOR_IN_SYSMACROS
+
+/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */
+#undef MALLOC_0_IS_NONNULL
+
+/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
+#undef MAP_ANONYMOUS
+
+/* Define if the mbrtowc function does not return (size_t) -2 for empty input.
+ */
+#undef MBRTOWC_EMPTY_INPUT_BUG
+
+/* Define if the mbrtowc function may signal encoding errors in the C locale.
+ */
+#undef MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
+
+/* Define if the mbrtowc function has the NULL pwc argument bug. */
+#undef MBRTOWC_NULL_ARG1_BUG
+
+/* Define if the mbrtowc function has the NULL string argument bug. */
+#undef MBRTOWC_NULL_ARG2_BUG
+
+/* Define if the mbrtowc function does not return 0 for a NUL character. */
+#undef MBRTOWC_NUL_RETVAL_BUG
+
+/* Define if the mbrtowc function returns a wrong return value. */
+#undef MBRTOWC_RETVAL_BUG
+
+/* Define if the mbrtowc function stores a wide character when reporting
+ incomplete input. */
+#undef MBRTOWC_STORES_INCOMPLETE_BUG
+
+/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+
+
+/* Define if (like SVR2) there is no specific function for reading the list of
+ mounted file systems, and your system has these header files: <sys/fstyp.h>
+ and <sys/statfs.h>. (SVR3) */
+#undef MOUNTED_FREAD_FSTYP
+
+/* Define if there are functions named next_dev and fs_stat_dev for reading
+ the list of mounted file systems. (BeOS) */
+#undef MOUNTED_FS_STAT_DEV
+
+/* Define if there is a function named getextmntent for reading the list of
+ mounted file systems. (Solaris) */
+#undef MOUNTED_GETEXTMNTENT
+
+/* Define if there is a function named getfsstat for reading the list of
+ mounted file systems. (DEC Alpha running OSF/1) */
+#undef MOUNTED_GETFSSTAT
+
+/* Define if there is a function named getmntent for reading the list of
+ mounted file systems, and that function takes a single argument. (4.3BSD,
+ SunOS, HP-UX, Irix) */
+#undef MOUNTED_GETMNTENT1
+
+/* Define if there is a function named getmntent for reading the list of
+ mounted file systems, and that function takes two arguments. (SVR4) */
+#undef MOUNTED_GETMNTENT2
+
+/* Define if there is a function named getmntinfo for reading the list of
+ mounted file systems and it returns an array of 'struct statfs'. (4.4BSD,
+ Darwin) */
+#undef MOUNTED_GETMNTINFO
+
+/* Define if there is a function named getmntinfo for reading the list of
+ mounted file systems and it returns an array of 'struct statvfs'. (NetBSD
+ 3.0) */
+#undef MOUNTED_GETMNTINFO2
+
+/* Define if we are on interix, and ought to use statvfs plus some special
+ knowledge on where mounted file systems can be found. (Interix) */
+#undef MOUNTED_INTERIX_STATVFS
+
+/* Define if there is a function named mntctl that can be used to read the
+ list of mounted file systems, and there is a system header file that
+ declares 'struct vmount'. (AIX) */
+#undef MOUNTED_VMOUNT
+
+/* Define if gettimeofday is needed */
+#undef NEED_GETTIMEOFDAY
+
+/* Define if the compilation of mktime.c should define 'mktime_internal'. */
+#undef NEED_MKTIME_INTERNAL
+
+/* Define if the compilation of mktime.c should define 'mktime' with the
+ native Windows TZ workaround. */
+#undef NEED_MKTIME_WINDOWS
+
+/* Define if the compilation of mktime.c should define 'mktime' with the
+ algorithmic workarounds. */
+#undef NEED_MKTIME_WORKING
+
+/* Define to 1 if nl_langinfo is multithread-safe. */
+#undef NL_LANGINFO_MTSAFE
+
+/* Enable INI file parsing. */
+#undef NP_EXTRA_OPTS
+
+/* path and args for nslookup */
+#undef NSLOOKUP_COMMAND
+
+/* Define to 1 if the nlist n_name member is a pointer */
+#undef N_NAME_POINTER
+
+/* Define to 1 if open() fails to recognize a trailing slash. */
+#undef OPEN_TRAILING_SLASH_BUG
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Path to apt-get command, if present */
+#undef PATH_TO_APTGET
+
+/* Path to dig command, if present */
+#undef PATH_TO_DIG
+
+/* path to fping */
+#undef PATH_TO_FPING
+
+/* path to fping6 */
+#undef PATH_TO_FPING6
+
+/* path to lmstat */
+#undef PATH_TO_LMSTAT
+
+/* path to mailq */
+#undef PATH_TO_MAILQ
+
+/* path to qmail-qstat */
+#undef PATH_TO_QMAIL_QSTAT
+
+/* path to qstat/quakestat */
+#undef PATH_TO_QSTAT
+
+/* path to rpcinfo binary */
+#undef PATH_TO_RPCINFO
+
+/* path to smbclient binary */
+#undef PATH_TO_SMBCLIENT
+
+/* path to snmpget binary */
+#undef PATH_TO_SNMPGET
+
+/* path to snmpgetnext binary */
+#undef PATH_TO_SNMPGETNEXT
+
+/* path to sudo */
+#undef PATH_TO_SUDO
+
+/* path to uptime binary */
+#undef PATH_TO_UPTIME
+
+/* path and args for ICMPv6 ping command */
+#undef PING6_COMMAND
+
+/* Define if packet count must precede host */
+#undef PING6_PACKETS_FIRST
+
+/* path and args for ICMP ping command */
+#undef PING_COMMAND
+
+/* Define if ping has its own timeout option that should be set */
+#undef PING_HAS_TIMEOUT
+
+/* Define if packet count must precede host */
+#undef PING_PACKETS_FIRST
+
+/* path to /proc/meminfo if name changes */
+#undef PROC_MEMINFO
+
+/* Define to the type that is the result of default argument promotions of
+ type mode_t. */
+#undef PROMOTED_MODE_T
+
+/* Number of columns in ps command */
+#undef PS_COLS
+
+/* Verbatim command to execute for ps in check_procs */
+#undef PS_COMMAND
+
+/* Format string for scanning ps output in check_procs */
+#undef PS_FORMAT
+
+/* Whether the ps utility uses the "procetime" field */
+#undef PS_USES_PROCETIME
+
+/* Whether the ps utility uses the "procpcpu" field */
+#undef PS_USES_PROCPCPU
+
+/* Variable list for sscanf of 'ps' output */
+#undef PS_VARLIST
+
+/* Define if the pthread_in_use() detection is hard. */
+#undef PTHREAD_IN_USE_DETECTION_HARD
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'ptrdiff_t'. */
+#undef PTRDIFF_T_SUFFIX
+
+/* Forced workaround on redhat in spopen */
+#undef REDHAT_SPOPEN_ERROR
+
+/* Define to 1 if stat needs help when passed a file name with a trailing
+ slash */
+#undef REPLACE_FUNC_STAT_FILE
+
+/* Define if nl_langinfo exists but is overridden by gnulib. */
+#undef REPLACE_NL_LANGINFO
+
+/* Define to 1 if strerror(0) does not return a message implying success. */
+#undef REPLACE_STRERROR_0
+
+/* Define if vasnprintf exists but is overridden by gnulib. */
+#undef REPLACE_VASNPRINTF
+
+/* Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe. */
+#undef SETLOCALE_NULL_ALL_MTSAFE
+
+/* Define to 1 if setlocale (category, NULL) is multithread-safe. */
+#undef SETLOCALE_NULL_ONE_MTSAFE
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'sig_atomic_t'. */
+#undef SIG_ATOMIC_T_SUFFIX
+
+/* Define as the maximum value of type 'size_t', if the system doesn't define
+ it. */
+#ifndef SIZE_MAX
+# undef SIZE_MAX
+#endif
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'size_t'. */
+#undef SIZE_T_SUFFIX
+
+/* Define type of socket size */
+#undef SOCKET_SIZE_TYPE
+
+/* path to ssh binary */
+#undef SSH_COMMAND
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define if the block counts reported by statfs may be truncated to 2GB and
+ the correct values may be stored in the f_spare array. (SunOS 4.1.2, 4.1.3,
+ and 4.1.3_U1 are reported to have this problem. SunOS 4.1.1 seems not to be
+ affected.) */
+#undef STATFS_TRUNCATES_BLOCK_COUNTS
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+#undef STAT_MACROS_BROKEN
+
+/* Define if statfs takes 2 args and struct statfs has a field named f_bsize.
+ (4.3BSD, SunOS 4, HP-UX) */
+#undef STAT_STATFS2_BSIZE
+
+/* Define if statfs takes 2 args and struct statfs has a field named f_frsize.
+ (glibc/Linux > 2.6) */
+#undef STAT_STATFS2_FRSIZE
+
+/* Define if statfs takes 2 args and struct statfs has a field named f_fsize.
+ (4.4BSD, NetBSD) */
+#undef STAT_STATFS2_FSIZE
+
+/* Define if statfs takes 3 args. (DEC Alpha running OSF/1) */
+#undef STAT_STATFS3_OSF1
+
+/* Define if statfs takes 4 args. (SVR3, old Irix) */
+#undef STAT_STATFS4
+
+/* Define if there is a function named statvfs. (SVR4) */
+#undef STAT_STATVFS
+
+/* Define if statvfs64 should be preferred over statvfs. */
+#undef STAT_STATVFS64
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
+/* Define to 1 on System V Release 4. */
+#undef SVR4
+
+/* Path to swap/swapinfo binary, with any args */
+#undef SWAP_COMMAND
+
+/* Conversion factor to MB */
+#undef SWAP_CONVERSION
+
+/* Format string for parsing swap output */
+#undef SWAP_FORMAT
+
+/* Define to 1 if time_t is signed. */
+#undef TIME_T_IS_SIGNED
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Define to 1 if the type of the st_atim member of a struct stat is struct
+ timespec. */
+#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+
+/* Define to 1 for Encore UMAX. */
+#undef UMAX
+
+/* Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h> instead of
+ <sys/cpustats.h>. */
+#undef UMAX4_3
+
+/* Define if using gnutls libraries */
+#undef USE_GNUTLS
+
+/* Enable IPv6 support */
+#undef USE_IPV6
+
+/* Define if the combination of the ISO C and POSIX multithreading APIs can be
+ used. */
+#undef USE_ISOC_AND_POSIX_THREADS
+
+/* Define if the ISO C multithreading library can be used. */
+#undef USE_ISOC_THREADS
+
+/* Define to 1 if you want to use the Linux kernel cryptographic API. */
+#undef USE_LINUX_CRYPTO_API
+
+/* Define if using OpenSSL libraries */
+#undef USE_OPENSSL
+
+/* Define if the POSIX multithreading library can be used. */
+#undef USE_POSIX_THREADS
+
+/* Define if references to the POSIX multithreading library are satisfied by
+ libc. */
+#undef USE_POSIX_THREADS_FROM_LIBC
+
+/* Define if references to the POSIX multithreading library should be made
+ weak. */
+#undef USE_POSIX_THREADS_WEAK
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
+#ifndef _NETBSD_SOURCE
+# undef _NETBSD_SOURCE
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# undef __STDC_WANT_IEC_60559_BFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# undef __STDC_WANT_IEC_60559_DFP_EXT__
+#endif
+/* Enable extensions specified by C23 Annex F. */
+#ifndef __STDC_WANT_IEC_60559_EXT__
+# undef __STDC_WANT_IEC_60559_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#endif
+/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# undef __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+# undef __STDC_WANT_LIB_EXT2__
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# undef __STDC_WANT_MATH_SPEC_FUNCS__
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+
+
+/* Define if the native Windows multithreading API can be used. */
+#undef USE_WINDOWS_THREADS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if unsetenv returns void instead of int. */
+#undef VOID_UNSETENV
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wchar_t'. */
+#undef WCHAR_T_SUFFIX
+
+/* Define if the wcrtomb function does not work in the C locale. */
+#undef WCRTOMB_C_LOCALE_BUG
+
+/* Define if the wcrtomb function has an incorrect return value. */
+#undef WCRTOMB_RETVAL_BUG
+
+/* path and arguments for invoking 'who' */
+#undef WHO_COMMAND
+
+/* Define if WSAStartup is needed. */
+#undef WINDOWS_SOCKETS
+
+/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
+ 'wint_t'. */
+#undef WINT_T_SUFFIX
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+
+
+/* Define to enable the declarations of ISO C 11 types and functions. */
+#undef _ISOC11_SOURCE
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define to 1 on platforms where this makes off_t a 64-bit type. */
+#undef _LARGE_FILES
+
+/* Define to 1 on Solaris. */
+#undef _LCONV_C99
+
+/* The _Noreturn keyword of C11. */
+#ifndef _Noreturn
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+ && 0)
+ /* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
+# define _Noreturn [[noreturn]]
+# elif (defined __clang__ && __clang_major__ < 16 \
+ && defined _GL_WORK_AROUND_LLVM_BUG_59792)
+ /* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
+ that rare LLVM bug, though you may get many false-alarm warnings. */
+# define _Noreturn
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || (!defined __STRICT_ANSI__ \
+ && (_GL_GNUC_PREREQ (4, 7) \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+ /* _Noreturn works as-is. */
+# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+
+
+/* Define to 1 in order to get the POSIX compatible declarations of socket
+ functions. */
+#undef _POSIX_PII_SOCKET
+
+/* Define if you want <regex.h> to include <limits.h>, so that it consistently
+ overrides <limits.h>'s RE_DUP_MAX. */
+#undef _REGEX_INCLUDE_LIMITS_H
+
+/* Define if you want regoff_t to be at least as wide POSIX requires. */
+#undef _REGEX_LARGE_OFFSETS
+
+/* Number of bits in time_t, on hosts where this is settable. */
+#undef _TIME_BITS
+
+/* For standard stat data types on VMS. */
+#undef _USE_STD_STAT
+
+/* Define to rpl_ if the getopt replacement functions and variables should be
+ used. */
+#undef __GETOPT_PREFIX
+
+/* Define to 1 on platforms where this makes time_t a 64-bit type. */
+#undef __MINGW_USE_VC2005_COMPAT
+
+/* Define to 1 if the system <stdint.h> predates C++11. */
+#undef __STDC_CONSTANT_MACROS
+
+/* Define to 1 if the system <stdint.h> predates C++11. */
+#undef __STDC_LIMIT_MACROS
+
+/* Define to 1 if C does not support variable-length arrays, and if the
+ compiler does not already define this. */
+#undef __STDC_NO_VLA__
+
+/* bsd specific code in check_dhcp.c */
+#undef __bsd__
+
+/* hpux specific code in check_dhcp.c */
+#undef __hpux__
+
+/* linux specific code in check_dhcp.c */
+#undef __linux__
+
+/* sun specific code in check_dhcp.c */
+#undef __sun__
+
+/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+ signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+ invoked from such signal handlers. Such functions have some restrictions:
+ * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+ or should be listed as async-signal-safe in POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+ section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
+ particular, are NOT async-signal-safe.
+ * All memory locations (variables and struct fields) that these functions
+ access must be marked 'volatile'. This holds for both read and write
+ accesses. Otherwise the compiler might optimize away stores to and
+ reads from such locations that occur in the program, depending on its
+ data flow analysis. For example, when the program contains a loop
+ that is intended to inspect a variable set from within a signal handler
+ while (!signal_occurred)
+ ;
+ the compiler is allowed to transform this into an endless loop if the
+ variable 'signal_occurred' is not declared 'volatile'.
+ Additionally, recall that:
+ * A signal handler should not modify errno (except if it is a handler
+ for a fatal signal and ends by raising the same signal again, thus
+ provoking the termination of the process). If it invokes a function
+ that may clobber errno, it needs to save and restore the value of
+ errno. */
+#define _GL_ASYNC_SAFE
+
+
+/* Attributes. */
+#if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
+#else
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# ifdef _ICC
+# define _GL_ATTR_may_alias 0
+# else
+# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
+#endif
+
+/* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */
+#if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)
+# pragma GCC diagnostic ignored "-Wpedantic"
+#endif
+
+
+/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
+ is the size of the returned memory block.
+ _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
+ by the Nth argument of the function is the size of the returned memory block.
+ */
+/* Applies to: function, pointer to function, function types. */
+#ifndef _GL_ATTRIBUTE_ALLOC_SIZE
+# if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+# else
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
+ function and report an error if it cannot do so. */
+/* Applies to: function. */
+#ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
+# if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
+# else
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
+ in stack traces when debugging. The compiler should omit the function from
+ stack traces. */
+/* Applies to: function. */
+#ifndef _GL_ATTRIBUTE_ARTIFICIAL
+# if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
+# else
+# define _GL_ATTRIBUTE_ARTIFICIAL
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */
+/* Applies to: functions. */
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+ <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+ Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
+#ifndef _GL_ATTRIBUTE_COLD
+# if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# ifndef __SUNPRO_C
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
+# else
+# define _GL_ATTRIBUTE_COLD
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
+ calls to the function with the same arguments.
+ This attribute is safe for a function that neither depends on nor affects
+ observable state, and always returns exactly once - e.g., does not loop
+ forever, and does not call longjmp.
+ (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_CONST
+# if _GL_HAS_ATTRIBUTE (const)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+# else
+# define _GL_ATTRIBUTE_CONST
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F.
+ _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if _GL_GNUC_PREREQ (11, 0)
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+/* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
+ to use this earlier definition, since <stdlib.h> may not have been included
+ yet. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
+ The compiler may warn if the entity is used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: namespace, class, template specialization. */
+#ifndef _GL_ATTRIBUTE_DEPRECATED
+# ifdef __has_c_attribute
+# if __has_c_attribute (__deprecated__)
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+# endif
+# ifndef _GL_ATTRIBUTE_DEPRECATED
+# define _GL_ATTRIBUTE_DEPRECATED
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and
+ the function call is not optimized away.
+ _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and
+ the function call is not optimized away. */
+/* Applies to: functions. */
+#if !(defined _GL_ATTRIBUTE_ERROR && defined _GL_ATTRIBUTE_WARNING)
+# if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+# elif _GL_HAS_ATTRIBUTE (diagnose_if)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+# else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain
+ visible to debuggers etc., even with '-fwhole-program'. */
+/* Applies to: functions, variables. */
+#ifndef _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+# if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+# else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if
+ the control flow falls through to the immediately following 'case' or
+ 'default' label. The compiler should not warn in this case. */
+/* Applies to: Empty statement (;), inside a 'switch' statement. */
+/* Always expands to something. */
+#ifndef _GL_ATTRIBUTE_FALLTHROUGH
+# ifdef __has_c_attribute
+# if __has_c_attribute (__fallthrough__)
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_FALLTHROUGH && _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+# endif
+# ifndef _GL_ATTRIBUTE_FALLTHROUGH
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
+ declares that the STRING-INDEXth function argument is a format string of
+ style ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_FORMAT
+# if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other
+ compilation unit, it executes code from that unit only by return or by
+ exception handling. This declaration lets the compiler optimize that unit
+ more aggressively. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_LEAF
+# if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+# else
+# define _GL_ATTRIBUTE_LEAF
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if _GL_HAS_ATTRIBUTE (malloc)
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the
+ same storage as pointers to other types. Thus this declaration disables
+ strict aliasing optimization. */
+/* Applies to: types. */
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
+#ifndef _GL_ATTRIBUTE_MAY_ALIAS
+# if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+# else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
+ the entity is not used. The compiler should not warn if the entity is not
+ used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: class. */
+/* In C++ and C23, this is spelled [[__maybe_unused__]].
+ GCC's syntax is __attribute__ ((__unused__)).
+ clang supports both syntaxes. */
+#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+# ifdef __has_c_attribute
+# if __has_c_attribute (__maybe_unused__)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+# endif
+# endif
+# ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
+# endif
+#endif
+/* Alternative spelling of this macro, for convenience and for
+ compatibility with glibc/include/libc-symbols.h. */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+/* Earlier spellings of this macro. */
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not
+ discard the return value. The compiler may warn if the caller does not use
+ the return value, unless the caller uses something like ignore_value. */
+/* Applies to: function, enumeration, class. */
+#ifndef _GL_ATTRIBUTE_NODISCARD
+# ifdef __has_c_attribute
+# if __has_c_attribute (__nodiscard__)
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+# endif
+# ifndef _GL_ATTRIBUTE_NODISCARD
+# define _GL_ATTRIBUTE_NODISCARD
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the
+ function. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NOINLINE
+# if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+# else
+# define _GL_ATTRIBUTE_NOINLINE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
+ must not be NULL.
+ _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be
+ null. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NONNULL
+# if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+# else
+# define _GL_ATTRIBUTE_NONNULL(args)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
+ not meant to be NUL-terminated. */
+/* Applies to: struct/union members and variables that are arrays of element
+ type '[[un]signed] char'. */
+#ifndef _GL_ATTRIBUTE_NONSTRING
+# if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+# else
+# define _GL_ATTRIBUTE_NONSTRING
+# endif
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
+
+/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
+ */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NOTHROW
+# if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+# else
+# define _GL_ATTRIBUTE_NOTHROW
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_PACKED declares:
+ For struct members: The member has the smallest possible alignment.
+ For struct, union, class: All members have the smallest possible alignment,
+ minimizing the memory required. */
+/* Applies to: struct members, struct, union,
+ in C++ also: class. */
+#ifndef _GL_ATTRIBUTE_PACKED
+# if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+# else
+# define _GL_ATTRIBUTE_PACKED
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
+ calls to the function with the same arguments if observable state is not
+ changed between calls.
+ This attribute is safe for a function that does not affect
+ observable state, and always returns exactly once.
+ (This attribute is looser than _GL_ATTRIBUTE_CONST.) */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is
+ a non-NULL pointer. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_RETURNS_NONNULL
+# if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+# else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a
+ trailing NULL argument.
+ _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
+ _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_SENTINEL
+# if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+# else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+# endif
+#endif
+
+/* A helper macro. Don't use it directly. */
+#ifndef _GL_ATTRIBUTE_UNUSED
+# if _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# else
+# define _GL_ATTRIBUTE_UNUSED
+# endif
+#endif
+
+
+/* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the
+ immediately preceding label is not used. The compiler should not warn
+ if the label is not used. */
+/* Applies to: label (both in C and C++). */
+/* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
+ syntax. But clang does. */
+#ifndef _GL_UNUSED_LABEL
+# if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
+# else
+# define _GL_UNUSED_LABEL
+# endif
+#endif
+
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define curl_free() as free() if our version of curl lacks curl_free. */
+#undef curl_free
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */
+#undef intmax_t
+
+/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+ the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+ earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+ __APPLE__ && __MACH__ test for Mac OS X.
+ __APPLE_CC__ tests for the Apple compiler and its version.
+ __STDC_VERSION__ tests for the C99 mode. */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+# define __GNUC_STDC_INLINE__ 1
+#endif
+
+/* Define to a type if <wchar.h> does not define. */
+#undef mbstate_t
+
+/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
+ n1 and n2 are expressions without side effects, that evaluate to real
+ numbers (excluding NaN).
+ It returns
+ 1 if n1 > n2
+ 0 if n1 == n2
+ -1 if n1 < n2
+ The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
+ jump with nearly all GCC versions up to GCC 10.
+ This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
+ GCC versions up to GCC 9.
+ The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
+ avoids conditional jumps in all GCC versions >= 3.4. */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+
+
+/* Define to the real name of the mktime_internal function. */
+#undef mktime_internal
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
+
+/* Define to the type of st_nlink in struct stat, or a supertype. */
+#undef nlink_t
+
+/* Define as a signed integer type capable of holding a process identifier. */
+#undef pid_t
+
+/* Define as the type of the result of subtracting two pointers, if the system
+ doesn't define it. */
+#undef ptrdiff_t
+
+/* Define to rpl_re_comp if the replacement should be used. */
+#undef re_comp
+
+/* Define to rpl_re_compile_fastmap if the replacement should be used. */
+#undef re_compile_fastmap
+
+/* Define to rpl_re_compile_pattern if the replacement should be used. */
+#undef re_compile_pattern
+
+/* Define to rpl_re_exec if the replacement should be used. */
+#undef re_exec
+
+/* Define to rpl_re_match if the replacement should be used. */
+#undef re_match
+
+/* Define to rpl_re_match_2 if the replacement should be used. */
+#undef re_match_2
+
+/* Define to rpl_re_search if the replacement should be used. */
+#undef re_search
+
+/* Define to rpl_re_search_2 if the replacement should be used. */
+#undef re_search_2
+
+/* Define to rpl_re_set_registers if the replacement should be used. */
+#undef re_set_registers
+
+/* Define to rpl_re_set_syntax if the replacement should be used. */
+#undef re_set_syntax
+
+/* Define to rpl_re_syntax_options if the replacement should be used. */
+#undef re_syntax_options
+
+/* Define to rpl_regcomp if the replacement should be used. */
+#undef regcomp
+
+/* Define to rpl_regerror if the replacement should be used. */
+#undef regerror
+
+/* Define to rpl_regexec if the replacement should be used. */
+#undef regexec
+
+/* Define to rpl_regfree if the replacement should be used. */
+#undef regfree
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported only directly. */
+#undef restrict
+/* Work around a bug in older versions of Sun C++, which did not
+ #define __restrict__ or support _Restrict or __restrict__
+ even though the corresponding Sun C compiler ended up with
+ "#define restrict _Restrict" or "#define restrict __restrict__"
+ in the previous line. This workaround can be removed once
+ we assume Oracle Developer Studio 12.5 (2016) or later. */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* type to use in place of socklen_t if not defined */
+#undef socklen_t
+
+/* Define as a signed type of the same size as size_t. */
+#undef ssize_t
+
+#if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof
+# if HAVE_STDALIGN_H
+# include <stdalign.h>
+# else
+ /* Substitute. Keep consistent with gnulib/lib/stdalign.in.h. */
+# ifndef _GL_STDALIGN_H
+# define _GL_STDALIGN_H
+# undef _Alignas
+# undef _Alignof
+# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# ifdef __cplusplus
+# if (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignof(type) alignof (type)
+# else
+ template <class __t> struct __alignof_helper { char __a; __t __b; };
+# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# else
+# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
+# define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+# else
+# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# endif
+# endif
+# if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))
+# define alignof _Alignof
+# endif
+# define __alignof_is_defined 1
+# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignas(a) alignas (a)
+# elif (!defined __attribute__ \
+ && ((defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__ && !defined __ibmxl__) \
+ || (4 <= __clang_major__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
+# define _Alignas(a) __attribute__ ((__aligned__ (a)))
+# elif 1300 <= _MSC_VER
+# define _Alignas(a) __declspec (align (a))
+# endif
+# endif
+# if ((defined _Alignas \
+ && !(defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# define alignas _Alignas
+# endif
+# if (defined alignas \
+ || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)))
+# define __alignas_is_defined 1
+# endif
+# if _GL_STDALIGN_NEEDS_STDDEF
+# include <stddef.h>
+# endif
+# endif /* _GL_STDALIGN_H */
+# endif
+#endif
+
+#ifndef HAVE_C_BOOL
+# if !defined __cplusplus && !defined __bool_true_false_are_defined
+# if HAVE_STDBOOL_H
+# include <stdbool.h>
+# else
+# if defined __SUNPRO_C
+# error "<stdbool.h> is not usable with this configuration. To make it usable, add -D_STDC_C99= to $CC."
+# else
+# error "<stdbool.h> does not exist on this platform. Use gnulib module 'stdbool-c99' instead of gnulib module 'stdbool'."
+# endif
+# endif
+# endif
+# if !true
+# define true (!false)
+# endif
+#endif
+
+#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \
+ && (!defined __cplusplus \
+ || (__cpp_static_assert < 201411 \
+ && __GNUG__ < 6 && __clang_major__ < 6)))
+ #include <assert.h>
+ #undef/**/assert
+ /* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments.
+ We need it also to be invocable with a single argument. */
+ #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus
+ #undef/**/static_assert
+ #define static_assert _Static_assert
+ #endif
+#endif
diff --git a/config.rpath b/config.rpath
new file mode 100755
index 0000000..e082db6
--- /dev/null
+++ b/config.rpath
@@ -0,0 +1,660 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2006 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ darwin*)
+ case $cc_basename in
+ xlc*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ mingw* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ wl='-Wl,'
+ ;;
+ pgcc | pgf77 | pgf90)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ sco3.2v5*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we cannot use
+ # them.
+ ld_shlibs=no
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ interix3*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if test "$GCC" = yes ; then
+ :
+ else
+ case $cc_basename in
+ xlc*)
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+ freebsd2.2*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ freebsd2*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ openbsd*)
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix4* | aix5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ library_names_spec='$libname.a'
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd1*)
+ ;;
+ kfreebsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_os" in
+ freebsd[123]*)
+ library_names_spec='$libname$shrext$versuffix' ;;
+ *)
+ library_names_spec='$libname$shrext' ;;
+ esac
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ nto-qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/config_test/Makefile b/config_test/Makefile
new file mode 100644
index 0000000..1064d56
--- /dev/null
+++ b/config_test/Makefile
@@ -0,0 +1,12 @@
+
+all: child_test
+
+child_test: child_test.c
+ gcc -o child_test child_test.c
+
+test:
+ ./run_tests 10 100 > /dev/null
+
+clean:
+ rm -f child_test
+
diff --git a/config_test/child_test.c b/config_test/child_test.c
new file mode 100644
index 0000000..2add3bc
--- /dev/null
+++ b/config_test/child_test.c
@@ -0,0 +1,77 @@
+/* Base code taken from http://www-h.eng.cam.ac.uk/help/tpl/unix/fork.html
+ * Fix for redhat suggested by Ptere Pramberger, peter@pramberger.at */
+#include <unistd.h>
+#include <sys/wait.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <signal.h>
+void popen_sigchld_handler (int);
+int childtermd;
+
+int main(){
+ char str[1024];
+ int pipefd[2];
+ pid_t pid;
+ int status, died;
+
+ if (signal (SIGCHLD, popen_sigchld_handler) == SIG_ERR) {
+ printf ("Cannot catch SIGCHLD\n");
+ _exit(-1);
+ }
+
+ pipe (pipefd);
+ switch(pid=fork()){
+ case -1:
+ printf("can't fork\n");
+ _exit(-1);
+
+ case 0 : /* this is the code the child runs */
+ close(1); /* close stdout */
+ /* pipefd[1] is for writing to the pipe. We want the output
+ * that used to go to the standard output (file descriptor 1)
+ * to be written to the pipe. The following command does this,
+ * creating a new file descriptor 1 (the lowest available)
+ * that writes where pipefd[1] goes. */
+ dup (pipefd[1]); /* points pipefd at file descriptor */
+ /* the child isn't going to read from the pipe, so
+ * pipefd[0] can be closed */
+ close (pipefd[0]);
+
+ /* These are the commands to run, with success commented. dig and nslookup only problems */
+ /*execl ("/bin/date","date",0);*/ /* 100% */
+ /*execl ("/bin/cat", "cat", "/etc/hosts", 0);*/ /* 100% */
+ /*execl ("/usr/bin/dig", "dig", "redhat.com", 0);*/ /* 69% */
+ /*execl("/bin/sleep", "sleep", "1", 0);*/ /* 100% */
+ execl ("/usr/bin/nslookup","nslookup","redhat.com",0); /* 90% (after 100 tests), 40% (after 10 tests) */
+ /*execl ("/bin/ping","ping","-c","1","localhost",0);*/ /* 100% */
+ /*execl ("/bin/ping","ping","-c","1","192.168.10.32",0);*/ /* 100% */
+ _exit(0);
+
+ default: /* this is the code the parent runs */
+
+ close(0); /* close stdin */
+ /* Set file descriptor 0 (stdin) to read from the pipe */
+ dup (pipefd[0]);
+ /* the parent isn't going to write to the pipe */
+ close (pipefd[1]);
+ /* Now read from the pipe */
+ fgets(str, 1023, stdin);
+ /*printf("1st line output is %s\n", str);*/
+
+ /*while (!childtermd);*/ /* Uncomment this line to fix */
+
+ died= wait(&status);
+ /*printf("died=%d status=%d\n", died, status);*/
+ if (died > 0) _exit(0);
+ else _exit(1);
+ }
+}
+
+void
+popen_sigchld_handler (int signo)
+{
+ if (signo == SIGCHLD) {
+ /*printf("Caught sigchld\n");*/
+ childtermd = 1;
+ }
+}
diff --git a/config_test/run_tests b/config_test/run_tests
new file mode 100755
index 0000000..e7db3ca
--- /dev/null
+++ b/config_test/run_tests
@@ -0,0 +1,30 @@
+#!/bin/ksh
+# $1 is the number of iterations to run
+# If $2 is specified, this is the number of times you run each iteration
+# If there is a fail at run, exit 1
+# Prints to stdout # of successes and passes
+# Prints to stderr a dot for each run
+
+total_runs=$2
+[[ -z $total_runs ]] && total_runs=1
+run=1
+while [[ $run -le $total_runs ]] ; do
+ i=0
+ success=0
+ fail=0
+ while [[ $i -lt $1 ]] ; do
+ ./child_test
+ if [[ $? -eq 0 ]] ; then
+ success=$(($success+1))
+ else
+ fail=$((fail+1))
+ fi
+ i=$(($i+1))
+ done
+ print "Success=$success Fail=$fail"
+ [[ $fail -gt 0 ]] && exit 1
+ run=$(($run+1))
+ [[ $total_runs -gt 1 ]] && print -u2 -n "."
+done
+[[ $total_runs -gt 1 ]] && print -u2
+exit 0
diff --git a/configure b/configure
new file mode 100755
index 0000000..e5442c7
--- /dev/null
+++ b/configure
@@ -0,0 +1,54320 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for monitoring-plugins 2.3.5.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='monitoring-plugins'
+PACKAGE_TARNAME='monitoring-plugins'
+PACKAGE_VERSION='2.3.5'
+PACKAGE_STRING='monitoring-plugins 2.3.5'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+ac_unique_file="NPTest.pm"
+ac_header_list=
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+gl_use_threads_default=
+gl_use_winpthreads_default=
+gt_needs=
+ac_func_list=
+with_openssl_default='no'
+LIB_CRYPTO=
+gl_floorf_required=plain
+gl_getopt_required=POSIX
+enable_year2038=no
+enable_largefile=yes
+ac_subst_vars='gltests_LIBOBJDEPS
+gltests_LTLIBOBJS
+gltests_LIBOBJS
+gl_LIBOBJDEPS
+gl_LTLIBOBJS
+gl_LIBOBJS
+am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBGNU_LTLIBDEPS
+LIBGNU_LIBDEPS
+GL_CFLAG_GNULIB_WARNINGS
+GL_CFLAG_ALLOW_WARNINGS
+gltests_WITNESS
+GL_COND_OBJ_WINDOWS_RWLOCK_FALSE
+GL_COND_OBJ_WINDOWS_RWLOCK_TRUE
+GL_COND_OBJ_WINDOWS_RECMUTEX_FALSE
+GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE
+GL_COND_OBJ_WINDOWS_ONCE_FALSE
+GL_COND_OBJ_WINDOWS_ONCE_TRUE
+GL_COND_OBJ_WINDOWS_MUTEX_FALSE
+GL_COND_OBJ_WINDOWS_MUTEX_TRUE
+GL_GNULIB_TOWCTRANS
+GL_GNULIB_WCTRANS
+GL_GNULIB_ISWCTYPE
+GL_GNULIB_WCTYPE
+GL_GNULIB_ISWXDIGIT
+GL_GNULIB_ISWDIGIT
+GL_GNULIB_ISWBLANK
+REPLACE_TOWLOWER
+REPLACE_ISWCNTRL
+HAVE_WCTYPE_H
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
+NEXT_WCTYPE_H
+HAVE_ISWCNTRL
+REPLACE_ISWXDIGIT
+REPLACE_ISWDIGIT
+REPLACE_ISWBLANK
+HAVE_WCTRANS_T
+HAVE_WCTYPE_T
+HAVE_ISWBLANK
+GL_COND_OBJ_WCRTOMB_FALSE
+GL_COND_OBJ_WCRTOMB_TRUE
+HAVE_CRTDEFS_H
+HAVE_WINT_T
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
+NEXT_WCHAR_H
+GL_COND_OBJ_UNSETENV_FALSE
+GL_COND_OBJ_UNSETENV_TRUE
+HAVE_UNISTD_H
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
+NEXT_UNISTD_H
+GL_COND_OBJ_TIMEGM_FALSE
+GL_COND_OBJ_TIMEGM_TRUE
+GL_COND_OBJ_TIME_R_FALSE
+GL_COND_OBJ_TIME_R_TRUE
+TIME_H_DEFINES_TIME_UTC
+UNISTD_H_DEFINES_STRUCT_TIMESPEC
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
+TIME_H_DEFINES_STRUCT_TIMESPEC
+NEXT_AS_FIRST_DIRECTIVE_TIME_H
+NEXT_TIME_H
+HAVE_SYS_UIO_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
+NEXT_SYS_UIO_H
+GL_GNULIB_ACCEPT4
+GL_GNULIB_SHUTDOWN
+GL_GNULIB_SETSOCKOPT
+GL_GNULIB_SENDTO
+GL_GNULIB_RECVFROM
+GL_GNULIB_SEND
+GL_GNULIB_RECV
+GL_GNULIB_LISTEN
+GL_GNULIB_GETSOCKOPT
+GL_GNULIB_GETSOCKNAME
+GL_GNULIB_GETPEERNAME
+GL_GNULIB_BIND
+GL_GNULIB_ACCEPT
+GL_GNULIB_CONNECT
+GL_GNULIB_SOCKET
+GL_COND_OBJ_STRSEP_FALSE
+GL_COND_OBJ_STRSEP_TRUE
+GL_GNULIB_FFS
+HAVE_STRINGS_H
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H
+NEXT_STRINGS_H
+NEXT_AS_FIRST_DIRECTIVE_STRING_H
+NEXT_STRING_H
+GL_COND_OBJ_STRERROR_OVERRIDE_FALSE
+GL_COND_OBJ_STRERROR_OVERRIDE_TRUE
+GL_COND_OBJ_STRERROR_FALSE
+GL_COND_OBJ_STRERROR_TRUE
+GL_COND_OBJ_STRNCASECMP_FALSE
+GL_COND_OBJ_STRNCASECMP_TRUE
+GL_COND_OBJ_STRCASECMP_FALSE
+GL_COND_OBJ_STRCASECMP_TRUE
+HAVE_DECL_STRNCASECMP
+HAVE_STRCASECMP
+HAVE_FFS
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
+NEXT_STDLIB_H
+GL_COND_OBJ_STDIO_WRITE_FALSE
+GL_COND_OBJ_STDIO_WRITE_TRUE
+GL_COND_OBJ_STDIO_READ_FALSE
+GL_COND_OBJ_STDIO_READ_TRUE
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H
+NEXT_STDIO_H
+GL_GENERATE_STDINT_H_FALSE
+GL_GENERATE_STDINT_H_TRUE
+STDINT_H
+GL_GENERATE_STDDEF_H_FALSE
+GL_GENERATE_STDDEF_H_TRUE
+STDDEF_H
+GL_GENERATE_STDCKDINT_H_FALSE
+GL_GENERATE_STDCKDINT_H_TRUE
+STDCKDINT_H
+GL_GENERATE_STDALIGN_H_FALSE
+GL_GENERATE_STDALIGN_H_TRUE
+STDALIGN_H
+GL_COND_OBJ_STAT_FALSE
+GL_COND_OBJ_STAT_TRUE
+LIBSOCKET
+GL_COND_OBJ_SETLOCALE_LOCK_FALSE
+GL_COND_OBJ_SETLOCALE_LOCK_TRUE
+GL_COND_OBJ_SETENV_FALSE
+GL_COND_OBJ_SETENV_TRUE
+GL_COND_OBJ_REGEX_FALSE
+GL_COND_OBJ_REGEX_TRUE
+GL_COND_OBJ_REALLOCARRAY_FALSE
+GL_COND_OBJ_REALLOCARRAY_TRUE
+GL_COND_OBJ_OPEN_FALSE
+GL_COND_OBJ_OPEN_TRUE
+GL_COND_OBJ_NL_LANGINFO_LOCK_FALSE
+GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE
+GL_COND_OBJ_NL_LANGINFO_FALSE
+GL_COND_OBJ_NL_LANGINFO_TRUE
+LIB_NL_LANGINFO
+GL_GENERATE_NETINET_IN_H_FALSE
+GL_GENERATE_NETINET_IN_H_TRUE
+NETINET_IN_H
+HAVE_NETINET_IN_H
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
+NEXT_NETINET_IN_H
+GL_COND_OBJ_MSVC_NOTHROW_FALSE
+GL_COND_OBJ_MSVC_NOTHROW_TRUE
+GL_COND_OBJ_MSVC_INVAL_FALSE
+GL_COND_OBJ_MSVC_INVAL_TRUE
+GL_COND_OBJ_MOUNTLIST_FALSE
+GL_COND_OBJ_MOUNTLIST_TRUE
+GL_GNULIB_MDA_TZSET
+GL_GNULIB_TZSET
+GL_GNULIB_TIME_RZ
+GL_GNULIB_TIME_R
+GL_GNULIB_TIMESPEC_GETRES
+GL_GNULIB_TIMESPEC_GET
+GL_GNULIB_TIMEGM
+GL_GNULIB_STRPTIME
+GL_GNULIB_STRFTIME
+GL_GNULIB_NANOSLEEP
+GL_GNULIB_LOCALTIME
+GL_GNULIB_MKTIME
+GL_GNULIB_CTIME
+REPLACE_LOCALTIME
+REPLACE_GMTIME
+GNULIB_GETTIMEOFDAY
+REPLACE_TZSET
+REPLACE_TIMEGM
+REPLACE_STRFTIME
+REPLACE_NANOSLEEP
+REPLACE_MKTIME
+REPLACE_LOCALTIME_R
+REPLACE_CTIME
+HAVE_TIMEZONE_T
+HAVE_TIMESPEC_GETRES
+HAVE_TIMESPEC_GET
+HAVE_TIMEGM
+HAVE_STRPTIME
+HAVE_NANOSLEEP
+HAVE_DECL_LOCALTIME_R
+GL_GNULIB_MDA_STRDUP
+GL_GNULIB_MDA_MEMCCPY
+GL_GNULIB_STRVERSCMP
+GL_GNULIB_STRSIGNAL
+GL_GNULIB_SIGDESCR_NP
+GL_GNULIB_SIGABBREV_NP
+GL_GNULIB_STRERRORNAME_NP
+GL_GNULIB_STRERROR_R
+GL_GNULIB_STRERROR
+GL_GNULIB_MBSTOK_R
+GL_GNULIB_MBSSEP
+GL_GNULIB_MBSSPN
+GL_GNULIB_MBSPBRK
+GL_GNULIB_MBSCSPN
+GL_GNULIB_MBSCASESTR
+GL_GNULIB_MBSPCASECMP
+GL_GNULIB_MBSNCASECMP
+GL_GNULIB_MBSCASECMP
+GL_GNULIB_MBSSTR
+GL_GNULIB_MBSRCHR
+GL_GNULIB_MBSCHR
+GL_GNULIB_MBSNLEN
+GL_GNULIB_MBSLEN
+GL_GNULIB_STRTOK_R
+GL_GNULIB_STRCASESTR
+GL_GNULIB_STRSTR
+GL_GNULIB_STRSEP
+GL_GNULIB_STRPBRK
+GL_GNULIB_STRNLEN
+GL_GNULIB_STRNDUP
+GL_GNULIB_STRNCAT
+GL_GNULIB_STRDUP
+GL_GNULIB_STRCHRNUL
+GL_GNULIB_STPNCPY
+GL_GNULIB_STPCPY
+GL_GNULIB_RAWMEMCHR
+GL_GNULIB_MEMSET_EXPLICIT
+GL_GNULIB_MEMRCHR
+GL_GNULIB_MEMPCPY
+GL_GNULIB_MEMMEM
+GL_GNULIB_MEMCHR
+GL_GNULIB_FFSLL
+GL_GNULIB_FFSL
+GL_GNULIB_EXPLICIT_BZERO
+GL_COND_OBJ_MEMCHR_FALSE
+GL_COND_OBJ_MEMCHR_TRUE
+UNDEFINE_STRTOK_R
+REPLACE_STRSIGNAL
+REPLACE_STRERRORNAME_NP
+REPLACE_STRERROR_R
+REPLACE_STRERROR
+REPLACE_STRTOK_R
+REPLACE_STRCASESTR
+REPLACE_STRSTR
+REPLACE_STRNLEN
+REPLACE_STRNDUP
+REPLACE_STRNCAT
+REPLACE_STRDUP
+REPLACE_STRCHRNUL
+REPLACE_STPNCPY
+REPLACE_MEMMEM
+REPLACE_MEMCHR
+REPLACE_FFSLL
+HAVE_STRVERSCMP
+HAVE_DECL_STRSIGNAL
+HAVE_SIGDESCR_NP
+HAVE_SIGABBREV_NP
+HAVE_STRERRORNAME_NP
+HAVE_DECL_STRERROR_R
+HAVE_DECL_STRTOK_R
+HAVE_STRCASESTR
+HAVE_STRSEP
+HAVE_STRPBRK
+HAVE_DECL_STRNLEN
+HAVE_DECL_STRNDUP
+HAVE_DECL_STRDUP
+HAVE_STRCHRNUL
+HAVE_STPNCPY
+HAVE_STPCPY
+HAVE_RAWMEMCHR
+HAVE_DECL_MEMRCHR
+HAVE_MEMSET_EXPLICIT
+HAVE_MEMPCPY
+HAVE_DECL_MEMMEM
+HAVE_FFSLL
+HAVE_FFSL
+HAVE_EXPLICIT_BZERO
+HAVE_MBSLEN
+GL_COND_OBJ_MBTOWC_FALSE
+GL_COND_OBJ_MBTOWC_TRUE
+GL_COND_OBJ_MBSINIT_FALSE
+GL_COND_OBJ_MBSINIT_TRUE
+HAVE_VISIBILITY
+CFLAG_VISIBILITY
+GL_COND_OBJ_MBRTOWC_FALSE
+GL_COND_OBJ_MBRTOWC_TRUE
+LIB_MBRTOWC
+LOCALE_ZH_CN
+LOCALE_FR_UTF8
+LOCALE_JA
+NEXT_AS_FIRST_DIRECTIVE_MATH_H
+NEXT_MATH_H
+GL_COND_OBJ_LSEEK_FALSE
+GL_COND_OBJ_LSEEK_TRUE
+LTLIBMULTITHREAD
+LIBMULTITHREAD
+LTLIBTHREAD
+LIBTHREAD
+LIBSTDTHREAD
+GL_COND_OBJ_LOCALECONV_FALSE
+GL_COND_OBJ_LOCALECONV_TRUE
+GL_GNULIB_LOCALENAME
+GL_GNULIB_DUPLOCALE
+GL_GNULIB_SETLOCALE_NULL
+GL_GNULIB_SETLOCALE
+GL_GNULIB_LOCALECONV
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
+NEXT_LOCALE_H
+HAVE_XLOCALE_H
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
+NEXT_STDDEF_H
+HAVE_WCHAR_T
+HAVE_MAX_ALIGN_T
+REPLACE_NULL
+LOCALENAME_ENHANCE_LOCALE_FUNCS
+REPLACE_STRUCT_LCONV
+REPLACE_FREELOCALE
+REPLACE_DUPLOCALE
+REPLACE_NEWLOCALE
+REPLACE_SETLOCALE
+REPLACE_LOCALECONV
+HAVE_FREELOCALE
+HAVE_DUPLOCALE
+HAVE_NEWLOCALE
+LOCALCHARSET_TESTS_ENVIRONMENT
+GL_GENERATE_LIMITS_H_FALSE
+GL_GENERATE_LIMITS_H_TRUE
+LIMITS_H
+GL_GNULIB_NL_LANGINFO
+HAVE_LANGINFO_YESEXPR
+HAVE_LANGINFO_ERA
+HAVE_LANGINFO_ALTMON
+HAVE_LANGINFO_T_FMT_AMPM
+HAVE_LANGINFO_CODESET
+HAVE_LANGINFO_H
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H
+NEXT_LANGINFO_H
+REPLACE_NL_LANGINFO
+HAVE_NL_LANGINFO
+GL_GNULIB_STRTOUMAX
+GL_GNULIB_STRTOIMAX
+GL_GNULIB_IMAXDIV
+GL_GNULIB_IMAXABS
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
+NEXT_INTTYPES_H
+UINT64_MAX_EQ_ULONG_MAX
+UINT32_MAX_LT_UINTMAX_MAX
+PRIPTR_PREFIX
+INT64_MAX_EQ_LONG_MAX
+INT32_MAX_LT_INTMAX_MAX
+REPLACE_STRTOUMAX
+REPLACE_STRTOIMAX
+HAVE_IMAXDIV_T
+HAVE_DECL_STRTOUMAX
+HAVE_DECL_STRTOIMAX
+HAVE_DECL_IMAXDIV
+HAVE_DECL_IMAXABS
+HAVE_SYS_INTTYPES_H
+HAVE_SYS_BITYPES_H
+HAVE_C99_STDINT_H
+WINT_T_SUFFIX
+WCHAR_T_SUFFIX
+SIG_ATOMIC_T_SUFFIX
+SIZE_T_SUFFIX
+PTRDIFF_T_SUFFIX
+HAVE_SIGNED_WINT_T
+HAVE_SIGNED_WCHAR_T
+HAVE_SIGNED_SIG_ATOMIC_T
+BITSIZEOF_WINT_T
+BITSIZEOF_WCHAR_T
+BITSIZEOF_SIG_ATOMIC_T
+BITSIZEOF_SIZE_T
+BITSIZEOF_PTRDIFF_T
+APPLE_UNIVERSAL_BUILD
+HAVE_STDINT_H
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H
+NEXT_STDINT_H
+HAVE_SYS_TYPES_H
+HAVE_INTTYPES_H
+HAVE_WCHAR_H
+GNULIBHEADERS_OVERRIDE_WINT_T
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
+NEXT_LIMITS_H
+GL_COND_OBJ_INET_NTOP_FALSE
+GL_COND_OBJ_INET_NTOP_TRUE
+LIB_HARD_LOCALE
+LIB_SETLOCALE_NULL
+LIB_SCHED_YIELD
+LIBPMULTITHREAD
+LIBPTHREAD
+GL_COND_OBJ_GETOPT_FALSE
+GL_COND_OBJ_GETOPT_TRUE
+GL_GENERATE_GETOPT_CDEFS_H_FALSE
+GL_GENERATE_GETOPT_CDEFS_H_TRUE
+GETOPT_CDEFS_H
+GL_GENERATE_GETOPT_H_FALSE
+GL_GENERATE_GETOPT_H_TRUE
+GETOPT_H
+HAVE_SYS_CDEFS_H
+HAVE_GETOPT_H
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
+NEXT_GETOPT_H
+GL_COND_OBJ_GETLOADAVG_FALSE
+GL_COND_OBJ_GETLOADAVG_TRUE
+GETLOADAVG_LIBS
+GL_COND_OBJ_GETLINE_FALSE
+GL_COND_OBJ_GETLINE_TRUE
+GL_COND_OBJ_GETHOSTNAME_FALSE
+GL_COND_OBJ_GETHOSTNAME_TRUE
+GETHOSTNAME_LIB
+GL_COND_OBJ_GETDTABLESIZE_FALSE
+GL_COND_OBJ_GETDTABLESIZE_TRUE
+GL_COND_OBJ_GETDELIM_FALSE
+GL_COND_OBJ_GETDELIM_TRUE
+GL_GNULIB_GETADDRINFO
+GL_COND_OBJ_GAI_STRERROR_FALSE
+GL_COND_OBJ_GAI_STRERROR_TRUE
+GL_COND_OBJ_GETADDRINFO_FALSE
+GL_COND_OBJ_GETADDRINFO_TRUE
+GETADDRINFO_LIB
+INET_NTOP_LIB
+SERVENT_LIB
+HOSTENT_LIB
+HAVE_NETDB_H
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H
+NEXT_NETDB_H
+REPLACE_GETADDRINFO
+REPLACE_GAI_STRERROR
+HAVE_DECL_GETNAMEINFO
+HAVE_DECL_GETADDRINFO
+HAVE_DECL_GAI_STRERROR
+HAVE_DECL_FREEADDRINFO
+HAVE_STRUCT_ADDRINFO
+GL_COND_OBJ_FTELLO_FALSE
+GL_COND_OBJ_FTELLO_TRUE
+GL_COND_OBJ_FTELL_FALSE
+GL_COND_OBJ_FTELL_TRUE
+GL_COND_OBJ_FSUSAGE_FALSE
+GL_COND_OBJ_FSUSAGE_TRUE
+GL_GNULIB_MDA_UMASK
+GL_GNULIB_MDA_MKDIR
+GL_GNULIB_MDA_CHMOD
+GL_GNULIB_OVERRIDES_STRUCT_STAT
+GL_GNULIB_UTIMENSAT
+GL_GNULIB_STAT
+GL_GNULIB_MKNODAT
+GL_GNULIB_MKNOD
+GL_GNULIB_MKFIFOAT
+GL_GNULIB_MKFIFO
+GL_GNULIB_MKDIRAT
+GL_GNULIB_MKDIR
+GL_GNULIB_LSTAT
+GL_GNULIB_LCHMOD
+GL_GNULIB_GETUMASK
+GL_GNULIB_FUTIMENS
+GL_GNULIB_FSTATAT
+GL_GNULIB_FSTAT
+GL_GNULIB_FCHMODAT
+GL_GNULIB_CHMOD
+WINDOWS_64_BIT_ST_SIZE
+WINDOWS_STAT_TIMESPEC
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
+NEXT_SYS_STAT_H
+GL_COND_OBJ_FSTAT_FALSE
+GL_COND_OBJ_FSTAT_TRUE
+REPLACE_UTIMENSAT
+REPLACE_STAT
+REPLACE_MKNODAT
+REPLACE_MKNOD
+REPLACE_MKFIFOAT
+REPLACE_MKFIFO
+REPLACE_MKDIR
+REPLACE_LSTAT
+REPLACE_FUTIMENS
+REPLACE_FSTATAT
+REPLACE_FSTAT
+REPLACE_FCHMODAT
+REPLACE_CHMOD
+HAVE_UTIMENSAT
+HAVE_MKNODAT
+HAVE_MKNOD
+HAVE_MKFIFOAT
+HAVE_MKFIFO
+HAVE_MKDIRAT
+HAVE_LSTAT
+HAVE_LCHMOD
+HAVE_GETUMASK
+HAVE_FUTIMENS
+HAVE_FSTATAT
+HAVE_FCHMODAT
+GL_COND_OBJ_FSEEKO_FALSE
+GL_COND_OBJ_FSEEKO_TRUE
+GL_COND_OBJ_FSEEK_FALSE
+GL_COND_OBJ_FSEEK_TRUE
+WINDOWS_STAT_INODES
+WINDOWS_64_BIT_OFF_T
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
+NEXT_SYS_TYPES_H
+GL_COND_OBJ_FREE_FALSE
+GL_COND_OBJ_FREE_TRUE
+GL_COND_OBJ_FPURGE_FALSE
+GL_COND_OBJ_FPURGE_TRUE
+GL_GNULIB_MDA_YN
+GL_GNULIB_MDA_Y1
+GL_GNULIB_MDA_Y0
+GL_GNULIB_MDA_JN
+GL_GNULIB_MDA_J1
+GL_GNULIB_MDA_J0
+GL_GNULIB_TRUNCL
+GL_GNULIB_TRUNCF
+GL_GNULIB_TRUNC
+GL_GNULIB_TANHF
+GL_GNULIB_TANL
+GL_GNULIB_TANF
+GL_GNULIB_SQRTL
+GL_GNULIB_SQRTF
+GL_GNULIB_SINHF
+GL_GNULIB_SINL
+GL_GNULIB_SINF
+GL_GNULIB_SIGNBIT
+GL_GNULIB_ROUNDL
+GL_GNULIB_ROUNDF
+GL_GNULIB_ROUND
+GL_GNULIB_RINTL
+GL_GNULIB_RINTF
+GL_GNULIB_RINT
+GL_GNULIB_REMAINDERL
+GL_GNULIB_REMAINDERF
+GL_GNULIB_REMAINDER
+GL_GNULIB_POWF
+GL_GNULIB_MODFL
+GL_GNULIB_MODFF
+GL_GNULIB_MODF
+GL_GNULIB_LOGBL
+GL_GNULIB_LOGBF
+GL_GNULIB_LOGB
+GL_GNULIB_LOG2L
+GL_GNULIB_LOG2F
+GL_GNULIB_LOG2
+GL_GNULIB_LOG1PL
+GL_GNULIB_LOG1PF
+GL_GNULIB_LOG1P
+GL_GNULIB_LOG10L
+GL_GNULIB_LOG10F
+GL_GNULIB_LOG10
+GL_GNULIB_LOGL
+GL_GNULIB_LOGF
+GL_GNULIB_LOG
+GL_GNULIB_LDEXPL
+GL_GNULIB_LDEXPF
+GL_GNULIB_ISNANL
+GL_GNULIB_ISNAND
+GL_GNULIB_ISNANF
+GL_GNULIB_ISNAN
+GL_GNULIB_ISINF
+GL_GNULIB_ISFINITE
+GL_GNULIB_ILOGBL
+GL_GNULIB_ILOGBF
+GL_GNULIB_ILOGB
+GL_GNULIB_HYPOTL
+GL_GNULIB_HYPOTF
+GL_GNULIB_HYPOT
+GL_GNULIB_FREXPL
+GL_GNULIB_FREXP
+GL_GNULIB_FREXPF
+GL_GNULIB_FMODL
+GL_GNULIB_FMODF
+GL_GNULIB_FMOD
+GL_GNULIB_FMAL
+GL_GNULIB_FMAF
+GL_GNULIB_FMA
+GL_GNULIB_FLOORL
+GL_GNULIB_FLOORF
+GL_GNULIB_FLOOR
+GL_GNULIB_FABSL
+GL_GNULIB_FABSF
+GL_GNULIB_EXPM1L
+GL_GNULIB_EXPM1F
+GL_GNULIB_EXPM1
+GL_GNULIB_EXP2L
+GL_GNULIB_EXP2F
+GL_GNULIB_EXP2
+GL_GNULIB_EXPL
+GL_GNULIB_EXPF
+GL_GNULIB_COSHF
+GL_GNULIB_COSL
+GL_GNULIB_COSF
+GL_GNULIB_COPYSIGNL
+GL_GNULIB_COPYSIGNF
+GL_GNULIB_COPYSIGN
+GL_GNULIB_CEILL
+GL_GNULIB_CEILF
+GL_GNULIB_CEIL
+GL_GNULIB_CBRTL
+GL_GNULIB_CBRTF
+GL_GNULIB_CBRT
+GL_GNULIB_ATAN2F
+GL_GNULIB_ATANL
+GL_GNULIB_ATANF
+GL_GNULIB_ASINL
+GL_GNULIB_ASINF
+GL_GNULIB_ACOSL
+GL_GNULIB_ACOSF
+GL_COND_OBJ_FLOORF_FALSE
+GL_COND_OBJ_FLOORF_TRUE
+FLOORF_LIBM
+REPLACE_TRUNCL
+REPLACE_TRUNCF
+REPLACE_TRUNC
+REPLACE_TANHF
+REPLACE_TANF
+REPLACE_SQRTL
+REPLACE_SQRTF
+REPLACE_SINHF
+REPLACE_SINF
+REPLACE_SIGNBIT_USING_BUILTINS
+REPLACE_SIGNBIT
+REPLACE_ROUNDL
+REPLACE_ROUNDF
+REPLACE_ROUND
+REPLACE_RINTL
+REPLACE_REMAINDERL
+REPLACE_REMAINDERF
+REPLACE_REMAINDER
+REPLACE_NAN
+REPLACE_MODFL
+REPLACE_MODFF
+REPLACE_MODF
+REPLACE_LOGBL
+REPLACE_LOGBF
+REPLACE_LOGB
+REPLACE_LOG2L
+REPLACE_LOG2F
+REPLACE_LOG2
+REPLACE_LOG1PL
+REPLACE_LOG1PF
+REPLACE_LOG1P
+REPLACE_LOG10L
+REPLACE_LOG10F
+REPLACE_LOG10
+REPLACE_LOGL
+REPLACE_LOGF
+REPLACE_LOG
+REPLACE_LDEXPL
+REPLACE_ISNAN
+REPLACE_ISINF
+REPLACE_ISFINITE
+REPLACE_ILOGBL
+REPLACE_ILOGBF
+REPLACE_ILOGB
+REPLACE_HYPOTL
+REPLACE_HYPOTF
+REPLACE_HYPOT
+REPLACE_HUGE_VAL
+REPLACE_FREXPL
+REPLACE_FREXP
+REPLACE_FREXPF
+REPLACE_FMODL
+REPLACE_FMODF
+REPLACE_FMOD
+REPLACE_FMAL
+REPLACE_FMAF
+REPLACE_FMA
+REPLACE_FLOORL
+REPLACE_FLOORF
+REPLACE_FLOOR
+REPLACE_FABSL
+REPLACE_EXP2L
+REPLACE_EXP2
+REPLACE_EXPM1L
+REPLACE_EXPM1F
+REPLACE_EXPM1
+REPLACE_EXPL
+REPLACE_EXPF
+REPLACE_COSHF
+REPLACE_COSF
+REPLACE_CEILL
+REPLACE_CEILF
+REPLACE_CEIL
+REPLACE_CBRTL
+REPLACE_CBRTF
+REPLACE_ATAN2F
+REPLACE_ATANF
+REPLACE_ASINF
+REPLACE_ACOSF
+HAVE_DECL_TRUNCL
+HAVE_DECL_TRUNCF
+HAVE_DECL_TRUNC
+HAVE_DECL_TANL
+HAVE_DECL_SQRTL
+HAVE_DECL_SINL
+HAVE_DECL_ROUNDL
+HAVE_DECL_ROUNDF
+HAVE_DECL_ROUND
+HAVE_DECL_RINTF
+HAVE_DECL_REMAINDERL
+HAVE_DECL_REMAINDER
+HAVE_DECL_LOGB
+HAVE_DECL_LOG2L
+HAVE_DECL_LOG2F
+HAVE_DECL_LOG2
+HAVE_DECL_LOG10L
+HAVE_DECL_LOGL
+HAVE_DECL_LDEXPL
+HAVE_DECL_FREXPL
+HAVE_DECL_FLOORL
+HAVE_DECL_FLOORF
+HAVE_DECL_EXPM1L
+HAVE_DECL_EXP2L
+HAVE_DECL_EXP2F
+HAVE_DECL_EXP2
+HAVE_DECL_EXPL
+HAVE_DECL_COSL
+HAVE_DECL_COPYSIGNF
+HAVE_DECL_CEILL
+HAVE_DECL_CEILF
+HAVE_DECL_CBRTL
+HAVE_DECL_CBRTF
+HAVE_DECL_ATANL
+HAVE_DECL_ASINL
+HAVE_DECL_ACOSL
+HAVE_TANHF
+HAVE_TANL
+HAVE_TANF
+HAVE_SQRTL
+HAVE_SQRTF
+HAVE_SINHF
+HAVE_SINL
+HAVE_SINF
+HAVE_RINTL
+HAVE_RINT
+HAVE_REMAINDERF
+HAVE_REMAINDER
+HAVE_POWF
+HAVE_MODFL
+HAVE_MODFF
+HAVE_LOGBL
+HAVE_LOGBF
+HAVE_LOG1PL
+HAVE_LOG1PF
+HAVE_LOG1P
+HAVE_LOG10L
+HAVE_LOG10F
+HAVE_LOGL
+HAVE_LOGF
+HAVE_LDEXPF
+HAVE_ISNANL
+HAVE_ISNAND
+HAVE_ISNANF
+HAVE_ILOGBL
+HAVE_ILOGBF
+HAVE_ILOGB
+HAVE_HYPOTL
+HAVE_HYPOTF
+HAVE_FREXPF
+HAVE_FMODL
+HAVE_FMODF
+HAVE_FMAL
+HAVE_FMAF
+HAVE_FMA
+HAVE_FABSL
+HAVE_FABSF
+HAVE_EXPM1F
+HAVE_EXPM1
+HAVE_EXPL
+HAVE_EXPF
+HAVE_COSHF
+HAVE_COSL
+HAVE_COSF
+HAVE_COPYSIGNL
+HAVE_COPYSIGN
+HAVE_CBRTL
+HAVE_CBRTF
+HAVE_CBRT
+HAVE_ATAN2F
+HAVE_ATANL
+HAVE_ATANF
+HAVE_ASINL
+HAVE_ASINF
+HAVE_ACOSL
+HAVE_ACOSF
+GL_COND_OBJ_ITOLD_FALSE
+GL_COND_OBJ_ITOLD_TRUE
+GL_COND_OBJ_FLOAT_FALSE
+GL_COND_OBJ_FLOAT_TRUE
+GL_GENERATE_FLOAT_H_FALSE
+GL_GENERATE_FLOAT_H_TRUE
+FLOAT_H
+REPLACE_ITOLD
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
+NEXT_FLOAT_H
+GL_GNULIB_MDA_TEMPNAM
+GL_GNULIB_MDA_PUTW
+GL_GNULIB_MDA_GETW
+GL_GNULIB_MDA_FILENO
+GL_GNULIB_MDA_FDOPEN
+GL_GNULIB_MDA_FCLOSEALL
+GL_GNULIB_VSPRINTF_POSIX
+GL_GNULIB_VSNPRINTF
+GL_GNULIB_VPRINTF_POSIX
+GL_GNULIB_VPRINTF
+GL_GNULIB_VFPRINTF_POSIX
+GL_GNULIB_VFPRINTF
+GL_GNULIB_VDPRINTF
+GL_GNULIB_VSCANF
+GL_GNULIB_VFSCANF
+GL_GNULIB_VASPRINTF
+GL_GNULIB_TMPFILE
+GL_GNULIB_STDIO_H_SIGPIPE
+GL_GNULIB_STDIO_H_NONBLOCKING
+GL_GNULIB_SPRINTF_POSIX
+GL_GNULIB_SNPRINTF
+GL_GNULIB_SCANF
+GL_GNULIB_RENAMEAT
+GL_GNULIB_RENAME
+GL_GNULIB_REMOVE
+GL_GNULIB_PUTS
+GL_GNULIB_PUTCHAR
+GL_GNULIB_PUTC
+GL_GNULIB_PRINTF_POSIX
+GL_GNULIB_PRINTF
+GL_GNULIB_POPEN
+GL_GNULIB_PERROR
+GL_GNULIB_PCLOSE
+GL_GNULIB_OBSTACK_PRINTF_POSIX
+GL_GNULIB_OBSTACK_PRINTF
+GL_GNULIB_GETLINE
+GL_GNULIB_GETDELIM
+GL_GNULIB_GETCHAR
+GL_GNULIB_GETC
+GL_GNULIB_FWRITE
+GL_GNULIB_FTELLO
+GL_GNULIB_FTELL
+GL_GNULIB_FSEEKO
+GL_GNULIB_FSEEK
+GL_GNULIB_FSCANF
+GL_GNULIB_FREOPEN
+GL_GNULIB_FREAD
+GL_GNULIB_FPUTS
+GL_GNULIB_FPUTC
+GL_GNULIB_FPURGE
+GL_GNULIB_FPRINTF_POSIX
+GL_GNULIB_FPRINTF
+GL_GNULIB_FOPEN_GNU
+GL_GNULIB_FOPEN
+GL_GNULIB_FGETS
+GL_GNULIB_FGETC
+GL_GNULIB_FFLUSH
+GL_GNULIB_FDOPEN
+GL_GNULIB_FCLOSE
+GL_GNULIB_DPRINTF
+GL_COND_OBJ_FFLUSH_FALSE
+GL_COND_OBJ_FFLUSH_TRUE
+REPLACE_VSPRINTF
+REPLACE_VSNPRINTF
+REPLACE_VPRINTF
+REPLACE_VFPRINTF
+REPLACE_VDPRINTF
+REPLACE_VASPRINTF
+REPLACE_TMPFILE
+REPLACE_STDIO_WRITE_FUNCS
+REPLACE_STDIO_READ_FUNCS
+REPLACE_SPRINTF
+REPLACE_SNPRINTF
+REPLACE_RENAMEAT
+REPLACE_RENAME
+REPLACE_REMOVE
+REPLACE_PRINTF
+REPLACE_POPEN
+REPLACE_PERROR
+REPLACE_OBSTACK_PRINTF
+REPLACE_GETLINE
+REPLACE_GETDELIM
+REPLACE_FTELLO
+REPLACE_FTELL
+REPLACE_FSEEKO
+REPLACE_FSEEK
+REPLACE_FREOPEN
+REPLACE_FPURGE
+REPLACE_FPRINTF
+REPLACE_FOPEN_FOR_FOPEN_GNU
+REPLACE_FOPEN
+REPLACE_FFLUSH
+REPLACE_FDOPEN
+REPLACE_FCLOSE
+REPLACE_DPRINTF
+HAVE_VDPRINTF
+HAVE_VASPRINTF
+HAVE_RENAMEAT
+HAVE_POPEN
+HAVE_PCLOSE
+HAVE_FTELLO
+HAVE_FSEEKO
+HAVE_DPRINTF
+HAVE_DECL_VSNPRINTF
+HAVE_DECL_SNPRINTF
+HAVE_DECL_OBSTACK_PRINTF
+HAVE_DECL_GETLINE
+HAVE_DECL_GETDELIM
+HAVE_DECL_FTELLO
+HAVE_DECL_FSEEKO
+HAVE_DECL_FPURGE
+HAVE_DECL_FCLOSEALL
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
+NEXT_FCNTL_H
+GL_GNULIB_MDA_OPEN
+GL_GNULIB_MDA_CREAT
+GL_GNULIB_OPENAT
+GL_GNULIB_OPEN
+GL_GNULIB_NONBLOCKING
+GL_GNULIB_FCNTL
+GL_GNULIB_CREAT
+GL_COND_OBJ_FCNTL_FALSE
+GL_COND_OBJ_FCNTL_TRUE
+REPLACE_OPENAT
+REPLACE_OPEN
+REPLACE_FCNTL
+REPLACE_CREAT
+HAVE_OPENAT
+HAVE_FCNTL
+GL_COND_OBJ_ERROR_FALSE
+GL_COND_OBJ_ERROR_TRUE
+GL_GENERATE_ERRNO_H_FALSE
+GL_GENERATE_ERRNO_H_TRUE
+ERRNO_H
+EOVERFLOW_VALUE
+EOVERFLOW_HIDDEN
+ENOLINK_VALUE
+ENOLINK_HIDDEN
+EMULTIHOP_VALUE
+EMULTIHOP_HIDDEN
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
+NEXT_ERRNO_H
+GL_COND_OBJ_DUP2_FALSE
+GL_COND_OBJ_DUP2_TRUE
+LIB_CRYPTO
+HAVE_SYS_SOCKET_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
+NEXT_SYS_SOCKET_H
+HAVE_ACCEPT4
+HAVE_SA_FAMILY_T
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+HAVE_STRUCT_SOCKADDR_STORAGE
+GL_GNULIB_MDA_WRITE
+GL_GNULIB_MDA_UNLINK
+GL_GNULIB_MDA_SWAB
+GL_GNULIB_MDA_RMDIR
+GL_GNULIB_MDA_READ
+GL_GNULIB_MDA_LSEEK
+GL_GNULIB_MDA_ISATTY
+GL_GNULIB_MDA_GETPID
+GL_GNULIB_MDA_GETCWD
+GL_GNULIB_MDA_EXECVPE
+GL_GNULIB_MDA_EXECVP
+GL_GNULIB_MDA_EXECVE
+GL_GNULIB_MDA_EXECV
+GL_GNULIB_MDA_EXECLP
+GL_GNULIB_MDA_EXECLE
+GL_GNULIB_MDA_EXECL
+GL_GNULIB_MDA_DUP2
+GL_GNULIB_MDA_DUP
+GL_GNULIB_MDA_CLOSE
+GL_GNULIB_MDA_CHDIR
+GL_GNULIB_MDA_ACCESS
+GL_GNULIB_WRITE
+GL_GNULIB_USLEEP
+GL_GNULIB_UNLINKAT
+GL_GNULIB_UNLINK
+GL_GNULIB_UNISTD_H_SIGPIPE
+GL_GNULIB_UNISTD_H_NONBLOCKING
+GL_GNULIB_UNISTD_H_GETOPT
+GL_GNULIB_TTYNAME_R
+GL_GNULIB_TRUNCATE
+GL_GNULIB_SYMLINKAT
+GL_GNULIB_SYMLINK
+GL_GNULIB_SLEEP
+GL_GNULIB_SETHOSTNAME
+GL_GNULIB_RMDIR
+GL_GNULIB_READLINKAT
+GL_GNULIB_READLINK
+GL_GNULIB_READ
+GL_GNULIB_PWRITE
+GL_GNULIB_PREAD
+GL_GNULIB_PIPE2
+GL_GNULIB_PIPE
+GL_GNULIB_LSEEK
+GL_GNULIB_LINKAT
+GL_GNULIB_LINK
+GL_GNULIB_LCHOWN
+GL_GNULIB_ISATTY
+GL_GNULIB_GROUP_MEMBER
+GL_GNULIB_GETUSERSHELL
+GL_GNULIB_GETPASS_GNU
+GL_GNULIB_GETPASS
+GL_GNULIB_GETPAGESIZE
+GL_GNULIB_GETOPT_POSIX
+GL_GNULIB_GETLOGIN_R
+GL_GNULIB_GETLOGIN
+GL_GNULIB_GETHOSTNAME
+GL_GNULIB_GETGROUPS
+GL_GNULIB_GETENTROPY
+GL_GNULIB_GETDTABLESIZE
+GL_GNULIB_GETDOMAINNAME
+GL_GNULIB_GETCWD
+GL_GNULIB_FTRUNCATE
+GL_GNULIB_FSYNC
+GL_GNULIB_FDATASYNC
+GL_GNULIB_FCHOWNAT
+GL_GNULIB_FCHDIR
+GL_GNULIB_FACCESSAT
+GL_GNULIB_EXECVPE
+GL_GNULIB_EXECVP
+GL_GNULIB_EXECVE
+GL_GNULIB_EXECV
+GL_GNULIB_EXECLP
+GL_GNULIB_EXECLE
+GL_GNULIB_EXECL
+GL_GNULIB_EUIDACCESS
+GL_GNULIB_ENVIRON
+GL_GNULIB_DUP3
+GL_GNULIB_DUP2
+GL_GNULIB_DUP
+GL_GNULIB_COPY_FILE_RANGE
+GL_GNULIB_CLOSE
+GL_GNULIB_CHOWN
+GL_GNULIB_CHDIR
+GL_GNULIB_ACCESS
+GL_COND_OBJ_CLOSE_FALSE
+GL_COND_OBJ_CLOSE_TRUE
+HAVE_WINSOCK2_H
+HAVE_MSVC_INVALID_PARAMETER_HANDLER
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
+UNISTD_H_HAVE_WINSOCK2_H
+UNISTD_H_HAVE_SYS_RANDOM_H
+REPLACE_WRITE
+REPLACE_USLEEP
+REPLACE_UNLINKAT
+REPLACE_UNLINK
+REPLACE_TTYNAME_R
+REPLACE_TRUNCATE
+REPLACE_SYMLINKAT
+REPLACE_SYMLINK
+REPLACE_SLEEP
+REPLACE_RMDIR
+REPLACE_READLINKAT
+REPLACE_READLINK
+REPLACE_READ
+REPLACE_PWRITE
+REPLACE_PREAD
+REPLACE_LSEEK
+REPLACE_LINKAT
+REPLACE_LINK
+REPLACE_LCHOWN
+REPLACE_ISATTY
+REPLACE_GETPASS_FOR_GETPASS_GNU
+REPLACE_GETPASS
+REPLACE_GETPAGESIZE
+REPLACE_GETGROUPS
+REPLACE_GETLOGIN_R
+REPLACE_GETDTABLESIZE
+REPLACE_GETDOMAINNAME
+REPLACE_GETCWD
+REPLACE_FTRUNCATE
+REPLACE_FCHOWNAT
+REPLACE_FACCESSAT
+REPLACE_EXECVPE
+REPLACE_EXECVP
+REPLACE_EXECVE
+REPLACE_EXECV
+REPLACE_EXECLP
+REPLACE_EXECLE
+REPLACE_EXECL
+REPLACE_DUP2
+REPLACE_DUP
+REPLACE_COPY_FILE_RANGE
+REPLACE_CLOSE
+REPLACE_CHOWN
+REPLACE_ACCESS
+HAVE_SYS_PARAM_H
+HAVE_OS_H
+HAVE_DECL_TTYNAME_R
+HAVE_DECL_TRUNCATE
+HAVE_DECL_SETHOSTNAME
+HAVE_DECL_GETUSERSHELL
+HAVE_DECL_GETPAGESIZE
+HAVE_DECL_GETLOGIN_R
+HAVE_DECL_GETLOGIN
+HAVE_DECL_GETDOMAINNAME
+HAVE_DECL_FDATASYNC
+HAVE_DECL_FCHDIR
+HAVE_DECL_EXECVPE
+HAVE_DECL_ENVIRON
+HAVE_USLEEP
+HAVE_UNLINKAT
+HAVE_SYMLINKAT
+HAVE_SYMLINK
+HAVE_SLEEP
+HAVE_SETHOSTNAME
+HAVE_READLINKAT
+HAVE_READLINK
+HAVE_PWRITE
+HAVE_PREAD
+HAVE_PIPE2
+HAVE_PIPE
+HAVE_LINKAT
+HAVE_LINK
+HAVE_LCHOWN
+HAVE_GROUP_MEMBER
+HAVE_GETPASS
+HAVE_GETPAGESIZE
+HAVE_GETLOGIN
+HAVE_GETHOSTNAME
+HAVE_GETGROUPS
+HAVE_GETENTROPY
+HAVE_GETDTABLESIZE
+HAVE_FTRUNCATE
+HAVE_FSYNC
+HAVE_FDATASYNC
+HAVE_FCHOWNAT
+HAVE_FCHDIR
+HAVE_FACCESSAT
+HAVE_EXECVPE
+HAVE_EUIDACCESS
+HAVE_DUP3
+HAVE_COPY_FILE_RANGE
+HAVE_CHOWN
+GL_GENERATE_BYTESWAP_H_FALSE
+GL_GENERATE_BYTESWAP_H_TRUE
+BYTESWAP_H
+REPLACE_WCTOMB
+REPLACE_UNSETENV
+REPLACE_STRTOULL
+REPLACE_STRTOUL
+REPLACE_STRTOLL
+REPLACE_STRTOLD
+REPLACE_STRTOL
+REPLACE_STRTOD
+REPLACE_SETSTATE
+REPLACE_SETENV
+REPLACE_REALPATH
+REPLACE_REALLOCARRAY
+REPLACE_REALLOC_FOR_REALLOC_POSIX
+REPLACE_REALLOC_FOR_REALLOC_GNU
+REPLACE_RANDOM_R
+REPLACE_RANDOM
+REPLACE_QSORT_R
+REPLACE_PUTENV
+REPLACE_PTSNAME_R
+REPLACE_PTSNAME
+REPLACE_POSIX_MEMALIGN
+REPLACE_MKSTEMP
+REPLACE_MBTOWC
+REPLACE_MALLOC_FOR_MALLOC_POSIX
+REPLACE_MALLOC_FOR_MALLOC_GNU
+REPLACE_INITSTATE
+REPLACE_FREE
+REPLACE_CANONICALIZE_FILE_NAME
+REPLACE_CALLOC_FOR_CALLOC_POSIX
+REPLACE_CALLOC_FOR_CALLOC_GNU
+REPLACE_ALIGNED_ALLOC
+HAVE_DECL_UNSETENV
+HAVE_UNLOCKPT
+HAVE_SYS_LOADAVG_H
+HAVE_STRUCT_RANDOM_DATA
+HAVE_STRTOULL
+HAVE_STRTOUL
+HAVE_STRTOLL
+HAVE_STRTOLD
+HAVE_STRTOL
+HAVE_STRTOD
+HAVE_DECL_SETSTATE
+HAVE_SETSTATE
+HAVE_DECL_SETENV
+HAVE_SETENV
+HAVE_SECURE_GETENV
+HAVE_RPMATCH
+HAVE_REALPATH
+HAVE_REALLOCARRAY
+HAVE_RANDOM_R
+HAVE_RANDOM_H
+HAVE_RANDOM
+HAVE_QSORT_R
+HAVE_PTSNAME_R
+HAVE_PTSNAME
+HAVE_POSIX_OPENPT
+HAVE_POSIX_MEMALIGN
+HAVE_MKSTEMPS
+HAVE_MKSTEMP
+HAVE_MKOSTEMPS
+HAVE_MKOSTEMP
+HAVE_MKDTEMP
+HAVE_MBTOWC
+HAVE_DECL_INITSTATE
+HAVE_INITSTATE
+HAVE_GRANTPT
+HAVE_GETSUBOPT
+HAVE_DECL_GETLOADAVG
+HAVE_DECL_GCVT
+HAVE_DECL_FCVT
+HAVE_DECL_ECVT
+HAVE_CANONICALIZE_FILE_NAME
+HAVE_ATOLL
+HAVE_ALIGNED_ALLOC
+HAVE__EXIT
+GL_GNULIB_MDA_PUTENV
+GL_GNULIB_MDA_MKTEMP
+GL_GNULIB_MDA_GCVT
+GL_GNULIB_MDA_FCVT
+GL_GNULIB_MDA_ECVT
+GL_GNULIB_WCTOMB
+GL_GNULIB_UNSETENV
+GL_GNULIB_UNLOCKPT
+GL_GNULIB_SYSTEM_POSIX
+GL_GNULIB_STRTOULL
+GL_GNULIB_STRTOUL
+GL_GNULIB_STRTOLL
+GL_GNULIB_STRTOLD
+GL_GNULIB_STRTOL
+GL_GNULIB_STRTOD
+GL_GNULIB_SETENV
+GL_GNULIB_SECURE_GETENV
+GL_GNULIB_RPMATCH
+GL_GNULIB_REALPATH
+GL_GNULIB_REALLOC_POSIX
+GL_GNULIB_REALLOC_GNU
+GL_GNULIB_REALLOCARRAY
+GL_GNULIB_RANDOM_R
+GL_GNULIB_RANDOM
+GL_GNULIB_QSORT_R
+GL_GNULIB_PUTENV
+GL_GNULIB_PTSNAME_R
+GL_GNULIB_PTSNAME
+GL_GNULIB_POSIX_OPENPT
+GL_GNULIB_POSIX_MEMALIGN
+GL_GNULIB_MKSTEMPS
+GL_GNULIB_MKSTEMP
+GL_GNULIB_MKOSTEMPS
+GL_GNULIB_MKOSTEMP
+GL_GNULIB_MKDTEMP
+GL_GNULIB_MBTOWC
+GL_GNULIB_MALLOC_POSIX
+GL_GNULIB_MALLOC_GNU
+GL_GNULIB_GRANTPT
+GL_GNULIB_GETSUBOPT
+GL_GNULIB_GETLOADAVG
+GL_GNULIB_FREE_POSIX
+GL_GNULIB_CANONICALIZE_FILE_NAME
+GL_GNULIB_CALLOC_POSIX
+GL_GNULIB_CALLOC_GNU
+GL_GNULIB_ATOLL
+GL_GNULIB_ALIGNED_ALLOC
+GL_GNULIB__EXIT
+GL_GNULIB_MDA_WCSDUP
+GL_GNULIB_WCSFTIME
+GL_GNULIB_WCSWIDTH
+GL_GNULIB_WCSTOK
+GL_GNULIB_WCSSTR
+GL_GNULIB_WCSPBRK
+GL_GNULIB_WCSSPN
+GL_GNULIB_WCSCSPN
+GL_GNULIB_WCSRCHR
+GL_GNULIB_WCSCHR
+GL_GNULIB_WCSDUP
+GL_GNULIB_WCSXFRM
+GL_GNULIB_WCSCOLL
+GL_GNULIB_WCSNCASECMP
+GL_GNULIB_WCSCASECMP
+GL_GNULIB_WCSNCMP
+GL_GNULIB_WCSCMP
+GL_GNULIB_WCSNCAT
+GL_GNULIB_WCSCAT
+GL_GNULIB_WCPNCPY
+GL_GNULIB_WCSNCPY
+GL_GNULIB_WCPCPY
+GL_GNULIB_WCSCPY
+GL_GNULIB_WCSNLEN
+GL_GNULIB_WCSLEN
+GL_GNULIB_WMEMSET
+GL_GNULIB_WMEMPCPY
+GL_GNULIB_WMEMMOVE
+GL_GNULIB_WMEMCPY
+GL_GNULIB_WMEMCMP
+GL_GNULIB_WMEMCHR
+GL_GNULIB_WCWIDTH
+GL_GNULIB_WCSNRTOMBS
+GL_GNULIB_WCSRTOMBS
+GL_GNULIB_WCRTOMB
+GL_GNULIB_MBSNRTOWCS
+GL_GNULIB_MBSRTOWCS
+GL_GNULIB_MBRLEN
+GL_GNULIB_MBRTOWC
+GL_GNULIB_MBSINIT
+GL_GNULIB_WCTOB
+GL_GNULIB_BTOWC
+GL_COND_OBJ_BTOWC_FALSE
+GL_COND_OBJ_BTOWC_TRUE
+LOCALE_FR
+REPLACE_WCSTOK
+REPLACE_WCSFTIME
+REPLACE_WCSWIDTH
+REPLACE_WCWIDTH
+REPLACE_WCSNRTOMBS
+REPLACE_WCSRTOMBS
+REPLACE_WCRTOMB
+REPLACE_MBSNRTOWCS
+REPLACE_MBSRTOWCS
+REPLACE_MBRLEN
+REPLACE_MBRTOWC
+REPLACE_MBSINIT
+REPLACE_WCTOB
+REPLACE_BTOWC
+REPLACE_MBSTATE_T
+HAVE_DECL_WCWIDTH
+HAVE_DECL_WCSDUP
+HAVE_DECL_WCTOB
+HAVE_WCSFTIME
+HAVE_WCSWIDTH
+HAVE_WCSTOK
+HAVE_WCSSTR
+HAVE_WCSPBRK
+HAVE_WCSSPN
+HAVE_WCSCSPN
+HAVE_WCSRCHR
+HAVE_WCSCHR
+HAVE_WCSDUP
+HAVE_WCSXFRM
+HAVE_WCSCOLL
+HAVE_WCSNCASECMP
+HAVE_WCSCASECMP
+HAVE_WCSNCMP
+HAVE_WCSCMP
+HAVE_WCSNCAT
+HAVE_WCSCAT
+HAVE_WCPNCPY
+HAVE_WCSNCPY
+HAVE_WCPCPY
+HAVE_WCSCPY
+HAVE_WCSNLEN
+HAVE_WCSLEN
+HAVE_WMEMSET
+HAVE_WMEMPCPY
+HAVE_WMEMMOVE
+HAVE_WMEMCPY
+HAVE_WMEMCMP
+HAVE_WMEMCHR
+HAVE_WCSNRTOMBS
+HAVE_WCSRTOMBS
+HAVE_WCRTOMB
+HAVE_MBSNRTOWCS
+HAVE_MBSRTOWCS
+HAVE_MBRLEN
+HAVE_MBRTOWC
+HAVE_MBSINIT
+HAVE_BTOWC
+GL_GENERATE_ASSERT_H_FALSE
+GL_GENERATE_ASSERT_H_TRUE
+ASSERT_H
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H
+NEXT_ASSERT_H
+GL_GNULIB_INET_PTON
+GL_GNULIB_INET_NTOP
+HAVE_WS2TCPIP_H
+HAVE_FEATURES_H
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
+NEXT_ARPA_INET_H
+PRAGMA_COLUMNS
+PRAGMA_SYSTEM_HEADER
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE
+INCLUDE_NEXT
+HAVE_ARPA_INET_H
+REPLACE_INET_PTON
+REPLACE_INET_NTOP
+HAVE_DECL_INET_PTON
+HAVE_DECL_INET_NTOP
+GL_GENERATE_ALLOCA_H_FALSE
+GL_GENERATE_ALLOCA_H_TRUE
+ALLOCA_H
+HAVE_ALLOCA_H
+ALLOCA
+GL_COND_LIBTOOL_FALSE
+GL_COND_LIBTOOL_TRUE
+PERLMODS_DIR
+POSUB
+LTLIBINTL
+LIBINTL
+INTLLIBS
+LTLIBICONV
+LIBICONV
+INTL_MACOSX_LIBS
+XGETTEXT_EXTRA_OPTIONS
+MSGMERGE_FOR_MSGFMT_OPTION
+MSGMERGE
+XGETTEXT_015
+XGETTEXT
+GMSGFMT_015
+GMSGFMT
+MSGFMT
+GETTEXT_MACRO_VERSION
+USE_NLS
+DEPLIBS
+EXTRA_NETOBJS
+EXTRAS_ROOT
+EXTRAS
+PATH_TO_APTGET
+PATH_TO_DIG
+PATH_TO_LSPS
+PATH_TO_SWAPINFO
+PATH_TO_SWAP
+PATH_TO_QMAIL_QSTAT
+PATH_TO_MAILQ
+PATH_TO_SUDO
+PATH_TO_SSH
+PATH_TO_FPING6
+PATH_TO_FPING
+PATH_TO_QSTAT
+PATH_TO_QUAKESTAT
+PATH_TO_SNMPGETNEXT
+PATH_TO_SNMPGET
+PATH_TO_SMBCLIENT
+PATH_TO_LMSTAT
+PATH_TO_RPCINFO
+PATH_TO_UPTIME
+PATH_TO_NSLOOKUP
+PATH_TO_PING6
+PATH_TO_PING
+PST3CFLAGS
+PATH_TO_ENV
+PATH_TO_PS
+SSLLIBS
+check_tcp_ssl
+SSLINCLUDE
+KRBINCLUDE
+PATH_TO_WHO
+URIPARSERCFLAGS
+URIPARSERLIBS
+URIPARSERINCLUDE
+URIPARSER
+URIPARSER_CPPFLAGS
+PKGCONFIG
+LIBCURLCFLAGS
+LIBCURLLIBS
+LIBCURLINCLUDE
+LIBCURL
+LIBCURL_CPPFLAGS
+_libcurl_config
+WTSAPI32LIBS
+HAVE_WTS32API_FALSE
+HAVE_WTS32API_TRUE
+HAVE_UTMPX_FALSE
+HAVE_UTMPX_TRUE
+MYSQLCFLAGS
+MYSQLLIBS
+MYSQLINCLUDE
+np_mysql_config
+SYSTEMDINCLUDE
+SYSTEMDLIBS
+LDAPINCLUDE
+LDAPLIBS
+RADIUSLIBS
+DBILIBS
+PGINCLUDE
+PGLIBS
+USE_PARSE_INI_FALSE
+USE_PARSE_INI_TRUE
+EXTRA_TEST
+USE_LIBTAP_LOCAL_FALSE
+USE_LIBTAP_LOCAL_TRUE
+MATHLIBS
+SOCKETLIBS
+BASENAME
+HOSTNAME
+PERL
+NP_RELEASE
+RELEASE_PRESENT_FALSE
+RELEASE_PRESENT_TRUE
+REV_TIMESTAMP
+REV_DATESTAMP
+PKG_ARCH
+with_trusted_path
+SUPPORT
+WARRANTY
+SCRIPT_TEST
+PLUGIN_TEST
+POW_LIB
+LIBOBJS
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+ac_ct_AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+RANLIB
+ARFLAGS
+AR
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+INSTALL
+RELEASE
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL
+am__quote'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+with_nagios_user
+with_nagios_group
+with_world_permissions
+enable_dependency_tracking
+enable_threads
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+with_cgiurl
+with_trusted_path
+with_perl
+with_openssl
+with_gnutls
+enable_libtap
+enable_extra_opts
+with_pgsql
+with_dbi
+with_radius
+with_ldap
+with_systemd
+with_mysql
+with_libcurl
+with_uriparser
+with_ipv6
+with_ps_command
+with_ps_format
+with_ps_cols
+with_ps_varlist
+with_ping_command
+with_ping6_command
+with_nslookup_command
+with_uptime_command
+with_rpcinfo_command
+with_smbclient_command
+with_snmpget_command
+with_snmpgetnext_command
+with_qstat_command
+with_fping_command
+with_fping6_command
+with_ssh_command
+with_sudo_command
+with_mailq_command
+with_qmail_qstat_command
+with_proc_meminfo
+with_dig_command
+with_apt_get_command
+enable_nls
+enable_rpath
+with_libiconv_prefix
+with_libintl_prefix
+enable_redhat_pthread_workaround
+enable_perl_modules
+enable_cross_guesses
+with_linux_crypto
+with_included_regex
+enable_year2038
+enable_largefile
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir runstatedir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures monitoring-plugins 2.3.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root
+ [DATAROOTDIR/doc/monitoring-plugins]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of monitoring-plugins 2.3.5:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --disable-maintainer-mode
+ disable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-threads={isoc|posix|isoc+posix|windows}
+ specify multithreading API
+ --disable-threads build without multithread safety
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-libtap Enable built-in libtap for unit-testing (default:
+ autodetect system library).
+ --enable-extra-opts Enables parsing of plugins ini config files for
+ extra options (default: no)
+ --disable-nls do not use Native Language Support
+ --disable-rpath do not hardcode runtime library paths
+ --enable-redhat-pthread-workaround
+ force Redhat patch to be applied (default: test
+ system)
+ --enable-perl-modules Enables installation of Monitoring::Plugin and its
+ dependencies (default: no)
+ --enable-cross-guesses={conservative|risky}
+ specify policy for cross-compilation guesses
+ --enable-year2038 support timestamps after 2038
+ --disable-largefile omit support for large files
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-nagios-user=USER Installs executables with this user. Defaults to install user
+ --with-nagios-group=GROUP Installs executables with this group. Defaults to install user
+ --without-world-permissions Installs executables without world permissions
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+ --with-cgiurl=DIR sets URL for cgi programs
+ --with-trusted-path=PATH sets trusted path for executables called by scripts
+ --with-perl=PATH sets path to perl executable
+ --with-openssl=DIR path to openssl installation
+ --with-gnutls=PATH path to gnutls installation root
+ --with-pgsql=DIR sets path to pgsql installation
+ --without-dbi Skips the dbi plugin
+ --without-radius Skips the radius plugin
+ --without-ldap Skips the LDAP plugin
+ --without-systemd Skips systemd support
+ --with-mysql=DIR Locates mysql libraries. Expects
+ DIR/bin/mysql_config. Default to search for
+ mysql_config in PATH
+ --with-libcurl=PREFIX look for the curl library in PREFIX/lib and headers
+ in PREFIX/include
+ --with-uriparser=PREFIX look for the uriparser library in PREFIX/lib and
+ headers in PREFIX/include
+ --with-ipv6 support IPv6 [default=check]
+ --with-ps-command=PATH Verbatim command to execute for ps
+ --with-ps-format=FORMAT Format string for scanning ps output
+ --with-ps-cols=NUM Number of columns in ps command
+ --with-ps-varlist=LIST Variable list for sscanf of 'ps' output
+ --with-ping-command=SYNTAX sets syntax for ICMP ping
+ --with-ping6-command=SYNTAX sets syntax for ICMPv6 ping
+ --with-nslookup-command=PATH sets path to nslookup executable
+ --with-uptime-command=PATH sets path to uptime
+ --with-rpcinfo-command=PATH sets path to rpcinfo
+ --with-smbclient-command=PATH sets path to smbclient
+ --with-snmpget-command=PATH Path to snmpget command
+ --with-snmpgetnext-command=PATH Path to snmpgetnext command
+ --with-qstat-command=PATH Path to qstat command
+ --with-fping-command=PATH Path to fping command
+ --with-fping6-command=PATH Path to fping6 command
+ --with-ssh-command=PATH sets path for ssh
+ --with-sudo-command=PATH sets path to sudo
+ --with-mailq-command=PATH sets path to mailq
+ --with-qmail-qstat-command=PATH sets path to qmail-qstat
+ --with-proc-meminfo=PATH path to /proc/meminfo or equivalent
+ --with-dig-command=PATH Path to dig command
+ --with-apt-get-command=PATH Path to apt-get command
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
+ --without-libiconv-prefix don't search for libiconv in includedir and libdir
+ --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
+ --without-libintl-prefix don't search for libintl in includedir and libdir
+ --with-linux-crypto use Linux kernel cryptographic API (if available)
+ for the hash functions MD5, SHA-1, SHA-224, SHA-256,
+ SHA-384, SHA-512 on files
+ --with-openssl[=ARG] use libcrypto hash routines for the hash functions
+ MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512.
+ Valid ARGs are:
+ 'yes',
+ 'no',
+ 'auto' => use if any version available,
+ 'auto-gpl-compat' => use if GPL compatible version
+ available,
+ 'optional' => use if available
+ and warn if not available;
+ Default is 'no'.
+ Note also --with-linux-crypto, which will enable the
+ use of Linux kernel crypto routines (if available),
+ which has precedence for files.
+ --without-included-regex
+ don't compile regex; this is the default on systems
+ with recent-enough versions of the GNU C Library
+ (use with caution on other systems).
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+monitoring-plugins configure 2.3.5
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ ac_save_ac_compile="$ac_compile"
+ if test -n "$ac_compile_for_check_decl"; then
+ ac_compile="$ac_compile_for_check_decl"
+ fi
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ ac_compile="$ac_save_ac_compile"
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by monitoring-plugins $as_me 2.3.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+as_fn_append ac_header_list " wchar.h"
+as_fn_append ac_header_list " minix/config.h"
+gt_needs="$gt_needs need-ngettext"
+as_fn_append ac_header_list " arpa/inet.h"
+as_fn_append ac_header_list " features.h"
+as_fn_append ac_header_list " sys/socket.h"
+as_fn_append ac_func_list " btowc"
+as_fn_append ac_func_list " _set_invalid_parameter_handler"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_func_list " fcntl"
+as_fn_append ac_func_list " symlink"
+as_fn_append ac_header_list " stdio_ext.h"
+as_fn_append ac_func_list " fpurge"
+as_fn_append ac_func_list " __fpurge"
+as_fn_append ac_func_list " __freading"
+as_fn_append ac_header_list " sys/stat.h"
+as_fn_append ac_header_list " sys/param.h"
+as_fn_append ac_header_list " sys/vfs.h"
+as_fn_append ac_header_list " sys/fs_types.h"
+as_fn_append ac_header_list " netdb.h"
+as_fn_append ac_header_list " netinet/in.h"
+as_fn_append ac_func_list " getdelim"
+as_fn_append ac_func_list " getdtablesize"
+gl_getopt_required=GNU
+as_fn_append ac_header_list " getopt.h"
+as_fn_append ac_header_list " sys/cdefs.h"
+as_fn_append ac_func_list " getprogname"
+as_fn_append ac_func_list " getexecname"
+as_fn_append ac_header_list " threads.h"
+as_fn_append ac_func_list " getuid"
+as_fn_append ac_func_list " geteuid"
+as_fn_append ac_func_list " getresuid"
+as_fn_append ac_func_list " getgid"
+as_fn_append ac_func_list " getegid"
+as_fn_append ac_func_list " getresgid"
+as_fn_append ac_func_list " setresuid"
+as_fn_append ac_func_list " setreuid"
+as_fn_append ac_func_list " seteuid"
+as_fn_append ac_func_list " setresgid"
+as_fn_append ac_func_list " setregid"
+as_fn_append ac_func_list " setegid"
+as_fn_append ac_header_list " limits.h"
+as_fn_append ac_header_list " inttypes.h"
+as_fn_append ac_header_list " sys/types.h"
+as_fn_append ac_header_list " stdint.h"
+as_fn_append ac_header_list " langinfo.h"
+as_fn_append ac_header_list " xlocale.h"
+as_fn_append ac_header_list " math.h"
+as_fn_append ac_func_list " mbsinit"
+as_fn_append ac_func_list " mbrtowc"
+as_fn_append ac_header_list " sys/mman.h"
+as_fn_append ac_func_list " mprotect"
+as_fn_append ac_header_list " sys/statvfs.h"
+as_fn_append ac_func_list " nl_langinfo"
+as_fn_append ac_func_list " lstat"
+as_fn_append ac_header_list " malloc.h"
+as_fn_append ac_func_list " isblank"
+as_fn_append ac_func_list " iswctype"
+as_fn_append ac_func_list " setenv"
+as_fn_append ac_func_list " snprintf"
+as_fn_append ac_header_list " sys/time.h"
+as_fn_append ac_header_list " stdalign.h"
+as_fn_append ac_header_list " stdbool.h"
+as_fn_append ac_header_list " stdckdint.h"
+as_fn_append ac_header_list " strings.h"
+as_fn_append ac_header_list " sys/uio.h"
+as_fn_append ac_func_list " localtime_r"
+as_fn_append ac_func_list " timegm"
+as_fn_append ac_func_list " vasnprintf"
+as_fn_append ac_header_list " crtdefs.h"
+as_fn_append ac_func_list " wcrtomb"
+as_fn_append ac_func_list " iswcntrl"
+as_fn_append ac_header_list " wctype.h"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_config_files="$ac_config_files gl/Makefile"
+
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+am__api_version='1.16'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='monitoring-plugins'
+ VERSION='2.3.5'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=0;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=yes
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+DEFAULT_PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+RELEASE=1
+
+
+
+
+extra_install_args=""
+
+# Check whether --with-nagios_user was given.
+if test "${with_nagios_user+set}" = set; then :
+ withval=$with_nagios_user; extra_install_args="-o $withval"
+fi
+
+
+# Check whether --with-nagios_group was given.
+if test "${with_nagios_group+set}" = set; then :
+ withval=$with_nagios_group; extra_install_args="$extra_install_args -g $withval"
+fi
+
+
+# Check whether --with-world_permissions was given.
+if test "${with_world_permissions+set}" = set; then :
+ withval=$with_world_permissions;
+fi
+
+
+if test "x$with_world_permissions" = xno ; then
+ extra_install_args="$extra_install_args -m 0550"
+fi
+
+INSTALL="$INSTALL $extra_install_args"
+INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}clang"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "clang", so it can be a program name with args.
+set dummy clang; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="clang"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion -version; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+$as_echo_n "checking for $CC option to enable C11 features... " >&6; }
+if ${ac_cv_prog_cc_c11+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c11=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+
+int
+main ()
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ v1.i = 2;
+ v1.w.k = 5;
+ _Static_assert ((offsetof (struct anonymous, i)
+ == offsetof (struct anonymous, w.k)),
+ "Anonymous union alignment botch");
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_c11" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c11"
+ CC=$CC$ac_prog_cc_stdc_options
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+$as_echo "$ac_cv_prog_cc_c11" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c11" != xno; then :
+ ac_prog_cc_stdc=c11
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+$as_echo_n "checking for $CC option to enable C99 features... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}
+int
+main ()
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_c99" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c99"
+ CC=$CC$ac_prog_cc_stdc_options
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+ ac_prog_cc_stdc=c99
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+$as_echo_n "checking for $CC option to enable C89 features... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_c89"
+ CC=$CC$ac_prog_cc_stdc_options
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+ ac_prog_cc_stdc=c89
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+else
+ ac_prog_cc_stdc=no
+ ac_cv_prog_cc_stdc=no
+fi
+
+fi
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
+$as_echo_n "checking whether the compiler is clang... " >&6; }
+if ${gl_cv_compiler_clang+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef __clang__
+ barfbarf
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_compiler_clang=no
+else
+ gl_cv_compiler_clang=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5
+$as_echo "$gl_cv_compiler_clang" >&6; }
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5
+$as_echo_n "checking for compiler option needed when checking for declarations... " >&6; }
+if ${gl_cv_compiler_check_decl_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test $gl_cv_compiler_clang = yes; then
+ save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile -Werror=implicit-function-declaration"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'
+else
+ gl_cv_compiler_check_decl_option=none
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_compile="$save_ac_compile"
+ else
+ gl_cv_compiler_check_decl_option=none
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5
+$as_echo "$gl_cv_compiler_check_decl_option" >&6; }
+ if test "x$gl_cv_compiler_check_decl_option" != xnone; then
+ ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
+ else
+ ac_compile_for_check_decl="$ac_compile"
+ fi
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
+ ;;
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+ for ac_header in $ac_header_list
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
+$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
+if ${ac_cv_should_define__xopen_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_should_define__xopen_source=no
+ if test $ac_cv_header_wchar_h = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <wchar.h>
+ mbstate_t x;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_should_define__xopen_source=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
+$as_echo "$ac_cv_should_define__xopen_source" >&6; }
+
+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
+
+ $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _OPENBSD_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
+
+ $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
+
+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+ if test $ac_cv_header_minix_config_h = yes; then :
+ MINIX=yes
+ $as_echo "#define _MINIX 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+else
+ MINIX=
+fi
+ if test $ac_cv_safe_to_define___extensions__ = yes; then :
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+fi
+ if test $ac_cv_should_define__xopen_source = yes; then :
+ $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+fi
+
+
+
+
+
+ case "$host_os" in
+ openbsd*)
+
+$as_echo "#define _ISOC11_SOURCE 1" >>confdefs.h
+
+ ;;
+ esac
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
+$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
+if ${gl_cv_c_amsterdam_compiler+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef __ACK__
+Amsterdam
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Amsterdam" >/dev/null 2>&1; then :
+ gl_cv_c_amsterdam_compiler=yes
+else
+ gl_cv_c_amsterdam_compiler=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
+$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
+
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ if test -z "$AR"; then
+ AR='cc -c.a'
+ fi
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='-o'
+ fi
+ else
+ :
+ fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="ar"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cr'
+ fi
+
+
+
+ if test -z "$RANLIB"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ RANLIB=':'
+ else
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ fi
+ fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_sys_largefile_source=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE_SOURCE 1
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_sys_largefile_source=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_cv_sys_largefile_source=unknown
+ break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
+$as_echo "$ac_cv_sys_largefile_source" >&6; }
+case $ac_cv_sys_largefile_source in #(
+ no | unknown) ;;
+ *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
+_ACEOF
+;;
+esac
+rm -rf conftest*
+
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+if test $ac_cv_sys_largefile_source != unknown; then
+
+$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
+
+fi
+
+ case "$host_os" in
+ hpux*)
+
+$as_echo "#define _LARGEFILE_SOURCE 1" >>confdefs.h
+
+ ;;
+ esac
+
+
+ if test "$enable_largefile" != no; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5
+$as_echo_n "checking for $CC option to enable large file support... " >&6; }
+if ${ac_cv_sys_largefile_opts+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_CC="$CC"
+ ac_opt_found=no
+ for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do
+ if test x"$ac_opt" != x"none needed"; then :
+ CC="$ac_save_CC $ac_opt"
+fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_largefile_opts="$ac_opt"
+ ac_opt_found=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test $ac_opt_found = no || break
+ done
+ CC="$ac_save_CC"
+ test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5
+$as_echo "$ac_cv_sys_largefile_opts" >&6; }
+
+ac_have_largefile=yes
+case $ac_cv_sys_largefile_opts in #(
+ "none needed") :
+ ;; #(
+ "support not detected") :
+ ac_have_largefile=no ;; #(
+ "-D_FILE_OFFSET_BITS=64") :
+
+$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h
+ ;; #(
+ "-D_LARGE_FILES=1") :
+
+$as_echo "#define _LARGE_FILES 1" >>confdefs.h
+ ;; #(
+ "-n32") :
+ CC="$CC -n32" ;; #(
+ *) :
+ as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;;
+esac
+
+ if test "$enable_year2038" != no; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable timestamps after Jan 2038" >&5
+$as_echo_n "checking for $CC option to enable timestamps after Jan 2038... " >&6; }
+if ${ac_cv_sys_year2038_opts+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_opt_found=no
+ for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do
+ if test x"$ac_opt" != x"none needed"; then :
+ CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"
+fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <time.h>
+ /* Check that time_t can represent 2**32 - 1 correctly. */
+ #define LARGE_TIME_T \\
+ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))
+ int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535
+ && LARGE_TIME_T % 65537 == 0)
+ ? 1 : -1];
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_sys_year2038_opts="$ac_opt"
+ ac_opt_found=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test $ac_opt_found = no || break
+ done
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5
+$as_echo "$ac_cv_sys_year2038_opts" >&6; }
+
+ac_have_year2038=yes
+case $ac_cv_sys_year2038_opts in #(
+ "none needed") :
+ ;; #(
+ "support not detected") :
+ ac_have_year2038=no
+ case $enable_year2038 in #(
+ yes) :
+ # If we're not cross compiling and 'touch' works with a large
+ # timestamp, then we can presume the system supports wider time_t
+ # *somehow* and we just weren't able to detect it. One common
+ # case that we deliberately *don't* probe for is a system that
+ # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
+ # wide time_t. (It would be inappropriate for us to override an
+ # intentional use of -m32.) Error out, demanding use of
+ # --disable-year2038 if this is intentional.
+ if test $cross_compiling = no; then :
+ if TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null; then :
+ case `TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null` in #(
+ *'Feb 7 2106'* | *'Feb 7 17:10'*) :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "this system appears to support timestamps after
+January 2038, but no mechanism for enabling wide
+'time_t' was detected. Did you mean to build a 64-bit
+binary? (e.g. 'CC=\"${CC} -m64\"'.) To proceed with
+32-bit time_t, configure with '--disable-year2038'.
+See \`config.log' for more details" "$LINENO" 5; } ;; #(
+ *) :
+ ;;
+esac
+fi
+fi ;; #(
+ *) :
+ ;;
+esac ;; #(
+ "-D_TIME_BITS=64") :
+
+$as_echo "#define _TIME_BITS 64" >>confdefs.h
+ ;; #(
+ "-D__MINGW_USE_VC2005_COMPAT=1") :
+
+$as_echo "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h
+ ;; #(
+ "-U_USE_32_BIT_TIME_T"*) :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It
+will stop working after January 2038. Remove
+_USE_32BIT_TIME_T from the compiler flags.
+See \`config.log' for more details" "$LINENO" 5; } ;; #(
+ *) :
+ as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;;
+esac
+
+fi
+
+
+
+fi
+
+
+
+
+
+
+
+
+ # Check whether --enable-threads was given.
+if test "${enable_threads+set}" = set; then :
+ enableval=$enable_threads; gl_use_threads=$enableval
+else
+ if test -n "$gl_use_threads_default"; then
+ gl_use_threads="$gl_use_threads_default"
+ else
+ case "$host_os" in
+ osf*) gl_use_threads=no ;;
+ cygwin*)
+ case `uname -r` in
+ 1.[0-5].*) gl_use_threads=no ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ mingw*)
+ case "$gl_use_winpthreads_default" in
+ yes) gl_use_threads=posix ;;
+ no) gl_use_threads=windows ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ *) gl_use_threads=yes ;;
+ esac
+ fi
+
+fi
+
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = isoc \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+ # For using <threads.h> or <pthread.h>:
+
+
+ if test -z "$gl_anythreadlib_early_done"; then
+ case "$host_os" in
+ osf*)
+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+ # groks <pthread.h>. cc also understands the flag -pthread, but
+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
+ # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ # Some systems optimize for single-threaded programs by default, and
+ # need special flags to disable these optimizations. For example, the
+ # definition of 'errno' in <errno.h>.
+ case "$host_os" in
+ aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+ solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+ esac
+ gl_anythreadlib_early_done=done
+ fi
+
+ fi
+
+
+
+ # Pre-early section.
+
+
+
+ # Code from module absolute-header:
+ # Code from module alloca-opt:
+ # Code from module arpa_inet:
+ # Code from module assert-h:
+ # Code from module attribute:
+ # Code from module base64:
+ # Code from module basename-lgpl:
+ # Code from module btowc:
+ # Code from module builtin-expect:
+ # Code from module byteswap:
+ # Code from module c99:
+ # Code from module calloc-gnu:
+ # Code from module calloc-posix:
+ # Code from module cloexec:
+ # Code from module close:
+ # Code from module crypto/af_alg:
+ # Code from module crypto/sha256:
+ # Code from module crypto/sha256-buffer:
+ # Code from module dirname:
+ # Code from module dirname-lgpl:
+ # Code from module double-slash-root:
+ # Code from module dup2:
+ # Code from module environ:
+ # Code from module errno:
+ # Code from module error:
+ # Code from module exitfail:
+ # Code from module extensions:
+ # Code from module extern-inline:
+ # Code from module fcntl:
+ # Code from module fcntl-h:
+ # Code from module fd-hook:
+ # Code from module fflush:
+
+ # Code from module filename:
+ # Code from module float:
+ # Code from module floorf:
+ # Code from module fopen:
+ # Code from module fopen-gnu:
+ # Code from module fpurge:
+ # Code from module freading:
+ # Code from module free-posix:
+ # Code from module fseek:
+ # Code from module fseeko:
+
+ # Code from module fstat:
+ # Code from module fsusage:
+ # Code from module ftell:
+ # Code from module ftello:
+
+ # Code from module gen-header:
+ # Code from module getaddrinfo:
+ # Code from module getdelim:
+ # Code from module getdtablesize:
+ # Code from module gethostname:
+ # Code from module getline:
+ # Code from module getloadavg:
+ # Code from module getopt-gnu:
+ # Code from module getopt-posix:
+ # Code from module getprogname:
+ # Code from module gettext-h:
+ # Code from module glibc-internal/dynarray:
+ # Code from module hard-locale:
+ # Code from module hostent:
+ # Code from module ialloc:
+ # Code from module idpriv-droptemp:
+ # Code from module idx:
+ # Code from module include_next:
+ # Code from module inet_ntop:
+ # Code from module intprops:
+ # Code from module inttypes-incomplete:
+ # Code from module langinfo:
+ # Code from module largefile:
+
+ # Code from module libc-config:
+ # Code from module limits-h:
+ # Code from module localcharset:
+ # Code from module locale:
+ # Code from module localeconv:
+ # Code from module lock:
+ # Code from module lseek:
+ # Code from module malloc-gnu:
+ # Code from module malloc-posix:
+ # Code from module malloca:
+ # Code from module math:
+ # Code from module mbrtowc:
+ # Code from module mbsinit:
+ # Code from module mbtowc:
+ # Code from module memchr:
+ # Code from module minmax:
+ # Code from module mktime:
+ # Code from module mktime-internal:
+ # Code from module mountlist:
+ # Code from module msvc-inval:
+ # Code from module msvc-nothrow:
+ # Code from module multiarch:
+ # Code from module netdb:
+ # Code from module netinet_in:
+ # Code from module nl_langinfo:
+ # Code from module nocrash:
+ # Code from module open:
+ # Code from module pathmax:
+ # Code from module realloc-gnu:
+ # Code from module realloc-posix:
+ # Code from module reallocarray:
+ # Code from module regex:
+ # Code from module servent:
+ # Code from module setenv:
+ # Code from module setlocale-null:
+ # Code from module size_max:
+ # Code from module snippet/_Noreturn:
+ # Code from module snippet/arg-nonnull:
+ # Code from module snippet/c++defs:
+ # Code from module snippet/warn-on-use:
+ # Code from module snprintf:
+ # Code from module socketlib:
+ # Code from module sockets:
+ # Code from module socklen:
+ # Code from module ssize_t:
+ # Code from module stat:
+ # Code from module stat-time:
+ # Code from module std-gnu11:
+ # Code from module stdalign:
+ # Code from module stdbool:
+ # Code from module stdckdint:
+ # Code from module stddef:
+ # Code from module stdint:
+ # Code from module stdio:
+ # Code from module stdlib:
+ # Code from module strcase:
+ # Code from module strcasestr:
+ # Code from module strcasestr-simple:
+ # Code from module streq:
+ # Code from module strerror:
+ # Code from module strerror-override:
+ # Code from module string:
+ # Code from module strings:
+ # Code from module strsep:
+ # Code from module strstr-simple:
+ # Code from module sys_socket:
+ # Code from module sys_stat:
+ # Code from module sys_types:
+ # Code from module sys_uio:
+ # Code from module threadlib:
+
+
+
+ # Code from module time:
+ # Code from module time_r:
+ # Code from module timegm:
+ # Code from module unistd:
+ # Code from module unlocked-io-internal:
+ # Code from module unsetenv:
+ # Code from module vararrays:
+ # Code from module vasnprintf:
+ # Code from module vasprintf:
+ # Code from module verify:
+ # Code from module vsnprintf:
+ # Code from module wchar:
+ # Code from module wcrtomb:
+ # Code from module wctype-h:
+ # Code from module windows-mutex:
+ # Code from module windows-once:
+ # Code from module windows-recmutex:
+ # Code from module windows-rwlock:
+ # Code from module xalloc:
+ # Code from module xalloc-die:
+ # Code from module xalloc-oversized:
+ # Code from module xsize:
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if ${ac_cv_prog_gcc_traditional+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ link_all_deplibs=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ link_all_deplibs=no
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+$as_echo_n "checking for error_at_line... " >&6; }
+if ${ac_cv_lib_error_at_line+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <error.h>
+int
+main ()
+{
+error_at_line (0, 0, "", 0, "an error occurred");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_error_at_line=yes
+else
+ ac_cv_lib_error_at_line=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+$as_echo "$ac_cv_lib_error_at_line" >&6; }
+if test $ac_cv_lib_error_at_line = no; then
+ case " $LIBOBJS " in
+ *" error.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS error.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
+$as_echo_n "checking for working strtod... " >&6; }
+if ${ac_cv_func_strtod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_strtod=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+$ac_includes_default
+#ifndef strtod
+double strtod ();
+#endif
+int
+main()
+{
+ {
+ /* Some versions of Linux strtod mis-parse strings with leading '+'. */
+ char *string = " +69";
+ char *term;
+ double value;
+ value = strtod (string, &term);
+ if (value != 69 || term != (string + 4))
+ return 1;
+ }
+
+ {
+ /* Under Solaris 2.4, strtod returns the wrong value for the
+ terminating character under some conditions. */
+ char *string = "NaN";
+ char *term;
+ strtod (string, &term);
+ if (term != string && *(term - 1) == 0)
+ return 1;
+ }
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_strtod=yes
+else
+ ac_cv_func_strtod=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5
+$as_echo "$ac_cv_func_strtod" >&6; }
+if test $ac_cv_func_strtod = no; then
+ case " $LIBOBJS " in
+ *" strtod.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strtod.$ac_objext"
+ ;;
+esac
+
+ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
+if test "x$ac_cv_func_pow" = xyes; then :
+
+fi
+
+if test $ac_cv_func_pow = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
+$as_echo_n "checking for pow in -lm... " >&6; }
+if ${ac_cv_lib_m_pow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_pow=yes
+else
+ ac_cv_lib_m_pow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
+$as_echo "$ac_cv_lib_m_pow" >&6; }
+if test "x$ac_cv_lib_m_pow" = xyes; then :
+ POW_LIB=-lm
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
+$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;}
+fi
+
+fi
+
+fi
+
+
+PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
+
+SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
+
+WARRANTY="The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n"
+
+
+SUPPORT="Send email to help@monitoring-plugins.org if you have questions regarding use\nof this software. To submit patches or suggest improvements, send email to\ndevel@monitoring-plugins.org. Please include version information with all\ncorrespondence (when possible, use output from the --version option of the\nplugin itself).\n"
+
+
+
+# Check whether --with-cgiurl was given.
+if test "${with_cgiurl+set}" = set; then :
+ withval=$with_cgiurl; with_cgiurl=$withval
+else
+ with_cgiurl=/nagios/cgi-bin
+fi
+
+CGIURL="$with_cgiurl"
+
+cat >>confdefs.h <<_ACEOF
+#define CGIURL "$CGIURL"
+_ACEOF
+
+
+
+# Check whether --with-trusted_path was given.
+if test "${with_trusted_path+set}" = set; then :
+ withval=$with_trusted_path; with_trusted_path=$withval
+else
+ with_trusted_path=$DEFAULT_PATH
+fi
+
+
+
+EXTRAS=
+EXTRAS_ROOT=
+
+LDFLAGS="$LDFLAGS -L."
+
+ac_cv_uname_m=`uname -m`
+ac_cv_uname_s=`uname -s`
+ac_cv_uname_r=`uname -r`
+ac_cv_uname_v=`uname -v`
+ac_cv_uname_o=`uname -o`
+
+PKG_ARCH=`uname -p`
+REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
+REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
+
+
+
+
+
+ if test -f $srcdir/release; then
+ RELEASE_PRESENT_TRUE=
+ RELEASE_PRESENT_FALSE='#'
+else
+ RELEASE_PRESENT_TRUE='#'
+ RELEASE_PRESENT_FALSE=
+fi
+
+
+# Also read in the version from it
+if test -f $srcdir/release; then
+ NP_RELEASE="$(<release)"
+else
+ NP_RELEASE="$PACKAGE_VERSION"
+fi
+
+
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PERL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PERL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "hostname", so it can be a program name with args.
+set dummy hostname; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_HOSTNAME+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $HOSTNAME in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_HOSTNAME="$HOSTNAME" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_HOSTNAME="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+HOSTNAME=$ac_cv_path_HOSTNAME
+if test -n "$HOSTNAME"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOSTNAME" >&5
+$as_echo "$HOSTNAME" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "basename", so it can be a program name with args.
+set dummy basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_BASENAME+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $BASENAME in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_BASENAME="$BASENAME" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_BASENAME="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+BASENAME=$ac_cv_path_BASENAME
+if test -n "$BASENAME"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASENAME" >&5
+$as_echo "$BASENAME" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+# Check whether --with-perl was given.
+if test "${with_perl+set}" = set; then :
+ withval=$with_perl; with_perl=$withval
+else
+ with_perl=$PERL
+fi
+
+PERL=$with_perl
+
+
+
+# Check whether --with-openssl was given.
+if test "${with_openssl+set}" = set; then :
+ withval=$with_openssl;
+fi
+
+
+
+# Check whether --with-gnutls was given.
+if test "${with_gnutls+set}" = set; then :
+ withval=$with_gnutls;
+fi
+
+
+if test ! "$with_openssl" = "" && test ! "$with_openssl" = "no"; then
+ with_gnutls="no"
+fi
+if test ! "$with_gnutls" = "" && test ! "$with_gnutls" = "no"; then
+ with_openssl="no"
+fi
+
+OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
+ /opt /opt/openssl"
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldce" >&5
+$as_echo_n "checking for main in -ldce... " >&6; }
+if ${ac_cv_lib_dce_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldce $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dce_main=yes
+else
+ ac_cv_lib_dce_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dce_main" >&5
+$as_echo "$ac_cv_lib_dce_main" >&6; }
+if test "x$ac_cv_lib_dce_main" = xyes; then :
+ SOCKETLIBS="$SOCKETLIBS -ldce"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5
+$as_echo_n "checking for main in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_main=yes
+else
+ ac_cv_lib_nsl_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5
+$as_echo "$ac_cv_lib_nsl_main" >&6; }
+if test "x$ac_cv_lib_nsl_main" = xyes; then :
+ SOCKETLIBS="$SOCKETLIBS -lnsl"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_socket=yes
+else
+ ac_cv_lib_socket_socket=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
+ SOCKETLIBS="$SOCKETLIBS -lsocket"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lresolv" >&5
+$as_echo_n "checking for main in -lresolv... " >&6; }
+if ${ac_cv_lib_resolv_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lresolv $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_resolv_main=yes
+else
+ ac_cv_lib_resolv_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_main" >&5
+$as_echo "$ac_cv_lib_resolv_main" >&6; }
+if test "x$ac_cv_lib_resolv_main" = xyes; then :
+ SOCKETLIBS="$SOCKETLIBS -lresolv"
+fi
+
+
+
+for ac_header in math.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default"
+if test "x$ac_cv_header_math_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MATH_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
+$as_echo_n "checking for floor in -lm... " >&6; }
+if ${ac_cv_lib_m_floor+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char floor ();
+int
+main ()
+{
+return floor ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_floor=yes
+else
+ ac_cv_lib_m_floor=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
+$as_echo "$ac_cv_lib_m_floor" >&6; }
+if test "x$ac_cv_lib_m_floor" = xyes; then :
+ MATHLIBS="-lm"
+fi
+
+for ac_header in mp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "mp.h" "ac_cv_header_mp_h" "$ac_includes_default"
+if test "x$ac_cv_header_mp_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MP_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lbsd" >&5
+$as_echo_n "checking for pow in -lbsd... " >&6; }
+if ${ac_cv_lib_bsd_pow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bsd_pow=yes
+else
+ ac_cv_lib_bsd_pow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_pow" >&5
+$as_echo "$ac_cv_lib_bsd_pow" >&6; }
+if test "x$ac_cv_lib_bsd_pow" = xyes; then :
+ MATHLIBS="$MATHLIBS -lbsd"
+fi
+
+
+
+# Check whether --enable-libtap was given.
+if test "${enable_libtap+set}" = set; then :
+ enableval=$enable_libtap; enable_libtap=$enableval
+else
+ enable_libtap=no
+fi
+
+ if test "$enable_libtap" = "yes"; then
+ USE_LIBTAP_LOCAL_TRUE=
+ USE_LIBTAP_LOCAL_FALSE='#'
+else
+ USE_LIBTAP_LOCAL_TRUE='#'
+ USE_LIBTAP_LOCAL_FALSE=
+fi
+
+
+# If not local, check if we can use the system one
+if test "$enable_libtap" != "yes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for plan_tests in -ltap" >&5
+$as_echo_n "checking for plan_tests in -ltap... " >&6; }
+if ${ac_cv_lib_tap_plan_tests+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltap $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char plan_tests ();
+int
+main ()
+{
+return plan_tests ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_tap_plan_tests=yes
+else
+ ac_cv_lib_tap_plan_tests=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tap_plan_tests" >&5
+$as_echo "$ac_cv_lib_tap_plan_tests" >&6; }
+if test "x$ac_cv_lib_tap_plan_tests" = xyes; then :
+ enable_libtap="yes"
+
+fi
+
+fi
+
+# Finally, define tests if we use libtap
+if test "$enable_libtap" = "yes" ; then
+ EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
+
+fi
+
+# Check whether --enable-extra-opts was given.
+if test "${enable_extra_opts+set}" = set; then :
+ enableval=$enable_extra_opts; enable_extra_opts=$enableval
+else
+ enable_extra_opts=yes
+fi
+
+ if test "$enable_extra_opts" = "yes"; then
+ USE_PARSE_INI_TRUE=
+ USE_PARSE_INI_FALSE='#'
+else
+ USE_PARSE_INI_TRUE='#'
+ USE_PARSE_INI_FALSE=
+fi
+
+if test "$enable_extra_opts" = "yes" ; then
+
+$as_echo "#define NP_EXTRA_OPTS 1" >>confdefs.h
+
+ if test "$enable_libtap" = "yes"; then
+ EXTRA_TEST="$EXTRA_TEST test_ini1 test_ini3 test_opts1 test_opts2 test_opts3"
+
+ fi
+fi
+
+_SAVEDLIBS="$LIBS"
+_SAVEDCPPFLAGS="$CPPFLAGS"
+
+# Check whether --with-pgsql was given.
+if test "${with_pgsql+set}" = set; then :
+ withval=$with_pgsql; PGSQL=$withval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypt" >&5
+$as_echo_n "checking for main in -lcrypt... " >&6; }
+if ${ac_cv_lib_crypt_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypt_main=yes
+else
+ ac_cv_lib_crypt_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_main" >&5
+$as_echo "$ac_cv_lib_crypt_main" >&6; }
+if test "x$ac_cv_lib_crypt_main" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPT 1
+_ACEOF
+
+ LIBS="-lcrypt $LIBS"
+
+fi
+
+if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
+ if test -n "$PGSQL"; then
+ LDFLAGS="$LDFLAGS -L$PGSQL/lib"
+ CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQsetdbLogin in -lpq" >&5
+$as_echo_n "checking for PQsetdbLogin in -lpq... " >&6; }
+if ${ac_cv_lib_pq_PQsetdbLogin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpq -lcrypt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PQsetdbLogin ();
+int
+main ()
+{
+return PQsetdbLogin ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pq_PQsetdbLogin=yes
+else
+ ac_cv_lib_pq_PQsetdbLogin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsetdbLogin" >&5
+$as_echo "$ac_cv_lib_pq_PQsetdbLogin" >&6; }
+if test "x$ac_cv_lib_pq_PQsetdbLogin" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPQ 1
+_ACEOF
+
+ LIBS="-lpq $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
+ for ac_header in pgsql/libpq-fe.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "pgsql/libpq-fe.h" "ac_cv_header_pgsql_libpq_fe_h" "$ac_includes_default"
+if test "x$ac_cv_header_pgsql_libpq_fe_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PGSQL_LIBPQ_FE_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in postgresql/libpq-fe.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "postgresql/libpq-fe.h" "ac_cv_header_postgresql_libpq_fe_h" "$ac_includes_default"
+if test "x$ac_cv_header_postgresql_libpq_fe_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_POSTGRESQL_LIBPQ_FE_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_header in libpq-fe.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libpq-fe.h" "ac_cv_header_libpq_fe_h" "$ac_includes_default"
+if test "x$ac_cv_header_libpq_fe_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPQ_FE_H 1
+_ACEOF
+
+fi
+
+done
+
+ if [ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]; then
+ PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+ PGINCLUDE="-I$PGSQL/include"
+ elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
+ PGLIBS="-lpq -lcrypt"
+ PGINCLUDE="-I/usr/include/pgsql"
+ elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
+ PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+ PGINCLUDE="-I/usr/include/postgresql"
+ elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
+ PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+ PGINCLUDE="-I$PGSQL/include"
+ fi
+ if test -z "$PGINCLUDE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping PostgreSQL plugin (check_pgsql)" >&5
+$as_echo "$as_me: WARNING: Skipping PostgreSQL plugin (check_pgsql)" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install PostgreSQL headers to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install PostgreSQL headers to compile this plugin (see REQUIREMENTS)." >&2;}
+ else
+
+
+ EXTRAS="$EXTRAS check_pgsql\$(EXEEXT)"
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping PostgreSQL plugin (check_pgsql)" >&5
+$as_echo "$as_me: WARNING: Skipping PostgreSQL plugin (check_pgsql)" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LIBS=\"$LIBS\" CPPFLAGS=\"$CPPFLAGS\"" >&5
+$as_echo "$as_me: WARNING: LIBS=\"$LIBS\" CPPFLAGS=\"$CPPFLAGS\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install PostgreSQL libs to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install PostgreSQL libs to compile this plugin (see REQUIREMENTS)." >&2;}
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping PostgreSQL plugin (check_pgsql)" >&5
+$as_echo "$as_me: WARNING: Skipping PostgreSQL plugin (check_pgsql)" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS)." >&2;}
+fi
+LIBS="$_SAVEDLIBS"
+CPPFLAGS="$_SAVEDCPPFLAGS"
+
+
+# Check whether --with-dbi was given.
+if test "${with_dbi+set}" = set; then :
+ withval=$with_dbi;
+fi
+
+if test "x$with_dbi" != "xno"; then :
+
+ _SAVEDLIBS="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbi_initialize in -ldbi" >&5
+$as_echo_n "checking for dbi_initialize in -ldbi... " >&6; }
+if ${ac_cv_lib_dbi_dbi_initialize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldbi $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dbi_initialize ();
+int
+main ()
+{
+return dbi_initialize ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dbi_dbi_initialize=yes
+else
+ ac_cv_lib_dbi_dbi_initialize=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbi_dbi_initialize" >&5
+$as_echo "$ac_cv_lib_dbi_dbi_initialize" >&6; }
+if test "x$ac_cv_lib_dbi_dbi_initialize" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDBI 1
+_ACEOF
+
+ LIBS="-ldbi $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then
+ EXTRAS="$EXTRAS check_dbi\$(EXEEXT)"
+ DBILIBS="-ldbi"
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping dbi plugin" >&5
+$as_echo "$as_me: WARNING: Skipping dbi plugin" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install DBI libs to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install DBI libs to compile this plugin (see REQUIREMENTS)." >&2;}
+ fi
+ LIBS="$_SAVEDLIBS"
+
+fi
+
+
+# Check whether --with-radius was given.
+if test "${with_radius+set}" = set; then :
+ withval=$with_radius;
+fi
+
+
+if test "x$with_radius" != "xno"; then :
+
+ _SAVEDLIBS="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradcli" >&5
+$as_echo_n "checking for rc_read_config in -lradcli... " >&6; }
+if ${ac_cv_lib_radcli_rc_read_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lradcli $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rc_read_config ();
+int
+main ()
+{
+return rc_read_config ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_radcli_rc_read_config=yes
+else
+ ac_cv_lib_radcli_rc_read_config=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radcli_rc_read_config" >&5
+$as_echo "$ac_cv_lib_radcli_rc_read_config" >&6; }
+if test "x$ac_cv_lib_radcli_rc_read_config" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRADCLI 1
+_ACEOF
+
+ LIBS="-lradcli $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_radcli_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lradcli"
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lfreeradius-client" >&5
+$as_echo_n "checking for rc_read_config in -lfreeradius-client... " >&6; }
+if ${ac_cv_lib_freeradius_client_rc_read_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfreeradius-client $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rc_read_config ();
+int
+main ()
+{
+return rc_read_config ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_freeradius_client_rc_read_config=yes
+else
+ ac_cv_lib_freeradius_client_rc_read_config=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freeradius_client_rc_read_config" >&5
+$as_echo "$ac_cv_lib_freeradius_client_rc_read_config" >&6; }
+if test "x$ac_cv_lib_freeradius_client_rc_read_config" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBFREERADIUS_CLIENT 1
+_ACEOF
+
+ LIBS="-lfreeradius-client $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lfreeradius-client"
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradiusclient-ng" >&5
+$as_echo_n "checking for rc_read_config in -lradiusclient-ng... " >&6; }
+if ${ac_cv_lib_radiusclient_ng_rc_read_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lradiusclient-ng $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rc_read_config ();
+int
+main ()
+{
+return rc_read_config ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_radiusclient_ng_rc_read_config=yes
+else
+ ac_cv_lib_radiusclient_ng_rc_read_config=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radiusclient_ng_rc_read_config" >&5
+$as_echo "$ac_cv_lib_radiusclient_ng_rc_read_config" >&6; }
+if test "x$ac_cv_lib_radiusclient_ng_rc_read_config" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRADIUSCLIENT_NG 1
+_ACEOF
+
+ LIBS="-lradiusclient-ng $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lradiusclient-ng"
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradiusclient" >&5
+$as_echo_n "checking for rc_read_config in -lradiusclient... " >&6; }
+if ${ac_cv_lib_radiusclient_rc_read_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lradiusclient $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char rc_read_config ();
+int
+main ()
+{
+return rc_read_config ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_radiusclient_rc_read_config=yes
+else
+ ac_cv_lib_radiusclient_rc_read_config=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_radiusclient_rc_read_config" >&5
+$as_echo "$ac_cv_lib_radiusclient_rc_read_config" >&6; }
+if test "x$ac_cv_lib_radiusclient_rc_read_config" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRADIUSCLIENT 1
+_ACEOF
+
+ LIBS="-lradiusclient $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lradiusclient"
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping radius plugin" >&5
+$as_echo "$as_me: WARNING: Skipping radius plugin" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install radius libs to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install radius libs to compile this plugin (see REQUIREMENTS)." >&2;}
+ fi
+ fi
+ fi
+ fi
+ LIBS="$_SAVEDLIBS"
+
+fi
+
+
+# Check whether --with-ldap was given.
+if test "${with_ldap+set}" = set; then :
+ withval=$with_ldap;
+fi
+
+
+if test "x$with_ldap" != "xno"; then :
+
+ _SAVEDLIBS="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lldap" >&5
+$as_echo_n "checking for main in -lldap... " >&6; }
+if ${ac_cv_lib_ldap_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap -llber $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ldap_main=yes
+else
+ ac_cv_lib_ldap_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_main" >&5
+$as_echo "$ac_cv_lib_ldap_main" >&6; }
+if test "x$ac_cv_lib_ldap_main" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLDAP 1
+_ACEOF
+
+ LIBS="-lldap $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_ldap_main" = "yes"; then
+ LDAPLIBS="-lldap -llber"\
+ LDAPINCLUDE="-I/usr/include/ldap"
+
+
+ for ac_func in ldap_set_option
+do :
+ ac_fn_c_check_func "$LINENO" "ldap_set_option" "ac_cv_func_ldap_set_option"
+if test "x$ac_cv_func_ldap_set_option" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LDAP_SET_OPTION 1
+_ACEOF
+
+fi
+done
+
+ EXTRAS="$EXTRAS check_ldap\$(EXEEXT)"
+ for ac_func in ldap_init ldap_set_option ldap_get_option ldap_start_tls_s
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping LDAP plugin" >&5
+$as_echo "$as_me: WARNING: Skipping LDAP plugin" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install LDAP libs to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install LDAP libs to compile this plugin (see REQUIREMENTS)." >&2;}
+ fi
+ LIBS="$_SAVEDLIBS"
+
+fi
+
+
+
+# Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+ withval=$with_systemd;
+fi
+
+
+if test "x$with_systemd" != "xno"; then :
+
+ _SAVEDLIBS="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sd_get_sessions in -lsystemd" >&5
+$as_echo_n "checking for sd_get_sessions in -lsystemd... " >&6; }
+if ${ac_cv_lib_systemd_sd_get_sessions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsystemd -lsystemd $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sd_get_sessions ();
+int
+main ()
+{
+return sd_get_sessions ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_systemd_sd_get_sessions=yes
+else
+ ac_cv_lib_systemd_sd_get_sessions=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_systemd_sd_get_sessions" >&5
+$as_echo "$ac_cv_lib_systemd_sd_get_sessions" >&6; }
+if test "x$ac_cv_lib_systemd_sd_get_sessions" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSYSTEMD 1
+_ACEOF
+
+ LIBS="-lsystemd $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_systemd_sd_get_sessions" = "yes"; then
+ SYSTEMDLIBS="-lsystemd"
+ SYSTEMDINCLUDE=""
+
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping systemd support" >&5
+$as_echo "$as_me: WARNING: Skipping systemd support" >&2;}
+ fi
+ LIBS="$_SAVEDLIBS"
+
+fi
+
+
+case $host in
+ *linux*)
+ ac_fn_c_check_header_mongrel "$LINENO" "linux/hdreg.h" "ac_cv_header_linux_hdreg_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_hdreg_h" = xyes; then :
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ ac_fn_c_check_header_mongrel "$LINENO" "linux/types.h" "ac_cv_header_linux_types_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_types_h" = xyes; then :
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping check_ide_smart plugin." >&5
+$as_echo "$as_me: WARNING: Skipping check_ide_smart plugin." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: check_ide_smart requires linux/hdreg.h and linux/types.h." >&5
+$as_echo "$as_me: WARNING: check_ide_smart requires linux/hdreg.h and linux/types.h." >&2;}
+ fi
+ ;;
+ *netbsd*)
+ ac_fn_c_check_header_mongrel "$LINENO" "dev/ata/atareg.h" "ac_cv_header_dev_ata_atareg_h" "$ac_includes_default"
+if test "x$ac_cv_header_dev_ata_atareg_h" = xyes; then :
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ ac_fn_c_check_header_mongrel "$LINENO" "dev/ic/wdcreg.h" "ac_cv_header_dev_ic_wdcreg_h" "$ac_includes_default"
+if test "x$ac_cv_header_dev_ic_wdcreg_h" = xyes; then :
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping check_ide_smart plugin." >&5
+$as_echo "$as_me: WARNING: Skipping check_ide_smart plugin." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h" >&5
+$as_echo "$as_me: WARNING: check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h" >&2;}
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping check_ide_smart plugin." >&5
+$as_echo "$as_me: WARNING: Skipping check_ide_smart plugin." >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: check_ide_smart works only on Linux and NetBSD" >&5
+$as_echo "$as_me: WARNING: check_ide_smart works only on Linux and NetBSD" >&2;}
+esac
+
+if test "$FOUNDINCLUDE" = "yes" ; then
+ EXTRAS="$EXTRAS check_ide_smart\$(EXEEXT)"
+fi
+
+
+
+# Check whether --with-mysql was given.
+if test "${with_mysql+set}" = set; then :
+ withval=$with_mysql; with_mysql=$withval
+else
+ with_mysql=yes
+fi
+
+
+ if test "x$with_mysql" != "xno" ; then
+ if test "x$with_mysql" = "xyes" ; then
+ # Extract the first word of "mysql_config", so it can be a program name with args.
+set dummy mysql_config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_np_mysql_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $np_mysql_config in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_np_mysql_config="$np_mysql_config" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_np_mysql_config="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+np_mysql_config=$ac_cv_path_np_mysql_config
+if test -n "$np_mysql_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $np_mysql_config" >&5
+$as_echo "$np_mysql_config" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ if test -x $with_mysql/bin/mysql_config ; then
+ np_mysql_config="$with_mysql/bin/mysql_config"
+ fi
+ fi
+ if test -z "$np_mysql_config"; then
+ with_mysql="no"
+ else
+ np_mysql_include="`$np_mysql_config --include`"
+ # Mysql 3 does not support --include. --cflags should be sufficient
+ if test $? -ne 0; then
+ np_mysql_include="-I$with_mysql/include" # Guessed location
+ fi
+ np_mysql_libs="`$np_mysql_config --libs`"
+ np_mysql_cflags="`$np_mysql_config --cflags`"
+ # On Solaris, cflags may contain -xstrconst, which is not acceptable to the
+ # gcc compiler. In this case, use the include flags as the cflags
+ echo $np_mysql_cflags | grep -- -xstrconst > /dev/null 2> /dev/null
+ if test $? -eq 0 -a "$CC" = "gcc" ; then
+ np_mysql_cflags="`$np_mysql_config --include`"
+ fi
+
+ _savedcppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $np_mysql_include"
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient" >&5
+$as_echo_n "checking for mysql_init in -lmysqlclient... " >&6; }
+if ${ac_cv_lib_mysqlclient_mysql_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmysqlclient $np_mysql_libs $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mysql_init ();
+int
+main ()
+{
+return mysql_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_mysqlclient_mysql_init=yes
+else
+ ac_cv_lib_mysqlclient_mysql_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mysqlclient_mysql_init" >&5
+$as_echo "$ac_cv_lib_mysqlclient_mysql_init" >&6; }
+if test "x$ac_cv_lib_mysqlclient_mysql_init" = xyes; then :
+
+ with_mysql=$np_mysql_config
+
+$as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h
+
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmariadbclient" >&5
+$as_echo_n "checking for mysql_init in -lmariadbclient... " >&6; }
+if ${ac_cv_lib_mariadbclient_mysql_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmariadbclient $np_mysql_libs $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mysql_init ();
+int
+main ()
+{
+return mysql_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_mariadbclient_mysql_init=yes
+else
+ ac_cv_lib_mariadbclient_mysql_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mariadbclient_mysql_init" >&5
+$as_echo "$ac_cv_lib_mariadbclient_mysql_init" >&6; }
+if test "x$ac_cv_lib_mariadbclient_mysql_init" = xyes; then :
+
+ with_mysql=$np_mysql_config
+
+$as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h
+
+
+else
+ with_mysql=no
+fi
+
+
+fi
+
+
+
+ CPPFLAGS=$_savedcppflags
+
+ fi
+ fi
+
+if test $with_mysql = "no" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping mysql plugin" >&5
+$as_echo "$as_me: WARNING: Skipping mysql plugin" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install mysql client libs to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install mysql client libs to compile this plugin (see REQUIREMENTS)." >&2;}
+else
+ EXTRAS="$EXTRAS check_mysql\$(EXEEXT) check_mysql_query\$(EXEEXT)"
+ MYSQLINCLUDE="$np_mysql_include"
+ MYSQLLIBS="$np_mysql_libs"
+ MYSQLCFLAGS="$np_mysql_cflags"
+
+
+
+fi
+
+for ac_header in utmpx.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "utmpx.h" "ac_cv_header_utmpx_h" "$ac_includes_default"
+if test "x$ac_cv_header_utmpx_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UTMPX_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test "$ac_cv_header_utmpx_h" = "yes"; then
+ HAVE_UTMPX_TRUE=
+ HAVE_UTMPX_FALSE='#'
+else
+ HAVE_UTMPX_TRUE='#'
+ HAVE_UTMPX_FALSE=
+fi
+
+
+for ac_header in wtsapi32.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "wtsapi32.h" "ac_cv_header_wtsapi32_h" "#include <windows.h>
+"
+if test "x$ac_cv_header_wtsapi32_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WTSAPI32_H 1
+_ACEOF
+
+fi
+
+done
+
+ if test "$ac_cv_header_wtsapi32_h" = "yes"; then
+ HAVE_WTS32API_TRUE=
+ HAVE_WTS32API_FALSE='#'
+else
+ HAVE_WTS32API_TRUE='#'
+ HAVE_WTS32API_FALSE=
+fi
+
+
+if test "$ac_cv_header_wtsapi32_h" = "yes"; then
+ WTSAPI32LIBS="-lwtsapi32"
+
+fi
+
+_can_enable_check_curl=no
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-libcurl was given.
+if test "${with_libcurl+set}" = set; then :
+ withval=$with_libcurl; _libcurl_with=$withval
+else
+ _libcurl_with=yes
+fi
+
+
+ if test "$_libcurl_with" != "no" ; then
+
+ for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+
+ _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
+
+ _libcurl_try_link=yes
+
+ if test -d "$_libcurl_with" ; then
+ LIBCURL_CPPFLAGS="-I$withval/include"
+ _libcurl_ldflags="-L$withval/lib"
+ # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path__libcurl_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $_libcurl_config in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in "$withval/bin"
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
+$as_echo "$_libcurl_config" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path__libcurl_config+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $_libcurl_config in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
+$as_echo "$_libcurl_config" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+
+ if test x$_libcurl_config != "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5
+$as_echo_n "checking for the version of libcurl... " >&6; }
+if ${libcurl_cv_lib_curl_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5
+$as_echo "$libcurl_cv_lib_curl_version" >&6; }
+
+ _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
+ _libcurl_wanted=`echo 7.15.2 | $_libcurl_version_parse`
+
+ if test $_libcurl_wanted -gt 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version 7.15.2" >&5
+$as_echo_n "checking for libcurl >= version 7.15.2... " >&6; }
+if ${libcurl_cv_lib_version_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $_libcurl_version -ge $_libcurl_wanted ; then
+ libcurl_cv_lib_version_ok=yes
+ else
+ libcurl_cv_lib_version_ok=no
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5
+$as_echo "$libcurl_cv_lib_version_ok" >&6; }
+ fi
+
+ if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
+ if test x"$LIBCURL_CPPFLAGS" = "x" ; then
+ LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
+ fi
+ if test x"$LIBCURL" = "x" ; then
+ LIBCURL=`$_libcurl_config --libs`
+
+ # This is so silly, but Apple actually has a bug in their
+ # curl-config script. Fixed in Tiger, but there are still
+ # lots of Panther installs around.
+ case "${host}" in
+ powerpc-apple-darwin7*)
+ LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
+ ;;
+ esac
+ fi
+
+ # All curl-config scripts support --feature
+ _libcurl_features=`$_libcurl_config --feature`
+
+ # Is it modern enough to have --protocols? (7.12.4)
+ if test $_libcurl_version -ge 461828 ; then
+ _libcurl_protocols=`$_libcurl_config --protocols`
+ fi
+ else
+ _libcurl_try_link=no
+ fi
+
+ unset _libcurl_wanted
+ fi
+
+ if test $_libcurl_try_link = yes ; then
+
+ # we didn't find curl-config, so let's see if the user-supplied
+ # link line (or failing that, "-lcurl") is enough.
+ LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5
+$as_echo_n "checking whether libcurl is usable... " >&6; }
+if ${libcurl_cv_lib_curl_usable+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ _libcurl_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+ _libcurl_save_libs=$LIBS
+ LIBS="$LIBCURL $LIBS"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <curl/curl.h>
+int
+main ()
+{
+
+/* Try and use a few common options to force a failure if we are
+ missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_WRITEDATA;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+if (x) {;}
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ libcurl_cv_lib_curl_usable=yes
+else
+ libcurl_cv_lib_curl_usable=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ CPPFLAGS=$_libcurl_save_cppflags
+ LIBS=$_libcurl_save_libs
+ unset _libcurl_save_cppflags
+ unset _libcurl_save_libs
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5
+$as_echo "$libcurl_cv_lib_curl_usable" >&6; }
+
+ if test $libcurl_cv_lib_curl_usable = yes ; then
+
+ # Does curl_free() exist in this version of libcurl?
+ # If not, fake it with free()
+
+ _libcurl_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+ _libcurl_save_libs=$LIBS
+ LIBS="$LIBS $LIBCURL"
+
+ ac_fn_c_check_func "$LINENO" "curl_free" "ac_cv_func_curl_free"
+if test "x$ac_cv_func_curl_free" = xyes; then :
+
+else
+
+$as_echo "#define curl_free free" >>confdefs.h
+
+fi
+
+
+ CPPFLAGS=$_libcurl_save_cppflags
+ LIBS=$_libcurl_save_libs
+ unset _libcurl_save_cppflags
+ unset _libcurl_save_libs
+
+
+$as_echo "#define HAVE_LIBCURL 1" >>confdefs.h
+
+
+
+
+ for _libcurl_feature in $_libcurl_features ; do
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
+_ACEOF
+
+ eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
+ done
+
+ if test "x$_libcurl_protocols" = "x" ; then
+
+ # We don't have --protocols, so just assume that all
+ # protocols are available
+ _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
+
+ if test x$libcurl_feature_SSL = xyes ; then
+ _libcurl_protocols="$_libcurl_protocols HTTPS"
+
+ # FTPS wasn't standards-compliant until version
+ # 7.11.0 (0x070b00 == 461568)
+ if test $_libcurl_version -ge 461568; then
+ _libcurl_protocols="$_libcurl_protocols FTPS"
+ fi
+ fi
+
+ # RTSP, IMAP, POP3 and SMTP were added in
+ # 7.20.0 (0x071400 == 463872)
+ if test $_libcurl_version -ge 463872; then
+ _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP"
+ fi
+ fi
+
+ for _libcurl_protocol in $_libcurl_protocols ; do
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
+_ACEOF
+
+ eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes
+ done
+ else
+ unset LIBCURL
+ unset LIBCURL_CPPFLAGS
+ fi
+ fi
+
+ unset _libcurl_try_link
+ unset _libcurl_version_parse
+ unset _libcurl_config
+ unset _libcurl_feature
+ unset _libcurl_features
+ unset _libcurl_protocol
+ unset _libcurl_protocols
+ unset _libcurl_version
+ unset _libcurl_ldflags
+ fi
+
+ if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
+ # This is the IF-NO path
+
+ _can_enable_check_curl=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping curl plugin" >&5
+$as_echo "$as_me: WARNING: Skipping curl plugin" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install libcurl libs to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install libcurl libs to compile this plugin (see REQUIREMENTS)." >&2;}
+
+ else
+ # This is the IF-YES path
+
+ _can_enable_check_curl=yes
+ LIBCURLINCLUDE="$LIBCURL_CPPFLAGS"
+ LIBCURLLIBS="$LIBCURL"
+ LIBCURLCFLAGS="$LIBCURL_CPPFLAGS"
+
+
+
+
+ fi
+
+ unset _libcurl_with
+
+
+
+
+# Check whether --with-uriparser was given.
+if test "${with_uriparser+set}" = set; then :
+ withval=$with_uriparser; _uriparser_with=$withval
+else
+ _uriparser_with=yes
+fi
+
+
+ if test "$_uriparser_with" != "no" ; then
+
+ _uriparser_try_link=yes
+
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PKGCONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PKGCONFIG"; then
+ ac_cv_prog_PKGCONFIG="$PKGCONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PKGCONFIG="pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_PKGCONFIG" && ac_cv_prog_PKGCONFIG="no"
+fi
+fi
+PKGCONFIG=$ac_cv_prog_PKGCONFIG
+if test -n "$PKGCONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5
+$as_echo "$PKGCONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ if test "x$URIPARSER" != "x" || test "x$URIPARSER_CPPFLAGS" != "x"; then
+ :
+ elif test -d "$_uriparser_with" ; then
+ URIPARSER_CPPFLAGS="-I$withval/include"
+ _uriparser_ldflags="-L$withval/lib"
+
+ elif test x$PKGCONFIG != xno; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of uriparser" >&5
+$as_echo_n "checking for the version of uriparser... " >&6; }
+if ${uriparser_cv_uriparser_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ uriparser_cv_uriparser_version=`$PKGCONFIG liburiparser --modversion`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $uriparser_cv_uriparser_version" >&5
+$as_echo "$uriparser_cv_uriparser_version" >&6; }
+
+ for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+
+ _uriparser_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
+
+ _uriparser_version=`echo $uriparser_cv_uriparser_version | $_uriparser_version_parse`
+ _uriparser_wanted=`echo 0.7.5 | $_uriparser_version_parse`
+
+ if test $_uriparser_wanted -gt 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uriparser >= version 0.7.5" >&5
+$as_echo_n "checking for uriparser >= version 0.7.5... " >&6; }
+if ${uriparser_cv_lib_version_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $_uriparser_version -ge $_uriparser_wanted ; then
+ uriparser_cv_lib_version_ok=yes
+ else
+ uriparser_cv_lib_version_ok=no
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $uriparser_cv_lib_version_ok" >&5
+$as_echo "$uriparser_cv_lib_version_ok" >&6; }
+ fi
+
+ if test $_uriparser_wanted -eq 0 || test x$uriparser_cv_lib_version_ok = xyes ; then
+ if test x"$URIPARSER_CPPFLAGS" = "x" ; then
+ URIPARSER_CPPFLAGS=`$PKGCONFIG liburiparser --cflags`
+ fi
+ if test x"$URIPARSER" = "x" ; then
+ URIPARSER=`$PKGCONFIG liburiparser --libs`
+ fi
+ else
+ _uriparser_try_link=no
+ fi
+
+ unset _uriparser_wanted
+ else
+ URIPARSER_CPPFLAGS="-I/usr/include"
+ URIPARSER="-luriparser -L/usr/lib -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/i686-linux-gnu"
+ fi
+
+ if test $_uriparser_try_link = yes ; then
+
+ # let's see if the user-supplied
+ # link line (or failing that, "-luriparser") is enough.
+ URIPARSER=${URIPARSER-"$_uriparser_ldflags -luriparser"}
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uriparser is usable" >&5
+$as_echo_n "checking whether uriparser is usable... " >&6; }
+if ${uriparser_cv_lib_uriparser_usable+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ _liburiparser_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS"
+ _liburiparser_save_libs=$LIBS
+ LIBS="$URIPARSER $LIBS"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <uriparser/Uri.h>
+int
+main ()
+{
+
+/* Try and use a few common options to force a failure if we are
+ missing symbols or cannot link. */
+UriParserStateA state;
+UriUriA uri;
+state.uri = &uri;
+char *location = "http://test.dom/dir/file.ext";
+int x = uriParseUriA (&state, location);
+if (x == URI_SUCCESS) {;}
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ uriparser_cv_lib_uriparser_usable=yes
+else
+ uriparser_cv_lib_uriparser_usable=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ CPPFLAGS=$_liburiparser_save_cppflags
+ LIBS=$_liburiparser_save_libs
+ unset _liburiparser_save_cppflags
+ unset _liburiparser_save_libs
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $uriparser_cv_lib_uriparser_usable" >&5
+$as_echo "$uriparser_cv_lib_uriparser_usable" >&6; }
+
+ if test $uriparser_cv_lib_uriparser_usable = yes ; then
+
+$as_echo "#define HAVE_URIPARSER 1" >>confdefs.h
+
+
+
+ else
+ unset URIPARSER
+ unset URIPARSER_CPPFLAGS
+ fi
+ fi
+
+ unset _uriparser_try_link
+ unset _uriparser_version_parse
+ unset _uriparser_version
+ unset _uriparser_ldflags
+ fi
+
+ if test x$_uriparser_with = xno || test x$uriparser_cv_lib_uriparser_usable != xyes ; then
+ # This is the IF-NO path
+
+ _can_enable_check_curl=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping curl plugin" >&5
+$as_echo "$as_me: WARNING: Skipping curl plugin" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: install the uriparser library to compile this plugin (see REQUIREMENTS)." >&5
+$as_echo "$as_me: WARNING: install the uriparser library to compile this plugin (see REQUIREMENTS)." >&2;}
+
+ else
+ # This is the IF-YES path
+
+ URIPARSERINCLUDE="$URIPARSER_CPPFLAGS"
+ URIPARSERLIBS="$URIPARSER"
+ URIPARSERCFLAGS="$URIPARSER_CPPFLAGS"
+
+
+
+
+ fi
+
+ unset _uriparser_with
+
+
+if test x$_can_enable_check_curl = xyes; then
+ EXTRAS="$EXTRAS check_curl\$(EXEEXT)"
+fi
+ac_config_files="$ac_config_files plugins/picohttpparser/Makefile"
+
+
+if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no"
+then
+ # Extract the first word of "who", so it can be a program name with args.
+set dummy who; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_WHO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_WHO in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_WHO="$PATH_TO_WHO" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_WHO="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_WHO=$ac_cv_path_PATH_TO_WHO
+if test -n "$PATH_TO_WHO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_WHO" >&5
+$as_echo "$PATH_TO_WHO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ if $PATH_TO_WHO -q 2>/dev/null | grep -E -i "^# users=[0-9]+$" >/dev/null
+ then
+ ac_cv_path_to_who="$PATH_TO_WHO -q"
+ else
+ ac_cv_path_to_who="$PATH_TO_WHO"
+ fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define WHO_COMMAND "$ac_cv_path_to_who"
+_ACEOF
+
+fi
+
+
+# Check whether --with-ipv6 was given.
+if test "${with_ipv6+set}" = set; then :
+ withval=$with_ipv6;
+else
+ with_ipv6=check
+fi
+
+
+if test "$with_ipv6" != "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 support" >&5
+$as_echo_n "checking for IPv6 support... " >&6; }
+if ${np_cv_sys_ipv6+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+int
+main ()
+{
+struct sockaddr_in6 sin6;
+ void *p;
+
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = 587;
+ p = &sin6.sin6_addr;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ np_cv_sys_ipv6=yes
+else
+ np_cv_sys_ipv6=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $np_cv_sys_ipv6" >&5
+$as_echo "$np_cv_sys_ipv6" >&6; }
+ if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "--with-ipv6 was given, but test for IPv6 support failed
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ if test "$np_cv_sys_ipv6" = "yes"; then
+
+$as_echo "#define USE_IPV6 1" >>confdefs.h
+
+ fi
+ with_ipv6="$np_cv_sys_ipv6"
+fi
+
+
+for ac_header in krb5.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "krb5.h" "ac_cv_header_krb5_h" "$ac_includes_default"
+if test "x$ac_cv_header_krb5_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_H 1
+_ACEOF
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+done
+
+if test "$FOUNDINCLUDE" = "no"; then
+ _SAVEDCPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
+ unset ac_cv_header_krb5_h
+ for ac_header in krb5.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "krb5.h" "ac_cv_header_krb5_h" "$ac_includes_default"
+if test "x$ac_cv_header_krb5_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_H 1
+_ACEOF
+ KRB5INCLUDE="-I/usr/kerberos/include"
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+done
+
+fi
+
+if test "$FOUNDINCLUDE" = "no"; then
+ CPPFLAGS="$_SAVEDCPPFLAGS"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+
+ LIBS="-ldl $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldl" >&5
+$as_echo_n "checking for shl_load in -ldl... " >&6; }
+if ${ac_cv_lib_dl_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_shl_load=yes
+else
+ ac_cv_lib_dl_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_shl_load" >&5
+$as_echo "$ac_cv_lib_dl_shl_load" >&6; }
+if test "x$ac_cv_lib_dl_shl_load" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+
+ LIBS="-ldl $LIBS"
+
+fi
+
+
+if ! test x"$with_openssl" = x"no"; then
+ if ! test -d "$with_openssl"; then
+ for d in $OPENSSL_DIRS; do
+ if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
+ with_openssl=$d
+ fi
+ done
+ fi
+
+ _SAVEDCPPFLAGS="$CPPFLAGS"
+ _SAVEDLDFLAGS="$LDFLAGS"
+ unset FOUNDINCLUDE
+ if test x"$with_openssl" != x"/usr" ; then
+ CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
+ LDFLAGS="$LDFLAGS -L$with_openssl/lib"
+ fi
+
+ for ac_header in openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ SSLINCLUDE="-I$with_openssl/include"
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+done
+
+ if test "$FOUNDINCLUDE" = "no"; then
+ for ac_header in ssl.h x509.h rsa.h pem.h crypto.h err.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ SSLINCLUDE="-I$with_openssl/include"
+ FOUNDINCLUDE=yes
+else
+ FOUNDINCLUDE=no
+fi
+
+done
+
+ fi
+
+ if test "$FOUNDINCLUDE" = "no"; then
+ CPPFLAGS="$_SAVEDCPPFLAGS"
+ LDFLAGS="$_SAVEDLDFLAGS"
+ fi
+
+ _SAVEDLIBS="$LIBS"
+ LIBS="-L${with_openssl}/lib"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
+$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char CRYPTO_new_ex_data ();
+int
+main ()
+{
+return CRYPTO_new_ex_data ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
+else
+ ac_cv_lib_crypto_CRYPTO_new_ex_data=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
+$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; }
+if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
+
+ LIBS="-lcrypto $LIBS"
+
+fi
+
+ if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lssl" >&5
+$as_echo_n "checking for main in -lssl... " >&6; }
+if ${ac_cv_lib_ssl_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl -lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ssl_main=yes
+else
+ ac_cv_lib_ssl_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_main" >&5
+$as_echo "$ac_cv_lib_ssl_main" >&6; }
+if test "x$ac_cv_lib_ssl_main" = xyes; then :
+ SSLLIBS="-lssl -lcrypto"
+fi
+
+ fi
+ LIBS="$_SAVEDLIBS"
+
+ if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
+ if test "$ac_cv_lib_ssl_main" = "yes"; then
+ if test "$FOUNDINCLUDE" = "yes"; then
+ FOUNDOPENSSL="yes"
+ fi
+ fi
+ fi
+fi
+
+
+if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
+ if test ! "$with_gnutls" = ""; then
+ CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
+ fi
+ for ac_header in gnutls/openssl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "gnutls/openssl.h" "ac_cv_header_gnutls_openssl_h" "$ac_includes_default"
+if test "x$ac_cv_header_gnutls_openssl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GNUTLS_OPENSSL_H 1
+_ACEOF
+ FOUNDGNUTLS="yes"
+fi
+
+done
+
+ if test "$FOUNDGNUTLS" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgnutls-openssl" >&5
+$as_echo_n "checking for main in -lgnutls-openssl... " >&6; }
+if ${ac_cv_lib_gnutls_openssl_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgnutls-openssl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_gnutls_openssl_main=yes
+else
+ ac_cv_lib_gnutls_openssl_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_openssl_main" >&5
+$as_echo "$ac_cv_lib_gnutls_openssl_main" >&6; }
+if test "x$ac_cv_lib_gnutls_openssl_main" = xyes; then :
+ SSLLIBS="-lgnutls-openssl"
+fi
+
+ fi
+fi
+
+if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
+ check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
+
+
+
+$as_echo "#define HAVE_SSL 1" >>confdefs.h
+
+ if test "$FOUNDOPENSSL" = "yes"; then
+
+$as_echo "#define USE_OPENSSL 1" >>confdefs.h
+
+ with_openssl="yes"
+ with_gnutls="no"
+ else
+
+$as_echo "#define USE_GNUTLS 1" >>confdefs.h
+
+ with_gnutls="yes"
+ with_openssl="no"
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OpenSSL or GnuTLS libs could not be found or were disabled" >&5
+$as_echo "$as_me: WARNING: OpenSSL or GnuTLS libs could not be found or were disabled" >&2;}
+ with_openssl="no"
+ with_gnutls="no"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
+$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
+if ${ac_cv_header_sys_wait_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_sys_wait_h=yes
+else
+ ac_cv_header_sys_wait_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
+$as_echo "$ac_cv_header_sys_wait_h" >&6; }
+if test $ac_cv_header_sys_wait_h = yes; then
+
+$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+for ac_header in signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in features.h stdarg.h sys/unistd.h ctype.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this sort of thing. */
+ typedef int charset[2];
+ const charset cs = { 0, 0 };
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default
+"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #if defined _WIN64 && !defined __CYGWIN__
+ LLP64
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_pid_type='int'
+else
+ gl_pid_type='__int64'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t $gl_pid_type
+_ACEOF
+
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
+$as_echo_n "checking for va_copy... " >&6; }
+if ${ac_cv_HAVE_VA_COPY+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+va_list ap1,ap2;
+int
+main ()
+{
+va_copy(ap1,ap2);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_HAVE_VA_COPY=yes
+else
+ ac_cv_HAVE_VA_COPY=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE_VA_COPY" >&5
+$as_echo "$ac_cv_HAVE_VA_COPY" >&6; }
+if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
+
+$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5
+$as_echo_n "checking for __va_copy... " >&6; }
+if ${ac_cv_HAVE___VA_COPY+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+ va_list ap1,ap2;
+int
+main ()
+{
+__va_copy(ap1,ap2);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_HAVE___VA_COPY=yes
+else
+ ac_cv_HAVE___VA_COPY=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_HAVE___VA_COPY" >&5
+$as_echo "$ac_cv_HAVE___VA_COPY" >&6; }
+ if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
+
+$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h
+
+ fi
+fi
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+int
+main ()
+{
+struct timeval *tv;
+ struct timezone *tz;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h
+
+ FOUND_STRUCT_TIMEVAL="yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+int
+main ()
+{
+struct timeval *tv;
+ struct timezone *tz;
+ gettimeofday(tv, tz);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+
+else
+
+$as_echo "#define NEED_GETTIMEOFDAY 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+for ac_func in memmove select socket strdup strstr strtol strtoul floor
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+for ac_func in poll
+do :
+ ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll"
+if test "x$ac_cv_func_poll" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_POLL 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of socket size" >&5
+$as_echo_n "checking return type of socket size... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+int
+main ()
+{
+int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_socket_size_type="size_t"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t" >&5
+$as_echo "size_t" >&6; }
+else
+ ac_cv_socket_size_type="int"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: int" >&5
+$as_echo "int" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+cat >>confdefs.h <<_ACEOF
+#define SOCKET_SIZE_TYPE $ac_cv_socket_size_type
+_ACEOF
+
+
+
+
+# Extract the first word of "ps", so it can be a program name with args.
+set dummy ps; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_PS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_PS in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_PS="$PATH_TO_PS" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_PS="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_PS=$ac_cv_path_PATH_TO_PS
+if test -n "$PATH_TO_PS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_PS" >&5
+$as_echo "$PATH_TO_PS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "env", so it can be a program name with args.
+set dummy env; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_ENV+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_ENV in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_ENV="$PATH_TO_ENV" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_ENV="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_ENV=$ac_cv_path_PATH_TO_ENV
+if test -n "$PATH_TO_ENV"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_ENV" >&5
+$as_echo "$PATH_TO_ENV" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ps syntax" >&5
+$as_echo_n "checking for ps syntax... " >&6; }
+
+# Check whether --with-ps_command was given.
+if test "${with_ps_command+set}" = set; then :
+ withval=$with_ps_command; PS_COMMAND=$withval
+fi
+
+
+# Check whether --with-ps_format was given.
+if test "${with_ps_format+set}" = set; then :
+ withval=$with_ps_format; PS_FORMAT=$withval
+fi
+
+
+# Check whether --with-ps_cols was given.
+if test "${with_ps_cols+set}" = set; then :
+ withval=$with_ps_cols; PS_COLS=$withval
+fi
+
+
+# Check whether --with-ps_varlist was given.
+if test "${with_ps_varlist+set}" = set; then :
+ withval=$with_ps_varlist; PS_VARLIST=$withval
+fi
+
+
+if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
+ ac_cv_ps_command="$PS_COMMAND"
+ ac_cv_ps_format="$PS_FORMAT"
+ ac_cv_ps_varlist="$PS_VARLIST"
+ ac_cv_ps_cols="$PS_COLS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: (command-line) $ac_cv_ps_command" >&5
+$as_echo "(command-line) $ac_cv_ps_command" >&6; }
+
+elif test "$ac_cv_uname_s" = "SunOS"; then
+ #
+ # this is a very, very ugly hack, to hardcode the location for plugins
+ #
+ if test "$libexecdir" = '${exec_prefix}/libexec'; then
+ if test "$exec_prefix" = "NONE"; then
+ if test "$prefix" = "NONE"; then
+ pst3="$ac_default_prefix/libexec/pst3"
+ else
+ pst3="$prefix/libexec/pst3"
+ fi
+ else
+ pst3="$exec_prefix/libexec/pst3"
+ fi
+ else
+ pst3="$libexecdir/pst3"
+ fi
+ ac_cv_ps_command="$pst3"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using monitoring-plugins internal ps command (pst3) for solaris" >&5
+$as_echo "using monitoring-plugins internal ps command (pst3) for solaris" >&6; }
+ if test `isainfo -b` = 64 ; then
+ pst3_use_64bit=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using 64bit pst3" >&5
+$as_echo "$as_me: using 64bit pst3" >&6;}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using 32bit pst3" >&5
+$as_echo "$as_me: using 32bit pst3" >&6;}
+ fi
+ EXTRAS_ROOT="$EXTRAS_ROOT pst3\$(EXEEXT)"
+
+ if test "$pst3_use_64bit" = 1; then
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ pst3_64bit_working=0
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+return sizeof(void*) == 8 ? 0 : 1;
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+ PST3CFLAGS="-m64"
+
+ pst3_64bit_working=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using -m64 for 64bit code" >&5
+$as_echo "$as_me: using -m64 for 64bit code" >&6;}
+
+else
+
+ pst3_64bit_working=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: compiler do not like -m64" >&5
+$as_echo "$as_me: compiler do not like -m64" >&6;}
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ CFLAGS=$old_cflags
+ if test "$pst3_64bit_working" = 0; then
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -xarch=v9"
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+return sizeof(void*) == 8 ? 0 : 1;
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+ PST3CFLAGS="-xarch=v9"
+
+ pst3_64bit_working=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using -xarch=v9 for 64bit code" >&5
+$as_echo "$as_me: using -xarch=v9 for 64bit code" >&6;}
+
+else
+
+ pst3_64bit_working=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: compiler do not like -xarch=v9" >&5
+$as_echo "$as_me: compiler do not like -xarch=v9" >&6;}
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ CFLAGS=$old_cflags
+ fi
+ if test "$pst3_64bit_working" = 0; then
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -xarch=amd64"
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+return sizeof(void*) == 8 ? 0 : 1;
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+ PST3CFLAGS="-xarch=amd64"
+
+ pst3_64bit_working=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using -xarch=amd64 for 64bit code" >&5
+$as_echo "$as_me: using -xarch=amd64 for 64bit code" >&6;}
+
+else
+
+ pst3_64bit_working=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: compiler do not like -xarch=amd64" >&5
+$as_echo "$as_me: compiler do not like -xarch=amd64" >&6;}
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ CFLAGS=$old_cflags
+ fi
+ if test "$pst3_64bit_working" = 0; then
+ as_fn_error $? "I don't know how to build a 64-bit object!" "$LINENO" 5
+ fi
+ fi
+
+
+elif ps axwo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
+ grep -E -i "^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +ELAPSED +COMMAND" > /dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu etime comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
+ ac_cv_ps_cols=10
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i "^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND" > /dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i "^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND" > /dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
+ grep -E -i "^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND" > /dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
+ grep -E -i "^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
+ ac_cv_ps_cols=10
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
+ grep -E -i "^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i "^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -laxnwww 2>/dev/null | head -1 | \
+ grep -E -i "^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND" >/dev/null
+then
+ ac_cv_ps_varlist="&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog"
+ ac_cv_ps_command="$PATH_TO_PS -laxnwww"
+ ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps laxnwww 2>/dev/null | \
+ grep -E -i "^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND" >/dev/null
+then
+ ac_cv_ps_varlist="&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog"
+ ac_cv_ps_command="$PATH_TO_PS laxnwww"
+ ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i "^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
+ grep -E -i "^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+" > /dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos"
+ ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
+ ac_cv_ps_format="%s%*[ +<>] %d %d %d %f %s %s %n"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i "^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
+ grep -E -i "^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command - with no RSS" >&5
+$as_echo "$ac_cv_ps_command - with no RSS" >&6; }
+
+elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
+ # There must be no space between the %s and %n due to a weird problem in sscanf where
+ # it will return %n as longer than the line length
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
+ grep -E -i "^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -el 2>/dev/null | \
+ grep -E -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog"
+ ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -el 2>/dev/null | \
+ grep -E -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&pos,procprog"
+ ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
+ ac_cv_ps_cols=6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif env UNIX95=1 ps -eo 'state uid ruid user ruser pid ppid vsz pcpu comm args' 2>/dev/null | head -n 1 | \
+ grep -E -i "^ *S +UID +RUID +USER +RUSER +PID +PPID +VSZ +%CPU +COMMAND +COMMAND" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos"
+ ac_cv_ps_command="$PATH_TO_ENV UNIX95=1 $PATH_TO_PS -eo 'state uid pid ppid vsz pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -el 2>/dev/null | \
+ grep -E -i "^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&pos,procprog"
+ ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
+ ac_cv_ps_cols=6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps glaxen 2>/dev/null | \
+ grep -E -i "^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND" >/dev/null
+then
+ ac_cv_ps_varlist="&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog"
+ ac_cv_ps_command="$PATH_TO_PS glaxen"
+ ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
+ grep -E -i "^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND" >/dev/null
+then
+ ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
+ ac_cv_ps_varlist="procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+elif ps -Al 2>/dev/null | \
+ grep -E -i "^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD" >/dev/null
+then
+ ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&pos,procprog"
+ ac_cv_ps_command="$PATH_TO_PS -Al"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
+ ac_cv_ps_cols=8
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ps_command" >&5
+$as_echo "$ac_cv_ps_command" >&6; }
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to find usable ps syntax - check_procs and check_nagios will not be compiled" >&5
+$as_echo "$as_me: WARNING: unable to find usable ps syntax - check_procs and check_nagios will not be compiled" >&2;}
+fi
+
+if test -n "$ac_cv_ps_varlist" ; then
+
+cat >>confdefs.h <<_ACEOF
+#define PS_VARLIST $ac_cv_ps_varlist
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PS_COMMAND "$ac_cv_ps_command"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PS_FORMAT "$ac_cv_ps_format"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PS_COLS $ac_cv_ps_cols
+_ACEOF
+
+ EXTRAS="$EXTRAS check_procs check_nagios\$(EXEEXT)"
+ if echo "$ac_cv_ps_varlist" | grep "procetime" >/dev/null; then
+
+$as_echo "#define PS_USES_PROCETIME \"yes\"" >>confdefs.h
+
+ fi
+ if echo "$ac_cv_ps_varlist" | grep "procpcpu" >/dev/null; then
+
+$as_echo "#define PS_USES_PROCPCPU \"yes\"" >>confdefs.h
+
+ fi
+fi
+
+# Extract the first word of "ping", so it can be a program name with args.
+set dummy ping; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_PING+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_PING in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_PING="$PATH_TO_PING" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_PING="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_PING=$ac_cv_path_PATH_TO_PING
+if test -n "$PATH_TO_PING"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_PING" >&5
+$as_echo "$PATH_TO_PING" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "ping6", so it can be a program name with args.
+set dummy ping6; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_PING6+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_PING6 in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_PING6="$PATH_TO_PING6" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_PING6="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_PING6=$ac_cv_path_PATH_TO_PING6
+if test -n "$PATH_TO_PING6"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_PING6" >&5
+$as_echo "$PATH_TO_PING6" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+# Check whether --with-ping_command was given.
+if test "${with_ping_command+set}" = set; then :
+ withval=$with_ping_command; with_ping_command=$withval
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICMP ping syntax" >&5
+$as_echo_n "checking for ICMP ping syntax... " >&6; }
+ac_cv_ping_packets_first=no
+ac_cv_ping_has_timeout=no
+if test -n "$with_ping_command"
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: (command-line) $with_ping_command" >&5
+$as_echo "(command-line) $with_ping_command" >&6; }
+ if echo "$with_ping_command" | grep '%d.*%d.*%s' >/dev/null
+ then
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ elif echo "$with_ping_command" | grep '%d.*%s.*%d' >/dev/null || \
+ echo "$with_ping_command" | grep '%s.*%d.*%d' >/dev/null
+ then
+ ac_cv_ping_has_timeout=yes
+ elif echo "$with_ping_command" | grep '%d.*%s' >/dev/null
+ then
+ ac_cv_ping_packets_first=yes
+ fi
+
+elif [ "z$ac_cv_uname_o" = "zCygwin" ]
+then
+ with_ping_command="$PATH_TO_PING -n %d -w %d000 %s"
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif [ "z$ac_cv_uname_s" = "zUnixWare" ] && \
+ $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -U -c %d %s"
+ ac_cv_ping_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -4 -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ # check if -4 is supported - issue #1550
+ with_ping_command="$PATH_TO_PING -4 -n -U -w %d -c %d %s"
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -U -c %d %s"
+ ac_cv_ping_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -c %d %s"
+ ac_cv_ping_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n %s -c %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING %s -n %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
+ ac_cv_ping_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -c %d %s"
+ ac_cv_ping_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to find usable ping syntax" >&5
+$as_echo "$as_me: WARNING: unable to find usable ping syntax" >&2;}
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define PING_COMMAND "$with_ping_command"
+_ACEOF
+
+
+if test "x$ac_cv_ping_packets_first" != "xno"
+then
+
+$as_echo "#define PING_PACKETS_FIRST 1" >>confdefs.h
+
+fi
+
+if test "x$ac_cv_ping_has_timeout" != "xno"
+then
+
+$as_echo "#define PING_HAS_TIMEOUT 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-ping6_command was given.
+if test "${with_ping6_command+set}" = set; then :
+ withval=$with_ping6_command; with_ping6_command=$withval
+fi
+
+
+if test x"$with_ipv6" != xno ; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICMPv6 ping syntax" >&5
+$as_echo_n "checking for ICMPv6 ping syntax... " >&6; }
+ac_cv_ping6_packets_first=no
+if test -n "$with_ping6_command"
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: (command-line) $with_ping6_command" >&5
+$as_echo "(command-line) $with_ping6_command" >&6; }
+ if echo "$with_ping6_command" | grep '%d.*%d.*%s' >/dev/null
+ then
+ ac_cv_ping6_packets_first=yes
+ elif echo "$with_ping6_command" | grep '%d.*%s.*%d' >/dev/null || \
+ echo "$with_ping6_command" | grep '%s.*%d.*%d' >/dev/null
+ then
+ # Just keep same logic as ping (IPv4) if we ever need ac_cv_ping6_has_timeout
+ true
+ elif echo "$with_ping6_command" | grep '%d.*%s' >/dev/null
+ then
+ ac_cv_ping6_packets_first=yes
+ fi
+elif [ "z$ac_cv_uname_o" = "zCygwin" -a "x$PATH_TO_PING" != "x" ]; then
+ with_ping6_command="$PATH_TO_PING -6 -n %d -w %d000 %s"
+ ac_cv_ping6_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+elif test "x$PATH_TO_PING6" != "x"; then
+ if [ "z$ac_cv_uname_s" = "zUnixWare" ] && \
+ $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 %s -n %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+ elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ fi
+
+elif test "x$PATH_TO_PING" != "x"; then
+ if [ "z$ac_cv_uname_s" = "zUnixWare" ] && \
+ $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping_command" >&5
+$as_echo "$with_ping_command" >&6; }
+
+ elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ping6_command" >&5
+$as_echo "$with_ping6_command" >&6; }
+
+ fi
+
+fi
+
+if test "x$with_ping6_command" != "x"; then
+
+cat >>confdefs.h <<_ACEOF
+#define PING6_COMMAND "$with_ping6_command"
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+
+if test "x$ac_cv_ping6_packets_first" != "xno"; then
+
+$as_echo "#define PING6_PACKETS_FIRST 1" >>confdefs.h
+
+fi
+fi
+
+
+
+# Check whether --with-nslookup_command was given.
+if test "${with_nslookup_command+set}" = set; then :
+ withval=$with_nslookup_command; ac_cv_nslookup_command=$withval
+fi
+
+if test -n "$ac_cv_nslookup_command"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using specific nslookup at $ac_cv_nslookup_command" >&5
+$as_echo "$as_me: Using specific nslookup at $ac_cv_nslookup_command" >&6;}
+else
+ # Extract the first word of "nslookup", so it can be a program name with args.
+set dummy nslookup; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_NSLOOKUP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_NSLOOKUP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_NSLOOKUP="$PATH_TO_NSLOOKUP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_NSLOOKUP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_NSLOOKUP=$ac_cv_path_PATH_TO_NSLOOKUP
+if test -n "$PATH_TO_NSLOOKUP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_NSLOOKUP" >&5
+$as_echo "$PATH_TO_NSLOOKUP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -n "$PATH_TO_NSLOOKUP"
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nslookup syntax" >&5
+$as_echo_n "checking for nslookup syntax... " >&6; }
+ if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep "Invalid option: sil" >/dev/null
+ then
+ ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nslookup_command" >&5
+$as_echo "$ac_cv_nslookup_command" >&6; }
+
+ else
+ ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nslookup_command" >&5
+$as_echo "$ac_cv_nslookup_command" >&6; }
+
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: nslookup command not found" >&5
+$as_echo "$as_me: WARNING: nslookup command not found" >&2;}
+ fi
+fi
+
+if test -n "$ac_cv_nslookup_command"; then
+ EXTRAS="$EXTRAS check_dns\$(EXEEXT)"
+
+cat >>confdefs.h <<_ACEOF
+#define NSLOOKUP_COMMAND "$ac_cv_nslookup_command"
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of online cpus" >&5
+$as_echo_n "checking for number of online cpus... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+int
+main ()
+{
+sysconf(_SC_NPROCESSORS_ONLN) > 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_SYSCONF__SC_NPROCESSORS_ONLN 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: sysconf(_SC_NPROCESSORS_ONLN)" >&5
+$as_echo "sysconf(_SC_NPROCESSORS_ONLN)" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot calculate" >&5
+$as_echo "cannot calculate" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of available cpus" >&5
+$as_echo_n "checking for number of available cpus... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+int
+main ()
+{
+sysconf(_SC_NPROCESSORS_CONF) > 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_SYSCONF__SC_NPROCESSORS_CONF 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: sysconf(_SC_NPROCESSORS_CONF)" >&5
+$as_echo "sysconf(_SC_NPROCESSORS_CONF)" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot calculate" >&5
+$as_echo "cannot calculate" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+# Extract the first word of "uptime", so it can be a program name with args.
+set dummy uptime; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_UPTIME+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_UPTIME in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_UPTIME="$PATH_TO_UPTIME" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_UPTIME="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_UPTIME=$ac_cv_path_PATH_TO_UPTIME
+if test -n "$PATH_TO_UPTIME"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_UPTIME" >&5
+$as_echo "$PATH_TO_UPTIME" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-uptime_command was given.
+if test "${with_uptime_command+set}" = set; then :
+ withval=$with_uptime_command; PATH_TO_UPTIME=$withval
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_UPTIME "$PATH_TO_UPTIME"
+_ACEOF
+
+
+# Extract the first word of "rpcinfo", so it can be a program name with args.
+set dummy rpcinfo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_RPCINFO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_RPCINFO in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_RPCINFO="$PATH_TO_RPCINFO" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_RPCINFO="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_RPCINFO=$ac_cv_path_PATH_TO_RPCINFO
+if test -n "$PATH_TO_RPCINFO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_RPCINFO" >&5
+$as_echo "$PATH_TO_RPCINFO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-rpcinfo_command was given.
+if test "${with_rpcinfo_command+set}" = set; then :
+ withval=$with_rpcinfo_command; PATH_TO_RPCINFO=$withval
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_RPCINFO "$PATH_TO_RPCINFO"
+_ACEOF
+
+
+# Extract the first word of "lmstat", so it can be a program name with args.
+set dummy lmstat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_LMSTAT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_LMSTAT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_LMSTAT="$PATH_TO_LMSTAT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_LMSTAT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_LMSTAT=$ac_cv_path_PATH_TO_LMSTAT
+if test -n "$PATH_TO_LMSTAT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_LMSTAT" >&5
+$as_echo "$PATH_TO_LMSTAT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test -x "$PATH_TO_LMSTAT"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_LMSTAT "$PATH_TO_LMSTAT"
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Get lmstat from Globetrotter Software to monitor flexlm licenses" >&5
+$as_echo "$as_me: WARNING: Get lmstat from Globetrotter Software to monitor flexlm licenses" >&2;}
+fi
+
+# Extract the first word of "smbclient", so it can be a program name with args.
+set dummy smbclient; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_SMBCLIENT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_SMBCLIENT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_SMBCLIENT="$PATH_TO_SMBCLIENT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_SMBCLIENT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_SMBCLIENT=$ac_cv_path_PATH_TO_SMBCLIENT
+if test -n "$PATH_TO_SMBCLIENT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_SMBCLIENT" >&5
+$as_echo "$PATH_TO_SMBCLIENT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-smbclient_command was given.
+if test "${with_smbclient_command+set}" = set; then :
+ withval=$with_smbclient_command; PATH_TO_SMBCLIENT=$withval
+fi
+
+if test -n "$PATH_TO_SMBCLIENT"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_SMBCLIENT "$PATH_TO_SMBCLIENT"
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Get smbclient from Samba.org to monitor SMB shares" >&5
+$as_echo "$as_me: WARNING: Get smbclient from Samba.org to monitor SMB shares" >&2;}
+fi
+
+# Extract the first word of "snmpget", so it can be a program name with args.
+set dummy snmpget; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_SNMPGET+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_SNMPGET in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_SNMPGET="$PATH_TO_SNMPGET" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_SNMPGET="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_SNMPGET=$ac_cv_path_PATH_TO_SNMPGET
+if test -n "$PATH_TO_SNMPGET"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_SNMPGET" >&5
+$as_echo "$PATH_TO_SNMPGET" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-snmpget_command was given.
+if test "${with_snmpget_command+set}" = set; then :
+ withval=$with_snmpget_command; PATH_TO_SNMPGET=$withval
+fi
+
+if test -n "$PATH_TO_SNMPGET"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_SNMPGET "$PATH_TO_SNMPGET"
+_ACEOF
+
+ EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins" >&5
+$as_echo "$as_me: WARNING: Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins" >&2;}
+fi
+
+# Extract the first word of "snmpgetnext", so it can be a program name with args.
+set dummy snmpgetnext; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_SNMPGETNEXT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_SNMPGETNEXT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_SNMPGETNEXT="$PATH_TO_SNMPGETNEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_SNMPGETNEXT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_SNMPGETNEXT=$ac_cv_path_PATH_TO_SNMPGETNEXT
+if test -n "$PATH_TO_SNMPGETNEXT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_SNMPGETNEXT" >&5
+$as_echo "$PATH_TO_SNMPGETNEXT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-snmpgetnext_command was given.
+if test "${with_snmpgetnext_command+set}" = set; then :
+ withval=$with_snmpgetnext_command; PATH_TO_SNMPGETNEXT=$withval
+fi
+
+if test -n "$PATH_TO_SNMPGETNEXT"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_SNMPGETNEXT "$PATH_TO_SNMPGETNEXT"
+_ACEOF
+
+fi
+
+if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Net::SNMP perl module" >&5
+$as_echo_n "checking for Net::SNMP perl module... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins" >&5
+$as_echo "$as_me: WARNING: Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins" >&2;}
+fi
+
+# Extract the first word of "quakestat", so it can be a program name with args.
+set dummy quakestat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_QUAKESTAT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_QUAKESTAT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_QUAKESTAT="$PATH_TO_QUAKESTAT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_QUAKESTAT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_QUAKESTAT=$ac_cv_path_PATH_TO_QUAKESTAT
+if test -n "$PATH_TO_QUAKESTAT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_QUAKESTAT" >&5
+$as_echo "$PATH_TO_QUAKESTAT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "qstat", so it can be a program name with args.
+set dummy qstat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_QSTAT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_QSTAT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_QSTAT="$PATH_TO_QSTAT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_QSTAT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_QSTAT=$ac_cv_path_PATH_TO_QSTAT
+if test -n "$PATH_TO_QSTAT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_QSTAT" >&5
+$as_echo "$PATH_TO_QSTAT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-qstat_command was given.
+if test "${with_qstat_command+set}" = set; then :
+ withval=$with_qstat_command; PATH_TO_QSTAT=$withval
+fi
+
+
+if test -x "$PATH_TO_QUAKESTAT"
+then
+ ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
+ EXTRAS="$EXTRAS check_game\$(EXEEXT)"
+
+elif test -n "$PATH_TO_QSTAT"
+then
+ ac_cv_path_to_qstat="$PATH_TO_QSTAT"
+ EXTRAS="$EXTRAS check_game\$(EXEEXT)"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin" >&5
+$as_echo "$as_me: WARNING: Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin" >&2;}
+fi
+
+if test $ac_cv_path_to_qstat
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_QSTAT "$ac_cv_path_to_qstat"
+_ACEOF
+
+fi
+
+# Extract the first word of "fping", so it can be a program name with args.
+set dummy fping; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_FPING+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_FPING in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_FPING="$PATH_TO_FPING" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_FPING="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_FPING=$ac_cv_path_PATH_TO_FPING
+if test -n "$PATH_TO_FPING"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_FPING" >&5
+$as_echo "$PATH_TO_FPING" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "fping6", so it can be a program name with args.
+set dummy fping6; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_FPING6+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_FPING6 in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_FPING6="$PATH_TO_FPING6" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_FPING6="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_FPING6=$ac_cv_path_PATH_TO_FPING6
+if test -n "$PATH_TO_FPING6"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_FPING6" >&5
+$as_echo "$PATH_TO_FPING6" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+# Check whether --with-fping_command was given.
+if test "${with_fping_command+set}" = set; then :
+ withval=$with_fping_command; PATH_TO_FPING=$withval
+fi
+
+
+# Check whether --with-fping6_command was given.
+if test "${with_fping6_command+set}" = set; then :
+ withval=$with_fping6_command; PATH_TO_FPING6=$withval
+fi
+
+
+if test -n "$PATH_TO_FPING"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_FPING "$PATH_TO_FPING"
+_ACEOF
+
+ EXTRAS="$EXTRAS check_fping\$(EXEEXT)"
+ if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_FPING6 "$PATH_TO_FPING6"
+_ACEOF
+
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Get fping from http://www.fping.com in order to make check_fping plugin" >&5
+$as_echo "$as_me: WARNING: Get fping from http://www.fping.com in order to make check_fping plugin" >&2;}
+fi
+
+# Extract the first word of "ssh", so it can be a program name with args.
+set dummy ssh; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_SSH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_SSH in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_SSH="$PATH_TO_SSH" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_SSH="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_SSH=$ac_cv_path_PATH_TO_SSH
+if test -n "$PATH_TO_SSH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_SSH" >&5
+$as_echo "$PATH_TO_SSH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-ssh_command was given.
+if test "${with_ssh_command+set}" = set; then :
+ withval=$with_ssh_command; PATH_TO_SSH=$withval
+fi
+
+if test -n "$PATH_TO_SSH"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define SSH_COMMAND "$PATH_TO_SSH"
+_ACEOF
+
+ EXTRAS="$EXTRAS check_by_ssh\$(EXEEXT)"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Get ssh in order to make check_by_ssh plugin" >&5
+$as_echo "$as_me: WARNING: Get ssh in order to make check_by_ssh plugin" >&2;}
+fi
+
+# Extract the first word of "sudo", so it can be a program name with args.
+set dummy sudo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_SUDO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_SUDO in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_SUDO="$PATH_TO_SUDO" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_SUDO="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_SUDO=$ac_cv_path_PATH_TO_SUDO
+if test -n "$PATH_TO_SUDO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_SUDO" >&5
+$as_echo "$PATH_TO_SUDO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-sudo_command was given.
+if test "${with_sudo_command+set}" = set; then :
+ withval=$with_sudo_command; PATH_TO_SUDO=$withval
+fi
+
+if test -n "$PATH_TO_SUDO"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_SUDO "$PATH_TO_SUDO"
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find sudo or equivalent" >&5
+$as_echo "$as_me: WARNING: Could not find sudo or equivalent" >&2;}
+fi
+
+# Extract the first word of "mailq", so it can be a program name with args.
+set dummy mailq; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_MAILQ+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_MAILQ in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_MAILQ="$PATH_TO_MAILQ" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_MAILQ="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_MAILQ=$ac_cv_path_PATH_TO_MAILQ
+if test -n "$PATH_TO_MAILQ"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_MAILQ" >&5
+$as_echo "$PATH_TO_MAILQ" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-mailq_command was given.
+if test "${with_mailq_command+set}" = set; then :
+ withval=$with_mailq_command; PATH_TO_MAILQ=$withval
+fi
+
+if test -n "$PATH_TO_MAILQ"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_MAILQ "$PATH_TO_MAILQ"
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find mailq or equivalent" >&5
+$as_echo "$as_me: WARNING: Could not find mailq or equivalent" >&2;}
+fi
+
+# Extract the first word of "qmail-qstat", so it can be a program name with args.
+set dummy qmail-qstat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_QMAIL_QSTAT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_QMAIL_QSTAT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_QMAIL_QSTAT="$PATH_TO_QMAIL_QSTAT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_QMAIL_QSTAT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_QMAIL_QSTAT=$ac_cv_path_PATH_TO_QMAIL_QSTAT
+if test -n "$PATH_TO_QMAIL_QSTAT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_QMAIL_QSTAT" >&5
+$as_echo "$PATH_TO_QMAIL_QSTAT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-qmail_qstat_command was given.
+if test "${with_qmail_qstat_command+set}" = set; then :
+ withval=$with_qmail_qstat_command; PATH_TO_QMAIL_QSTAT=$withval
+fi
+
+if test -n "$PATH_TO_QMAIL_QSTAT"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_QMAIL_QSTAT "$PATH_TO_QMAIL_QSTAT"
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find qmail-qstat or equivalent" >&5
+$as_echo "$as_me: WARNING: Could not find qmail-qstat or equivalent" >&2;}
+fi
+
+# Extract the first word of "swap", so it can be a program name with args.
+set dummy swap; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_SWAP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_SWAP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_SWAP="$PATH_TO_SWAP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_SWAP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_SWAP=$ac_cv_path_PATH_TO_SWAP
+if test -n "$PATH_TO_SWAP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_SWAP" >&5
+$as_echo "$PATH_TO_SWAP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if (test -n "$PATH_TO_SWAP")
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PATH_TO_SWAP format" >&5
+$as_echo_n "checking for $PATH_TO_SWAP format... " >&6; }
+if $PATH_TO_SWAP -l 2>&1 >/dev/null
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_SWAP -l"
+ if $PATH_TO_SWAP -l 2>/dev/null | \
+ grep -E -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
+ >/dev/null
+ then
+ ac_cv_swap_format=" %*d %*s %*d,%*d %*d %*d %lu %lu"
+ ac_cv_swap_conv=2048
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using IRIX format swap" >&5
+$as_echo "using IRIX format swap" >&6; }
+
+ elif $PATH_TO_SWAP -l 2>/dev/null | grep -E -i "^path +dev +swaplo +blocks +free" >/dev/null
+ then
+ ac_cv_swap_format="%*s %*[0-9,-] %*d %lu %lu"
+ ac_cv_swap_conv=2048
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Unixware format swap" >&5
+$as_echo "using Unixware format swap" >&6; }
+ else
+ ac_cv_have_swap=""
+ ac_cv_swap_command=""
+ fi
+fi
+fi
+
+# Extract the first word of "swapinfo", so it can be a program name with args.
+set dummy swapinfo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_SWAPINFO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_SWAPINFO in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_SWAPINFO="$PATH_TO_SWAPINFO" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_SWAPINFO="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_SWAPINFO=$ac_cv_path_PATH_TO_SWAPINFO
+if test -n "$PATH_TO_SWAPINFO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_SWAPINFO" >&5
+$as_echo "$PATH_TO_SWAPINFO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if (test -n "$PATH_TO_SWAPINFO")
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PATH_TO_SWAPINFO format" >&5
+$as_echo_n "checking for $PATH_TO_SWAPINFO format... " >&6; }
+if $PATH_TO_SWAPINFO -k 2>&1 | grep -E -i "^Device" >/dev/null
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
+
+ if $PATH_TO_SWAPINFO -k 2>/dev/null | grep -E -i "^Device +1K-blocks +Used +Avail" >/dev/null
+ then
+ ac_cv_swap_format="%*s %lu %*d %lu"
+ ac_cv_swap_conv=1024
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using FreeBSD format swapinfo" >&5
+$as_echo "using FreeBSD format swapinfo" >&6; }
+ fi
+
+elif $PATH_TO_SWAPINFO -dfM 2>/dev/null | grep -E -i "^TYPE +AVAIL +USED +FREE" >/dev/null
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
+ ac_cv_swap_format="%*s %lu %*d %lu"
+ ac_cv_swap_conv=1024
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using HP-UX format swapinfo" >&5
+$as_echo "using HP-UX format swapinfo" >&6; }
+fi
+fi
+
+# Extract the first word of "lsps", so it can be a program name with args.
+set dummy lsps; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_LSPS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_LSPS in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_LSPS="$PATH_TO_LSPS" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_LSPS="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_LSPS=$ac_cv_path_PATH_TO_LSPS
+if test -n "$PATH_TO_LSPS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_LSPS" >&5
+$as_echo "$PATH_TO_LSPS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if (test -n "$PATH_TO_LSPS")
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PATH_TO_LSPS format" >&5
+$as_echo_n "checking for $PATH_TO_LSPS format... " >&6; }
+if $PATH_TO_LSPS -a 2>/dev/null | grep -E -i "^Page Space" > /dev/null
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_LSPS -a"
+ ac_cv_swap_format="%*s %*s %*s %lu%*s %lu %*s"
+ ac_cv_swap_conv=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using AIX lsps" >&5
+$as_echo "using AIX lsps" >&6; }
+fi
+fi
+
+
+for ac_header in sys/stat.h sys/param.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/swap.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/swap.h" "ac_cv_header_sys_swap_h" "
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+"
+if test "x$ac_cv_header_sys_swap_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SWAP_H 1
+_ACEOF
+
+fi
+
+done
+
+ac_fn_c_check_decl "$LINENO" "swapctl" "ac_cv_have_decl_swapctl" "
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/swap.h>
+
+"
+if test "x$ac_cv_have_decl_swapctl" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SWAPCTL $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_type "$LINENO" "swaptbl_t" "ac_cv_type_swaptbl_t" "
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/swap.h>
+
+"
+if test "x$ac_cv_type_swaptbl_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SWAPTBL_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "swapent_t" "ac_cv_type_swapent_t" "
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/swap.h>
+
+"
+if test "x$ac_cv_type_swapent_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SWAPENT_T 1
+_ACEOF
+
+
+fi
+
+ac_fn_c_check_member "$LINENO" "struct swapent" "se_nblks" "ac_cv_member_struct_swapent_se_nblks" "
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/swap.h>
+
+"
+if test "x$ac_cv_member_struct_swapent_se_nblks" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SWAPENT_SE_NBLKS 1
+_ACEOF
+
+
+fi
+
+
+if test "$ac_cv_have_decl_swapctl" = "yes";
+then
+ EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 2-arg (SVR4) swapctl" >&5
+$as_echo_n "checking for 2-arg (SVR4) swapctl... " >&6; }
+ if test "$ac_cv_type_swaptbl_t" = "yes" -a \
+ "$ac_cv_type_swapent_t" = "yes";
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ ac_cv_check_swap_swapctl_svr4="1";
+
+$as_echo "#define CHECK_SWAP_SWAPCTL_SVR4 1" >>confdefs.h
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-arg (*BSD) swapctl" >&5
+$as_echo_n "checking for 3-arg (*BSD) swapctl... " >&6; }
+ if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define CHECK_SWAP_SWAPCTL_BSD 1" >>confdefs.h
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether swapctl uses blocks or pages" >&5
+$as_echo_n "checking for whether swapctl uses blocks or pages... " >&6; }
+ if test "$ac_cv_check_swap_swapctl_svr4" = "1";
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: page" >&5
+$as_echo "page" >&6; }
+ ac_fn_c_check_decl "$LINENO" "sysconf" "ac_cv_have_decl_sysconf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_sysconf" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SYSCONF $ac_have_decl
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for system page size" >&5
+$as_echo_n "checking for system page size... " >&6; }
+ if test "$ac_cv_have_decl_sysconf" = "yes";
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: determined by sysconf(3)" >&5
+$as_echo "determined by sysconf(3)" >&6; }
+ ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: don't know. guessing 4096k" >&5
+$as_echo "$as_me: WARNING: don't know. guessing 4096k" >&2;}
+ ac_cv_swap_conv=256
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: blocks (assuming 512b)" >&5
+$as_echo "blocks (assuming 512b)" >&6; }
+ ac_cv_swap_conv=2048
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define SWAP_CONVERSION $ac_cv_swap_conv
+_ACEOF
+
+fi
+
+
+if test "x$ac_cv_have_swap" != "x"
+then
+
+$as_echo "#define HAVE_SWAP 1" >>confdefs.h
+
+ EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
+fi
+if test "x$ac_cv_swap_command" != "x"
+then
+
+cat >>confdefs.h <<_ACEOF
+#define SWAP_COMMAND "$ac_cv_swap_command"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SWAP_FORMAT "$ac_cv_swap_format"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SWAP_CONVERSION $ac_cv_swap_conv
+_ACEOF
+
+fi
+
+
+# Check whether --with-proc-meminfo was given.
+if test "${with_proc_meminfo+set}" = set; then :
+ withval=$with_proc_meminfo; ac_cv_proc_meminfo=$withval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/meminfo" >&5
+$as_echo_n "checking for /proc/meminfo... " >&6; }
+if test -n "$ac_cv_proc_meminfo"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: (command line) $ac_cv_proc_meminfo" >&5
+$as_echo "(command line) $ac_cv_proc_meminfo" >&6; }
+elif cat /proc/meminfo > /dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found /proc/meminfo" >&5
+$as_echo "found /proc/meminfo" >&6; }
+ ac_cv_proc_meminfo="/proc/meminfo"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+if test -n "$ac_cv_proc_meminfo"; then
+
+$as_echo "#define HAVE_PROC_MEMINFO 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define PROC_MEMINFO "$ac_cv_proc_meminfo"
+_ACEOF
+
+ EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
+fi
+
+# Extract the first word of "dig", so it can be a program name with args.
+set dummy dig; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_DIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_DIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_DIG="$PATH_TO_DIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_DIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_DIG=$ac_cv_path_PATH_TO_DIG
+if test -n "$PATH_TO_DIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_DIG" >&5
+$as_echo "$PATH_TO_DIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-dig_command was given.
+if test "${with_dig_command+set}" = set; then :
+ withval=$with_dig_command; PATH_TO_DIG=$withval
+fi
+
+if test -n "$PATH_TO_DIG"; then
+ EXTRAS="$EXTRAS check_dig\$(EXEEXT)"
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_DIG "$PATH_TO_DIG"
+_ACEOF
+
+fi
+
+# Extract the first word of "apt-get", so it can be a program name with args.
+set dummy apt-get; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATH_TO_APTGET+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PATH_TO_APTGET in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PATH_TO_APTGET="$PATH_TO_APTGET" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PATH_TO_APTGET="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PATH_TO_APTGET=$ac_cv_path_PATH_TO_APTGET
+if test -n "$PATH_TO_APTGET"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_APTGET" >&5
+$as_echo "$PATH_TO_APTGET" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Check whether --with-apt-get_command was given.
+if test "${with_apt_get_command+set}" = set; then :
+ withval=$with_apt_get_command; with_apt_get_command=$withval
+else
+ with_apt_get_command=$PATH_TO_APTGET
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define PATH_TO_APTGET "$PATH_TO_APTGET"
+_ACEOF
+
+if test -n "$PATH_TO_APTGET" ; then
+ EXTRAS="$EXTRAS check_apt\$(EXEEXT)"
+fi
+
+
+if test -f $srcdir/plugins/check_nt.c ; then
+ EXTRAS="$EXTRAS check_nt\$(EXEEXT)"
+fi
+
+
+for ac_header in sys/sockio.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sockio_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_SOCKIO_H 1
+_ACEOF
+
+fi
+
+done
+
+
+case $host in
+ *bsd*)
+
+$as_echo "#define __bsd__ 1" >>confdefs.h
+
+ ;;
+ *linux*)
+
+$as_echo "#define __linux__ 1" >>confdefs.h
+
+ ;;
+ *sun* | *solaris*)
+
+$as_echo "#define __sun__ 1" >>confdefs.h
+
+ ;;
+ *hpux*)
+
+$as_echo "#define __hpux__ 1" >>confdefs.h
+
+ ;;
+esac
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
+$as_echo_n "checking whether NLS is requested... " >&6; }
+ # Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then :
+ enableval=$enable_nls; USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
+
+
+
+
+ GETTEXT_MACRO_VERSION=0.20
+
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MSGFMT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$MSGFMT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
+$as_echo "$MSGFMT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GMSGFMT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
+$as_echo "$GMSGFMT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_XGETTEXT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$XGETTEXT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
+$as_echo "$XGETTEXT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ rm -f messages.po
+
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MSGMERGE+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$MSGMERGE" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ echo "$as_me: trying $ac_dir/$ac_word..." >&5
+ if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+ ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+ ;;
+esac
+fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
+$as_echo "$MSGMERGE" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
+ MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
+ else
+ if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
+ MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
+ else
+ MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
+ fi
+ fi
+
+
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+
+
+ ac_config_commands="$ac_config_commands po-directories"
+
+
+
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld" >&5
+$as_echo_n "checking for ld... " >&6; }
+elif test "$GCC" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test -n "$LD"; then
+ # Let the user override the test with a path.
+ :
+else
+ if ${acl_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ acl_cv_path_LD= # Final result of this test
+ ac_prog=ld # Program to search in $PATH
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $acl_output in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+ while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+ acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+ done
+ # Got the pathname. No search in PATH is needed.
+ acl_cv_path_LD="$acl_output"
+ ac_prog=
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+ fi
+ if test -n "$ac_prog"; then
+ # Search for $ac_prog in $PATH.
+ acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$acl_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_ifs"
+ fi
+ case $host in
+ *-*-aix*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # The compiler produces 64-bit code. Add option '-b64' so that the
+ # linker groks 64-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -b64 "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+ esac
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ sparc64-*-netbsd*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ # The compiler produces 32-bit code. Add option '-m elf32_sparc'
+ # so that the linker groks 32-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -m elf32_sparc "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+ esac
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ esac
+
+fi
+
+ LD="$acl_cv_path_LD"
+fi
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${acl_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes
+ ;;
+*)
+ acl_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
+$as_echo "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
+$as_echo_n "checking for shared library run path origin... " >&6; }
+if ${acl_cv_rpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
+$as_echo "$acl_cv_rpath" >&6; }
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; :
+else
+ enable_rpath=yes
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5
+$as_echo_n "checking 32-bit host C ABI... " >&6; }
+if ${gl_cv_host_cpu_c_abi_32bit+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$gl_cv_host_cpu_c_abi"; then
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown ;;
+ esac
+ else
+ case "$host_cpu" in
+
+ # CPUs that only support a 32-bit ABI.
+ arc \
+ | bfin \
+ | cris* \
+ | csky \
+ | epiphany \
+ | ft32 \
+ | h8300 \
+ | m68k \
+ | microblaze | microblazeel \
+ | nds32 | nds32le | nds32be \
+ | nios2 | nios2eb | nios2el \
+ | or1k* \
+ | or32 \
+ | sh | sh1234 | sh1234elb \
+ | tic6x \
+ | xtensa* )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ # CPUs that only support a 64-bit ABI.
+ alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ | mmix )
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
+
+ i[34567]86 )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64) \
+ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=yes
+else
+ gl_cv_host_cpu_c_abi_32bit=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_host_cpu_c_abi_32bit=no
+else
+ gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown
+ ;;
+ esac
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5
+$as_echo "$gl_cv_host_cpu_c_abi_32bit" >&6; }
+
+ HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5
+$as_echo_n "checking for ELF binary format... " >&6; }
+if ${gl_cv_elf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+ gl_cv_elf=yes
+else
+ gl_cv_elf=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5
+$as_echo "$gl_cv_elf" >&6; }
+ if test $gl_cv_elf; then
+ # Extract the ELF class of a file (5th byte) in decimal.
+ # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+ if od -A x < /dev/null >/dev/null 2>/dev/null; then
+ # Use POSIX od.
+ func_elfclass ()
+ {
+ od -A n -t d1 -j 4 -N 1
+ }
+ else
+ # Use BSD hexdump.
+ func_elfclass ()
+ {
+ dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+ echo
+ }
+ fi
+ case $HOST_CPU_C_ABI_32BIT in
+ yes)
+ # 32-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ test "`func_elfclass | sed -e 's/[ ]//g'`" = 1
+ }
+ ;;
+ no)
+ # 64-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ test "`func_elfclass | sed -e 's/[ ]//g'`" = 2
+ }
+ ;;
+ *)
+ # Unknown.
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ ;;
+ esac
+ else
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
+$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; }
+if ${acl_cv_libdirstems+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ acl_libdirstem3=
+ case "$host_os" in
+ solaris*)
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ acl_libdirstem2=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem3=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test $HOST_CPU_C_ABI_32BIT != no; then
+ # 32-bit or unknown ABI.
+ if test -d /usr/lib32; then
+ acl_libdirstem2=lib32
+ fi
+ fi
+ if test $HOST_CPU_C_ABI_32BIT != yes; then
+ # 64-bit or unknown ABI.
+ if test -d /usr/lib64; then
+ acl_libdirstem3=lib64
+ fi
+ fi
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64 ) acl_libdirstem3=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ if test $HOST_CPU_C_ABI_32BIT = yes; then
+ # 32-bit ABI.
+ acl_libdirstem3=
+ fi
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ # 64-bit ABI.
+ acl_libdirstem2=
+ fi
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+ test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+ acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5
+$as_echo "$acl_cv_libdirstems" >&6; }
+ acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+ acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+ acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then :
+ withval=$with_libiconv_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ additional_libdir2="$withval/$acl_libdirstem2"
+ additional_libdir3="$withval/$acl_libdirstem3"
+ fi
+ fi
+
+fi
+
+ if test "X$additional_libdir2" = "X$additional_libdir"; then
+ additional_libdir2=
+ fi
+ if test "X$additional_libdir3" = "X$additional_libdir"; then
+ additional_libdir3=
+ fi
+ LIBICONV=
+ LTLIBICONV=
+ INCICONV=
+ LIBICONV_PREFIX=
+ HAVE_LIBICONV=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='iconv '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+ if test "X$found_dir" = "X"; then
+ eval dir=\$$additional_libdir_variable
+ if test -n "$dir"; then
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ if test "$acl_hardcode_direct" = yes; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ haveit=
+ for x in $LDFLAGS $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
+ fi
+ fi
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = 'iconv'; then
+ LIBICONV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = 'iconv'; then
+ LIBICONV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem3 | */$acl_libdirstem3/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+ if test "$name" = 'iconv'; then
+ LIBICONV_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INCICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
+ haveit=
+ if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
+$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
+if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <CoreFoundation/CFPreferences.h>
+int
+main ()
+{
+CFPreferencesCopyAppValue(NULL, NULL)
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gt_cv_func_CFPreferencesCopyAppValue=yes
+else
+ gt_cv_func_CFPreferencesCopyAppValue=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+
+$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5
+$as_echo_n "checking for CFLocaleCopyPreferredLanguages... " >&6; }
+if ${gt_cv_func_CFLocaleCopyPreferredLanguages+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <CoreFoundation/CFLocale.h>
+int
+main ()
+{
+CFLocaleCopyPreferredLanguages();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gt_cv_func_CFLocaleCopyPreferredLanguages=yes
+else
+ gt_cv_func_CFLocaleCopyPreferredLanguages=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gt_save_LIBS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5
+$as_echo "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; }
+ if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+
+$as_echo "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h
+
+ fi
+ INTL_MACOSX_LIBS=
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+ INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+ fi
+
+
+
+
+
+
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
+$as_echo_n "checking for GNU gettext in libc... " >&6; }
+if eval \${$gt_func_gnugettext_libc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
+int
+main ()
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$gt_func_gnugettext_libc=yes"
+else
+ eval "$gt_func_gnugettext_libc=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$gt_func_gnugettext_libc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+
+
+
+
+
+ am_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCICONV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
+$as_echo_n "checking for iconv... " >&6; }
+if ${am_cv_func_iconv+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
+$as_echo "$am_cv_func_iconv" >&6; }
+ if test "$am_cv_func_iconv" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
+$as_echo_n "checking for working iconv... " >&6; }
+if ${am_cv_func_iconv_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ am_cv_func_iconv_works=no
+ for ac_iconv_const in '' 'const'; do
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
+{
+int result = 0;
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 1;
+ iconv_close (cd_utf8_to_88591);
+ }
+ }
+ /* Test against Solaris 10 bug: Failures are not distinguishable from
+ successful returns. */
+ {
+ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+ if (cd_ascii_to_88591 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\263";
+ char buf[10];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_ascii_to_88591,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 2;
+ iconv_close (cd_ascii_to_88591);
+ }
+ }
+ /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+ result |= 4;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ ICONV_CONST char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ result |= 8;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ {
+ /* Try standardized names. */
+ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+ /* Try IRIX, OSF/1 names. */
+ iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+ /* Try AIX names. */
+ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+ /* Try HP-UX names. */
+ iconv_t cd4 = iconv_open ("utf8", "eucJP");
+ if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+ && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+ result |= 16;
+ if (cd1 != (iconv_t)(-1))
+ iconv_close (cd1);
+ if (cd2 != (iconv_t)(-1))
+ iconv_close (cd2);
+ if (cd3 != (iconv_t)(-1))
+ iconv_close (cd3);
+ if (cd4 != (iconv_t)(-1))
+ iconv_close (cd4);
+ }
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ am_cv_func_iconv_works=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ test "$am_cv_func_iconv_works" = no || break
+ done
+ LIBS="$am_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
+$as_echo "$am_cv_func_iconv_works" >&6; }
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+
+$as_echo "#define HAVE_ICONV 1" >>confdefs.h
+
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
+$as_echo_n "checking how to link with libiconv... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
+$as_echo "$LIBICONV" >&6; }
+ else
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+
+
+
+
+
+
+
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libintl-prefix was given.
+if test "${with_libintl_prefix+set}" = set; then :
+ withval=$with_libintl_prefix;
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/$acl_libdirstem"
+ additional_libdir2="$withval/$acl_libdirstem2"
+ additional_libdir3="$withval/$acl_libdirstem3"
+ fi
+ fi
+
+fi
+
+ if test "X$additional_libdir2" = "X$additional_libdir"; then
+ additional_libdir2=
+ fi
+ if test "X$additional_libdir3" = "X$additional_libdir"; then
+ additional_libdir3=
+ fi
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ LIBINTL_PREFIX=
+ HAVE_LIBINTL=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='intl '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+ if test "X$found_dir" = "X"; then
+ eval dir=\$$additional_libdir_variable
+ if test -n "$dir"; then
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ fi
+ done
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $found_dir"
+ fi
+ if test "$acl_hardcode_direct" = yes; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $found_dir"
+ fi
+ else
+ haveit=
+ for x in $LDFLAGS $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$found_dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
+ fi
+ if test "$acl_hardcode_minus_L" != no; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ fi
+ else
+ if test "X$found_a" != "X"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
+ fi
+ fi
+ additional_includedir=
+ case "$found_dir" in
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = 'intl'; then
+ LIBINTL_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = 'intl'; then
+ LIBINTL_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem3 | */$acl_libdirstem3/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+ if test "$name" = 'intl'; then
+ LIBINTL_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ esac
+ if test "X$additional_includedir" != "X"; then
+ if test "X$additional_includedir" != "X/usr/include"; then
+ haveit=
+ if test "X$additional_includedir" = "X/usr/local/include"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ for x in $CPPFLAGS $INCINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-I$additional_includedir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$additional_includedir"; then
+ INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -n "$found_la"; then
+ save_libdir="$libdir"
+ case "$found_la" in
+ */* | *\\*) . "$found_la" ;;
+ *) . "./$found_la" ;;
+ esac
+ libdir="$save_libdir"
+ for dep in $dependency_libs; do
+ case "$dep" in
+ -L*)
+ dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
+ haveit=
+ if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $LIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir"
+ fi
+ fi
+ haveit=
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X-L$dependency_libdir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ if test -d "$dependency_libdir"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir"
+ fi
+ fi
+ fi
+ fi
+ ;;
+ -R*)
+ dir=`echo "X$dep" | sed -e 's/^X-R//'`
+ if test "$enable_rpath" != no; then
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
+ fi
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$acl_hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
+$as_echo_n "checking for GNU gettext in libintl... " >&6; }
+if eval \${$gt_func_gnugettext_libintl+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
+int
+main ()
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$gt_func_gnugettext_libintl=yes"
+else
+ eval "$gt_func_gnugettext_libintl=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
+int
+main ()
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_func_gnugettext_libintl=yes"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"
+fi
+eval ac_res=\$$gt_func_gnugettext_libintl
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ fi
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+
+
+ if test -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+
+$as_echo "#define ENABLE_NLS 1" >>confdefs.h
+
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5
+$as_echo_n "checking whether to use NLS... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
+ if test "$USE_NLS" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5
+$as_echo_n "checking where the gettext function comes from... " >&6; }
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5
+$as_echo "$gt_source" >&6; }
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
+$as_echo_n "checking how to link with libintl... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
+$as_echo "$LIBINTL" >&6; }
+
+ for element in $INCINTL; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+ fi
+
+
+$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h
+
+ fi
+
+ POSUB=po
+ fi
+
+
+
+ INTLLIBS="$LIBINTL"
+
+
+
+
+
+
+
+
+# Check whether --enable-redhat-pthread-workaround was given.
+if test "${enable_redhat_pthread_workaround+set}" = set; then :
+ enableval=$enable_redhat_pthread_workaround; ac_cv_enable_redhat_pthread_workaround=$enableval
+else
+ ac_cv_enable_redhat_pthread_workaround=test
+fi
+
+if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
+ if echo $ac_cv_uname_r | grep -E "\.EL(smp)?$" >/dev/null 2>&1 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: See https://www.monitoring-plugins.org/doc/faq/configure-hangs.html if this next part takes a long time" >&5
+$as_echo "$as_me: See https://www.monitoring-plugins.org/doc/faq/configure-hangs.html if this next part takes a long time" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for redhat spopen problem" >&5
+$as_echo_n "checking for redhat spopen problem... " >&6; }
+ ( cd config_test && make && make test ) > /dev/null 2>&1
+ if test $? -eq 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: okay" >&5
+$as_echo "okay" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5
+$as_echo "error" >&6; }
+
+$as_echo "#define REDHAT_SPOPEN_ERROR 1" >>confdefs.h
+
+ fi
+ fi
+elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
+
+$as_echo "#define REDHAT_SPOPEN_ERROR 1" >>confdefs.h
+
+fi
+
+# Check whether --enable-perl-modules was given.
+if test "${enable_perl_modules+set}" = set; then :
+ enableval=$enable_perl_modules; enable_perl_modules=$enableval
+else
+ enable_perl_modules=no
+fi
+
+if test "$enable_perl_modules" = "yes" ; then
+ PERLMODS_DIR=perlmods
+
+fi
+
+# From Tap configure
+# Checks for libraries
+case "$host" in
+ *-*-*freebsd4*)
+ LDFLAGS="$LDFLAGS -pthread"
+ HAVE_LIBPTHREAD=1
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
+$as_echo_n "checking for main in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_main=yes
+else
+ ac_cv_lib_pthread_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
+$as_echo "$ac_cv_lib_pthread_main" >&6; }
+if test "x$ac_cv_lib_pthread_main" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+ LIBS="-lpthread $LIBS"
+
+fi
+
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-cross-guesses was given.
+if test "${enable_cross_guesses+set}" = set; then :
+ enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
+$as_echo "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
+ enableval=conservative
+ fi
+ gl_cross_guesses="$enableval"
+else
+ gl_cross_guesses=conservative
+fi
+
+ if test $gl_cross_guesses = risky; then
+ gl_cross_guess_normal="guessing yes"
+ gl_cross_guess_inverted="guessing no"
+ else
+ gl_cross_guess_normal="guessing no"
+ gl_cross_guess_inverted="guessing yes"
+ fi
+ LIBC_FATAL_STDERR_=1
+ export LIBC_FATAL_STDERR_
+
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${ac_cv_working_alloca_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_working_alloca_h=yes
+else
+ ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if ${ac_cv_func_alloca_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca (size_t);
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_alloca_works=yes
+else
+ ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+
+
+
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if ${ac_cv_c_stack_direction+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_c_stack_direction=0
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+find_stack_direction (int *addr, int depth)
+{
+ int dir, dummy = 0;
+ if (! addr)
+ addr = &dummy;
+ *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+ dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+ return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+ return find_stack_direction (0, argc + !argv + 20) < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_stack_direction=1
+else
+ ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+
+ HAVE_DECL_INET_NTOP=1;
+ HAVE_DECL_INET_PTON=1;
+ REPLACE_INET_NTOP=0;
+ REPLACE_INET_PTON=0;
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
+$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
+if ${gl_cv_have_include_next+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -rf conftestd1a conftestd1b conftestd2
+ mkdir conftestd1a conftestd1b conftestd2
+ cat <<EOF > conftestd1a/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+ cat <<EOF > conftestd1b/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include <stdio.h>
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+ cat <<EOF > conftestd2/conftest.h
+#ifndef DEFINED_IN_CONFTESTD1
+#error "include_next test doesn't work"
+#endif
+#define DEFINED_IN_CONFTESTD2
+EOF
+ gl_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <conftest.h>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_have_include_next=yes
+else
+ CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <conftest.h>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_have_include_next=buggy
+else
+ gl_cv_have_include_next=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$gl_save_CPPFLAGS"
+ rm -rf conftestd1a conftestd1b conftestd2
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
+$as_echo "$gl_cv_have_include_next" >&6; }
+ PRAGMA_SYSTEM_HEADER=
+ if test $gl_cv_have_include_next = yes; then
+ INCLUDE_NEXT=include_next
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+ if test -n "$GCC"; then
+ PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
+ fi
+ else
+ if test $gl_cv_have_include_next = buggy; then
+ INCLUDE_NEXT=include
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+ else
+ INCLUDE_NEXT=include
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
+ fi
+ fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether source code line length is unlimited" >&5
+$as_echo_n "checking whether source code line length is unlimited... " >&6; }
+if ${gl_cv_source_line_length_unlimited+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef __TANDEM
+choke me
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "choke me" >/dev/null 2>&1; then :
+ gl_cv_source_line_length_unlimited=no
+else
+ gl_cv_source_line_length_unlimited=yes
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5
+$as_echo "$gl_cv_source_line_length_unlimited" >&6; }
+ if test $gl_cv_source_line_length_unlimited = no; then
+ PRAGMA_COLUMNS="#pragma COLUMNS 10000"
+ else
+ PRAGMA_COLUMNS=
+ fi
+
+
+
+
+
+
+ if test $ac_cv_header_features_h = yes; then
+ HAVE_FEATURES_H=1
+ else
+ HAVE_FEATURES_H=0
+ fi
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h = no; then
+ for ac_header in ws2tcpip.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
+if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WS2TCPIP_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+
+
+
+
+
+ if test $ac_cv_header_arpa_inet_h = yes; then
+ HAVE_ARPA_INET_H=1
+ else
+ HAVE_ARPA_INET_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
+$as_echo_n "checking absolute name of <arpa/inet.h>... " >&6; }
+if ${gl_cv_next_arpa_inet_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_arpa_inet_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <arpa/inet.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'arpa/inet.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_arpa_inet_h
+ gl_cv_next_arpa_inet_h='"'$gl_header'"'
+ else
+ gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
+$as_echo "$gl_cv_next_arpa_inet_h" >&6; }
+ fi
+ NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'arpa/inet.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_WS2TCPIP_H=0
+ else
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_INET_NTOP=0
+
+
+
+ GL_GNULIB_INET_PTON=0
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
+if ${ac_cv_c_restrict+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_restrict=no
+ # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+ # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+ # Put 'restrict' last, because C++ lacks it.
+ for ac_kw in __restrict__ __restrict _Restrict restrict; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+typedef int *int_ptr;
+ int foo (int_ptr $ac_kw ip) { return ip[0]; }
+ int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
+ int bar (int ip[$ac_kw]) { return ip[0]; }
+
+int
+main ()
+{
+int s[1];
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_restrict=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_restrict" != no && break
+ done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+$as_echo "$ac_cv_c_restrict" >&6; }
+
+ case $ac_cv_c_restrict in
+ restrict) ;;
+ no) $as_echo "#define restrict /**/" >>confdefs.h
+ ;;
+ *) cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
+_ACEOF
+ ;;
+ esac
+
+
+ HAVE_BTOWC=1;
+ HAVE_MBSINIT=1;
+ HAVE_MBRTOWC=1;
+ HAVE_MBRLEN=1;
+ HAVE_MBSRTOWCS=1;
+ HAVE_MBSNRTOWCS=1;
+ HAVE_WCRTOMB=1;
+ HAVE_WCSRTOMBS=1;
+ HAVE_WCSNRTOMBS=1;
+ HAVE_WMEMCHR=1;
+ HAVE_WMEMCMP=1;
+ HAVE_WMEMCPY=1;
+ HAVE_WMEMMOVE=1;
+ HAVE_WMEMPCPY=1;
+ HAVE_WMEMSET=1;
+ HAVE_WCSLEN=1;
+ HAVE_WCSNLEN=1;
+ HAVE_WCSCPY=1;
+ HAVE_WCPCPY=1;
+ HAVE_WCSNCPY=1;
+ HAVE_WCPNCPY=1;
+ HAVE_WCSCAT=1;
+ HAVE_WCSNCAT=1;
+ HAVE_WCSCMP=1;
+ HAVE_WCSNCMP=1;
+ HAVE_WCSCASECMP=1;
+ HAVE_WCSNCASECMP=1;
+ HAVE_WCSCOLL=1;
+ HAVE_WCSXFRM=1;
+ HAVE_WCSDUP=1;
+ HAVE_WCSCHR=1;
+ HAVE_WCSRCHR=1;
+ HAVE_WCSCSPN=1;
+ HAVE_WCSSPN=1;
+ HAVE_WCSPBRK=1;
+ HAVE_WCSSTR=1;
+ HAVE_WCSTOK=1;
+ HAVE_WCSWIDTH=1;
+ HAVE_WCSFTIME=1;
+ HAVE_DECL_WCTOB=1;
+ HAVE_DECL_WCSDUP=1;
+ HAVE_DECL_WCWIDTH=1;
+ REPLACE_MBSTATE_T=0;
+ REPLACE_BTOWC=0;
+ REPLACE_WCTOB=0;
+ REPLACE_MBSINIT=0;
+ REPLACE_MBRTOWC=0;
+ REPLACE_MBRLEN=0;
+ REPLACE_MBSRTOWCS=0;
+ REPLACE_MBSNRTOWCS=0;
+ REPLACE_WCRTOMB=0;
+ REPLACE_WCSRTOMBS=0;
+ REPLACE_WCSNRTOMBS=0;
+ REPLACE_WCWIDTH=0;
+ REPLACE_WCSWIDTH=0;
+ REPLACE_WCSFTIME=0;
+ REPLACE_WCSTOK=0;
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
+$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
+if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_header_wchar_h_correct_inline=yes
+ case "$host_os" in
+ *-gnu* | gnu*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ extern int zero (void);
+ int main () { return zero(); }
+
+_ACEOF
+ save_ac_compile="$ac_compile"
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+ if echo '#include "conftest.c"' >conftest1.c \
+ && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ int zero (void) { return 0; }
+
+_ACEOF
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+ if echo '#include "conftest.c"' >conftest2.c \
+ && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
+ :
+ else
+ gl_cv_header_wchar_h_correct_inline=no
+ fi
+ fi
+ fi
+ ac_compile="$save_ac_compile"
+ rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
+$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
+ if test $gl_cv_header_wchar_h_correct_inline = no; then
+ as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
+C99 mode. You have four options:
+ - Add the flag -fgnu89-inline to CC and reconfigure, or
+ - Fix your include files, using parts of
+ <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+ - Use a gcc version older than 4.3, or
+ - Don't use the flags -std=c99 or -std=gnu99.
+Configuration aborted." "$LINENO" 5
+ fi
+
+
+
+
+ for ac_func in $ac_func_list
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
+$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
+if ${am_cv_langinfo_codeset+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET); return !cs;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ am_cv_langinfo_codeset=yes
+else
+ am_cv_langinfo_codeset=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
+$as_echo "$am_cv_langinfo_codeset" >&6; }
+ if test $am_cv_langinfo_codeset = yes; then
+
+$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
+
+ fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+$as_echo_n "checking for a traditional french locale... " >&6; }
+if ${gt_cv_locale_fr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in the abbreviation of the second month, the second
+ character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+ one byte long. This excludes the UTF-8 encoding. */
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
+ /* Check whether the decimal separator is a comma.
+ On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+ are nl_langinfo(RADIXCHAR) are both ".". */
+ if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+ return 0;
+#endif
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the native Windows locale name.
+ if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=French_France.1252
+ else
+ # None found.
+ gt_cv_locale_fr=none
+ fi
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.ISO-8859-1
+ else
+ # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
+ if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.ISO8859-1
+ else
+ # Test for the HP-UX locale name.
+ if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.iso88591
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr
+ else
+ # None found.
+ gt_cv_locale_fr=none
+ fi
+ fi
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+$as_echo "$gt_cv_locale_fr" >&6; }
+ LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+ GL_GNULIB_BTOWC=0
+
+
+
+ GL_GNULIB_WCTOB=0
+
+
+
+ GL_GNULIB_MBSINIT=0
+
+
+
+ GL_GNULIB_MBRTOWC=0
+
+
+
+ GL_GNULIB_MBRLEN=0
+
+
+
+ GL_GNULIB_MBSRTOWCS=0
+
+
+
+ GL_GNULIB_MBSNRTOWCS=0
+
+
+
+ GL_GNULIB_WCRTOMB=0
+
+
+
+ GL_GNULIB_WCSRTOMBS=0
+
+
+
+ GL_GNULIB_WCSNRTOMBS=0
+
+
+
+ GL_GNULIB_WCWIDTH=0
+
+
+
+ GL_GNULIB_WMEMCHR=0
+
+
+
+ GL_GNULIB_WMEMCMP=0
+
+
+
+ GL_GNULIB_WMEMCPY=0
+
+
+
+ GL_GNULIB_WMEMMOVE=0
+
+
+
+ GL_GNULIB_WMEMPCPY=0
+
+
+
+ GL_GNULIB_WMEMSET=0
+
+
+
+ GL_GNULIB_WCSLEN=0
+
+
+
+ GL_GNULIB_WCSNLEN=0
+
+
+
+ GL_GNULIB_WCSCPY=0
+
+
+
+ GL_GNULIB_WCPCPY=0
+
+
+
+ GL_GNULIB_WCSNCPY=0
+
+
+
+ GL_GNULIB_WCPNCPY=0
+
+
+
+ GL_GNULIB_WCSCAT=0
+
+
+
+ GL_GNULIB_WCSNCAT=0
+
+
+
+ GL_GNULIB_WCSCMP=0
+
+
+
+ GL_GNULIB_WCSNCMP=0
+
+
+
+ GL_GNULIB_WCSCASECMP=0
+
+
+
+ GL_GNULIB_WCSNCASECMP=0
+
+
+
+ GL_GNULIB_WCSCOLL=0
+
+
+
+ GL_GNULIB_WCSXFRM=0
+
+
+
+ GL_GNULIB_WCSDUP=0
+
+
+
+ GL_GNULIB_WCSCHR=0
+
+
+
+ GL_GNULIB_WCSRCHR=0
+
+
+
+ GL_GNULIB_WCSCSPN=0
+
+
+
+ GL_GNULIB_WCSSPN=0
+
+
+
+ GL_GNULIB_WCSPBRK=0
+
+
+
+ GL_GNULIB_WCSSTR=0
+
+
+
+ GL_GNULIB_WCSTOK=0
+
+
+
+ GL_GNULIB_WCSWIDTH=0
+
+
+
+ GL_GNULIB_WCSFTIME=0
+
+
+
+ GL_GNULIB_MDA_WCSDUP=1
+
+
+
+
+
+ GL_GNULIB__EXIT=0
+
+
+
+ GL_GNULIB_ALIGNED_ALLOC=0
+
+
+
+ GL_GNULIB_ATOLL=0
+
+
+
+ GL_GNULIB_CALLOC_GNU=0
+
+
+
+ GL_GNULIB_CALLOC_POSIX=0
+
+
+
+ GL_GNULIB_CANONICALIZE_FILE_NAME=0
+
+
+
+ GL_GNULIB_FREE_POSIX=0
+
+
+
+ GL_GNULIB_GETLOADAVG=0
+
+
+
+ GL_GNULIB_GETSUBOPT=0
+
+
+
+ GL_GNULIB_GRANTPT=0
+
+
+
+ GL_GNULIB_MALLOC_GNU=0
+
+
+
+ GL_GNULIB_MALLOC_POSIX=0
+
+
+
+ GL_GNULIB_MBTOWC=0
+
+
+
+ GL_GNULIB_MKDTEMP=0
+
+
+
+ GL_GNULIB_MKOSTEMP=0
+
+
+
+ GL_GNULIB_MKOSTEMPS=0
+
+
+
+ GL_GNULIB_MKSTEMP=0
+
+
+
+ GL_GNULIB_MKSTEMPS=0
+
+
+
+ GL_GNULIB_POSIX_MEMALIGN=0
+
+
+
+ GL_GNULIB_POSIX_OPENPT=0
+
+
+
+ GL_GNULIB_PTSNAME=0
+
+
+
+ GL_GNULIB_PTSNAME_R=0
+
+
+
+ GL_GNULIB_PUTENV=0
+
+
+
+ GL_GNULIB_QSORT_R=0
+
+
+
+ GL_GNULIB_RANDOM=0
+
+
+
+ GL_GNULIB_RANDOM_R=0
+
+
+
+ GL_GNULIB_REALLOCARRAY=0
+
+
+
+ GL_GNULIB_REALLOC_GNU=0
+
+
+
+ GL_GNULIB_REALLOC_POSIX=0
+
+
+
+ GL_GNULIB_REALPATH=0
+
+
+
+ GL_GNULIB_RPMATCH=0
+
+
+
+ GL_GNULIB_SECURE_GETENV=0
+
+
+
+ GL_GNULIB_SETENV=0
+
+
+
+ GL_GNULIB_STRTOD=0
+
+
+
+ GL_GNULIB_STRTOL=0
+
+
+
+ GL_GNULIB_STRTOLD=0
+
+
+
+ GL_GNULIB_STRTOLL=0
+
+
+
+ GL_GNULIB_STRTOUL=0
+
+
+
+ GL_GNULIB_STRTOULL=0
+
+
+
+ GL_GNULIB_SYSTEM_POSIX=0
+
+
+
+ GL_GNULIB_UNLOCKPT=0
+
+
+
+ GL_GNULIB_UNSETENV=0
+
+
+
+ GL_GNULIB_WCTOMB=0
+
+
+
+ GL_GNULIB_MDA_ECVT=1
+
+
+
+ GL_GNULIB_MDA_FCVT=1
+
+
+
+ GL_GNULIB_MDA_GCVT=1
+
+
+
+ GL_GNULIB_MDA_MKTEMP=1
+
+
+
+ GL_GNULIB_MDA_PUTENV=1
+
+
+
+
+ HAVE__EXIT=1;
+ HAVE_ALIGNED_ALLOC=1;
+ HAVE_ATOLL=1;
+ HAVE_CANONICALIZE_FILE_NAME=1;
+ HAVE_DECL_ECVT=1;
+ HAVE_DECL_FCVT=1;
+ HAVE_DECL_GCVT=1;
+ HAVE_DECL_GETLOADAVG=1;
+ HAVE_GETSUBOPT=1;
+ HAVE_GRANTPT=1;
+ HAVE_INITSTATE=1;
+ HAVE_DECL_INITSTATE=1;
+ HAVE_MBTOWC=1;
+ HAVE_MKDTEMP=1;
+ HAVE_MKOSTEMP=1;
+ HAVE_MKOSTEMPS=1;
+ HAVE_MKSTEMP=1;
+ HAVE_MKSTEMPS=1;
+ HAVE_POSIX_MEMALIGN=1;
+ HAVE_POSIX_OPENPT=1;
+ HAVE_PTSNAME=1;
+ HAVE_PTSNAME_R=1;
+ HAVE_QSORT_R=1;
+ HAVE_RANDOM=1;
+ HAVE_RANDOM_H=1;
+ HAVE_RANDOM_R=1;
+ HAVE_REALLOCARRAY=1;
+ HAVE_REALPATH=1;
+ HAVE_RPMATCH=1;
+ HAVE_SECURE_GETENV=1;
+ HAVE_SETENV=1;
+ HAVE_DECL_SETENV=1;
+ HAVE_SETSTATE=1;
+ HAVE_DECL_SETSTATE=1;
+ HAVE_STRTOD=1;
+ HAVE_STRTOL=1;
+ HAVE_STRTOLD=1;
+ HAVE_STRTOLL=1;
+ HAVE_STRTOUL=1;
+ HAVE_STRTOULL=1;
+ HAVE_STRUCT_RANDOM_DATA=1;
+ HAVE_SYS_LOADAVG_H=0;
+ HAVE_UNLOCKPT=1;
+ HAVE_DECL_UNSETENV=1;
+ REPLACE_ALIGNED_ALLOC=0;
+ REPLACE_CALLOC_FOR_CALLOC_GNU=0;
+ REPLACE_CALLOC_FOR_CALLOC_POSIX=0;
+ REPLACE_CANONICALIZE_FILE_NAME=0;
+ REPLACE_FREE=0;
+ REPLACE_INITSTATE=0;
+ REPLACE_MALLOC_FOR_MALLOC_GNU=0;
+ REPLACE_MALLOC_FOR_MALLOC_POSIX=0;
+ REPLACE_MBTOWC=0;
+ REPLACE_MKSTEMP=0;
+ REPLACE_POSIX_MEMALIGN=0;
+ REPLACE_PTSNAME=0;
+ REPLACE_PTSNAME_R=0;
+ REPLACE_PUTENV=0;
+ REPLACE_QSORT_R=0;
+ REPLACE_RANDOM=0;
+ REPLACE_RANDOM_R=0;
+ REPLACE_REALLOC_FOR_REALLOC_GNU=0;
+ REPLACE_REALLOC_FOR_REALLOC_POSIX=0;
+ REPLACE_REALLOCARRAY=0;
+ REPLACE_REALPATH=0;
+ REPLACE_SETENV=0;
+ REPLACE_SETSTATE=0;
+ REPLACE_STRTOD=0;
+ REPLACE_STRTOL=0;
+ REPLACE_STRTOLD=0;
+ REPLACE_STRTOLL=0;
+ REPLACE_STRTOUL=0;
+ REPLACE_STRTOULL=0;
+ REPLACE_UNSETENV=0;
+ REPLACE_WCTOMB=0;
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc is ptrdiff_t safe" >&5
+$as_echo_n "checking whether malloc is ptrdiff_t safe... " >&6; }
+if ${gl_cv_malloc_ptrdiff+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+
+int
+main ()
+{
+/* 64-bit ptrdiff_t is so wide that no practical platform
+ can exceed it. */
+ #define WIDE_PTRDIFF (PTRDIFF_MAX >> 31 >> 31 != 0)
+
+ /* On rare machines where size_t fits in ptrdiff_t there
+ is no problem. */
+ #define NARROW_SIZE (SIZE_MAX <= PTRDIFF_MAX)
+
+ /* glibc 2.30 and later malloc refuses to exceed ptrdiff_t
+ bounds even on 32-bit platforms. We don't know which
+ non-glibc systems are safe. */
+ #define KNOWN_SAFE (2 < __GLIBC__ + (30 <= __GLIBC_MINOR__))
+
+ #if WIDE_PTRDIFF || NARROW_SIZE || KNOWN_SAFE
+ return 0;
+ #else
+ #error "malloc might not be ptrdiff_t safe"
+ syntax error
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_malloc_ptrdiff=yes
+else
+ gl_cv_malloc_ptrdiff=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_malloc_ptrdiff" >&5
+$as_echo "$gl_cv_malloc_ptrdiff" >&6; }
+
+
+
+
+ test "$gl_cv_malloc_ptrdiff" = yes || REPLACE_MALLOC_FOR_MALLOC_POSIX=1
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc set errno on failure" >&5
+$as_echo_n "checking whether malloc, realloc, calloc set errno on failure... " >&6; }
+if ${gl_cv_func_malloc_posix+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ mingw*)
+ gl_cv_func_malloc_posix=no ;;
+ irix* | solaris*)
+
+ gl_cv_func_malloc_posix=no ;;
+ *)
+ gl_cv_func_malloc_posix=yes ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
+$as_echo "$gl_cv_func_malloc_posix" >&6; }
+
+
+
+
+
+ if test "$gl_cv_func_malloc_posix" = yes; then
+
+$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
+
+ else
+ REPLACE_MALLOC_FOR_MALLOC_POSIX=1
+ fi
+
+
+
+
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_CALLOC_FOR_CALLOC_POSIX=1
+ fi
+
+
+ HAVE_CHOWN=1;
+ HAVE_COPY_FILE_RANGE=1;
+ HAVE_DUP3=1;
+ HAVE_EUIDACCESS=1;
+ HAVE_EXECVPE=1;
+ HAVE_FACCESSAT=1;
+ HAVE_FCHDIR=1;
+ HAVE_FCHOWNAT=1;
+ HAVE_FDATASYNC=1;
+ HAVE_FSYNC=1;
+ HAVE_FTRUNCATE=1;
+ HAVE_GETDTABLESIZE=1;
+ HAVE_GETENTROPY=1;
+ HAVE_GETGROUPS=1;
+ HAVE_GETHOSTNAME=1;
+ HAVE_GETLOGIN=1;
+ HAVE_GETPAGESIZE=1;
+ HAVE_GETPASS=1;
+ HAVE_GROUP_MEMBER=1;
+ HAVE_LCHOWN=1;
+ HAVE_LINK=1;
+ HAVE_LINKAT=1;
+ HAVE_PIPE=1;
+ HAVE_PIPE2=1;
+ HAVE_PREAD=1;
+ HAVE_PWRITE=1;
+ HAVE_READLINK=1;
+ HAVE_READLINKAT=1;
+ HAVE_SETHOSTNAME=1;
+ HAVE_SLEEP=1;
+ HAVE_SYMLINK=1;
+ HAVE_SYMLINKAT=1;
+ HAVE_UNLINKAT=1;
+ HAVE_USLEEP=1;
+ HAVE_DECL_ENVIRON=1;
+ HAVE_DECL_EXECVPE=1;
+ HAVE_DECL_FCHDIR=1;
+ HAVE_DECL_FDATASYNC=1;
+ HAVE_DECL_GETDOMAINNAME=1;
+ HAVE_DECL_GETLOGIN=1;
+ HAVE_DECL_GETLOGIN_R=1;
+ HAVE_DECL_GETPAGESIZE=1;
+ HAVE_DECL_GETUSERSHELL=1;
+ HAVE_DECL_SETHOSTNAME=1;
+ HAVE_DECL_TRUNCATE=1;
+ HAVE_DECL_TTYNAME_R=1;
+ HAVE_OS_H=0;
+ HAVE_SYS_PARAM_H=0;
+ REPLACE_ACCESS=0;
+ REPLACE_CHOWN=0;
+ REPLACE_CLOSE=0;
+ REPLACE_COPY_FILE_RANGE=0;
+ REPLACE_DUP=0;
+ REPLACE_DUP2=0;
+ REPLACE_EXECL=0;
+ REPLACE_EXECLE=0;
+ REPLACE_EXECLP=0;
+ REPLACE_EXECV=0;
+ REPLACE_EXECVE=0;
+ REPLACE_EXECVP=0;
+ REPLACE_EXECVPE=0;
+ REPLACE_FACCESSAT=0;
+ REPLACE_FCHOWNAT=0;
+ REPLACE_FTRUNCATE=0;
+ REPLACE_GETCWD=0;
+ REPLACE_GETDOMAINNAME=0;
+ REPLACE_GETDTABLESIZE=0;
+ REPLACE_GETLOGIN_R=0;
+ REPLACE_GETGROUPS=0;
+ REPLACE_GETPAGESIZE=0;
+ REPLACE_GETPASS=0;
+ REPLACE_GETPASS_FOR_GETPASS_GNU=0;
+ REPLACE_ISATTY=0;
+ REPLACE_LCHOWN=0;
+ REPLACE_LINK=0;
+ REPLACE_LINKAT=0;
+ REPLACE_LSEEK=0;
+ REPLACE_PREAD=0;
+ REPLACE_PWRITE=0;
+ REPLACE_READ=0;
+ REPLACE_READLINK=0;
+ REPLACE_READLINKAT=0;
+ REPLACE_RMDIR=0;
+ REPLACE_SLEEP=0;
+ REPLACE_SYMLINK=0;
+ REPLACE_SYMLINKAT=0;
+ REPLACE_TRUNCATE=0;
+ REPLACE_TTYNAME_R=0;
+ REPLACE_UNLINK=0;
+ REPLACE_UNLINKAT=0;
+ REPLACE_USLEEP=0;
+ REPLACE_WRITE=0;
+ UNISTD_H_HAVE_SYS_RANDOM_H=0;
+ UNISTD_H_HAVE_WINSOCK2_H=0;
+ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+
+
+
+
+
+
+ if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
+
+$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
+
+ else
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+ fi
+
+
+
+
+ GL_GNULIB_ACCESS=0
+
+
+
+ GL_GNULIB_CHDIR=0
+
+
+
+ GL_GNULIB_CHOWN=0
+
+
+
+ GL_GNULIB_CLOSE=0
+
+
+
+ GL_GNULIB_COPY_FILE_RANGE=0
+
+
+
+ GL_GNULIB_DUP=0
+
+
+
+ GL_GNULIB_DUP2=0
+
+
+
+ GL_GNULIB_DUP3=0
+
+
+
+ GL_GNULIB_ENVIRON=0
+
+
+
+ GL_GNULIB_EUIDACCESS=0
+
+
+
+ GL_GNULIB_EXECL=0
+
+
+
+ GL_GNULIB_EXECLE=0
+
+
+
+ GL_GNULIB_EXECLP=0
+
+
+
+ GL_GNULIB_EXECV=0
+
+
+
+ GL_GNULIB_EXECVE=0
+
+
+
+ GL_GNULIB_EXECVP=0
+
+
+
+ GL_GNULIB_EXECVPE=0
+
+
+
+ GL_GNULIB_FACCESSAT=0
+
+
+
+ GL_GNULIB_FCHDIR=0
+
+
+
+ GL_GNULIB_FCHOWNAT=0
+
+
+
+ GL_GNULIB_FDATASYNC=0
+
+
+
+ GL_GNULIB_FSYNC=0
+
+
+
+ GL_GNULIB_FTRUNCATE=0
+
+
+
+ GL_GNULIB_GETCWD=0
+
+
+
+ GL_GNULIB_GETDOMAINNAME=0
+
+
+
+ GL_GNULIB_GETDTABLESIZE=0
+
+
+
+ GL_GNULIB_GETENTROPY=0
+
+
+
+ GL_GNULIB_GETGROUPS=0
+
+
+
+ GL_GNULIB_GETHOSTNAME=0
+
+
+
+ GL_GNULIB_GETLOGIN=0
+
+
+
+ GL_GNULIB_GETLOGIN_R=0
+
+
+
+ GL_GNULIB_GETOPT_POSIX=0
+
+
+
+ GL_GNULIB_GETPAGESIZE=0
+
+
+
+ GL_GNULIB_GETPASS=0
+
+
+
+ GL_GNULIB_GETPASS_GNU=0
+
+
+
+ GL_GNULIB_GETUSERSHELL=0
+
+
+
+ GL_GNULIB_GROUP_MEMBER=0
+
+
+
+ GL_GNULIB_ISATTY=0
+
+
+
+ GL_GNULIB_LCHOWN=0
+
+
+
+ GL_GNULIB_LINK=0
+
+
+
+ GL_GNULIB_LINKAT=0
+
+
+
+ GL_GNULIB_LSEEK=0
+
+
+
+ GL_GNULIB_PIPE=0
+
+
+
+ GL_GNULIB_PIPE2=0
+
+
+
+ GL_GNULIB_PREAD=0
+
+
+
+ GL_GNULIB_PWRITE=0
+
+
+
+ GL_GNULIB_READ=0
+
+
+
+ GL_GNULIB_READLINK=0
+
+
+
+ GL_GNULIB_READLINKAT=0
+
+
+
+ GL_GNULIB_RMDIR=0
+
+
+
+ GL_GNULIB_SETHOSTNAME=0
+
+
+
+ GL_GNULIB_SLEEP=0
+
+
+
+ GL_GNULIB_SYMLINK=0
+
+
+
+ GL_GNULIB_SYMLINKAT=0
+
+
+
+ GL_GNULIB_TRUNCATE=0
+
+
+
+ GL_GNULIB_TTYNAME_R=0
+
+
+
+ GL_GNULIB_UNISTD_H_GETOPT=0
+
+
+
+ GL_GNULIB_UNISTD_H_NONBLOCKING=0
+
+
+
+ GL_GNULIB_UNISTD_H_SIGPIPE=0
+
+
+
+ GL_GNULIB_UNLINK=0
+
+
+
+ GL_GNULIB_UNLINKAT=0
+
+
+
+ GL_GNULIB_USLEEP=0
+
+
+
+ GL_GNULIB_WRITE=0
+
+
+
+ GL_GNULIB_MDA_ACCESS=1
+
+
+
+ GL_GNULIB_MDA_CHDIR=1
+
+
+
+ GL_GNULIB_MDA_CLOSE=1
+
+
+
+ GL_GNULIB_MDA_DUP=1
+
+
+
+ GL_GNULIB_MDA_DUP2=1
+
+
+
+ GL_GNULIB_MDA_EXECL=1
+
+
+
+ GL_GNULIB_MDA_EXECLE=1
+
+
+
+ GL_GNULIB_MDA_EXECLP=1
+
+
+
+ GL_GNULIB_MDA_EXECV=1
+
+
+
+ GL_GNULIB_MDA_EXECVE=1
+
+
+
+ GL_GNULIB_MDA_EXECVP=1
+
+
+
+ GL_GNULIB_MDA_EXECVPE=1
+
+
+
+ GL_GNULIB_MDA_GETCWD=1
+
+
+
+ GL_GNULIB_MDA_GETPID=1
+
+
+
+ GL_GNULIB_MDA_ISATTY=1
+
+
+
+ GL_GNULIB_MDA_LSEEK=1
+
+
+
+ GL_GNULIB_MDA_READ=1
+
+
+
+ GL_GNULIB_MDA_RMDIR=1
+
+
+
+ GL_GNULIB_MDA_SWAB=1
+
+
+
+ GL_GNULIB_MDA_UNLINK=1
+
+
+
+ GL_GNULIB_MDA_WRITE=1
+
+
+
+
+ HAVE_STRUCT_SOCKADDR_STORAGE=1;
+ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+
+ HAVE_SA_FAMILY_T=1;
+ HAVE_ACCEPT4=1;
+
+
+
+
+
+ case "$host_os" in
+ osf*)
+
+$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h
+
+ ;;
+ esac
+
+ GL_GENERATE_SYS_SOCKET_H=false
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
+$as_echo_n "checking whether <sys/socket.h> is self-contained... " >&6; }
+if ${gl_cv_header_sys_socket_h_selfcontained+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/socket.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_sys_socket_h_selfcontained=yes
+else
+ gl_cv_header_sys_socket_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
+$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
+ if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+ for ac_func in shutdown
+do :
+ ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
+if test "x$ac_cv_func_shutdown" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SHUTDOWN 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_shutdown = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
+$as_echo_n "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
+if ${gl_cv_header_sys_socket_h_shut+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/socket.h>
+int
+main ()
+{
+int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_sys_socket_h_shut=yes
+else
+ gl_cv_header_sys_socket_h_shut=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
+$as_echo "$gl_cv_header_sys_socket_h_shut" >&6; }
+ if test $gl_cv_header_sys_socket_h_shut = no; then
+ GL_GENERATE_SYS_SOCKET_H=true
+ fi
+ fi
+ fi
+ # We need to check for ws2tcpip.h now.
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
+$as_echo_n "checking absolute name of <sys/socket.h>... " >&6; }
+if ${gl_cv_next_sys_socket_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_socket_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/socket.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/socket.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_socket_h
+ gl_cv_next_sys_socket_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
+$as_echo "$gl_cv_next_sys_socket_h" >&6; }
+ fi
+ NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'sys/socket.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_socket_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_SYS_SOCKET_H=1
+ else
+ HAVE_SYS_SOCKET_H=0
+ fi
+
+
+
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_WS2TCPIP_H=0
+ else
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+
+
+
+ ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_type_sa_family_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SA_FAMILY_T 1
+_ACEOF
+
+
+fi
+
+ if test $ac_cv_type_struct_sockaddr_storage = no; then
+ HAVE_STRUCT_SOCKADDR_STORAGE=0
+ fi
+ if test $ac_cv_type_sa_family_t = no; then
+ HAVE_SA_FAMILY_T=0
+ fi
+ if test $ac_cv_type_struct_sockaddr_storage != no; then
+ ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #ifdef HAVE_WS2TCPIP_H
+ #include <ws2tcpip.h>
+ #endif
+
+"
+if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+_ACEOF
+
+
+else
+ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
+fi
+
+ fi
+ if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+ GL_GENERATE_SYS_SOCKET_H=true
+ fi
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linux/if_alg.h has struct sockaddr_alg." >&5
+$as_echo_n "checking whether linux/if_alg.h has struct sockaddr_alg.... " >&6; }
+if ${gl_cv_header_linux_if_alg_salg+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/socket.h>
+ #include <linux/if_alg.h>
+ struct sockaddr_alg salg = {
+ .salg_family = AF_ALG,
+ .salg_type = "hash",
+ .salg_name = "sha1",
+ };
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_linux_if_alg_salg=yes
+else
+ gl_cv_header_linux_if_alg_salg=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_linux_if_alg_salg" >&5
+$as_echo "$gl_cv_header_linux_if_alg_salg" >&6; }
+ if test "$gl_cv_header_linux_if_alg_salg" = yes; then
+
+$as_echo "#define HAVE_LINUX_IF_ALG_H 1" >>confdefs.h
+
+ fi
+
+ use_af_alg=no
+
+# Check whether --with-linux-crypto was given.
+if test "${with_linux_crypto+set}" = set; then :
+ withval=$with_linux_crypto; use_af_alg=$withval
+else
+ use_af_alg=no
+fi
+
+ if test "$gl_cv_header_linux_if_alg_salg" != yes; then
+ if test "$use_af_alg" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Linux kernel cryptographic API not found" >&5
+$as_echo "$as_me: WARNING: Linux kernel cryptographic API not found" >&2;}
+ fi
+ use_af_alg=no
+ fi
+
+ if test "$use_af_alg" != no; then
+ USE_AF_ALG=1
+ else
+ USE_AF_ALG=0
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define USE_LINUX_CRYPTO_API $USE_AF_ALG
+_ACEOF
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+gl_mda_defines='
+#if defined _WIN32 && !defined __CYGWIN__
+#define access _access
+#define chdir _chdir
+#define chmod _chmod
+#define close _close
+#define creat _creat
+#define dup _dup
+#define dup2 _dup2
+#define ecvt _ecvt
+#define execl _execl
+#define execle _execle
+#define execlp _execlp
+#define execv _execv
+#define execve _execve
+#define execvp _execvp
+#define execvpe _execvpe
+#define fcloseall _fcloseall
+#define fcvt _fcvt
+#define fdopen _fdopen
+#define fileno _fileno
+#define gcvt _gcvt
+#define getcwd _getcwd
+#define getpid _getpid
+#define getw _getw
+#define isatty _isatty
+#define j0 _j0
+#define j1 _j1
+#define jn _jn
+#define lfind _lfind
+#define lsearch _lsearch
+#define lseek _lseek
+#define memccpy _memccpy
+#define mkdir _mkdir
+#define mktemp _mktemp
+#define open _open
+#define putenv _putenv
+#define putw _putw
+#define read _read
+#define rmdir _rmdir
+#define strdup _strdup
+#define swab _swab
+#define tempnam _tempnam
+#define tzset _tzset
+#define umask _umask
+#define unlink _unlink
+#define utime _utime
+#define wcsdup _wcsdup
+#define write _write
+#define y0 _y0
+#define y1 _y1
+#define yn _yn
+#endif
+'
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
+$as_echo_n "checking if environ is properly declared... " >&6; }
+if ${gt_cv_var_environ_declaration+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
+ #include <stdlib.h>
+
+ typedef struct { int foo; } foo_t;
+ extern foo_t environ;
+int
+main ()
+{
+environ.foo = 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_var_environ_declaration=no
+else
+ gt_cv_var_environ_declaration=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
+$as_echo "$gt_cv_var_environ_declaration" >&6; }
+ if test $gt_cv_var_environ_declaration = yes; then
+
+$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
+
+ fi
+
+
+ if test $gt_cv_var_environ_declaration != yes; then
+ HAVE_DECL_ENVIRON=0
+ fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
+$as_echo_n "checking for complete errno.h... " >&6; }
+if ${gl_cv_header_errno_h_complete+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
+#if !defined ENOMSG
+booboo
+#endif
+#if !defined EIDRM
+booboo
+#endif
+#if !defined ENOLINK
+booboo
+#endif
+#if !defined EPROTO
+booboo
+#endif
+#if !defined EMULTIHOP
+booboo
+#endif
+#if !defined EBADMSG
+booboo
+#endif
+#if !defined EOVERFLOW
+booboo
+#endif
+#if !defined ENOTSUP
+booboo
+#endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
+#if !defined ESTALE
+booboo
+#endif
+#if !defined EDQUOT
+booboo
+#endif
+#if !defined ECANCELED
+booboo
+#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
+#if !defined EILSEQ
+booboo
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "booboo" >/dev/null 2>&1; then :
+ gl_cv_header_errno_h_complete=no
+else
+ gl_cv_header_errno_h_complete=yes
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
+$as_echo "$gl_cv_header_errno_h_complete" >&6; }
+ if test $gl_cv_header_errno_h_complete = yes; then
+ GL_GENERATE_ERRNO_H=false
+ else
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_errno_h='<'errno.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
+$as_echo_n "checking absolute name of <errno.h>... " >&6; }
+if ${gl_cv_next_errno_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'errno.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_errno_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_errno_h
+ gl_cv_next_errno_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
+$as_echo "$gl_cv_next_errno_h" >&6; }
+ fi
+ NEXT_ERRNO_H=$gl_cv_next_errno_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'errno.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_errno_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H=$gl_next_as_first_directive
+
+
+
+
+ GL_GENERATE_ERRNO_H=true
+ fi
+
+ if $GL_GENERATE_ERRNO_H; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
+$as_echo_n "checking for EMULTIHOP value... " >&6; }
+if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#ifdef EMULTIHOP
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ gl_cv_header_errno_h_EMULTIHOP=yes
+else
+ gl_cv_header_errno_h_EMULTIHOP=no
+fi
+rm -f conftest*
+
+ if test $gl_cv_header_errno_h_EMULTIHOP = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EMULTIHOP
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ gl_cv_header_errno_h_EMULTIHOP=hidden
+fi
+rm -f conftest*
+
+ if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
+ if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" "
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug. */
+#include <stdio.h>
+#include <stdlib.h>
+"; then :
+
+fi
+
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
+$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
+ case $gl_cv_header_errno_h_EMULTIHOP in
+ yes | no)
+ EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
+ ;;
+ *)
+ EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP"
+ ;;
+ esac
+
+
+ fi
+
+
+ if $GL_GENERATE_ERRNO_H; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
+$as_echo_n "checking for ENOLINK value... " >&6; }
+if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#ifdef ENOLINK
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ gl_cv_header_errno_h_ENOLINK=yes
+else
+ gl_cv_header_errno_h_ENOLINK=no
+fi
+rm -f conftest*
+
+ if test $gl_cv_header_errno_h_ENOLINK = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef ENOLINK
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ gl_cv_header_errno_h_ENOLINK=hidden
+fi
+rm -f conftest*
+
+ if test $gl_cv_header_errno_h_ENOLINK = hidden; then
+ if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" "
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug. */
+#include <stdio.h>
+#include <stdlib.h>
+"; then :
+
+fi
+
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
+$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
+ case $gl_cv_header_errno_h_ENOLINK in
+ yes | no)
+ ENOLINK_HIDDEN=0; ENOLINK_VALUE=
+ ;;
+ *)
+ ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK"
+ ;;
+ esac
+
+
+ fi
+
+
+ if $GL_GENERATE_ERRNO_H; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
+$as_echo_n "checking for EOVERFLOW value... " >&6; }
+if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ gl_cv_header_errno_h_EOVERFLOW=yes
+else
+ gl_cv_header_errno_h_EOVERFLOW=no
+fi
+rm -f conftest*
+
+ if test $gl_cv_header_errno_h_EOVERFLOW = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "yes" >/dev/null 2>&1; then :
+ gl_cv_header_errno_h_EOVERFLOW=hidden
+fi
+rm -f conftest*
+
+ if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
+ if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" "
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug. */
+#include <stdio.h>
+#include <stdlib.h>
+"; then :
+
+fi
+
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
+$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
+ case $gl_cv_header_errno_h_EOVERFLOW in
+ yes | no)
+ EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
+ ;;
+ *)
+ EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW"
+ ;;
+ esac
+
+
+ fi
+
+
+ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
+
+for ac_func in strerror_r
+do :
+ ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
+if test "x$ac_cv_func_strerror_r" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR_R 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+$as_echo_n "checking whether strerror_r returns char *... " >&6; }
+if ${ac_cv_func_strerror_r_char_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+ # function. BeOS and DEC UNIX 4.0 fall in this category, but the
+ # former has a strerror_r that returns char*, while the latter
+ # has a strerror_r that returns `int'.
+ # This test should segfault on the DEC system.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ extern char *strerror_r ();
+int
+main ()
+{
+char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ return ! isalpha (x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
+$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+
+fi
+
+
+ XGETTEXT_EXTRA_OPTIONS=
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ctype.h defines __header_inline" >&5
+$as_echo_n "checking whether ctype.h defines __header_inline... " >&6; }
+if ${gl_cv_have___header_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+ #ifndef __header_inline
+ #error "<ctype.h> does not define __header_inline"
+ #endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ gl_cv_have___header_inline=yes
+else
+ gl_cv_have___header_inline=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have___header_inline" >&5
+$as_echo "$gl_cv_have___header_inline" >&6; }
+ if test "$gl_cv_have___header_inline" = yes; then
+
+$as_echo "#define HAVE___HEADER_INLINE 1" >>confdefs.h
+
+ fi
+
+
+
+
+ HAVE_FCNTL=1;
+ HAVE_OPENAT=1;
+ REPLACE_CREAT=0;
+ REPLACE_FCNTL=0;
+ REPLACE_OPEN=0;
+ REPLACE_OPENAT=0;
+
+
+
+
+
+ GL_GNULIB_CREAT=0
+
+
+
+ GL_GNULIB_FCNTL=0
+
+
+
+ GL_GNULIB_NONBLOCKING=0
+
+
+
+ GL_GNULIB_OPEN=0
+
+
+
+ GL_GNULIB_OPENAT=0
+
+
+
+ GL_GNULIB_MDA_CREAT=1
+
+
+
+ GL_GNULIB_MDA_OPEN=1
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
+$as_echo_n "checking for working fcntl.h... " >&6; }
+if ${gl_cv_header_working_fcntl_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess 'no' on native Windows.
+ mingw*) gl_cv_header_working_fcntl_h='no' ;;
+ *) gl_cv_header_working_fcntl_h=cross-compiling ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <io.h>
+ # include <stdlib.h>
+ # defined sleep(n) _sleep ((n) * 1000)
+ #endif
+ #include <fcntl.h>
+
+
+$gl_mda_defines
+
+ #ifndef O_NOATIME
+ #define O_NOATIME 0
+ #endif
+ #ifndef O_NOFOLLOW
+ #define O_NOFOLLOW 0
+ #endif
+ static int const constants[] =
+ {
+ O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+ O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+ };
+
+int
+main ()
+{
+
+ int result = !constants;
+ #if HAVE_SYMLINK
+ {
+ static char const sym[] = "conftest.sym";
+ if (symlink ("/dev/null", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ if (unlink (sym) != 0 || symlink (".", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ unlink (sym);
+ }
+ #endif
+ {
+ static char const file[] = "confdefs.h";
+ int fd = open (file, O_RDONLY | O_NOATIME);
+ if (fd < 0)
+ result |= 8;
+ else
+ {
+ struct stat st0;
+ if (fstat (fd, &st0) != 0)
+ result |= 16;
+ else
+ {
+ char c;
+ sleep (1);
+ if (read (fd, &c, 1) != 1)
+ result |= 24;
+ else
+ {
+ if (close (fd) != 0)
+ result |= 32;
+ else
+ {
+ struct stat st1;
+ if (stat (file, &st1) != 0)
+ result |= 40;
+ else
+ if (st0.st_atime != st1.st_atime)
+ result |= 64;
+ }
+ }
+ }
+ }
+ }
+ return result;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_header_working_fcntl_h=yes
+else
+ case $? in #(
+ 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+ 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+ 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+ *) gl_cv_header_working_fcntl_h='no';;
+ esac
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
+$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_O_NOATIME $ac_val
+_ACEOF
+
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_O_NOFOLLOW $ac_val
+_ACEOF
+
+
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_fcntl_h='<'fcntl.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
+$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
+if ${gl_cv_next_fcntl_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'fcntl.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_fcntl_h
+ gl_cv_next_fcntl_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
+$as_echo "$gl_cv_next_fcntl_h" >&6; }
+ fi
+ NEXT_FCNTL_H=$gl_cv_next_fcntl_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'fcntl.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_fcntl_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ HAVE_DECL_FCLOSEALL=1;
+ HAVE_DECL_FPURGE=1;
+ HAVE_DECL_FSEEKO=1;
+ HAVE_DECL_FTELLO=1;
+ HAVE_DECL_GETDELIM=1;
+ HAVE_DECL_GETLINE=1;
+ HAVE_DECL_OBSTACK_PRINTF=1;
+ HAVE_DECL_SNPRINTF=1;
+ HAVE_DECL_VSNPRINTF=1;
+ HAVE_DPRINTF=1;
+ HAVE_FSEEKO=1;
+ HAVE_FTELLO=1;
+ HAVE_PCLOSE=1;
+ HAVE_POPEN=1;
+ HAVE_RENAMEAT=1;
+ HAVE_VASPRINTF=1;
+ HAVE_VDPRINTF=1;
+ REPLACE_DPRINTF=0;
+ REPLACE_FCLOSE=0;
+ REPLACE_FDOPEN=0;
+ REPLACE_FFLUSH=0;
+ REPLACE_FOPEN=0;
+ REPLACE_FOPEN_FOR_FOPEN_GNU=0;
+ REPLACE_FPRINTF=0;
+ REPLACE_FPURGE=0;
+ REPLACE_FREOPEN=0;
+ REPLACE_FSEEK=0;
+ REPLACE_FSEEKO=0;
+ REPLACE_FTELL=0;
+ REPLACE_FTELLO=0;
+ REPLACE_GETDELIM=0;
+ REPLACE_GETLINE=0;
+ REPLACE_OBSTACK_PRINTF=0;
+ REPLACE_PERROR=0;
+ REPLACE_POPEN=0;
+ REPLACE_PRINTF=0;
+ REPLACE_REMOVE=0;
+ REPLACE_RENAME=0;
+ REPLACE_RENAMEAT=0;
+ REPLACE_SNPRINTF=0;
+ REPLACE_SPRINTF=0;
+ REPLACE_STDIO_READ_FUNCS=0;
+ REPLACE_STDIO_WRITE_FUNCS=0;
+ REPLACE_TMPFILE=0;
+ REPLACE_VASPRINTF=0;
+ REPLACE_VDPRINTF=0;
+ REPLACE_VFPRINTF=0;
+ REPLACE_VPRINTF=0;
+ REPLACE_VSNPRINTF=0;
+ REPLACE_VSPRINTF=0;
+
+
+
+ GL_GNULIB_DPRINTF=0
+
+
+
+ GL_GNULIB_FCLOSE=0
+
+
+
+ GL_GNULIB_FDOPEN=0
+
+
+
+ GL_GNULIB_FFLUSH=0
+
+
+
+ GL_GNULIB_FGETC=0
+
+
+
+ GL_GNULIB_FGETS=0
+
+
+
+ GL_GNULIB_FOPEN=0
+
+
+
+ GL_GNULIB_FOPEN_GNU=0
+
+
+
+ GL_GNULIB_FPRINTF=0
+
+
+
+ GL_GNULIB_FPRINTF_POSIX=0
+
+
+
+ GL_GNULIB_FPURGE=0
+
+
+
+ GL_GNULIB_FPUTC=0
+
+
+
+ GL_GNULIB_FPUTS=0
+
+
+
+ GL_GNULIB_FREAD=0
+
+
+
+ GL_GNULIB_FREOPEN=0
+
+
+
+ GL_GNULIB_FSCANF=0
+
+
+
+ GL_GNULIB_FSEEK=0
+
+
+
+ GL_GNULIB_FSEEKO=0
+
+
+
+ GL_GNULIB_FTELL=0
+
+
+
+ GL_GNULIB_FTELLO=0
+
+
+
+ GL_GNULIB_FWRITE=0
+
+
+
+ GL_GNULIB_GETC=0
+
+
+
+ GL_GNULIB_GETCHAR=0
+
+
+
+ GL_GNULIB_GETDELIM=0
+
+
+
+ GL_GNULIB_GETLINE=0
+
+
+
+ GL_GNULIB_OBSTACK_PRINTF=0
+
+
+
+ GL_GNULIB_OBSTACK_PRINTF_POSIX=0
+
+
+
+ GL_GNULIB_PCLOSE=0
+
+
+
+ GL_GNULIB_PERROR=0
+
+
+
+ GL_GNULIB_POPEN=0
+
+
+
+ GL_GNULIB_PRINTF=0
+
+
+
+ GL_GNULIB_PRINTF_POSIX=0
+
+
+
+ GL_GNULIB_PUTC=0
+
+
+
+ GL_GNULIB_PUTCHAR=0
+
+
+
+ GL_GNULIB_PUTS=0
+
+
+
+ GL_GNULIB_REMOVE=0
+
+
+
+ GL_GNULIB_RENAME=0
+
+
+
+ GL_GNULIB_RENAMEAT=0
+
+
+
+ GL_GNULIB_SCANF=0
+
+
+
+ GL_GNULIB_SNPRINTF=0
+
+
+
+ GL_GNULIB_SPRINTF_POSIX=0
+
+
+
+ GL_GNULIB_STDIO_H_NONBLOCKING=0
+
+
+
+ GL_GNULIB_STDIO_H_SIGPIPE=0
+
+
+
+ GL_GNULIB_TMPFILE=0
+
+
+
+ GL_GNULIB_VASPRINTF=0
+
+
+
+ GL_GNULIB_VFSCANF=0
+
+
+
+ GL_GNULIB_VSCANF=0
+
+
+
+ GL_GNULIB_VDPRINTF=0
+
+
+
+ GL_GNULIB_VFPRINTF=0
+
+
+
+ GL_GNULIB_VFPRINTF_POSIX=0
+
+
+
+ GL_GNULIB_VPRINTF=0
+
+
+
+ GL_GNULIB_VPRINTF_POSIX=0
+
+
+
+ GL_GNULIB_VSNPRINTF=0
+
+
+
+ GL_GNULIB_VSPRINTF_POSIX=0
+
+
+
+ GL_GNULIB_MDA_FCLOSEALL=1
+
+
+
+ GL_GNULIB_MDA_FDOPEN=1
+
+
+
+ GL_GNULIB_MDA_FILENO=1
+
+
+
+ GL_GNULIB_MDA_GETW=1
+
+
+
+ GL_GNULIB_MDA_PUTW=1
+
+
+
+ GL_GNULIB_MDA_TEMPNAM=1
+
+
+
+
+ HAVE_ACOSF=1;
+ HAVE_ACOSL=1;
+ HAVE_ASINF=1;
+ HAVE_ASINL=1;
+ HAVE_ATANF=1;
+ HAVE_ATANL=1;
+ HAVE_ATAN2F=1;
+ HAVE_CBRT=1;
+ HAVE_CBRTF=1;
+ HAVE_CBRTL=1;
+ HAVE_COPYSIGN=1;
+ HAVE_COPYSIGNL=1;
+ HAVE_COSF=1;
+ HAVE_COSL=1;
+ HAVE_COSHF=1;
+ HAVE_EXPF=1;
+ HAVE_EXPL=1;
+ HAVE_EXPM1=1;
+ HAVE_EXPM1F=1;
+ HAVE_FABSF=1;
+ HAVE_FABSL=1;
+ HAVE_FMA=1;
+ HAVE_FMAF=1;
+ HAVE_FMAL=1;
+ HAVE_FMODF=1;
+ HAVE_FMODL=1;
+ HAVE_FREXPF=1;
+ HAVE_HYPOTF=1;
+ HAVE_HYPOTL=1;
+ HAVE_ILOGB=1;
+ HAVE_ILOGBF=1;
+ HAVE_ILOGBL=1;
+ HAVE_ISNANF=1;
+ HAVE_ISNAND=1;
+ HAVE_ISNANL=1;
+ HAVE_LDEXPF=1;
+ HAVE_LOGF=1;
+ HAVE_LOGL=1;
+ HAVE_LOG10F=1;
+ HAVE_LOG10L=1;
+ HAVE_LOG1P=1;
+ HAVE_LOG1PF=1;
+ HAVE_LOG1PL=1;
+ HAVE_LOGBF=1;
+ HAVE_LOGBL=1;
+ HAVE_MODFF=1;
+ HAVE_MODFL=1;
+ HAVE_POWF=1;
+ HAVE_REMAINDER=1;
+ HAVE_REMAINDERF=1;
+ HAVE_RINT=1;
+ HAVE_RINTL=1;
+ HAVE_SINF=1;
+ HAVE_SINL=1;
+ HAVE_SINHF=1;
+ HAVE_SQRTF=1;
+ HAVE_SQRTL=1;
+ HAVE_TANF=1;
+ HAVE_TANL=1;
+ HAVE_TANHF=1;
+ HAVE_DECL_ACOSL=1;
+ HAVE_DECL_ASINL=1;
+ HAVE_DECL_ATANL=1;
+ HAVE_DECL_CBRTF=1;
+ HAVE_DECL_CBRTL=1;
+ HAVE_DECL_CEILF=1;
+ HAVE_DECL_CEILL=1;
+ HAVE_DECL_COPYSIGNF=1;
+ HAVE_DECL_COSL=1;
+ HAVE_DECL_EXPL=1;
+ HAVE_DECL_EXP2=1;
+ HAVE_DECL_EXP2F=1;
+ HAVE_DECL_EXP2L=1;
+ HAVE_DECL_EXPM1L=1;
+ HAVE_DECL_FLOORF=1;
+ HAVE_DECL_FLOORL=1;
+ HAVE_DECL_FREXPL=1;
+ HAVE_DECL_LDEXPL=1;
+ HAVE_DECL_LOGL=1;
+ HAVE_DECL_LOG10L=1;
+ HAVE_DECL_LOG2=1;
+ HAVE_DECL_LOG2F=1;
+ HAVE_DECL_LOG2L=1;
+ HAVE_DECL_LOGB=1;
+ HAVE_DECL_REMAINDER=1;
+ HAVE_DECL_REMAINDERL=1;
+ HAVE_DECL_RINTF=1;
+ HAVE_DECL_ROUND=1;
+ HAVE_DECL_ROUNDF=1;
+ HAVE_DECL_ROUNDL=1;
+ HAVE_DECL_SINL=1;
+ HAVE_DECL_SQRTL=1;
+ HAVE_DECL_TANL=1;
+ HAVE_DECL_TRUNC=1;
+ HAVE_DECL_TRUNCF=1;
+ HAVE_DECL_TRUNCL=1;
+ REPLACE_ACOSF=0;
+ REPLACE_ASINF=0;
+ REPLACE_ATANF=0;
+ REPLACE_ATAN2F=0;
+ REPLACE_CBRTF=0;
+ REPLACE_CBRTL=0;
+ REPLACE_CEIL=0;
+ REPLACE_CEILF=0;
+ REPLACE_CEILL=0;
+ REPLACE_COSF=0;
+ REPLACE_COSHF=0;
+ REPLACE_EXPF=0;
+ REPLACE_EXPL=0;
+ REPLACE_EXPM1=0;
+ REPLACE_EXPM1F=0;
+ REPLACE_EXPM1L=0;
+ REPLACE_EXP2=0;
+ REPLACE_EXP2L=0;
+ REPLACE_FABSL=0;
+ REPLACE_FLOOR=0;
+ REPLACE_FLOORF=0;
+ REPLACE_FLOORL=0;
+ REPLACE_FMA=0;
+ REPLACE_FMAF=0;
+ REPLACE_FMAL=0;
+ REPLACE_FMOD=0;
+ REPLACE_FMODF=0;
+ REPLACE_FMODL=0;
+ REPLACE_FREXPF=0;
+ REPLACE_FREXP=0;
+ REPLACE_FREXPL=0;
+ REPLACE_HUGE_VAL=0;
+ REPLACE_HYPOT=0;
+ REPLACE_HYPOTF=0;
+ REPLACE_HYPOTL=0;
+ REPLACE_ILOGB=0;
+ REPLACE_ILOGBF=0;
+ REPLACE_ILOGBL=0;
+ REPLACE_ISFINITE=0;
+ REPLACE_ISINF=0;
+ REPLACE_ISNAN=0;
+ REPLACE_LDEXPL=0;
+ REPLACE_LOG=0;
+ REPLACE_LOGF=0;
+ REPLACE_LOGL=0;
+ REPLACE_LOG10=0;
+ REPLACE_LOG10F=0;
+ REPLACE_LOG10L=0;
+ REPLACE_LOG1P=0;
+ REPLACE_LOG1PF=0;
+ REPLACE_LOG1PL=0;
+ REPLACE_LOG2=0;
+ REPLACE_LOG2F=0;
+ REPLACE_LOG2L=0;
+ REPLACE_LOGB=0;
+ REPLACE_LOGBF=0;
+ REPLACE_LOGBL=0;
+ REPLACE_MODF=0;
+ REPLACE_MODFF=0;
+ REPLACE_MODFL=0;
+ REPLACE_NAN=0;
+ REPLACE_REMAINDER=0;
+ REPLACE_REMAINDERF=0;
+ REPLACE_REMAINDERL=0;
+ REPLACE_RINTL=0;
+ REPLACE_ROUND=0;
+ REPLACE_ROUNDF=0;
+ REPLACE_ROUNDL=0;
+ REPLACE_SIGNBIT=0;
+ REPLACE_SIGNBIT_USING_BUILTINS=0;
+ REPLACE_SINF=0;
+ REPLACE_SINHF=0;
+ REPLACE_SQRTF=0;
+ REPLACE_SQRTL=0;
+ REPLACE_TANF=0;
+ REPLACE_TANHF=0;
+ REPLACE_TRUNC=0;
+ REPLACE_TRUNCF=0;
+ REPLACE_TRUNCL=0;
+
+
+
+ GL_GNULIB_ACOSF=0
+
+
+
+ GL_GNULIB_ACOSL=0
+
+
+
+ GL_GNULIB_ASINF=0
+
+
+
+ GL_GNULIB_ASINL=0
+
+
+
+ GL_GNULIB_ATANF=0
+
+
+
+ GL_GNULIB_ATANL=0
+
+
+
+ GL_GNULIB_ATAN2F=0
+
+
+
+ GL_GNULIB_CBRT=0
+
+
+
+ GL_GNULIB_CBRTF=0
+
+
+
+ GL_GNULIB_CBRTL=0
+
+
+
+ GL_GNULIB_CEIL=0
+
+
+
+ GL_GNULIB_CEILF=0
+
+
+
+ GL_GNULIB_CEILL=0
+
+
+
+ GL_GNULIB_COPYSIGN=0
+
+
+
+ GL_GNULIB_COPYSIGNF=0
+
+
+
+ GL_GNULIB_COPYSIGNL=0
+
+
+
+ GL_GNULIB_COSF=0
+
+
+
+ GL_GNULIB_COSL=0
+
+
+
+ GL_GNULIB_COSHF=0
+
+
+
+ GL_GNULIB_EXPF=0
+
+
+
+ GL_GNULIB_EXPL=0
+
+
+
+ GL_GNULIB_EXP2=0
+
+
+
+ GL_GNULIB_EXP2F=0
+
+
+
+ GL_GNULIB_EXP2L=0
+
+
+
+ GL_GNULIB_EXPM1=0
+
+
+
+ GL_GNULIB_EXPM1F=0
+
+
+
+ GL_GNULIB_EXPM1L=0
+
+
+
+ GL_GNULIB_FABSF=0
+
+
+
+ GL_GNULIB_FABSL=0
+
+
+
+ GL_GNULIB_FLOOR=0
+
+
+
+ GL_GNULIB_FLOORF=0
+
+
+
+ GL_GNULIB_FLOORL=0
+
+
+
+ GL_GNULIB_FMA=0
+
+
+
+ GL_GNULIB_FMAF=0
+
+
+
+ GL_GNULIB_FMAL=0
+
+
+
+ GL_GNULIB_FMOD=0
+
+
+
+ GL_GNULIB_FMODF=0
+
+
+
+ GL_GNULIB_FMODL=0
+
+
+
+ GL_GNULIB_FREXPF=0
+
+
+
+ GL_GNULIB_FREXP=0
+
+
+
+ GL_GNULIB_FREXPL=0
+
+
+
+ GL_GNULIB_HYPOT=0
+
+
+
+ GL_GNULIB_HYPOTF=0
+
+
+
+ GL_GNULIB_HYPOTL=0
+
+
+
+ GL_GNULIB_ILOGB=0
+
+
+
+ GL_GNULIB_ILOGBF=0
+
+
+
+ GL_GNULIB_ILOGBL=0
+
+
+
+ GL_GNULIB_ISFINITE=0
+
+
+
+ GL_GNULIB_ISINF=0
+
+
+
+ GL_GNULIB_ISNAN=0
+
+
+
+ GL_GNULIB_ISNANF=0
+
+
+
+ GL_GNULIB_ISNAND=0
+
+
+
+ GL_GNULIB_ISNANL=0
+
+
+
+ GL_GNULIB_LDEXPF=0
+
+
+
+ GL_GNULIB_LDEXPL=0
+
+
+
+ GL_GNULIB_LOG=0
+
+
+
+ GL_GNULIB_LOGF=0
+
+
+
+ GL_GNULIB_LOGL=0
+
+
+
+ GL_GNULIB_LOG10=0
+
+
+
+ GL_GNULIB_LOG10F=0
+
+
+
+ GL_GNULIB_LOG10L=0
+
+
+
+ GL_GNULIB_LOG1P=0
+
+
+
+ GL_GNULIB_LOG1PF=0
+
+
+
+ GL_GNULIB_LOG1PL=0
+
+
+
+ GL_GNULIB_LOG2=0
+
+
+
+ GL_GNULIB_LOG2F=0
+
+
+
+ GL_GNULIB_LOG2L=0
+
+
+
+ GL_GNULIB_LOGB=0
+
+
+
+ GL_GNULIB_LOGBF=0
+
+
+
+ GL_GNULIB_LOGBL=0
+
+
+
+ GL_GNULIB_MODF=0
+
+
+
+ GL_GNULIB_MODFF=0
+
+
+
+ GL_GNULIB_MODFL=0
+
+
+
+ GL_GNULIB_POWF=0
+
+
+
+ GL_GNULIB_REMAINDER=0
+
+
+
+ GL_GNULIB_REMAINDERF=0
+
+
+
+ GL_GNULIB_REMAINDERL=0
+
+
+
+ GL_GNULIB_RINT=0
+
+
+
+ GL_GNULIB_RINTF=0
+
+
+
+ GL_GNULIB_RINTL=0
+
+
+
+ GL_GNULIB_ROUND=0
+
+
+
+ GL_GNULIB_ROUNDF=0
+
+
+
+ GL_GNULIB_ROUNDL=0
+
+
+
+ GL_GNULIB_SIGNBIT=0
+
+
+
+ GL_GNULIB_SINF=0
+
+
+
+ GL_GNULIB_SINL=0
+
+
+
+ GL_GNULIB_SINHF=0
+
+
+
+ GL_GNULIB_SQRTF=0
+
+
+
+ GL_GNULIB_SQRTL=0
+
+
+
+ GL_GNULIB_TANF=0
+
+
+
+ GL_GNULIB_TANL=0
+
+
+
+ GL_GNULIB_TANHF=0
+
+
+
+ GL_GNULIB_TRUNC=0
+
+
+
+ GL_GNULIB_TRUNCF=0
+
+
+
+ GL_GNULIB_TRUNCL=0
+
+
+
+ GL_GNULIB_MDA_J0=1
+
+
+
+ GL_GNULIB_MDA_J1=1
+
+
+
+ GL_GNULIB_MDA_JN=1
+
+
+
+ GL_GNULIB_MDA_Y0=1
+
+
+
+ GL_GNULIB_MDA_Y1=1
+
+
+
+ GL_GNULIB_MDA_YN=1
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5
+$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; }
+if ${gl_cv_var_stdin_large_offset+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+#if defined __SL64 && defined __SCLE /* cygwin */
+ /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+ fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
+ it is easier to do a version check than building a runtime test. */
+# include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
+ choke me
+# endif
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_var_stdin_large_offset=yes
+else
+ gl_cv_var_stdin_large_offset=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5
+$as_echo "$gl_cv_var_stdin_large_offset" >&6; }
+
+
+
+
+
+ case "$host_os" in
+ mingw*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
+$as_echo_n "checking for 64-bit off_t... " >&6; }
+if ${gl_cv_type_off_t_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_type_off_t_64=yes
+else
+ gl_cv_type_off_t_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
+$as_echo "$gl_cv_type_off_t_64" >&6; }
+ if test $gl_cv_type_off_t_64 = no; then
+ WINDOWS_64_BIT_OFF_T=1
+ else
+ WINDOWS_64_BIT_OFF_T=0
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
+$as_echo_n "checking for 64-bit st_size... " >&6; }
+if ${gl_cv_member_st_size_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ struct stat buf;
+ int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_member_st_size_64=yes
+else
+ gl_cv_member_st_size_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
+$as_echo "$gl_cv_member_st_size_64" >&6; }
+ if test $gl_cv_member_st_size_64 = no; then
+ WINDOWS_64_BIT_ST_SIZE=1
+ else
+ WINDOWS_64_BIT_ST_SIZE=0
+ fi
+ ;;
+ *)
+ WINDOWS_64_BIT_OFF_T=0
+ WINDOWS_64_BIT_ST_SIZE=0
+ ;;
+ esac
+
+
+
+
+
+
+
+
+
+
+
+$as_echo "#define _USE_STD_STAT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_types_h='<'sys/types.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
+$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
+if ${gl_cv_next_sys_types_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/types.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_types_h
+ gl_cv_next_sys_types_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
+$as_echo "$gl_cv_next_sys_types_h" >&6; }
+ fi
+ NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'sys/types.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_types_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+ WINDOWS_STAT_INODES=0
+
+
+
+ac_fn_c_check_decl "$LINENO" "fseeko" "ac_cv_have_decl_fseeko" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fseeko" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FSEEKO $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
+$as_echo_n "checking for fseeko... " >&6; }
+if ${gl_cv_func_fseeko+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+
+int
+main ()
+{
+fseeko (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_fseeko=yes
+else
+ gl_cv_func_fseeko=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
+$as_echo "$gl_cv_func_fseeko" >&6; }
+
+
+ if test $ac_cv_have_decl_fseeko = no; then
+ HAVE_DECL_FSEEKO=0
+ fi
+
+ if test $gl_cv_func_fseeko = no; then
+ HAVE_FSEEKO=0
+ else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FSEEKO=1
+ fi
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FSEEKO=1
+ fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+$as_echo_n "checking whether fflush works on input streams... " >&6; }
+if ${gl_cv_func_fflush_stdin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo hello world > conftest.txt
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+ *) gl_cv_func_fflush_stdin=cross ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+
+
+$gl_mda_defines
+
+int
+main ()
+{
+FILE *f = fopen ("conftest.txt", "r");
+ char buffer[10];
+ int fd;
+ int c;
+ if (f == NULL)
+ return 1;
+ fd = fileno (f);
+ if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+ { fclose (f); return 2; }
+ /* For deterministic results, ensure f read a bigger buffer. */
+ if (lseek (fd, 0, SEEK_CUR) == 5)
+ { fclose (f); return 3; }
+ /* POSIX requires fflush-fseek to set file offset of fd. This fails
+ on BSD systems and on mingw. */
+ if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+ { fclose (f); return 4; }
+ if (lseek (fd, 0, SEEK_CUR) != 5)
+ { fclose (f); return 5; }
+ /* Verify behaviour of fflush after ungetc. See
+ <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
+ /* Verify behaviour of fflush after a backup ungetc. This fails on
+ mingw. */
+ c = fgetc (f);
+ ungetc (c, f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 6; }
+ /* Verify behaviour of fflush after a non-backup ungetc. This fails
+ on glibc 2.8 and on BSD systems. */
+ c = fgetc (f);
+ ungetc ('@', f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 7; }
+ fclose (f);
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fflush_stdin=yes
+else
+ gl_cv_func_fflush_stdin=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm conftest.txt
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+$as_echo "$gl_cv_func_fflush_stdin" >&6; }
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) gl_func_fflush_stdin=1 ;;
+ *no) gl_func_fflush_stdin=0 ;;
+ *) gl_func_fflush_stdin='(-1)' ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
+_ACEOF
+
+
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) ;;
+ *) REPLACE_FSEEKO=1 ;;
+ esac
+
+ fi
+
+
+ HAVE_FCHMODAT=1;
+ HAVE_FSTATAT=1;
+ HAVE_FUTIMENS=1;
+ HAVE_GETUMASK=1;
+ HAVE_LCHMOD=1;
+ HAVE_LSTAT=1;
+ HAVE_MKDIRAT=1;
+ HAVE_MKFIFO=1;
+ HAVE_MKFIFOAT=1;
+ HAVE_MKNOD=1;
+ HAVE_MKNODAT=1;
+ HAVE_UTIMENSAT=1;
+ REPLACE_CHMOD=0;
+ REPLACE_FCHMODAT=0;
+ REPLACE_FSTAT=0;
+ REPLACE_FSTATAT=0;
+ REPLACE_FUTIMENS=0;
+ REPLACE_LSTAT=0;
+ REPLACE_MKDIR=0;
+ REPLACE_MKFIFO=0;
+ REPLACE_MKFIFOAT=0;
+ REPLACE_MKNOD=0;
+ REPLACE_MKNODAT=0;
+ REPLACE_STAT=0;
+ REPLACE_UTIMENSAT=0;
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
+$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
+if ${ac_cv_header_stat_broken+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
+#endif
+
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#endif
+
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#endif
+
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stat_broken=no
+else
+ ac_cv_header_stat_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
+$as_echo "$ac_cv_header_stat_broken" >&6; }
+if test $ac_cv_header_stat_broken = yes; then
+
+$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
+$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
+if ${gl_cv_next_sys_stat_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_stat_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/stat.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_stat_h
+ gl_cv_next_sys_stat_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
+$as_echo "$gl_cv_next_sys_stat_h" >&6; }
+ fi
+ NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'sys/stat.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_stat_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+ WINDOWS_STAT_TIMESPEC=0
+
+
+
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_type_nlink_t" = xyes; then :
+
+else
+
+$as_echo "#define nlink_t int" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+
+ case "$host_os" in
+ mingw*)
+ for ac_header in sdkddkver.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default"
+if test "x$ac_cv_header_sdkddkver_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SDKDDKVER_H 1
+_ACEOF
+
+fi
+
+done
+
+ ;;
+ esac
+
+
+
+
+
+
+
+ GL_GNULIB_CHMOD=0
+
+
+
+ GL_GNULIB_FCHMODAT=0
+
+
+
+ GL_GNULIB_FSTAT=0
+
+
+
+ GL_GNULIB_FSTATAT=0
+
+
+
+ GL_GNULIB_FUTIMENS=0
+
+
+
+ GL_GNULIB_GETUMASK=0
+
+
+
+ GL_GNULIB_LCHMOD=0
+
+
+
+ GL_GNULIB_LSTAT=0
+
+
+
+ GL_GNULIB_MKDIR=0
+
+
+
+ GL_GNULIB_MKDIRAT=0
+
+
+
+ GL_GNULIB_MKFIFO=0
+
+
+
+ GL_GNULIB_MKFIFOAT=0
+
+
+
+ GL_GNULIB_MKNOD=0
+
+
+
+ GL_GNULIB_MKNODAT=0
+
+
+
+ GL_GNULIB_STAT=0
+
+
+
+ GL_GNULIB_UTIMENSAT=0
+
+
+
+ GL_GNULIB_OVERRIDES_STRUCT_STAT=0
+
+
+
+ GL_GNULIB_MDA_CHMOD=1
+
+
+
+ GL_GNULIB_MDA_MKDIR=1
+
+
+
+ GL_GNULIB_MDA_UMASK=1
+
+
+
+
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "ftello" "ac_cv_have_decl_ftello" "$ac_includes_default"
+if test "x$ac_cv_have_decl_ftello" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FTELLO $ac_have_decl
+_ACEOF
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ungetc works on arbitrary bytes" >&5
+$as_echo_n "checking whether ungetc works on arbitrary bytes... " >&6; }
+if ${gl_cv_func_ungetc_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on bionic systems.
+ *-android*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+
+int
+main ()
+{
+FILE *f;
+ if (!(f = fopen ("conftest.tmp", "w+")))
+ return 1;
+ if (fputs ("abc", f) < 0)
+ { fclose (f); return 2; }
+ rewind (f);
+ if (fgetc (f) != 'a')
+ { fclose (f); return 3; }
+ if (fgetc (f) != 'b')
+ { fclose (f); return 4; }
+ if (ungetc ('d', f) != 'd')
+ { fclose (f); return 5; }
+ if (ftell (f) != 1)
+ { fclose (f); return 6; }
+ if (fgetc (f) != 'd')
+ { fclose (f); return 7; }
+ if (ftell (f) != 2)
+ { fclose (f); return 8; }
+ if (fseek (f, 0, SEEK_CUR) != 0)
+ { fclose (f); return 9; }
+ if (ftell (f) != 2)
+ { fclose (f); return 10; }
+ if (fgetc (f) != 'c')
+ { fclose (f); return 11; }
+ fclose (f);
+ remove ("conftest.tmp");
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_ungetc_works=yes
+else
+ gl_cv_func_ungetc_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ungetc_works" >&5
+$as_echo "$gl_cv_func_ungetc_works" >&6; }
+ gl_ftello_broken_after_ungetc=no
+ case "$gl_cv_func_ungetc_works" in
+ *yes) ;;
+ *)
+ case "$host_os" in
+ darwin*) gl_ftello_broken_after_ungetc=yes ;;
+ *)
+
+$as_echo "#define FUNC_UNGETC_BROKEN 1" >>confdefs.h
+
+ ;;
+ esac
+ ;;
+ esac
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_ftello = no; then
+ HAVE_DECL_FTELLO=0
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
+$as_echo_n "checking for ftello... " >&6; }
+if ${gl_cv_func_ftello+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+ftello (stdin);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_ftello=yes
+else
+ gl_cv_func_ftello=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
+$as_echo "$gl_cv_func_ftello" >&6; }
+ if test $gl_cv_func_ftello = no; then
+ HAVE_FTELLO=0
+ else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FTELLO=1
+ fi
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FTELLO=1
+ fi
+ if test $REPLACE_FTELLO = 0; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
+$as_echo_n "checking whether ftello works... " >&6; }
+if ${gl_cv_func_ftello_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_func_ftello_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_ftello_works="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_ftello_works="guessing yes" ;;
+ esac
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+ FILE *fp;
+
+ /* Create a file with some contents. */
+ fp = fopen (TESTFILE, "w");
+ if (fp == NULL)
+ return 70;
+ if (fwrite ("foogarsh", 1, 8, fp) < 8)
+ { fclose (fp); return 71; }
+ if (fclose (fp))
+ return 72;
+
+ /* The file's contents is now "foogarsh". */
+
+ /* Try writing after reading to EOF. */
+ fp = fopen (TESTFILE, "r+");
+ if (fp == NULL)
+ return 73;
+ if (fseek (fp, -1, SEEK_END))
+ { fclose (fp); return 74; }
+ if (!(getc (fp) == 'h'))
+ { fclose (fp); return 1; }
+ if (!(getc (fp) == EOF))
+ { fclose (fp); return 2; }
+ if (!(ftell (fp) == 8))
+ { fclose (fp); return 3; }
+ if (!(ftell (fp) == 8))
+ { fclose (fp); return 4; }
+ if (!(putc ('!', fp) == '!'))
+ { fclose (fp); return 5; }
+ if (!(ftell (fp) == 9))
+ { fclose (fp); return 6; }
+ if (!(fclose (fp) == 0))
+ return 7;
+ fp = fopen (TESTFILE, "r");
+ if (fp == NULL)
+ return 75;
+ {
+ char buf[10];
+ if (!(fread (buf, 1, 10, fp) == 9))
+ { fclose (fp); return 10; }
+ if (!(memcmp (buf, "foogarsh!", 9) == 0))
+ { fclose (fp); return 11; }
+ }
+ if (!(fclose (fp) == 0))
+ return 12;
+
+ /* The file's contents is now "foogarsh!". */
+
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_ftello_works=yes
+else
+ gl_cv_func_ftello_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
+$as_echo "$gl_cv_func_ftello_works" >&6; }
+ case "$gl_cv_func_ftello_works" in
+ *yes) ;;
+ *)
+ REPLACE_FTELLO=1
+
+$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
+
+ ;;
+ esac
+ fi
+ if test $REPLACE_FTELLO = 0; then
+
+ if test $gl_ftello_broken_after_ungetc = yes; then
+ REPLACE_FTELLO=1
+
+$as_echo "#define FTELLO_BROKEN_AFTER_UNGETC 1" >>confdefs.h
+
+ fi
+ fi
+ fi
+
+
+ HAVE_STRUCT_ADDRINFO=1;
+ HAVE_DECL_FREEADDRINFO=1;
+ HAVE_DECL_GAI_STRERROR=1;
+ HAVE_DECL_GETADDRINFO=1;
+ HAVE_DECL_GETNAMEINFO=1;
+ REPLACE_GAI_STRERROR=0;
+ REPLACE_GETADDRINFO=0;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_netdb_h='<'netdb.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netdb.h>" >&5
+$as_echo_n "checking absolute name of <netdb.h>... " >&6; }
+if ${gl_cv_next_netdb_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_netdb_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netdb.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'netdb.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_netdb_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_netdb_h
+ gl_cv_next_netdb_h='"'$gl_header'"'
+ else
+ gl_cv_next_netdb_h='<'netdb.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netdb_h" >&5
+$as_echo "$gl_cv_next_netdb_h" >&6; }
+ fi
+ NEXT_NETDB_H=$gl_cv_next_netdb_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'netdb.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_netdb_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_NETDB_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_netdb_h = yes; then
+ HAVE_NETDB_H=1
+ else
+ HAVE_NETDB_H=0
+ fi
+
+
+
+
+
+
+
+ HOSTENT_LIB=
+ gl_saved_libs="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if ${ac_cv_search_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl network net; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_gethostbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_gethostbyname+:} false; then :
+
+else
+ ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+$as_echo "$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ if test "$ac_cv_search_gethostbyname" != "none required"; then
+ HOSTENT_LIB="$ac_cv_search_gethostbyname"
+ fi
+fi
+
+ LIBS="$gl_saved_libs"
+ if test -z "$HOSTENT_LIB"; then
+ for ac_func in gethostbyname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTBYNAME 1
+_ACEOF
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in winsock2.h and -lws2_32" >&5
+$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; }
+if ${gl_cv_w32_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_w32_gethostbyname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+
+int
+main ()
+{
+gethostbyname(NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_w32_gethostbyname=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostbyname" >&5
+$as_echo "$gl_cv_w32_gethostbyname" >&6; }
+ if test "$gl_cv_w32_gethostbyname" = "yes"; then
+ HOSTENT_LIB="-lws2_32"
+ fi
+
+fi
+done
+
+ fi
+
+
+
+ SERVENT_LIB=
+ gl_saved_libs="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5
+$as_echo_n "checking for library containing getservbyname... " >&6; }
+if ${ac_cv_search_getservbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getservbyname ();
+int
+main ()
+{
+return getservbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket network net; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getservbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getservbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getservbyname+:} false; then :
+
+else
+ ac_cv_search_getservbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyname" >&5
+$as_echo "$ac_cv_search_getservbyname" >&6; }
+ac_res=$ac_cv_search_getservbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ if test "$ac_cv_search_getservbyname" != "none required"; then
+ SERVENT_LIB="$ac_cv_search_getservbyname"
+ fi
+fi
+
+ LIBS="$gl_saved_libs"
+ if test -z "$SERVENT_LIB"; then
+ for ac_func in getservbyname
+do :
+ ac_fn_c_check_func "$LINENO" "getservbyname" "ac_cv_func_getservbyname"
+if test "x$ac_cv_func_getservbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETSERVBYNAME 1
+_ACEOF
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservbyname in winsock2.h and -lws2_32" >&5
+$as_echo_n "checking for getservbyname in winsock2.h and -lws2_32... " >&6; }
+if ${gl_cv_w32_getservbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_w32_getservbyname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+
+int
+main ()
+{
+getservbyname(NULL,NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_w32_getservbyname=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getservbyname" >&5
+$as_echo "$gl_cv_w32_getservbyname" >&6; }
+ if test "$gl_cv_w32_getservbyname" = "yes"; then
+ SERVENT_LIB="-lws2_32"
+ fi
+
+fi
+done
+
+ fi
+
+
+
+
+
+
+
+
+
+ HAVE_INET_NTOP=1
+ INET_NTOP_LIB=
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+ if test $HAVE_WINSOCK2_H = 1; then
+ REPLACE_INET_NTOP=1
+ ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
+"
+if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_inet_ntop = yes; then
+ INET_NTOP_LIB="-lws2_32"
+ else
+ HAVE_DECL_INET_NTOP=0
+ fi
+ else
+ gl_save_LIBS=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
+$as_echo_n "checking for library containing inet_ntop... " >&6; }
+if ${ac_cv_search_inet_ntop+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntop ();
+int
+main ()
+{
+return inet_ntop ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl resolv network; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_ntop=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_ntop+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_ntop+:} false; then :
+
+else
+ ac_cv_search_inet_ntop=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
+$as_echo "$ac_cv_search_inet_ntop" >&6; }
+ac_res=$ac_cv_search_inet_ntop
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ for ac_func in inet_ntop
+do :
+ ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
+if test "x$ac_cv_func_inet_ntop" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_NTOP 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_inet_ntop = no; then
+ HAVE_INET_NTOP=0
+ fi
+
+fi
+
+ LIBS=$gl_save_LIBS
+
+ if test "$ac_cv_search_inet_ntop" != "no" \
+ && test "$ac_cv_search_inet_ntop" != "none required"; then
+ INET_NTOP_LIB="$ac_cv_search_inet_ntop"
+ fi
+
+
+ ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
+ #if HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+
+"
+if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_inet_ntop = no; then
+ HAVE_DECL_INET_NTOP=0
+ fi
+ fi
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
+$as_echo_n "checking for IPv4 sockets... " >&6; }
+if ${gl_cv_socket_ipv4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+int
+main ()
+{
+int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_socket_ipv4=yes
+else
+ gl_cv_socket_ipv4=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
+$as_echo "$gl_cv_socket_ipv4" >&6; }
+ if test $gl_cv_socket_ipv4 = yes; then
+
+$as_echo "#define HAVE_IPV4 1" >>confdefs.h
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
+$as_echo_n "checking for IPv6 sockets... " >&6; }
+if ${gl_cv_socket_ipv6+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+int
+main ()
+{
+int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_socket_ipv6=yes
+else
+ gl_cv_socket_ipv6=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
+$as_echo "$gl_cv_socket_ipv6" >&6; }
+ if test $gl_cv_socket_ipv6 = yes; then
+
+$as_echo "#define HAVE_IPV6 1" >>confdefs.h
+
+ fi
+
+
+
+ GL_GNULIB_GETADDRINFO=0
+
+
+
+ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getdelim" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETDELIM $ac_have_decl
+_ACEOF
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getline" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETLINE $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_getopt_h='<'getopt.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
+$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
+if ${gl_cv_next_getopt_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_getopt_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'getopt.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_getopt_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_getopt_h
+ gl_cv_next_getopt_h='"'$gl_header'"'
+ else
+ gl_cv_next_getopt_h='<'getopt.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
+$as_echo "$gl_cv_next_getopt_h" >&6; }
+ fi
+ NEXT_GETOPT_H=$gl_cv_next_getopt_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'getopt.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_getopt_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_getopt_h = yes; then
+ HAVE_GETOPT_H=1
+ else
+ HAVE_GETOPT_H=0
+ fi
+
+
+ gl_replace_getopt=
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ for ac_header in getopt.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
+if test "x$ac_cv_header_getopt_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_H 1
+_ACEOF
+
+else
+ gl_replace_getopt=yes
+fi
+
+done
+
+ fi
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ for ac_func in getopt_long_only
+do :
+ ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
+if test "x$ac_cv_func_getopt_long_only" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_LONG_ONLY 1
+_ACEOF
+
+else
+ gl_replace_getopt=yes
+fi
+done
+
+ fi
+
+ if test -z "$gl_replace_getopt"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
+$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
+if ${gl_cv_func_getopt_posix+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $cross_compiling = no; then
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
+ int c;
+
+ c = getopt (4, argv, "ab");
+ if (!(c == 'a'))
+ return 1;
+ c = getopt (4, argv, "ab");
+ if (!(c == -1))
+ return 2;
+ if (!(optind == 2))
+ return 3;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_posix=maybe
+else
+ gl_cv_func_getopt_posix=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ if test $gl_cv_func_getopt_posix = maybe; then
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ int c;
+
+ c = getopt (7, argv, "+abp:q:");
+ if (!(c == -1))
+ return 4;
+ if (!(strcmp (argv[0], "program") == 0))
+ return 5;
+ if (!(strcmp (argv[1], "donald") == 0))
+ return 6;
+ if (!(strcmp (argv[2], "-p") == 0))
+ return 7;
+ if (!(strcmp (argv[3], "billy") == 0))
+ return 8;
+ if (!(strcmp (argv[4], "duck") == 0))
+ return 9;
+ if (!(strcmp (argv[5], "-a") == 0))
+ return 10;
+ if (!(strcmp (argv[6], "bar") == 0))
+ return 11;
+ if (!(optind == 1))
+ return 12;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_posix=maybe
+else
+ gl_cv_func_getopt_posix=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ if test $gl_cv_func_getopt_posix = maybe; then
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
+ if (getopt (2, argv, "ab:") != 'a')
+ return 13;
+ if (getopt (2, argv, "ab:") != '?')
+ return 14;
+ if (optopt != 'b')
+ return 15;
+ if (optind != 2)
+ return 16;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_posix=yes
+else
+ gl_cv_func_getopt_posix=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ else
+ case "$host_os" in
+ darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+ *) gl_cv_func_getopt_posix="guessing yes";;
+ esac
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
+$as_echo "$gl_cv_func_getopt_posix" >&6; }
+ case "$gl_cv_func_getopt_posix" in
+ *no) gl_replace_getopt=yes ;;
+ esac
+ fi
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
+$as_echo_n "checking for working GNU getopt function... " >&6; }
+if ${gl_cv_func_getopt_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+ # optstring is necessary for programs like m4 that have POSIX-mandated
+ # semantics for supporting options interspersed with files.
+ # Also, since getopt_long is a GNU extension, we require optind=0.
+ # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+ # so take care to revert to the correct (non-)export state.
+ gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+ case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+ xx) gl_had_POSIXLY_CORRECT=exported ;;
+ x) gl_had_POSIXLY_CORRECT=yes ;;
+ *) gl_had_POSIXLY_CORRECT= ;;
+ esac
+ POSIXLY_CORRECT=1
+ export POSIXLY_CORRECT
+ if test "$cross_compiling" = yes; then :
+ gl_cv_func_getopt_gnu="$gl_cross_guess_normal"
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on Mac OS X. */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens. */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+ EXC_BAD_ACCESS. */
+static void *
+mach_exception_thread (void *arg)
+{
+ /* Buffer for a message to be received. */
+ struct {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+ } msg;
+ mach_msg_return_t retval;
+ /* Wait for a message on the exception port. */
+ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+ our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ if (retval != MACH_MSG_SUCCESS)
+ abort ();
+ exit (1);
+}
+static void
+nocrash_init (void)
+{
+ mach_port_t self = mach_task_self ();
+ /* Allocate a port on which the thread shall listen for exceptions. */
+ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+ == KERN_SUCCESS) {
+ /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
+ if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+ MACH_MSG_TYPE_MAKE_SEND)
+ == KERN_SUCCESS) {
+ /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
+ for us. */
+ exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+ /* Create the thread listening on the exception port. */
+ pthread_attr_t attr;
+ pthread_t thread;
+ if (pthread_attr_init (&attr) == 0
+ && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+ && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+ pthread_attr_destroy (&attr);
+ /* Replace the exception port info for these exceptions with our own.
+ Note that we replace the exception port for the entire task, not only
+ for a particular thread. This has the effect that when our exception
+ port gets the message, the thread specific exception port has already
+ been asked, and we don't need to bother about it.
+ See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
+ task_set_exception_ports (self, mask, our_exception_port,
+ EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+ }
+ }
+ }
+}
+#elif defined _WIN32 && ! defined __CYGWIN__
+/* Avoid a crash on native Windows. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+ switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+ {
+ case EXCEPTION_ACCESS_VIOLATION:
+ case EXCEPTION_IN_PAGE_ERROR:
+ case EXCEPTION_STACK_OVERFLOW:
+ case EXCEPTION_GUARD_PAGE:
+ case EXCEPTION_PRIV_INSTRUCTION:
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ exit (1);
+ }
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+ SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems. */
+#include <signal.h>
+#include <unistd.h>
+/* A POSIX signal handler. */
+static void
+exception_handler (int sig)
+{
+ _exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+ signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+ signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
+
+
+int
+main ()
+{
+
+ int result = 0;
+
+ nocrash_init();
+
+ /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
+ and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+ OSF/1 5.1, Solaris 10. */
+ {
+ static char conftest[] = "conftest";
+ static char plus[] = "-+";
+ char *argv[3] = { conftest, plus, NULL };
+ opterr = 0;
+ if (getopt (2, argv, "+a") != '?')
+ result |= 1;
+ }
+ /* This code succeeds on glibc 2.8, mingw,
+ and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+ IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
+ {
+ static char program[] = "program";
+ static char p[] = "-p";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, p, foo, bar, NULL };
+
+ optind = 1;
+ if (getopt (4, argv, "p::") != 'p')
+ result |= 2;
+ else if (optarg != NULL)
+ result |= 4;
+ else if (getopt (4, argv, "p::") != -1)
+ result |= 6;
+ else if (optind != 2)
+ result |= 8;
+ }
+ /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
+ {
+ static char program[] = "program";
+ static char foo[] = "foo";
+ static char p[] = "-p";
+ char *argv[] = { program, foo, p, NULL };
+ optind = 0;
+ if (getopt (3, argv, "-p") != 1)
+ result |= 16;
+ else if (getopt (3, argv, "-p") != 'p')
+ result |= 16;
+ }
+ /* This code fails on glibc 2.11. */
+ {
+ static char program[] = "program";
+ static char b[] = "-b";
+ static char a[] = "-a";
+ char *argv[] = { program, b, a, NULL };
+ optind = opterr = 0;
+ if (getopt (3, argv, "+:a:b") != 'b')
+ result |= 32;
+ else if (getopt (3, argv, "+:a:b") != ':')
+ result |= 32;
+ }
+ /* This code dumps core on glibc 2.14. */
+ {
+ static char program[] = "program";
+ static char w[] = "-W";
+ static char dummy[] = "dummy";
+ char *argv[] = { program, w, dummy, NULL };
+ optind = opterr = 1;
+ if (getopt (3, argv, "W;") != 'W')
+ result |= 64;
+ }
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_gnu=yes
+else
+ gl_cv_func_getopt_gnu=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ case $gl_had_POSIXLY_CORRECT in
+ exported) ;;
+ yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;;
+ *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
+$as_echo "$gl_cv_func_getopt_gnu" >&6; }
+ if test "$gl_cv_func_getopt_gnu" != yes; then
+ gl_replace_getopt=yes
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5
+$as_echo_n "checking for working GNU getopt_long function... " >&6; }
+if ${gl_cv_func_getopt_long_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+
+int
+main ()
+{
+static const struct option long_options[] =
+ {
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+ /* This code fails on OpenBSD 5.0. */
+ {
+ static char program[] = "program";
+ static char xtremel[] = "--xtremel";
+ char *argv[] = { program, xtremel, NULL };
+ int option_index;
+ optind = 1; opterr = 0;
+ if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+ return 1;
+ }
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getopt_long_gnu=yes
+else
+ gl_cv_func_getopt_long_gnu=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5
+$as_echo "$gl_cv_func_getopt_long_gnu" >&6; }
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ if test -z "$gl_pthreadlib_body_done"; then
+ gl_pthread_api=no
+ LIBPTHREAD=
+ LIBPMULTITHREAD=
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+ ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ gl_have_pthread_h=yes
+else
+ gl_have_pthread_h=no
+fi
+
+
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ #
+ # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+ # needs -pthread for some reason. See:
+ # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+ save_LIBS=$LIBS
+ for gl_pthread in '' '-pthread'; do
+ LIBS="$LIBS $gl_pthread"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+ pthread_mutex_t m;
+ pthread_mutexattr_t ma;
+
+int
+main ()
+{
+pthread_mutex_lock (&m);
+ pthread_mutexattr_init (&ma);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=$gl_pthread
+ LIBPMULTITHREAD=$gl_pthread
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$save_LIBS
+ test $gl_pthread_api = yes && break
+ done
+ echo "$as_me:29910: gl_pthread_api=$gl_pthread_api" >&5
+ echo "$as_me:29911: LIBPTHREAD=$LIBPTHREAD" >&5
+
+ gl_pthread_in_glibc=no
+ # On Linux with glibc >= 2.34, libc contains the fully functional
+ # pthread functions.
+ case "$host_os" in
+ linux*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky user" >/dev/null 2>&1; then :
+ gl_pthread_in_glibc=yes
+fi
+rm -f conftest*
+
+ ;;
+ esac
+ echo "$as_me:29936: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
+
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+ # The program links fine without libpthread. But it may actually
+ # need to link with libpthread in order to create multiple threads.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_kill=yes
+else
+ ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+ if test $gl_pthread_in_glibc = yes; then
+ LIBPMULTITHREAD=
+ else
+ LIBPMULTITHREAD=-lpthread
+ # On Solaris and HP-UX, most pthread functions exist also in libc.
+ # Therefore pthread_in_use() needs to actually try to create a
+ # thread: pthread_create from libc will fail, whereas
+ # pthread_create will actually create a thread.
+ # On Solaris 10 or newer, this test is no longer needed, because
+ # libc contains the fully functional pthread functions.
+ case "$host_os" in
+ solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+
+$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+ esac
+ fi
+
+fi
+
+ elif test $gl_pthread_api != yes; then
+ # Some library is needed. Try libpthread and libc_r.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_kill=yes
+else
+ ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=-lpthread
+ LIBPMULTITHREAD=-lpthread
+fi
+
+ if test $gl_pthread_api != yes; then
+ # For FreeBSD 4.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_pthread_kill=yes
+else
+ ac_cv_lib_c_r_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=-lc_r
+ LIBPMULTITHREAD=-lc_r
+fi
+
+ fi
+ fi
+ echo "$as_me:30090: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+$as_echo_n "checking whether POSIX threads API is available... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+$as_echo "$gl_pthread_api" >&6; }
+
+
+ if test $gl_pthread_api = yes; then
+
+$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
+
+ fi
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sched.h>
+int
+main ()
+{
+sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIB_SCHED_YIELD=
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_sched_yield=yes
+else
+ ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+ LIB_SCHED_YIELD=-lrt
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
+if ${ac_cv_lib_posix4_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_posix4_sched_yield=yes
+else
+ ac_cv_lib_posix4_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
+ LIB_SCHED_YIELD=-lposix4
+fi
+
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+ gl_pthreadlib_body_done=done
+ fi
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
+$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
+if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+ *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+ gl_cv_func_setlocale_null_all_mtsafe=no ;;
+ # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
+ *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
+ gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
+$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_all_mtsafe" in
+ *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
+_ACEOF
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
+$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
+if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ # Guess no on OpenBSD, AIX.
+ openbsd* | aix*)
+ gl_cv_func_setlocale_null_one_mtsafe=no ;;
+ # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
+ *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+ gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
+$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_one_mtsafe" in
+ *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
+_ACEOF
+
+
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ case "$host_os" in
+ mingw*) LIB_SETLOCALE_NULL= ;;
+ *)
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
+if ${gl_cv_have_weak+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ cygwin*)
+ gl_cv_have_weak="guessing no"
+ ;;
+ *)
+ gl_cv_have_weak=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main ()
+{
+xyzzy();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test $gl_cv_have_weak = maybe; then
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+ gl_cv_have_weak="guessing yes"
+else
+ gl_cv_have_weak="guessing no"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_have_weak=yes
+else
+ gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ ;;
+ esac
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+$as_echo "$gl_cv_have_weak" >&6; }
+ case "$gl_cv_have_weak" in
+ *yes)
+
+$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+ ;;
+ esac
+
+ case "$gl_cv_have_weak" in
+ *yes) LIB_SETLOCALE_NULL= ;;
+ *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_SETLOCALE_NULL=
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_limits_h='<'limits.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
+$as_echo_n "checking absolute name of <limits.h>... " >&6; }
+if ${gl_cv_next_limits_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_limits_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'limits.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_limits_h
+ gl_cv_next_limits_h='"'$gl_header'"'
+ else
+ gl_cv_next_limits_h='<'limits.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
+$as_echo "$gl_cv_next_limits_h" >&6; }
+ fi
+ NEXT_LIMITS_H=$gl_cv_next_limits_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'limits.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_limits_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has WORD_BIT, BOOL_WIDTH etc." >&5
+$as_echo_n "checking whether limits.h has WORD_BIT, BOOL_WIDTH etc.... " >&6; }
+if ${gl_cv_header_limits_width+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <limits.h>
+ long long llm = LLONG_MAX;
+ int wb = WORD_BIT;
+ int ullw = ULLONG_WIDTH;
+ int bw = BOOL_WIDTH;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_limits_width=yes
+else
+ gl_cv_header_limits_width=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
+$as_echo "$gl_cv_header_limits_width" >&6; }
+ if test "$gl_cv_header_limits_width" = yes; then
+ GL_GENERATE_LIMITS_H=false
+ else
+ GL_GENERATE_LIMITS_H=true
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
+$as_echo_n "checking for wint_t... " >&6; }
+if ${gt_cv_c_wint_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wchar.h>
+ wint_t foo = (wchar_t)'\0';
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_c_wint_t=yes
+else
+ gt_cv_c_wint_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
+$as_echo "$gt_cv_c_wint_t" >&6; }
+ if test $gt_cv_c_wint_t = yes; then
+
+$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5
+$as_echo_n "checking whether wint_t is large enough... " >&6; }
+if ${gl_cv_type_wint_t_large_enough+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wchar.h>
+ int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_type_wint_t_large_enough=yes
+else
+ gl_cv_type_wint_t_large_enough=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5
+$as_echo "$gl_cv_type_wint_t_large_enough" >&6; }
+ if test $gl_cv_type_wint_t_large_enough = no; then
+ GNULIBHEADERS_OVERRIDE_WINT_T=1
+ else
+ GNULIBHEADERS_OVERRIDE_WINT_T=0
+ fi
+ else
+ GNULIBHEADERS_OVERRIDE_WINT_T=0
+ fi
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5
+$as_echo_n "checking whether the compiler produces multi-arch binaries... " >&6; }
+if ${gl_cv_c_multiarch+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_c_multiarch=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64 | arm | arm64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5
+$as_echo "$gl_cv_c_multiarch" >&6; }
+ if test $gl_cv_c_multiarch = yes; then
+ APPLE_UNIVERSAL_BUILD=1
+ else
+ APPLE_UNIVERSAL_BUILD=0
+ fi
+
+
+
+
+
+
+
+
+$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+
+
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+
+
+
+ if test $ac_cv_header_inttypes_h = yes; then
+ HAVE_INTTYPES_H=1
+ else
+ HAVE_INTTYPES_H=0
+ fi
+
+
+
+ if test $ac_cv_header_sys_types_h = yes; then
+ HAVE_SYS_TYPES_H=1
+ else
+ HAVE_SYS_TYPES_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdint_h='<'stdint.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
+$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
+if ${gl_cv_next_stdint_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_stdint_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stdint.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stdint_h
+ gl_cv_next_stdint_h='"'$gl_header'"'
+ else
+ gl_cv_next_stdint_h='<'stdint.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
+$as_echo "$gl_cv_next_stdint_h" >&6; }
+ fi
+ NEXT_STDINT_H=$gl_cv_next_stdint_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'stdint.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdint_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_stdint_h = yes; then
+ HAVE_STDINT_H=1
+ else
+ HAVE_STDINT_H=0
+ fi
+
+
+ if test $ac_cv_header_stdint_h = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
+$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
+if ${gl_cv_header_working_stdint_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_header_working_stdint_h=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
+
+
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
+
+/* Check that SIZE_MAX has the correct type, if possible. */
+#if 201112 <= __STDC_VERSION__
+int k = _Generic (SIZE_MAX, size_t: 0);
+#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+extern size_t k;
+extern __typeof__ (SIZE_MAX) k;
+#endif
+
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+ ((t) ((t) 0 < (t) -1 \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+struct s {
+ int check_PTRDIFF:
+ PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
+ && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+ ? 1 : -1;
+ /* Detect bug in FreeBSD 6.0/ia64 and FreeBSD 13.0/arm64. */
+ int check_SIG_ATOMIC:
+ SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+ && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+ ? 1 : -1;
+ int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+ int check_WCHAR:
+ WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+ && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+ ? 1 : -1;
+ /* Detect bug in mingw. */
+ int check_WINT:
+ WINT_MIN == TYPE_MINIMUM (wint_t)
+ && WINT_MAX == TYPE_MAXIMUM (wint_t)
+ ? 1 : -1;
+
+ /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
+ int check_UINT8_C:
+ (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+ int check_UINT16_C:
+ (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+
+ /* Detect bugs in OpenBSD 3.9 stdint.h. */
+#ifdef UINT8_MAX
+ int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+ int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+ int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+ int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+ int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+ int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+ int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+ int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+ int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+ int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+ int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+ int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+ int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+ int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+ int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
+ # In general, assume it works.
+ *) gl_cv_header_working_stdint_h="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+
+
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+
+#include <stdio.h>
+#include <string.h>
+#define MVAL(macro) MVAL1(macro)
+#define MVAL1(expression) #expression
+static const char *macro_values[] =
+ {
+#ifdef INT8_MAX
+ MVAL (INT8_MAX),
+#endif
+#ifdef INT16_MAX
+ MVAL (INT16_MAX),
+#endif
+#ifdef INT32_MAX
+ MVAL (INT32_MAX),
+#endif
+#ifdef INT64_MAX
+ MVAL (INT64_MAX),
+#endif
+#ifdef UINT8_MAX
+ MVAL (UINT8_MAX),
+#endif
+#ifdef UINT16_MAX
+ MVAL (UINT16_MAX),
+#endif
+#ifdef UINT32_MAX
+ MVAL (UINT32_MAX),
+#endif
+#ifdef UINT64_MAX
+ MVAL (UINT64_MAX),
+#endif
+ NULL
+ };
+
+int
+main ()
+{
+
+ const char **mv;
+ for (mv = macro_values; *mv != NULL; mv++)
+ {
+ const char *value = *mv;
+ /* Test whether it looks like a cast expression. */
+ if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
+ || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
+ || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
+ || strncmp (value, "((int)"/*)*/, 6) == 0
+ || strncmp (value, "((signed short)"/*)*/, 15) == 0
+ || strncmp (value, "((signed char)"/*)*/, 14) == 0)
+ return mv - macro_values + 1;
+ }
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_header_working_stdint_h=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
+$as_echo "$gl_cv_header_working_stdint_h" >&6; }
+ fi
+
+ HAVE_C99_STDINT_H=0
+ HAVE_SYS_BITYPES_H=0
+ HAVE_SYS_INTTYPES_H=0
+ GL_GENERATE_STDINT_H=true
+ case "$gl_cv_header_working_stdint_h" in
+ *yes)
+ HAVE_C99_STDINT_H=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5
+$as_echo_n "checking whether stdint.h works without ISO C predefines... " >&6; }
+if ${gl_cv_header_stdint_without_STDC_macros+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_header_stdint_without_STDC_macros=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+
+
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+
+intmax_t im = INTMAX_MAX;
+int32_t i32 = INT32_C (0x7fffffff);
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_stdint_without_STDC_macros=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5
+$as_echo "$gl_cv_header_stdint_without_STDC_macros" >&6; }
+
+ if test $gl_cv_header_stdint_without_STDC_macros = no; then
+
+$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
+
+
+$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
+$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
+if ${gl_cv_header_stdint_width+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_header_stdint_width=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <stdint.h>
+
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+ int iw = UINTMAX_WIDTH;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_stdint_width=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
+$as_echo "$gl_cv_header_stdint_width" >&6; }
+ if test "$gl_cv_header_stdint_width" = yes; then
+ GL_GENERATE_STDINT_H=false
+ fi
+ ;;
+ *)
+ for ac_header in sys/inttypes.h sys/bitypes.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ if test $ac_cv_header_sys_inttypes_h = yes; then
+ HAVE_SYS_INTTYPES_H=1
+ fi
+ if test $ac_cv_header_sys_bitypes_h = yes; then
+ HAVE_SYS_BITYPES_H=1
+ fi
+
+
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+
+ for gltype in ptrdiff_t size_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+$as_echo_n "checking for bit size of $gltype... " >&6; }
+if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+#include <limits.h>"; then :
+
+else
+ result=unknown
+fi
+
+ eval gl_cv_bitsizeof_${gltype}=\$result
+
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
+
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+
+
+ fi
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+$as_echo_n "checking for bit size of $gltype... " >&6; }
+if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" "
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+#include <limits.h>"; then :
+
+else
+ result=unknown
+fi
+
+ eval gl_cv_bitsizeof_${gltype}=\$result
+
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
+
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+
+
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
+$as_echo_n "checking whether $gltype is signed... " >&6; }
+if eval \${gl_cv_type_${gltype}_signed+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ result=yes
+else
+ result=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval gl_cv_type_${gltype}_signed=\$result
+
+fi
+eval ac_res=\$gl_cv_type_${gltype}_signed
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval result=\$gl_cv_type_${gltype}_signed
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ if test "$result" = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGNED_${GLTYPE} 1
+_ACEOF
+
+ eval HAVE_SIGNED_${GLTYPE}=1
+ else
+ eval HAVE_SIGNED_${GLTYPE}=0
+ fi
+ done
+
+
+ gl_cv_type_ptrdiff_t_signed=yes
+ gl_cv_type_size_t_signed=no
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+
+
+ for gltype in ptrdiff_t size_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
+if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval gl_cv_type_${gltype}_suffix=no
+ eval result=\$gl_cv_type_${gltype}_signed
+ if test "$result" = yes; then
+ glsufu=
+ else
+ glsufu=u
+ fi
+ for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+ case $glsuf in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ i64) gltype1='__int64';;
+ u) gltype1='unsigned int';;
+ ul) gltype1='unsigned long int';;
+ ull) gltype1='unsigned long long int';;
+ ui64)gltype1='unsigned __int64';;
+ esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+ extern $gltype foo;
+ extern $gltype1 foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval gl_cv_type_${gltype}_suffix=\$glsuf
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
+
+ done
+
+
+ fi
+
+
+ for gltype in sig_atomic_t wchar_t wint_t ; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
+if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval gl_cv_type_${gltype}_suffix=no
+ eval result=\$gl_cv_type_${gltype}_signed
+ if test "$result" = yes; then
+ glsufu=
+ else
+ glsufu=u
+ fi
+ for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+ case $glsuf in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ i64) gltype1='__int64';;
+ u) gltype1='unsigned int';;
+ ul) gltype1='unsigned long int';;
+ ull) gltype1='unsigned long long int';;
+ ui64)gltype1='unsigned __int64';;
+ esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+
+ extern $gltype foo;
+ extern $gltype1 foo;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval gl_cv_type_${gltype}_suffix=\$glsuf
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
+
+ done
+
+
+
+ if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+ BITSIZEOF_WINT_T=32
+ fi
+
+ ;;
+ esac
+
+
+
+ GL_GENERATE_LIMITS_H=true
+
+
+
+
+
+
+
+ HAVE_DECL_IMAXABS=1;
+ HAVE_DECL_IMAXDIV=1;
+ HAVE_DECL_STRTOIMAX=1;
+ HAVE_DECL_STRTOUMAX=1;
+ HAVE_IMAXDIV_T=1;
+ REPLACE_STRTOIMAX=0;
+ REPLACE_STRTOUMAX=0;
+ INT32_MAX_LT_INTMAX_MAX=1;
+ INT64_MAX_EQ_LONG_MAX='defined _LP64';
+ PRIPTR_PREFIX=__PRIPTR_PREFIX;
+ UINT32_MAX_LT_UINTMAX_MAX=1;
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_inttypes_h='<'inttypes.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
+$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
+if ${gl_cv_next_inttypes_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_inttypes_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <inttypes.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'inttypes.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_inttypes_h
+ gl_cv_next_inttypes_h='"'$gl_header'"'
+ else
+ gl_cv_next_inttypes_h='<'inttypes.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
+$as_echo "$gl_cv_next_inttypes_h" >&6; }
+ fi
+ NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'inttypes.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_inttypes_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_IMAXABS=0
+
+
+
+ GL_GNULIB_IMAXDIV=0
+
+
+
+ GL_GNULIB_STRTOIMAX=0
+
+
+
+ GL_GNULIB_STRTOUMAX=0
+
+
+
+
+ HAVE_NL_LANGINFO=1;
+ REPLACE_NL_LANGINFO=0;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_langinfo_h='<'langinfo.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5
+$as_echo_n "checking absolute name of <langinfo.h>... " >&6; }
+if ${gl_cv_next_langinfo_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_langinfo_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'langinfo.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_langinfo_h
+ gl_cv_next_langinfo_h='"'$gl_header'"'
+ else
+ gl_cv_next_langinfo_h='<'langinfo.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5
+$as_echo "$gl_cv_next_langinfo_h" >&6; }
+ fi
+ NEXT_LANGINFO_H=$gl_cv_next_langinfo_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'langinfo.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_langinfo_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive
+
+
+
+
+
+ HAVE_LANGINFO_CODESET=0
+ HAVE_LANGINFO_T_FMT_AMPM=0
+ HAVE_LANGINFO_ALTMON=0
+ HAVE_LANGINFO_ERA=0
+ HAVE_LANGINFO_YESEXPR=0
+
+ if test $ac_cv_header_langinfo_h = yes; then
+ HAVE_LANGINFO_H=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5
+$as_echo_n "checking whether langinfo.h defines CODESET... " >&6; }
+if ${gl_cv_header_langinfo_codeset+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = CODESET;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_langinfo_codeset=yes
+else
+ gl_cv_header_langinfo_codeset=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5
+$as_echo "$gl_cv_header_langinfo_codeset" >&6; }
+ if test $gl_cv_header_langinfo_codeset = yes; then
+ HAVE_LANGINFO_CODESET=1
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5
+$as_echo_n "checking whether langinfo.h defines T_FMT_AMPM... " >&6; }
+if ${gl_cv_header_langinfo_t_fmt_ampm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = T_FMT_AMPM;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_langinfo_t_fmt_ampm=yes
+else
+ gl_cv_header_langinfo_t_fmt_ampm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5
+$as_echo "$gl_cv_header_langinfo_t_fmt_ampm" >&6; }
+ if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
+ HAVE_LANGINFO_T_FMT_AMPM=1
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ALTMON_1" >&5
+$as_echo_n "checking whether langinfo.h defines ALTMON_1... " >&6; }
+if ${gl_cv_header_langinfo_altmon+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = ALTMON_1;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_langinfo_altmon=yes
+else
+ gl_cv_header_langinfo_altmon=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_altmon" >&5
+$as_echo "$gl_cv_header_langinfo_altmon" >&6; }
+ if test $gl_cv_header_langinfo_altmon = yes; then
+ HAVE_LANGINFO_ALTMON=1
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5
+$as_echo_n "checking whether langinfo.h defines ERA... " >&6; }
+if ${gl_cv_header_langinfo_era+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = ERA;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_langinfo_era=yes
+else
+ gl_cv_header_langinfo_era=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5
+$as_echo "$gl_cv_header_langinfo_era" >&6; }
+ if test $gl_cv_header_langinfo_era = yes; then
+ HAVE_LANGINFO_ERA=1
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5
+$as_echo_n "checking whether langinfo.h defines YESEXPR... " >&6; }
+if ${gl_cv_header_langinfo_yesexpr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int a = YESEXPR;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_langinfo_yesexpr=yes
+else
+ gl_cv_header_langinfo_yesexpr=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5
+$as_echo "$gl_cv_header_langinfo_yesexpr" >&6; }
+ if test $gl_cv_header_langinfo_yesexpr = yes; then
+ HAVE_LANGINFO_YESEXPR=1
+ fi
+ else
+ HAVE_LANGINFO_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_NL_LANGINFO=0
+
+
+
+
+ HAVE_NEWLOCALE=1;
+ HAVE_DUPLOCALE=1;
+ HAVE_FREELOCALE=1;
+ REPLACE_LOCALECONV=0;
+ REPLACE_SETLOCALE=0;
+ REPLACE_NEWLOCALE=0;
+ REPLACE_DUPLOCALE=0;
+ REPLACE_FREELOCALE=0;
+ REPLACE_STRUCT_LCONV=0;
+ LOCALENAME_ENHANCE_LOCALE_FUNCS=0;
+
+
+ REPLACE_NULL=0;
+ HAVE_MAX_ALIGN_T=1;
+ HAVE_WCHAR_T=1;
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
+$as_echo_n "checking for wchar_t... " >&6; }
+if ${gt_cv_c_wchar_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ wchar_t foo = (wchar_t)'\0';
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_c_wchar_t=yes
+else
+ gt_cv_c_wchar_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
+$as_echo "$gt_cv_c_wchar_t" >&6; }
+ if test $gt_cv_c_wchar_t = yes; then
+
+$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+ GL_GENERATE_STDDEF_H=false
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
+$as_echo_n "checking for good max_align_t... " >&6; }
+if ${gl_cv_type_max_align_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* On FreeBSD 12.0/x86, max_align_t defined by <stddef.h> has
+ the correct alignment with the default (wrong) definition of
+ _Alignof, but a wrong alignment as soon as we activate an
+ ISO C compliant _Alignof definition. */
+ #if ((defined __GNUC__ && 4 <= __GNUC__) || defined __clang__) && !defined __cplusplus
+ #define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+ #endif
+ #include <stddef.h>
+ unsigned int s = sizeof (max_align_t);
+ #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+ int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+ #endif
+ typedef struct { char a; max_align_t b; } max_helper;
+ typedef struct { char a; long b; } long_helper;
+ typedef struct { char a; double b; } double_helper;
+ typedef struct { char a; long double b; } long_double_helper;
+ int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_type_max_align_t=yes
+else
+ gl_cv_type_max_align_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
+$as_echo "$gl_cv_type_max_align_t" >&6; }
+ if test $gl_cv_type_max_align_t = no; then
+ HAVE_MAX_ALIGN_T=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ if test $gt_cv_c_wchar_t = no; then
+ HAVE_WCHAR_T=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
+$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
+if ${gl_cv_decl_null_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ int test[2 * (sizeof NULL == sizeof (void *)) -1];
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_decl_null_works=yes
+else
+ gl_cv_decl_null_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
+$as_echo "$gl_cv_decl_null_works" >&6; }
+ if test $gl_cv_decl_null_works = no; then
+ REPLACE_NULL=1
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ if $GL_GENERATE_STDDEF_H; then
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stddef_h='<'stddef.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
+$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
+if ${gl_cv_next_stddef_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stddef.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stddef_h
+ gl_cv_next_stddef_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
+$as_echo "$gl_cv_next_stddef_h" >&6; }
+ fi
+ NEXT_STDDEF_H=$gl_cv_next_stddef_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'stddef.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stddef_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
+
+
+
+
+ fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
+$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
+if ${gl_cv_header_locale_has_locale_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+ locale_t x;
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_locale_has_locale_t=yes
+else
+ gl_cv_header_locale_has_locale_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
+$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
+
+
+ if test $ac_cv_header_xlocale_h = yes; then
+ HAVE_XLOCALE_H=1
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ else
+ gl_cv_header_locale_h_needs_xlocale_h=yes
+ fi
+ HAVE_LOCALE_T=1
+ else
+ HAVE_XLOCALE_H=0
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ HAVE_LOCALE_T=1
+ else
+ HAVE_LOCALE_T=0
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+ case "$host_os" in
+ solaris*)
+
+$as_echo "#define _LCONV_C99 1" >>confdefs.h
+
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
+$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
+if ${gl_cv_header_locale_h_posix2001+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+ int x = LC_MESSAGES;
+ int y = sizeof (((struct lconv *) 0)->decimal_point);
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_locale_h_posix2001=yes
+else
+ gl_cv_header_locale_h_posix2001=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
+$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
+$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
+if ${gl_cv_sys_struct_lconv_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+ struct lconv l;
+ int x = sizeof (l.decimal_point);
+ int y = sizeof (l.int_p_cs_precedes);
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_lconv_ok=yes
+else
+ gl_cv_sys_struct_lconv_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
+$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
+ if test $gl_cv_sys_struct_lconv_ok = no; then
+ case "$host_os" in
+ mingw*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef _MSC_VER
+ Special
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Special" >/dev/null 2>&1; then :
+
+else
+ REPLACE_STRUCT_LCONV=1
+fi
+rm -f conftest*
+
+ ;;
+ *) REPLACE_STRUCT_LCONV=1 ;;
+ esac
+ fi
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_locale_h='<'locale.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
+$as_echo_n "checking absolute name of <locale.h>... " >&6; }
+if ${gl_cv_next_locale_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'locale.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_locale_h
+ gl_cv_next_locale_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
+$as_echo "$gl_cv_next_locale_h" >&6; }
+ fi
+ NEXT_LOCALE_H=$gl_cv_next_locale_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'locale.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_locale_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_LOCALECONV=0
+
+
+
+ GL_GNULIB_SETLOCALE=0
+
+
+
+ GL_GNULIB_SETLOCALE_NULL=0
+
+
+
+ GL_GNULIB_DUPLOCALE=0
+
+
+
+ GL_GNULIB_LOCALENAME=0
+
+
+
+
+
+ gl_threads_api=none
+ LIBTHREAD=
+ LTLIBTHREAD=
+ LIBMULTITHREAD=
+ LTLIBMULTITHREAD=
+ if test "$gl_use_threads" != no; then
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
+if ${gl_cv_have_weak+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ cygwin*)
+ gl_cv_have_weak="guessing no"
+ ;;
+ *)
+ gl_cv_have_weak=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main ()
+{
+xyzzy();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test $gl_cv_have_weak = maybe; then
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+ gl_cv_have_weak="guessing yes"
+else
+ gl_cv_have_weak="guessing no"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_have_weak=yes
+else
+ gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ ;;
+ esac
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+$as_echo "$gl_cv_have_weak" >&6; }
+ case "$gl_cv_have_weak" in
+ *yes)
+
+$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+ ;;
+ esac
+
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+
+ :
+ fi
+ if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+
+ gl_have_isoc_threads="$ac_cv_header_threads_h"
+ fi
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+
+
+ if test -z "$gl_pthreadlib_body_done"; then
+ gl_pthread_api=no
+ LIBPTHREAD=
+ LIBPMULTITHREAD=
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+ ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ gl_have_pthread_h=yes
+else
+ gl_have_pthread_h=no
+fi
+
+
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ #
+ # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+ # needs -pthread for some reason. See:
+ # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+ save_LIBS=$LIBS
+ for gl_pthread in '' '-pthread'; do
+ LIBS="$LIBS $gl_pthread"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+ pthread_mutex_t m;
+ pthread_mutexattr_t ma;
+
+int
+main ()
+{
+pthread_mutex_lock (&m);
+ pthread_mutexattr_init (&ma);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=$gl_pthread
+ LIBPMULTITHREAD=$gl_pthread
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$save_LIBS
+ test $gl_pthread_api = yes && break
+ done
+ echo "$as_me:32541: gl_pthread_api=$gl_pthread_api" >&5
+ echo "$as_me:32542: LIBPTHREAD=$LIBPTHREAD" >&5
+
+ gl_pthread_in_glibc=no
+ # On Linux with glibc >= 2.34, libc contains the fully functional
+ # pthread functions.
+ case "$host_os" in
+ linux*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky user" >/dev/null 2>&1; then :
+ gl_pthread_in_glibc=yes
+fi
+rm -f conftest*
+
+ ;;
+ esac
+ echo "$as_me:32567: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
+
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+ # The program links fine without libpthread. But it may actually
+ # need to link with libpthread in order to create multiple threads.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_kill=yes
+else
+ ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+ if test $gl_pthread_in_glibc = yes; then
+ LIBPMULTITHREAD=
+ else
+ LIBPMULTITHREAD=-lpthread
+ # On Solaris and HP-UX, most pthread functions exist also in libc.
+ # Therefore pthread_in_use() needs to actually try to create a
+ # thread: pthread_create from libc will fail, whereas
+ # pthread_create will actually create a thread.
+ # On Solaris 10 or newer, this test is no longer needed, because
+ # libc contains the fully functional pthread functions.
+ case "$host_os" in
+ solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+
+$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+ esac
+ fi
+
+fi
+
+ elif test $gl_pthread_api != yes; then
+ # Some library is needed. Try libpthread and libc_r.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_kill=yes
+else
+ ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=-lpthread
+ LIBPMULTITHREAD=-lpthread
+fi
+
+ if test $gl_pthread_api != yes; then
+ # For FreeBSD 4.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_pthread_kill=yes
+else
+ ac_cv_lib_c_r_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=-lc_r
+ LIBPMULTITHREAD=-lc_r
+fi
+
+ fi
+ fi
+ echo "$as_me:32721: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+$as_echo_n "checking whether POSIX threads API is available... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+$as_echo "$gl_pthread_api" >&6; }
+
+
+ if test $gl_pthread_api = yes; then
+
+$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
+
+ fi
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sched.h>
+int
+main ()
+{
+sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIB_SCHED_YIELD=
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_sched_yield=yes
+else
+ ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+ LIB_SCHED_YIELD=-lrt
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
+if ${ac_cv_lib_posix4_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_posix4_sched_yield=yes
+else
+ ac_cv_lib_posix4_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
+ LIB_SCHED_YIELD=-lposix4
+fi
+
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+ gl_pthreadlib_body_done=done
+ fi
+
+ LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+ LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+ if test $gl_pthread_api = yes; then
+ if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+ gl_threads_api='isoc+posix'
+
+$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
+
+ LIBTHREAD= LTLIBTHREAD=
+ else
+ gl_threads_api=posix
+
+$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
+
+ if test -z "$LIBMULTITHREAD" && test -z "$LTLIBMULTITHREAD"; then
+
+$as_echo "#define USE_POSIX_THREADS_FROM_LIBC 1" >>confdefs.h
+
+ else
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+
+$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
+
+ LIBTHREAD= LTLIBTHREAD=
+ else
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
+
+$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+ fi
+ ;;
+ esac
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+
+
+
+ if test -z "$gl_stdthreadlib_body_done"; then
+
+
+ case "$host_os" in
+ mingw*)
+ LIBSTDTHREAD=
+ ;;
+ *)
+
+
+ if test -z "$gl_pthreadlib_body_done"; then
+ gl_pthread_api=no
+ LIBPTHREAD=
+ LIBPMULTITHREAD=
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+ ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+ gl_have_pthread_h=yes
+else
+ gl_have_pthread_h=no
+fi
+
+
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ #
+ # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+ # needs -pthread for some reason. See:
+ # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+ save_LIBS=$LIBS
+ for gl_pthread in '' '-pthread'; do
+ LIBS="$LIBS $gl_pthread"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+ pthread_mutex_t m;
+ pthread_mutexattr_t ma;
+
+int
+main ()
+{
+pthread_mutex_lock (&m);
+ pthread_mutexattr_init (&ma);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=$gl_pthread
+ LIBPMULTITHREAD=$gl_pthread
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$save_LIBS
+ test $gl_pthread_api = yes && break
+ done
+ echo "$as_me:32947: gl_pthread_api=$gl_pthread_api" >&5
+ echo "$as_me:32948: LIBPTHREAD=$LIBPTHREAD" >&5
+
+ gl_pthread_in_glibc=no
+ # On Linux with glibc >= 2.34, libc contains the fully functional
+ # pthread functions.
+ case "$host_os" in
+ linux*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky user" >/dev/null 2>&1; then :
+ gl_pthread_in_glibc=yes
+fi
+rm -f conftest*
+
+ ;;
+ esac
+ echo "$as_me:32973: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5
+
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+ # The program links fine without libpthread. But it may actually
+ # need to link with libpthread in order to create multiple threads.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_kill=yes
+else
+ ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+ if test $gl_pthread_in_glibc = yes; then
+ LIBPMULTITHREAD=
+ else
+ LIBPMULTITHREAD=-lpthread
+ # On Solaris and HP-UX, most pthread functions exist also in libc.
+ # Therefore pthread_in_use() needs to actually try to create a
+ # thread: pthread_create from libc will fail, whereas
+ # pthread_create will actually create a thread.
+ # On Solaris 10 or newer, this test is no longer needed, because
+ # libc contains the fully functional pthread functions.
+ case "$host_os" in
+ solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+
+$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+ esac
+ fi
+
+fi
+
+ elif test $gl_pthread_api != yes; then
+ # Some library is needed. Try libpthread and libc_r.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_kill=yes
+else
+ ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=-lpthread
+ LIBPMULTITHREAD=-lpthread
+fi
+
+ if test $gl_pthread_api != yes; then
+ # For FreeBSD 4.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_pthread_kill=yes
+else
+ ac_cv_lib_c_r_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
+ gl_pthread_api=yes
+ LIBPTHREAD=-lc_r
+ LIBPMULTITHREAD=-lc_r
+fi
+
+ fi
+ fi
+ echo "$as_me:33127: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+$as_echo_n "checking whether POSIX threads API is available... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+$as_echo "$gl_pthread_api" >&6; }
+
+
+ if test $gl_pthread_api = yes; then
+
+$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h
+
+ fi
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sched.h>
+int
+main ()
+{
+sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIB_SCHED_YIELD=
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+$as_echo_n "checking for sched_yield in -lrt... " >&6; }
+if ${ac_cv_lib_rt_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_sched_yield=yes
+else
+ ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+$as_echo "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes; then :
+ LIB_SCHED_YIELD=-lrt
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+$as_echo_n "checking for sched_yield in -lposix4... " >&6; }
+if ${ac_cv_lib_posix4_sched_yield+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_posix4_sched_yield=yes
+else
+ ac_cv_lib_posix4_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then :
+ LIB_SCHED_YIELD=-lposix4
+fi
+
+fi
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+ gl_pthreadlib_body_done=done
+ fi
+
+ if test $ac_cv_header_threads_h = yes; then
+ for ac_func in thrd_create
+do :
+ ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
+if test "x$ac_cv_func_thrd_create" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_THRD_CREATE 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_thrd_create = yes; then
+ LIBSTDTHREAD=
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
+$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; }
+if ${ac_cv_lib_stdthreads_thrd_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lstdthreads $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char thrd_create ();
+int
+main ()
+{
+return thrd_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_stdthreads_thrd_create=yes
+else
+ ac_cv_lib_stdthreads_thrd_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
+$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; }
+if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then :
+
+ LIBSTDTHREAD='-lstdthreads -lpthread'
+
+else
+
+ LIBSTDTHREAD="$LIBPMULTITHREAD"
+
+fi
+
+ fi
+ else
+ LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+ fi
+ ;;
+ esac
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
+$as_echo_n "checking whether ISO C threads API is available... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
+$as_echo "$ac_cv_header_threads_h" >&6; }
+ gl_stdthreadlib_body_done=done
+ fi
+
+ LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+ LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+ gl_threads_api=isoc
+
+$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h
+
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ case "$gl_use_threads" in
+ yes | windows | win32) # The 'win32' is for backward compatibility.
+ if { case "$host_os" in
+ mingw*) true;;
+ *) false;;
+ esac
+ }; then
+ gl_threads_api=windows
+
+$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
+
+ fi
+ ;;
+ esac
+ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
+$as_echo_n "checking for multithread API to use... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
+$as_echo "$gl_threads_api" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc (0) returns nonnull" >&5
+$as_echo_n "checking whether malloc (0) returns nonnull... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+ | gnu* | *-musl* | midnightbsd* \
+ | hpux* | solaris* | cygwin* | mingw* | msys* )
+ ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+int
+main ()
+{
+void *p = malloc (0);
+ int result = !p;
+ free (p);
+ return result;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_malloc_0_nonnull=yes
+else
+ ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+ case $ac_cv_func_malloc_0_nonnull in #(
+ *yes) :
+ gl_cv_func_malloc_0_nonnull=1 ;; #(
+ *) :
+ gl_cv_func_malloc_0_nonnull=0 ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_math_h='<'math.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
+$as_echo_n "checking absolute name of <math.h>... " >&6; }
+if ${gl_cv_next_math_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_math_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <math.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'math.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_math_h
+ gl_cv_next_math_h='"'$gl_header'"'
+ else
+ gl_cv_next_math_h='<'math.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
+$as_echo "$gl_cv_next_math_h" >&6; }
+ fi
+ NEXT_MATH_H=$gl_cv_next_math_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'math.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_math_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
+$as_echo_n "checking whether NAN macro works... " >&6; }
+if ${gl_cv_header_math_nan_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <math.h>
+int
+main ()
+{
+/* Solaris 10 has a broken definition of NAN. Other platforms
+ fail to provide NAN, or provide it only in C99 mode; this
+ test only needs to fail when NAN is provided but wrong. */
+ float f = 1.0f;
+#ifdef NAN
+ f = NAN;
+#endif
+ return f == 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_math_nan_works=yes
+else
+ gl_cv_header_math_nan_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
+$as_echo "$gl_cv_header_math_nan_works" >&6; }
+ if test $gl_cv_header_math_nan_works = no; then
+ REPLACE_NAN=1
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
+$as_echo_n "checking whether HUGE_VAL works... " >&6; }
+if ${gl_cv_header_math_huge_val_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <math.h>
+int
+main ()
+{
+/* Solaris 10 has a broken definition of HUGE_VAL. */
+ double d = HUGE_VAL;
+ return d == 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_math_huge_val_works=yes
+else
+ gl_cv_header_math_huge_val_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
+$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
+ if test $gl_cv_header_math_huge_val_works = no; then
+ REPLACE_HUGE_VAL=1
+ fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
+$as_echo_n "checking for mbstate_t... " >&6; }
+if ${ac_cv_type_mbstate_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ #include <wchar.h>
+int
+main ()
+{
+mbstate_t x; return sizeof x;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_type_mbstate_t=yes
+else
+ ac_cv_type_mbstate_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
+$as_echo "$ac_cv_type_mbstate_t" >&6; }
+ if test $ac_cv_type_mbstate_t = yes; then
+
+$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
+
+ else
+
+$as_echo "#define mbstate_t int" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+$as_echo_n "checking for a traditional japanese locale... " >&6; }
+if ${gt_cv_locale_ja+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
+ on Cygwin 1.5.x. */
+ if (MB_CUR_MAX == 1)
+ return 1;
+ /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+ This excludes the UTF-8 encoding (except on MirBSD). */
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
+ return 0;
+#endif
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Note that on native Windows, the Japanese locale is
+ # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
+ # cannot use it here.
+ gt_cv_locale_ja=none
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the AIX locale name.
+ if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.EUC-JP
+ else
+ # Test for the HP-UX, OSF/1, NetBSD locale name.
+ if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.eucJP
+ else
+ # Test for the IRIX, FreeBSD locale name.
+ if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.EUC
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja
+ else
+ # Special test for NetBSD 1.6.
+ if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
+ gt_cv_locale_ja=ja_JP.eucJP
+ else
+ # None found.
+ gt_cv_locale_ja=none
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+$as_echo "$gt_cv_locale_ja" >&6; }
+ LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+$as_echo_n "checking for a french Unicode locale... " >&6; }
+if ${gt_cv_locale_fr_utf8+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if !(defined __BEOS__ || defined __HAIKU__)
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail. */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in the abbreviation of the second month, the second
+ character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+ two bytes long, with UTF-8 encoding. */
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 4
+ || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+ return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
+ /* Check whether the decimal separator is a comma.
+ On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+ are nl_langinfo(RADIXCHAR) are both ".". */
+ if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+ return 0;
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=French_France.65001
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+$as_echo "$gt_cv_locale_fr_utf8" >&6; }
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+$as_echo_n "checking for a transitional chinese locale... " >&6; }
+if ${gt_cv_locale_zh_CN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+ This excludes the UTF-8 encoding (except on MirBSD). */
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
+ /* Check whether a typical GB18030 multibyte sequence is recognized as a
+ single wide character. This excludes the GB2312 and GBK encodings. */
+ if (mblen ("\203\062\332\066", 5) != 4)
+ return 1;
+ return 0;
+#endif
+}
+
+_ACEOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=Chinese_China.54936
+ else
+ # None found.
+ gt_cv_locale_zh_CN=none
+ fi
+ ;;
+ solaris2.8)
+ # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+ # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+ # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+ gt_cv_locale_zh_CN=none
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the locale name without encoding suffix.
+ if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=zh_CN
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=zh_CN.GB18030
+ else
+ # None found.
+ gt_cv_locale_zh_CN=none
+ fi
+ fi
+ ;;
+ esac
+ else
+ # If there was a link error, due to mblen(), the system is so old that
+ # it certainly doesn't have a chinese locale.
+ gt_cv_locale_zh_CN=none
+ fi
+ rm -fr conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+$as_echo "$gt_cv_locale_zh_CN" >&6; }
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+ # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
+ # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
+ # irrelevant for anonymous mappings.
+ ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes; then :
+ gl_have_mmap=yes
+else
+ gl_have_mmap=no
+fi
+
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
+$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
+ gl_have_mmap_anonymous=yes
+fi
+rm -f conftest*
+
+ if test $gl_have_mmap_anonymous != yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
+
+$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
+
+ gl_have_mmap_anonymous=yes
+fi
+rm -f conftest*
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
+$as_echo "$gl_have_mmap_anonymous" >&6; }
+ if test $gl_have_mmap_anonymous = yes; then
+
+$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+
+ fi
+ fi
+
+
+
+
+
+
+ HAVE_MBSLEN=0;
+ HAVE_EXPLICIT_BZERO=1;
+ HAVE_FFSL=1;
+ HAVE_FFSLL=1;
+ HAVE_DECL_MEMMEM=1;
+ HAVE_MEMPCPY=1;
+ HAVE_MEMSET_EXPLICIT=1;
+ HAVE_DECL_MEMRCHR=1;
+ HAVE_RAWMEMCHR=1;
+ HAVE_STPCPY=1;
+ HAVE_STPNCPY=1;
+ HAVE_STRCHRNUL=1;
+ HAVE_DECL_STRDUP=1;
+ HAVE_DECL_STRNDUP=1;
+ HAVE_DECL_STRNLEN=1;
+ HAVE_STRPBRK=1;
+ HAVE_STRSEP=1;
+ HAVE_STRCASESTR=1;
+ HAVE_DECL_STRTOK_R=1;
+ HAVE_DECL_STRERROR_R=1;
+ HAVE_STRERRORNAME_NP=1;
+ HAVE_SIGABBREV_NP=1;
+ HAVE_SIGDESCR_NP=1;
+ HAVE_DECL_STRSIGNAL=1;
+ HAVE_STRVERSCMP=1;
+ REPLACE_FFSLL=0;
+ REPLACE_MEMCHR=0;
+ REPLACE_MEMMEM=0;
+ REPLACE_STPNCPY=0;
+ REPLACE_STRCHRNUL=0;
+ REPLACE_STRDUP=0;
+ REPLACE_STRNCAT=0;
+ REPLACE_STRNDUP=0;
+ REPLACE_STRNLEN=0;
+ REPLACE_STRSTR=0;
+ REPLACE_STRCASESTR=0;
+ REPLACE_STRTOK_R=0;
+ REPLACE_STRERROR=0;
+ REPLACE_STRERROR_R=0;
+ REPLACE_STRERRORNAME_NP=0;
+ REPLACE_STRSIGNAL=0;
+ UNDEFINE_STRTOK_R=0;
+
+
+
+
+
+
+
+
+ # Detect platform-specific bugs in some versions of glibc:
+ # memchr should not dereference anything with length 0
+ # https://bugzilla.redhat.com/show_bug.cgi?id=499689
+ # memchr should not dereference overestimated length after a match
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
+ # memchr should cast the second argument to 'unsigned char'.
+ # This bug exists in Android 4.3.
+ # Assume that memchr works on platforms that lack mprotect.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
+$as_echo_n "checking whether memchr works... " >&6; }
+if ${gl_cv_func_memchr_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_memchr_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h>
+#if HAVE_SYS_MMAN_H
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+# ifndef MAP_FILE
+# define MAP_FILE 0
+# endif
+#endif
+
+int
+main ()
+{
+
+ int result = 0;
+ char *fence = NULL;
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# if HAVE_MAP_ANONYMOUS
+ const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
+ const int fd = -1;
+# else /* !HAVE_MAP_ANONYMOUS */
+ const int flags = MAP_FILE | MAP_PRIVATE;
+ int fd = open ("/dev/zero", O_RDONLY, 0666);
+ if (fd >= 0)
+# endif
+ {
+ int pagesize = getpagesize ();
+ char *two_pages =
+ (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
+ flags, fd, 0);
+ if (two_pages != (char *)(-1)
+ && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
+ fence = two_pages + pagesize;
+ }
+#endif
+ if (fence)
+ {
+ /* Test against bugs on glibc systems. */
+ if (memchr (fence, 0, 0))
+ result |= 1;
+ strcpy (fence - 9, "12345678");
+ if (memchr (fence - 9, 0, 79) != fence - 1)
+ result |= 2;
+ if (memchr (fence - 1, 0, 3) != fence - 1)
+ result |= 4;
+ /* Test against bug on AIX 7.2. */
+ if (memchr (fence - 4, '6', 16) != fence - 4)
+ result |= 8;
+ }
+ /* Test against bug on Android 4.3. */
+ {
+ char input[3];
+ input[0] = 'a';
+ input[1] = 'b';
+ input[2] = 'c';
+ if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
+ result |= 16;
+ }
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_memchr_works=yes
+else
+ gl_cv_func_memchr_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
+$as_echo "$gl_cv_func_memchr_works" >&6; }
+ case "$gl_cv_func_memchr_works" in
+ *yes) ;;
+ *) REPLACE_MEMCHR=1 ;;
+ esac
+
+
+
+ GL_GNULIB_EXPLICIT_BZERO=0
+
+
+
+ GL_GNULIB_FFSL=0
+
+
+
+ GL_GNULIB_FFSLL=0
+
+
+
+ GL_GNULIB_MEMCHR=0
+
+
+
+ GL_GNULIB_MEMMEM=0
+
+
+
+ GL_GNULIB_MEMPCPY=0
+
+
+
+ GL_GNULIB_MEMRCHR=0
+
+
+
+ GL_GNULIB_MEMSET_EXPLICIT=0
+
+
+
+ GL_GNULIB_RAWMEMCHR=0
+
+
+
+ GL_GNULIB_STPCPY=0
+
+
+
+ GL_GNULIB_STPNCPY=0
+
+
+
+ GL_GNULIB_STRCHRNUL=0
+
+
+
+ GL_GNULIB_STRDUP=0
+
+
+
+ GL_GNULIB_STRNCAT=0
+
+
+
+ GL_GNULIB_STRNDUP=0
+
+
+
+ GL_GNULIB_STRNLEN=0
+
+
+
+ GL_GNULIB_STRPBRK=0
+
+
+
+ GL_GNULIB_STRSEP=0
+
+
+
+ GL_GNULIB_STRSTR=0
+
+
+
+ GL_GNULIB_STRCASESTR=0
+
+
+
+ GL_GNULIB_STRTOK_R=0
+
+
+
+ GL_GNULIB_MBSLEN=0
+
+
+
+ GL_GNULIB_MBSNLEN=0
+
+
+
+ GL_GNULIB_MBSCHR=0
+
+
+
+ GL_GNULIB_MBSRCHR=0
+
+
+
+ GL_GNULIB_MBSSTR=0
+
+
+
+ GL_GNULIB_MBSCASECMP=0
+
+
+
+ GL_GNULIB_MBSNCASECMP=0
+
+
+
+ GL_GNULIB_MBSPCASECMP=0
+
+
+
+ GL_GNULIB_MBSCASESTR=0
+
+
+
+ GL_GNULIB_MBSCSPN=0
+
+
+
+ GL_GNULIB_MBSPBRK=0
+
+
+
+ GL_GNULIB_MBSSPN=0
+
+
+
+ GL_GNULIB_MBSSEP=0
+
+
+
+ GL_GNULIB_MBSTOK_R=0
+
+
+
+ GL_GNULIB_STRERROR=0
+
+
+
+ GL_GNULIB_STRERROR_R=0
+
+
+
+ GL_GNULIB_STRERRORNAME_NP=0
+
+
+
+ GL_GNULIB_SIGABBREV_NP=0
+
+
+
+ GL_GNULIB_SIGDESCR_NP=0
+
+
+
+ GL_GNULIB_STRSIGNAL=0
+
+
+
+ GL_GNULIB_STRVERSCMP=0
+
+
+
+ GL_GNULIB_MDA_MEMCCPY=1
+
+
+
+ GL_GNULIB_MDA_STRDUP=1
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
+$as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; }
+if ${gl_cv_minmax_in_limits_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ int x = MIN (42, 17);
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_minmax_in_limits_h=yes
+else
+ gl_cv_minmax_in_limits_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
+$as_echo "$gl_cv_minmax_in_limits_h" >&6; }
+ if test $gl_cv_minmax_in_limits_h = yes; then
+
+$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
+$as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
+if ${gl_cv_minmax_in_sys_param_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/param.h>
+ int x = MIN (42, 17);
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_minmax_in_sys_param_h=yes
+else
+ gl_cv_minmax_in_sys_param_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
+$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; }
+ if test $gl_cv_minmax_in_sys_param_h = yes; then
+
+$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+ HAVE_DECL_LOCALTIME_R=1;
+ HAVE_NANOSLEEP=1;
+ HAVE_STRPTIME=1;
+ HAVE_TIMEGM=1;
+ HAVE_TIMESPEC_GET=1;
+ HAVE_TIMESPEC_GETRES=1;
+ HAVE_TIMEZONE_T=0;
+ REPLACE_CTIME=GNULIB_PORTCHECK;
+ REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
+ REPLACE_MKTIME=GNULIB_PORTCHECK;
+ REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
+ REPLACE_STRFTIME=GNULIB_PORTCHECK;
+ REPLACE_TIMEGM=GNULIB_PORTCHECK;
+ REPLACE_TZSET=GNULIB_PORTCHECK;
+
+ : ${GNULIB_GETTIMEOFDAY=0};
+ REPLACE_GMTIME=0;
+ REPLACE_LOCALTIME=0;
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5
+$as_echo_n "checking whether time_t is signed... " >&6; }
+if ${gl_cv_time_t_is_signed+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+ char time_t_signed[(time_t) -1 < 0 ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_time_t_is_signed=yes
+else
+ gl_cv_time_t_is_signed=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_t_is_signed" >&5
+$as_echo "$gl_cv_time_t_is_signed" >&6; }
+ if test $gl_cv_time_t_is_signed = yes; then
+
+$as_echo "#define TIME_T_IS_SIGNED 1" >>confdefs.h
+
+ fi
+
+ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
+if test "x$ac_cv_have_decl_alarm" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ALARM $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
+$as_echo_n "checking for working mktime... " >&6; }
+if ${gl_cv_func_working_mktime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test $APPLE_UNIVERSAL_BUILD = 1; then
+ # A universal build on Apple Mac OS X platforms.
+ # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+ # But we need a configuration result that is valid in both modes.
+ gl_cv_func_working_mktime="guessing no"
+ else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_mktime="guessing no" ;;
+ *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Test program from Paul Eggert and Tony Leneis. */
+#include <limits.h>
+#include <stdlib.h>
+#include <time.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_DECL_ALARM
+# include <signal.h>
+#endif
+
+
+
+$gl_mda_defines
+
+
+#ifndef TIME_T_IS_SIGNED
+# define TIME_T_IS_SIGNED 0
+#endif
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable. */
+static char *tz_strings[] = {
+ (char *) 0, "TZ=GMT0", "TZ=JST-9",
+ "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+static int
+spring_forward_gap ()
+{
+ /* glibc (up to about 1998-10-07) failed this test. */
+ struct tm tm;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0)
+ return -1;
+
+ tm.tm_year = 98;
+ tm.tm_mon = 3;
+ tm.tm_mday = 5;
+ tm.tm_hour = 2;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ return mktime (&tm) != (time_t) -1;
+}
+
+static int
+mktime_test1 (time_t now)
+{
+ struct tm *lt;
+ return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (time_t now)
+{
+ return (mktime_test1 (now)
+ && mktime_test1 ((time_t) (time_t_max - now))
+ && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+ /* Based on code from Ariel Faigon. */
+ struct tm tm;
+ tm.tm_year = 96;
+ tm.tm_mon = 3;
+ tm.tm_mday = 0;
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+ return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (int j)
+{
+ struct tm tm;
+ time_t now;
+ tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+ now = mktime (&tm);
+ if (now != (time_t) -1)
+ {
+ struct tm *lt = localtime (&now);
+ if (! (lt
+ && lt->tm_year == tm.tm_year
+ && lt->tm_mon == tm.tm_mon
+ && lt->tm_mday == tm.tm_mday
+ && lt->tm_hour == tm.tm_hour
+ && lt->tm_min == tm.tm_min
+ && lt->tm_sec == tm.tm_sec
+ && lt->tm_yday == tm.tm_yday
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+ return 0;
+ }
+ return 1;
+}
+
+static int
+year_2050_test ()
+{
+ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+ ignoring leap seconds. */
+ unsigned long int answer = 2527315200UL;
+
+ struct tm tm;
+ time_t t;
+ tm.tm_year = 2050 - 1900;
+ tm.tm_mon = 2 - 1;
+ tm.tm_mday = 1;
+ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0)
+ return -1;
+
+ t = mktime (&tm);
+
+ /* Check that the result is either a failure, or close enough
+ to the correct answer that we can assume the discrepancy is
+ due to leap seconds. */
+ return (t == (time_t) -1
+ || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
+
+static int
+indiana_test ()
+{
+ if (putenv ("TZ=America/Indiana/Indianapolis") != 0)
+ return -1;
+ struct tm tm;
+ tm.tm_year = 1986 - 1900; tm.tm_mon = 4 - 1; tm.tm_mday = 28;
+ tm.tm_hour = 16; tm.tm_min = 24; tm.tm_sec = 50; tm.tm_isdst = 0;
+ time_t std = mktime (&tm);
+ if (! (std == 515107490 || std == 515107503))
+ return 1;
+
+ /* This platform supports TZDB, either without or with leap seconds.
+ Return true if GNU Bug#48085 is absent. */
+ tm.tm_isdst = 1;
+ time_t dst = mktime (&tm);
+ return std - dst == 60 * 60;
+}
+
+int
+main ()
+{
+ int result = 0;
+ time_t t, delta;
+ int i, j;
+ int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
+
+#if HAVE_DECL_ALARM
+ /* This test makes some buggy mktime implementations loop.
+ Give up after 60 seconds; a mktime slower than that
+ isn't worth using anyway. */
+ signal (SIGALRM, SIG_DFL);
+ alarm (60);
+#endif
+
+ time_t_max = (! TIME_T_IS_SIGNED
+ ? (time_t) -1
+ : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
+ * 2 + 1));
+ time_t_min = (! TIME_T_IS_SIGNED
+ ? (time_t) 0
+ : time_t_signed_magnitude
+ ? ~ (time_t) 0
+ : ~ time_t_max);
+
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+ if (tz_strings[i])
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
+ if (! mktime_test (t))
+ result |= 1;
+ if ((result & 2) == 0
+ && ! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ result |= 2;
+
+ for (j = 1; (result & 4) == 0; j <<= 1)
+ {
+ if (! bigtime_test (j))
+ result |= 4;
+ if (INT_MAX / 2 < j)
+ break;
+ }
+ if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
+ result |= 8;
+ }
+ if (! irix_6_4_bug ())
+ result |= 16;
+ if (! spring_forward_gap ())
+ result |= 32;
+ if (! year_2050_test () || ! indiana_test ())
+ result |= 64;
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_working_mktime=yes
+else
+ gl_cv_func_working_mktime=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mktime" >&5
+$as_echo "$gl_cv_func_working_mktime" >&6; }
+
+
+
+ GL_GNULIB_CTIME=0
+
+
+
+ GL_GNULIB_MKTIME=0
+
+
+
+ GL_GNULIB_LOCALTIME=0
+
+
+
+ GL_GNULIB_NANOSLEEP=0
+
+
+
+ GL_GNULIB_STRFTIME=0
+
+
+
+ GL_GNULIB_STRPTIME=0
+
+
+
+ GL_GNULIB_TIMEGM=0
+
+
+
+ GL_GNULIB_TIMESPEC_GET=0
+
+
+
+ GL_GNULIB_TIMESPEC_GETRES=0
+
+
+
+ GL_GNULIB_TIME_R=0
+
+
+
+ GL_GNULIB_TIME_RZ=0
+
+
+
+ GL_GNULIB_TZSET=0
+
+
+
+ GL_GNULIB_MDA_TZSET=1
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
+$as_echo_n "checking for O_CLOEXEC... " >&6; }
+if ${gl_cv_macro_O_CLOEXEC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+ #ifndef O_CLOEXEC
+ choke me;
+ #endif
+
+int
+main ()
+{
+return O_CLOEXEC;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_macro_O_CLOEXEC=yes
+else
+ gl_cv_macro_O_CLOEXEC=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
+$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; }
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
+$as_echo_n "checking for promoted mode_t type... " >&6; }
+if ${gl_cv_promoted_mode_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_promoted_mode_t='int'
+else
+ gl_cv_promoted_mode_t='mode_t'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
+$as_echo "$gl_cv_promoted_mode_t" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
+_ACEOF
+
+
+
+
+
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_REALLOC_FOR_REALLOC_POSIX=1
+ fi
+
+
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_setenv" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SETENV $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+ if test $ac_cv_have_decl_setenv = no; then
+ HAVE_DECL_SETENV=0
+ fi
+
+
+
+
+
+ for ac_header in search.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
+if test "x$ac_cv_header_search_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SEARCH_H 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_func in tsearch
+do :
+ ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
+if test "x$ac_cv_func_tsearch" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TSEARCH 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5
+$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; }
+if ${gl_cv_func_snprintf_retval_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef _MSC_VER
+ Known
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Known" >/dev/null 2>&1; then :
+ gl_cv_func_snprintf_retval_c99="guessing yes"
+else
+ gl_cv_func_snprintf_retval_c99="guessing no"
+fi
+rm -f conftest*
+
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+ strcpy (buf, "ABCDEF");
+ if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+ return 1;
+ if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+ return 2;
+ if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+ return 3;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_snprintf_retval_c99=yes
+else
+ gl_cv_func_snprintf_retval_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5
+$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
+
+ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_snprintf" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SNPRINTF $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+ LIBSOCKET=
+ if test $HAVE_WINSOCK2_H = 1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WSAStartup" >&5
+$as_echo_n "checking for WSAStartup... " >&6; }
+if ${gl_cv_func_wsastartup+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
+int
+main ()
+{
+
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ int err = WSAStartup(wVersionRequested, &wsaData);
+ WSACleanup ();
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_wsastartup=yes
+else
+ gl_cv_func_wsastartup=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5
+$as_echo "$gl_cv_func_wsastartup" >&6; }
+ if test "$gl_cv_func_wsastartup" = "yes"; then
+
+$as_echo "#define WINDOWS_SOCKETS 1" >>confdefs.h
+
+ LIBSOCKET='-lws2_32'
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
+$as_echo_n "checking for library containing setsockopt... " >&6; }
+if ${gl_cv_lib_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_cv_lib_socket=
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main ()
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ gl_save_LIBS="$LIBS"
+ LIBS="$gl_save_LIBS -lsocket"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main ()
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_lib_socket="-lsocket"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnetwork"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main ()
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_lib_socket="-lnetwork"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnet"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main ()
+{
+setsockopt();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_lib_socket="-lnet"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+ fi
+ LIBS="$gl_save_LIBS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$gl_cv_lib_socket"; then
+ gl_cv_lib_socket="none needed"
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5
+$as_echo "$gl_cv_lib_socket" >&6; }
+ if test "$gl_cv_lib_socket" != "none needed"; then
+ LIBSOCKET="$gl_cv_lib_socket"
+ fi
+ fi
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fcloseall" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FCLOSEALL $ac_have_decl
+_ACEOF
+
+
+
+
+ $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdio_h='<'stdio.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
+$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
+if ${gl_cv_next_stdio_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stdio.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stdio_h
+ gl_cv_next_stdio_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
+$as_echo "$gl_cv_next_stdio_h" >&6; }
+ fi
+ NEXT_STDIO_H=$gl_cv_next_stdio_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'stdio.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdio_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
+$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
+if ${gl_cv_func_printf_attribute_flavor+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define __STDC_FORMAT_MACROS 1
+ #include <stdio.h>
+ #include <inttypes.h>
+ /* For non-mingw systems, compilation will trivially succeed.
+ For mingw, compilation will succeed for older mingw (system
+ printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
+ #if (defined _WIN32 && ! defined __CYGWIN__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_printf_attribute_flavor=system
+else
+ gl_cv_func_printf_attribute_flavor=gnu
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
+$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
+ if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
+
+$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_fcloseall = no; then
+ HAVE_DECL_FCLOSEALL=0
+ fi
+
+ac_fn_c_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default"
+if test "x$ac_cv_have_decl_ecvt" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ECVT $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fcvt" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FCVT $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default"
+if test "x$ac_cv_have_decl_gcvt" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GCVT $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_stdlib_h='<'stdlib.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
+$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
+if ${gl_cv_next_stdlib_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'stdlib.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_stdlib_h
+ gl_cv_next_stdlib_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
+$as_echo "$gl_cv_next_stdlib_h" >&6; }
+ fi
+ NEXT_STDLIB_H=$gl_cv_next_stdlib_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'stdlib.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_stdlib_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_ecvt = no; then
+ HAVE_DECL_ECVT=0
+ fi
+
+ if test $ac_cv_have_decl_fcvt = no; then
+ HAVE_DECL_FCVT=0
+ fi
+
+ if test $ac_cv_have_decl_gcvt = no; then
+ HAVE_DECL_GCVT=0
+ fi
+
+
+ HAVE_FFS=1;
+ HAVE_STRCASECMP=1;
+ HAVE_DECL_STRNCASECMP=1;
+
+
+
+
+
+
+
+ for ac_func in strcasestr
+do :
+ ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr"
+if test "x$ac_cv_func_strcasestr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRCASESTR 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strcasestr = no; then
+ HAVE_STRCASESTR=0
+ else
+ if test $REPLACE_MEMCHR = 1; then
+ REPLACE_STRCASESTR=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strcasestr works" >&5
+$as_echo_n "checking whether strcasestr works... " >&6; }
+if ${gl_cv_func_strcasestr_works_always+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h> /* for __GNU_LIBRARY__ */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
+ Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky user" >/dev/null 2>&1; then :
+ gl_cv_func_strcasestr_works_always="guessing yes"
+else
+ gl_cv_func_strcasestr_works_always="$gl_cross_guess_normal"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h> /* for __GNU_LIBRARY__, strcasestr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+ Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+
+int
+main ()
+{
+return !!strcasestr (HAYSTACK, NEEDLE);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_strcasestr_works_always=yes
+else
+ gl_cv_func_strcasestr_works_always=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strcasestr_works_always" >&5
+$as_echo "$gl_cv_func_strcasestr_works_always" >&6; }
+ case "$gl_cv_func_strcasestr_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_STRCASESTR=1
+ ;;
+ esac
+ fi
+ fi
+
+
+ REPLACE_STRERROR_0=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
+$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
+if ${gl_cv_func_strerror_0_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+ #include <errno.h>
+
+int
+main ()
+{
+int result = 0;
+ char *str;
+ errno = 0;
+ str = strerror (0);
+ if (!*str) result |= 1;
+ if (errno) result |= 2;
+ if (strstr (str, "nknown") || strstr (str, "ndefined"))
+ result |= 4;
+ return result;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_strerror_0_works=yes
+else
+ gl_cv_func_strerror_0_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
+$as_echo "$gl_cv_func_strerror_0_works" >&6; }
+ case "$gl_cv_func_strerror_0_works" in
+ *yes) ;;
+ *)
+ REPLACE_STRERROR_0=1
+
+$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
+
+ ;;
+ esac
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_string_h='<'string.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
+$as_echo_n "checking absolute name of <string.h>... " >&6; }
+if ${gl_cv_next_string_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'string.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_string_h
+ gl_cv_next_string_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
+$as_echo "$gl_cv_next_string_h" >&6; }
+ fi
+ NEXT_STRING_H=$gl_cv_next_string_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'string.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_string_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_strings_h='<'strings.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <strings.h>" >&5
+$as_echo_n "checking absolute name of <strings.h>... " >&6; }
+if ${gl_cv_next_strings_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_strings_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <strings.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'strings.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_strings_h
+ gl_cv_next_strings_h='"'$gl_header'"'
+ else
+ gl_cv_next_strings_h='<'strings.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5
+$as_echo "$gl_cv_next_strings_h" >&6; }
+ fi
+ NEXT_STRINGS_H=$gl_cv_next_strings_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'strings.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_strings_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_strings_h = yes; then
+ HAVE_STRINGS_H=1
+ else
+ HAVE_STRINGS_H=0
+ fi
+
+
+
+
+
+
+
+
+ GL_GNULIB_FFS=0
+
+
+
+
+
+ GL_GNULIB_SOCKET=0
+
+
+
+ GL_GNULIB_CONNECT=0
+
+
+
+ GL_GNULIB_ACCEPT=0
+
+
+
+ GL_GNULIB_BIND=0
+
+
+
+ GL_GNULIB_GETPEERNAME=0
+
+
+
+ GL_GNULIB_GETSOCKNAME=0
+
+
+
+ GL_GNULIB_GETSOCKOPT=0
+
+
+
+ GL_GNULIB_LISTEN=0
+
+
+
+ GL_GNULIB_RECV=0
+
+
+
+ GL_GNULIB_SEND=0
+
+
+
+ GL_GNULIB_RECVFROM=0
+
+
+
+ GL_GNULIB_SENDTO=0
+
+
+
+ GL_GNULIB_SETSOCKOPT=0
+
+
+
+ GL_GNULIB_SHUTDOWN=0
+
+
+
+ GL_GNULIB_ACCEPT4=0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_sys_uio_h='<'sys/uio.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
+$as_echo_n "checking absolute name of <sys/uio.h>... " >&6; }
+if ${gl_cv_next_sys_uio_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_sys_uio_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/uio.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'sys/uio.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_sys_uio_h
+ gl_cv_next_sys_uio_h='"'$gl_header'"'
+ else
+ gl_cv_next_sys_uio_h='<'sys/uio.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
+$as_echo "$gl_cv_next_sys_uio_h" >&6; }
+ fi
+ NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'sys/uio.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_sys_uio_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_sys_uio_h = yes; then
+ HAVE_SYS_UIO_H=1
+ else
+ HAVE_SYS_UIO_H=0
+ fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
+$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
+if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timespec_in_time_h=yes
+else
+ gl_cv_sys_struct_timespec_in_time_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
+
+ TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
+ UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
+ if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
+ TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
+$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
+if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/time.h>
+
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timespec_in_sys_time_h=yes
+else
+ gl_cv_sys_struct_timespec_in_sys_time_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
+$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
+if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timespec_in_pthread_h=yes
+else
+ gl_cv_sys_struct_timespec_in_pthread_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
+$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
+if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timespec_in_unistd_h=yes
+else
+ gl_cv_sys_struct_timespec_in_unistd_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
+ UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
+ fi
+ fi
+ fi
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_time_h='<'time.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
+$as_echo_n "checking absolute name of <time.h>... " >&6; }
+if ${gl_cv_next_time_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'time.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_time_h
+ gl_cv_next_time_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
+$as_echo "$gl_cv_next_time_h" >&6; }
+ fi
+ NEXT_TIME_H=$gl_cv_next_time_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'time.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_time_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in <time.h>" >&5
+$as_echo_n "checking for TIME_UTC in <time.h>... " >&6; }
+if ${gl_cv_time_h_has_TIME_UTC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <time.h>
+
+int
+main ()
+{
+static int x = TIME_UTC; x++;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_time_h_has_TIME_UTC=yes
+else
+ gl_cv_time_h_has_TIME_UTC=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5
+$as_echo "$gl_cv_time_h_has_TIME_UTC" >&6; }
+ if test $gl_cv_time_h_has_TIME_UTC = yes; then
+ TIME_H_DEFINES_TIME_UTC=1
+ else
+ TIME_H_DEFINES_TIME_UTC=0
+ fi
+
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default"
+if test "x$ac_cv_have_decl_execvpe" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_EXECVPE $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_unistd_h='<'unistd.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
+$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
+if ${gl_cv_next_unistd_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_unistd_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <unistd.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'unistd.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_unistd_h
+ gl_cv_next_unistd_h='"'$gl_header'"'
+ else
+ gl_cv_next_unistd_h='<'unistd.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
+$as_echo "$gl_cv_next_unistd_h" >&6; }
+ fi
+ NEXT_UNISTD_H=$gl_cv_next_unistd_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'unistd.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_unistd_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_unistd_h = yes; then
+ HAVE_UNISTD_H=1
+ else
+ HAVE_UNISTD_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_execvpe = no; then
+ HAVE_DECL_EXECVPE=0
+ fi
+
+ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_feof_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_ferror_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fflush_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fgets_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fputc_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fputs_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fread_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getchar_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_putc_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_putchar_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UNSETENV $ac_have_decl
+_ACEOF
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
+$as_echo_n "checking for inttypes.h... " >&6; }
+if ${gl_cv_header_inttypes_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <inttypes.h>
+
+int
+main ()
+{
+uintmax_t i = (uintmax_t) -1; return !i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_inttypes_h=yes
+else
+ gl_cv_header_inttypes_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5
+$as_echo "$gl_cv_header_inttypes_h" >&6; }
+ if test $gl_cv_header_inttypes_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+_ACEOF
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5
+$as_echo_n "checking for stdint.h... " >&6; }
+if ${gl_cv_header_stdint_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <stdint.h>
+int
+main ()
+{
+uintmax_t i = (uintmax_t) -1; return !i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_stdint_h=yes
+else
+ gl_cv_header_stdint_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5
+$as_echo "$gl_cv_header_stdint_h" >&6; }
+ if test $gl_cv_header_stdint_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H_WITH_UINTMAX 1
+_ACEOF
+
+ fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5
+$as_echo_n "checking for intmax_t... " >&6; }
+if ${gt_cv_c_intmax_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+
+int
+main ()
+{
+intmax_t x = -1; return !x;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_c_intmax_t=yes
+else
+ gt_cv_c_intmax_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5
+$as_echo "$gt_cv_c_intmax_t" >&6; }
+ if test $gt_cv_c_intmax_t = yes; then
+
+$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
+
+ else
+
+cat >>confdefs.h <<_ACEOF
+#define intmax_t long long
+_ACEOF
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
+$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
+if ${gl_cv_cc_double_expbit0+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined arm || defined __arm || defined __arm__
+ mixed_endianness
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "mixed_endianness" >/dev/null 2>&1; then :
+ gl_cv_cc_double_expbit0="unknown"
+else
+
+ :
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+:
+ case $ac_cv_c_bigendian in #(
+ yes)
+ gl_cv_cc_double_expbit0="word 0 bit 20";; #(
+ no)
+ gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ gl_cv_cc_double_expbit0="unknown" ;;
+ esac
+
+
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (double x)
+{
+ memory_double m;
+ size_t i;
+ /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
+ memset (&m, 0, sizeof (memory_double));
+ m.value = x;
+ for (i = 0; i < NWORDS; i++)
+ {
+ ored_words[i] |= m.word[i];
+ anded_words[i] &= m.word[i];
+ }
+}
+int main ()
+{
+ size_t j;
+ FILE *fp = fopen ("conftest.out", "w");
+ if (fp == NULL)
+ return 1;
+ for (j = 0; j < NWORDS; j++)
+ anded_words[j] = ~ (unsigned int) 0;
+ add_to_ored_words (0.25);
+ add_to_ored_words (0.5);
+ add_to_ored_words (1.0);
+ add_to_ored_words (2.0);
+ add_to_ored_words (4.0);
+ /* Remove bits that are common (e.g. if representation of the first mantissa
+ bit is explicit). */
+ for (j = 0; j < NWORDS; j++)
+ ored_words[j] &= ~anded_words[j];
+ /* Now find the nonzero word. */
+ for (j = 0; j < NWORDS; j++)
+ if (ored_words[j] != 0)
+ break;
+ if (j < NWORDS)
+ {
+ size_t i;
+ for (i = j + 1; i < NWORDS; i++)
+ if (ored_words[i] != 0)
+ {
+ fprintf (fp, "unknown");
+ return (fclose (fp) != 0);
+ }
+ for (i = 0; ; i++)
+ if ((ored_words[j] >> i) & 1)
+ {
+ fprintf (fp, "word %d bit %d", (int) j, (int) i);
+ return (fclose (fp) != 0);
+ }
+ }
+ fprintf (fp, "unknown");
+ return (fclose (fp) != 0);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_cc_double_expbit0=`cat conftest.out`
+else
+ gl_cv_cc_double_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.out
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
+$as_echo "$gl_cv_cc_double_expbit0" >&6; }
+ case "$gl_cv_cc_double_expbit0" in
+ word*bit*)
+ word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+ bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_EXPBIT0_WORD $word
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_EXPBIT0_BIT $bit
+_ACEOF
+
+ ;;
+ esac
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf truncates the result as in C99" >&5
+$as_echo_n "checking whether snprintf truncates the result as in C99... " >&6; }
+if ${gl_cv_func_snprintf_truncation_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on OSF/1 >= 5.
+ osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+ strcpy (buf, "ABCDEF");
+ my_snprintf (buf, 3, "%d %d", 4567, 89);
+ if (memcmp (buf, "45\0DEF", 6) != 0)
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_snprintf_truncation_c99=yes
+else
+ gl_cv_func_snprintf_truncation_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_truncation_c99" >&5
+$as_echo "$gl_cv_func_snprintf_truncation_c99" >&6; }
+
+
+
+
+
+ for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h>
+"
+if test "x$ac_cv_have_decl__snprintf" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__SNPRINTF $ac_have_decl
+_ACEOF
+
+
+
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+
+$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
+
+ ;;
+ esac
+
+ case "$gl_cv_func_snprintf_truncation_c99" in
+ *yes)
+
+$as_echo "#define HAVE_SNPRINTF_TRUNCATION_C99 1" >>confdefs.h
+
+ ;;
+ esac
+
+ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default"
+if test "x$ac_cv_have_decl_vsnprintf" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_VSNPRINTF $ac_have_decl
+_ACEOF
+
+
+
+
+
+ if test $ac_cv_header_crtdefs_h = yes; then
+ HAVE_CRTDEFS_H=1
+ else
+ HAVE_CRTDEFS_H=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_wchar_h='<'wchar.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
+$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
+if ${gl_cv_next_wchar_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_wchar_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wchar.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'wchar.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_wchar_h
+ gl_cv_next_wchar_h='"'$gl_header'"'
+ else
+ gl_cv_next_wchar_h='<'wchar.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
+$as_echo "$gl_cv_next_wchar_h" >&6; }
+ fi
+ NEXT_WCHAR_H=$gl_cv_next_wchar_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'wchar.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_wchar_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+
+
+
+
+
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" "
+ #include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_wcsdup" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_WCSDUP $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_wcsdup = no; then
+ HAVE_DECL_WCSDUP=0
+ fi
+
+
+
+
+ HAVE_ISWBLANK=1;
+ HAVE_WCTYPE_T=1;
+ HAVE_WCTRANS_T=1;
+ REPLACE_ISWBLANK=0;
+ REPLACE_ISWDIGIT=0;
+ REPLACE_ISWXDIGIT=0;
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_iswcntrl = yes; then
+ HAVE_ISWCNTRL=1
+ else
+ HAVE_ISWCNTRL=0
+ fi
+
+
+
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_wctype_h='<'wctype.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
+$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
+if ${gl_cv_next_wctype_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_wctype_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wctype.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'wctype.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_wctype_h
+ gl_cv_next_wctype_h='"'$gl_header'"'
+ else
+ gl_cv_next_wctype_h='<'wctype.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
+$as_echo "$gl_cv_next_wctype_h" >&6; }
+ fi
+ NEXT_WCTYPE_H=$gl_cv_next_wctype_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'wctype.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_wctype_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_wctype_h = yes; then
+ if test $ac_cv_func_iswcntrl = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
+$as_echo_n "checking whether iswcntrl works... " >&6; }
+if ${gl_cv_func_iswcntrl_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+ #if __GNU_LIBRARY__ == 1
+ Linux libc5 i18n is broken.
+ #endif
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_iswcntrl_works="guessing yes"
+else
+ gl_cv_func_iswcntrl_works="guessing no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <wchar.h>
+ #include <wctype.h>
+ int main () { return iswprint ('x') == 0; }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_iswcntrl_works=yes
+else
+ gl_cv_func_iswcntrl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
+$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
+ fi
+ HAVE_WCTYPE_H=1
+ else
+ HAVE_WCTYPE_H=0
+ fi
+
+
+ if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+ REPLACE_ISWCNTRL=1
+ else
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
+ fi
+
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ :
+ fi
+
+ if test $REPLACE_ISWCNTRL = 1; then
+ REPLACE_TOWLOWER=1
+ else
+ for ac_func in towlower
+do :
+ ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
+if test "x$ac_cv_func_towlower" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TOWLOWER 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_towlower = yes; then
+ REPLACE_TOWLOWER=0
+ else
+ ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+
+"
+if test "x$ac_cv_have_decl_towlower" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TOWLOWER $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_towlower = yes; then
+ REPLACE_TOWLOWER=1
+ else
+ REPLACE_TOWLOWER=0
+ fi
+ fi
+ fi
+
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+ :
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
+$as_echo_n "checking for wctype_t... " >&6; }
+if ${gl_cv_type_wctype_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ wctype_t a;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_type_wctype_t=yes
+else
+ gl_cv_type_wctype_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
+$as_echo "$gl_cv_type_wctype_t" >&6; }
+ if test $gl_cv_type_wctype_t = no; then
+ HAVE_WCTYPE_T=0
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
+$as_echo_n "checking for wctrans_t... " >&6; }
+if ${gl_cv_type_wctrans_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <wchar.h>
+ #include <wctype.h>
+ wctrans_t a;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_type_wctrans_t=yes
+else
+ gl_cv_type_wctrans_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
+$as_echo "$gl_cv_type_wctrans_t" >&6; }
+ if test $gl_cv_type_wctrans_t = no; then
+ HAVE_WCTRANS_T=0
+ fi
+
+
+
+
+
+
+
+ GL_GNULIB_ISWBLANK=0
+
+
+
+ GL_GNULIB_ISWDIGIT=0
+
+
+
+ GL_GNULIB_ISWXDIGIT=0
+
+
+
+ GL_GNULIB_WCTYPE=0
+
+
+
+ GL_GNULIB_ISWCTYPE=0
+
+
+
+ GL_GNULIB_WCTRANS=0
+
+
+
+ GL_GNULIB_TOWCTRANS=0
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler option to allow warnings" >&5
+$as_echo_n "checking for C compiler option to allow warnings... " >&6; }
+if ${gl_cv_cc_wallow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f conftest*
+ echo 'int dummy;' > conftest.c
+ { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c 2>conftest1.err'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; } >/dev/null
+ { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Wno-error -c conftest.c 2>conftest2.err'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; } >/dev/null
+ if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then
+ gl_cv_cc_wallow='-Wno-error'
+ else
+ gl_cv_cc_wallow=none
+ fi
+ rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_wallow" >&5
+$as_echo "$gl_cv_cc_wallow" >&6; }
+ case "$gl_cv_cc_wallow" in
+ none) GL_CFLAG_ALLOW_WARNINGS='' ;;
+ *) GL_CFLAG_ALLOW_WARNINGS="$gl_cv_cc_wallow" ;;
+ esac
+
+
+
+
+ GL_CFLAG_GNULIB_WARNINGS=''
+ if test -n "$GL_CFLAG_ALLOW_WARNINGS"; then
+ cat > conftest.c <<\EOF
+ #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-cast-qual
+ -Wno-conversion
+ -Wno-float-equal
+ -Wno-sign-compare
+ -Wno-undef
+ -Wno-unused-function
+ -Wno-unused-parameter
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-float-conversion
+ #endif
+ #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wimplicit-fallthrough
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-pedantic
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-sign-conversion
+ -Wno-type-limits
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
+ -Wno-unsuffixed-float-constants
+ #endif
+EOF
+ gl_command="$CC $CFLAGS $CPPFLAGS -E conftest.c > conftest.out"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gl_command\""; } >&5
+ (eval $gl_command) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ gl_options=`grep -v '#' conftest.out`
+ for word in $gl_options; do
+ GL_CFLAG_GNULIB_WARNINGS="$GL_CFLAG_GNULIB_WARNINGS $word"
+ done
+ fi
+ rm -f conftest.c conftest.out
+ fi
+
+
+
+ if false; then
+ GL_COND_LIBTOOL_TRUE=
+ GL_COND_LIBTOOL_FALSE='#'
+else
+ GL_COND_LIBTOOL_TRUE='#'
+ GL_COND_LIBTOOL_FALSE=
+fi
+
+ gl_cond_libtool=false
+ gl_libdeps=
+ gl_ltlibdeps=
+ gl_m4_base='gl/m4'
+
+
+
+
+
+
+
+
+
+
+
+
+ gl_source_base='gl'
+ gl_source_base_prefix=
+
+
+ if test $ac_cv_func_alloca_works = no; then
+ :
+ fi
+
+ # Define an additional variable used in the Makefile substitution.
+ if test $ac_cv_working_alloca_h = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
+$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
+if ${gl_cv_rpl_alloca+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+ Need own alloca
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Need own alloca" >/dev/null 2>&1; then :
+ gl_cv_rpl_alloca=yes
+else
+ gl_cv_rpl_alloca=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
+$as_echo "$gl_cv_rpl_alloca" >&6; }
+ if test $gl_cv_rpl_alloca = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+ GL_GENERATE_ALLOCA_H=true
+ else
+ GL_GENERATE_ALLOCA_H=false
+ fi
+ else
+ GL_GENERATE_ALLOCA_H=true
+ fi
+
+ if test $ac_cv_working_alloca_h = yes; then
+ HAVE_ALLOCA_H=1
+ else
+ HAVE_ALLOCA_H=0
+ fi
+
+
+
+
+
+
+ case "$GL_GENERATE_ALLOCA_H" in
+ false) ALLOCA_H='' ;;
+ true)
+ if test -z "$ALLOCA_H"; then
+ ALLOCA_H="${gl_source_base_prefix}alloca.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_ALLOCA_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_ALLOCA_H; then
+ GL_GENERATE_ALLOCA_H_TRUE=
+ GL_GENERATE_ALLOCA_H_FALSE='#'
+else
+ GL_GENERATE_ALLOCA_H_TRUE='#'
+ GL_GENERATE_ALLOCA_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
+ GL_GENERATE_ALLOCA_H_TRUE='#'
+ GL_GENERATE_ALLOCA_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for static_assert" >&5
+$as_echo_n "checking for static_assert... " >&6; }
+if ${gl_cv_static_assert+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS=$CFLAGS
+ for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do
+ case $gl_working in #(
+ *assert.h*) :
+ CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H" ;; #(
+ *) :
+ ;;
+esac
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __clang__ && __STDC_VERSION__ < 202311
+ #pragma clang diagnostic error "-Wc2x-extensions"
+ #pragma clang diagnostic error "-Wc++17-extensions"
+ #endif
+ #ifdef INCLUDE_ASSERT_H
+ #include <assert.h>
+ #endif
+ static_assert (2 + 2 == 4, "arithmetic does not work");
+ static_assert (2 + 2 == 4);
+
+int
+main ()
+{
+
+ static_assert (sizeof (char) == 1, "sizeof does not work");
+ static_assert (sizeof (char) == 1);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_static_assert=$gl_working
+else
+ gl_cv_static_assert=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$gl_save_CFLAGS
+ test "$gl_cv_static_assert" != no && break
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_static_assert" >&5
+$as_echo "$gl_cv_static_assert" >&6; }
+
+ GL_GENERATE_ASSERT_H=false
+ case $gl_cv_static_assert in #(
+ yes*keyword*) :
+
+$as_echo "#define HAVE_C_STATIC_ASSERT 1" >>confdefs.h
+ ;; #(
+ no) :
+ GL_GENERATE_ASSERT_H=true
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_assert_h='<'assert.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <assert.h>" >&5
+$as_echo_n "checking absolute name of <assert.h>... " >&6; }
+if ${gl_cv_next_assert_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <assert.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'assert.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_assert_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_assert_h
+ gl_cv_next_assert_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_assert_h" >&5
+$as_echo "$gl_cv_next_assert_h" >&6; }
+ fi
+ NEXT_ASSERT_H=$gl_cv_next_assert_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'assert.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_assert_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_ASSERT_H=$gl_next_as_first_directive
+
+
+
+ ;; #(
+ *) :
+ ;;
+esac
+
+
+
+
+
+
+
+ case "$GL_GENERATE_ASSERT_H" in
+ false) ASSERT_H='' ;;
+ true)
+ if test -z "$ASSERT_H"; then
+ ASSERT_H="${gl_source_base_prefix}assert.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_ASSERT_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_ASSERT_H; then
+ GL_GENERATE_ASSERT_H_TRUE=
+ GL_GENERATE_ASSERT_H_FALSE='#'
+else
+ GL_GENERATE_ASSERT_H_TRUE='#'
+ GL_GENERATE_ASSERT_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_ASSERT_H_TRUE}" && test -z "${GL_GENERATE_ASSERT_H_FALSE}"; then
+ GL_GENERATE_ASSERT_H_TRUE='#'
+ GL_GENERATE_ASSERT_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_btowc = no; then
+ HAVE_BTOWC=0
+ else
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
+$as_echo_n "checking whether btowc(0) is correct... " >&6; }
+if ${gl_cv_func_btowc_nul+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+
+ case "$host_os" in
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_nul="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <wchar.h>
+int main ()
+{
+ if (btowc ('\0') != 0)
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_btowc_nul=yes
+else
+ gl_cv_func_btowc_nul=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
+$as_echo "$gl_cv_func_btowc_nul" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
+$as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
+if ${gl_cv_func_btowc_eof+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on IRIX.
+ irix*) gl_cv_func_btowc_eof="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_eof="guessing yes" ;;
+ esac
+ if test $LOCALE_FR != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdio.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ if (btowc (EOF) != WEOF)
+ return 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_btowc_eof=yes
+else
+ gl_cv_func_btowc_eof=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
+$as_echo "$gl_cv_func_btowc_eof" >&6; }
+
+ case "$gl_cv_func_btowc_nul" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ case "$gl_cv_func_btowc_eof" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ fi
+
+
+ if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
+ GL_COND_OBJ_BTOWC_TRUE=
+ GL_COND_OBJ_BTOWC_FALSE='#'
+else
+ GL_COND_OBJ_BTOWC_TRUE='#'
+ GL_COND_OBJ_BTOWC_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_BTOWC_TRUE}" && test -z "${GL_COND_OBJ_BTOWC_FALSE}"; then
+ GL_COND_OBJ_BTOWC_TRUE='#'
+ GL_COND_OBJ_BTOWC_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_BTOWC_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_BTOWC=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
+$as_echo_n "checking for __builtin_expect... " >&6; }
+if ${gl_cv___builtin_expect+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ int
+ main (int argc, char **argv)
+ {
+ argc = __builtin_expect (argc, 100);
+ return argv[argc != 100][0];
+ }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv___builtin_expect=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <builtins.h>
+ int
+ main (int argc, char **argv)
+ {
+ argc = __builtin_expect (argc, 100);
+ return argv[argc != 100][0];
+ }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv___builtin_expect="in <builtins.h>"
+else
+ gl_cv___builtin_expect=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
+$as_echo "$gl_cv___builtin_expect" >&6; }
+ if test "$gl_cv___builtin_expect" = yes; then
+ $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
+
+ elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
+ $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
+
+ fi
+
+
+
+ for ac_header in byteswap.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default"
+if test "x$ac_cv_header_byteswap_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_BYTESWAP_H 1
+_ACEOF
+
+ GL_GENERATE_BYTESWAP_H=false
+
+else
+
+ GL_GENERATE_BYTESWAP_H=true
+
+fi
+
+done
+
+
+
+
+
+
+ case "$GL_GENERATE_BYTESWAP_H" in
+ false) BYTESWAP_H='' ;;
+ true)
+ if test -z "$BYTESWAP_H"; then
+ BYTESWAP_H="${gl_source_base_prefix}byteswap.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_BYTESWAP_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_BYTESWAP_H; then
+ GL_GENERATE_BYTESWAP_H_TRUE=
+ GL_GENERATE_BYTESWAP_H_FALSE='#'
+else
+ GL_GENERATE_BYTESWAP_H_TRUE='#'
+ GL_GENERATE_BYTESWAP_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_BYTESWAP_H_TRUE}" && test -z "${GL_GENERATE_BYTESWAP_H_FALSE}"; then
+ GL_GENERATE_BYTESWAP_H_TRUE='#'
+ GL_GENERATE_BYTESWAP_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+ REPLACE_CALLOC_FOR_CALLOC_GNU="$REPLACE_CALLOC_FOR_CALLOC_POSIX"
+ if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 0; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether calloc (0, n) and calloc (n, 0) return nonnull" >&5
+$as_echo_n "checking whether calloc (0, n) and calloc (n, 0) return nonnull... " >&6; }
+if ${ac_cv_func_calloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test $cross_compiling != yes; then
+ ac_cv_func_calloc_0_nonnull=yes
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+int result = 0;
+ char * volatile p = calloc (0, 0);
+ if (!p)
+ result |= 1;
+ free (p);
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_func_calloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ else
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_calloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_calloc_0_nonnull" >&6; }
+ case $ac_cv_func_calloc_0_nonnull in #(
+ *yes) :
+ ;; #(
+ *) :
+ REPLACE_CALLOC_FOR_CALLOC_GNU=1 ;;
+esac
+
+ fi
+
+ if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext"
+
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_CALLOC_GNU=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CALLOC_GNU 1" >>confdefs.h
+
+
+
+
+
+
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_CALLOC_FOR_CALLOC_POSIX=1
+ fi
+
+ if test $REPLACE_CALLOC_FOR_CALLOC_POSIX = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext"
+
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_CALLOC_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CALLOC_POSIX 1" >>confdefs.h
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
+
+
+
+
+
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_CLOSE=1
+ fi
+
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+ if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+ REPLACE_CLOSE=1
+ fi
+
+
+
+
+ if test $REPLACE_CLOSE = 1; then
+ GL_COND_OBJ_CLOSE_TRUE=
+ GL_COND_OBJ_CLOSE_FALSE='#'
+else
+ GL_COND_OBJ_CLOSE_TRUE='#'
+ GL_COND_OBJ_CLOSE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_CLOSE_TRUE}" && test -z "${GL_COND_OBJ_CLOSE_FALSE}"; then
+ GL_COND_OBJ_CLOSE_TRUE='#'
+ GL_COND_OBJ_CLOSE_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_CLOSE=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-openssl was given.
+if test "${with_openssl+set}" = set; then :
+ withval=$with_openssl;
+else
+ with_openssl=$with_openssl_default
+fi
+
+
+
+ if test "x$with_openssl" != xno; then
+ if test "x$with_openssl" = xauto-gpl-compat; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether openssl is GPL compatible" >&5
+$as_echo_n "checking whether openssl is GPL compatible... " >&6; }
+if ${gl_cv_openssl_gpl_compat+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <openssl/opensslv.h>
+ #if OPENSSL_VERSION_MAJOR < 3
+ #error "openssl >= version 3 not found"
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_openssl_gpl_compat=yes
+else
+ gl_cv_openssl_gpl_compat=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_openssl_gpl_compat" >&5
+$as_echo "$gl_cv_openssl_gpl_compat" >&6; }
+ fi
+ if test "x$with_openssl" != xauto-gpl-compat ||
+ test "x$gl_cv_openssl_gpl_compat" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA256 in -lcrypto" >&5
+$as_echo_n "checking for SHA256 in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_SHA256+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SHA256 ();
+int
+main ()
+{
+return SHA256 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_SHA256=yes
+else
+ ac_cv_lib_crypto_SHA256=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256" >&5
+$as_echo "$ac_cv_lib_crypto_SHA256" >&6; }
+if test "x$ac_cv_lib_crypto_SHA256" = xyes; then :
+ for ac_header in openssl/sha.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_sha_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENSSL_SHA_H 1
+_ACEOF
+ LIB_CRYPTO=-lcrypto
+
+$as_echo "#define HAVE_OPENSSL_SHA256 1" >>confdefs.h
+
+fi
+
+done
+
+fi
+
+ fi
+ if test "x$LIB_CRYPTO" = x; then
+ message='openssl development library not found for SHA256.
+ If you want to install it, first find the pre-built package name:
+ - On Debian and Debian-based systems: libssl-dev,
+ - On Red Hat distributions: openssl-devel.
+ - Other: https://repology.org/project/openssl/versions'
+ if test "x$with_openssl" = xyes; then
+ as_fn_error $? "$message" "$LINENO" 5
+ elif test "x$with_openssl" = xoptional; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $message" >&5
+$as_echo "$as_me: WARNING: $message" >&2;}
+ fi
+ fi
+ fi
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_DIRNAME 1
+_ACEOF
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
+$as_echo_n "checking whether // is distinct from /... " >&6; }
+if ${gl_cv_double_slash_root+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test x"$cross_compiling" = xyes ; then
+ # When cross-compiling, there is no way to tell whether // is special
+ # short of a list of hosts. However, the only known hosts to date
+ # that have a distinct // are Apollo DomainOS (too old to port to),
+ # Cygwin, and z/OS. If anyone knows of another system for which // has
+ # special semantics and is distinct from /, please report it to
+ # <bug-gnulib@gnu.org>.
+ case $host in
+ *-cygwin | i370-ibm-openedition)
+ gl_cv_double_slash_root=yes ;;
+ *)
+ # Be optimistic and assume that / and // are the same when we
+ # don't know.
+ gl_cv_double_slash_root='unknown, assuming no' ;;
+ esac
+ else
+ set x `ls -di / // 2>/dev/null`
+ if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
+ gl_cv_double_slash_root=no
+ else
+ gl_cv_double_slash_root=yes
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
+$as_echo "$gl_cv_double_slash_root" >&6; }
+ if test "$gl_cv_double_slash_root" = yes; then
+
+$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
+
+ fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
+$as_echo_n "checking whether dup2 works... " >&6; }
+if ${gl_cv_func_dup2_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ mingw*) # on this platform, dup2 always returns 0 for success
+ gl_cv_func_dup2_works="guessing no" ;;
+ cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+ gl_cv_func_dup2_works="guessing no" ;;
+ aix* | freebsd*)
+ # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
+ # not EBADF.
+ gl_cv_func_dup2_works="guessing no" ;;
+ haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *-android*) # implemented using dup3(), which fails if oldfd == newfd
+ gl_cv_func_dup2_works="guessing no" ;;
+ os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *) gl_cv_func_dup2_works="guessing yes" ;;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+
+
+$gl_mda_defines
+
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+
+int
+main ()
+{
+int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+ result |= 1;
+ #endif
+ if (dup2 (1, 1) != 1)
+ result |= 2;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+ result |= 4;
+ #endif
+ close (0);
+ if (dup2 (0, 0) != -1)
+ result |= 8;
+ /* Many gnulib modules require POSIX conformance of EBADF. */
+ if (dup2 (2, bad_fd) == -1 && errno != EBADF)
+ result |= 16;
+ /* Flush out some cygwin core dumps. */
+ if (dup2 (2, -1) != -1 || errno != EBADF)
+ result |= 32;
+ dup2 (2, 255);
+ dup2 (2, 256);
+ /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
+ {
+ int fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 64;
+ else if (dup2 (fd, fd + 1) == -1)
+ result |= 128;
+ close (fd);
+ }
+ return result;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_dup2_works=yes
+else
+ gl_cv_func_dup2_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
+$as_echo "$gl_cv_func_dup2_works" >&6; }
+ case "$gl_cv_func_dup2_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP2=1
+ for ac_func in setdtablesize
+do :
+ ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
+if test "x$ac_cv_func_setdtablesize" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SETDTABLESIZE 1
+_ACEOF
+
+fi
+done
+
+ ;;
+ esac
+
+
+
+ if test $REPLACE_DUP2 = 1; then
+ GL_COND_OBJ_DUP2_TRUE=
+ GL_COND_OBJ_DUP2_FALSE='#'
+else
+ GL_COND_OBJ_DUP2_TRUE='#'
+ GL_COND_OBJ_DUP2_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_DUP2_TRUE}" && test -z "${GL_COND_OBJ_DUP2_FALSE}"; then
+ GL_COND_OBJ_DUP2_TRUE='#'
+ GL_COND_OBJ_DUP2_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_DUP2_TRUE"; then :
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_DUP2=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_ENVIRON=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ case "$GL_GENERATE_ERRNO_H" in
+ false) ERRNO_H='' ;;
+ true)
+ if test -z "$ERRNO_H"; then
+ ERRNO_H="${gl_source_base_prefix}errno.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_ERRNO_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_ERRNO_H; then
+ GL_GENERATE_ERRNO_H_TRUE=
+ GL_GENERATE_ERRNO_H_FALSE='#'
+else
+ GL_GENERATE_ERRNO_H_TRUE='#'
+ GL_GENERATE_ERRNO_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
+ GL_GENERATE_ERRNO_H_TRUE='#'
+ GL_GENERATE_ERRNO_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+$as_echo_n "checking for error_at_line... " >&6; }
+if ${ac_cv_lib_error_at_line+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <error.h>
+int
+main ()
+{
+error_at_line (0, 0, "", 0, "an error occurred");
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_error_at_line=yes
+else
+ ac_cv_lib_error_at_line=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+$as_echo "$ac_cv_lib_error_at_line" >&6; }
+
+
+ if test "$ac_cv_lib_error_at_line" = no; then
+ GL_COND_OBJ_ERROR_TRUE=
+ GL_COND_OBJ_ERROR_FALSE='#'
+else
+ GL_COND_OBJ_ERROR_TRUE='#'
+ GL_COND_OBJ_ERROR_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_ERROR_TRUE}" && test -z "${GL_COND_OBJ_ERROR_FALSE}"; then
+ GL_COND_OBJ_ERROR_TRUE='#'
+ GL_COND_OBJ_ERROR_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_ERROR_TRUE"; then :
+
+
+
+
+
+ :
+
+
+fi
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format"
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format"
+
+
+
+
+
+
+
+ if test $ac_cv_func_fcntl = no; then
+
+
+
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
+$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
+if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case $host_os in
+ aix* | cygwin* | haiku*)
+ gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
+ esac
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+
+
+$gl_mda_defines
+
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+
+int
+main ()
+{
+int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+ if (errno != EINVAL) result |= 2;
+ if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
+ if (errno != EINVAL) result |= 8;
+ /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
+ {
+ int fd;
+ fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 16;
+ else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
+ result |= 32;
+
+ close (fd);
+ }
+ return result;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fcntl_f_dupfd_works=yes
+else
+ gl_cv_func_fcntl_f_dupfd_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
+$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
+ case $gl_cv_func_fcntl_f_dupfd_works in
+ *yes) ;;
+ *)
+
+
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+
+
+$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
+$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
+if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on NetBSD.
+ netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+ #include <unistd.h>
+ int main (int argc, char *argv[])
+ {
+ if (argc == 1)
+ /* parent process */
+ {
+ if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
+ return 1;
+ return execl ("./conftest", "./conftest", "child", NULL);
+ }
+ else
+ /* child process */
+ return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
+ }
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef __linux__
+/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
+ it to support the semantics on older kernels that failed with EINVAL. */
+choke me
+#endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_fcntl_f_dupfd_cloexec=yes
+else
+ gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+ gl_cv_func_fcntl_f_dupfd_cloexec=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
+$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
+ case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
+ *yes) ;;
+ *)
+
+
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+
+ ;;
+ esac
+ fi
+
+
+
+ if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+ GL_COND_OBJ_FCNTL_TRUE=
+ GL_COND_OBJ_FCNTL_FALSE='#'
+else
+ GL_COND_OBJ_FCNTL_TRUE='#'
+ GL_COND_OBJ_FCNTL_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FCNTL_TRUE}" && test -z "${GL_COND_OBJ_FCNTL_FALSE}"; then
+ GL_COND_OBJ_FCNTL_TRUE='#'
+ GL_COND_OBJ_FCNTL_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FCNTL=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+$as_echo_n "checking whether fflush works on input streams... " >&6; }
+if ${gl_cv_func_fflush_stdin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo hello world > conftest.txt
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+ *) gl_cv_func_fflush_stdin=cross ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+
+
+$gl_mda_defines
+
+int
+main ()
+{
+FILE *f = fopen ("conftest.txt", "r");
+ char buffer[10];
+ int fd;
+ int c;
+ if (f == NULL)
+ return 1;
+ fd = fileno (f);
+ if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+ { fclose (f); return 2; }
+ /* For deterministic results, ensure f read a bigger buffer. */
+ if (lseek (fd, 0, SEEK_CUR) == 5)
+ { fclose (f); return 3; }
+ /* POSIX requires fflush-fseek to set file offset of fd. This fails
+ on BSD systems and on mingw. */
+ if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+ { fclose (f); return 4; }
+ if (lseek (fd, 0, SEEK_CUR) != 5)
+ { fclose (f); return 5; }
+ /* Verify behaviour of fflush after ungetc. See
+ <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
+ /* Verify behaviour of fflush after a backup ungetc. This fails on
+ mingw. */
+ c = fgetc (f);
+ ungetc (c, f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 6; }
+ /* Verify behaviour of fflush after a non-backup ungetc. This fails
+ on glibc 2.8 and on BSD systems. */
+ c = fgetc (f);
+ ungetc ('@', f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 7; }
+ fclose (f);
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fflush_stdin=yes
+else
+ gl_cv_func_fflush_stdin=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm conftest.txt
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+$as_echo "$gl_cv_func_fflush_stdin" >&6; }
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) gl_func_fflush_stdin=1 ;;
+ *no) gl_func_fflush_stdin=0 ;;
+ *) gl_func_fflush_stdin='(-1)' ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
+_ACEOF
+
+
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) ;;
+ *) REPLACE_FFLUSH=1 ;;
+ esac
+
+
+ if test $REPLACE_FFLUSH = 1; then
+ GL_COND_OBJ_FFLUSH_TRUE=
+ GL_COND_OBJ_FFLUSH_FALSE='#'
+else
+ GL_COND_OBJ_FFLUSH_TRUE='#'
+ GL_COND_OBJ_FFLUSH_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FFLUSH_TRUE}" && test -z "${GL_COND_OBJ_FFLUSH_FALSE}"; then
+ GL_COND_OBJ_FFLUSH_TRUE='#'
+ GL_COND_OBJ_FFLUSH_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_FFLUSH_TRUE"; then :
+
+ :
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FFLUSH 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FFLUSH=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FFLUSH 1" >>confdefs.h
+
+
+
+
+
+
+ GL_GENERATE_FLOAT_H=false
+ REPLACE_FLOAT_LDBL=0
+ case "$host_os" in
+ aix* | beos* | openbsd* | mirbsd* | irix*)
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_cpu" in
+ i[34567]86 )
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ x86_64 )
+ # On x86_64 systems, the C compiler may still be generating
+ # 32-bit code.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ GL_GENERATE_FLOAT_H=true
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ esac
+ ;;
+ linux*)
+ case "$host_cpu" in
+ powerpc*)
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ esac
+ ;;
+ esac
+ case "$host_os" in
+ aix* | freebsd* | dragonfly* | linux*)
+ if $GL_GENERATE_FLOAT_H; then
+ REPLACE_FLOAT_LDBL=1
+ fi
+ ;;
+ esac
+
+ REPLACE_ITOLD=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
+$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
+if ${gl_cv_func_itold_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ case "$host" in
+ sparc*-*-linux*)
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined __LP64__ || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_itold_works="guessing no"
+else
+ gl_cv_func_itold_works="guessing yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_itold_works="guessing yes" ;;
+ *) gl_cv_func_itold_works="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int i = -1;
+volatile long double ld;
+int main ()
+{
+ ld += i * 1.0L;
+ if (ld > 0)
+ return 1;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_itold_works=yes
+else
+ gl_cv_func_itold_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
+$as_echo "$gl_cv_func_itold_works" >&6; }
+ case "$gl_cv_func_itold_works" in
+ *no)
+ REPLACE_ITOLD=1
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ esac
+
+ if $GL_GENERATE_FLOAT_H; then
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_float_h='<'float.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
+$as_echo_n "checking absolute name of <float.h>... " >&6; }
+if ${gl_cv_next_float_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <float.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'float.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_float_h
+ gl_cv_next_float_h='"'$gl_header'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
+$as_echo "$gl_cv_next_float_h" >&6; }
+ fi
+ NEXT_FLOAT_H=$gl_cv_next_float_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'float.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_float_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
+
+
+
+
+ fi
+
+
+
+
+
+
+ case "$GL_GENERATE_FLOAT_H" in
+ false) FLOAT_H='' ;;
+ true)
+ if test -z "$FLOAT_H"; then
+ FLOAT_H="${gl_source_base_prefix}float.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_FLOAT_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_FLOAT_H; then
+ GL_GENERATE_FLOAT_H_TRUE=
+ GL_GENERATE_FLOAT_H_FALSE='#'
+else
+ GL_GENERATE_FLOAT_H_TRUE='#'
+ GL_GENERATE_FLOAT_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
+ GL_GENERATE_FLOAT_H_TRUE='#'
+ GL_GENERATE_FLOAT_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+ if test $REPLACE_FLOAT_LDBL = 1; then
+ GL_COND_OBJ_FLOAT_TRUE=
+ GL_COND_OBJ_FLOAT_FALSE='#'
+else
+ GL_COND_OBJ_FLOAT_TRUE='#'
+ GL_COND_OBJ_FLOAT_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FLOAT_TRUE}" && test -z "${GL_COND_OBJ_FLOAT_FALSE}"; then
+ GL_COND_OBJ_FLOAT_TRUE='#'
+ GL_COND_OBJ_FLOAT_FALSE='#'
+ fi
+
+
+ if test $REPLACE_ITOLD = 1; then
+ GL_COND_OBJ_ITOLD_TRUE=
+ GL_COND_OBJ_ITOLD_FALSE='#'
+else
+ GL_COND_OBJ_ITOLD_TRUE='#'
+ GL_COND_OBJ_ITOLD_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_ITOLD_TRUE}" && test -z "${GL_COND_OBJ_ITOLD_FALSE}"; then
+ GL_COND_OBJ_ITOLD_TRUE='#'
+ GL_COND_OBJ_ITOLD_FALSE='#'
+ fi
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "floorf" "ac_cv_have_decl_floorf" "#include <math.h>
+"
+if test "x$ac_cv_have_decl_floorf" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FLOORF $ac_have_decl
+_ACEOF
+
+ if test "$ac_cv_have_decl_floorf" = yes; then
+
+
+
+ exec 9>&6 6>/dev/null
+
+ if ${gl_cv_func_floorf_libm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_cv_func_floorf_libm=?
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ float (*funcptr) (float) = floorf;
+ float x;
+int
+main ()
+{
+x = funcptr(x) + floorf(x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_floorf_libm=
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "$gl_cv_func_floorf_libm" = "?"; then
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ float (*funcptr) (float) = floorf;
+ float x;
+int
+main ()
+{
+x = funcptr(x) + floorf(x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_floorf_libm="-lm"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$save_LIBS"
+ fi
+
+fi
+
+
+ exec 6>&9 9>&-
+
+
+ FLOORF_LIBM="$gl_cv_func_floorf_libm"
+
+ if test "$FLOORF_LIBM" = "?"; then
+ REPLACE_FLOORF=1
+ fi
+
+ else
+ HAVE_DECL_FLOORF=0
+ fi
+ if test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1; then
+ FLOORF_LIBM=
+ fi
+
+
+
+ if test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1; then
+ GL_COND_OBJ_FLOORF_TRUE=
+ GL_COND_OBJ_FLOORF_FALSE='#'
+else
+ GL_COND_OBJ_FLOORF_TRUE='#'
+ GL_COND_OBJ_FLOORF_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FLOORF_TRUE}" && test -z "${GL_COND_OBJ_FLOORF_FALSE}"; then
+ GL_COND_OBJ_FLOORF_TRUE='#'
+ GL_COND_OBJ_FLOORF_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FLOORF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FLOORF 1" >>confdefs.h
+
+
+
+
+
+
+ case "$host_os" in
+ mingw* | pw*)
+ REPLACE_FOPEN=1
+ gl_cv_func_fopen_slash="guessing no"
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen recognizes a trailing slash" >&5
+$as_echo_n "checking whether fopen recognizes a trailing slash... " >&6; }
+if ${gl_cv_func_fopen_slash+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+
+ case "$host_os" in
+ aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+ gl_cv_func_fopen_slash="guessing no" ;;
+ *)
+ gl_cv_func_fopen_slash="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stddef.h>
+#include <stdio.h>
+int main ()
+{
+ FILE *fp = fopen ("conftest.sl/", "w");
+ int result = (fp != NULL);
+ if (fp != NULL)
+ fclose (fp);
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fopen_slash=yes
+else
+ gl_cv_func_fopen_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.sl
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_slash" >&5
+$as_echo "$gl_cv_func_fopen_slash" >&6; }
+ ;;
+ esac
+ case "$gl_cv_func_fopen_slash" in
+ *no)
+
+$as_echo "#define FOPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
+
+ REPLACE_FOPEN=1
+ ;;
+ esac
+
+ if test $REPLACE_FOPEN = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fopen.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FOPEN=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FOPEN 1" >>confdefs.h
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen supports the mode character 'x'" >&5
+$as_echo_n "checking whether fopen supports the mode character 'x'... " >&6; }
+if ${gl_cv_func_fopen_mode_x+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f conftest.x
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc and musl systems.
+ linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+ gl_cv_func_fopen_mode_x="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_fopen_mode_x="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <errno.h>
+int main ()
+{
+ FILE *fp;
+ fp = fopen ("conftest.x", "w");
+ fclose (fp);
+ fp = fopen ("conftest.x", "wx");
+ if (fp != NULL)
+ /* 'x' ignored */
+ return 1;
+ else if (errno == EEXIST)
+ return 0;
+ else
+ /* 'x' rejected */
+ return 2;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fopen_mode_x=yes
+else
+ gl_cv_func_fopen_mode_x=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.x
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_mode_x" >&5
+$as_echo "$gl_cv_func_fopen_mode_x" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen supports the mode character 'e'" >&5
+$as_echo_n "checking whether fopen supports the mode character 'e'... " >&6; }
+if ${gl_cv_func_fopen_mode_e+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo foo > conftest.x
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc and musl systems.
+ linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+ gl_cv_func_fopen_mode_e="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*)
+ gl_cv_func_fopen_mode_e="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_fopen_mode_e="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+
+
+$gl_mda_defines
+
+int main ()
+{
+ FILE *fp = fopen ("conftest.x", "re");
+ if (fp != NULL)
+ {
+ if (fcntl (fileno (fp), F_GETFD) & FD_CLOEXEC)
+ return 0;
+ else
+ /* 'e' ignored */
+ return 1;
+ }
+ else
+ /* 'e' rejected */
+ return 2;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fopen_mode_e=yes
+else
+ gl_cv_func_fopen_mode_e=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.x
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_mode_e" >&5
+$as_echo "$gl_cv_func_fopen_mode_e" >&6; }
+ REPLACE_FOPEN_FOR_FOPEN_GNU="$REPLACE_FOPEN"
+ case "$gl_cv_func_fopen_mode_x" in
+ *no) REPLACE_FOPEN_FOR_FOPEN_GNU=1 ;;
+ esac
+ case "$gl_cv_func_fopen_mode_e" in
+ *no) REPLACE_FOPEN_FOR_FOPEN_GNU=1 ;;
+ esac
+
+ if test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS fopen.$ac_objext"
+
+ :
+ fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FOPEN_GNU 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FOPEN_GNU=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FOPEN_GNU 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include <stdio.h>
+"
+if test "x$ac_cv_have_decl_fpurge" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FPURGE $ac_have_decl
+_ACEOF
+
+ if test "x$ac_cv_func_fpurge" = xyes; then
+ HAVE_FPURGE=1
+ # Detect BSD bug. Only cygwin 1.7 and musl are known to be immune.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fpurge works" >&5
+$as_echo_n "checking whether fpurge works... " >&6; }
+if ${gl_cv_func_fpurge_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_fpurge_works="guessing yes" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+
+int
+main ()
+{
+FILE *f = fopen ("conftest.txt", "w+");
+ if (!f)
+ return 1;
+ if (fputc ('a', f) != 'a')
+ { fclose (f); return 2; }
+ rewind (f);
+ if (fgetc (f) != 'a')
+ { fclose (f); return 3; }
+ if (fgetc (f) != EOF)
+ { fclose (f); return 4; }
+ if (fpurge (f) != 0)
+ { fclose (f); return 5; }
+ if (putc ('b', f) != 'b')
+ { fclose (f); return 6; }
+ if (fclose (f) != 0)
+ return 7;
+ if ((f = fopen ("conftest.txt", "r")) == NULL)
+ return 8;
+ if (fgetc (f) != 'a')
+ { fclose (f); return 9; }
+ if (fgetc (f) != 'b')
+ { fclose (f); return 10; }
+ if (fgetc (f) != EOF)
+ { fclose (f); return 11; }
+ if (fclose (f) != 0)
+ return 12;
+ if (remove ("conftest.txt") != 0)
+ return 13;
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fpurge_works=yes
+else
+ gl_cv_func_fpurge_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fpurge_works" >&5
+$as_echo "$gl_cv_func_fpurge_works" >&6; }
+ case "$gl_cv_func_fpurge_works" in
+ *yes) ;;
+ *) REPLACE_FPURGE=1 ;;
+ esac
+ else
+ HAVE_FPURGE=0
+ fi
+ if test "x$ac_cv_have_decl_fpurge" = xno; then
+ HAVE_DECL_FPURGE=0
+ fi
+
+
+ if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
+ GL_COND_OBJ_FPURGE_TRUE=
+ GL_COND_OBJ_FPURGE_FALSE='#'
+else
+ GL_COND_OBJ_FPURGE_TRUE='#'
+ GL_COND_OBJ_FPURGE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FPURGE_TRUE}" && test -z "${GL_COND_OBJ_FPURGE_FALSE}"; then
+ GL_COND_OBJ_FPURGE_TRUE='#'
+ GL_COND_OBJ_FPURGE_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FPURGE=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FPURGE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether free is known to preserve errno" >&5
+$as_echo_n "checking whether free is known to preserve errno... " >&6; }
+if ${gl_cv_func_free_preserves_errno+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+int
+main ()
+{
+#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
+ #elif defined __OpenBSD__
+ #elif defined __sun
+ #else
+ #error "'free' is not known to preserve errno"
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_free_preserves_errno=yes
+else
+ gl_cv_func_free_preserves_errno=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_free_preserves_errno" >&5
+$as_echo "$gl_cv_func_free_preserves_errno" >&6; }
+
+ case $gl_cv_func_free_preserves_errno in
+ *yes)
+
+$as_echo "#define HAVE_FREE_POSIX 1" >>confdefs.h
+
+ ;;
+ *) REPLACE_FREE=1 ;;
+ esac
+
+
+ if test $REPLACE_FREE = 1; then
+ GL_COND_OBJ_FREE_TRUE=
+ GL_COND_OBJ_FREE_FALSE='#'
+else
+ GL_COND_OBJ_FREE_TRUE='#'
+ GL_COND_OBJ_FREE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FREE_TRUE}" && test -z "${GL_COND_OBJ_FREE_FALSE}"; then
+ GL_COND_OBJ_FREE_TRUE='#'
+ GL_COND_OBJ_FREE_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_FREE_TRUE"; then :
+
+ :
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FREE_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FREE_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+ REPLACE_FSEEK=1
+ fi
+
+
+ if test $REPLACE_FSEEK = 1; then
+ GL_COND_OBJ_FSEEK_TRUE=
+ GL_COND_OBJ_FSEEK_FALSE='#'
+else
+ GL_COND_OBJ_FSEEK_TRUE='#'
+ GL_COND_OBJ_FSEEK_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FSEEK_TRUE}" && test -z "${GL_COND_OBJ_FSEEK_FALSE}"; then
+ GL_COND_OBJ_FSEEK_TRUE='#'
+ GL_COND_OBJ_FSEEK_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FSEEK=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FSEEK 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
+$as_echo_n "checking for fseeko... " >&6; }
+if ${gl_cv_func_fseeko+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+
+int
+main ()
+{
+fseeko (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_fseeko=yes
+else
+ gl_cv_func_fseeko=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
+$as_echo "$gl_cv_func_fseeko" >&6; }
+
+
+ if test $ac_cv_have_decl_fseeko = no; then
+ HAVE_DECL_FSEEKO=0
+ fi
+
+ if test $gl_cv_func_fseeko = no; then
+ HAVE_FSEEKO=0
+ else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FSEEKO=1
+ fi
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FSEEKO=1
+ fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+$as_echo_n "checking whether fflush works on input streams... " >&6; }
+if ${gl_cv_func_fflush_stdin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo hello world > conftest.txt
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+ *) gl_cv_func_fflush_stdin=cross ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+
+
+$gl_mda_defines
+
+int
+main ()
+{
+FILE *f = fopen ("conftest.txt", "r");
+ char buffer[10];
+ int fd;
+ int c;
+ if (f == NULL)
+ return 1;
+ fd = fileno (f);
+ if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+ { fclose (f); return 2; }
+ /* For deterministic results, ensure f read a bigger buffer. */
+ if (lseek (fd, 0, SEEK_CUR) == 5)
+ { fclose (f); return 3; }
+ /* POSIX requires fflush-fseek to set file offset of fd. This fails
+ on BSD systems and on mingw. */
+ if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+ { fclose (f); return 4; }
+ if (lseek (fd, 0, SEEK_CUR) != 5)
+ { fclose (f); return 5; }
+ /* Verify behaviour of fflush after ungetc. See
+ <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
+ /* Verify behaviour of fflush after a backup ungetc. This fails on
+ mingw. */
+ c = fgetc (f);
+ ungetc (c, f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 6; }
+ /* Verify behaviour of fflush after a non-backup ungetc. This fails
+ on glibc 2.8 and on BSD systems. */
+ c = fgetc (f);
+ ungetc ('@', f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 7; }
+ fclose (f);
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_fflush_stdin=yes
+else
+ gl_cv_func_fflush_stdin=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm conftest.txt
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+$as_echo "$gl_cv_func_fflush_stdin" >&6; }
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) gl_func_fflush_stdin=1 ;;
+ *no) gl_func_fflush_stdin=0 ;;
+ *) gl_func_fflush_stdin='(-1)' ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
+_ACEOF
+
+
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) ;;
+ *) REPLACE_FSEEKO=1 ;;
+ esac
+
+ fi
+
+
+ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+ GL_COND_OBJ_FSEEKO_TRUE=
+ GL_COND_OBJ_FSEEKO_FALSE='#'
+else
+ GL_COND_OBJ_FSEEKO_TRUE='#'
+ GL_COND_OBJ_FSEEKO_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FSEEKO_TRUE}" && test -z "${GL_COND_OBJ_FSEEKO_FALSE}"; then
+ GL_COND_OBJ_FSEEKO_TRUE='#'
+ GL_COND_OBJ_FSEEKO_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_FSEEKO_TRUE"; then :
+
+
+ for ac_func in _fseeki64
+do :
+ ac_fn_c_check_func "$LINENO" "_fseeki64" "ac_cv_func__fseeki64"
+if test "x$ac_cv_func__fseeki64" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__FSEEKI64 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func__fseeki64 = yes; then
+ ac_fn_c_check_decl "$LINENO" "_fseeki64" "ac_cv_have_decl__fseeki64" "$ac_includes_default"
+if test "x$ac_cv_have_decl__fseeki64" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL__FSEEKI64 $ac_have_decl
+_ACEOF
+
+ fi
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FSEEKO=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FSEEKO 1" >>confdefs.h
+
+
+
+
+
+
+
+ case "$host_os" in
+ mingw* | solaris*)
+ REPLACE_FSTAT=1
+ ;;
+ esac
+
+
+
+
+ if test $REPLACE_FSTAT = 1; then
+ GL_COND_OBJ_FSTAT_TRUE=
+ GL_COND_OBJ_FSTAT_FALSE='#'
+else
+ GL_COND_OBJ_FSTAT_TRUE='#'
+ GL_COND_OBJ_FSTAT_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FSTAT_TRUE}" && test -z "${GL_COND_OBJ_FSTAT_FALSE}"; then
+ GL_COND_OBJ_FSTAT_TRUE='#'
+ GL_COND_OBJ_FSTAT_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_FSTAT_TRUE"; then :
+
+ case "$host_os" in
+ mingw*)
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
+
+ ;;
+ esac
+
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FSTAT=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
+
+
+
+
+
+
+ for ac_header in sys/mount.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default
+ #if HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+"
+if test "x$ac_cv_header_sys_mount_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_MOUNT_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+ ac_fsusage_space=no
+
+ # Perform only the link test since it seems there are no variants of the
+ # statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs])
+ # because that got a false positive on SCO OSR5. Adding the declaration
+ # of a 'struct statvfs' causes this test to fail (as it should) on such
+ # systems. That system is reported to work fine with STAT_STATFS4 which
+ # is what it gets when this test fails.
+ if test $ac_fsusage_space = no; then
+ # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
+ # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for statvfs function (SVR4)" >&5
+$as_echo_n "checking for statvfs function (SVR4)... " >&6; }
+if ${fu_cv_sys_stat_statvfs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#ifdef __osf__
+"Do not use Tru64's statvfs implementation"
+#endif
+
+#include <sys/statvfs.h>
+
+struct statvfs fsd;
+
+#if defined __APPLE__ && defined __MACH__
+#include <limits.h>
+/* On Mac OS X >= 10.5, f_blocks in 'struct statvfs' is a 32-bit quantity;
+ that commonly limits file systems to 4 TiB. Whereas f_blocks in
+ 'struct statfs' is a 64-bit type, thanks to the large-file support
+ that was enabled above. In this case, don't use statvfs(); use statfs()
+ instead. */
+int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
+#endif
+
+int
+main ()
+{
+statvfs (0, &fsd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ fu_cv_sys_stat_statvfs=yes
+else
+ fu_cv_sys_stat_statvfs=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statvfs" >&5
+$as_echo "$fu_cv_sys_stat_statvfs" >&6; }
+ if test $fu_cv_sys_stat_statvfs = yes; then
+ ac_fsusage_space=yes
+ # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
+ # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems
+ # statvfs with large-file support is already equivalent to statvfs64.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use statvfs64" >&5
+$as_echo_n "checking whether to use statvfs64... " >&6; }
+if ${fu_cv_sys_stat_statvfs64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/statvfs.h>
+ struct statvfs64 fsd;
+ int check_f_blocks_larger_in_statvfs64
+ [sizeof (((struct statvfs64 *) 0)->f_blocks)
+ > sizeof (((struct statvfs *) 0)->f_blocks)
+ ? 1 : -1];
+
+int
+main ()
+{
+statvfs64 (0, &fsd);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ fu_cv_sys_stat_statvfs64=yes
+else
+ fu_cv_sys_stat_statvfs64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statvfs64" >&5
+$as_echo "$fu_cv_sys_stat_statvfs64" >&6; }
+ if test $fu_cv_sys_stat_statvfs64 = yes; then
+
+$as_echo "#define STAT_STATVFS64 1" >>confdefs.h
+
+ else
+
+$as_echo "#define STAT_STATVFS 1" >>confdefs.h
+
+ fi
+ fi
+ fi
+
+ # Check for this unconditionally so we have a
+ # good fallback on glibc/Linux > 2.6 < 2.6.36
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.f_frsize member" >&5
+$as_echo_n "checking for two-argument statfs with statfs.f_frsize member... " >&6; }
+if ${fu_cv_sys_stat_statfs2_frsize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ fu_cv_sys_stat_statfs2_frsize=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_frsize = 0;
+ return statfs (".", &fsd) != 0;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ fu_cv_sys_stat_statfs2_frsize=yes
+else
+ fu_cv_sys_stat_statfs2_frsize=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_frsize" >&5
+$as_echo "$fu_cv_sys_stat_statfs2_frsize" >&6; }
+ if test $fu_cv_sys_stat_statfs2_frsize = yes; then
+ ac_fsusage_space=yes
+
+$as_echo "#define STAT_STATFS2_FRSIZE 1" >>confdefs.h
+
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # DEC Alpha running OSF/1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-argument statfs function (DEC OSF/1)" >&5
+$as_echo_n "checking for 3-argument statfs function (DEC OSF/1)... " >&6; }
+if ${fu_cv_sys_stat_statfs3_osf1+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ fu_cv_sys_stat_statfs3_osf1=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_fsize = 0;
+ return statfs (".", &fsd, sizeof (struct statfs)) != 0;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ fu_cv_sys_stat_statfs3_osf1=yes
+else
+ fu_cv_sys_stat_statfs3_osf1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs3_osf1" >&5
+$as_echo "$fu_cv_sys_stat_statfs3_osf1" >&6; }
+ if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
+ ac_fsusage_space=yes
+
+$as_echo "#define STAT_STATFS3_OSF1 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
+ # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
+ # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
+ # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
+ # <sys/vfs.h>.)
+ # (On Solaris, statfs has 4 arguments.)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)" >&5
+$as_echo_n "checking for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)... " >&6; }
+if ${fu_cv_sys_stat_statfs2_bsize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ fu_cv_sys_stat_statfs2_bsize=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_bsize = 0;
+ return statfs (".", &fsd) != 0;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ fu_cv_sys_stat_statfs2_bsize=yes
+else
+ fu_cv_sys_stat_statfs2_bsize=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_bsize" >&5
+$as_echo "$fu_cv_sys_stat_statfs2_bsize" >&6; }
+ if test $fu_cv_sys_stat_statfs2_bsize = yes; then
+ ac_fsusage_space=yes
+
+$as_echo "#define STAT_STATFS2_BSIZE 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # SVR3
+ # (Solaris already handled above.)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for four-argument statfs (SVR3)" >&5
+$as_echo_n "checking for four-argument statfs (SVR3)... " >&6; }
+if ${fu_cv_sys_stat_statfs4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ fu_cv_sys_stat_statfs4=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/statfs.h>
+ int
+ main ()
+ {
+ struct statfs fsd;
+ return statfs (".", &fsd, sizeof fsd, 0) != 0;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ fu_cv_sys_stat_statfs4=yes
+else
+ fu_cv_sys_stat_statfs4=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs4" >&5
+$as_echo "$fu_cv_sys_stat_statfs4" >&6; }
+ if test $fu_cv_sys_stat_statfs4 = yes; then
+ ac_fsusage_space=yes
+
+$as_echo "#define STAT_STATFS4 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # 4.4BSD and older NetBSD
+ # (OSF/1 already handled above.)
+ # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
+ # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
+ # <sys/mount.h>.)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)" >&5
+$as_echo_n "checking for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)... " >&6; }
+if ${fu_cv_sys_stat_statfs2_fsize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ fu_cv_sys_stat_statfs2_fsize=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_fsize = 0;
+ return statfs (".", &fsd) != 0;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ fu_cv_sys_stat_statfs2_fsize=yes
+else
+ fu_cv_sys_stat_statfs2_fsize=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_stat_statfs2_fsize" >&5
+$as_echo "$fu_cv_sys_stat_statfs2_fsize" >&6; }
+ if test $fu_cv_sys_stat_statfs2_fsize = yes; then
+ ac_fsusage_space=yes
+
+$as_echo "#define STAT_STATFS2_FSIZE 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test $ac_fsusage_space = yes; then :
+ gl_cv_fs_space=yes
+else
+ gl_cv_fs_space=no
+fi
+
+
+
+
+ if test $gl_cv_fs_space = yes; then
+ GL_COND_OBJ_FSUSAGE_TRUE=
+ GL_COND_OBJ_FSUSAGE_FALSE='#'
+else
+ GL_COND_OBJ_FSUSAGE_TRUE='#'
+ GL_COND_OBJ_FSUSAGE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FSUSAGE_TRUE}" && test -z "${GL_COND_OBJ_FSUSAGE_FALSE}"; then
+ GL_COND_OBJ_FSUSAGE_TRUE='#'
+ GL_COND_OBJ_FSUSAGE_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_FSUSAGE_TRUE"; then :
+
+
+ for ac_header in sys/fs/s5param.h sys/statfs.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs that truncates block counts" >&5
+$as_echo_n "checking for statfs that truncates block counts... " >&6; }
+if ${fu_cv_sys_truncating_statfs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if !defined(sun) && !defined(__sun)
+choke -- this is a workaround for a Sun-specific problem
+#endif
+#include <sys/types.h>
+#include <sys/vfs.h>
+
+int
+main ()
+{
+struct statfs t; long c = *(t.f_spare);
+ if (c) return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ fu_cv_sys_truncating_statfs=yes
+else
+ fu_cv_sys_truncating_statfs=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_truncating_statfs" >&5
+$as_echo "$fu_cv_sys_truncating_statfs" >&6; }
+ if test $fu_cv_sys_truncating_statfs = yes; then
+
+$as_echo "#define STATFS_TRUNCATES_BLOCK_COUNTS 1" >>confdefs.h
+
+ fi
+
+
+
+fi
+
+
+
+ if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+ REPLACE_FTELL=1
+ fi
+
+
+ if test $REPLACE_FTELL = 1; then
+ GL_COND_OBJ_FTELL_TRUE=
+ GL_COND_OBJ_FTELL_FALSE='#'
+else
+ GL_COND_OBJ_FTELL_TRUE='#'
+ GL_COND_OBJ_FTELL_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FTELL_TRUE}" && test -z "${GL_COND_OBJ_FTELL_FALSE}"; then
+ GL_COND_OBJ_FTELL_TRUE='#'
+ GL_COND_OBJ_FTELL_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FTELL=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FTELL 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_ftello = no; then
+ HAVE_DECL_FTELLO=0
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
+$as_echo_n "checking for ftello... " >&6; }
+if ${gl_cv_func_ftello+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+ftello (stdin);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_ftello=yes
+else
+ gl_cv_func_ftello=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
+$as_echo "$gl_cv_func_ftello" >&6; }
+ if test $gl_cv_func_ftello = no; then
+ HAVE_FTELLO=0
+ else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FTELLO=1
+ fi
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FTELLO=1
+ fi
+ if test $REPLACE_FTELLO = 0; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
+$as_echo_n "checking whether ftello works... " >&6; }
+if ${gl_cv_func_ftello_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_func_ftello_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_ftello_works="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_ftello_works="guessing yes" ;;
+ esac
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+ FILE *fp;
+
+ /* Create a file with some contents. */
+ fp = fopen (TESTFILE, "w");
+ if (fp == NULL)
+ return 70;
+ if (fwrite ("foogarsh", 1, 8, fp) < 8)
+ { fclose (fp); return 71; }
+ if (fclose (fp))
+ return 72;
+
+ /* The file's contents is now "foogarsh". */
+
+ /* Try writing after reading to EOF. */
+ fp = fopen (TESTFILE, "r+");
+ if (fp == NULL)
+ return 73;
+ if (fseek (fp, -1, SEEK_END))
+ { fclose (fp); return 74; }
+ if (!(getc (fp) == 'h'))
+ { fclose (fp); return 1; }
+ if (!(getc (fp) == EOF))
+ { fclose (fp); return 2; }
+ if (!(ftell (fp) == 8))
+ { fclose (fp); return 3; }
+ if (!(ftell (fp) == 8))
+ { fclose (fp); return 4; }
+ if (!(putc ('!', fp) == '!'))
+ { fclose (fp); return 5; }
+ if (!(ftell (fp) == 9))
+ { fclose (fp); return 6; }
+ if (!(fclose (fp) == 0))
+ return 7;
+ fp = fopen (TESTFILE, "r");
+ if (fp == NULL)
+ return 75;
+ {
+ char buf[10];
+ if (!(fread (buf, 1, 10, fp) == 9))
+ { fclose (fp); return 10; }
+ if (!(memcmp (buf, "foogarsh!", 9) == 0))
+ { fclose (fp); return 11; }
+ }
+ if (!(fclose (fp) == 0))
+ return 12;
+
+ /* The file's contents is now "foogarsh!". */
+
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_ftello_works=yes
+else
+ gl_cv_func_ftello_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
+$as_echo "$gl_cv_func_ftello_works" >&6; }
+ case "$gl_cv_func_ftello_works" in
+ *yes) ;;
+ *)
+ REPLACE_FTELLO=1
+
+$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
+
+ ;;
+ esac
+ fi
+ if test $REPLACE_FTELLO = 0; then
+
+ if test $gl_ftello_broken_after_ungetc = yes; then
+ REPLACE_FTELLO=1
+
+$as_echo "#define FTELLO_BROKEN_AFTER_UNGETC 1" >>confdefs.h
+
+ fi
+ fi
+ fi
+
+
+ if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+ GL_COND_OBJ_FTELLO_TRUE=
+ GL_COND_OBJ_FTELLO_FALSE='#'
+else
+ GL_COND_OBJ_FTELLO_TRUE='#'
+ GL_COND_OBJ_FTELLO_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_FTELLO_TRUE}" && test -z "${GL_COND_OBJ_FTELLO_FALSE}"; then
+ GL_COND_OBJ_FTELLO_TRUE='#'
+ GL_COND_OBJ_FTELLO_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_FTELLO_TRUE"; then :
+
+
+ for ac_func in _ftelli64
+do :
+ ac_fn_c_check_func "$LINENO" "_ftelli64" "ac_cv_func__ftelli64"
+if test "x$ac_cv_func__ftelli64" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__FTELLI64 1
+_ACEOF
+
+fi
+done
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FTELLO=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FTELLO 1" >>confdefs.h
+
+
+
+
+ GETADDRINFO_LIB=
+ gai_saved_LIBS="$LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
+$as_echo_n "checking for library containing getaddrinfo... " >&6; }
+if ${ac_cv_search_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getaddrinfo ();
+int
+main ()
+{
+return getaddrinfo ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket network net; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getaddrinfo=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getaddrinfo+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getaddrinfo+:} false; then :
+
+else
+ ac_cv_search_getaddrinfo=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5
+$as_echo "$ac_cv_search_getaddrinfo" >&6; }
+ac_res=$ac_cv_search_getaddrinfo
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ if test "$ac_cv_search_getaddrinfo" != "none required"; then
+ GETADDRINFO_LIB="$ac_cv_search_getaddrinfo"
+ fi
+fi
+
+ LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
+
+ HAVE_GETADDRINFO=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5
+$as_echo_n "checking for getaddrinfo... " >&6; }
+if ${gl_cv_func_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#include <stddef.h>
+
+int
+main ()
+{
+getaddrinfo("", "", NULL, NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_getaddrinfo=yes
+else
+ gl_cv_func_getaddrinfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getaddrinfo" >&5
+$as_echo "$gl_cv_func_getaddrinfo" >&6; }
+ if test $gl_cv_func_getaddrinfo = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5
+$as_echo_n "checking for getaddrinfo in ws2tcpip.h and -lws2_32... " >&6; }
+if ${gl_cv_w32_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_cv_w32_getaddrinfo=no
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+
+int
+main ()
+{
+getaddrinfo(NULL, NULL, NULL, NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_w32_getaddrinfo=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getaddrinfo" >&5
+$as_echo "$gl_cv_w32_getaddrinfo" >&6; }
+ if test "$gl_cv_w32_getaddrinfo" = "yes"; then
+ GETADDRINFO_LIB="-lws2_32"
+ LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo with POSIX signature" >&5
+$as_echo_n "checking for getaddrinfo with POSIX signature... " >&6; }
+if ${gl_cv_func_getaddrinfo_posix_signature+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int getaddrinfo (const char *, const char *, const struct addrinfo *, struct addrinfo **);
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_getaddrinfo_posix_signature=yes
+else
+ gl_cv_func_getaddrinfo_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getaddrinfo_posix_signature" >&5
+$as_echo "$gl_cv_func_getaddrinfo_posix_signature" >&6; }
+ if test $gl_cv_func_getaddrinfo_posix_signature = no; then
+ REPLACE_GETADDRINFO=1
+ fi
+ else
+ HAVE_GETADDRINFO=0
+ fi
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_GETADDRINFO $HAVE_GETADDRINFO
+_ACEOF
+
+
+ # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
+ # inline function declared in ws2tcpip.h, so we need to get that
+ # header included somehow.
+ ac_fn_c_check_decl "$LINENO" "gai_strerror" "ac_cv_have_decl_gai_strerror" "
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+
+"
+if test "x$ac_cv_have_decl_gai_strerror" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GAI_STRERROR $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_gai_strerror = yes; then
+ ac_fn_c_check_decl "$LINENO" "gai_strerrorA" "ac_cv_have_decl_gai_strerrorA" "
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+
+"
+if test "x$ac_cv_have_decl_gai_strerrorA" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GAI_STRERRORA $ac_have_decl
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gai_strerror with POSIX signature" >&5
+$as_echo_n "checking for gai_strerror with POSIX signature... " >&6; }
+if ${gl_cv_func_gai_strerror_posix_signature+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *gai_strerror(int);
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_gai_strerror_posix_signature=yes
+else
+ gl_cv_func_gai_strerror_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gai_strerror_posix_signature" >&5
+$as_echo "$gl_cv_func_gai_strerror_posix_signature" >&6; }
+ if test $gl_cv_func_gai_strerror_posix_signature = no; then
+ REPLACE_GAI_STRERROR=1
+ fi
+ fi
+
+ LIBS="$gai_saved_LIBS"
+
+
+
+
+
+
+
+
+ ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "
+#include <sys/types.h>
+#include <sys/socket.h>
+
+"
+if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
+_ACEOF
+
+
+fi
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "getaddrinfo" "ac_cv_have_decl_getaddrinfo" "
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_getaddrinfo" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETADDRINFO $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "freeaddrinfo" "ac_cv_have_decl_freeaddrinfo" "
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_freeaddrinfo" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FREEADDRINFO $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "getnameinfo" "ac_cv_have_decl_getnameinfo" "
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_getnameinfo" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETNAMEINFO $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_getaddrinfo = no; then
+ HAVE_DECL_GETADDRINFO=0
+ fi
+ if test $ac_cv_have_decl_freeaddrinfo = no; then
+ HAVE_DECL_FREEADDRINFO=0
+ fi
+ if test $ac_cv_have_decl_gai_strerror = no; then
+ HAVE_DECL_GAI_STRERROR=0
+ fi
+ if test $ac_cv_have_decl_getnameinfo = no; then
+ HAVE_DECL_GETNAMEINFO=0
+ fi
+
+ ac_fn_c_check_type "$LINENO" "struct addrinfo" "ac_cv_type_struct_addrinfo" "
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_type_struct_addrinfo" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ADDRINFO 1
+_ACEOF
+
+
+fi
+
+ if test $ac_cv_type_struct_addrinfo = no; then
+ HAVE_STRUCT_ADDRINFO=0
+ fi
+
+ case " $GETADDRINFO_LIB " in
+ *" $HOSTENT_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;;
+ esac
+
+ case " $GETADDRINFO_LIB " in
+ *" $SERVENT_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
+ esac
+
+ case " $GETADDRINFO_LIB " in
+ *" $INET_NTOP_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;;
+ esac
+
+
+
+
+
+ if test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1; then
+ GL_COND_OBJ_GETADDRINFO_TRUE=
+ GL_COND_OBJ_GETADDRINFO_FALSE='#'
+else
+ GL_COND_OBJ_GETADDRINFO_TRUE='#'
+ GL_COND_OBJ_GETADDRINFO_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GETADDRINFO_TRUE}" && test -z "${GL_COND_OBJ_GETADDRINFO_FALSE}"; then
+ GL_COND_OBJ_GETADDRINFO_TRUE='#'
+ GL_COND_OBJ_GETADDRINFO_FALSE='#'
+ fi
+
+
+ if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
+ GL_COND_OBJ_GAI_STRERROR_TRUE=
+ GL_COND_OBJ_GAI_STRERROR_FALSE='#'
+else
+ GL_COND_OBJ_GAI_STRERROR_TRUE='#'
+ GL_COND_OBJ_GAI_STRERROR_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GAI_STRERROR_TRUE}" && test -z "${GL_COND_OBJ_GAI_STRERROR_FALSE}"; then
+ GL_COND_OBJ_GAI_STRERROR_TRUE='#'
+ GL_COND_OBJ_GAI_STRERROR_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETADDRINFO=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETADDRINFO 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_getdelim = yes; then
+ HAVE_GETDELIM=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getdelim function" >&5
+$as_echo_n "checking for working getdelim function... " >&6; }
+if ${gl_cv_func_working_getdelim+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ darwin*)
+ gl_cv_func_working_getdelim=no ;;
+ *)
+ echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
+ Lucky GNU user
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
+ gl_cv_func_working_getdelim="guessing yes"
+else
+ case "$host_os" in
+ *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
+ *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
+ esac
+
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+ int main ()
+ {
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ {
+ /* Test result for a NULL buffer and a zero size.
+ Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len = getdelim (&line, &siz, '\n', in);
+ if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
+ { free (line); fclose (in); return 2; }
+ free (line);
+ }
+ {
+ /* Test result for a NULL buffer and a non-zero size.
+ This crashes on FreeBSD 8.0. */
+ char *line = NULL;
+ size_t siz = (size_t)(~0) / 4;
+ if (getdelim (&line, &siz, '\n', in) == -1)
+ { fclose (in); return 3; }
+ free (line);
+ }
+ fclose (in);
+ return 0;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_working_getdelim=yes
+else
+ gl_cv_func_working_getdelim=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_getdelim" >&5
+$as_echo "$gl_cv_func_working_getdelim" >&6; }
+ case "$gl_cv_func_working_getdelim" in
+ *yes) ;;
+ *) REPLACE_GETDELIM=1 ;;
+ esac
+ else
+ HAVE_GETDELIM=0
+ fi
+
+ if test $ac_cv_have_decl_getdelim = no; then
+ HAVE_DECL_GETDELIM=0
+ fi
+
+
+ if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
+ GL_COND_OBJ_GETDELIM_TRUE=
+ GL_COND_OBJ_GETDELIM_FALSE='#'
+else
+ GL_COND_OBJ_GETDELIM_TRUE='#'
+ GL_COND_OBJ_GETDELIM_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GETDELIM_TRUE}" && test -z "${GL_COND_OBJ_GETDELIM_FALSE}"; then
+ GL_COND_OBJ_GETDELIM_TRUE='#'
+ GL_COND_OBJ_GETDELIM_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_GETDELIM_TRUE"; then :
+
+
+ for ac_func in flockfile funlockfile
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
+_ACEOF
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETDELIM=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETDELIM 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_getdtablesize = yes &&
+ test $ac_cv_have_decl_getdtablesize = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
+$as_echo_n "checking whether getdtablesize works... " >&6; }
+if ${gl_cv_func_getdtablesize_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
+ *)
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+ gl_cv_func_getdtablesize_works="guessing no" ;;
+ *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <unistd.h>
+
+
+$gl_mda_defines
+
+
+int
+main ()
+{
+int size = getdtablesize();
+ if (dup2 (0, getdtablesize()) != -1)
+ return 1;
+ if (size != getdtablesize())
+ return 2;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_getdtablesize_works=yes
+else
+ gl_cv_func_getdtablesize_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
+$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
+ case "$gl_cv_func_getdtablesize_works" in
+ *yes | "no (limitation)") ;;
+ *) REPLACE_GETDTABLESIZE=1 ;;
+ esac
+ else
+ HAVE_GETDTABLESIZE=0
+ fi
+
+
+ if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
+ GL_COND_OBJ_GETDTABLESIZE_TRUE=
+ GL_COND_OBJ_GETDTABLESIZE_FALSE='#'
+else
+ GL_COND_OBJ_GETDTABLESIZE_TRUE='#'
+ GL_COND_OBJ_GETDTABLESIZE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GETDTABLESIZE_TRUE}" && test -z "${GL_COND_OBJ_GETDTABLESIZE_FALSE}"; then
+ GL_COND_OBJ_GETDTABLESIZE_TRUE='#'
+ GL_COND_OBJ_GETDTABLESIZE_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_GETDTABLESIZE_TRUE"; then :
+
+ :
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETDTABLESIZE=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+
+ GETHOSTNAME_LIB=
+ for ac_func in gethostname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname"
+if test "x$ac_cv_func_gethostname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTNAME 1
+_ACEOF
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostname in winsock2.h and -lws2_32" >&5
+$as_echo_n "checking for gethostname in winsock2.h and -lws2_32... " >&6; }
+if ${gl_cv_w32_gethostname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_w32_gethostname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+
+int
+main ()
+{
+gethostname(NULL, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_w32_gethostname=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostname" >&5
+$as_echo "$gl_cv_w32_gethostname" >&6; }
+ if test "$gl_cv_w32_gethostname" = "yes"; then
+ GETHOSTNAME_LIB="-lws2_32"
+ fi
+
+fi
+done
+
+
+
+ if test "$ac_cv_func_gethostname" = no; then
+ HAVE_GETHOSTNAME=0
+ fi
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HOST_NAME_MAX" >&5
+$as_echo_n "checking for HOST_NAME_MAX... " >&6; }
+if ${gl_cv_decl_HOST_NAME_MAX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_cv_decl_HOST_NAME_MAX=
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <limits.h>
+#ifdef HOST_NAME_MAX
+lucky
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "lucky" >/dev/null 2>&1; then :
+ gl_cv_decl_HOST_NAME_MAX=yes
+fi
+rm -f conftest*
+
+ if test -z "$gl_cv_decl_HOST_NAME_MAX"; then
+ if test "$gl_cv_w32_gethostname" = yes; then
+ gl_cv_decl_HOST_NAME_MAX=256
+ else
+ if ac_fn_c_compute_int "$LINENO" "MAXHOSTNAMELEN" "gl_cv_decl_HOST_NAME_MAX" "
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+# include <netdb.h>
+#endif
+"; then :
+
+else
+ gl_cv_decl_HOST_NAME_MAX=256
+
+fi
+
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_HOST_NAME_MAX" >&5
+$as_echo "$gl_cv_decl_HOST_NAME_MAX" >&6; }
+ if test "$gl_cv_decl_HOST_NAME_MAX" != yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HOST_NAME_MAX $gl_cv_decl_HOST_NAME_MAX
+_ACEOF
+
+ fi
+
+
+
+ if test $HAVE_GETHOSTNAME = 0; then
+ GL_COND_OBJ_GETHOSTNAME_TRUE=
+ GL_COND_OBJ_GETHOSTNAME_FALSE='#'
+else
+ GL_COND_OBJ_GETHOSTNAME_TRUE='#'
+ GL_COND_OBJ_GETHOSTNAME_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GETHOSTNAME_TRUE}" && test -z "${GL_COND_OBJ_GETHOSTNAME_FALSE}"; then
+ GL_COND_OBJ_GETHOSTNAME_TRUE='#'
+ GL_COND_OBJ_GETHOSTNAME_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_GETHOSTNAME_TRUE"; then :
+
+
+ if test "$gl_cv_w32_gethostname" != "yes"; then
+ for ac_func in uname
+do :
+ ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname"
+if test "x$ac_cv_func_uname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UNAME 1
+_ACEOF
+
+fi
+done
+
+ fi
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETHOSTNAME=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETHOSTNAME 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+ gl_getline_needs_run_time_check=no
+ ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline"
+if test "x$ac_cv_func_getline" = xyes; then :
+ gl_getline_needs_run_time_check=yes
+else
+ am_cv_func_working_getline=no
+fi
+
+ if test $gl_getline_needs_run_time_check = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working getline function" >&5
+$as_echo_n "checking for working getline function... " >&6; }
+if ${am_cv_func_working_getline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
+ Lucky GNU user
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
+ am_cv_func_working_getline="guessing yes"
+else
+ case "$host_os" in
+ *-musl*) am_cv_func_working_getline="guessing yes" ;;
+ *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
+ esac
+
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+ int main ()
+ {
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ {
+ /* Test result for a NULL buffer and a zero size.
+ Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len = getline (&line, &siz, in);
+ if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
+ { free (line); fclose (in); return 2; }
+ free (line);
+ }
+ {
+ /* Test result for a NULL buffer and a non-zero size.
+ This crashes on FreeBSD 8.0. */
+ char *line = NULL;
+ size_t siz = (size_t)(~0) / 4;
+ if (getline (&line, &siz, in) == -1)
+ { fclose (in); return 3; }
+ free (line);
+ }
+ fclose (in);
+ return 0;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ am_cv_func_working_getline=yes
+else
+ am_cv_func_working_getline=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_working_getline" >&5
+$as_echo "$am_cv_func_working_getline" >&6; }
+ fi
+
+ if test $ac_cv_have_decl_getline = no; then
+ HAVE_DECL_GETLINE=0
+ fi
+
+ case "$am_cv_func_working_getline" in
+ *yes) ;;
+ *)
+ REPLACE_GETLINE=1
+ ;;
+ esac
+
+
+ if test $REPLACE_GETLINE = 1; then
+ GL_COND_OBJ_GETLINE_TRUE=
+ GL_COND_OBJ_GETLINE_FALSE='#'
+else
+ GL_COND_OBJ_GETLINE_TRUE='#'
+ GL_COND_OBJ_GETLINE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GETLINE_TRUE}" && test -z "${GL_COND_OBJ_GETLINE_FALSE}"; then
+ GL_COND_OBJ_GETLINE_TRUE='#'
+ GL_COND_OBJ_GETLINE_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_GETLINE_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETLINE=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETLINE 1" >>confdefs.h
+
+
+
+
+
+
+# Persuade glibc <stdlib.h> to declare getloadavg().
+
+
+gl_save_LIBS=$LIBS
+
+# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
+# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
+HAVE_GETLOADAVG=1
+ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg"
+if test "x$ac_cv_func_getloadavg" = xyes; then :
+
+else
+ gl_func_getloadavg_done=no
+
+ # Some systems with -lutil have (and need) -lkvm as well, some do not.
+ # On Solaris, -lkvm requires nlist from -lelf, so check that first
+ # to get the right answer into the cache.
+ # For kstat on solaris, we need to test for libelf and libkvm to force the
+ # definition of SVR4 below.
+ if test $gl_func_getloadavg_done = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_begin in -lelf" >&5
+$as_echo_n "checking for elf_begin in -lelf... " >&6; }
+if ${ac_cv_lib_elf_elf_begin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lelf $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char elf_begin ();
+int
+main ()
+{
+return elf_begin ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_elf_elf_begin=yes
+else
+ ac_cv_lib_elf_elf_begin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_elf_elf_begin" >&5
+$as_echo "$ac_cv_lib_elf_elf_begin" >&6; }
+if test "x$ac_cv_lib_elf_elf_begin" = xyes; then :
+ LIBS="-lelf $LIBS"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
+$as_echo_n "checking for kvm_open in -lkvm... " >&6; }
+if ${ac_cv_lib_kvm_kvm_open+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkvm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_open ();
+int
+main ()
+{
+return kvm_open ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_kvm_kvm_open=yes
+else
+ ac_cv_lib_kvm_kvm_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5
+$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
+if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then :
+ LIBS="-lkvm $LIBS"
+fi
+
+ # Check for the 4.4BSD definition of getloadavg.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lutil" >&5
+$as_echo_n "checking for getloadavg in -lutil... " >&6; }
+if ${ac_cv_lib_util_getloadavg+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lutil $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getloadavg ();
+int
+main ()
+{
+return getloadavg ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_util_getloadavg=yes
+else
+ ac_cv_lib_util_getloadavg=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_getloadavg" >&5
+$as_echo "$ac_cv_lib_util_getloadavg" >&6; }
+if test "x$ac_cv_lib_util_getloadavg" = xyes; then :
+ LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes
+fi
+
+ fi
+
+ if test $gl_func_getloadavg_done = no; then
+ # There is a commonly available library for RS/6000 AIX.
+ # Since it is not a standard part of AIX, it might be installed locally.
+ gl_getloadavg_LIBS=$LIBS
+ if test $cross_compiling != yes; then
+ LIBS="-L/usr/local/lib $LIBS"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getloadavg in -lgetloadavg" >&5
+$as_echo_n "checking for getloadavg in -lgetloadavg... " >&6; }
+if ${ac_cv_lib_getloadavg_getloadavg+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgetloadavg $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getloadavg ();
+int
+main ()
+{
+return getloadavg ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_getloadavg_getloadavg=yes
+else
+ ac_cv_lib_getloadavg_getloadavg=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_getloadavg_getloadavg" >&5
+$as_echo "$ac_cv_lib_getloadavg_getloadavg" >&6; }
+if test "x$ac_cv_lib_getloadavg_getloadavg" = xyes; then :
+ LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes
+else
+ LIBS=$gl_getloadavg_LIBS
+fi
+
+ fi
+
+ # Set up the replacement function if necessary.
+ if test $gl_func_getloadavg_done = no; then
+ HAVE_GETLOADAVG=0
+
+ # Solaris has libkstat which does not require root.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5
+$as_echo_n "checking for kstat_open in -lkstat... " >&6; }
+if ${ac_cv_lib_kstat_kstat_open+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkstat $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kstat_open ();
+int
+main ()
+{
+return kstat_open ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_kstat_kstat_open=yes
+else
+ ac_cv_lib_kstat_kstat_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5
+$as_echo "$ac_cv_lib_kstat_kstat_open" >&6; }
+if test "x$ac_cv_lib_kstat_kstat_open" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKSTAT 1
+_ACEOF
+
+ LIBS="-lkstat $LIBS"
+
+fi
+
+ test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
+
+ # AIX has libperfstat which does not require root
+ if test $gl_func_getloadavg_done = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5
+$as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; }
+if ${ac_cv_lib_perfstat_perfstat_cpu_total+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lperfstat $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char perfstat_cpu_total ();
+int
+main ()
+{
+return perfstat_cpu_total ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_perfstat_perfstat_cpu_total=yes
+else
+ ac_cv_lib_perfstat_perfstat_cpu_total=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_perfstat_cpu_total" >&5
+$as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; }
+if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPERFSTAT 1
+_ACEOF
+
+ LIBS="-lperfstat $LIBS"
+
+fi
+
+ test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
+ fi
+
+ if test $gl_func_getloadavg_done = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/dg_sys_info.h" "ac_cv_header_sys_dg_sys_info_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_dg_sys_info_h" = xyes; then :
+ gl_func_getloadavg_done=yes
+
+$as_echo "#define DGUX 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dg_sys_info in -ldgc" >&5
+$as_echo_n "checking for dg_sys_info in -ldgc... " >&6; }
+if ${ac_cv_lib_dgc_dg_sys_info+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldgc $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dg_sys_info ();
+int
+main ()
+{
+return dg_sys_info ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dgc_dg_sys_info=yes
+else
+ ac_cv_lib_dgc_dg_sys_info=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgc_dg_sys_info" >&5
+$as_echo "$ac_cv_lib_dgc_dg_sys_info" >&6; }
+if test "x$ac_cv_lib_dgc_dg_sys_info" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDGC 1
+_ACEOF
+
+ LIBS="-ldgc $LIBS"
+
+fi
+
+fi
+
+
+ fi
+ fi
+fi
+
+
+if test "x$gl_save_LIBS" = x; then
+ GETLOADAVG_LIBS=$LIBS
+else
+ GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
+fi
+LIBS=$gl_save_LIBS
+
+
+# Test whether the system declares getloadavg. Solaris has the function
+# but declares it in <sys/loadavg.h>, not <stdlib.h>.
+for ac_header in sys/loadavg.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/loadavg.h" "ac_cv_header_sys_loadavg_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_loadavg_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_LOADAVG_H 1
+_ACEOF
+
+fi
+
+done
+
+if test $ac_cv_header_sys_loadavg_h = yes; then
+ HAVE_SYS_LOADAVG_H=1
+else
+ HAVE_SYS_LOADAVG_H=0
+fi
+ac_fn_c_check_decl "$LINENO" "getloadavg" "ac_cv_have_decl_getloadavg" "#if HAVE_SYS_LOADAVG_H
+ /* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+ # include <sys/time.h>
+ # include <sys/loadavg.h>
+ #endif
+ #include <stdlib.h>
+"
+if test "x$ac_cv_have_decl_getloadavg" = xyes; then :
+
+else
+ HAVE_DECL_GETLOADAVG=0
+fi
+
+
+
+ if test $HAVE_GETLOADAVG = 0; then
+ GL_COND_OBJ_GETLOADAVG_TRUE=
+ GL_COND_OBJ_GETLOADAVG_FALSE='#'
+else
+ GL_COND_OBJ_GETLOADAVG_TRUE='#'
+ GL_COND_OBJ_GETLOADAVG_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GETLOADAVG_TRUE}" && test -z "${GL_COND_OBJ_GETLOADAVG_FALSE}"; then
+ GL_COND_OBJ_GETLOADAVG_TRUE='#'
+ GL_COND_OBJ_GETLOADAVG_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_GETLOADAVG_TRUE"; then :
+
+
+# Figure out what our getloadavg.c needs.
+
+
+
+# On HPUX9, an unprivileged user can get load averages this way.
+if test $gl_func_getloadavg_done = no; then
+ for ac_func in pstat_getdynamic
+do :
+ ac_fn_c_check_func "$LINENO" "pstat_getdynamic" "ac_cv_func_pstat_getdynamic"
+if test "x$ac_cv_func_pstat_getdynamic" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PSTAT_GETDYNAMIC 1
+_ACEOF
+ gl_func_getloadavg_done=yes
+fi
+done
+
+fi
+
+# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
+# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
+# Irix 4.0.5F has the header but not the library.
+if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
+ && test "$ac_cv_lib_kvm_kvm_open" = yes; then
+ gl_func_getloadavg_done=yes
+
+$as_echo "#define SVR4 1" >>confdefs.h
+
+fi
+
+if test $gl_func_getloadavg_done = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "inq_stats/cpustats.h" "ac_cv_header_inq_stats_cpustats_h" "$ac_includes_default"
+if test "x$ac_cv_header_inq_stats_cpustats_h" = xyes; then :
+ gl_func_getloadavg_done=yes
+
+$as_echo "#define UMAX 1" >>confdefs.h
+
+
+$as_echo "#define UMAX4_3 1" >>confdefs.h
+
+fi
+
+
+fi
+
+if test $gl_func_getloadavg_done = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/cpustats.h" "ac_cv_header_sys_cpustats_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_cpustats_h" = xyes; then :
+ gl_func_getloadavg_done=yes; $as_echo "#define UMAX 1" >>confdefs.h
+
+fi
+
+
+fi
+
+if test $gl_func_getloadavg_done = no; then
+ for ac_header in mach/mach.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
+if test "x$ac_cv_header_mach_mach_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MACH_MACH_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+for ac_header in nlist.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "nlist.h" "ac_cv_header_nlist_h" "$ac_includes_default"
+if test "x$ac_cv_header_nlist_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NLIST_H 1
+_ACEOF
+ ac_fn_c_check_member "$LINENO" "struct nlist" "n_un.n_name" "ac_cv_member_struct_nlist_n_un_n_name" "#include <nlist.h>
+"
+if test "x$ac_cv_member_struct_nlist_n_un_n_name" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_NLIST_N_UN_N_NAME 1
+_ACEOF
+
+
+fi
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <nlist.h>
+int
+main ()
+{
+struct nlist x;
+ #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
+ x.n_un.n_name = "";
+ #else
+ x.n_name = "";
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+$as_echo "#define N_NAME_POINTER 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+done
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETLOADAVG=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETLOADAVG 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+
+ GL_GENERATE_GETOPT_H=false
+ GL_GENERATE_GETOPT_CDEFS_H=false
+ if test $REPLACE_GETOPT = 1; then
+
+
+ if test $ac_cv_header_sys_cdefs_h = yes; then
+ HAVE_SYS_CDEFS_H=1
+ else
+ HAVE_SYS_CDEFS_H=0
+ fi
+
+
+
+$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+
+ GL_GENERATE_GETOPT_H=true
+ GL_GENERATE_GETOPT_CDEFS_H=true
+
+ fi
+
+
+
+
+
+ case "$GL_GENERATE_GETOPT_H" in
+ false) GETOPT_H='' ;;
+ true)
+ if test -z "$GETOPT_H"; then
+ GETOPT_H="${gl_source_base_prefix}getopt.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_GETOPT_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_GETOPT_H; then
+ GL_GENERATE_GETOPT_H_TRUE=
+ GL_GENERATE_GETOPT_H_FALSE='#'
+else
+ GL_GENERATE_GETOPT_H_TRUE='#'
+ GL_GENERATE_GETOPT_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_GETOPT_H_TRUE}" && test -z "${GL_GENERATE_GETOPT_H_FALSE}"; then
+ GL_GENERATE_GETOPT_H_TRUE='#'
+ GL_GENERATE_GETOPT_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+ case "$GL_GENERATE_GETOPT_CDEFS_H" in
+ false) GETOPT_CDEFS_H='' ;;
+ true)
+ if test -z "$GETOPT_CDEFS_H"; then
+ GETOPT_CDEFS_H="${gl_source_base_prefix}getopt-cdefs.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_GETOPT_CDEFS_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_GETOPT_CDEFS_H; then
+ GL_GENERATE_GETOPT_CDEFS_H_TRUE=
+ GL_GENERATE_GETOPT_CDEFS_H_FALSE='#'
+else
+ GL_GENERATE_GETOPT_CDEFS_H_TRUE='#'
+ GL_GENERATE_GETOPT_CDEFS_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_GETOPT_CDEFS_H_TRUE}" && test -z "${GL_GENERATE_GETOPT_CDEFS_H_FALSE}"; then
+ GL_GENERATE_GETOPT_CDEFS_H_TRUE='#'
+ GL_GENERATE_GETOPT_CDEFS_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+ if test $REPLACE_GETOPT = 1; then
+ GL_COND_OBJ_GETOPT_TRUE=
+ GL_COND_OBJ_GETOPT_FALSE='#'
+else
+ GL_COND_OBJ_GETOPT_TRUE='#'
+ GL_COND_OBJ_GETOPT_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_GETOPT_TRUE}" && test -z "${GL_COND_OBJ_GETOPT_FALSE}"; then
+ GL_COND_OBJ_GETOPT_TRUE='#'
+ GL_COND_OBJ_GETOPT_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_GETOPT_TRUE"; then :
+
+
+
+
+
+
+
+ GL_GNULIB_UNISTD_H_GETOPT=1
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETOPT_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETOPT_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+ ac_found=0
+ ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
+"
+if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_found=1
+fi
+
+ ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
+"
+if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_found=1
+fi
+
+ ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
+"
+if test "x$ac_cv_have_decl___argv" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL___ARGV $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_found=1
+fi
+
+
+ # Incur the cost of this test only if none of the above worked.
+ if test $ac_found = 0; then
+ # On OpenBSD 5.1, using the global __progname variable appears to be
+ # the only way to implement getprogname.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
+$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
+if ${gl_cv_var___progname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_cv_var___progname=
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern char *__progname;
+int
+main ()
+{
+return *__progname;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_var___progname=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
+$as_echo "$gl_cv_var___progname" >&6; }
+ if test "$gl_cv_var___progname" = yes; then
+
+$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
+
+ fi
+ fi
+
+
+
+
+
+ LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+
+
+ HOSTENT_LIB=
+ gl_saved_libs="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if ${ac_cv_search_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl network net; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_gethostbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_gethostbyname+:} false; then :
+
+else
+ ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+$as_echo "$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ if test "$ac_cv_search_gethostbyname" != "none required"; then
+ HOSTENT_LIB="$ac_cv_search_gethostbyname"
+ fi
+fi
+
+ LIBS="$gl_saved_libs"
+ if test -z "$HOSTENT_LIB"; then
+ for ac_func in gethostbyname
+do :
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTBYNAME 1
+_ACEOF
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in winsock2.h and -lws2_32" >&5
+$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; }
+if ${gl_cv_w32_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_w32_gethostbyname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+
+int
+main ()
+{
+gethostbyname(NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_w32_gethostbyname=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_gethostbyname" >&5
+$as_echo "$gl_cv_w32_gethostbyname" >&6; }
+ if test "$gl_cv_w32_gethostbyname" = "yes"; then
+ HOSTENT_LIB="-lws2_32"
+ fi
+
+fi
+done
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ HAVE_INET_NTOP=1
+ INET_NTOP_LIB=
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+ if test $HAVE_WINSOCK2_H = 1; then
+ REPLACE_INET_NTOP=1
+ ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <ws2tcpip.h>
+"
+if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_inet_ntop = yes; then
+ INET_NTOP_LIB="-lws2_32"
+ else
+ HAVE_DECL_INET_NTOP=0
+ fi
+ else
+ gl_save_LIBS=$LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
+$as_echo_n "checking for library containing inet_ntop... " >&6; }
+if ${ac_cv_search_inet_ntop+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntop ();
+int
+main ()
+{
+return inet_ntop ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl resolv network; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_inet_ntop=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_ntop+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_ntop+:} false; then :
+
+else
+ ac_cv_search_inet_ntop=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5
+$as_echo "$ac_cv_search_inet_ntop" >&6; }
+ac_res=$ac_cv_search_inet_ntop
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+ for ac_func in inet_ntop
+do :
+ ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
+if test "x$ac_cv_func_inet_ntop" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_INET_NTOP 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_inet_ntop = no; then
+ HAVE_INET_NTOP=0
+ fi
+
+fi
+
+ LIBS=$gl_save_LIBS
+
+ if test "$ac_cv_search_inet_ntop" != "no" \
+ && test "$ac_cv_search_inet_ntop" != "none required"; then
+ INET_NTOP_LIB="$ac_cv_search_inet_ntop"
+ fi
+
+
+ ac_fn_c_check_decl "$LINENO" "inet_ntop" "ac_cv_have_decl_inet_ntop" "#include <arpa/inet.h>
+ #if HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+
+"
+if test "x$ac_cv_have_decl_inet_ntop" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_inet_ntop = no; then
+ HAVE_DECL_INET_NTOP=0
+ fi
+ fi
+
+
+
+ if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
+ GL_COND_OBJ_INET_NTOP_TRUE=
+ GL_COND_OBJ_INET_NTOP_FALSE='#'
+else
+ GL_COND_OBJ_INET_NTOP_TRUE='#'
+ GL_COND_OBJ_INET_NTOP_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_INET_NTOP_TRUE}" && test -z "${GL_COND_OBJ_INET_NTOP_FALSE}"; then
+ GL_COND_OBJ_INET_NTOP_TRUE='#'
+ GL_COND_OBJ_INET_NTOP_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_INET_NTOP_TRUE"; then :
+
+
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_INET_NTOP=1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
+$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; }
+if ${gl_cv_c___inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+typedef int foo_t;
+ static __inline foo_t foo (void) { return 0; }
+int
+main ()
+{
+return foo ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_c___inline=yes
+else
+ gl_cv_c___inline=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
+$as_echo "$gl_cv_c___inline" >&6; }
+ if test $gl_cv_c___inline = yes; then
+
+$as_echo "#define HAVE___INLINE 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+ case "$GL_GENERATE_LIMITS_H" in
+ false) LIMITS_H='' ;;
+ true)
+ if test -z "$LIMITS_H"; then
+ LIMITS_H="${gl_source_base_prefix}limits.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_LIMITS_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_LIMITS_H; then
+ GL_GENERATE_LIMITS_H_TRUE=
+ GL_GENERATE_LIMITS_H_FALSE='#'
+else
+ GL_GENERATE_LIMITS_H_TRUE='#'
+ GL_GENERATE_LIMITS_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
+ GL_GENERATE_LIMITS_H_TRUE='#'
+ GL_GENERATE_LIMITS_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+ LOCALCHARSET_TESTS_ENVIRONMENT=
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $REPLACE_STRUCT_LCONV = 1; then
+ REPLACE_LOCALECONV=1
+ fi
+
+
+ if test $REPLACE_LOCALECONV = 1; then
+ GL_COND_OBJ_LOCALECONV_TRUE=
+ GL_COND_OBJ_LOCALECONV_FALSE='#'
+else
+ GL_COND_OBJ_LOCALECONV_TRUE='#'
+ GL_COND_OBJ_LOCALECONV_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_LOCALECONV_TRUE}" && test -z "${GL_COND_OBJ_LOCALECONV_FALSE}"; then
+ GL_COND_OBJ_LOCALECONV_TRUE='#'
+ GL_COND_OBJ_LOCALECONV_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_LOCALECONV_TRUE"; then :
+
+
+ ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
+"
+if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
+_ACEOF
+
+
+fi
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_LOCALECONV=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h
+
+
+
+
+
+ if test "$gl_threads_api" = posix; then
+ # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
+ # pthread_rwlock_* functions.
+ has_rwlock=false
+ ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
+"
+if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
+ has_rwlock=true
+
+$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
+
+fi
+
+ if $has_rwlock; then
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
+$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
+if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on musl systems.
+ *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on bionic systems.
+ *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess yes on native Windows with the mingw-w64 winpthreads library.
+ # Guess no on native Windows with the gnulib windows-rwlock module.
+ mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
+ else
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
+ fi
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define SUCCEED() exit (0)
+#define FAILURE() exit (1)
+#define UNEXPECTED(n) (exit (10 + (n)))
+
+/* The main thread creates the waiting writer and the requesting reader threads
+ in the default way; this guarantees that they have the same priority.
+ We can reuse the main thread as first reader thread. */
+
+static pthread_rwlock_t lock;
+static pthread_t reader1;
+static pthread_t writer;
+static pthread_t reader2;
+static pthread_t timer;
+/* Used to pass control from writer to reader2 and from reader2 to timer,
+ as in a relay race.
+ Passing control from one running thread to another running thread
+ is most likely faster than to create the second thread. */
+static pthread_mutex_t baton;
+
+static void *
+timer_func (void *ignored)
+{
+ /* Step 13 (can be before or after step 12):
+ The timer thread takes the baton, then waits a moment to make sure
+ it can tell whether the second reader thread is blocked at step 12. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (13);
+ usleep (100000);
+ /* By the time we get here, it's clear that the second reader thread is
+ blocked at step 12. This is the desired behaviour. */
+ SUCCEED ();
+}
+
+static void *
+reader2_func (void *ignored)
+{
+ int err;
+
+ /* Step 8 (can be before or after step 7):
+ The second reader thread takes the baton, then waits a moment to make sure
+ the writer thread has reached step 7. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (8);
+ usleep (100000);
+ /* Step 9: The second reader thread requests the lock. */
+ err = pthread_rwlock_tryrdlock (&lock);
+ if (err == 0)
+ FAILURE ();
+ else if (err != EBUSY)
+ UNEXPECTED (9);
+ /* Step 10: Launch a timer, to test whether the next call blocks. */
+ if (pthread_create (&timer, NULL, timer_func, NULL))
+ UNEXPECTED (10);
+ /* Step 11: Release the baton. */
+ if (pthread_mutex_unlock (&baton))
+ UNEXPECTED (11);
+ /* Step 12: The second reader thread requests the lock. */
+ err = pthread_rwlock_rdlock (&lock);
+ if (err == 0)
+ FAILURE ();
+ else
+ UNEXPECTED (12);
+}
+
+static void *
+writer_func (void *ignored)
+{
+ /* Step 4: Take the baton, so that the second reader thread does not go ahead
+ too early. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (4);
+ /* Step 5: Create the second reader thread. */
+ if (pthread_create (&reader2, NULL, reader2_func, NULL))
+ UNEXPECTED (5);
+ /* Step 6: Release the baton. */
+ if (pthread_mutex_unlock (&baton))
+ UNEXPECTED (6);
+ /* Step 7: The writer thread requests the lock. */
+ if (pthread_rwlock_wrlock (&lock))
+ UNEXPECTED (7);
+ return NULL;
+}
+
+int
+main ()
+{
+ reader1 = pthread_self ();
+
+ /* Step 1: The main thread initializes the lock and the baton. */
+ if (pthread_rwlock_init (&lock, NULL))
+ UNEXPECTED (1);
+ if (pthread_mutex_init (&baton, NULL))
+ UNEXPECTED (1);
+ /* Step 2: The main thread acquires the lock as a reader. */
+ if (pthread_rwlock_rdlock (&lock))
+ UNEXPECTED (2);
+ /* Step 3: Create the writer thread. */
+ if (pthread_create (&writer, NULL, writer_func, NULL))
+ UNEXPECTED (3);
+ /* Job done. Go to sleep. */
+ for (;;)
+ {
+ sleep (1);
+ }
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
+else
+ gl_cv_pthread_rwlock_rdlock_prefer_writer=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ LIBS="$save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
+$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
+ case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
+ *yes)
+
+$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
+
+ ;;
+ esac
+
+ fi
+ # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+int
+main ()
+{
+
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ :
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_LOCK 1
+_ACEOF
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5
+$as_echo_n "checking whether lseek detects pipes... " >&6; }
+if ${gl_cv_func_lseek_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ mingw*)
+ gl_cv_func_lseek_pipe=no
+ ;;
+ *)
+ if test $cross_compiling = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h> /* for off_t */
+#include <stdio.h> /* for SEEK_CUR */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+
+
+$gl_mda_defines
+
+int
+main ()
+{
+
+ /* Exit with success only if stdin is seekable. */
+ return lseek (0, (off_t)0, SEEK_CUR) < 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if test -s conftest$ac_exeext \
+ && ./conftest$ac_exeext < conftest.$ac_ext \
+ && test 1 = "`echo hi \
+ | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+ gl_cv_func_lseek_pipe=yes
+ else
+ gl_cv_func_lseek_pipe=no
+ fi
+
+else
+ gl_cv_func_lseek_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined __BEOS__
+/* BeOS mistakenly return 0 when trying to seek on pipes. */
+ Choke me.
+#endif
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_func_lseek_pipe=yes
+else
+ gl_cv_func_lseek_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5
+$as_echo "$gl_cv_func_lseek_pipe" >&6; }
+ if test "$gl_cv_func_lseek_pipe" = no; then
+ REPLACE_LSEEK=1
+
+$as_echo "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h
+
+ fi
+
+
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_LSEEK=1
+ fi
+
+ case $host_os in
+ darwin*)
+ REPLACE_LSEEK=1;;
+ esac
+
+
+ if test $REPLACE_LSEEK = 1; then
+ GL_COND_OBJ_LSEEK_TRUE=
+ GL_COND_OBJ_LSEEK_FALSE='#'
+else
+ GL_COND_OBJ_LSEEK_TRUE='#'
+ GL_COND_OBJ_LSEEK_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_LSEEK_TRUE}" && test -z "${GL_COND_OBJ_LSEEK_FALSE}"; then
+ GL_COND_OBJ_LSEEK_TRUE='#'
+ GL_COND_OBJ_LSEEK_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_LSEEK=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_LSEEK 1" >>confdefs.h
+
+
+
+
+
+
+ REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX"
+ if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc (0) returns nonnull" >&5
+$as_echo_n "checking whether malloc (0) returns nonnull... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+ | gnu* | *-musl* | midnightbsd* \
+ | hpux* | solaris* | cygwin* | mingw* | msys* )
+ ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+int
+main ()
+{
+void *p = malloc (0);
+ int result = !p;
+ free (p);
+ return result;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_malloc_0_nonnull=yes
+else
+ ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+ case $ac_cv_func_malloc_0_nonnull in #(
+ *yes) :
+ ;; #(
+ *) :
+ REPLACE_MALLOC_FOR_MALLOC_GNU=1 ;;
+esac
+
+ fi
+
+ if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
+
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_MALLOC_GNU=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MALLOC_GNU 1" >>confdefs.h
+
+
+
+
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
+
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_MALLOC_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if case "$host_os" in
+ mingw*) true ;;
+ *) test $ac_cv_func_mbsinit = yes ;;
+ esac \
+ && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
+if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on AIX and OSF/1.
+ aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+ esac
+ if test $LOCALE_JA != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ else
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris 8.
+ solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+ esac
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8:
+ mbrtowc returns 2, and sets wc to 0x00F0.
+ mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 6, &state) != 4
+ && mbtowc (&wc, input + 3, 6) == 4)
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_sanitycheck=yes
+else
+ gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+ REPLACE_MBSTATE_T=0
+ case "$gl_cv_func_mbrtowc_incomplete_state" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ case "$gl_cv_func_mbrtowc_sanitycheck" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ else
+ REPLACE_MBSTATE_T=1
+ fi
+
+
+
+ if test $ac_cv_func_mbrtowc = no; then
+ HAVE_MBRTOWC=0
+ ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
+ #include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBRTOWC $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_mbrtowc = yes; then
+ REPLACE_MBRTOWC=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBRTOWC=1
+ else
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
+$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
+if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
+ esac
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ char input[] = "\303\237er";
+ mbstate_t state;
+ wchar_t wc;
+ size_t ret;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 5, &state);
+ if (ret != 2)
+ result |= 1;
+ if (!mbsinit (&state))
+ result |= 2;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ ret = mbrtowc (NULL, input, 5, &state);
+ if (ret != 2) /* Solaris 7 fails here: ret is -1. */
+ result |= 4;
+ if (!mbsinit (&state))
+ result |= 8;
+ }
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_null_arg1=yes
+else
+ gl_cv_func_mbrtowc_null_arg1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
+$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
+$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
+if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on OSF/1.
+ osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
+ esac
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ mbstate_t state;
+ wchar_t wc;
+ int ret;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ mbrtowc (&wc, NULL, 5, &state);
+ /* Check that wc was not modified. */
+ if (wc != (wchar_t) 0xBADFACE)
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_null_arg2=yes
+else
+ gl_cv_func_mbrtowc_null_arg2=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
+$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
+$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
+if ${gl_cv_func_mbrtowc_retval+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on HP-UX, Solaris, native Windows.
+ hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
+ esac
+ if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
+ || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ int found_some_locale = 0;
+ /* This fails on Solaris. */
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ {
+ input[1] = '\0';
+ if (mbrtowc (&wc, input + 2, 5, &state) != 1)
+ result |= 1;
+ }
+ found_some_locale = 1;
+ }
+ /* This fails on HP-UX 11.11. */
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ {
+ input[1] = '\0';
+ if (mbrtowc (&wc, input + 2, 5, &state) != 2)
+ result |= 2;
+ }
+ found_some_locale = 1;
+ }
+ /* This fails on native Windows. */
+ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+ {
+ char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 4;
+ }
+ found_some_locale = 1;
+ }
+ if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+ {
+ char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 8;
+ }
+ found_some_locale = 1;
+ }
+ if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+ {
+ char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 16;
+ }
+ found_some_locale = 1;
+ }
+ return (found_some_locale ? result : 77);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_retval=yes
+else
+ if test $? != 77; then
+ gl_cv_func_mbrtowc_retval=no
+ fi
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
+$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
+$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
+if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris 8 and 9.
+ solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
+ esac
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8 and 9. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "", 1, &state) != 0)
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_nul_retval=yes
+else
+ gl_cv_func_mbrtowc_nul_retval=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
+$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5
+$as_echo_n "checking whether mbrtowc stores incomplete characters... " >&6; }
+if ${gl_cv_func_mbrtowc_stores_incomplete+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
+ esac
+ case "$host_os" in
+ mingw*)
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "French_France.65001") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 1;
+ }
+ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 2;
+ }
+ if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 4;
+ }
+ if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 8;
+ }
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_stores_incomplete=no
+else
+ gl_cv_func_mbrtowc_stores_incomplete=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ ;;
+ *)
+
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ return 1;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_stores_incomplete=no
+else
+ gl_cv_func_mbrtowc_stores_incomplete=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5
+$as_echo "$gl_cv_func_mbrtowc_stores_incomplete" >&6; }
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
+$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
+if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on AIX and glibc systems.
+ aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ esac
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <wchar.h>
+ static wchar_t wc;
+ static mbstate_t mbs;
+ int
+ main (void)
+ {
+ return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
+ }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_empty_input=yes
+else
+ gl_cv_func_mbrtowc_empty_input=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
+$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
+$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
+if ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
+
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+ #include <locale.h>
+ #include <wchar.h>
+
+int
+main ()
+{
+
+ int i;
+ char *locale = setlocale (LC_ALL, "C");
+ if (! locale)
+ return 2;
+ for (i = CHAR_MIN; i <= CHAR_MAX; i++)
+ {
+ char c = i;
+ wchar_t wc;
+ mbstate_t mbs = { 0, };
+ size_t ss = mbrtowc (&wc, &c, 1, &mbs);
+ if (1 < ss)
+ return 3;
+ }
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes
+else
+ gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5
+$as_echo "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; }
+
+ case "$gl_cv_func_mbrtowc_null_arg1" in
+ *yes) ;;
+ *)
+$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_null_arg2" in
+ *yes) ;;
+ *)
+$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_retval" in
+ *yes) ;;
+ *)
+$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_nul_retval" in
+ *yes) ;;
+ *)
+$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_stores_incomplete" in
+ *no) ;;
+ *)
+$as_echo "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_empty_input" in
+ *yes) ;;
+ *)
+$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *)
+$as_echo "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
+
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ fi
+ fi
+ if test $REPLACE_MBSTATE_T = 1; then
+ case "$host_os" in
+ mingw*) LIB_MBRTOWC= ;;
+ *)
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
+if ${gl_cv_have_weak+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ cygwin*)
+ gl_cv_have_weak="guessing no"
+ ;;
+ *)
+ gl_cv_have_weak=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main ()
+{
+xyzzy();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test $gl_cv_have_weak = maybe; then
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+ gl_cv_have_weak="guessing yes"
+else
+ gl_cv_have_weak="guessing no"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_have_weak=yes
+else
+ gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ ;;
+ esac
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+$as_echo "$gl_cv_have_weak" >&6; }
+ case "$gl_cv_have_weak" in
+ *yes)
+
+$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+ ;;
+ esac
+
+ case "$gl_cv_have_weak" in
+ *yes) LIB_MBRTOWC= ;;
+ *) LIB_MBRTOWC="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_MBRTOWC=
+ fi
+
+
+
+ if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+ GL_COND_OBJ_MBRTOWC_TRUE=
+ GL_COND_OBJ_MBRTOWC_FALSE='#'
+else
+ GL_COND_OBJ_MBRTOWC_TRUE='#'
+ GL_COND_OBJ_MBRTOWC_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_MBRTOWC_TRUE}" && test -z "${GL_COND_OBJ_MBRTOWC_FALSE}"; then
+ GL_COND_OBJ_MBRTOWC_TRUE='#'
+ GL_COND_OBJ_MBRTOWC_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_MBRTOWC_TRUE"; then :
+
+ if test $REPLACE_MBSTATE_T = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS lc-charset-dispatch.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mbtowc-lock.$ac_objext"
+
+
+
+
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
+$as_echo_n "checking whether the -Werror option is usable... " >&6; }
+if ${gl_cv_cc_vis_werror+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_cc_vis_werror=yes
+else
+ gl_cv_cc_vis_werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
+$as_echo "$gl_cv_cc_vis_werror" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
+$as_echo_n "checking for simple visibility declarations... " >&6; }
+if ${gl_cv_cc_visibility+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void);
+ int hiddenvar;
+ int exportedvar;
+ int hiddenfunc (void) { return 51; }
+ int exportedfunc (void) { return 1225736919; }
+ void dummyfunc (void) {}
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_cc_visibility=yes
+else
+ gl_cv_cc_visibility=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
+$as_echo "$gl_cv_cc_visibility" >&6; }
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VISIBILITY $HAVE_VISIBILITY
+_ACEOF
+
+
+
+ fi
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_MBRTOWC=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if case "$host_os" in
+ mingw*) true ;;
+ *) test $ac_cv_func_mbsinit = yes ;;
+ esac \
+ && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
+if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on AIX and OSF/1.
+ aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+ esac
+ if test $LOCALE_JA != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ else
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris 8.
+ solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+ esac
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8:
+ mbrtowc returns 2, and sets wc to 0x00F0.
+ mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 6, &state) != 4
+ && mbtowc (&wc, input + 3, 6) == 4)
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_sanitycheck=yes
+else
+ gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+ REPLACE_MBSTATE_T=0
+ case "$gl_cv_func_mbrtowc_incomplete_state" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ case "$gl_cv_func_mbrtowc_sanitycheck" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ else
+ REPLACE_MBSTATE_T=1
+ fi
+
+
+
+ if test $ac_cv_func_mbsinit = no; then
+ HAVE_MBSINIT=0
+ ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
+ #include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBSINIT $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_mbsinit = yes; then
+ REPLACE_MBSINIT=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBSINIT=1
+ else
+ case "$host_os" in
+ mingw*) REPLACE_MBSINIT=1 ;;
+ esac
+ fi
+ fi
+
+
+ if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+ GL_COND_OBJ_MBSINIT_TRUE=
+ GL_COND_OBJ_MBSINIT_FALSE='#'
+else
+ GL_COND_OBJ_MBSINIT_TRUE='#'
+ GL_COND_OBJ_MBSINIT_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_MBSINIT_TRUE}" && test -z "${GL_COND_OBJ_MBSINIT_FALSE}"; then
+ GL_COND_OBJ_MBSINIT_TRUE='#'
+ GL_COND_OBJ_MBSINIT_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_MBSINIT_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_MBSINIT=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
+
+
+
+
+
+
+ for ac_func in mbtowc
+do :
+ ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc"
+if test "x$ac_cv_func_mbtowc" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MBTOWC 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_mbtowc = no; then
+ HAVE_MBTOWC=0
+ else
+ if false; then
+ REPLACE_MBTOWC=1
+ fi
+ fi
+
+
+ if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
+ GL_COND_OBJ_MBTOWC_TRUE=
+ GL_COND_OBJ_MBTOWC_FALSE='#'
+else
+ GL_COND_OBJ_MBTOWC_TRUE='#'
+ GL_COND_OBJ_MBTOWC_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_MBTOWC_TRUE}" && test -z "${GL_COND_OBJ_MBTOWC_FALSE}"; then
+ GL_COND_OBJ_MBTOWC_TRUE='#'
+ GL_COND_OBJ_MBTOWC_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_MBTOWC_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_MBTOWC=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
+
+
+
+
+
+ if test $REPLACE_MEMCHR = 1; then
+ GL_COND_OBJ_MEMCHR_TRUE=
+ GL_COND_OBJ_MEMCHR_FALSE='#'
+else
+ GL_COND_OBJ_MEMCHR_TRUE='#'
+ GL_COND_OBJ_MEMCHR_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_MEMCHR_TRUE}" && test -z "${GL_COND_OBJ_MEMCHR_FALSE}"; then
+ GL_COND_OBJ_MEMCHR_TRUE='#'
+ GL_COND_OBJ_MEMCHR_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_MEMCHR_TRUE"; then :
+
+
+ for ac_header in bp-sym.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
+if test "x$ac_cv_header_bp_sym_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_BP_SYM_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_MEMCHR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+ REPLACE_MKTIME=0
+ if test "$gl_cv_func_working_mktime" != yes; then
+ REPLACE_MKTIME=1
+
+$as_echo "#define NEED_MKTIME_WORKING 1" >>confdefs.h
+
+ fi
+ case "$host_os" in
+ mingw*)
+ REPLACE_MKTIME=1
+
+$as_echo "#define NEED_MKTIME_WINDOWS 1" >>confdefs.h
+
+ ;;
+ esac
+
+ if test $REPLACE_MKTIME = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
+
+ :
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_MKTIME=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MKTIME 1" >>confdefs.h
+
+
+
+
+
+
+ WANT_MKTIME_INTERNAL=0
+ ac_fn_c_check_func "$LINENO" "__mktime_internal" "ac_cv_func___mktime_internal"
+if test "x$ac_cv_func___mktime_internal" = xyes; then :
+
+$as_echo "#define mktime_internal __mktime_internal" >>confdefs.h
+
+
+else
+ WANT_MKTIME_INTERNAL=1
+
+$as_echo "#define NEED_MKTIME_INTERNAL 1" >>confdefs.h
+
+
+fi
+
+
+ if test $WANT_MKTIME_INTERNAL = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS mktime.$ac_objext"
+
+ :
+ fi
+
+
+ for ac_func in listmntent
+do :
+ ac_fn_c_check_func "$LINENO" "listmntent" "ac_cv_func_listmntent"
+if test "x$ac_cv_func_listmntent" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LISTMNTENT 1
+_ACEOF
+
+fi
+done
+
+
+
+ # We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses
+ # NGROUPS (as the array dimension for a struct member) without a definition.
+ for ac_header in sys/ucred.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/ucred.h" "ac_cv_header_sys_ucred_h" "#include <grp.h>
+"
+if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_UCRED_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ for ac_header in sys/mount.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default
+ #if HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+
+"
+if test "x$ac_cv_header_sys_mount_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_MOUNT_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ for ac_header in mntent.h sys/fs_types.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ getfsstat_includes="\
+$ac_includes_default
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
+#endif
+#if HAVE_SYS_UCRED_H
+# include <grp.h> /* needed for definition of NGROUPS */
+# include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
+#endif
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_FS_TYPES_H
+# include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
+#endif
+"
+ ac_fn_c_check_member "$LINENO" "struct fsstat" "f_fstypename" "ac_cv_member_struct_fsstat_f_fstypename" "$getfsstat_includes
+"
+if test "x$ac_cv_member_struct_fsstat_f_fstypename" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_FSSTAT_F_FSTYPENAME 1
+_ACEOF
+
+
+fi
+
+
+ # Determine how to get the list of mounted file systems.
+ ac_list_mounted_fs=
+
+ # If the getmntent function is available but not in the standard library,
+ # make sure LIBS contains the appropriate -l option.
+
+ # getmntent is in the standard C library on most systems, but in -lgen on
+ # Unixware.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5
+$as_echo_n "checking for library containing getmntent... " >&6; }
+if ${ac_cv_search_getmntent+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getmntent ();
+int
+main ()
+{
+return getmntent ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' gen; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getmntent=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getmntent+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getmntent+:} false; then :
+
+else
+ ac_cv_search_getmntent=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5
+$as_echo "$ac_cv_search_getmntent" >&6; }
+ac_res=$ac_cv_search_getmntent
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ for ac_func in getmntent
+do :
+ ac_fn_c_check_func "$LINENO" "getmntent" "ac_cv_func_getmntent"
+if test "x$ac_cv_func_getmntent" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETMNTENT 1
+_ACEOF
+
+fi
+done
+
+
+
+ if test -z "$ac_list_mounted_fs"; then
+ # AIX.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mntctl function and struct vmount" >&5
+$as_echo_n "checking for mntctl function and struct vmount... " >&6; }
+if ${fu_cv_sys_mounted_vmount+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fshelp.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ fu_cv_sys_mounted_vmount=yes
+else
+ fu_cv_sys_mounted_vmount=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_vmount" >&5
+$as_echo "$fu_cv_sys_mounted_vmount" >&6; }
+ if test $fu_cv_sys_mounted_vmount = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_VMOUNT 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test $ac_cv_func_getmntent = yes; then
+
+ # This system has the getmntent function.
+ # Determine whether it's the one-argument variant or the two-argument one.
+
+ if test -z "$ac_list_mounted_fs"; then
+ # glibc, HP-UX, IRIX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for one-argument getmntent function" >&5
+$as_echo_n "checking for one-argument getmntent function... " >&6; }
+if ${fu_cv_sys_mounted_getmntent1+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
+#include <stdio.h>
+
+#include <mntent.h>
+#if defined __ANDROID__ /* Android */
+# undef MOUNTED
+# define MOUNTED "/proc/mounts"
+#elif !defined MOUNTED
+# if defined _PATH_MOUNTED /* GNU libc */
+# define MOUNTED _PATH_MOUNTED
+# endif
+# if defined MNT_MNTTAB /* HP-UX. */
+# define MOUNTED MNT_MNTTAB
+# endif
+#endif
+
+int
+main ()
+{
+struct mntent *mnt = 0; char *table = MOUNTED;
+ if (sizeof mnt && sizeof table) return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ fu_cv_sys_mounted_getmntent1=yes
+else
+ fu_cv_sys_mounted_getmntent1=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent1" >&5
+$as_echo "$fu_cv_sys_mounted_getmntent1" >&6; }
+ if test $fu_cv_sys_mounted_getmntent1 = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_GETMNTENT1 1" >>confdefs.h
+
+ for ac_func in setmntent endmntent hasmntopt
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Solaris >= 8.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getextmntent function" >&5
+$as_echo_n "checking for getextmntent function... " >&6; }
+if ${fu_cv_sys_mounted_getextmntent+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/mnttab.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "getextmntent" >/dev/null 2>&1; then :
+ fu_cv_sys_mounted_getextmntent=yes
+else
+ fu_cv_sys_mounted_getextmntent=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getextmntent" >&5
+$as_echo "$fu_cv_sys_mounted_getextmntent" >&6; }
+ if test $fu_cv_sys_mounted_getextmntent = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_GETEXTMNTENT 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Solaris < 8, also (obsolete) SVR4.
+ # Solaris >= 8 has the two-argument getmntent but is already handled above.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for two-argument getmntent function" >&5
+$as_echo_n "checking for two-argument getmntent function... " >&6; }
+if ${fu_cv_sys_mounted_getmntent2+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/mnttab.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "getmntent" >/dev/null 2>&1; then :
+ fu_cv_sys_mounted_getmntent2=yes
+else
+ fu_cv_sys_mounted_getmntent2=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntent2" >&5
+$as_echo "$fu_cv_sys_mounted_getmntent2" >&6; }
+ if test $fu_cv_sys_mounted_getmntent2 = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_GETMNTENT2 1" >>confdefs.h
+
+ for ac_func in hasmntopt
+do :
+ ac_fn_c_check_func "$LINENO" "hasmntopt" "ac_cv_func_hasmntopt"
+if test "x$ac_cv_func_hasmntopt" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_HASMNTOPT 1
+_ACEOF
+
+fi
+done
+
+ fi
+ fi
+
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # OSF/1, also (obsolete) Apple Darwin 1.3.
+ # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getfsstat function" >&5
+$as_echo_n "checking for getfsstat function... " >&6; }
+if ${fu_cv_sys_mounted_getfsstat+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
+# define FS_TYPE(Ent) ((Ent).f_fstypename)
+#else
+# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
+#endif
+$getfsstat_includes
+
+int
+main ()
+{
+struct statfs *stats;
+ int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
+ char *t = FS_TYPE (*stats);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ fu_cv_sys_mounted_getfsstat=yes
+else
+ fu_cv_sys_mounted_getfsstat=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getfsstat" >&5
+$as_echo "$fu_cv_sys_mounted_getfsstat" >&6; }
+ if test $fu_cv_sys_mounted_getfsstat = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_GETFSSTAT 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # (obsolete) SVR3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIXME existence of three headers" >&5
+$as_echo_n "checking for FIXME existence of three headers... " >&6; }
+if ${fu_cv_sys_mounted_fread_fstyp+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/statfs.h>
+#include <sys/fstyp.h>
+#include <mnttab.h>
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ fu_cv_sys_mounted_fread_fstyp=yes
+else
+ fu_cv_sys_mounted_fread_fstyp=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fread_fstyp" >&5
+$as_echo "$fu_cv_sys_mounted_fread_fstyp" >&6; }
+ if test $fu_cv_sys_mounted_fread_fstyp = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_FREAD_FSTYP 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, also (obsolete) 4.4BSD.
+ # OSF/1 also has getmntinfo but is already handled above.
+ # We cannot use AC_CHECK_FUNCS([getmntinfo]) here, because at the linker
+ # level the function is sometimes called getmntinfo64 or getmntinfo$INODE64
+ # on Mac OS X, __getmntinfo13 on NetBSD and Minix, _F64_getmntinfo on OSF/1.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getmntinfo function" >&5
+$as_echo_n "checking for getmntinfo function... " >&6; }
+if ${fu_cv_sys_mounted_getmntinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+#include <stdlib.h>
+
+int
+main ()
+{
+int count = getmntinfo (NULL, MNT_WAIT);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ fu_cv_sys_mounted_getmntinfo=yes
+else
+ fu_cv_sys_mounted_getmntinfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntinfo" >&5
+$as_echo "$fu_cv_sys_mounted_getmntinfo" >&6; }
+ if test $fu_cv_sys_mounted_getmntinfo = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getmntinfo returns statvfs structures" >&5
+$as_echo_n "checking whether getmntinfo returns statvfs structures... " >&6; }
+if ${fu_cv_sys_mounted_getmntinfo2+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int getmntinfo (struct statfs **, int);
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ fu_cv_sys_mounted_getmntinfo2=no
+else
+ fu_cv_sys_mounted_getmntinfo2=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_getmntinfo2" >&5
+$as_echo "$fu_cv_sys_mounted_getmntinfo2" >&6; }
+ if test $fu_cv_sys_mounted_getmntinfo2 = no; then
+ # Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD.
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_GETMNTINFO 1" >>confdefs.h
+
+ else
+ # NetBSD, Minix.
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_GETMNTINFO2 1" >>confdefs.h
+
+ fi
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Haiku, also (obsolete) BeOS.
+ for ac_func in next_dev fs_stat_dev
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ for ac_header in fs_info.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "fs_info.h" "ac_cv_header_fs_info_h" "$ac_includes_default"
+if test "x$ac_cv_header_fs_info_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_FS_INFO_H 1
+_ACEOF
+
+fi
+
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BEOS mounted file system support functions" >&5
+$as_echo_n "checking for BEOS mounted file system support functions... " >&6; }
+if ${fu_cv_sys_mounted_fs_stat_dev+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test $ac_cv_header_fs_info_h = yes \
+ && test $ac_cv_func_next_dev = yes \
+ && test $ac_cv_func_fs_stat_dev = yes; then
+ fu_cv_sys_mounted_fs_stat_dev=yes
+ else
+ fu_cv_sys_mounted_fs_stat_dev=no
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fu_cv_sys_mounted_fs_stat_dev" >&5
+$as_echo "$fu_cv_sys_mounted_fs_stat_dev" >&6; }
+ if test $fu_cv_sys_mounted_fs_stat_dev = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_FS_STAT_DEV 1" >>confdefs.h
+
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Interix / BSD alike statvfs
+ # the code is really interix specific, so make sure, we're on it.
+ case "$host" in
+ *-interix*)
+ for ac_func in statvfs
+do :
+ ac_fn_c_check_func "$LINENO" "statvfs" "ac_cv_func_statvfs"
+if test "x$ac_cv_func_statvfs" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STATVFS 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_statvfs = yes; then
+ ac_list_mounted_fs=found
+
+$as_echo "#define MOUNTED_INTERIX_STATVFS 1" >>confdefs.h
+
+ fi
+ ;;
+ esac
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ as_fn_error $? "could not determine how to read list of mounted file systems" "$LINENO" 5
+ # FIXME -- no need to abort building the whole package
+ # Can't build mountlist.c or anything that needs its functions
+ fi
+
+ if test $ac_list_mounted_fs = found; then
+ gl_cv_list_mounted_fs=yes
+ else
+ gl_cv_list_mounted_fs=no
+ fi
+
+
+ if test $gl_cv_list_mounted_fs = yes; then
+ GL_COND_OBJ_MOUNTLIST_TRUE=
+ GL_COND_OBJ_MOUNTLIST_FALSE='#'
+else
+ GL_COND_OBJ_MOUNTLIST_TRUE='#'
+ GL_COND_OBJ_MOUNTLIST_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_MOUNTLIST_TRUE}" && test -z "${GL_COND_OBJ_MOUNTLIST_FALSE}"; then
+ GL_COND_OBJ_MOUNTLIST_TRUE='#'
+ GL_COND_OBJ_MOUNTLIST_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_MOUNTLIST_TRUE"; then :
+
+
+ for ac_header in sys/mntent.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/mntent.h" "ac_cv_header_sys_mntent_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_mntent_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_MNTENT_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
+
+$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
+
+fi
+
+
+if test $ac_cv_header_sys_mkdev_h = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
+
+$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
+
+fi
+
+
+fi
+
+ ac_fn_c_check_member "$LINENO" "struct statfs" "f_fstypename" "ac_cv_member_struct_statfs_f_fstypename" "
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/mount.h>
+
+"
+if test "x$ac_cv_member_struct_statfs_f_fstypename" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STATFS_F_FSTYPENAME 1
+_ACEOF
+
+
+fi
+
+
+
+
+fi
+
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ GL_COND_OBJ_MSVC_INVAL_TRUE=
+ GL_COND_OBJ_MSVC_INVAL_FALSE='#'
+else
+ GL_COND_OBJ_MSVC_INVAL_TRUE='#'
+ GL_COND_OBJ_MSVC_INVAL_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_MSVC_INVAL_TRUE}" && test -z "${GL_COND_OBJ_MSVC_INVAL_FALSE}"; then
+ GL_COND_OBJ_MSVC_INVAL_TRUE='#'
+ GL_COND_OBJ_MSVC_INVAL_FALSE='#'
+ fi
+
+
+
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ GL_COND_OBJ_MSVC_NOTHROW_TRUE=
+ GL_COND_OBJ_MSVC_NOTHROW_FALSE='#'
+else
+ GL_COND_OBJ_MSVC_NOTHROW_TRUE='#'
+ GL_COND_OBJ_MSVC_NOTHROW_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_MSVC_NOTHROW_TRUE}" && test -z "${GL_COND_OBJ_MSVC_NOTHROW_FALSE}"; then
+ GL_COND_OBJ_MSVC_NOTHROW_TRUE='#'
+ GL_COND_OBJ_MSVC_NOTHROW_FALSE='#'
+ fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_MSVC_NOTHROW 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
+$as_echo_n "checking whether <netinet/in.h> is self-contained... " >&6; }
+if ${gl_cv_header_netinet_in_h_selfcontained+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netinet/in.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_netinet_in_h_selfcontained=yes
+else
+ gl_cv_header_netinet_in_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
+$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
+ if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
+ GL_GENERATE_NETINET_IN_H=false
+ else
+ GL_GENERATE_NETINET_IN_H=true
+ for ac_header in netinet/in.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_in_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NETINET_IN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+ if test $gl_cv_have_include_next = yes; then
+ gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
+$as_echo_n "checking absolute name of <netinet/in.h>... " >&6; }
+if ${gl_cv_next_netinet_in_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test $ac_cv_header_netinet_in_h = yes; then
+
+
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netinet/in.h>
+_ACEOF
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+
+ case "$host_os" in
+ mingw*)
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo 'netinet/in.h' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+
+ gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+ sed -n "$gl_absolute_header_sed"`
+
+ gl_header=$gl_cv_absolute_netinet_in_h
+ gl_cv_next_netinet_in_h='"'$gl_header'"'
+ else
+ gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+ fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
+$as_echo "$gl_cv_next_netinet_in_h" >&6; }
+ fi
+ NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h
+
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'netinet/in.h'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=$gl_cv_next_netinet_in_h
+ fi
+ NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
+
+
+
+
+ if test $ac_cv_header_netinet_in_h = yes; then
+ HAVE_NETINET_IN_H=1
+ else
+ HAVE_NETINET_IN_H=0
+ fi
+
+ fi
+
+
+
+
+
+ case "$GL_GENERATE_NETINET_IN_H" in
+ false) NETINET_IN_H='' ;;
+ true)
+ if test -z "$NETINET_IN_H"; then
+ NETINET_IN_H="${gl_source_base_prefix}netinet/in.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_NETINET_IN_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_NETINET_IN_H; then
+ GL_GENERATE_NETINET_IN_H_TRUE=
+ GL_GENERATE_NETINET_IN_H_FALSE='#'
+else
+ GL_GENERATE_NETINET_IN_H_TRUE='#'
+ GL_GENERATE_NETINET_IN_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
+ GL_GENERATE_NETINET_IN_H_TRUE='#'
+ GL_GENERATE_NETINET_IN_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_func_nl_langinfo = yes; then
+ # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5
+$as_echo_n "checking whether YESEXPR works... " >&6; }
+if ${gl_cv_func_nl_langinfo_yesexpr_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+
+ case "$host_os" in
+ # Guess no on irix systems.
+ irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
+ # Guess yes elsewhere.
+ *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+
+int
+main ()
+{
+return !*nl_langinfo(YESEXPR);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_nl_langinfo_yesexpr_works=yes
+else
+ gl_cv_func_nl_langinfo_yesexpr_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5
+$as_echo "$gl_cv_func_nl_langinfo_yesexpr_works" >&6; }
+ case $gl_cv_func_nl_langinfo_yesexpr_works in
+ *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
+ *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS
+_ACEOF
+
+ # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
+ case "$host_os" in
+ solaris*) NL_LANGINFO_MTSAFE=0 ;;
+ *) NL_LANGINFO_MTSAFE=1 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define NL_LANGINFO_MTSAFE $NL_LANGINFO_MTSAFE
+_ACEOF
+
+ if test $HAVE_LANGINFO_CODESET = 1 \
+ && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
+ && test $HAVE_LANGINFO_ALTMON = 1 \
+ && test $HAVE_LANGINFO_ERA = 1 \
+ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
+ && test $NL_LANGINFO_MTSAFE = 1; then
+ :
+ else
+ REPLACE_NL_LANGINFO=1
+
+$as_echo "#define REPLACE_NL_LANGINFO 1" >>confdefs.h
+
+ fi
+ else
+ HAVE_NL_LANGINFO=0
+ fi
+ if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
+ LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
+ else
+ LIB_NL_LANGINFO=
+ fi
+
+
+
+ if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
+ GL_COND_OBJ_NL_LANGINFO_TRUE=
+ GL_COND_OBJ_NL_LANGINFO_FALSE='#'
+else
+ GL_COND_OBJ_NL_LANGINFO_TRUE='#'
+ GL_COND_OBJ_NL_LANGINFO_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_NL_LANGINFO_TRUE}" && test -z "${GL_COND_OBJ_NL_LANGINFO_FALSE}"; then
+ GL_COND_OBJ_NL_LANGINFO_TRUE='#'
+ GL_COND_OBJ_NL_LANGINFO_FALSE='#'
+ fi
+
+
+ if test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0; then
+ GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE=
+ GL_COND_OBJ_NL_LANGINFO_LOCK_FALSE='#'
+else
+ GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE='#'
+ GL_COND_OBJ_NL_LANGINFO_LOCK_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE}" && test -z "${GL_COND_OBJ_NL_LANGINFO_LOCK_FALSE}"; then
+ GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE='#'
+ GL_COND_OBJ_NL_LANGINFO_LOCK_FALSE='#'
+ fi
+
+ if test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0; then
+
+
+
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
+$as_echo_n "checking whether the -Werror option is usable... " >&6; }
+if ${gl_cv_cc_vis_werror+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_cc_vis_werror=yes
+else
+ gl_cv_cc_vis_werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
+$as_echo "$gl_cv_cc_vis_werror" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
+$as_echo_n "checking for simple visibility declarations... " >&6; }
+if ${gl_cv_cc_visibility+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void);
+ int hiddenvar;
+ int exportedvar;
+ int hiddenfunc (void) { return 51; }
+ int exportedfunc (void) { return 1225736919; }
+ void dummyfunc (void) {}
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_cc_visibility=yes
+else
+ gl_cv_cc_visibility=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
+$as_echo "$gl_cv_cc_visibility" >&6; }
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VISIBILITY $HAVE_VISIBILITY
+_ACEOF
+
+
+
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_NL_LANGINFO=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
+
+
+
+
+
+
+ case "$host_os" in
+ mingw* | pw*)
+ REPLACE_OPEN=1
+ ;;
+ *)
+
+ if test "$gl_cv_macro_O_CLOEXEC" != yes; then
+ REPLACE_OPEN=1
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
+$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
+if ${gl_cv_func_open_slash+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ touch conftest.tmp
+ ln -s conftest.tmp conftest.lnk
+ fi
+ if test "$cross_compiling" = yes; then :
+
+ case "$host_os" in
+ freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+ gl_cv_func_open_slash="guessing no" ;;
+ *)
+ gl_cv_func_open_slash="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+
+$gl_mda_defines
+
+int main ()
+{
+ int result = 0;
+#if HAVE_LSTAT
+ if (open ("conftest.lnk/", O_RDONLY) != -1)
+ result |= 1;
+#endif
+ if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+ result |= 2;
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_open_slash=yes
+else
+ gl_cv_func_open_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.sl conftest.tmp conftest.lnk
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
+$as_echo "$gl_cv_func_open_slash" >&6; }
+ case "$gl_cv_func_open_slash" in
+ *no)
+
+$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
+
+ ;;
+ esac
+
+ case "$gl_cv_func_open_slash" in
+ *no)
+ REPLACE_OPEN=1
+ ;;
+ esac
+ ;;
+ esac
+
+
+
+
+ if test $REPLACE_OPEN = 1; then
+ GL_COND_OBJ_OPEN_TRUE=
+ GL_COND_OBJ_OPEN_FALSE='#'
+else
+ GL_COND_OBJ_OPEN_TRUE='#'
+ GL_COND_OBJ_OPEN_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_OPEN_TRUE}" && test -z "${GL_COND_OBJ_OPEN_FALSE}"; then
+ GL_COND_OBJ_OPEN_TRUE='#'
+ GL_COND_OBJ_OPEN_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_OPEN_TRUE"; then :
+
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_OPEN=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+ if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realloc (0, 0) returns nonnull" >&5
+$as_echo_n "checking whether realloc (0, 0) returns nonnull... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+ | gnu* | *-musl* | midnightbsd* \
+ | hpux* | solaris* | cygwin* | mingw* | msys* )
+ ac_cv_func_realloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+int
+main ()
+{
+void *p = realloc (0, 0);
+ int result = !p;
+ free (p);
+ return result;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_realloc_0_nonnull=yes
+else
+ ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+ case $ac_cv_func_realloc_0_nonnull in #(
+ *yes) :
+ ;; #(
+ *) :
+ REPLACE_REALLOC_FOR_REALLOC_GNU=1 ;;
+esac
+
+ fi
+
+ if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
+
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_REALLOC_GNU=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_REALLOC_GNU 1" >>confdefs.h
+
+
+
+
+
+
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_REALLOC_FOR_REALLOC_POSIX=1
+ fi
+
+ if test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
+
+ fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_REALLOC_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ for ac_func in reallocarray
+do :
+ ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray"
+if test "x$ac_cv_func_reallocarray" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_REALLOCARRAY 1
+_ACEOF
+
+fi
+done
+
+ if test "$ac_cv_func_reallocarray" = no; then
+ HAVE_REALLOCARRAY=0
+ elif test "$gl_cv_malloc_ptrdiff" = no; then
+ REPLACE_REALLOCARRAY=1
+ fi
+
+
+ if test $HAVE_REALLOCARRAY = 0 || test $REPLACE_REALLOCARRAY = 1; then
+ GL_COND_OBJ_REALLOCARRAY_TRUE=
+ GL_COND_OBJ_REALLOCARRAY_FALSE='#'
+else
+ GL_COND_OBJ_REALLOCARRAY_TRUE='#'
+ GL_COND_OBJ_REALLOCARRAY_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_REALLOCARRAY_TRUE}" && test -z "${GL_COND_OBJ_REALLOCARRAY_FALSE}"; then
+ GL_COND_OBJ_REALLOCARRAY_TRUE='#'
+ GL_COND_OBJ_REALLOCARRAY_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_REALLOCARRAY_TRUE"; then :
+
+ :
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_REALLOCARRAY 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_REALLOCARRAY=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_REALLOCARRAY 1" >>confdefs.h
+
+
+
+
+
+# Check whether --with-included-regex was given.
+if test "${with_included_regex+set}" = set; then :
+ withval=$with_included_regex;
+fi
+
+
+ case $with_included_regex in #(
+ yes|no) ac_use_included_regex=$with_included_regex
+ ;;
+ '')
+ # If the system regex support is good enough that it passes the
+ # following run test, then default to *not* using the included regex.c.
+ # If cross compiling, assume the test would fail and use the included
+ # regex.c.
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5
+$as_echo_n "checking for working re_compile_pattern... " >&6; }
+if ${gl_cv_func_re_compile_pattern_working+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <regex.h>
+
+ #include <locale.h>
+ #include <limits.h>
+ #include <string.h>
+
+ #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
+ # include <signal.h>
+ # include <unistd.h>
+ #endif
+
+ #if HAVE_MALLOC_H
+ # include <malloc.h>
+ #endif
+
+ #ifdef M_CHECK_ACTION
+ /* Exit with distinguishable exit code. */
+ static void sigabrt_no_core (int sig) { raise (SIGTERM); }
+ #endif
+
+int
+main ()
+{
+int result = 0;
+ static struct re_pattern_buffer regex;
+ unsigned char folded_chars[UCHAR_MAX + 1];
+ int i;
+ const char *s;
+ struct re_registers regs;
+
+ /* Some builds of glibc go into an infinite loop on this
+ test. Use alarm to force death, and mallopt to avoid
+ malloc recursion in diagnosing the corrupted heap. */
+#if HAVE_DECL_ALARM
+ signal (SIGALRM, SIG_DFL);
+ alarm (2);
+#endif
+#ifdef M_CHECK_ACTION
+ signal (SIGABRT, sigabrt_no_core);
+ mallopt (M_CHECK_ACTION, 2);
+#endif
+
+ if (setlocale (LC_ALL, "en_US.UTF-8"))
+ {
+ {
+ /* https://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+ This test needs valgrind to catch the bug on Debian
+ GNU/Linux 3.1 x86, but it might catch the bug better
+ on other platforms and it shouldn't hurt to try the
+ test here. */
+ static char const pat[] = "insert into";
+ static char const data[] =
+ "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
+ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
+ | RE_ICASE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else
+ {
+ if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ regfree (&regex);
+ }
+ }
+
+ {
+ /* This test is from glibc bug 15078.
+ The test case is from Andreas Schwab in
+ <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+ */
+ static char const pat[] = "[^x]x";
+ static char const data[] =
+ /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
+ "\xe1\x80\x80"
+ "\xe1\x80\xbb"
+ "\xe1\x80\xbd"
+ "\xe1\x80\x94"
+ "\xe1\x80\xba"
+ "\xe1\x80\xaf"
+ "\xe1\x80\x95"
+ "\xe1\x80\xba"
+ "x";
+ re_set_syntax (0);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else
+ {
+ i = re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, 0);
+ if (i != 0 && i != 21)
+ result |= 1;
+ regfree (&regex);
+ }
+ }
+
+ if (! setlocale (LC_ALL, "C"))
+ return 1;
+ }
+
+ /* This test is from glibc bug 3957, reported by Andrew Mackey. */
+ re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("a[^x]b", 6, &regex);
+ if (s)
+ result |= 2;
+ else
+ {
+ /* This should fail, but succeeds for glibc-2.5. */
+ if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+ regfree (&regex);
+ }
+
+ /* This regular expression is from Spencer ere test number 75
+ in grep-2.3. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ for (i = 0; i <= UCHAR_MAX; i++)
+ folded_chars[i] = i;
+ regex.translate = folded_chars;
+ s = re_compile_pattern ("a[[:]:]]b\n", 11, &regex);
+ /* This should fail with _Invalid character class name_ error. */
+ if (!s)
+ {
+ result |= 4;
+ regfree (&regex);
+ }
+
+ /* Ensure that [b-a] is diagnosed as invalid, when
+ using RE_NO_EMPTY_RANGES. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("a[b-a]", 6, &regex);
+ if (s == 0)
+ {
+ result |= 8;
+ regfree (&regex);
+ }
+
+ /* This should succeed, but does not for glibc-2.1.3. */
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("{1", 2, &regex);
+ if (s)
+ result |= 8;
+ else
+ regfree (&regex);
+
+ /* The following example is derived from a problem report
+ against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("[an\371]*n", 7, &regex);
+ if (s)
+ result |= 8;
+ else
+ {
+ /* This should match, but does not for glibc-2.2.1. */
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 8;
+ else
+ {
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ /* The version of regex.c in older versions of gnulib
+ ignored RE_ICASE. Detect that problem too. */
+ re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 16;
+ else
+ {
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ result |= 16;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ /* Catch a bug reported by Vin Shelton in
+ https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
+ */
+ re_set_syntax (RE_SYNTAX_POSIX_BASIC
+ & ~RE_CONTEXT_INVALID_DUP
+ & ~RE_NO_EMPTY_RANGES);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("[[:alnum:]_-]\\\\+\$", 16, &regex);
+ if (s)
+ result |= 32;
+ else
+ regfree (&regex);
+
+ /* REG_STARTEND was added to glibc on 2004-01-15.
+ Reject older versions. */
+ if (! REG_STARTEND)
+ result |= 64;
+
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\\\1|0", 10, &regex);
+ if (!s)
+ {
+ memset (&regs, 0, sizeof regs);
+ i = re_search (&regex, "x", 1, 0, 1, &regs);
+ if (i != -1)
+ result |= 64;
+ if (0 <= i)
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+ else
+ {
+ if (strcmp (s, "Invalid back reference"))
+ result |= 64;
+ }
+
+ /* glibc bug 11053. */
+ re_set_syntax (RE_SYNTAX_POSIX_BASIC);
+ memset (&regex, 0, sizeof regex);
+ static char const pat_sub2[] = "\\\\(a*\\\\)*a*\\\\1";
+ s = re_compile_pattern (pat_sub2, sizeof pat_sub2 - 1, &regex);
+ if (s)
+ result |= 64;
+ else
+ {
+ memset (&regs, 0, sizeof regs);
+ static char const data[] = "a";
+ int datalen = sizeof data - 1;
+ i = re_search (&regex, data, datalen, 0, datalen, &regs);
+ if (i != 0)
+ result |= 64;
+ else if (regs.num_regs < 2)
+ result |= 64;
+ else if (! (regs.start[0] == 0 && regs.end[0] == 1))
+ result |= 64;
+ else if (! (regs.start[1] == 0 && regs.end[1] == 0))
+ result |= 64;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+
+#if 0
+ /* It would be nice to reject hosts whose regoff_t values are too
+ narrow (including glibc on hosts with 64-bit ptrdiff_t and
+ 32-bit int), but we should wait until glibc implements this
+ feature. Otherwise, support for equivalence classes and
+ multibyte collation symbols would always be broken except
+ when compiling --without-included-regex. */
+ if (sizeof (regoff_t) < sizeof (ptrdiff_t)
+ || sizeof (regoff_t) < sizeof (ssize_t))
+ result |= 64;
+#endif
+
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_re_compile_pattern_working=yes
+else
+ gl_cv_func_re_compile_pattern_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5
+$as_echo "$gl_cv_func_re_compile_pattern_working" >&6; }
+ case "$gl_cv_func_re_compile_pattern_working" in #(
+ *yes) ac_use_included_regex=no;; #(
+ *no) ac_use_included_regex=yes;;
+ esac
+ ;;
+ *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5
+ ;;
+ esac
+
+ if test $ac_use_included_regex = yes; then
+
+$as_echo "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h
+
+
+$as_echo "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h
+
+
+$as_echo "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h
+
+
+$as_echo "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h
+
+
+$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h
+
+
+$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h
+
+
+$as_echo "#define re_search rpl_re_search" >>confdefs.h
+
+
+$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h
+
+
+$as_echo "#define re_match rpl_re_match" >>confdefs.h
+
+
+$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h
+
+
+$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h
+
+
+$as_echo "#define re_comp rpl_re_comp" >>confdefs.h
+
+
+$as_echo "#define re_exec rpl_re_exec" >>confdefs.h
+
+
+$as_echo "#define regcomp rpl_regcomp" >>confdefs.h
+
+
+$as_echo "#define regexec rpl_regexec" >>confdefs.h
+
+
+$as_echo "#define regerror rpl_regerror" >>confdefs.h
+
+
+$as_echo "#define regfree rpl_regfree" >>confdefs.h
+
+ fi
+
+
+ if test $ac_use_included_regex = yes; then
+ GL_COND_OBJ_REGEX_TRUE=
+ GL_COND_OBJ_REGEX_FALSE='#'
+else
+ GL_COND_OBJ_REGEX_TRUE='#'
+ GL_COND_OBJ_REGEX_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_REGEX_TRUE}" && test -z "${GL_COND_OBJ_REGEX_FALSE}"; then
+ GL_COND_OBJ_REGEX_TRUE='#'
+ GL_COND_OBJ_REGEX_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_REGEX_TRUE"; then :
+
+
+
+
+
+
+
+ for ac_header in libintl.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
+if test "x$ac_cv_header_libintl_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBINTL_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
+"
+if test "x$ac_cv_have_decl_isblank" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISBLANK $ac_have_decl
+_ACEOF
+
+
+
+fi
+
+ SERVENT_LIB=
+ gl_saved_libs="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getservbyname" >&5
+$as_echo_n "checking for library containing getservbyname... " >&6; }
+if ${ac_cv_search_getservbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getservbyname ();
+int
+main ()
+{
+return getservbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket network net; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getservbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getservbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getservbyname+:} false; then :
+
+else
+ ac_cv_search_getservbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getservbyname" >&5
+$as_echo "$ac_cv_search_getservbyname" >&6; }
+ac_res=$ac_cv_search_getservbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ if test "$ac_cv_search_getservbyname" != "none required"; then
+ SERVENT_LIB="$ac_cv_search_getservbyname"
+ fi
+fi
+
+ LIBS="$gl_saved_libs"
+ if test -z "$SERVENT_LIB"; then
+ for ac_func in getservbyname
+do :
+ ac_fn_c_check_func "$LINENO" "getservbyname" "ac_cv_func_getservbyname"
+if test "x$ac_cv_func_getservbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GETSERVBYNAME 1
+_ACEOF
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservbyname in winsock2.h and -lws2_32" >&5
+$as_echo_n "checking for getservbyname in winsock2.h and -lws2_32... " >&6; }
+if ${gl_cv_w32_getservbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_cv_w32_getservbyname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+
+int
+main ()
+{
+getservbyname(NULL,NULL);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_w32_getservbyname=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$gl_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_w32_getservbyname" >&5
+$as_echo "$gl_cv_w32_getservbyname" >&6; }
+ if test "$gl_cv_w32_getservbyname" = "yes"; then
+ SERVENT_LIB="-lws2_32"
+ fi
+
+fi
+done
+
+ fi
+
+
+
+
+ if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
+$as_echo_n "checking whether setenv validates arguments... " >&6; }
+if ${gl_cv_func_setenv_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+
+int
+main ()
+{
+
+ int result = 0;
+ {
+ if (setenv ("", "", 0) != -1)
+ result |= 1;
+ else if (errno != EINVAL)
+ result |= 2;
+ }
+ {
+ if (setenv ("a", "=", 1) != 0)
+ result |= 4;
+ else if (strcmp (getenv ("a"), "=") != 0)
+ result |= 8;
+ }
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_setenv_works=yes
+else
+ gl_cv_func_setenv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
+$as_echo "$gl_cv_func_setenv_works" >&6; }
+ case "$gl_cv_func_setenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_SETENV=1
+ ;;
+ esac
+ fi
+
+
+ if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
+ GL_COND_OBJ_SETENV_TRUE=
+ GL_COND_OBJ_SETENV_FALSE='#'
+else
+ GL_COND_OBJ_SETENV_TRUE='#'
+ GL_COND_OBJ_SETENV_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_SETENV_TRUE}" && test -z "${GL_COND_OBJ_SETENV_FALSE}"; then
+ GL_COND_OBJ_SETENV_TRUE='#'
+ GL_COND_OBJ_SETENV_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_SETENV=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
+$as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
+if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+ *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+ gl_cv_func_setlocale_null_all_mtsafe=no ;;
+ # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
+ *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
+ gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
+$as_echo "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_all_mtsafe" in
+ *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE
+_ACEOF
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
+$as_echo_n "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
+if ${gl_cv_func_setlocale_null_one_mtsafe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ # Guess no on OpenBSD, AIX.
+ openbsd* | aix*)
+ gl_cv_func_setlocale_null_one_mtsafe=no ;;
+ # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
+ *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+ gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
+$as_echo "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_one_mtsafe" in
+ *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE
+_ACEOF
+
+
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ case "$host_os" in
+ mingw*) LIB_SETLOCALE_NULL= ;;
+ *)
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
+if ${gl_cv_have_weak+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case "$host_os" in
+ cygwin*)
+ gl_cv_have_weak="guessing no"
+ ;;
+ *)
+ gl_cv_have_weak=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main ()
+{
+xyzzy();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test $gl_cv_have_weak = maybe; then
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+ gl_cv_have_weak="guessing yes"
+else
+ gl_cv_have_weak="guessing no"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_have_weak=yes
+else
+ gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ ;;
+ esac
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+$as_echo "$gl_cv_have_weak" >&6; }
+ case "$gl_cv_have_weak" in
+ *yes)
+
+$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+ ;;
+ esac
+
+ case "$gl_cv_have_weak" in
+ *yes) LIB_SETLOCALE_NULL= ;;
+ *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_SETLOCALE_NULL=
+ fi
+
+
+
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ GL_COND_OBJ_SETLOCALE_LOCK_TRUE=
+ GL_COND_OBJ_SETLOCALE_LOCK_FALSE='#'
+else
+ GL_COND_OBJ_SETLOCALE_LOCK_TRUE='#'
+ GL_COND_OBJ_SETLOCALE_LOCK_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_SETLOCALE_LOCK_TRUE}" && test -z "${GL_COND_OBJ_SETLOCALE_LOCK_FALSE}"; then
+ GL_COND_OBJ_SETLOCALE_LOCK_TRUE='#'
+ GL_COND_OBJ_SETLOCALE_LOCK_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_SETLOCALE_LOCK_TRUE"; then :
+
+
+
+
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
+$as_echo_n "checking whether the -Werror option is usable... " >&6; }
+if ${gl_cv_cc_vis_werror+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_cc_vis_werror=yes
+else
+ gl_cv_cc_vis_werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
+$as_echo "$gl_cv_cc_vis_werror" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
+$as_echo_n "checking for simple visibility declarations... " >&6; }
+if ${gl_cv_cc_visibility+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void);
+ int hiddenvar;
+ int exportedvar;
+ int hiddenfunc (void) { return 51; }
+ int exportedfunc (void) { return 1225736919; }
+ void dummyfunc (void) {}
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_cc_visibility=yes
+else
+ gl_cv_cc_visibility=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
+$as_echo "$gl_cv_cc_visibility" >&6; }
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VISIBILITY $HAVE_VISIBILITY
+_ACEOF
+
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_SETLOCALE_NULL=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h
+
+
+
+
+ for ac_header in stdint.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H 1
+_ACEOF
+
+fi
+
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
+$as_echo_n "checking for SIZE_MAX... " >&6; }
+if ${gl_cv_size_max+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_cv_size_max=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Found it" >/dev/null 2>&1; then :
+ gl_cv_size_max=yes
+fi
+rm -f conftest*
+
+ if test $gl_cv_size_max != yes; then
+ if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include <stddef.h>
+#include <limits.h>"; then :
+
+else
+ size_t_bits_minus_1=
+fi
+
+ if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include <stddef.h>"; then :
+
+else
+ fits_in_uint=
+fi
+
+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+ if test $fits_in_uint = 1; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ fits_in_uint=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $fits_in_uint = 1; then
+ gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ else
+ gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ fi
+ else
+ gl_cv_size_max='((size_t)~(size_t)0)'
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
+$as_echo "$gl_cv_size_max" >&6; }
+ if test "$gl_cv_size_max" != yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define SIZE_MAX $gl_cv_size_max
+_ACEOF
+
+ fi
+
+
+
+
+ gl_cv_func_snprintf_usable=no
+ for ac_func in snprintf
+do :
+ ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
+if test "x$ac_cv_func_snprintf" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SNPRINTF 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_snprintf = yes; then
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5
+$as_echo_n "checking whether snprintf respects a size of 1... " >&6; }
+if ${gl_cv_func_snprintf_size1+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ *) gl_cv_func_snprintf_size1="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+int main()
+{
+ static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+ my_snprintf (buf, 1, "%d", 12345);
+ return buf[1] != 'E';
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_snprintf_size1=yes
+else
+ gl_cv_func_snprintf_size1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5
+$as_echo "$gl_cv_func_snprintf_size1" >&6; }
+
+ case "$gl_cv_func_snprintf_size1" in
+ *yes)
+
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5
+$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; }
+if ${gl_cv_func_printf_positions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+
+ case "$host_os" in
+ netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+ gl_cv_func_printf_positions="guessing no";;
+ beos*) gl_cv_func_printf_positions="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_positions="guessing yes";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+ *) gl_cv_func_printf_positions="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+ dollar expansion (possibly an autoconf bug). */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+ sprintf (buf, format, 33, 55);
+ return (strcmp (buf, "55 33") != 0);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_printf_positions=yes
+else
+ gl_cv_func_printf_positions=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5
+$as_echo "$gl_cv_func_printf_positions" >&6; }
+
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ gl_cv_func_snprintf_usable=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ if test $gl_cv_func_snprintf_usable = no; then
+
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext"
+
+ if test $ac_cv_func_snprintf = yes; then
+ REPLACE_SNPRINTF=1
+ else
+
+ if test $ac_cv_have_decl_snprintf = yes; then
+ REPLACE_SNPRINTF=1
+ fi
+ fi
+ :
+
+ fi
+
+ if test $ac_cv_have_decl_snprintf = no; then
+ HAVE_DECL_SNPRINTF=0
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_SNPRINTF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_SNPRINTF 1
+_ACEOF
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
+/* <sys/types.h> is not needed according to POSIX, but the
+ <sys/socket.h> in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_type_socklen_t" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
+$as_echo_n "checking for socklen_t equivalent... " >&6; }
+if ${gl_cv_socklen_t_equiv+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Systems have either "struct sockaddr *" or
+ # "void *" as the second argument to getpeername
+ gl_cv_socklen_t_equiv=
+ for arg2 in "struct sockaddr" void; do
+ for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/socket.h>
+
+ int getpeername (int, $arg2 *, $t *);
+int
+main ()
+{
+$t len;
+ getpeername (0, 0, &len);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_socklen_t_equiv="$t"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ if test "$gl_cv_socklen_t_equiv" = ""; then
+ as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
+$as_echo "$gl_cv_socklen_t_equiv" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define socklen_t $gl_cv_socklen_t_equiv
+_ACEOF
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
+$as_echo_n "checking for ssize_t... " >&6; }
+if ${gt_cv_ssize_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+int x = sizeof (ssize_t *) + sizeof (ssize_t);
+ return !x;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_ssize_t=yes
+else
+ gt_cv_ssize_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
+$as_echo "$gt_cv_ssize_t" >&6; }
+ if test $gt_cv_ssize_t = no; then
+
+$as_echo "#define ssize_t int" >>confdefs.h
+
+ fi
+
+
+
+
+
+ case "$host_os" in
+ mingw*)
+ REPLACE_STAT=1
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
+$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
+if ${gl_cv_func_stat_file_slash+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ touch conftest.tmp
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.tmp conftest.lnk
+ fi
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+
+int
+main ()
+{
+int result = 0;
+ struct stat st;
+ if (!stat ("conftest.tmp/", &st))
+ result |= 1;
+#if HAVE_LSTAT
+ if (!stat ("conftest.lnk/", &st))
+ result |= 2;
+#endif
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_stat_file_slash=yes
+else
+ gl_cv_func_stat_file_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ rm -f conftest.tmp conftest.lnk
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
+$as_echo "$gl_cv_func_stat_file_slash" >&6; }
+ case $gl_cv_func_stat_file_slash in
+ *no)
+ REPLACE_STAT=1
+
+$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
+;;
+ esac
+ case $host_os in
+ solaris*)
+ REPLACE_FSTAT=1 ;;
+ esac
+ ;;
+ esac
+
+
+ if test $REPLACE_STAT = 1; then
+ GL_COND_OBJ_STAT_TRUE=
+ GL_COND_OBJ_STAT_FALSE='#'
+else
+ GL_COND_OBJ_STAT_TRUE='#'
+ GL_COND_OBJ_STAT_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STAT_TRUE}" && test -z "${GL_COND_OBJ_STAT_FALSE}"; then
+ GL_COND_OBJ_STAT_TRUE='#'
+ GL_COND_OBJ_STAT_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_STAT_TRUE"; then :
+
+ case "$host_os" in
+ mingw*)
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext"
+
+ ;;
+ esac
+
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_STAT=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
+
+
+
+
+
+
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
+_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
+$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
+if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #include <time.h>
+ struct timespec ts;
+ struct stat st;
+
+int
+main ()
+{
+
+ st.st_atim = ts;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
+else
+ ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
+$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+
+$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
+
+ fi
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
+_ACEOF
+
+
+fi
+
+fi
+
+fi
+
+fi
+
+
+
+
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
+_ACEOF
+
+
+else
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
+ #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
+_ACEOF
+
+
+fi
+
+fi
+
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alignas and alignof" >&5
+$as_echo_n "checking for alignas and alignof... " >&6; }
+if ${gl_cv_header_working_stdalign_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ gl_save_CFLAGS=$CFLAGS
+ for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do
+ case $gl_working in #(
+ *stdalign.h*) :
+ CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H" ;; #(
+ *) :
+ ;;
+esac
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+ #ifdef INCLUDE_STDALIGN_H
+ #include <stdalign.h>
+ #endif
+ #include <stddef.h>
+
+ /* Test that alignof yields a result consistent with offsetof.
+ This catches GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+ #ifdef __cplusplus
+ template <class t> struct alignof_helper { char a; t b; };
+ # define ao(type) offsetof (alignof_helper<type>, b)
+ #else
+ # define ao(type) offsetof (struct { char a; type b; }, b)
+ #endif
+ char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
+ char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
+ char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
+
+ /* Test alignas only on platforms where gnulib can help. */
+ #if \
+ ((defined __cplusplus && 201103 <= __cplusplus) \
+ || (__TINYC__ && defined __attribute__) \
+ || (defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
+ || 1300 <= _MSC_VER)
+ struct alignas_test { char c; char alignas (8) alignas_8; };
+ char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
+ ? 1 : -1];
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_header_working_stdalign_h=$gl_working
+else
+ gl_cv_header_working_stdalign_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ CFLAGS=$gl_save_CFLAGS
+ test "$gl_cv_header_working_stdalign_h" != no && break
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
+$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
+
+ GL_GENERATE_STDALIGN_H=false
+ case $gl_cv_header_working_stdalign_h in #(
+ no) :
+ GL_GENERATE_STDALIGN_H=true ;; #(
+ yes*keyword*) :
+
+$as_echo "#define HAVE_C_ALIGNASOF 1" >>confdefs.h
+ ;; #(
+ *) :
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+ case "$GL_GENERATE_STDALIGN_H" in
+ false) STDALIGN_H='' ;;
+ true)
+ if test -z "$STDALIGN_H"; then
+ STDALIGN_H="${gl_source_base_prefix}stdalign.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_STDALIGN_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_STDALIGN_H; then
+ GL_GENERATE_STDALIGN_H_TRUE=
+ GL_GENERATE_STDALIGN_H_FALSE='#'
+else
+ GL_GENERATE_STDALIGN_H_TRUE='#'
+ GL_GENERATE_STDALIGN_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
+ GL_GENERATE_STDALIGN_H_TRUE='#'
+ GL_GENERATE_STDALIGN_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bool, true, false" >&5
+$as_echo_n "checking for bool, true, false... " >&6; }
+if ${gl_cv_c_bool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #if true == false
+ #error "true == false"
+ #endif
+ extern bool b;
+ bool b = true == false;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_c_bool=yes
+else
+ gl_cv_c_bool=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_bool" >&5
+$as_echo "$gl_cv_c_bool" >&6; }
+ if test "$gl_cv_c_bool" = yes; then
+
+$as_echo "#define HAVE_C_BOOL 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+ if test $ac_cv_header_stdckdint_h = yes; then
+ GL_GENERATE_STDCKDINT_H=false
+ else
+ GL_GENERATE_STDCKDINT_H=true
+ fi
+
+
+
+
+ case "$GL_GENERATE_STDCKDINT_H" in
+ false) STDCKDINT_H='' ;;
+ true)
+ if test -z "$STDCKDINT_H"; then
+ STDCKDINT_H="${gl_source_base_prefix}stdckdint.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_STDCKDINT_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_STDCKDINT_H; then
+ GL_GENERATE_STDCKDINT_H_TRUE=
+ GL_GENERATE_STDCKDINT_H_FALSE='#'
+else
+ GL_GENERATE_STDCKDINT_H_TRUE='#'
+ GL_GENERATE_STDCKDINT_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_STDCKDINT_H_TRUE}" && test -z "${GL_GENERATE_STDCKDINT_H_FALSE}"; then
+ GL_GENERATE_STDCKDINT_H_TRUE='#'
+ GL_GENERATE_STDCKDINT_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ case "$GL_GENERATE_STDDEF_H" in
+ false) STDDEF_H='' ;;
+ true)
+ if test -z "$STDDEF_H"; then
+ STDDEF_H="${gl_source_base_prefix}stddef.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_STDDEF_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_STDDEF_H; then
+ GL_GENERATE_STDDEF_H_TRUE=
+ GL_GENERATE_STDDEF_H_FALSE='#'
+else
+ GL_GENERATE_STDDEF_H_TRUE='#'
+ GL_GENERATE_STDDEF_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
+ GL_GENERATE_STDDEF_H_TRUE='#'
+ GL_GENERATE_STDDEF_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+
+ case "$GL_GENERATE_STDINT_H" in
+ false) STDINT_H='' ;;
+ true)
+ if test -z "$STDINT_H"; then
+ STDINT_H="${gl_source_base_prefix}stdint.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_STDINT_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_STDINT_H; then
+ GL_GENERATE_STDINT_H_TRUE=
+ GL_GENERATE_STDINT_H_FALSE='#'
+else
+ GL_GENERATE_STDINT_H_TRUE='#'
+ GL_GENERATE_STDINT_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
+ GL_GENERATE_STDINT_H_TRUE='#'
+ GL_GENERATE_STDINT_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+ case "$GL_GENERATE_LIMITS_H" in
+ false) LIMITS_H='' ;;
+ true)
+ if test -z "$LIMITS_H"; then
+ LIMITS_H="${gl_source_base_prefix}limits.h"
+ fi
+ ;;
+ *) echo "*** GL_GENERATE_LIMITS_H is not set correctly" 1>&2; exit 1 ;;
+ esac
+
+
+ if $GL_GENERATE_LIMITS_H; then
+ GL_GENERATE_LIMITS_H_TRUE=
+ GL_GENERATE_LIMITS_H_FALSE='#'
+else
+ GL_GENERATE_LIMITS_H_TRUE='#'
+ GL_GENERATE_LIMITS_H_FALSE=
+fi
+:
+ if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
+ GL_GENERATE_LIMITS_H_TRUE='#'
+ GL_GENERATE_LIMITS_H_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $REPLACE_STDIO_READ_FUNCS = 1; then
+ GL_COND_OBJ_STDIO_READ_TRUE=
+ GL_COND_OBJ_STDIO_READ_FALSE='#'
+else
+ GL_COND_OBJ_STDIO_READ_TRUE='#'
+ GL_COND_OBJ_STDIO_READ_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STDIO_READ_TRUE}" && test -z "${GL_COND_OBJ_STDIO_READ_FALSE}"; then
+ GL_COND_OBJ_STDIO_READ_TRUE='#'
+ GL_COND_OBJ_STDIO_READ_FALSE='#'
+ fi
+
+
+ if test $REPLACE_STDIO_WRITE_FUNCS = 1; then
+ GL_COND_OBJ_STDIO_WRITE_TRUE=
+ GL_COND_OBJ_STDIO_WRITE_FALSE='#'
+else
+ GL_COND_OBJ_STDIO_WRITE_TRUE='#'
+ GL_COND_OBJ_STDIO_WRITE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STDIO_WRITE_TRUE}" && test -z "${GL_COND_OBJ_STDIO_WRITE_FALSE}"; then
+ GL_COND_OBJ_STDIO_WRITE_TRUE='#'
+ GL_COND_OBJ_STDIO_WRITE_FALSE='#'
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FSCANF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FSCANF 1" >>confdefs.h
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FSCANF 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_SCANF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_SCANF 1" >>confdefs.h
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_SCANF 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FGETC=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FGETC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETC=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_GETCHAR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_GETCHAR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FGETS=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FGETS 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FREAD=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FREAD 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FPRINTF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_PRINTF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_PRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_VFPRINTF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_VFPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_VPRINTF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_VPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FPUTC=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FPUTC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_PUTC=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_PUTC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_PUTCHAR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_PUTCHAR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FPUTS=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FPUTS 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_PUTS=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_PUTS 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_FWRITE=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FWRITE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for ac_func in strcasecmp
+do :
+ ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
+if test "x$ac_cv_func_strcasecmp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRCASECMP 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strcasecmp = no; then
+ HAVE_STRCASECMP=0
+ fi
+
+
+
+ for ac_func in strncasecmp
+do :
+ ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp"
+if test "x$ac_cv_func_strncasecmp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRNCASECMP 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strncasecmp = yes; then
+ HAVE_STRNCASECMP=1
+ else
+ HAVE_STRNCASECMP=0
+ fi
+ ac_fn_c_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strncasecmp" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNCASECMP $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_strncasecmp = no; then
+ HAVE_DECL_STRNCASECMP=0
+ fi
+
+
+
+ if test $HAVE_STRCASECMP = 0; then
+ GL_COND_OBJ_STRCASECMP_TRUE=
+ GL_COND_OBJ_STRCASECMP_FALSE='#'
+else
+ GL_COND_OBJ_STRCASECMP_TRUE='#'
+ GL_COND_OBJ_STRCASECMP_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STRCASECMP_TRUE}" && test -z "${GL_COND_OBJ_STRCASECMP_FALSE}"; then
+ GL_COND_OBJ_STRCASECMP_TRUE='#'
+ GL_COND_OBJ_STRCASECMP_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_STRCASECMP_TRUE"; then :
+
+
+ :
+
+
+fi
+
+ if test $HAVE_STRNCASECMP = 0; then
+ GL_COND_OBJ_STRNCASECMP_TRUE=
+ GL_COND_OBJ_STRNCASECMP_FALSE='#'
+else
+ GL_COND_OBJ_STRNCASECMP_TRUE='#'
+ GL_COND_OBJ_STRNCASECMP_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STRNCASECMP_TRUE}" && test -z "${GL_COND_OBJ_STRNCASECMP_FALSE}"; then
+ GL_COND_OBJ_STRNCASECMP_TRUE='#'
+ GL_COND_OBJ_STRNCASECMP_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_STRNCASECMP_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+ if test $HAVE_STRCASESTR = 1 && test $REPLACE_STRCASESTR = 0; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strcasestr works in linear time" >&5
+$as_echo_n "checking whether strcasestr works in linear time... " >&6; }
+if ${gl_cv_func_strcasestr_linear+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ && !defined __UCLIBC__
+ Lucky user
+ #endif
+#endif
+#ifdef __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky user" >/dev/null 2>&1; then :
+ gl_cv_func_strcasestr_linear="guessing yes"
+else
+ gl_cv_func_strcasestr_linear="$gl_cross_guess_normal"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <signal.h> /* for signal */
+#include <string.h> /* for strcasestr */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for alarm */
+static void quit (int sig) { _exit (sig + 128); }
+
+int
+main ()
+{
+
+ int result = 0;
+ size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 2);
+ char *needle = (char *) malloc (m + 2);
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also lack strcasestr. */
+ signal (SIGALRM, quit);
+ alarm (5);
+ /* Check for quadratic performance. */
+ if (haystack && needle)
+ {
+ memset (haystack, 'A', 2 * m);
+ haystack[2 * m] = 'B';
+ haystack[2 * m + 1] = 0;
+ memset (needle, 'A', m);
+ needle[m] = 'B';
+ needle[m + 1] = 0;
+ if (!strcasestr (haystack, needle))
+ result |= 1;
+ }
+ /* Free allocated memory, in case some sanitizer is watching. */
+ free (haystack);
+ free (needle);
+ return result;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_strcasestr_linear=yes
+else
+ gl_cv_func_strcasestr_linear=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strcasestr_linear" >&5
+$as_echo "$gl_cv_func_strcasestr_linear" >&6; }
+ case "$gl_cv_func_strcasestr_linear" in
+ *yes) ;;
+ *)
+ REPLACE_STRCASESTR=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_STRCASESTR = 0 || test $REPLACE_STRCASESTR = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strcasestr.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+
+ for ac_func in strcasestr
+do :
+ ac_fn_c_check_func "$LINENO" "strcasestr" "ac_cv_func_strcasestr"
+if test "x$ac_cv_func_strcasestr" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRCASESTR 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strcasestr = no; then
+ HAVE_STRCASESTR=0
+ else
+ if test $REPLACE_MEMCHR = 1; then
+ REPLACE_STRCASESTR=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strcasestr works" >&5
+$as_echo_n "checking whether strcasestr works... " >&6; }
+if ${gl_cv_func_strcasestr_works_always+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h> /* for __GNU_LIBRARY__ */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
+ Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky user" >/dev/null 2>&1; then :
+ gl_cv_func_strcasestr_works_always="guessing yes"
+else
+ gl_cv_func_strcasestr_works_always="$gl_cross_guess_normal"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h> /* for __GNU_LIBRARY__, strcasestr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+ Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+
+int
+main ()
+{
+return !!strcasestr (HAYSTACK, NEEDLE);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_strcasestr_works_always=yes
+else
+ gl_cv_func_strcasestr_works_always=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strcasestr_works_always" >&5
+$as_echo "$gl_cv_func_strcasestr_works_always" >&6; }
+ case "$gl_cv_func_strcasestr_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_STRCASESTR=1
+ ;;
+ esac
+ fi
+ fi
+
+ if test $HAVE_STRCASESTR = 0 || test $REPLACE_STRCASESTR = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strcasestr.$ac_objext"
+
+
+ :
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_STRCASESTR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STRCASESTR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+ if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
+$as_echo_n "checking for working strerror function... " >&6; }
+if ${gl_cv_func_working_strerror+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+int
+main ()
+{
+if (!*strerror (-2)) return 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_working_strerror=yes
+else
+ gl_cv_func_working_strerror=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
+$as_echo "$gl_cv_func_working_strerror" >&6; }
+ case "$gl_cv_func_working_strerror" in
+ *yes) ;;
+ *)
+ REPLACE_STRERROR=1
+ ;;
+ esac
+
+ else
+ REPLACE_STRERROR=1
+ fi
+
+
+ if test $REPLACE_STRERROR = 1; then
+ GL_COND_OBJ_STRERROR_TRUE=
+ GL_COND_OBJ_STRERROR_FALSE='#'
+else
+ GL_COND_OBJ_STRERROR_TRUE='#'
+ GL_COND_OBJ_STRERROR_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STRERROR_TRUE}" && test -z "${GL_COND_OBJ_STRERROR_FALSE}"; then
+ GL_COND_OBJ_STRERROR_TRUE='#'
+ GL_COND_OBJ_STRERROR_FALSE='#'
+ fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_STRERROR 1
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_STRERROR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
+
+
+
+
+
+
+ if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+ GL_COND_OBJ_STRERROR_OVERRIDE_TRUE=
+ GL_COND_OBJ_STRERROR_OVERRIDE_FALSE='#'
+else
+ GL_COND_OBJ_STRERROR_OVERRIDE_TRUE='#'
+ GL_COND_OBJ_STRERROR_OVERRIDE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STRERROR_OVERRIDE_TRUE}" && test -z "${GL_COND_OBJ_STRERROR_OVERRIDE_FALSE}"; then
+ GL_COND_OBJ_STRERROR_OVERRIDE_TRUE='#'
+ GL_COND_OBJ_STRERROR_OVERRIDE_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_STRERROR_OVERRIDE_TRUE"; then :
+
+
+
+
+
+ if test $ac_cv_header_sys_socket_h != yes; then
+ for ac_header in winsock2.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for ac_func in strsep
+do :
+ ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep"
+if test "x$ac_cv_func_strsep" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRSEP 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_strsep = no; then
+ HAVE_STRSEP=0
+ fi
+
+
+ if test $HAVE_STRSEP = 0; then
+ GL_COND_OBJ_STRSEP_TRUE=
+ GL_COND_OBJ_STRSEP_FALSE='#'
+else
+ GL_COND_OBJ_STRSEP_TRUE='#'
+ GL_COND_OBJ_STRSEP_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_STRSEP_TRUE}" && test -z "${GL_COND_OBJ_STRSEP_FALSE}"; then
+ GL_COND_OBJ_STRSEP_TRUE='#'
+ GL_COND_OBJ_STRSEP_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_STRSEP_TRUE"; then :
+
+ :
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_STRSEP=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STRSEP 1" >>confdefs.h
+
+
+
+
+
+
+ if test $REPLACE_MEMCHR = 1; then
+ REPLACE_STRSTR=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
+$as_echo_n "checking whether strstr works... " >&6; }
+if ${gl_cv_func_strstr_works_always+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h> /* for __GNU_LIBRARY__ */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
+ Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky user" >/dev/null 2>&1; then :
+ gl_cv_func_strstr_works_always="guessing yes"
+else
+ gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
+fi
+rm -f conftest*
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h> /* for __GNU_LIBRARY__, strstr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+ Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+
+int
+main ()
+{
+return !!strstr (HAYSTACK, NEEDLE);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_strstr_works_always=yes
+else
+ gl_cv_func_strstr_works_always=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
+$as_echo "$gl_cv_func_strstr_works_always" >&6; }
+ case "$gl_cv_func_strstr_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_STRSTR=1
+ ;;
+ esac
+ fi
+
+ if test $REPLACE_STRSTR = 1; then
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strstr.$ac_objext"
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_STRSTR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_decl "$LINENO" "localtime_r" "ac_cv_have_decl_localtime_r" "/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+
+"
+if test "x$ac_cv_have_decl_localtime_r" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_LOCALTIME_R $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_localtime_r = no; then
+ HAVE_DECL_LOCALTIME_R=0
+ fi
+
+
+ if test $ac_cv_func_localtime_r = yes; then
+ HAVE_LOCALTIME_R=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r is compatible with its POSIX signature" >&5
+$as_echo_n "checking whether localtime_r is compatible with its POSIX signature... " >&6; }
+if ${gl_cv_time_r_posix+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+
+int
+main ()
+{
+/* We don't need to append 'restrict's to the argument types,
+ even though the POSIX signature has the 'restrict's,
+ since C99 says they can't affect type compatibility. */
+ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
+ if (ptr) return 0;
+ /* Check the return type is a pointer.
+ On HP-UX 10 it is 'int'. */
+ *localtime_r (0, 0);
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_time_r_posix=yes
+else
+ gl_cv_time_r_posix=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_r_posix" >&5
+$as_echo "$gl_cv_time_r_posix" >&6; }
+ if test $gl_cv_time_r_posix = yes; then
+ REPLACE_LOCALTIME_R=0
+ else
+ REPLACE_LOCALTIME_R=1
+ fi
+ else
+ HAVE_LOCALTIME_R=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime_r exists as an inline function" >&5
+$as_echo_n "checking whether localtime_r exists as an inline function... " >&6; }
+if ${gl_cv_func_localtime_r_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+
+int
+main ()
+{
+time_t a;
+ struct tm r;
+ localtime_r (&a, &r);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ gl_cv_func_localtime_r_inline=yes
+else
+ gl_cv_func_localtime_r_inline=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_r_inline" >&5
+$as_echo "$gl_cv_func_localtime_r_inline" >&6; }
+ if test $gl_cv_func_localtime_r_inline = yes; then
+ REPLACE_LOCALTIME_R=1
+ fi
+ fi
+
+
+ if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
+ GL_COND_OBJ_TIME_R_TRUE=
+ GL_COND_OBJ_TIME_R_FALSE='#'
+else
+ GL_COND_OBJ_TIME_R_TRUE='#'
+ GL_COND_OBJ_TIME_R_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_TIME_R_TRUE}" && test -z "${GL_COND_OBJ_TIME_R_FALSE}"; then
+ GL_COND_OBJ_TIME_R_TRUE='#'
+ GL_COND_OBJ_TIME_R_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_TIME_R_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_TIME_R=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h
+
+
+
+
+
+
+ REPLACE_TIMEGM=0
+
+ if test $ac_cv_func_timegm = yes; then
+ if test "$gl_cv_func_working_mktime" != yes; then
+ # Assume that timegm is buggy if mktime is.
+ REPLACE_TIMEGM=1
+ fi
+ else
+ HAVE_TIMEGM=0
+ fi
+
+
+ if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
+ GL_COND_OBJ_TIMEGM_TRUE=
+ GL_COND_OBJ_TIMEGM_FALSE='#'
+else
+ GL_COND_OBJ_TIMEGM_TRUE='#'
+ GL_COND_OBJ_TIMEGM_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_TIMEGM_TRUE}" && test -z "${GL_COND_OBJ_TIMEGM_FALSE}"; then
+ GL_COND_OBJ_TIMEGM_TRUE='#'
+ GL_COND_OBJ_TIMEGM_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_TIMEGM_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_TIMEGM=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_TIMEGM 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ for ac_func in unsetenv
+do :
+ ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
+if test "x$ac_cv_func_unsetenv" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_UNSETENV 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
+ else
+ HAVE_UNSETENV=1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
+$as_echo_n "checking for unsetenv() return type... " >&6; }
+if ${gt_cv_func_unsetenv_ret+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
+#include <stdlib.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int unsetenv (const char *name);
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gt_cv_func_unsetenv_ret='int'
+else
+ gt_cv_func_unsetenv_ret='void'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
+$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
+ if test $gt_cv_func_unsetenv_ret = 'void'; then
+
+$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
+
+ REPLACE_UNSETENV=1
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
+$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
+if ${gl_cv_func_unsetenv_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+
+
+$gl_mda_defines
+
+int
+main ()
+{
+
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
+ if (putenv ((char *) "a=1")) return 1;
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 3;
+ if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_unsetenv_works=yes
+else
+ gl_cv_func_unsetenv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
+$as_echo "$gl_cv_func_unsetenv_works" >&6; }
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
+ fi
+
+
+ if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+ GL_COND_OBJ_UNSETENV_TRUE=
+ GL_COND_OBJ_UNSETENV_FALSE='#'
+else
+ GL_COND_OBJ_UNSETENV_TRUE='#'
+ GL_COND_OBJ_UNSETENV_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_UNSETENV_TRUE}" && test -z "${GL_COND_OBJ_UNSETENV_FALSE}"; then
+ GL_COND_OBJ_UNSETENV_TRUE='#'
+ GL_COND_OBJ_UNSETENV_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_UNSETENV_TRUE"; then :
+
+
+
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_UNSETENV=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5
+$as_echo_n "checking for variable-length arrays... " >&6; }
+if ${ac_cv_c_vararrays+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC_NO_VLA__
+ defined
+ #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "defined" >/dev/null 2>&1; then :
+ ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Test for VLA support. This test is partly inspired
+ from examples in the C standard. Use at least two VLA
+ functions to detect the GCC 3.4.3 bug described in:
+ https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
+ */
+ #ifdef __STDC_NO_VLA__
+ syntax error;
+ #else
+ extern int n;
+ int B[100];
+ int fvla (int m, int C[m][m]);
+
+ int
+ simple (int count, int all[static count])
+ {
+ return all[count - 1];
+ }
+
+ int
+ fvla (int m, int C[m][m])
+ {
+ typedef int VLA[m][m];
+ VLA x;
+ int D[m];
+ static int (*q)[m] = &B;
+ int (*s)[n] = q;
+ return C && &x[0][0] == &D[0] && &D[0] == s[0];
+ }
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_vararrays=yes
+else
+ ac_cv_c_vararrays=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5
+$as_echo "$ac_cv_c_vararrays" >&6; }
+ if test "$ac_cv_c_vararrays" = yes; then
+
+$as_echo "#define HAVE_C_VARARRAYS 1" >>confdefs.h
+
+ elif test "$ac_cv_c_vararrays" = no; then
+
+$as_echo "#define __STDC_NO_VLA__ 1" >>confdefs.h
+
+ fi
+
+
+
+
+ if test $ac_cv_func_vasnprintf = no; then
+
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
+
+ if test $ac_cv_func_vasnprintf = yes; then
+
+$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+ ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+else
+
+$as_echo "#define ptrdiff_t long" >>confdefs.h
+
+
+fi
+
+
+
+
+
+
+
+ fi
+
+
+ for ac_func in vasprintf
+do :
+ ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
+if test "x$ac_cv_func_vasprintf" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VASPRINTF 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_vasprintf = no; then
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS vasprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS asprintf.$ac_objext"
+
+
+ if test $ac_cv_func_vasprintf = yes; then
+ REPLACE_VASPRINTF=1
+ else
+ HAVE_VASPRINTF=0
+ fi
+
+
+
+
+
+
+
+
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_VASPRINTF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h
+
+
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format"
+
+
+
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format"
+
+
+
+ gl_cv_func_vsnprintf_usable=no
+ for ac_func in vsnprintf
+do :
+ ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf"
+if test "x$ac_cv_func_vsnprintf" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_VSNPRINTF 1
+_ACEOF
+
+fi
+done
+
+ if test $ac_cv_func_vsnprintf = yes; then
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5
+$as_echo_n "checking whether snprintf respects a size of 1... " >&6; }
+if ${gl_cv_func_snprintf_size1+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ *) gl_cv_func_snprintf_size1="guessing yes" ;;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+int main()
+{
+ static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+ my_snprintf (buf, 1, "%d", 12345);
+ return buf[1] != 'E';
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_snprintf_size1=yes
+else
+ gl_cv_func_snprintf_size1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5
+$as_echo "$gl_cv_func_snprintf_size1" >&6; }
+
+ case "$gl_cv_func_snprintf_size1" in
+ *yes)
+
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5
+$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; }
+if ${gl_cv_func_printf_positions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+
+ case "$host_os" in
+ netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+ gl_cv_func_printf_positions="guessing no";;
+ beos*) gl_cv_func_printf_positions="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_positions="guessing yes";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+ *) gl_cv_func_printf_positions="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+ dollar expansion (possibly an autoconf bug). */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+ sprintf (buf, format, 33, 55);
+ return (strcmp (buf, "55 33") != 0);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_printf_positions=yes
+else
+ gl_cv_func_printf_positions=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5
+$as_echo "$gl_cv_func_printf_positions" >&6; }
+
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ gl_cv_func_vsnprintf_usable=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ if test $gl_cv_func_vsnprintf_usable = no; then
+
+
+
+
+
+
+
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS vsnprintf.$ac_objext"
+
+ if test $ac_cv_func_vsnprintf = yes; then
+ REPLACE_VSNPRINTF=1
+ else
+
+ if test $ac_cv_have_decl_vsnprintf = yes; then
+ REPLACE_VSNPRINTF=1
+ fi
+ fi
+ :
+
+ fi
+
+ if test $ac_cv_have_decl_vsnprintf = no; then
+ HAVE_DECL_VSNPRINTF=0
+ fi
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_VSNPRINTF=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_VSNPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if case "$host_os" in
+ mingw*) true ;;
+ *) test $ac_cv_func_mbsinit = yes ;;
+ esac \
+ && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
+if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on AIX and OSF/1.
+ aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+ esac
+ if test $LOCALE_JA != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ else
+ if test $LOCALE_FR_UTF8 != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_incomplete_state=yes
+else
+ gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on Solaris 8.
+ solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+ esac
+ if test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8:
+ mbrtowc returns 2, and sets wc to 0x00F0.
+ mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 6, &state) != 4
+ && mbtowc (&wc, input + 3, 6) == 4)
+ return 2;
+ }
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_mbrtowc_sanitycheck=yes
+else
+ gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+ REPLACE_MBSTATE_T=0
+ case "$gl_cv_func_mbrtowc_incomplete_state" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ case "$gl_cv_func_mbrtowc_sanitycheck" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ else
+ REPLACE_MBSTATE_T=1
+ fi
+
+
+
+ if test $ac_cv_func_wcrtomb = no; then
+ HAVE_WCRTOMB=0
+ ac_fn_c_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" "
+ #include <wchar.h>
+
+"
+if test "x$ac_cv_have_decl_wcrtomb" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_WCRTOMB $ac_have_decl
+_ACEOF
+
+ if test $ac_cv_have_decl_wcrtomb = yes; then
+ REPLACE_WCRTOMB=1
+ fi
+ else
+ if test $REPLACE_WCRTOMB = 0; then
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb works in the C locale" >&5
+$as_echo_n "checking whether wcrtomb works in the C locale... " >&6; }
+if ${gl_cv_func_wcrtomb_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_wcrtomb_works="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_works="guessing yes";;
+ esac
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <string.h>
+#include <stdlib.h>
+#include <wchar.h>
+int main ()
+{
+ mbstate_t state;
+ char out[64];
+ int count;
+ memset (&state, 0, sizeof (state));
+ out[0] = 'x';
+ count = wcrtomb (out, L'a', &state);
+ return !(count == 1 && out[0] == 'a');
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_wcrtomb_works=yes
+else
+ gl_cv_func_wcrtomb_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_works" >&5
+$as_echo "$gl_cv_func_wcrtomb_works" >&6; }
+ case "$gl_cv_func_wcrtomb_works" in
+ *yes) ;;
+ *)
+$as_echo "#define WCRTOMB_C_LOCALE_BUG 1" >>confdefs.h
+
+ REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ if test $REPLACE_WCRTOMB = 0; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5
+$as_echo_n "checking whether wcrtomb return value is correct... " >&6; }
+if ${gl_cv_func_wcrtomb_retval+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ case "$host_os" in
+ # Guess no on AIX 4, OSF/1, Solaris, native Windows.
+ aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
+ esac
+ if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+#include <stdlib.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 1;
+ }
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 2;
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ if (mbtowc (&wc, "\303\274", 2) == 2)
+ if (wcrtomb (NULL, wc, NULL) != 1)
+ result |= 2;
+ }
+ }
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 4;
+ }
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 8;
+ }
+ return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gl_cv_func_wcrtomb_retval=yes
+else
+ gl_cv_func_wcrtomb_retval=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5
+$as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
+ case "$gl_cv_func_wcrtomb_retval" in
+ *yes) ;;
+ *)
+$as_echo "#define WCRTOMB_RETVAL_BUG 1" >>confdefs.h
+
+ REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ fi
+
+
+ if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
+ GL_COND_OBJ_WCRTOMB_TRUE=
+ GL_COND_OBJ_WCRTOMB_FALSE='#'
+else
+ GL_COND_OBJ_WCRTOMB_TRUE='#'
+ GL_COND_OBJ_WCRTOMB_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_WCRTOMB_TRUE}" && test -z "${GL_COND_OBJ_WCRTOMB_FALSE}"; then
+ GL_COND_OBJ_WCRTOMB_TRUE='#'
+ GL_COND_OBJ_WCRTOMB_FALSE='#'
+ fi
+
+ if test -z "$GL_COND_OBJ_WCRTOMB_TRUE"; then :
+
+
+ :
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GL_GNULIB_WCRTOMB=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+ if case "$host_os" in mingw*) true;; *) false;; esac; then
+ GL_COND_OBJ_WINDOWS_MUTEX_TRUE=
+ GL_COND_OBJ_WINDOWS_MUTEX_FALSE='#'
+else
+ GL_COND_OBJ_WINDOWS_MUTEX_TRUE='#'
+ GL_COND_OBJ_WINDOWS_MUTEX_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_WINDOWS_MUTEX_TRUE}" && test -z "${GL_COND_OBJ_WINDOWS_MUTEX_FALSE}"; then
+ GL_COND_OBJ_WINDOWS_MUTEX_TRUE='#'
+ GL_COND_OBJ_WINDOWS_MUTEX_FALSE='#'
+ fi
+
+
+
+ if case "$host_os" in mingw*) true;; *) false;; esac; then
+ GL_COND_OBJ_WINDOWS_ONCE_TRUE=
+ GL_COND_OBJ_WINDOWS_ONCE_FALSE='#'
+else
+ GL_COND_OBJ_WINDOWS_ONCE_TRUE='#'
+ GL_COND_OBJ_WINDOWS_ONCE_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_WINDOWS_ONCE_TRUE}" && test -z "${GL_COND_OBJ_WINDOWS_ONCE_FALSE}"; then
+ GL_COND_OBJ_WINDOWS_ONCE_TRUE='#'
+ GL_COND_OBJ_WINDOWS_ONCE_FALSE='#'
+ fi
+
+
+
+ if case "$host_os" in mingw*) true;; *) false;; esac; then
+ GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE=
+ GL_COND_OBJ_WINDOWS_RECMUTEX_FALSE='#'
+else
+ GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE='#'
+ GL_COND_OBJ_WINDOWS_RECMUTEX_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE}" && test -z "${GL_COND_OBJ_WINDOWS_RECMUTEX_FALSE}"; then
+ GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE='#'
+ GL_COND_OBJ_WINDOWS_RECMUTEX_FALSE='#'
+ fi
+
+
+
+ if case "$host_os" in mingw*) true;; *) false;; esac; then
+ GL_COND_OBJ_WINDOWS_RWLOCK_TRUE=
+ GL_COND_OBJ_WINDOWS_RWLOCK_FALSE='#'
+else
+ GL_COND_OBJ_WINDOWS_RWLOCK_TRUE='#'
+ GL_COND_OBJ_WINDOWS_RWLOCK_FALSE=
+fi
+:
+ if test -z "${GL_COND_OBJ_WINDOWS_RWLOCK_TRUE}" && test -z "${GL_COND_OBJ_WINDOWS_RWLOCK_FALSE}"; then
+ GL_COND_OBJ_WINDOWS_RWLOCK_TRUE='#'
+ GL_COND_OBJ_WINDOWS_RWLOCK_FALSE='#'
+ fi
+
+ :
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_XALLOC 1
+_ACEOF
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_XALLOC_DIE 1
+_ACEOF
+
+
+
+
+ for ac_header in stdint.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ # End of code from modules
+
+
+
+
+
+
+
+
+
+
+
+ gltests_libdeps=
+ gltests_ltlibdeps=
+
+
+
+
+
+
+
+
+
+
+
+
+ gl_source_base='tests'
+ gl_source_base_prefix=
+ gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+
+ gl_module_indicator_condition=$gltests_WITNESS
+
+
+
+
+
+
+
+
+
+
+
+
+ LIBGNU_LIBDEPS="$gl_libdeps"
+
+ LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
+
+
+
+if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_cv_prog_ac_ct_AR" = 'false' \) ; then
+ as_fn_error $? "No ar found for Solaris - is /usr/ccs/bin in PATH?" "$LINENO" 5
+fi
+
+ac_config_files="$ac_config_files Makefile tap/Makefile lib/Makefile plugins/Makefile lib/tests/Makefile plugins-root/Makefile plugins-scripts/Makefile plugins-scripts/utils.pm plugins-scripts/utils.sh test.pl pkg/solaris/pkginfo po/Makefile.in"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+# Check whether --enable-year2038 was given.
+if test "${enable_year2038+set}" = set; then :
+ enableval=$enable_year2038;
+fi
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+ enableval=$enable_largefile;
+fi
+
+if test -z "${RELEASE_PRESENT_TRUE}" && test -z "${RELEASE_PRESENT_FALSE}"; then
+ as_fn_error $? "conditional \"RELEASE_PRESENT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_LIBTAP_LOCAL_TRUE}" && test -z "${USE_LIBTAP_LOCAL_FALSE}"; then
+ as_fn_error $? "conditional \"USE_LIBTAP_LOCAL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_PARSE_INI_TRUE}" && test -z "${USE_PARSE_INI_FALSE}"; then
+ as_fn_error $? "conditional \"USE_PARSE_INI\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_UTMPX_TRUE}" && test -z "${HAVE_UTMPX_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_UTMPX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_WTS32API_TRUE}" && test -z "${HAVE_WTS32API_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_WTS32API\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
+ as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+
+
+ gl_libobjs=
+ gl_ltlibobjs=
+ gl_libobjdeps=
+ if test -n "$gl_LIBOBJS"; then
+ # Remove the extension.
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ sed_dirname1='s,//*,/,g'
+ sed_dirname2='s,\(.\)/$,\1,'
+ sed_dirname3='s,^[^/]*$,.,'
+ sed_dirname4='s,\(.\)/[^/]*$,\1,'
+ sed_basename1='s,.*/,,'
+ for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
+ gl_libobjs="$gl_libobjs $i.$ac_objext"
+ gl_ltlibobjs="$gl_ltlibobjs $i.lo"
+ i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
+ i_base=`echo "$i" | sed -e "$sed_basename1"`
+ gl_libobjdeps="$gl_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
+ done
+ fi
+ gl_LIBOBJS=$gl_libobjs
+
+ gl_LTLIBOBJS=$gl_ltlibobjs
+
+ gl_LIBOBJDEPS=$gl_libobjdeps
+
+
+
+ gltests_libobjs=
+ gltests_ltlibobjs=
+ gltests_libobjdeps=
+ if test -n "$gltests_LIBOBJS"; then
+ # Remove the extension.
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ sed_dirname1='s,//*,/,g'
+ sed_dirname2='s,\(.\)/$,\1,'
+ sed_dirname3='s,^[^/]*$,.,'
+ sed_dirname4='s,\(.\)/[^/]*$,\1,'
+ sed_basename1='s,.*/,,'
+ for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
+ gltests_libobjs="$gltests_libobjs $i.$ac_objext"
+ gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
+ i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
+ i_base=`echo "$i" | sed -e "$sed_basename1"`
+ gltests_libobjdeps="$gltests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
+ done
+ fi
+ gltests_LIBOBJS=$gltests_libobjs
+
+ gltests_LTLIBOBJS=$gltests_ltlibobjs
+
+ gltests_LIBOBJDEPS=$gltests_libobjdeps
+
+
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by monitoring-plugins $as_me 2.3.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+monitoring-plugins config.status 2.3.5
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
+ OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "gl/Makefile") CONFIG_FILES="$CONFIG_FILES gl/Makefile" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "plugins/picohttpparser/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/picohttpparser/Makefile" ;;
+ "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "tap/Makefile") CONFIG_FILES="$CONFIG_FILES tap/Makefile" ;;
+ "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+ "plugins/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;;
+ "lib/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lib/tests/Makefile" ;;
+ "plugins-root/Makefile") CONFIG_FILES="$CONFIG_FILES plugins-root/Makefile" ;;
+ "plugins-scripts/Makefile") CONFIG_FILES="$CONFIG_FILES plugins-scripts/Makefile" ;;
+ "plugins-scripts/utils.pm") CONFIG_FILES="$CONFIG_FILES plugins-scripts/utils.pm" ;;
+ "plugins-scripts/utils.sh") CONFIG_FILES="$CONFIG_FILES plugins-scripts/utils.sh" ;;
+ "test.pl") CONFIG_FILES="$CONFIG_FILES test.pl" ;;
+ "pkg/solaris/pkginfo") CONFIG_FILES="$CONFIG_FILES pkg/solaris/pkginfo" ;;
+ "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE=\"gmake\" (or whatever is
+ necessary). You can also try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+ "po-directories":C)
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ gt_tab=`printf '\t'`
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+
+echo " --with-apt-get-command: $with_apt_get_command"
+echo " --with-ping6-command: $with_ping6_command"
+echo " --with-ping-command: $with_ping_command"
+
+
+echo " --with-ipv6: $with_ipv6"
+echo " --with-mysql: $with_mysql"
+echo " --with-openssl: $with_openssl"
+echo " --with-gnutls: $with_gnutls"
+echo " --enable-extra-opts: $enable_extra_opts"
+echo " --with-perl: $with_perl"
+echo " --enable-perl-modules: $enable_perl_modules"
+echo " --with-cgiurl: $with_cgiurl"
+echo " --with-trusted-path: $with_trusted_path"
+echo " --enable-libtap: $enable_libtap"
+echo " --with-libcurl: $with_libcurl"
+echo " --with-uriparser: $with_uriparser"
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..7eed920
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,1966 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.64)
+AC_INIT(monitoring-plugins,2.3.5)
+AC_CONFIG_SRCDIR(NPTest.pm)
+AC_CONFIG_FILES([gl/Makefile])
+AC_CONFIG_AUX_DIR(build-aux)
+AM_INIT_AUTOMAKE([1.8.3])
+AM_SILENT_RULES([yes])
+AM_MAINTAINER_MODE([enable])
+AC_CONFIG_HEADERS([config.h])
+AC_CANONICAL_HOST
+
+DEFAULT_PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+RELEASE=1
+AC_SUBST(RELEASE)
+
+dnl Deprecated configure options
+
+
+dnl Append user (-o), group (-g), mode (-m) to install command
+dnl There is an assumption that this is possible with ./configure's chosen install command
+extra_install_args=""
+AC_ARG_WITH(nagios_user,
+ ACX_HELP_STRING([--with-nagios-user=USER],
+ [Installs executables with this user. Defaults to install user]),
+ extra_install_args="-o $withval")
+AC_ARG_WITH(nagios_group,
+ ACX_HELP_STRING([--with-nagios-group=GROUP],
+ [Installs executables with this group. Defaults to install user]),
+ extra_install_args="$extra_install_args -g $withval")
+AC_ARG_WITH(world_permissions,
+ ACX_HELP_STRING([--without-world-permissions],
+ [Installs executables without world permissions]))
+
+if test "x$with_world_permissions" = xno ; then
+ extra_install_args="$extra_install_args -m 0550"
+fi
+
+INSTALL="$INSTALL $extra_install_args"
+INSTALL_STRIP_PROGRAM="$INSTALL_STRIP_PROGRAM $extra_install_args"
+AC_SUBST(INSTALL)
+
+AC_PROG_CC
+gl_EARLY
+AC_PROG_GCC_TRADITIONAL
+AC_PROG_LIBTOOL
+
+AM_PROG_CC_C_O
+
+AC_FUNC_ERROR_AT_LINE
+AC_SYS_LARGEFILE
+
+ifdef([AC_FUNC_STRTOD],[AC_FUNC_STRTOD],[AM_FUNC_STRTOD])
+
+PLUGIN_TEST=`echo $srcdir/plugins/t/*.t|sed -e 's,\.*/plugins/,,g'`
+AC_SUBST(PLUGIN_TEST)dnl
+
+SCRIPT_TEST=`echo $srcdir/plugins-scripts/t/*.t|sed -e 's,\.*/plugins-scripts/,,g'`
+AC_SUBST(SCRIPT_TEST)dnl
+
+WARRANTY="The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n"
+AC_SUBST(WARRANTY)
+
+SUPPORT="Send email to help@monitoring-plugins.org if you have questions regarding use\nof this software. To submit patches or suggest improvements, send email to\ndevel@monitoring-plugins.org. Please include version information with all\ncorrespondence (when possible, use output from the --version option of the\nplugin itself).\n"
+AC_SUBST(SUPPORT)
+
+dnl CGIURL has changed for Nagios with 1.0 beta
+AC_ARG_WITH(cgiurl,
+ ACX_HELP_STRING([--with-cgiurl=DIR],
+ [sets URL for cgi programs]),
+ with_cgiurl=$withval,
+ with_cgiurl=/nagios/cgi-bin)
+CGIURL="$with_cgiurl"
+AC_DEFINE_UNQUOTED(CGIURL,"$CGIURL",[URL of CGI programs])
+
+AC_ARG_WITH(trusted_path,
+ ACX_HELP_STRING([--with-trusted-path=PATH],
+ [sets trusted path for executables called by scripts]),
+ with_trusted_path=$withval,
+ with_trusted_path=$DEFAULT_PATH)
+AC_SUBST(with_trusted_path)
+
+EXTRAS=
+EXTRAS_ROOT=
+dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$PATH
+
+LDFLAGS="$LDFLAGS -L."
+
+ac_cv_uname_m=`uname -m`
+ac_cv_uname_s=`uname -s`
+ac_cv_uname_r=`uname -r`
+ac_cv_uname_v=`uname -v`
+ac_cv_uname_o=`uname -o`
+
+PKG_ARCH=`uname -p`
+REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
+REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
+
+AC_SUBST(PKG_ARCH)
+AC_SUBST(REV_DATESTAMP)
+AC_SUBST(REV_TIMESTAMP)
+
+dnl Check if version file is present
+AM_CONDITIONAL([RELEASE_PRESENT], [test -f $srcdir/release])
+
+# Also read in the version from it
+if test -f $srcdir/release; then
+ NP_RELEASE="$(<release)"
+else
+ NP_RELEASE="$PACKAGE_VERSION"
+fi
+AC_SUBST(NP_RELEASE)
+
+dnl Checks for programs.
+AC_PATH_PROG(PERL,perl)
+AC_PATH_PROG(HOSTNAME,hostname)
+AC_PATH_PROG(BASENAME,basename)
+
+dnl allow them to override the path of perl
+AC_ARG_WITH(perl,
+ ACX_HELP_STRING([--with-perl=PATH],
+ [sets path to perl executable]),
+ with_perl=$withval,with_perl=$PERL)
+AC_SUBST(PERL, $with_perl)
+
+dnl openssl/gnutls
+AC_ARG_WITH(openssl,
+ AC_HELP_STRING([--with-openssl=DIR],
+ [path to openssl installation]),)
+
+AC_ARG_WITH(gnutls,
+ ACX_HELP_STRING([--with-gnutls=PATH],
+ [path to gnutls installation root]),)
+
+dnl you can only have one or the other
+if test ! "$with_openssl" = "" && test ! "$with_openssl" = "no"; then
+ with_gnutls="no"
+fi
+if test ! "$with_gnutls" = "" && test ! "$with_gnutls" = "no"; then
+ with_openssl="no"
+fi
+
+dnl list of possible dirs to try to autodetect openssl
+dnl if $dir/include exists, we consider it found
+dnl the order should allow locally installed versions to override distros' ones
+OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl \
+ /opt /opt/openssl"
+
+
+dnl
+dnl Checks for libraries.
+dnl
+
+AC_CHECK_LIB(dce,main,SOCKETLIBS="$SOCKETLIBS -ldce")
+AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
+AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
+AC_CHECK_LIB(resolv,main,SOCKETLIBS="$SOCKETLIBS -lresolv")
+AC_SUBST(SOCKETLIBS)
+
+dnl
+dnl check for math-related functions needing -lm
+AC_CHECK_HEADERS(math.h)
+AC_CHECK_LIB(m,floor,MATHLIBS="-lm")
+AC_CHECK_HEADERS(mp.h)
+AC_CHECK_LIB(bsd,pow,MATHLIBS="$MATHLIBS -lbsd")
+AC_SUBST(MATHLIBS)
+
+dnl Check if we buils local libtap
+AC_ARG_ENABLE(libtap,
+ AC_HELP_STRING([--enable-libtap],
+ [Enable built-in libtap for unit-testing (default: autodetect system library).]),
+ [enable_libtap=$enableval],
+ [enable_libtap=no])
+AM_CONDITIONAL([USE_LIBTAP_LOCAL],[test "$enable_libtap" = "yes"])
+
+# If not local, check if we can use the system one
+if test "$enable_libtap" != "yes" ; then
+ dnl Check for libtap, to run perl-like tests
+ AC_CHECK_LIB(tap, plan_tests,
+ enable_libtap="yes"
+ )
+fi
+
+# Finally, define tests if we use libtap
+if test "$enable_libtap" = "yes" ; then
+ EXTRA_TEST="test_utils test_disk test_tcp test_cmd test_base64"
+ AC_SUBST(EXTRA_TEST)
+fi
+
+dnl INI Parsing
+AC_ARG_ENABLE(extra-opts,
+ AC_HELP_STRING([--enable-extra-opts],
+ [Enables parsing of plugins ini config files for extra options (default: no)]),
+ [enable_extra_opts=$enableval],
+ [enable_extra_opts=yes])
+AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
+if test "$enable_extra_opts" = "yes" ; then
+ AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
+ if test "$enable_libtap" = "yes"; then
+ EXTRA_TEST="$EXTRA_TEST test_ini1 test_ini3 test_opts1 test_opts2 test_opts3"
+ AC_SUBST(EXTRA_TEST)
+ fi
+fi
+
+dnl Check for PostgreSQL libraries
+_SAVEDLIBS="$LIBS"
+_SAVEDCPPFLAGS="$CPPFLAGS"
+AC_ARG_WITH(pgsql,
+ ACX_HELP_STRING([--with-pgsql=DIR],
+ [sets path to pgsql installation]),
+ PGSQL=$withval,)
+AC_CHECK_LIB(crypt,main)
+if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
+ if test -n "$PGSQL"; then
+ LDFLAGS="$LDFLAGS -L$PGSQL/lib"
+ CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
+ fi
+ AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
+ if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
+ AC_CHECK_HEADERS(pgsql/libpq-fe.h)
+ AC_CHECK_HEADERS(postgresql/libpq-fe.h)
+ AC_CHECK_HEADERS(libpq-fe.h)
+ if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
+ PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+ PGINCLUDE="-I$PGSQL/include"
+ elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
+ PGLIBS="-lpq -lcrypt"
+ PGINCLUDE="-I/usr/include/pgsql"
+ elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
+ PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+ PGINCLUDE="-I/usr/include/postgresql"
+ elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
+ PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+ PGINCLUDE="-I$PGSQL/include"
+ fi
+ if test -z "$PGINCLUDE"; then
+ AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+ AC_MSG_WARN([install PostgreSQL headers to compile this plugin (see REQUIREMENTS).])
+ else
+ AC_SUBST(PGLIBS)
+ AC_SUBST(PGINCLUDE)
+ EXTRAS="$EXTRAS check_pgsql\$(EXEEXT)"
+ fi
+ else
+ AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+ AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
+ AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
+ fi
+else
+ AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+ AC_MSG_WARN([install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
+fi
+LIBS="$_SAVEDLIBS"
+CPPFLAGS="$_SAVEDCPPFLAGS"
+
+AC_ARG_WITH([dbi], [AS_HELP_STRING([--without-dbi], [Skips the dbi plugin])])
+dnl Check for DBI libraries
+AS_IF([test "x$with_dbi" != "xno"], [
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(dbi,dbi_initialize)
+ if test "$ac_cv_lib_dbi_dbi_initialize" = "yes"; then
+ EXTRAS="$EXTRAS check_dbi\$(EXEEXT)"
+ DBILIBS="-ldbi"
+ AC_SUBST(DBILIBS)
+ else
+ AC_MSG_WARN([Skipping dbi plugin])
+ AC_MSG_WARN([install DBI libs to compile this plugin (see REQUIREMENTS).])
+ fi
+ LIBS="$_SAVEDLIBS"
+])
+
+AC_ARG_WITH([radius], [AS_HELP_STRING([--without-radius], [Skips the radius plugin])])
+
+dnl Check for radius libraries
+AS_IF([test "x$with_radius" != "xno"], [
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(radcli,rc_read_config)
+ if test "$ac_cv_lib_radcli_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lradcli"
+ AC_SUBST(RADIUSLIBS)
+ else
+ AC_CHECK_LIB(freeradius-client,rc_read_config)
+ if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lfreeradius-client"
+ AC_SUBST(RADIUSLIBS)
+ else
+ AC_CHECK_LIB(radiusclient-ng,rc_read_config)
+ if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lradiusclient-ng"
+ AC_SUBST(RADIUSLIBS)
+ else
+ AC_CHECK_LIB(radiusclient,rc_read_config)
+ if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
+ EXTRAS="$EXTRAS check_radius\$(EXEEXT)"
+ RADIUSLIBS="-lradiusclient"
+ AC_SUBST(RADIUSLIBS)
+ else
+ AC_MSG_WARN([Skipping radius plugin])
+ AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
+ fi
+ fi
+ fi
+ fi
+ LIBS="$_SAVEDLIBS"
+])
+
+AC_ARG_WITH([ldap], [AS_HELP_STRING([--without-ldap], [Skips the LDAP plugin])])
+
+dnl Check for LDAP libraries
+AS_IF([test "x$with_ldap" != "xno"], [
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(ldap,main,,,-llber)
+ if test "$ac_cv_lib_ldap_main" = "yes"; then
+ LDAPLIBS="-lldap -llber"\
+ LDAPINCLUDE="-I/usr/include/ldap"
+ AC_SUBST(LDAPLIBS)
+ AC_SUBST(LDAPINCLUDE)
+ AC_CHECK_FUNCS(ldap_set_option)
+ EXTRAS="$EXTRAS check_ldap\$(EXEEXT)"
+ AC_CHECK_FUNCS(ldap_init ldap_set_option ldap_get_option ldap_start_tls_s)
+ else
+ AC_MSG_WARN([Skipping LDAP plugin])
+ AC_MSG_WARN([install LDAP libs to compile this plugin (see REQUIREMENTS).])
+ fi
+ LIBS="$_SAVEDLIBS"
+])
+
+
+AC_ARG_WITH([systemd], [AS_HELP_STRING([--without-systemd], [Skips systemd support])])
+
+dnl Check for libsystemd
+AS_IF([test "x$with_systemd" != "xno"], [
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(systemd,sd_get_sessions,,,-lsystemd)
+ if test "$ac_cv_lib_systemd_sd_get_sessions" = "yes"; then
+ SYSTEMDLIBS="-lsystemd"
+ SYSTEMDINCLUDE=""
+ AC_SUBST(SYSTEMDLIBS)
+ AC_SUBST(SYSTEMDINCLUDE)
+ else
+ AC_MSG_WARN([Skipping systemd support])
+ fi
+ LIBS="$_SAVEDLIBS"
+])
+
+
+dnl Check for headers used by check_ide_smart
+case $host in
+ *linux*)
+ AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
+ AC_MSG_WARN([Skipping check_ide_smart plugin.])
+ AC_MSG_WARN([check_ide_smart requires linux/hdreg.h and linux/types.h.])
+ fi
+ ;;
+ *netbsd*)
+ AC_CHECK_HEADER(dev/ata/atareg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ if test "$FOUNDINCLUDE" = "yes" ; then
+ AC_CHECK_HEADER(dev/ic/wdcreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
+ fi
+ if test "$FOUNDINCLUDE" = "no" ; then
+ AC_MSG_WARN([Skipping check_ide_smart plugin.])
+ AC_MSG_WARN([check_ide_smart requires dev/ata/atareg.h and dev/ic/wdcreg.h])
+ fi
+ ;;
+ *)
+ AC_MSG_WARN([Skipping check_ide_smart plugin.])
+ AC_MSG_WARN([check_ide_smart works only on Linux and NetBSD])
+esac
+
+if test "$FOUNDINCLUDE" = "yes" ; then
+ EXTRAS="$EXTRAS check_ide_smart\$(EXEEXT)"
+fi
+
+dnl Check for mysql libraries
+np_mysqlclient
+if test $with_mysql = "no" ; then
+ AC_MSG_WARN([Skipping mysql plugin])
+ AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
+else
+ EXTRAS="$EXTRAS check_mysql\$(EXEEXT) check_mysql_query\$(EXEEXT)"
+ MYSQLINCLUDE="$np_mysql_include"
+ MYSQLLIBS="$np_mysql_libs"
+ MYSQLCFLAGS="$np_mysql_cflags"
+ AC_SUBST(MYSQLINCLUDE)
+ AC_SUBST(MYSQLLIBS)
+ AC_SUBST(MYSQLCFLAGS)
+fi
+
+dnl Check for headers used by check_users
+AC_CHECK_HEADERS(utmpx.h)
+AM_CONDITIONAL([HAVE_UTMPX], [test "$ac_cv_header_utmpx_h" = "yes"])
+
+AC_CHECK_HEADERS(wtsapi32.h, [], [], [#include <windows.h>])
+AM_CONDITIONAL([HAVE_WTS32API], [test "$ac_cv_header_wtsapi32_h" = "yes"])
+
+if test "$ac_cv_header_wtsapi32_h" = "yes"; then
+ WTSAPI32LIBS="-lwtsapi32"
+ AC_SUBST(WTSAPI32LIBS)
+fi
+
+_can_enable_check_curl=no
+dnl Check for cURL library
+LIBCURL_CHECK_CONFIG(yes, 7.15.2, [
+ _can_enable_check_curl=yes
+ LIBCURLINCLUDE="$LIBCURL_CPPFLAGS"
+ LIBCURLLIBS="$LIBCURL"
+ LIBCURLCFLAGS="$LIBCURL_CPPFLAGS"
+ AC_SUBST(LIBCURLINCLUDE)
+ AC_SUBST(LIBCURLLIBS)
+ AC_SUBST(LIBCURLCFLAGS)
+ ], [
+ _can_enable_check_curl=no
+ AC_MSG_WARN([Skipping curl plugin])
+ AC_MSG_WARN([install libcurl libs to compile this plugin (see REQUIREMENTS).])
+])
+
+dnl Check for uriparser library
+URIPARSER_CHECK(yes, 0.7.5, [
+ URIPARSERINCLUDE="$URIPARSER_CPPFLAGS"
+ URIPARSERLIBS="$URIPARSER"
+ URIPARSERCFLAGS="$URIPARSER_CPPFLAGS"
+ AC_SUBST(URIPARSERINCLUDE)
+ AC_SUBST(URIPARSERLIBS)
+ AC_SUBST(URIPARSERCFLAGS)
+ ], [
+ _can_enable_check_curl=no
+ AC_MSG_WARN([Skipping curl plugin])
+ AC_MSG_WARN([install the uriparser library to compile this plugin (see REQUIREMENTS).])
+])
+
+dnl prerequisites met, enable the plugin
+if test x$_can_enable_check_curl = xyes; then
+ EXTRAS="$EXTRAS check_curl\$(EXEEXT)"
+fi
+AC_CONFIG_FILES([plugins/picohttpparser/Makefile])
+
+dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface
+if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no"
+then
+ AC_PATH_PROG(PATH_TO_WHO,who)
+
+ if [$PATH_TO_WHO -q 2>/dev/null | grep -E -i "^# users=[0-9]+$" >/dev/null]
+ then
+ ac_cv_path_to_who="$PATH_TO_WHO -q"
+ else
+ ac_cv_path_to_who="$PATH_TO_WHO"
+ fi
+
+ AC_DEFINE_UNQUOTED(WHO_COMMAND,"$ac_cv_path_to_who",
+ [path and arguments for invoking 'who'])
+fi
+
+AC_ARG_WITH([ipv6],
+ [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
+ [], [with_ipv6=check])
+
+dnl Check for AF_INET6 support - unistd.h required for Darwin
+if test "$with_ipv6" != "no"; then
+ AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
+ AC_TRY_COMPILE(
+ [#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ #include <netinet/in.h>
+ #include <sys/socket.h>],
+ [struct sockaddr_in6 sin6;
+ void *p;
+
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = 587;
+ p = &sin6.sin6_addr;],
+ [np_cv_sys_ipv6=yes],
+ [np_cv_sys_ipv6=no])
+ ])
+ if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
+ AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
+ fi
+ if test "$np_cv_sys_ipv6" = "yes"; then
+ AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
+ fi
+ with_ipv6="$np_cv_sys_ipv6"
+fi
+
+
+dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3
+AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
+if test "$FOUNDINCLUDE" = "no"; then
+ _SAVEDCPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$_SAVEDCPPFLAGS -I/usr/kerberos/include"
+ unset ac_cv_header_krb5_h
+ AC_CHECK_HEADERS(krb5.h,
+ KRB5INCLUDE="-I/usr/kerberos/include"
+ FOUNDINCLUDE=yes,
+ FOUNDINCLUDE=no)
+fi
+AC_SUBST(KRBINCLUDE)
+if test "$FOUNDINCLUDE" = "no"; then
+ CPPFLAGS="$_SAVEDCPPFLAGS"
+fi
+
+dnl *** The following block comes from wget configure.ac ***
+dnl Unfortunately, as of this writing (OpenSSL 0.9.6), the libcrypto
+dnl shared library doesn't record its dependency on libdl, so we
+dnl need to check for it ourselves so we won't fail to link due to a
+dnl lack of -ldl. Most OSes use dlopen(), but HP-UX uses
+dnl shl_load().
+AC_CHECK_LIB(dl,dlopen)
+AC_CHECK_LIB(dl,shl_load)
+
+dnl openssl detection/configuration
+if ! test x"$with_openssl" = x"no"; then
+ dnl Check for OpenSSL location if it wasn't already specified
+ if ! test -d "$with_openssl"; then
+ for d in $OPENSSL_DIRS; do
+ if test -x ${d}/bin/openssl || test -x ${d}/sbin/openssl ; then
+ with_openssl=$d
+ fi
+ done
+ fi
+
+ _SAVEDCPPFLAGS="$CPPFLAGS"
+ _SAVEDLDFLAGS="$LDFLAGS"
+ dnl Check for OpenSSL header files
+ unset FOUNDINCLUDE
+ if test x"$with_openssl" != x"/usr" ; then
+ CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
+ LDFLAGS="$LDFLAGS -L$with_openssl/lib"
+ fi
+
+ dnl check for openssl in $dir/include/openssl
+ AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h,
+ SSLINCLUDE="-I$with_openssl/include"
+ FOUNDINCLUDE=yes,
+ FOUNDINCLUDE=no)
+ dnl else check to see if $dir/include has it
+ if test "$FOUNDINCLUDE" = "no"; then
+ AC_CHECK_HEADERS(ssl.h x509.h rsa.h pem.h crypto.h err.h,
+ SSLINCLUDE="-I$with_openssl/include"
+ FOUNDINCLUDE=yes,
+ FOUNDINCLUDE=no)
+ fi
+ AC_SUBST(SSLINCLUDE)
+ dnl if we didn't find it, reset CPPFLAGS
+ if test "$FOUNDINCLUDE" = "no"; then
+ CPPFLAGS="$_SAVEDCPPFLAGS"
+ LDFLAGS="$_SAVEDLDFLAGS"
+ fi
+
+ dnl Check for crypto lib
+ _SAVEDLIBS="$LIBS"
+ LIBS="-L${with_openssl}/lib"
+ AC_CHECK_LIB(crypto,CRYPTO_new_ex_data)
+ if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
+ dnl Check for SSL lib
+ AC_CHECK_LIB(ssl,main, SSLLIBS="-lssl -lcrypto",,-lcrypto)
+ fi
+ LIBS="$_SAVEDLIBS"
+
+ dnl test headers and libs to decide whether check_http should use SSL
+ if test "$ac_cv_lib_crypto_CRYPTO_new_ex_data" = "yes"; then
+ if test "$ac_cv_lib_ssl_main" = "yes"; then
+ if test "$FOUNDINCLUDE" = "yes"; then
+ FOUNDOPENSSL="yes"
+ fi
+ fi
+ fi
+fi
+
+
+dnl check for gnutls if openssl isn't found (or is disabled)
+if test ! "$FOUNDOPENSSL" = "yes" && test ! "$with_gnutls" = "no"; then
+ if test ! "$with_gnutls" = ""; then
+ CPPFLAGS="$CPPFLAGS -I${with_gnutls}/include"
+ fi
+ AC_CHECK_HEADERS([gnutls/openssl.h],FOUNDGNUTLS="yes",)
+ if test "$FOUNDGNUTLS" = "yes"; then
+ AC_CHECK_LIB(gnutls-openssl,main,SSLLIBS="-lgnutls-openssl")
+ fi
+fi
+dnl end check for gnutls
+
+if test "$FOUNDOPENSSL" = "yes" || test "$FOUNDGNUTLS" = "yes"; then
+ check_tcp_ssl="check_simap check_spop check_jabber check_nntps check_ssmtp"
+ AC_SUBST(check_tcp_ssl)
+ AC_SUBST(SSLLIBS)
+ AC_DEFINE(HAVE_SSL,1,[Define if SSL libraries are found])
+ if test "$FOUNDOPENSSL" = "yes"; then
+ AC_DEFINE(USE_OPENSSL,1,[Define if using OpenSSL libraries])
+ with_openssl="yes"
+ with_gnutls="no"
+ else
+ AC_DEFINE(USE_GNUTLS,1,[Define if using gnutls libraries])
+ with_gnutls="yes"
+ with_openssl="no"
+ fi
+else
+ dnl else deliberately disabled or no ssl support available
+ AC_MSG_WARN([OpenSSL or GnuTLS libs could not be found or were disabled])
+ with_openssl="no"
+ with_gnutls="no"
+fi
+
+dnl
+dnl Checks for header files.
+dnl
+
+AC_HEADER_TIME
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h)
+AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_STRUCT_TM
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+
+AC_CACHE_CHECK([for va_copy],ac_cv_HAVE_VA_COPY,[
+AC_TRY_LINK([#include <stdarg.h>
+va_list ap1,ap2;], [va_copy(ap1,ap2);],
+ac_cv_HAVE_VA_COPY=yes,
+ac_cv_HAVE_VA_COPY=no)])
+if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then
+ AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
+else
+ AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE___VA_COPY,[
+ AC_TRY_LINK([#include <stdarg.h>
+ va_list ap1,ap2;], [__va_copy(ap1,ap2);],
+ ac_cv_HAVE___VA_COPY=yes,
+ ac_cv_HAVE___VA_COPY=no)])
+ if test x"$ac_cv_HAVE___VA_COPY" = x"yes"; then
+ AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
+ fi
+fi
+
+AC_TRY_COMPILE([#include <sys/time.h>],
+ [struct timeval *tv;
+ struct timezone *tz;],
+ AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
+ FOUND_STRUCT_TIMEVAL="yes")
+
+if test x"$FOUND_STRUCT_TIMEVAL" = x"yes"; then
+ AC_TRY_COMPILE([#include <sys/time.h>],
+ [struct timeval *tv;
+ struct timezone *tz;
+ gettimeofday(tv, tz);],
+ AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
+ AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed]))
+fi
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(memmove select socket strdup strstr strtol strtoul floor)
+AC_CHECK_FUNCS(poll)
+
+AC_MSG_CHECKING(return type of socket size)
+AC_TRY_COMPILE([#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>],
+ [int a = send(1, (const void *) buffer, (size_t *) 0, (int *) 0);],
+ ac_cv_socket_size_type=["size_t"]
+ AC_MSG_RESULT(size_t),
+ ac_cv_socket_size_type=["int"]
+ AC_MSG_RESULT(int))
+
+AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $ac_cv_socket_size_type ,
+ [Define type of socket size])
+
+
+dnl #### Process table test
+
+AC_PATH_PROG(PATH_TO_PS,ps)
+AC_PATH_PROG(PATH_TO_ENV,env)
+
+AC_MSG_CHECKING(for ps syntax)
+AC_ARG_WITH(ps_command,
+ ACX_HELP_STRING([--with-ps-command=PATH],
+ [Verbatim command to execute for ps]),
+ PS_COMMAND=$withval)
+AC_ARG_WITH(ps_format,
+ ACX_HELP_STRING([--with-ps-format=FORMAT],
+ [Format string for scanning ps output]),
+ PS_FORMAT=$withval)
+AC_ARG_WITH(ps_cols,
+ ACX_HELP_STRING([--with-ps-cols=NUM],
+ [Number of columns in ps command]),
+ PS_COLS=$withval)
+AC_ARG_WITH(ps_varlist,
+ ACX_HELP_STRING([--with-ps-varlist=LIST],
+ [Variable list for sscanf of 'ps' output]),
+ PS_VARLIST=$withval)
+
+if test -n "$PS_COMMAND" && test -n "$PS_FORMAT" && test -n "$PS_COLS" && test -n "$PS_VARLIST"; then
+ ac_cv_ps_command="$PS_COMMAND"
+ ac_cv_ps_format="$PS_FORMAT"
+ ac_cv_ps_varlist="$PS_VARLIST"
+ ac_cv_ps_cols="$PS_COLS"
+ AC_MSG_RESULT([(command-line) $ac_cv_ps_command])
+
+dnl Now using the pst3/kmem hack for solaris systems to avoid truncation
+elif test "$ac_cv_uname_s" = "SunOS"; then
+ #
+ # this is a very, very ugly hack, to hardcode the location for plugins
+ #
+ if test "$libexecdir" = '${exec_prefix}/libexec'; then
+ if test "$exec_prefix" = "NONE"; then
+ if test "$prefix" = "NONE"; then
+ pst3="$ac_default_prefix/libexec/pst3"
+ else
+ pst3="$prefix/libexec/pst3"
+ fi
+ else
+ pst3="$exec_prefix/libexec/pst3"
+ fi
+ else
+ pst3="$libexecdir/pst3"
+ fi
+ ac_cv_ps_command="$pst3"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([using monitoring-plugins internal ps command (pst3) for solaris])
+ if test `isainfo -b` = 64 ; then
+ pst3_use_64bit=1
+ AC_MSG_NOTICE([using 64bit pst3])
+ else
+ AC_MSG_NOTICE([using 32bit pst3])
+ fi
+ EXTRAS_ROOT="$EXTRAS_ROOT pst3\$(EXEEXT)"
+
+ if test "$pst3_use_64bit" = 1; then
+ dnl Test if we can actually compile code in 64bit
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ pst3_64bit_working=0
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([], [
+return sizeof(void*) == 8 ? 0 : 1;
+ ])
+ ],[
+ PST3CFLAGS="-m64"
+ AC_SUBST(PST3CFLAGS)
+ pst3_64bit_working=1
+ AC_MSG_NOTICE([using -m64 for 64bit code])
+ ],[
+ pst3_64bit_working=0
+ AC_MSG_NOTICE([compiler do not like -m64])
+ ])
+ CFLAGS=$old_cflags
+ if test "$pst3_64bit_working" = 0; then
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -xarch=v9"
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([], [
+return sizeof(void*) == 8 ? 0 : 1;
+ ])
+ ],[
+ PST3CFLAGS="-xarch=v9"
+ AC_SUBST(PST3CFLAGS)
+ pst3_64bit_working=1
+ AC_MSG_NOTICE([using -xarch=v9 for 64bit code])
+ ],[
+ pst3_64bit_working=0
+ AC_MSG_NOTICE([compiler do not like -xarch=v9])
+ ])
+ CFLAGS=$old_cflags
+ fi
+ if test "$pst3_64bit_working" = 0; then
+ old_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -xarch=amd64"
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([], [
+return sizeof(void*) == 8 ? 0 : 1;
+ ])
+ ],[
+ PST3CFLAGS="-xarch=amd64"
+ AC_SUBST(PST3CFLAGS)
+ pst3_64bit_working=1
+ AC_MSG_NOTICE([using -xarch=amd64 for 64bit code])
+ ],[
+ pst3_64bit_working=0
+ AC_MSG_NOTICE([compiler do not like -xarch=amd64])
+ ])
+ CFLAGS=$old_cflags
+ fi
+ if test "$pst3_64bit_working" = 0; then
+ AC_MSG_ERROR([I don't know how to build a 64-bit object!])
+ fi
+ fi
+
+dnl Removing this for the moment - Ton
+dnl Using /usr/ucb/ps on Solaris systems, to avoid truncation
+dnl Limitation that command name is not available
+dnl elif test "$ac_cv_uname_s" = "SunOS" && /usr/ucb/ps -alxwwn 2>/dev/null | \
+dnl grep -E -i ["^ *F +UID +PID +PPID +%C +PRI +NI +SZ +RSS +WCHAN +S +TT +TIME +COMMAND"] > /dev/null
+dnl then
+dnl ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procpcpu,&procvsz,&procrss,procstat,&pos]"
+dnl ac_cv_ps_command="/usr/ucb/ps -alxwwn"
+dnl ac_cv_ps_format=["%*s %d %d %d %d %*d %*d %d %d%*[ 0123456789abcdef]%[OSRZT]%*s %*s %n"]
+dnl ac_cv_ps_cols=8
+dnl AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl This one is the exact same test as the next one but includes etime
+elif ps axwo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
+ grep -E -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +ELAPSED +COMMAND"] > /dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu etime comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
+ ac_cv_ps_cols=10
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl Some gnu/linux systems (debian for one) don't like -axwo and need axwo.
+dnl so test for this first...
+elif ps axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS axwo 'stat uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
+dnl Should also work for FreeBSD 5.2.1 and 5.3
+dnl STAT UCOMM VSZ RSS USER PPID COMMAND
+elif ps -axwo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i ["^ *STAT +[UCOMAND]+ +VSZ +RSS +USER +UID +PID +PPID +COMMAND"] > /dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl Some *BSDs have different format for ps. This is mainly to catch FreeBSD 4.
+dnl Limitation: Only first 16 chars returned for ucomm field
+dnl Must come before ps -weo
+elif ps -axwo 'stat uid pid ppid vsz rss pcpu ucomm command' 2>/dev/null | \
+ grep -E -i ["^ *STAT +UID +PID +PPID +VSZ +RSS +%CPU +UCOMM +COMMAND"] > /dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid vsz rss pcpu ucomm command'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl STAT UCOMM VSZ RSS USER UID PPID COMMAND
+elif ps -weo 'stat comm vsz rss user uid pid ppid etime args' 2>/dev/null | \
+ grep -E -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[ID]+ +P[PID]+ +[ELAPSD]+ +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -weo 'stat uid pid ppid vsz rss pcpu etime comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %s %n"
+ ac_cv_ps_cols=10
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl FreeBSD
+elif ps waxco 'state command vsz rss uid user pid ppid' 2>/dev/null | \
+ grep -E -i ["^STAT +COMMAND +VSZ +RSS +UID +USER +PID +PPID"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS waxco 'state uid pid ppid vsz rss pcpu command command'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl BSD-like mode in RH 6.1
+elif ps waxno 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i ["^S +COMMAND +VSZ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS waxno 'state uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl SunOS 4.1.3:
+dnl F UID PID PPID CP PRI NI SZ RSS WCHAN STAT TT TIME COMMAND
+dnl Need the head -1 otherwise test will work because arguments are found
+elif ps -laxnwww 2>/dev/null | head -1 | \
+ grep -E -i ["^ *F(LAGS)? +UID +PID +PPID +CP +PRI +NI +(SZ)|(VSZ)|(SIZE) +RSS +WCHAN +STAT? +TTY? +TIME +COMMAND"] >/dev/null
+then
+ ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
+ ac_cv_ps_command="$PATH_TO_PS -laxnwww"
+ ac_cv_ps_format="%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl Debian Linux / procps v1.2.9:
+dnl FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
+dnl 100 0 1 0 0 0 776 76 c0131c8c S ffff 0:11 init [2]
+dnl
+elif ps laxnwww 2>/dev/null | \
+ grep -E -i ["^ *F(LAGS)? +UID +PID +PPID +PRI +NI +(VSZ)|(SIZE) +RSS +WCHAN +STAT? TTY +TIME +COMMAND"] >/dev/null
+then
+ ac_cv_ps_varlist="[&procuid,&procpid,&procppid,procstat,&procvsz,&procrss,&pos,procprog]"
+ ac_cv_ps_command="$PATH_TO_PS laxnwww"
+ ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl OpenBSD (needs to come early because -exo appears to work, but does not give all procs)
+elif ps -axo 'stat comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i ["^ *S[TAUES]* +[UCOMDNA]+ +[VSIZE]+ +R[S]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -axo 'stat uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl Tru64 - needs %*[ +<>] in PS_FORMAT.
+dnl Has /usr/bin/ps and /sbin/ps - force sbin version
+dnl Can't use vsize and rssize because comes back with text (eg, 1.5M instead
+dnl of 1500). Will need big changes to check_procs to support
+elif /sbin/ps -eo 'stat uid pid ppid pcpu etime comm args' 2>/dev/null | \
+ grep -E -i ["^ *S +[UID]+ +[PID]+ +[PID]+ +[%CPU]+ +[ELAPSD]+ +[COMMAND]+ +[COMMAND]+"] > /dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procpcpu,procetime,procprog,&pos]"
+ ac_cv_ps_command="/sbin/ps -eo 'stat uid pid ppid pcpu etime comm args'"
+ ac_cv_ps_format=["%s%*[ +<>] %d %d %d %f %s %s %n"]
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+elif ps -eo 's comm vsz rss user uid pid ppid args' 2>/dev/null | \
+ grep -E -i ["^S[TAUES]* +C[OMDNA]+ +[VSIZE]+ +U[SER]+ +U[ID]+ +P[PID]+ +P[PID]+ +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -eo 's uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl AIX 4.3.3 and 5.1 do not have an rss field
+elif ps -eo 'stat uid pid ppid vsz pcpu comm args' 2>/dev/null | \
+ grep -E -i ["^ *S[TAUES]* +UID +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -eo 'stat uid pid ppid vsz pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command - with no RSS])
+
+dnl Solaris 2.6
+elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'"
+ # There must be no space between the %s and %n due to a weird problem in sscanf where
+ # it will return %n as longer than the line length
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s%n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+elif ps -Ao 'status comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -Ao 'status uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+elif ps -Ao 'state comm vsz rss uid user pid ppid args' 2>/dev/null | \
+ grep -E -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -Ao 'state uid pid ppid vsz rss pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=9
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl wonder who takes state instead of stat
+elif ps -ao 'state command vsz rss user pid ppid args' 2>/dev/null | \
+ grep -E -i ["^S[TAUES]* +C[OMDNA]+ +V[SIZE]+ +RSS +UID +USER +PID +PPID +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_PS -ao 'state uid pid ppid vsz rss pcpu command args'"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl IRIX 53
+elif ps -el 2>/dev/null | \
+ grep -E -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&pos,procprog]"
+ ac_cv_ps_command="$PATH_TO_PS -el (IRIX 53)"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %d %d %*s %*s %*s %n%s"
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl IRIX 63
+elif ps -el 2>/dev/null | \
+ grep -E -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +P +ADDR +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
+ ac_cv_ps_command="$PATH_TO_PS -el (IRIX 63)"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
+ ac_cv_ps_cols=6
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl HP-UX:
+dnl S UID RUID USER RUSER PID PPID VSZ %CPU COMMAND COMMAND
+dnl S 0 400 root oracle 2805 1 12904 0.00 ora_dism_SEA1X ora_dism_SEA1X
+dnl S 400 400 oracle oracle 19261 1 126488 0.00 tnslsnr /u01/app/oracle/product/db/11.2.0.3/bin/tnslsnr LISTENER -inherit
+elif env UNIX95=1 ps -eo 'state uid ruid user ruser pid ppid vsz pcpu comm args' 2>/dev/null | head -n 1 | \
+ grep -E -i ["^ *S +UID +RUID +USER +RUSER +PID +PPID +VSZ +%CPU +COMMAND +COMMAND"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procpcpu,procprog,&pos]"
+ ac_cv_ps_command="$PATH_TO_ENV UNIX95=1 $PATH_TO_PS -eo 'state uid pid ppid vsz pcpu comm args'"
+ ac_cv_ps_format="%s %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl AIX 4.1:
+dnl F S UID PID PPID C PRI NI ADDR SZ RSS WCHAN TTY TIME CMD
+dnl 303 A 0 0 0 120 16 -- 1c07 20 24 - 0:45 swapper
+elif ps -el 2>/dev/null | \
+ grep -E -i ["^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
+ ac_cv_ps_command="$PATH_TO_PS -el (AIX 4.1 and HP-UX)"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
+ ac_cv_ps_cols=6
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl AIX?
+elif ps glaxen 2>/dev/null | \
+ grep -E -i ["^ *F +UID +PID +PPID +PRI +NI +VSZ +RSS +WCHAN +STAT +TTY +TIME +COMMAND"] >/dev/null
+then
+ ac_cv_ps_varlist="[&procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog]"
+ ac_cv_ps_command="$PATH_TO_PS glaxen"
+ ac_cv_ps_format="%*s %d %d %d %*s %*s %d %d %*s %s %*s %*s %n%s"
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl MacOSX / Darwin
+dnl TODO: MacOSX has commands with spaces which will cause problems to PS_FORMAT
+dnl Some truncation will happen in UCOMM column
+dnl STAT VSZ RSS UID PPID %CPU UCOMM COMMAND
+dnl Ss 52756 22496 501 1 6.9 Window Manager /System/Library/CoreServices/WindowServer -daemon
+elif ps wwaxo 'state vsz rss uid pid ppid pcpu ucomm command' 2>/dev/null | \
+ grep -E -i ["^STAT +VSZ +RSS +UID +PPID +%CPU +UCOMM +COMMAND"] >/dev/null
+then
+ ac_cv_ps_command="$PATH_TO_PS wwaxo 'state vsz rss uid pid ppid pcpu ucomm command'"
+ ac_cv_ps_varlist="[procstat,&procvsz,&procrss,&procuid,&procpid,&procppid,&procpcpu,procprog,&pos]"
+ ac_cv_ps_format="%s %d %d %d %d %d %f %s %n"
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+dnl UnixWare
+elif ps -Al 2>/dev/null | \
+ grep -E -i ["^ *F +S +UID +PID +PPID +CLS +PRI +NI +C +ADDR +SZ +WCHAN +TTY +TIME +COMD"] >/dev/null
+then
+ ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&pos,procprog]"
+ ac_cv_ps_command="$PATH_TO_PS -Al"
+ ac_cv_ps_format="%*s %s %d %d %d %*s %*s %*s %*s %*s %*s %*s %*s %*s %n%s"
+ ac_cv_ps_cols=8
+ AC_MSG_RESULT([$ac_cv_ps_command])
+
+else
+ AC_MSG_WARN([unable to find usable ps syntax - check_procs and check_nagios will not be compiled])
+fi
+
+if test -n "$ac_cv_ps_varlist" ; then
+ AC_DEFINE_UNQUOTED(PS_VARLIST,$ac_cv_ps_varlist,
+ [Variable list for sscanf of 'ps' output])
+ AC_DEFINE_UNQUOTED(PS_COMMAND,"$ac_cv_ps_command",
+ [Verbatim command to execute for ps in check_procs])
+ AC_DEFINE_UNQUOTED(PS_FORMAT,"$ac_cv_ps_format",
+ [Format string for scanning ps output in check_procs])
+ AC_DEFINE_UNQUOTED(PS_COLS,$ac_cv_ps_cols,
+ [Number of columns in ps command])
+ EXTRAS="$EXTRAS check_procs check_nagios\$(EXEEXT)"
+ if echo "$ac_cv_ps_varlist" | grep "procetime" >/dev/null; then
+ AC_DEFINE(PS_USES_PROCETIME,"yes",
+ [Whether the ps utility uses the "procetime" field])
+ fi
+ if echo "$ac_cv_ps_varlist" | grep "procpcpu" >/dev/null; then
+ AC_DEFINE(PS_USES_PROCPCPU,"yes",
+ [Whether the ps utility uses the "procpcpu" field])
+ fi
+fi
+
+AC_PATH_PROG(PATH_TO_PING,ping)
+AC_PATH_PROG(PATH_TO_PING6,ping6)
+
+AC_ARG_WITH(ping_command,
+ ACX_HELP_STRING([--with-ping-command=SYNTAX],
+ [sets syntax for ICMP ping]),
+ with_ping_command=$withval,)
+
+AC_MSG_CHECKING(for ICMP ping syntax)
+ac_cv_ping_packets_first=no
+ac_cv_ping_has_timeout=no
+if test -n "$with_ping_command"
+then
+ AC_MSG_RESULT([(command-line) $with_ping_command])
+ if echo "$with_ping_command" | grep '%d.*%d.*%s' >/dev/null
+ then
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ elif echo "$with_ping_command" | grep '%d.*%s.*%d' >/dev/null || \
+ echo "$with_ping_command" | grep '%s.*%d.*%d' >/dev/null
+ then
+ ac_cv_ping_has_timeout=yes
+ elif echo "$with_ping_command" | grep '%d.*%s' >/dev/null
+ then
+ ac_cv_ping_packets_first=yes
+ fi
+
+elif [[ "z$ac_cv_uname_o" = "zCygwin" ]]
+then
+ with_ping_command="$PATH_TO_PING -n %d -w %d000 %s"
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
+ $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -U -c %d %s"
+ ac_cv_ping_packets_first=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -4 -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ # check if -4 is supported - issue #1550
+ with_ping_command="$PATH_TO_PING -4 -n -U -w %d -c %d %s"
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ AC_MSG_RESULT([$with_ping_command])
+elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
+ ac_cv_ping_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -U -c %d %s"
+ ac_cv_ping_packets_first=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -c %d %s"
+ ac_cv_ping_packets_first=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n %s -c %d"
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING %s -n %d"
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
+ ac_cv_ping_packets_first=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+then
+ with_ping_command="$PATH_TO_PING -n -c %d %s"
+ ac_cv_ping_packets_first=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+else
+ AC_MSG_WARN([unable to find usable ping syntax])
+fi
+
+AC_DEFINE_UNQUOTED(PING_COMMAND,"$with_ping_command",
+ [path and args for ICMP ping command])
+
+if test "x$ac_cv_ping_packets_first" != "xno"
+then
+ AC_DEFINE(PING_PACKETS_FIRST,1,
+ [Define if packet count must precede host])
+fi
+
+if test "x$ac_cv_ping_has_timeout" != "xno"
+then
+ AC_DEFINE(PING_HAS_TIMEOUT,1,
+ [Define if ping has its own timeout option that should be set])
+fi
+
+AC_ARG_WITH(ping6_command,
+ ACX_HELP_STRING([--with-ping6-command=SYNTAX],
+ [sets syntax for ICMPv6 ping]),
+ with_ping6_command=$withval,)
+
+if test x"$with_ipv6" != xno ; then
+AC_MSG_CHECKING(for ICMPv6 ping syntax)
+ac_cv_ping6_packets_first=no
+if test -n "$with_ping6_command"
+then
+ AC_MSG_RESULT([(command-line) $with_ping6_command])
+ if echo "$with_ping6_command" | grep '%d.*%d.*%s' >/dev/null
+ then
+ ac_cv_ping6_packets_first=yes
+ elif echo "$with_ping6_command" | grep '%d.*%s.*%d' >/dev/null || \
+ echo "$with_ping6_command" | grep '%s.*%d.*%d' >/dev/null
+ then
+ # Just keep same logic as ping (IPv4) if we ever need ac_cv_ping6_has_timeout
+ true
+ elif echo "$with_ping6_command" | grep '%d.*%s' >/dev/null
+ then
+ ac_cv_ping6_packets_first=yes
+ fi
+elif [[ "z$ac_cv_uname_o" = "zCygwin" -a "x$PATH_TO_PING" != "x" ]]; then
+ with_ping6_command="$PATH_TO_PING -6 -n %d -w %d000 %s"
+ ac_cv_ping6_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ AC_MSG_RESULT([$with_ping6_command])
+elif test "x$PATH_TO_PING6" != "x"; then
+ if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
+ $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 -n -U -w 10 -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -U -w %d -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ ac_cv_ping_has_timeout=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 -n -U -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 -n ::1 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n %s -c %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 ::1 -n 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 %s -n %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -s %s 56 %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -h %s -s 56 -c %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING6 -n -s 56 -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -s 56 -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+ elif $PATH_TO_PING6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ fi
+
+elif test "x$PATH_TO_PING" != "x"; then
+ if [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
+ $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING -A inet6 -n -U -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -U -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING -A inet6 -n ::1 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n %s -c %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING -A inet6 ::1 -n 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 %s -n %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING -A inet6 -n -s ::1 56 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -s %s 56 %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING -A inet6 -n -h ::1 -s 56 -c 1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -h %s -s 56 -c %d"
+ AC_MSG_RESULT([$with_ping6_command])
+
+ elif $PATH_TO_PING -A inet6 -n -s 56 -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -s 56 -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping_command])
+
+ elif $PATH_TO_PING -A inet6 -n -c 1 ::1 2>/dev/null | \
+ grep -E -i "^round-trip|^rtt" >/dev/null
+ then
+ with_ping6_command="$PATH_TO_PING -A inet6 -n -c %d %s"
+ ac_cv_ping6_packets_first=yes
+ AC_MSG_RESULT([$with_ping6_command])
+
+ fi
+
+fi
+
+if test "x$with_ping6_command" != "x"; then
+ AC_DEFINE_UNQUOTED(PING6_COMMAND,"$with_ping6_command",
+ [path and args for ICMPv6 ping command])
+else
+ AC_MSG_RESULT([none])
+fi
+
+if test "x$ac_cv_ping6_packets_first" != "xno"; then
+ AC_DEFINE(PING6_PACKETS_FIRST,1,
+ [Define if packet count must precede host])
+fi
+fi
+
+
+AC_ARG_WITH(nslookup_command,
+ ACX_HELP_STRING([--with-nslookup-command=PATH],
+ [sets path to nslookup executable]),
+ ac_cv_nslookup_command=$withval)
+if test -n "$ac_cv_nslookup_command"; then
+ AC_MSG_NOTICE([Using specific nslookup at $ac_cv_nslookup_command])
+else
+ AC_PATH_PROG(PATH_TO_NSLOOKUP,nslookup)
+ if test -n "$PATH_TO_NSLOOKUP"
+ then
+ AC_MSG_CHECKING(for nslookup syntax)
+ if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
+ then
+ ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
+ AC_MSG_RESULT([$ac_cv_nslookup_command])
+
+ else
+ ac_cv_nslookup_command="$PATH_TO_NSLOOKUP -sil"
+ AC_MSG_RESULT([$ac_cv_nslookup_command])
+
+ fi
+ else
+ AC_MSG_WARN([nslookup command not found])
+ fi
+fi
+
+if test -n "$ac_cv_nslookup_command"; then
+ EXTRAS="$EXTRAS check_dns\$(EXEEXT)"
+ AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
+fi
+
+AC_MSG_CHECKING([for number of online cpus])
+AC_TRY_COMPILE([#include <unistd.h>],
+ [sysconf(_SC_NPROCESSORS_ONLN) > 0;],
+ AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_ONLN,1,[Define if sysconf returns number of online cpus])
+ AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_ONLN)]),
+ AC_MSG_RESULT([cannot calculate])
+ )
+
+AC_MSG_CHECKING([for number of available cpus])
+AC_TRY_COMPILE([#include <unistd.h>],
+ [sysconf(_SC_NPROCESSORS_CONF) > 0;],
+ AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of available cpus])
+ AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
+ AC_MSG_RESULT([cannot calculate])
+ )
+
+AC_PATH_PROG(PATH_TO_UPTIME,uptime)
+AC_ARG_WITH(uptime_command,
+ ACX_HELP_STRING([--with-uptime-command=PATH],
+ [sets path to uptime]), PATH_TO_UPTIME=$withval)
+AC_DEFINE_UNQUOTED(PATH_TO_UPTIME,"$PATH_TO_UPTIME",[path to uptime binary])
+
+AC_PATH_PROG(PATH_TO_RPCINFO,rpcinfo)
+AC_ARG_WITH(rpcinfo_command,
+ ACX_HELP_STRING([--with-rpcinfo-command=PATH],
+ [sets path to rpcinfo]), PATH_TO_RPCINFO=$withval)
+AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO",[path to rpcinfo binary])
+
+AC_PATH_PROG(PATH_TO_LMSTAT,lmstat)
+if test -x "$PATH_TO_LMSTAT"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_LMSTAT,"$PATH_TO_LMSTAT",[path to lmstat])
+else
+ AC_MSG_WARN([Get lmstat from Globetrotter Software to monitor flexlm licenses])
+fi
+
+AC_PATH_PROG(PATH_TO_SMBCLIENT,smbclient)
+AC_ARG_WITH(smbclient_command,
+ ACX_HELP_STRING([--with-smbclient-command=PATH],
+ [sets path to smbclient]),
+ PATH_TO_SMBCLIENT=$withval)
+if test -n "$PATH_TO_SMBCLIENT"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_SMBCLIENT,"$PATH_TO_SMBCLIENT",[path to smbclient binary])
+else
+ AC_MSG_WARN([Get smbclient from Samba.org to monitor SMB shares])
+fi
+
+AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
+AC_ARG_WITH(snmpget_command,
+ ACX_HELP_STRING([--with-snmpget-command=PATH],
+ [Path to snmpget command]),
+ PATH_TO_SNMPGET=$withval)
+if test -n "$PATH_TO_SNMPGET"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_SNMPGET,"$PATH_TO_SNMPGET",[path to snmpget binary])
+ EXTRAS="$EXTRAS check_hpjd check_snmp\$(EXEEXT)"
+else
+ AC_MSG_WARN([Get snmpget from http://net-snmp.sourceforge.net to make check_hpjd and check_snmp plugins])
+fi
+
+AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext)
+AC_ARG_WITH(snmpgetnext_command,
+ ACX_HELP_STRING([--with-snmpgetnext-command=PATH],
+ [Path to snmpgetnext command]),
+ PATH_TO_SNMPGETNEXT=$withval)
+if test -n "$PATH_TO_SNMPGETNEXT"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT",[path to snmpgetnext binary])
+fi
+
+if ( $PERL -M"Net::SNMP 3.6" -e 'exit' 2>/dev/null )
+then
+ AC_MSG_CHECKING(for Net::SNMP perl module)
+ AC_MSG_RESULT([found])
+else
+ AC_MSG_WARN([Tried $PERL - install Net::SNMP perl module if you want to use the perl snmp plugins])
+fi
+
+AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
+AC_PATH_PROG(PATH_TO_QSTAT,qstat)
+AC_ARG_WITH(qstat_command,
+ ACX_HELP_STRING([--with-qstat-command=PATH],
+ [Path to qstat command]), PATH_TO_QSTAT=$withval)
+
+if test -x "$PATH_TO_QUAKESTAT"
+then
+ ac_cv_path_to_qstat="$PATH_TO_QUAKESTAT"
+ EXTRAS="$EXTRAS check_game\$(EXEEXT)"
+
+elif test -n "$PATH_TO_QSTAT"
+then
+ ac_cv_path_to_qstat="$PATH_TO_QSTAT"
+ EXTRAS="$EXTRAS check_game\$(EXEEXT)"
+else
+ AC_MSG_WARN([Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin])
+fi
+
+if test $ac_cv_path_to_qstat
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_QSTAT,"$ac_cv_path_to_qstat",
+ [path to qstat/quakestat])
+fi
+
+AC_PATH_PROG(PATH_TO_FPING,fping)
+AC_PATH_PROG(PATH_TO_FPING6,fping6)
+
+AC_ARG_WITH(fping_command,
+ ACX_HELP_STRING([--with-fping-command=PATH],
+ [Path to fping command]), PATH_TO_FPING=$withval)
+AC_ARG_WITH(fping6_command,
+ ACX_HELP_STRING([--with-fping6-command=PATH],
+ [Path to fping6 command]), PATH_TO_FPING6=$withval)
+
+if test -n "$PATH_TO_FPING"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_FPING,"$PATH_TO_FPING",[path to fping])
+ EXTRAS="$EXTRAS check_fping\$(EXEEXT)"
+ if test x"$with_ipv6" != xno && test -n "$PATH_TO_FPING6"; then
+ AC_DEFINE_UNQUOTED(PATH_TO_FPING6,"$PATH_TO_FPING6",[path to fping6])
+ fi
+else
+ AC_MSG_WARN([Get fping from http://www.fping.com in order to make check_fping plugin])
+fi
+
+AC_PATH_PROG(PATH_TO_SSH,ssh)
+AC_ARG_WITH(ssh_command,
+ ACX_HELP_STRING([--with-ssh-command=PATH],
+ [sets path for ssh]), PATH_TO_SSH=$withval)
+if test -n "$PATH_TO_SSH"
+then
+ AC_DEFINE_UNQUOTED(SSH_COMMAND,"$PATH_TO_SSH",[path to ssh binary])
+ EXTRAS="$EXTRAS check_by_ssh\$(EXEEXT)"
+else
+ AC_MSG_WARN([Get ssh in order to make check_by_ssh plugin])
+fi
+
+AC_PATH_PROG(PATH_TO_SUDO,sudo)
+AC_ARG_WITH(sudo_command,
+ ACX_HELP_STRING([--with-sudo-command=PATH],
+ [sets path to sudo]), PATH_TO_SUDO=$withval)
+if test -n "$PATH_TO_SUDO"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_SUDO,"$PATH_TO_SUDO",[path to sudo])
+else
+ AC_MSG_WARN([Could not find sudo or equivalent])
+fi
+
+AC_PATH_PROG(PATH_TO_MAILQ,mailq)
+AC_ARG_WITH(mailq_command,
+ ACX_HELP_STRING([--with-mailq-command=PATH],
+ [sets path to mailq]), PATH_TO_MAILQ=$withval)
+if test -n "$PATH_TO_MAILQ"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq])
+else
+ AC_MSG_WARN([Could not find mailq or equivalent])
+fi
+
+AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat)
+AC_ARG_WITH(qmail_qstat_command,
+ ACX_HELP_STRING([--with-qmail-qstat-command=PATH],
+ [sets path to qmail-qstat]), PATH_TO_QMAIL_QSTAT=$withval)
+if test -n "$PATH_TO_QMAIL_QSTAT"
+then
+ AC_DEFINE_UNQUOTED(PATH_TO_QMAIL_QSTAT,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat])
+else
+ AC_MSG_WARN([Could not find qmail-qstat or equivalent])
+fi
+
+dnl SWAP info required is amount allocated/available and amount free
+dnl The plugin works through all the swap devices and adds up the total swap
+dnl available.
+AC_PATH_PROG(PATH_TO_SWAP,swap)
+if (test -n "$PATH_TO_SWAP")
+then
+AC_MSG_CHECKING([for $PATH_TO_SWAP format])
+if [$PATH_TO_SWAP -l 2>&1 >/dev/null]
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_SWAP -l"
+ if [$PATH_TO_SWAP -l 2>/dev/null | \
+ grep -E -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \
+ >/dev/null]
+ then
+ ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %lu %lu"]
+ ac_cv_swap_conv=2048
+ AC_MSG_RESULT([using IRIX format swap])
+
+ elif [$PATH_TO_SWAP -l 2>/dev/null | grep -E -i "^path +dev +swaplo +blocks +free" >/dev/null]
+ then
+ ac_cv_swap_format=["%*s %*[0-9,-] %*d %lu %lu"]
+ ac_cv_swap_conv=2048
+ AC_MSG_RESULT([using Unixware format swap])
+ else
+ dnl if we don't know what format swap's output is
+ dnl we might as well pretend we didn't see it
+ ac_cv_have_swap=""
+ ac_cv_swap_command=""
+ fi
+fi
+dnl end if for PATH_TO_SWAP
+fi
+
+AC_PATH_PROG(PATH_TO_SWAPINFO,swapinfo)
+if (test -n "$PATH_TO_SWAPINFO")
+then
+AC_MSG_CHECKING([for $PATH_TO_SWAPINFO format])
+if [$PATH_TO_SWAPINFO -k 2>&1 | grep -E -i "^Device" >/dev/null]
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_SWAPINFO -k"
+
+ if [$PATH_TO_SWAPINFO -k 2>/dev/null | grep -E -i "^Device +1K-blocks +Used +Avail" >/dev/null]
+ then
+ ac_cv_swap_format=["%*s %lu %*d %lu"]
+ ac_cv_swap_conv=1024
+ AC_MSG_RESULT([using FreeBSD format swapinfo])
+ fi
+
+elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | grep -E -i "^TYPE +AVAIL +USED +FREE" >/dev/null]
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM"
+ ac_cv_swap_format=["%*s %lu %*d %lu"]
+ ac_cv_swap_conv=1024
+ AC_MSG_RESULT([using HP-UX format swapinfo])
+fi
+dnl end if for PATH_TO_SWAPINFO
+fi
+
+AC_PATH_PROG(PATH_TO_LSPS,lsps)
+if (test -n "$PATH_TO_LSPS")
+then
+AC_MSG_CHECKING([for $PATH_TO_LSPS format])
+if [$PATH_TO_LSPS -a 2>/dev/null | grep -E -i "^Page Space" > /dev/null]
+then
+ ac_cv_have_swap=yes
+ ac_cv_swap_command="$PATH_TO_LSPS -a"
+ ac_cv_swap_format=["%*s %*s %*s %lu%*s %lu %*s"]
+ ac_cv_swap_conv=1
+ AC_MSG_RESULT([using AIX lsps])
+fi
+dnl end if for PATH_TO_SWAPINFO
+fi
+
+dnl
+dnl test for swapctl system call, both the 2-arg and 3-arg variants
+dnl fwict, the 2-arg is an SVR4 standard, whereas the 3-arg is shared
+dnl in the various BSD's
+dnl
+
+AC_CHECK_HEADERS([sys/stat.h sys/param.h])
+AC_CHECK_HEADERS([sys/swap.h], [], [], [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+])
+AC_CHECK_DECLS([swapctl],,,[
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/swap.h>
+ ])
+AC_CHECK_TYPES([swaptbl_t, swapent_t],,,[
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/swap.h>
+ ])
+AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/swap.h>
+ ])
+
+if test "$ac_cv_have_decl_swapctl" = "yes";
+then
+ EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
+ AC_MSG_CHECKING([for 2-arg (SVR4) swapctl])
+ if test "$ac_cv_type_swaptbl_t" = "yes" -a \
+ "$ac_cv_type_swapent_t" = "yes";
+ then
+ AC_MSG_RESULT([yes])
+ ac_cv_check_swap_swapctl_svr4="1";
+ AC_DEFINE([CHECK_SWAP_SWAPCTL_SVR4],1,
+ [Define if 2-argument SVR4 swapctl exists])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for 3-arg (*BSD) swapctl])
+ if test "$ac_cv_member_struct_swapent_se_nblks" = "yes";
+ then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([CHECK_SWAP_SWAPCTL_BSD],1,
+ [Define if 3-argument BSD swapctl exists])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+ AC_MSG_CHECKING([for whether swapctl uses blocks or pages])
+ if test "$ac_cv_check_swap_swapctl_svr4" = "1";
+ then
+ dnl
+ dnl the SVR4 spec returns values in pages
+ dnl
+ AC_MSG_RESULT([page])
+ AC_CHECK_DECLS([sysconf])
+ AC_MSG_CHECKING([for system page size])
+ if test "$ac_cv_have_decl_sysconf" = "yes";
+ then
+ AC_MSG_RESULT([determined by sysconf(3)])
+ ac_cv_swap_conv="(1048576/sysconf(_SC_PAGESIZE))"
+ else
+ AC_MSG_WARN([don't know. guessing 4096k])
+ ac_cv_swap_conv=256
+ fi
+ else
+ dnl
+ dnl the BSD spec returns values in blocks
+ dnl
+ AC_MSG_RESULT([blocks (assuming 512b)])
+ ac_cv_swap_conv=2048
+ fi
+ AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
+ [Conversion factor to MB])
+fi
+dnl
+dnl end tests for the swapctl system calls
+dnl
+
+
+if test "x$ac_cv_have_swap" != "x"
+then
+ AC_DEFINE(HAVE_SWAP,1,[Define if swap/swapinfo command is found])
+ EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
+fi
+if test "x$ac_cv_swap_command" != "x"
+then
+ AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$ac_cv_swap_command",
+ [Path to swap/swapinfo binary, with any args])
+ AC_DEFINE_UNQUOTED(SWAP_FORMAT,"$ac_cv_swap_format",
+ [Format string for parsing swap output])
+ AC_DEFINE_UNQUOTED(SWAP_CONVERSION,$ac_cv_swap_conv,
+ [Conversion factor to MB])
+fi
+
+AC_ARG_WITH(proc-meminfo,
+ ACX_HELP_STRING([--with-proc-meminfo=PATH],
+ [path to /proc/meminfo or equivalent]),
+ ac_cv_proc_meminfo=$withval)
+dnl dunno why this does not work below - use hack (kbd)
+dnl fine on linux, broken on solaris
+dnl if /bin/test -e "/proc/meminfo"
+AC_MSG_CHECKING([for /proc/meminfo])
+if test -n "$ac_cv_proc_meminfo"; then
+ AC_MSG_RESULT([(command line) $ac_cv_proc_meminfo])
+elif [cat /proc/meminfo > /dev/null 2>&1]; then
+ AC_MSG_RESULT([found /proc/meminfo])
+ ac_cv_proc_meminfo="/proc/meminfo"
+else
+ AC_MSG_RESULT([no])
+fi
+
+if test -n "$ac_cv_proc_meminfo"; then
+ AC_DEFINE(HAVE_PROC_MEMINFO,1,[Define if we have /proc/meminfo])
+ AC_DEFINE_UNQUOTED(PROC_MEMINFO,"$ac_cv_proc_meminfo",[path to /proc/meminfo if name changes])
+ EXTRAS="$EXTRAS check_swap\$(EXEEXT)"
+fi
+
+AC_PATH_PROG(PATH_TO_DIG,dig)
+AC_ARG_WITH(dig_command,
+ ACX_HELP_STRING([--with-dig-command=PATH],
+ [Path to dig command]), PATH_TO_DIG=$withval)
+if test -n "$PATH_TO_DIG"; then
+ EXTRAS="$EXTRAS check_dig\$(EXEEXT)"
+ AC_DEFINE_UNQUOTED(PATH_TO_DIG,"$PATH_TO_DIG",[Path to dig command, if present])
+fi
+
+AC_PATH_PROG(PATH_TO_APTGET,apt-get)
+AC_ARG_WITH(apt-get_command,
+ ACX_HELP_STRING([--with-apt-get-command=PATH],
+ [Path to apt-get command]),
+ with_apt_get_command=$withval,
+ with_apt_get_command=$PATH_TO_APTGET)
+AC_DEFINE_UNQUOTED(PATH_TO_APTGET,"$PATH_TO_APTGET",[Path to apt-get command, if present])
+if test -n "$PATH_TO_APTGET" ; then
+ EXTRAS="$EXTRAS check_apt\$(EXEEXT)"
+fi
+
+
+if test -f $srcdir/plugins/check_nt.c ; then
+ EXTRAS="$EXTRAS check_nt\$(EXEEXT)"
+fi
+
+
+dnl used in check_dhcp
+AC_CHECK_HEADERS(sys/sockio.h)
+
+case $host in
+ *bsd*)
+ AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
+ ;;
+ *linux*)
+ AC_DEFINE(__linux__,1,[linux specific code in check_dhcp.c])
+ ;;
+ *sun* | *solaris*)
+ AC_DEFINE(__sun__,1,[sun specific code in check_dhcp.c])
+ ;;
+ *hpux*)
+ AC_DEFINE(__hpux__,1,[hpux specific code in check_dhcp.c])
+ ;;
+esac
+
+AC_SUBST(EXTRAS)
+AC_SUBST(EXTRAS_ROOT)
+AC_SUBST(EXTRA_NETOBJS)
+AC_SUBST(DEPLIBS)
+
+AM_GNU_GETTEXT([external], [need-ngettext])
+AM_GNU_GETTEXT_VERSION(0.15)
+
+dnl Check for Redhat spopen problem
+dnl Weird problem where ECHILD is returned from a wait call in error
+dnl Only appears to affect nslookup and dig calls. Only affects redhat around
+dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause
+dnl We patch plugins/popen.c
+dnl Need to add smp because uname different on those
+dnl Can force patch to be applied with --enable-redhat-pthread-workaround
+AC_ARG_ENABLE(redhat-pthread-workaround,
+ AC_HELP_STRING([--enable-redhat-pthread-workaround],
+ [force Redhat patch to be applied (default: test system)]),
+ [ac_cv_enable_redhat_pthread_workaround=$enableval],
+ [ac_cv_enable_redhat_pthread_workaround=test])
+if test "$ac_cv_enable_redhat_pthread_workaround" = "test" ; then
+ if echo $ac_cv_uname_r | grep -E "\.EL(smp)?$" >/dev/null 2>&1 ; then
+ AC_MSG_NOTICE([See https://www.monitoring-plugins.org/doc/faq/configure-hangs.html if this next part takes a long time])
+ AC_MSG_CHECKING(for redhat spopen problem)
+ ( cd config_test && make && make test ) > /dev/null 2>&1
+ if test $? -eq 0 ; then
+ AC_MSG_RESULT(okay)
+ else
+ AC_MSG_RESULT(error)
+ AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Workaround on redhat in spopen])
+ fi
+ fi
+elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
+ AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
+fi
+
+dnl Perl modules
+AC_ARG_ENABLE(perl-modules,
+ AC_HELP_STRING([--enable-perl-modules],
+ [Enables installation of Monitoring::Plugin and its dependencies (default: no)]),
+ [enable_perl_modules=$enableval],
+ [enable_perl_modules=no])
+if test "$enable_perl_modules" = "yes" ; then
+ AC_SUBST(PERLMODS_DIR,perlmods)
+fi
+
+# From Tap configure
+# Checks for libraries
+case "$host" in
+ *-*-*freebsd4*)
+ LDFLAGS="$LDFLAGS -pthread"
+ HAVE_LIBPTHREAD=1
+ ;;
+ *)
+ AC_CHECK_LIB(pthread, main)
+ ;;
+esac
+
+dnl External libraries - see ACKNOWLEDGEMENTS
+gl_INIT
+
+dnl Some helpful common compile errors checked here
+if test "$ac_cv_uname_s" = 'SunOS' -a \( "x$ac_cv_prog_ac_ct_AR" = "x" -o "$ac_cv_prog_ac_ct_AR" = 'false' \) ; then
+ AC_MSG_ERROR(No ar found for Solaris - is /usr/ccs/bin in PATH?)
+fi
+
+AC_OUTPUT(
+ Makefile
+ tap/Makefile
+ lib/Makefile
+ plugins/Makefile
+ lib/tests/Makefile
+ plugins-root/Makefile
+ plugins-scripts/Makefile
+ plugins-scripts/utils.pm
+ plugins-scripts/utils.sh
+ test.pl
+ pkg/solaris/pkginfo
+ po/Makefile.in
+)
+
+
+dnl the ones below that are commented out need to be cleaned up
+dnl in the configure code above to use with_foo instead of ac_cv_foo
+dnl if we want them to show up here. it'd also make the code cleaner.
+dnl i'll get to that on another rainy day :) -sf
+ACX_FEATURE([with],[apt-get-command])
+dnl ACX_FEATURE([with],[dig-command])
+dnl ACX_FEATURE([with],[fping-command])
+dnl ACX_FEATURE([with],[mailq-command])
+dnl ACX_FEATURE([with],[nslookup-command])
+ACX_FEATURE([with],[ping6-command])
+ACX_FEATURE([with],[ping-command])
+dnl ACX_FEATURE([with],[qstat-command])
+dnl ACX_FEATURE([with],[rpcinfo-command])
+dnl ACX_FEATURE([with],[smbclient-command])
+dnl ACX_FEATURE([with],[snmpget-command])
+dnl ACX_FEATURE([with],[snmpgetnext-command])
+dnl ACX_FEATURE([with],[ssh-command])
+dnl ACX_FEATURE([with],[uptime-command])
+
+dnl ACX_FEATURE([with],[proc-meminfo])
+dnl ACX_FEATURE([with],[ps-command])
+dnl ACX_FEATURE([with],[ps-format])
+dnl ACX_FEATURE([with],[ps-cols])
+dnl ACX_FEATURE([with],[ps-varlist])
+
+ACX_FEATURE([with],[ipv6])
+ACX_FEATURE([with],[mysql])
+ACX_FEATURE([with],[openssl])
+ACX_FEATURE([with],[gnutls])
+ACX_FEATURE([enable],[extra-opts])
+ACX_FEATURE([with],[perl])
+ACX_FEATURE([enable],[perl-modules])
+ACX_FEATURE([with],[cgiurl])
+ACX_FEATURE([with],[trusted-path])
+ACX_FEATURE([enable],[libtap])
+ACX_FEATURE([with],[libcurl])
+ACX_FEATURE([with],[uriparser])
diff --git a/gl/Makefile.am b/gl/Makefile.am
new file mode 100644
index 0000000..dcebd4a
--- /dev/null
+++ b/gl/Makefile.am
@@ -0,0 +1,3024 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
+## Process this file with automake to produce Makefile.in.
+# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+# Reproduce by:
+# gnulib-tool --import \
+# --lib=libgnu \
+# --source-base=gl \
+# --m4-base=gl/m4 \
+# --doc-base=doc \
+# --tests-base=tests \
+# --aux-dir=build-aux \
+# --no-conditional-dependencies \
+# --no-libtool \
+# --macro-prefix=gl \
+# --no-vc-files \
+# base64 \
+# crypto/sha256 \
+# dirname \
+# environ \
+# floorf \
+# fsusage \
+# getaddrinfo \
+# gethostname \
+# getloadavg \
+# getopt-gnu \
+# gettext-h \
+# idpriv-droptemp \
+# mountlist \
+# regex \
+# setenv \
+# strcase \
+# strcasestr \
+# strsep \
+# timegm \
+# unsetenv \
+# vasprintf \
+# vsnprintf
+
+AUTOMAKE_OPTIONS = 1.14 gnits subdir-objects
+
+SUBDIRS =
+noinst_HEADERS =
+noinst_LIBRARIES =
+noinst_LTLIBRARIES =
+EXTRA_DIST =
+BUILT_SOURCES =
+SUFFIXES =
+MOSTLYCLEANFILES = core *.stackdump
+MOSTLYCLEANDIRS =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+# No GNU Make output.
+EXTRA_DIST += m4/gnulib-cache.m4
+
+AM_CPPFLAGS =
+AM_CFLAGS =
+
+noinst_LIBRARIES += libgnu.a
+
+libgnu_a_SOURCES =
+libgnu_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
+libgnu_a_LIBADD = $(gl_LIBOBJS)
+libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
+EXTRA_libgnu_a_SOURCES =
+
+## begin gnulib module absolute-header
+
+# Use this preprocessor expression to decide whether #include_next works.
+# Do not rely on a 'configure'-time test for this, since the expression
+# might appear in an installed header, which is used by some other compiler.
+HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
+
+## end gnulib module absolute-header
+
+## begin gnulib module alloca-opt
+
+BUILT_SOURCES += $(ALLOCA_H)
+
+# We need the following in order to create <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ALLOCA_H
+alloca.h: alloca.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' \
+ $(srcdir)/alloca.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+alloca.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += alloca.h alloca.h-t
+
+EXTRA_DIST += alloca.in.h
+
+## end gnulib module alloca-opt
+
+## begin gnulib module arpa_inet
+
+BUILT_SOURCES += arpa/inet.h
+
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/arpa'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
+ -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
+ -e 's/@''GNULIB_INET_NTOP''@/$(GL_GNULIB_INET_NTOP)/g' \
+ -e 's/@''GNULIB_INET_PTON''@/$(GL_GNULIB_INET_PTON)/g' \
+ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+ -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
+ -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+ -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \
+ -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/arpa_inet.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
+MOSTLYCLEANDIRS += arpa
+
+EXTRA_DIST += arpa_inet.in.h
+
+## end gnulib module arpa_inet
+
+## begin gnulib module assert-h
+
+BUILT_SOURCES += $(ASSERT_H)
+
+# We need the following in order to create <assert.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ASSERT_H
+assert.h: assert.in.h verify.h $(top_builddir)/config.status
+ $(gl_V_at){ $(SED_HEADER_STDOUT) \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_ASSERT_H''@|$(NEXT_ASSERT_H)|g' \
+ < $(srcdir)/assert.in.h && \
+ sed -e '/@assert.h omit start@/,/@assert.h omit end@/d' \
+ -e 's|_gl_verify|_gl_static_assert|g' \
+ -e 's|_GL_VERIFY|_GL_STATIC_ASSERT|g' \
+ -e 's|_GL\(_STATIC_ASSERT_H\)|_GL\1|g' \
+ < $(srcdir)/verify.h; \
+ } > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+assert.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += assert.h assert.h-t
+
+EXTRA_DIST += assert.in.h verify.h
+
+## end gnulib module assert-h
+
+## begin gnulib module attribute
+
+
+EXTRA_DIST += attribute.h
+
+## end gnulib module attribute
+
+## begin gnulib module base64
+
+libgnu_a_SOURCES += base64.h base64.c
+
+## end gnulib module base64
+
+## begin gnulib module basename-lgpl
+
+libgnu_a_SOURCES += basename-lgpl.c
+
+EXTRA_DIST += basename-lgpl.h
+
+## end gnulib module basename-lgpl
+
+## begin gnulib module btowc
+
+if GL_COND_OBJ_BTOWC
+libgnu_a_SOURCES += btowc.c
+endif
+
+## end gnulib module btowc
+
+## begin gnulib module byteswap
+
+BUILT_SOURCES += $(BYTESWAP_H)
+
+# We need the following in order to create <byteswap.h> when the system
+# doesn't have one.
+if GL_GENERATE_BYTESWAP_H
+byteswap.h: byteswap.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/byteswap.in.h
+ $(AM_V_at)mv $@-t $@
+else
+byteswap.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += byteswap.h byteswap.h-t
+
+EXTRA_DIST += byteswap.in.h
+
+## end gnulib module byteswap
+
+## begin gnulib module calloc-gnu
+
+
+EXTRA_DIST += calloc.c
+
+EXTRA_libgnu_a_SOURCES += calloc.c
+
+## end gnulib module calloc-gnu
+
+## begin gnulib module calloc-posix
+
+
+EXTRA_DIST += calloc.c
+
+EXTRA_libgnu_a_SOURCES += calloc.c
+
+## end gnulib module calloc-posix
+
+## begin gnulib module cloexec
+
+libgnu_a_SOURCES += cloexec.c
+
+EXTRA_DIST += cloexec.h
+
+## end gnulib module cloexec
+
+## begin gnulib module close
+
+if GL_COND_OBJ_CLOSE
+libgnu_a_SOURCES += close.c
+endif
+
+## end gnulib module close
+
+## begin gnulib module crypto/af_alg
+
+libgnu_a_SOURCES += af_alg.c
+
+EXTRA_DIST += af_alg.h sys-limits.h
+
+## end gnulib module crypto/af_alg
+
+## begin gnulib module crypto/sha256
+
+libgnu_a_SOURCES += sha256-stream.c
+
+## end gnulib module crypto/sha256
+
+## begin gnulib module crypto/sha256-buffer
+
+libgnu_a_SOURCES += sha256.c
+
+EXTRA_DIST += gl_openssl.h sha256.h
+
+## end gnulib module crypto/sha256-buffer
+
+## begin gnulib module dirname
+
+libgnu_a_SOURCES += dirname.c basename.c
+
+EXTRA_DIST += stripslash.c
+
+EXTRA_libgnu_a_SOURCES += stripslash.c
+
+## end gnulib module dirname
+
+## begin gnulib module dirname-lgpl
+
+libgnu_a_SOURCES += dirname-lgpl.c stripslash.c
+
+EXTRA_DIST += dirname.h
+
+## end gnulib module dirname-lgpl
+
+## begin gnulib module dup2
+
+if GL_COND_OBJ_DUP2
+libgnu_a_SOURCES += dup2.c
+endif
+
+## end gnulib module dup2
+
+## begin gnulib module errno
+
+BUILT_SOURCES += $(ERRNO_H)
+
+# We need the following in order to create <errno.h> when the system
+# doesn't have one that is POSIX compliant.
+if GL_GENERATE_ERRNO_H
+errno.h: errno.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+ $(srcdir)/errno.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+errno.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += errno.h errno.h-t
+
+EXTRA_DIST += errno.in.h
+
+## end gnulib module errno
+
+## begin gnulib module error
+
+if GL_COND_OBJ_ERROR
+libgnu_a_SOURCES += error.c
+endif
+
+EXTRA_DIST += error.h
+
+## end gnulib module error
+
+## begin gnulib module exitfail
+
+libgnu_a_SOURCES += exitfail.c
+
+EXTRA_DIST += exitfail.h
+
+## end gnulib module exitfail
+
+## begin gnulib module fcntl
+
+if GL_COND_OBJ_FCNTL
+libgnu_a_SOURCES += fcntl.c
+endif
+
+## end gnulib module fcntl
+
+## begin gnulib module fcntl-h
+
+BUILT_SOURCES += fcntl.h
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_CREAT''@/$(GL_GNULIB_CREAT)/g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GL_GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GL_GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GL_GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GL_GNULIB_OPENAT)/g' \
+ -e 's/@''GNULIB_MDA_CREAT''@/$(GL_GNULIB_MDA_CREAT)/g' \
+ -e 's/@''GNULIB_MDA_OPEN''@/$(GL_GNULIB_MDA_OPEN)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/fcntl.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += fcntl.h fcntl.h-t
+
+EXTRA_DIST += fcntl.in.h
+
+## end gnulib module fcntl-h
+
+## begin gnulib module fd-hook
+
+libgnu_a_SOURCES += fd-hook.c
+
+EXTRA_DIST += fd-hook.h
+
+## end gnulib module fd-hook
+
+## begin gnulib module fflush
+
+if GL_COND_OBJ_FFLUSH
+libgnu_a_SOURCES += fflush.c
+endif
+
+EXTRA_DIST += stdio-impl.h
+
+## end gnulib module fflush
+
+## begin gnulib module filename
+
+
+EXTRA_DIST += filename.h
+
+## end gnulib module filename
+
+## begin gnulib module float
+
+BUILT_SOURCES += $(FLOAT_H)
+
+# We need the following in order to create <float.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_FLOAT_H
+float.h: float.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+ $(srcdir)/float.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+float.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += float.h float.h-t
+
+if GL_COND_OBJ_FLOAT
+libgnu_a_SOURCES += float.c
+endif
+if GL_COND_OBJ_ITOLD
+libgnu_a_SOURCES += itold.c
+endif
+
+EXTRA_DIST += float.in.h
+
+## end gnulib module float
+
+## begin gnulib module floorf
+
+if GL_COND_OBJ_FLOORF
+libgnu_a_SOURCES += floorf.c
+endif
+
+EXTRA_DIST += floor.c
+
+EXTRA_libgnu_a_SOURCES += floor.c
+
+## end gnulib module floorf
+
+## begin gnulib module fopen
+
+
+EXTRA_DIST += fopen.c
+
+EXTRA_libgnu_a_SOURCES += fopen.c
+
+## end gnulib module fopen
+
+## begin gnulib module fopen-gnu
+
+
+EXTRA_DIST += fopen.c
+
+EXTRA_libgnu_a_SOURCES += fopen.c
+
+## end gnulib module fopen-gnu
+
+## begin gnulib module fpurge
+
+if GL_COND_OBJ_FPURGE
+libgnu_a_SOURCES += fpurge.c
+endif
+
+EXTRA_DIST += stdio-impl.h
+
+## end gnulib module fpurge
+
+## begin gnulib module freading
+
+libgnu_a_SOURCES += freading.c
+
+EXTRA_DIST += freading.h stdio-impl.h
+
+## end gnulib module freading
+
+## begin gnulib module free-posix
+
+if GL_COND_OBJ_FREE
+libgnu_a_SOURCES += free.c
+endif
+
+## end gnulib module free-posix
+
+## begin gnulib module fseek
+
+if GL_COND_OBJ_FSEEK
+libgnu_a_SOURCES += fseek.c
+endif
+
+## end gnulib module fseek
+
+## begin gnulib module fseeko
+
+if GL_COND_OBJ_FSEEKO
+libgnu_a_SOURCES += fseeko.c
+endif
+
+EXTRA_DIST += stdio-impl.h
+
+## end gnulib module fseeko
+
+## begin gnulib module fstat
+
+if GL_COND_OBJ_FSTAT
+libgnu_a_SOURCES += fstat.c
+endif
+
+EXTRA_DIST += stat-w32.c stat-w32.h
+
+EXTRA_libgnu_a_SOURCES += stat-w32.c
+
+## end gnulib module fstat
+
+## begin gnulib module fsusage
+
+if GL_COND_OBJ_FSUSAGE
+libgnu_a_SOURCES += fsusage.c
+endif
+
+EXTRA_DIST += fsusage.h
+
+## end gnulib module fsusage
+
+## begin gnulib module ftell
+
+if GL_COND_OBJ_FTELL
+libgnu_a_SOURCES += ftell.c
+endif
+
+## end gnulib module ftell
+
+## begin gnulib module ftello
+
+if GL_COND_OBJ_FTELLO
+libgnu_a_SOURCES += ftello.c
+endif
+
+EXTRA_DIST += stdio-impl.h
+
+## end gnulib module ftello
+
+## begin gnulib module gen-header
+
+# In 'sed', replace the pattern space with a "DO NOT EDIT" comment.
+SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,
+
+# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT".
+SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G
+
+# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading
+# "DO_NOT_EDIT". Although this could be done more simply via:
+# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t
+# the -n and 'w' avoid a fork+exec, at least when GNU Make is used.
+SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
+
+# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
+gl_V_at = $(AM_V_GEN)
+
+## end gnulib module gen-header
+
+## begin gnulib module getaddrinfo
+
+if GL_COND_OBJ_GETADDRINFO
+libgnu_a_SOURCES += getaddrinfo.c
+endif
+if GL_COND_OBJ_GAI_STRERROR
+libgnu_a_SOURCES += gai_strerror.c
+endif
+
+## end gnulib module getaddrinfo
+
+## begin gnulib module getdelim
+
+if GL_COND_OBJ_GETDELIM
+libgnu_a_SOURCES += getdelim.c
+endif
+
+## end gnulib module getdelim
+
+## begin gnulib module getdtablesize
+
+if GL_COND_OBJ_GETDTABLESIZE
+libgnu_a_SOURCES += getdtablesize.c
+endif
+
+## end gnulib module getdtablesize
+
+## begin gnulib module gethostname
+
+if GL_COND_OBJ_GETHOSTNAME
+libgnu_a_SOURCES += gethostname.c
+endif
+
+EXTRA_DIST += w32sock.h
+
+## end gnulib module gethostname
+
+## begin gnulib module getline
+
+if GL_COND_OBJ_GETLINE
+libgnu_a_SOURCES += getline.c
+endif
+
+## end gnulib module getline
+
+## begin gnulib module getloadavg
+
+if GL_COND_OBJ_GETLOADAVG
+libgnu_a_SOURCES += getloadavg.c
+endif
+
+## end gnulib module getloadavg
+
+## begin gnulib module getopt-posix
+
+BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)
+
+# We need the following in order to create <getopt.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_GETOPT_H
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ $(srcdir)/getopt.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+getopt.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+
+if GL_GENERATE_GETOPT_CDEFS_H
+getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(SED_HEADER_STDOUT) \
+ -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+ $(srcdir)/getopt-cdefs.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+getopt-cdefs.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+
+MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
+
+if GL_COND_OBJ_GETOPT
+libgnu_a_SOURCES += getopt.c getopt1.c
+endif
+
+EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.in.h getopt_int.h
+
+## end gnulib module getopt-posix
+
+## begin gnulib module getprogname
+
+libgnu_a_SOURCES += getprogname.h getprogname.c
+
+## end gnulib module getprogname
+
+## begin gnulib module gettext-h
+
+libgnu_a_SOURCES += gettext.h
+
+## end gnulib module gettext-h
+
+## begin gnulib module glibc-internal/dynarray
+
+BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h
+
+malloc/dynarray.gl.h: malloc/dynarray.h
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/dynarray.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t
+
+malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
+ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
+ -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
+ -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ $(srcdir)/malloc/dynarray-skeleton.c > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t
+
+libgnu_a_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c
+
+EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h
+
+EXTRA_libgnu_a_SOURCES += malloc/dynarray-skeleton.c
+
+## end gnulib module glibc-internal/dynarray
+
+## begin gnulib module hard-locale
+
+libgnu_a_SOURCES += hard-locale.c
+
+EXTRA_DIST += hard-locale.h
+
+## end gnulib module hard-locale
+
+## begin gnulib module ialloc
+
+libgnu_a_SOURCES += ialloc.c
+
+EXTRA_DIST += ialloc.h
+
+## end gnulib module ialloc
+
+## begin gnulib module idpriv-droptemp
+
+libgnu_a_SOURCES += idpriv-droptemp.c
+
+EXTRA_DIST += idpriv.h
+
+## end gnulib module idpriv-droptemp
+
+## begin gnulib module idx
+
+libgnu_a_SOURCES += idx.h
+
+## end gnulib module idx
+
+## begin gnulib module inet_ntop
+
+if GL_COND_OBJ_INET_NTOP
+libgnu_a_SOURCES += inet_ntop.c
+endif
+
+## end gnulib module inet_ntop
+
+## begin gnulib module intprops
+
+
+EXTRA_DIST += intprops-internal.h intprops.h
+
+## end gnulib module intprops
+
+## begin gnulib module inttypes-incomplete
+
+BUILT_SOURCES += inttypes.h
+
+# We need the following in order to create <inttypes.h> when the system
+# doesn't have one that works with the given compiler.
+inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+ -e 's/@''GNULIB_IMAXABS''@/$(GL_GNULIB_IMAXABS)/g' \
+ -e 's/@''GNULIB_IMAXDIV''@/$(GL_GNULIB_IMAXDIV)/g' \
+ -e 's/@''GNULIB_STRTOIMAX''@/$(GL_GNULIB_STRTOIMAX)/g' \
+ -e 's/@''GNULIB_STRTOUMAX''@/$(GL_GNULIB_STRTOUMAX)/g' \
+ -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
+ -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
+ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
+ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+ -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+ -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
+ -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
+ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
+ -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
+ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
+ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/inttypes.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += inttypes.h inttypes.h-t
+
+EXTRA_DIST += inttypes.in.h
+
+## end gnulib module inttypes-incomplete
+
+## begin gnulib module langinfo
+
+BUILT_SOURCES += langinfo.h
+
+# We need the following in order to create an empty placeholder for
+# <langinfo.h> when the system doesn't have one.
+langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
+ -e 's/@''GNULIB_NL_LANGINFO''@/$(GL_GNULIB_NL_LANGINFO)/g' \
+ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
+ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \
+ -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \
+ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
+ -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \
+ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
+ -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/langinfo.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += langinfo.h langinfo.h-t
+
+EXTRA_DIST += langinfo.in.h
+
+## end gnulib module langinfo
+
+## begin gnulib module libc-config
+
+
+EXTRA_DIST += cdefs.h libc-config.h
+
+## end gnulib module libc-config
+
+## begin gnulib module limits-h
+
+BUILT_SOURCES += $(LIMITS_H)
+
+# We need the following in order to create <limits.h> when the system
+# doesn't have one that is compatible with GNU.
+if GL_GENERATE_LIMITS_H
+limits.h: limits.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
+ $(srcdir)/limits.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+limits.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += limits.h limits.h-t
+
+EXTRA_DIST += limits.in.h
+
+## end gnulib module limits-h
+
+## begin gnulib module localcharset
+
+libgnu_a_SOURCES += localcharset.c
+
+EXTRA_DIST += localcharset.h
+
+## end gnulib module localcharset
+
+## begin gnulib module locale
+
+BUILT_SOURCES += locale.h
+
+# We need the following in order to create <locale.h> when the system
+# doesn't have one that provides all definitions.
+locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
+ -e 's/@''GNULIB_LOCALECONV''@/$(GL_GNULIB_LOCALECONV)/g' \
+ -e 's/@''GNULIB_SETLOCALE''@/$(GL_GNULIB_SETLOCALE)/g' \
+ -e 's/@''GNULIB_SETLOCALE_NULL''@/$(GL_GNULIB_SETLOCALE_NULL)/g' \
+ -e 's/@''GNULIB_DUPLOCALE''@/$(GL_GNULIB_DUPLOCALE)/g' \
+ -e 's/@''GNULIB_LOCALENAME''@/$(GL_GNULIB_LOCALENAME)/g' \
+ -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \
+ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
+ -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \
+ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
+ -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \
+ -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \
+ -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \
+ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+ -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \
+ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \
+ -e 's|@''LOCALENAME_ENHANCE_LOCALE_FUNCS''@|$(LOCALENAME_ENHANCE_LOCALE_FUNCS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/locale.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += locale.h locale.h-t
+
+EXTRA_DIST += locale.in.h
+
+## end gnulib module locale
+
+## begin gnulib module localeconv
+
+if GL_COND_OBJ_LOCALECONV
+libgnu_a_SOURCES += localeconv.c
+endif
+
+## end gnulib module localeconv
+
+## begin gnulib module lock
+
+libgnu_a_SOURCES += glthread/lock.h glthread/lock.c
+
+## end gnulib module lock
+
+## begin gnulib module lseek
+
+if GL_COND_OBJ_LSEEK
+libgnu_a_SOURCES += lseek.c
+endif
+
+## end gnulib module lseek
+
+## begin gnulib module malloc-gnu
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libgnu_a_SOURCES += malloc.c
+
+## end gnulib module malloc-gnu
+
+## begin gnulib module malloc-posix
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libgnu_a_SOURCES += malloc.c
+
+## end gnulib module malloc-posix
+
+## begin gnulib module malloca
+
+libgnu_a_SOURCES += malloca.c
+
+EXTRA_DIST += malloca.h
+
+## end gnulib module malloca
+
+## begin gnulib module math
+
+BUILT_SOURCES += math.h
+libgnu_a_SOURCES += math.c
+
+# We need the following in order to create <math.h> when the system
+# doesn't have one that works with the given compiler.
+math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
+ -e 's/@''GNULIB_ACOSF''@/$(GL_GNULIB_ACOSF)/g' \
+ -e 's/@''GNULIB_ACOSL''@/$(GL_GNULIB_ACOSL)/g' \
+ -e 's/@''GNULIB_ASINF''@/$(GL_GNULIB_ASINF)/g' \
+ -e 's/@''GNULIB_ASINL''@/$(GL_GNULIB_ASINL)/g' \
+ -e 's/@''GNULIB_ATANF''@/$(GL_GNULIB_ATANF)/g' \
+ -e 's/@''GNULIB_ATANL''@/$(GL_GNULIB_ATANL)/g' \
+ -e 's/@''GNULIB_ATAN2F''@/$(GL_GNULIB_ATAN2F)/g' \
+ -e 's/@''GNULIB_CBRT''@/$(GL_GNULIB_CBRT)/g' \
+ -e 's/@''GNULIB_CBRTF''@/$(GL_GNULIB_CBRTF)/g' \
+ -e 's/@''GNULIB_CBRTL''@/$(GL_GNULIB_CBRTL)/g' \
+ -e 's/@''GNULIB_CEIL''@/$(GL_GNULIB_CEIL)/g' \
+ -e 's/@''GNULIB_CEILF''@/$(GL_GNULIB_CEILF)/g' \
+ -e 's/@''GNULIB_CEILL''@/$(GL_GNULIB_CEILL)/g' \
+ -e 's/@''GNULIB_COPYSIGN''@/$(GL_GNULIB_COPYSIGN)/g' \
+ -e 's/@''GNULIB_COPYSIGNF''@/$(GL_GNULIB_COPYSIGNF)/g' \
+ -e 's/@''GNULIB_COPYSIGNL''@/$(GL_GNULIB_COPYSIGNL)/g' \
+ -e 's/@''GNULIB_COSF''@/$(GL_GNULIB_COSF)/g' \
+ -e 's/@''GNULIB_COSL''@/$(GL_GNULIB_COSL)/g' \
+ -e 's/@''GNULIB_COSHF''@/$(GL_GNULIB_COSHF)/g' \
+ -e 's/@''GNULIB_EXPF''@/$(GL_GNULIB_EXPF)/g' \
+ -e 's/@''GNULIB_EXPL''@/$(GL_GNULIB_EXPL)/g' \
+ -e 's/@''GNULIB_EXP2''@/$(GL_GNULIB_EXP2)/g' \
+ -e 's/@''GNULIB_EXP2F''@/$(GL_GNULIB_EXP2F)/g' \
+ -e 's/@''GNULIB_EXP2L''@/$(GL_GNULIB_EXP2L)/g' \
+ -e 's/@''GNULIB_EXPM1''@/$(GL_GNULIB_EXPM1)/g' \
+ -e 's/@''GNULIB_EXPM1F''@/$(GL_GNULIB_EXPM1F)/g' \
+ -e 's/@''GNULIB_EXPM1L''@/$(GL_GNULIB_EXPM1L)/g' \
+ -e 's/@''GNULIB_FABSF''@/$(GL_GNULIB_FABSF)/g' \
+ -e 's/@''GNULIB_FABSL''@/$(GL_GNULIB_FABSL)/g' \
+ -e 's/@''GNULIB_FLOOR''@/$(GL_GNULIB_FLOOR)/g' \
+ -e 's/@''GNULIB_FLOORF''@/$(GL_GNULIB_FLOORF)/g' \
+ -e 's/@''GNULIB_FLOORL''@/$(GL_GNULIB_FLOORL)/g' \
+ -e 's/@''GNULIB_FMA''@/$(GL_GNULIB_FMA)/g' \
+ -e 's/@''GNULIB_FMAF''@/$(GL_GNULIB_FMAF)/g' \
+ -e 's/@''GNULIB_FMAL''@/$(GL_GNULIB_FMAL)/g' \
+ -e 's/@''GNULIB_FMOD''@/$(GL_GNULIB_FMOD)/g' \
+ -e 's/@''GNULIB_FMODF''@/$(GL_GNULIB_FMODF)/g' \
+ -e 's/@''GNULIB_FMODL''@/$(GL_GNULIB_FMODL)/g' \
+ -e 's/@''GNULIB_FREXPF''@/$(GL_GNULIB_FREXPF)/g' \
+ -e 's/@''GNULIB_FREXP''@/$(GL_GNULIB_FREXP)/g' \
+ -e 's/@''GNULIB_FREXPL''@/$(GL_GNULIB_FREXPL)/g' \
+ -e 's/@''GNULIB_HYPOT''@/$(GL_GNULIB_HYPOT)/g' \
+ -e 's/@''GNULIB_HYPOTF''@/$(GL_GNULIB_HYPOTF)/g' \
+ -e 's/@''GNULIB_HYPOTL''@/$(GL_GNULIB_HYPOTL)/g' \
+ < $(srcdir)/math.in.h | \
+ sed -e 's/@''GNULIB_ILOGB''@/$(GL_GNULIB_ILOGB)/g' \
+ -e 's/@''GNULIB_ILOGBF''@/$(GL_GNULIB_ILOGBF)/g' \
+ -e 's/@''GNULIB_ILOGBL''@/$(GL_GNULIB_ILOGBL)/g' \
+ -e 's/@''GNULIB_ISFINITE''@/$(GL_GNULIB_ISFINITE)/g' \
+ -e 's/@''GNULIB_ISINF''@/$(GL_GNULIB_ISINF)/g' \
+ -e 's/@''GNULIB_ISNAN''@/$(GL_GNULIB_ISNAN)/g' \
+ -e 's/@''GNULIB_ISNANF''@/$(GL_GNULIB_ISNANF)/g' \
+ -e 's/@''GNULIB_ISNAND''@/$(GL_GNULIB_ISNAND)/g' \
+ -e 's/@''GNULIB_ISNANL''@/$(GL_GNULIB_ISNANL)/g' \
+ -e 's/@''GNULIB_LDEXPF''@/$(GL_GNULIB_LDEXPF)/g' \
+ -e 's/@''GNULIB_LDEXPL''@/$(GL_GNULIB_LDEXPL)/g' \
+ -e 's/@''GNULIB_LOG''@/$(GL_GNULIB_LOG)/g' \
+ -e 's/@''GNULIB_LOGF''@/$(GL_GNULIB_LOGF)/g' \
+ -e 's/@''GNULIB_LOGL''@/$(GL_GNULIB_LOGL)/g' \
+ -e 's/@''GNULIB_LOG10''@/$(GL_GNULIB_LOG10)/g' \
+ -e 's/@''GNULIB_LOG10F''@/$(GL_GNULIB_LOG10F)/g' \
+ -e 's/@''GNULIB_LOG10L''@/$(GL_GNULIB_LOG10L)/g' \
+ -e 's/@''GNULIB_LOG1P''@/$(GL_GNULIB_LOG1P)/g' \
+ -e 's/@''GNULIB_LOG1PF''@/$(GL_GNULIB_LOG1PF)/g' \
+ -e 's/@''GNULIB_LOG1PL''@/$(GL_GNULIB_LOG1PL)/g' \
+ -e 's/@''GNULIB_LOG2''@/$(GL_GNULIB_LOG2)/g' \
+ -e 's/@''GNULIB_LOG2F''@/$(GL_GNULIB_LOG2F)/g' \
+ -e 's/@''GNULIB_LOG2L''@/$(GL_GNULIB_LOG2L)/g' \
+ -e 's/@''GNULIB_LOGB''@/$(GL_GNULIB_LOGB)/g' \
+ -e 's/@''GNULIB_LOGBF''@/$(GL_GNULIB_LOGBF)/g' \
+ -e 's/@''GNULIB_LOGBL''@/$(GL_GNULIB_LOGBL)/g' \
+ -e 's/@''GNULIB_MODF''@/$(GL_GNULIB_MODF)/g' \
+ -e 's/@''GNULIB_MODFF''@/$(GL_GNULIB_MODFF)/g' \
+ -e 's/@''GNULIB_MODFL''@/$(GL_GNULIB_MODFL)/g' \
+ -e 's/@''GNULIB_POWF''@/$(GL_GNULIB_POWF)/g' \
+ -e 's/@''GNULIB_REMAINDER''@/$(GL_GNULIB_REMAINDER)/g' \
+ -e 's/@''GNULIB_REMAINDERF''@/$(GL_GNULIB_REMAINDERF)/g' \
+ -e 's/@''GNULIB_REMAINDERL''@/$(GL_GNULIB_REMAINDERL)/g' \
+ -e 's/@''GNULIB_RINT''@/$(GL_GNULIB_RINT)/g' \
+ -e 's/@''GNULIB_RINTF''@/$(GL_GNULIB_RINTF)/g' \
+ -e 's/@''GNULIB_RINTL''@/$(GL_GNULIB_RINTL)/g' \
+ -e 's/@''GNULIB_ROUND''@/$(GL_GNULIB_ROUND)/g' \
+ -e 's/@''GNULIB_ROUNDF''@/$(GL_GNULIB_ROUNDF)/g' \
+ -e 's/@''GNULIB_ROUNDL''@/$(GL_GNULIB_ROUNDL)/g' \
+ -e 's/@''GNULIB_SIGNBIT''@/$(GL_GNULIB_SIGNBIT)/g' \
+ -e 's/@''GNULIB_SINF''@/$(GL_GNULIB_SINF)/g' \
+ -e 's/@''GNULIB_SINL''@/$(GL_GNULIB_SINL)/g' \
+ -e 's/@''GNULIB_SINHF''@/$(GL_GNULIB_SINHF)/g' \
+ -e 's/@''GNULIB_SQRTF''@/$(GL_GNULIB_SQRTF)/g' \
+ -e 's/@''GNULIB_SQRTL''@/$(GL_GNULIB_SQRTL)/g' \
+ -e 's/@''GNULIB_TANF''@/$(GL_GNULIB_TANF)/g' \
+ -e 's/@''GNULIB_TANL''@/$(GL_GNULIB_TANL)/g' \
+ -e 's/@''GNULIB_TANHF''@/$(GL_GNULIB_TANHF)/g' \
+ -e 's/@''GNULIB_TRUNC''@/$(GL_GNULIB_TRUNC)/g' \
+ -e 's/@''GNULIB_TRUNCF''@/$(GL_GNULIB_TRUNCF)/g' \
+ -e 's/@''GNULIB_TRUNCL''@/$(GL_GNULIB_TRUNCL)/g' \
+ -e 's/@''GNULIB_MDA_J0''@/$(GL_GNULIB_MDA_J0)/g' \
+ -e 's/@''GNULIB_MDA_J1''@/$(GL_GNULIB_MDA_J1)/g' \
+ -e 's/@''GNULIB_MDA_JN''@/$(GL_GNULIB_MDA_JN)/g' \
+ -e 's/@''GNULIB_MDA_Y0''@/$(GL_GNULIB_MDA_Y0)/g' \
+ -e 's/@''GNULIB_MDA_Y1''@/$(GL_GNULIB_MDA_Y1)/g' \
+ -e 's/@''GNULIB_MDA_YN''@/$(GL_GNULIB_MDA_YN)/g' \
+ | \
+ sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \
+ -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
+ -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \
+ -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
+ -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \
+ -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
+ -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \
+ -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \
+ -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \
+ -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \
+ -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \
+ -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \
+ -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \
+ -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
+ -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \
+ -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \
+ -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \
+ -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \
+ -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \
+ -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \
+ -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \
+ -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \
+ -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \
+ -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \
+ -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \
+ -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \
+ -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \
+ -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \
+ -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \
+ -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \
+ -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \
+ -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \
+ -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \
+ -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \
+ -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \
+ -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \
+ -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \
+ -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \
+ -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \
+ -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \
+ -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \
+ -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \
+ -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \
+ -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \
+ -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \
+ -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \
+ -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \
+ -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \
+ -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \
+ -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \
+ -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \
+ -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \
+ -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \
+ -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \
+ -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \
+ -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \
+ -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \
+ -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \
+ -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \
+ -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \
+ -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
+ -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
+ -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
+ -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \
+ -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \
+ -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \
+ -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \
+ -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \
+ -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \
+ -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \
+ -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \
+ -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \
+ -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \
+ -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \
+ -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \
+ -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \
+ -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
+ -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
+ -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
+ -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \
+ -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \
+ -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \
+ -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \
+ -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \
+ -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \
+ -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \
+ -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \
+ -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \
+ -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \
+ -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \
+ -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \
+ -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \
+ -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \
+ -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
+ -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
+ -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
+ | \
+ sed -e 's|@''REPLACE_ACOSF''@|$(REPLACE_ACOSF)|g' \
+ -e 's|@''REPLACE_ASINF''@|$(REPLACE_ASINF)|g' \
+ -e 's|@''REPLACE_ATANF''@|$(REPLACE_ATANF)|g' \
+ -e 's|@''REPLACE_ATAN2F''@|$(REPLACE_ATAN2F)|g' \
+ -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
+ -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \
+ -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
+ -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
+ -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
+ -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \
+ -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \
+ -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \
+ -e 's|@''REPLACE_EXPL''@|$(REPLACE_EXPL)|g' \
+ -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
+ -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
+ -e 's|@''REPLACE_EXPM1L''@|$(REPLACE_EXPM1L)|g' \
+ -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
+ -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
+ -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
+ -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \
+ -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
+ -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
+ -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \
+ -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \
+ -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \
+ -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \
+ -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \
+ -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \
+ -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \
+ -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
+ -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
+ -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \
+ -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \
+ -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \
+ -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
+ -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
+ -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
+ -e 's|@''REPLACE_ILOGBL''@|$(REPLACE_ILOGBL)|g' \
+ -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
+ -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
+ -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
+ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+ -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \
+ -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \
+ -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \
+ -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \
+ -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \
+ -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \
+ -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \
+ -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \
+ -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \
+ -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \
+ -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \
+ -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \
+ -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \
+ -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \
+ -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \
+ -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \
+ -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \
+ -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \
+ -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \
+ -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \
+ -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
+ -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
+ -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
+ -e 's|@''REPLACE_RINTL''@|$(REPLACE_RINTL)|g' \
+ -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
+ -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
+ -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
+ -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
+ -e 's|@''REPLACE_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \
+ -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \
+ -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \
+ -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \
+ -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \
+ -e 's|@''REPLACE_TANF''@|$(REPLACE_TANF)|g' \
+ -e 's|@''REPLACE_TANHF''@|$(REPLACE_TANHF)|g' \
+ -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
+ -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
+ -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += math.h math.h-t
+
+EXTRA_DIST += math.in.h
+
+## end gnulib module math
+
+## begin gnulib module mbrtowc
+
+if GL_COND_OBJ_MBRTOWC
+libgnu_a_SOURCES += mbrtowc.c
+endif
+
+EXTRA_DIST += lc-charset-dispatch.c lc-charset-dispatch.h mbrtowc-impl-utf8.h mbrtowc-impl.h mbtowc-lock.c mbtowc-lock.h windows-initguard.h
+
+EXTRA_libgnu_a_SOURCES += lc-charset-dispatch.c mbtowc-lock.c
+
+## end gnulib module mbrtowc
+
+## begin gnulib module mbsinit
+
+if GL_COND_OBJ_MBSINIT
+libgnu_a_SOURCES += mbsinit.c
+endif
+
+## end gnulib module mbsinit
+
+## begin gnulib module mbtowc
+
+if GL_COND_OBJ_MBTOWC
+libgnu_a_SOURCES += mbtowc.c
+endif
+
+EXTRA_DIST += mbtowc-impl.h
+
+## end gnulib module mbtowc
+
+## begin gnulib module memchr
+
+if GL_COND_OBJ_MEMCHR
+libgnu_a_SOURCES += memchr.c
+endif
+
+EXTRA_DIST += memchr.valgrind
+
+## end gnulib module memchr
+
+## begin gnulib module minmax
+
+libgnu_a_SOURCES += minmax.h
+
+## end gnulib module minmax
+
+## begin gnulib module mktime
+
+
+EXTRA_DIST += mktime-internal.h mktime.c
+
+EXTRA_libgnu_a_SOURCES += mktime.c
+
+## end gnulib module mktime
+
+## begin gnulib module mktime-internal
+
+
+EXTRA_DIST += mktime-internal.h mktime.c
+
+EXTRA_libgnu_a_SOURCES += mktime.c
+
+## end gnulib module mktime-internal
+
+## begin gnulib module mountlist
+
+if GL_COND_OBJ_MOUNTLIST
+libgnu_a_SOURCES += mountlist.c
+endif
+
+EXTRA_DIST += mountlist.h
+
+## end gnulib module mountlist
+
+## begin gnulib module msvc-inval
+
+if GL_COND_OBJ_MSVC_INVAL
+libgnu_a_SOURCES += msvc-inval.c
+endif
+
+EXTRA_DIST += msvc-inval.h
+
+## end gnulib module msvc-inval
+
+## begin gnulib module msvc-nothrow
+
+if GL_COND_OBJ_MSVC_NOTHROW
+libgnu_a_SOURCES += msvc-nothrow.c
+endif
+
+EXTRA_DIST += msvc-nothrow.h
+
+## end gnulib module msvc-nothrow
+
+## begin gnulib module netdb
+
+BUILT_SOURCES += netdb.h
+
+# We need the following in order to create <netdb.h> when the system
+# doesn't have one that works with the given compiler.
+netdb.h: netdb.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \
+ -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \
+ -e 's/@''GNULIB_GETADDRINFO''@/$(GL_GNULIB_GETADDRINFO)/g' \
+ -e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \
+ -e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \
+ -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
+ -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
+ -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
+ -e 's|@''REPLACE_GAI_STRERROR''@|$(REPLACE_GAI_STRERROR)|g' \
+ -e 's|@''REPLACE_GETADDRINFO''@|$(REPLACE_GETADDRINFO)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/netdb.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += netdb.h netdb.h-t
+
+EXTRA_DIST += netdb.in.h
+
+## end gnulib module netdb
+
+## begin gnulib module netinet_in
+
+BUILT_SOURCES += $(NETINET_IN_H)
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+if GL_GENERATE_NETINET_IN_H
+netinet/in.h: netinet_in.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/netinet'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+ $(srcdir)/netinet_in.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+netinet/in.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
+MOSTLYCLEANDIRS += netinet
+
+EXTRA_DIST += netinet_in.in.h
+
+## end gnulib module netinet_in
+
+## begin gnulib module nl_langinfo
+
+if GL_COND_OBJ_NL_LANGINFO
+libgnu_a_SOURCES += nl_langinfo.c
+endif
+if GL_COND_OBJ_NL_LANGINFO_LOCK
+libgnu_a_SOURCES += nl_langinfo-lock.c
+endif
+
+EXTRA_DIST += windows-initguard.h
+
+## end gnulib module nl_langinfo
+
+## begin gnulib module open
+
+if GL_COND_OBJ_OPEN
+libgnu_a_SOURCES += open.c
+endif
+
+## end gnulib module open
+
+## begin gnulib module pathmax
+
+
+EXTRA_DIST += pathmax.h
+
+## end gnulib module pathmax
+
+## begin gnulib module realloc-gnu
+
+
+EXTRA_DIST += realloc.c
+
+EXTRA_libgnu_a_SOURCES += realloc.c
+
+## end gnulib module realloc-gnu
+
+## begin gnulib module realloc-posix
+
+
+EXTRA_DIST += realloc.c
+
+EXTRA_libgnu_a_SOURCES += realloc.c
+
+## end gnulib module realloc-posix
+
+## begin gnulib module reallocarray
+
+if GL_COND_OBJ_REALLOCARRAY
+libgnu_a_SOURCES += reallocarray.c
+endif
+
+## end gnulib module reallocarray
+
+## begin gnulib module regex
+
+if GL_COND_OBJ_REGEX
+libgnu_a_SOURCES += regex.c
+endif
+
+EXTRA_DIST += regcomp.c regex.h regex_internal.c regex_internal.h regexec.c
+
+EXTRA_libgnu_a_SOURCES += regcomp.c regex_internal.c regexec.c
+
+## end gnulib module regex
+
+## begin gnulib module setenv
+
+if GL_COND_OBJ_SETENV
+libgnu_a_SOURCES += setenv.c
+endif
+
+## end gnulib module setenv
+
+## begin gnulib module setlocale-null
+
+libgnu_a_SOURCES += setlocale_null.c
+if GL_COND_OBJ_SETLOCALE_LOCK
+libgnu_a_SOURCES += setlocale-lock.c
+endif
+
+EXTRA_DIST += setlocale_null.h windows-initguard.h
+
+## end gnulib module setlocale-null
+
+## begin gnulib module size_max
+
+libgnu_a_SOURCES += size_max.h
+
+## end gnulib module size_max
+
+## begin gnulib module snippet/_Noreturn
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(srcdir)/_Noreturn.h
+
+EXTRA_DIST += _Noreturn.h
+
+## end gnulib module snippet/_Noreturn
+
+## begin gnulib module snippet/arg-nonnull
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+ARG_NONNULL_H=$(srcdir)/arg-nonnull.h
+
+EXTRA_DIST += arg-nonnull.h
+
+## end gnulib module snippet/arg-nonnull
+
+## begin gnulib module snippet/c++defs
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+CXXDEFS_H=$(srcdir)/c++defs.h
+
+EXTRA_DIST += c++defs.h
+
+## end gnulib module snippet/c++defs
+
+## begin gnulib module snippet/warn-on-use
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+
+WARN_ON_USE_H=$(srcdir)/warn-on-use.h
+
+EXTRA_DIST += warn-on-use.h
+
+## end gnulib module snippet/warn-on-use
+
+## begin gnulib module snprintf
+
+
+EXTRA_DIST += snprintf.c
+
+EXTRA_libgnu_a_SOURCES += snprintf.c
+
+## end gnulib module snprintf
+
+## begin gnulib module sockets
+
+libgnu_a_SOURCES += sockets.h sockets.c
+
+EXTRA_DIST += w32sock.h
+
+## end gnulib module sockets
+
+## begin gnulib module stat
+
+if GL_COND_OBJ_STAT
+libgnu_a_SOURCES += stat.c
+endif
+
+EXTRA_DIST += stat-w32.c stat-w32.h
+
+EXTRA_libgnu_a_SOURCES += stat-w32.c
+
+## end gnulib module stat
+
+## begin gnulib module stat-time
+
+libgnu_a_SOURCES += stat-time.c
+
+EXTRA_DIST += stat-time.h
+
+## end gnulib module stat-time
+
+## begin gnulib module stdalign
+
+BUILT_SOURCES += $(STDALIGN_H)
+
+# We need the following in order to create <stdalign.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_STDALIGN_H
+stdalign.h: stdalign.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
+ $(AM_V_at)mv $@-t $@
+else
+stdalign.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdalign.h stdalign.h-t
+
+EXTRA_DIST += stdalign.in.h
+
+## end gnulib module stdalign
+
+## begin gnulib module stdckdint
+
+BUILT_SOURCES += $(STDCKDINT_H)
+
+# We need the following in order to create <stdckdint.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDCKDINT_H
+stdckdint.h: stdckdint.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ $(srcdir)/stdckdint.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+stdckdint.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdckdint.h stdckdint.h-t
+
+EXTRA_DIST += intprops-internal.h stdckdint.in.h
+
+## end gnulib module stdckdint
+
+## begin gnulib module stddef
+
+BUILT_SOURCES += $(STDDEF_H)
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDDEF_H
+stddef.h: stddef.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
+ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+ $(srcdir)/stddef.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+stddef.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stddef.h stddef.h-t
+
+EXTRA_DIST += stddef.in.h
+
+## end gnulib module stddef
+
+## begin gnulib module stdint
+
+BUILT_SOURCES += $(STDINT_H)
+
+# We need the following in order to create <stdint.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDINT_H
+stdint.h: stdint.in.h $(top_builddir)/config.status
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
+ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ $(srcdir)/stdint.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+else
+stdint.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdint.h stdint.h-t
+
+EXTRA_DIST += stdint.in.h
+
+## end gnulib module stdint
+
+## begin gnulib module stdio
+
+BUILT_SOURCES += stdio.h
+
+# We need the following in order to create <stdio.h> when the system
+# doesn't have one that works with the given compiler.
+stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+ -e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
+ -e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
+ -e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
+ -e 's/@''GNULIB_FGETC''@/$(GL_GNULIB_FGETC)/g' \
+ -e 's/@''GNULIB_FGETS''@/$(GL_GNULIB_FGETS)/g' \
+ -e 's/@''GNULIB_FOPEN''@/$(GL_GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FOPEN_GNU''@/$(GL_GNULIB_FOPEN_GNU)/g' \
+ -e 's/@''GNULIB_FPRINTF''@/$(GL_GNULIB_FPRINTF)/g' \
+ -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GL_GNULIB_FPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_FPURGE''@/$(GL_GNULIB_FPURGE)/g' \
+ -e 's/@''GNULIB_FPUTC''@/$(GL_GNULIB_FPUTC)/g' \
+ -e 's/@''GNULIB_FPUTS''@/$(GL_GNULIB_FPUTS)/g' \
+ -e 's/@''GNULIB_FREAD''@/$(GL_GNULIB_FREAD)/g' \
+ -e 's/@''GNULIB_FREOPEN''@/$(GL_GNULIB_FREOPEN)/g' \
+ -e 's/@''GNULIB_FSCANF''@/$(GL_GNULIB_FSCANF)/g' \
+ -e 's/@''GNULIB_FSEEK''@/$(GL_GNULIB_FSEEK)/g' \
+ -e 's/@''GNULIB_FSEEKO''@/$(GL_GNULIB_FSEEKO)/g' \
+ -e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
+ -e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
+ -e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
+ -e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
+ -e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
+ -e 's/@''GNULIB_GETLINE''@/$(GL_GNULIB_GETLINE)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_GNULIB_OBSTACK_PRINTF)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PCLOSE''@/$(GL_GNULIB_PCLOSE)/g' \
+ -e 's/@''GNULIB_PERROR''@/$(GL_GNULIB_PERROR)/g' \
+ -e 's/@''GNULIB_POPEN''@/$(GL_GNULIB_POPEN)/g' \
+ -e 's/@''GNULIB_PRINTF''@/$(GL_GNULIB_PRINTF)/g' \
+ -e 's/@''GNULIB_PRINTF_POSIX''@/$(GL_GNULIB_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PUTC''@/$(GL_GNULIB_PUTC)/g' \
+ -e 's/@''GNULIB_PUTCHAR''@/$(GL_GNULIB_PUTCHAR)/g' \
+ -e 's/@''GNULIB_PUTS''@/$(GL_GNULIB_PUTS)/g' \
+ -e 's/@''GNULIB_REMOVE''@/$(GL_GNULIB_REMOVE)/g' \
+ -e 's/@''GNULIB_RENAME''@/$(GL_GNULIB_RENAME)/g' \
+ -e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
+ -e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
+ -e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
+ -e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
+ -e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
+ -e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
+ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
+ -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
+ -e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
+ -e 's/@''GNULIB_MDA_GETW''@/$(GL_GNULIB_MDA_GETW)/g' \
+ -e 's/@''GNULIB_MDA_PUTW''@/$(GL_GNULIB_MDA_PUTW)/g' \
+ -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_GNULIB_MDA_TEMPNAM)/g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+ -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
+ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
+ -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
+ -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+ -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+ -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+ -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+ -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
+ -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
+ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
+ -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+ -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+ -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
+ -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FOPEN_FOR_FOPEN_GNU''@|$(REPLACE_FOPEN_FOR_FOPEN_GNU)|g' \
+ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+ -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
+ -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
+ -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
+ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
+ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
+ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+ -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
+ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+ -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
+ -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+ -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
+ -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+ -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
+ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+ -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
+ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+ -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
+ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+ -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += stdio.h stdio.h-t
+
+if GL_COND_OBJ_STDIO_READ
+libgnu_a_SOURCES += stdio-read.c
+endif
+if GL_COND_OBJ_STDIO_WRITE
+libgnu_a_SOURCES += stdio-write.c
+endif
+
+EXTRA_DIST += stdio.in.h
+
+## end gnulib module stdio
+
+## begin gnulib module stdlib
+
+BUILT_SOURCES += stdlib.h
+
+# We need the following in order to create <stdlib.h> when the system
+# doesn't have one that works with the given compiler.
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+ $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+ -e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \
+ -e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \
+ -e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \
+ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_GNULIB_CALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ -e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \
+ -e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \
+ -e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \
+ -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \
+ -e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_GNULIB_MKOSTEMPS)/g' \
+ -e 's/@''GNULIB_MKSTEMP''@/$(GL_GNULIB_MKSTEMP)/g' \
+ -e 's/@''GNULIB_MKSTEMPS''@/$(GL_GNULIB_MKSTEMPS)/g' \
+ -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_GNULIB_POSIX_MEMALIGN)/g' \
+ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_GNULIB_POSIX_OPENPT)/g' \
+ -e 's/@''GNULIB_PTSNAME''@/$(GL_GNULIB_PTSNAME)/g' \
+ -e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \
+ -e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \
+ -e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \
+ -e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \
+ -e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \
+ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_GNULIB_REALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_GNULIB_REALLOCARRAY)/g' \
+ -e 's/@''GNULIB_REALPATH''@/$(GL_GNULIB_REALPATH)/g' \
+ -e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \
+ -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \
+ -e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \
+ -e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \
+ -e 's/@''GNULIB_STRTOUL''@/$(GL_GNULIB_STRTOUL)/g' \
+ -e 's/@''GNULIB_STRTOULL''@/$(GL_GNULIB_STRTOULL)/g' \
+ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_GNULIB_SYSTEM_POSIX)/g' \
+ -e 's/@''GNULIB_UNLOCKPT''@/$(GL_GNULIB_UNLOCKPT)/g' \
+ -e 's/@''GNULIB_UNSETENV''@/$(GL_GNULIB_UNSETENV)/g' \
+ -e 's/@''GNULIB_WCTOMB''@/$(GL_GNULIB_WCTOMB)/g' \
+ -e 's/@''GNULIB_MDA_ECVT''@/$(GL_GNULIB_MDA_ECVT)/g' \
+ -e 's/@''GNULIB_MDA_FCVT''@/$(GL_GNULIB_MDA_FCVT)/g' \
+ -e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \
+ -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \
+ -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
+ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \
+ -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
+ -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
+ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
+ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
+ -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
+ -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
+ -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
+ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
+ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+ -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \
+ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+ -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
+ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
+ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
+ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+ -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \
+ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
+ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
+ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
+ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
+ -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
+ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
+ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
+ -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
+ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
+ -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \
+ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
+ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
+ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
+ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
+ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+ -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+ -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
+ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
+ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
+ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+ -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+ -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
+ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_POSIX''@|$(REPLACE_REALLOC_FOR_REALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \
+ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+ -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
+ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+ -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
+ -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
+ -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
+ -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \
+ -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
+ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += stdlib.h stdlib.h-t
+
+EXTRA_DIST += stdlib.in.h
+
+## end gnulib module stdlib
+
+## begin gnulib module strcase
+
+if GL_COND_OBJ_STRCASECMP
+libgnu_a_SOURCES += strcasecmp.c
+endif
+if GL_COND_OBJ_STRNCASECMP
+libgnu_a_SOURCES += strncasecmp.c
+endif
+
+## end gnulib module strcase
+
+## begin gnulib module strcasestr
+
+
+EXTRA_DIST += strcasestr.c
+
+EXTRA_libgnu_a_SOURCES += strcasestr.c
+
+## end gnulib module strcasestr
+
+## begin gnulib module strcasestr-simple
+
+
+EXTRA_DIST += str-two-way.h strcasestr.c
+
+EXTRA_libgnu_a_SOURCES += strcasestr.c
+
+## end gnulib module strcasestr-simple
+
+## begin gnulib module streq
+
+
+EXTRA_DIST += streq.h
+
+## end gnulib module streq
+
+## begin gnulib module strerror
+
+if GL_COND_OBJ_STRERROR
+libgnu_a_SOURCES += strerror.c
+endif
+
+## end gnulib module strerror
+
+## begin gnulib module strerror-override
+
+if GL_COND_OBJ_STRERROR_OVERRIDE
+libgnu_a_SOURCES += strerror-override.c
+endif
+
+EXTRA_DIST += strerror-override.h
+
+## end gnulib module strerror-override
+
+## begin gnulib module string
+
+BUILT_SOURCES += string.h
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_GNULIB_EXPLICIT_BZERO)/g' \
+ -e 's/@''GNULIB_FFSL''@/$(GL_GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GL_GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GL_GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GL_GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GL_GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GL_GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GL_GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GL_GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GL_GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GL_GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GL_GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GL_GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GL_GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GL_GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GL_GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_MEMSET_EXPLICIT''@/$(GL_GNULIB_MEMSET_EXPLICIT)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GL_GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GL_GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GL_GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GL_GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GL_GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GL_GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GL_GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GL_GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GL_GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GL_GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GL_GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GL_GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_GNULIB_STRERRORNAME_NP)/g' \
+ -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_GNULIB_SIGABBREV_NP)/g' \
+ -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_GNULIB_SIGDESCR_NP)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GL_GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GL_GNULIB_STRVERSCMP)/g' \
+ -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \
+ -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_MEMSET_EXPLICIT''@|$(HAVE_MEMSET_EXPLICIT)|g' \
+ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+ -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \
+ -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \
+ -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \
+ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+ -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \
+ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += string.h string.h-t
+
+EXTRA_DIST += string.in.h
+
+## end gnulib module string
+
+## begin gnulib module strings
+
+BUILT_SOURCES += strings.h
+
+# We need the following in order to create <strings.h> when the system
+# doesn't have one that works with the given compiler.
+strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
+ -e 's/@''GNULIB_FFS''@/$(GL_GNULIB_FFS)/g' \
+ -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \
+ -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
+ -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/strings.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += strings.h strings.h-t
+
+EXTRA_DIST += strings.in.h
+
+## end gnulib module strings
+
+## begin gnulib module strsep
+
+if GL_COND_OBJ_STRSEP
+libgnu_a_SOURCES += strsep.c
+endif
+
+## end gnulib module strsep
+
+## begin gnulib module strstr-simple
+
+
+EXTRA_DIST += str-two-way.h strstr.c
+
+EXTRA_libgnu_a_SOURCES += strstr.c
+
+## end gnulib module strstr-simple
+
+## begin gnulib module sys_socket
+
+BUILT_SOURCES += sys/socket.h
+libgnu_a_SOURCES += sys_socket.c
+
+# We need the following in order to create <sys/socket.h> when the system
+# doesn't have one that works with the given compiler.
+sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_SOCKET''@/$(GL_GNULIB_SOCKET)/g' \
+ -e 's/@''GNULIB_CONNECT''@/$(GL_GNULIB_CONNECT)/g' \
+ -e 's/@''GNULIB_ACCEPT''@/$(GL_GNULIB_ACCEPT)/g' \
+ -e 's/@''GNULIB_BIND''@/$(GL_GNULIB_BIND)/g' \
+ -e 's/@''GNULIB_GETPEERNAME''@/$(GL_GNULIB_GETPEERNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKNAME''@/$(GL_GNULIB_GETSOCKNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKOPT''@/$(GL_GNULIB_GETSOCKOPT)/g' \
+ -e 's/@''GNULIB_LISTEN''@/$(GL_GNULIB_LISTEN)/g' \
+ -e 's/@''GNULIB_RECV''@/$(GL_GNULIB_RECV)/g' \
+ -e 's/@''GNULIB_SEND''@/$(GL_GNULIB_SEND)/g' \
+ -e 's/@''GNULIB_RECVFROM''@/$(GL_GNULIB_RECVFROM)/g' \
+ -e 's/@''GNULIB_SENDTO''@/$(GL_GNULIB_SENDTO)/g' \
+ -e 's/@''GNULIB_SETSOCKOPT''@/$(GL_GNULIB_SETSOCKOPT)/g' \
+ -e 's/@''GNULIB_SHUTDOWN''@/$(GL_GNULIB_SHUTDOWN)/g' \
+ -e 's/@''GNULIB_ACCEPT4''@/$(GL_GNULIB_ACCEPT4)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \
+ -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_socket.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_socket.in.h
+
+## end gnulib module sys_socket
+
+## begin gnulib module sys_stat
+
+BUILT_SOURCES += sys/stat.h
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+ -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
+ -e 's/@''GNULIB_CHMOD''@/$(GL_GNULIB_CHMOD)/g' \
+ -e 's/@''GNULIB_FCHMODAT''@/$(GL_GNULIB_FCHMODAT)/g' \
+ -e 's/@''GNULIB_FSTAT''@/$(GL_GNULIB_FSTAT)/g' \
+ -e 's/@''GNULIB_FSTATAT''@/$(GL_GNULIB_FSTATAT)/g' \
+ -e 's/@''GNULIB_FUTIMENS''@/$(GL_GNULIB_FUTIMENS)/g' \
+ -e 's/@''GNULIB_GETUMASK''@/$(GL_GNULIB_GETUMASK)/g' \
+ -e 's/@''GNULIB_LCHMOD''@/$(GL_GNULIB_LCHMOD)/g' \
+ -e 's/@''GNULIB_LSTAT''@/$(GL_GNULIB_LSTAT)/g' \
+ -e 's/@''GNULIB_MKDIR''@/$(GL_GNULIB_MKDIR)/g' \
+ -e 's/@''GNULIB_MKDIRAT''@/$(GL_GNULIB_MKDIRAT)/g' \
+ -e 's/@''GNULIB_MKFIFO''@/$(GL_GNULIB_MKFIFO)/g' \
+ -e 's/@''GNULIB_MKFIFOAT''@/$(GL_GNULIB_MKFIFOAT)/g' \
+ -e 's/@''GNULIB_MKNOD''@/$(GL_GNULIB_MKNOD)/g' \
+ -e 's/@''GNULIB_MKNODAT''@/$(GL_GNULIB_MKNODAT)/g' \
+ -e 's/@''GNULIB_STAT''@/$(GL_GNULIB_STAT)/g' \
+ -e 's/@''GNULIB_UTIMENSAT''@/$(GL_GNULIB_UTIMENSAT)/g' \
+ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GL_GNULIB_OVERRIDES_STRUCT_STAT)/g' \
+ -e 's/@''GNULIB_MDA_CHMOD''@/$(GL_GNULIB_MDA_CHMOD)/g' \
+ -e 's/@''GNULIB_MDA_MKDIR''@/$(GL_GNULIB_MDA_MKDIR)/g' \
+ -e 's/@''GNULIB_MDA_UMASK''@/$(GL_GNULIB_MDA_UMASK)/g' \
+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+ -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \
+ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
+ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+ -e 's|@''REPLACE_CHMOD''@|$(REPLACE_CHMOD)|g' \
+ -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \
+ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
+ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
+ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
+ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
+ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+ -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \
+ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+ -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \
+ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
+ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_stat.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_stat.in.h
+
+## end gnulib module sys_stat
+
+## begin gnulib module sys_types
+
+BUILT_SOURCES += sys/types.h
+
+# We need the following in order to create <sys/types.h> when the system
+# doesn't have one that works with the given compiler.
+sys/types.h: sys_types.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
+ $(srcdir)/sys_types.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+
+EXTRA_DIST += sys_types.in.h
+
+## end gnulib module sys_types
+
+## begin gnulib module sys_uio
+
+BUILT_SOURCES += sys/uio.h
+
+# We need the following in order to create <sys/uio.h> when the system
+# doesn't have one that works with the given compiler.
+sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \
+ -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \
+ $(srcdir)/sys_uio.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += sys/uio.h sys/uio.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_uio.in.h
+
+## end gnulib module sys_uio
+
+## begin gnulib module threadlib
+
+libgnu_a_SOURCES += glthread/threadlib.c
+
+## end gnulib module threadlib
+
+## begin gnulib module time
+
+BUILT_SOURCES += time.h
+
+# We need the following in order to create <time.h> when the system
+# doesn't have one that works with the given compiler.
+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+ -e 's/@''GNULIB_CTIME''@/$(GL_GNULIB_CTIME)/g' \
+ -e 's/@''GNULIB_LOCALTIME''@/$(GL_GNULIB_LOCALTIME)/g' \
+ -e 's/@''GNULIB_MKTIME''@/$(GL_GNULIB_MKTIME)/g' \
+ -e 's/@''GNULIB_NANOSLEEP''@/$(GL_GNULIB_NANOSLEEP)/g' \
+ -e 's/@''GNULIB_STRFTIME''@/$(GL_GNULIB_STRFTIME)/g' \
+ -e 's/@''GNULIB_STRPTIME''@/$(GL_GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIMEGM''@/$(GL_GNULIB_TIMEGM)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_GNULIB_TIMESPEC_GET)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
+ -e 's/@''GNULIB_TIME_R''@/$(GL_GNULIB_TIME_R)/g' \
+ -e 's/@''GNULIB_TIME_RZ''@/$(GL_GNULIB_TIME_RZ)/g' \
+ -e 's/@''GNULIB_TZSET''@/$(GL_GNULIB_TZSET)/g' \
+ -e 's/@''GNULIB_MDA_TZSET''@/$(GL_GNULIB_MDA_TZSET)/g' \
+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+ -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \
+ -e 's|@''HAVE_TIMESPEC_GETRES''@|$(HAVE_TIMESPEC_GETRES)|g' \
+ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
+ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
+ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+ -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
+ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+ -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/time.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += time.h time.h-t
+
+EXTRA_DIST += time.in.h
+
+## end gnulib module time
+
+## begin gnulib module time_r
+
+if GL_COND_OBJ_TIME_R
+libgnu_a_SOURCES += time_r.c
+endif
+
+## end gnulib module time_r
+
+## begin gnulib module timegm
+
+if GL_COND_OBJ_TIMEGM
+libgnu_a_SOURCES += timegm.c
+endif
+
+EXTRA_DIST += mktime-internal.h
+
+## end gnulib module timegm
+
+## begin gnulib module unistd
+
+BUILT_SOURCES += unistd.h
+libgnu_a_SOURCES += unistd.c
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's/@''GNULIB_ACCESS''@/$(GL_GNULIB_ACCESS)/g' \
+ -e 's/@''GNULIB_CHDIR''@/$(GL_GNULIB_CHDIR)/g' \
+ -e 's/@''GNULIB_CHOWN''@/$(GL_GNULIB_CHOWN)/g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_GNULIB_COPY_FILE_RANGE)/g' \
+ -e 's/@''GNULIB_DUP''@/$(GL_GNULIB_DUP)/g' \
+ -e 's/@''GNULIB_DUP2''@/$(GL_GNULIB_DUP2)/g' \
+ -e 's/@''GNULIB_DUP3''@/$(GL_GNULIB_DUP3)/g' \
+ -e 's/@''GNULIB_ENVIRON''@/$(GL_GNULIB_ENVIRON)/g' \
+ -e 's/@''GNULIB_EUIDACCESS''@/$(GL_GNULIB_EUIDACCESS)/g' \
+ -e 's/@''GNULIB_EXECL''@/$(GL_GNULIB_EXECL)/g' \
+ -e 's/@''GNULIB_EXECLE''@/$(GL_GNULIB_EXECLE)/g' \
+ -e 's/@''GNULIB_EXECLP''@/$(GL_GNULIB_EXECLP)/g' \
+ -e 's/@''GNULIB_EXECV''@/$(GL_GNULIB_EXECV)/g' \
+ -e 's/@''GNULIB_EXECVE''@/$(GL_GNULIB_EXECVE)/g' \
+ -e 's/@''GNULIB_EXECVP''@/$(GL_GNULIB_EXECVP)/g' \
+ -e 's/@''GNULIB_EXECVPE''@/$(GL_GNULIB_EXECVPE)/g' \
+ -e 's/@''GNULIB_FACCESSAT''@/$(GL_GNULIB_FACCESSAT)/g' \
+ -e 's/@''GNULIB_FCHDIR''@/$(GL_GNULIB_FCHDIR)/g' \
+ -e 's/@''GNULIB_FCHOWNAT''@/$(GL_GNULIB_FCHOWNAT)/g' \
+ -e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \
+ -e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \
+ -e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \
+ -e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \
+ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \
+ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETENTROPY''@/$(GL_GNULIB_GETENTROPY)/g' \
+ -e 's/@''GNULIB_GETGROUPS''@/$(GL_GNULIB_GETGROUPS)/g' \
+ -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_GNULIB_GETHOSTNAME)/g' \
+ -e 's/@''GNULIB_GETLOGIN''@/$(GL_GNULIB_GETLOGIN)/g' \
+ -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_GNULIB_GETLOGIN_R)/g' \
+ -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_GNULIB_GETOPT_POSIX)/g' \
+ -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_GNULIB_GETPAGESIZE)/g' \
+ -e 's/@''GNULIB_GETPASS''@/$(GL_GNULIB_GETPASS)/g' \
+ -e 's/@''GNULIB_GETPASS_GNU''@/$(GL_GNULIB_GETPASS_GNU)/g' \
+ -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_GNULIB_GETUSERSHELL)/g' \
+ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_GNULIB_GROUP_MEMBER)/g' \
+ -e 's/@''GNULIB_ISATTY''@/$(GL_GNULIB_ISATTY)/g' \
+ -e 's/@''GNULIB_LCHOWN''@/$(GL_GNULIB_LCHOWN)/g' \
+ -e 's/@''GNULIB_LINK''@/$(GL_GNULIB_LINK)/g' \
+ -e 's/@''GNULIB_LINKAT''@/$(GL_GNULIB_LINKAT)/g' \
+ -e 's/@''GNULIB_LSEEK''@/$(GL_GNULIB_LSEEK)/g' \
+ -e 's/@''GNULIB_PIPE''@/$(GL_GNULIB_PIPE)/g' \
+ -e 's/@''GNULIB_PIPE2''@/$(GL_GNULIB_PIPE2)/g' \
+ -e 's/@''GNULIB_PREAD''@/$(GL_GNULIB_PREAD)/g' \
+ -e 's/@''GNULIB_PWRITE''@/$(GL_GNULIB_PWRITE)/g' \
+ -e 's/@''GNULIB_READ''@/$(GL_GNULIB_READ)/g' \
+ -e 's/@''GNULIB_READLINK''@/$(GL_GNULIB_READLINK)/g' \
+ -e 's/@''GNULIB_READLINKAT''@/$(GL_GNULIB_READLINKAT)/g' \
+ -e 's/@''GNULIB_RMDIR''@/$(GL_GNULIB_RMDIR)/g' \
+ -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_GNULIB_SETHOSTNAME)/g' \
+ -e 's/@''GNULIB_SLEEP''@/$(GL_GNULIB_SLEEP)/g' \
+ -e 's/@''GNULIB_SYMLINK''@/$(GL_GNULIB_SYMLINK)/g' \
+ -e 's/@''GNULIB_SYMLINKAT''@/$(GL_GNULIB_SYMLINKAT)/g' \
+ -e 's/@''GNULIB_TRUNCATE''@/$(GL_GNULIB_TRUNCATE)/g' \
+ -e 's/@''GNULIB_TTYNAME_R''@/$(GL_GNULIB_TTYNAME_R)/g' \
+ -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_UNISTD_H_GETOPT)/g' \
+ -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_GNULIB_UNISTD_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_GNULIB_UNISTD_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_UNLINK''@/$(GL_GNULIB_UNLINK)/g' \
+ -e 's/@''GNULIB_UNLINKAT''@/$(GL_GNULIB_UNLINKAT)/g' \
+ -e 's/@''GNULIB_USLEEP''@/$(GL_GNULIB_USLEEP)/g' \
+ -e 's/@''GNULIB_WRITE''@/$(GL_GNULIB_WRITE)/g' \
+ -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_GNULIB_MDA_ACCESS)/g' \
+ -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_GNULIB_MDA_CHDIR)/g' \
+ -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_GNULIB_MDA_CLOSE)/g' \
+ -e 's/@''GNULIB_MDA_DUP''@/$(GL_GNULIB_MDA_DUP)/g' \
+ -e 's/@''GNULIB_MDA_DUP2''@/$(GL_GNULIB_MDA_DUP2)/g' \
+ -e 's/@''GNULIB_MDA_EXECL''@/$(GL_GNULIB_MDA_EXECL)/g' \
+ -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_GNULIB_MDA_EXECLE)/g' \
+ -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_GNULIB_MDA_EXECLP)/g' \
+ -e 's/@''GNULIB_MDA_EXECV''@/$(GL_GNULIB_MDA_EXECV)/g' \
+ -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_GNULIB_MDA_EXECVE)/g' \
+ -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_GNULIB_MDA_EXECVP)/g' \
+ -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_GNULIB_MDA_EXECVPE)/g' \
+ -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_GNULIB_MDA_GETCWD)/g' \
+ -e 's/@''GNULIB_MDA_GETPID''@/$(GL_GNULIB_MDA_GETPID)/g' \
+ -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_GNULIB_MDA_ISATTY)/g' \
+ -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_GNULIB_MDA_LSEEK)/g' \
+ -e 's/@''GNULIB_MDA_READ''@/$(GL_GNULIB_MDA_READ)/g' \
+ -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_GNULIB_MDA_RMDIR)/g' \
+ -e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \
+ -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \
+ -e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \
+ < $(srcdir)/unistd.in.h | \
+ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
+ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+ -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \
+ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
+ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+ -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
+ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
+ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
+ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+ -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
+ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
+ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
+ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
+ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
+ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+ -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
+ -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
+ -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
+ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+ -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
+ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
+ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
+ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+ -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \
+ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
+ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
+ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+ -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
+ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
+ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
+ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
+ | \
+ sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
+ -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
+ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+ -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
+ -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
+ -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
+ -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \
+ -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \
+ -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
+ -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
+ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
+ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
+ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+ -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+ -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
+ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
+ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
+ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+ -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
+ -e 's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \
+ -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
+ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
+ -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
+ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+ -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+ -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
+ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
+ -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
+ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
+ -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+ -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
+ -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \
+ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
+ -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
+ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
+ -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
+ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+ -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += unistd.h unistd.h-t
+
+EXTRA_DIST += unistd.in.h
+
+## end gnulib module unistd
+
+## begin gnulib module unlocked-io-internal
+
+
+EXTRA_DIST += unlocked-io.h
+
+## end gnulib module unlocked-io-internal
+
+## begin gnulib module unsetenv
+
+if GL_COND_OBJ_UNSETENV
+libgnu_a_SOURCES += unsetenv.c
+endif
+
+## end gnulib module unsetenv
+
+## begin gnulib module vasnprintf
+
+
+EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
+
+EXTRA_libgnu_a_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
+
+## end gnulib module vasnprintf
+
+## begin gnulib module vasprintf
+
+
+EXTRA_DIST += asprintf.c vasprintf.c
+
+EXTRA_libgnu_a_SOURCES += asprintf.c vasprintf.c
+
+## end gnulib module vasprintf
+
+## begin gnulib module verify
+
+
+EXTRA_DIST += verify.h
+
+## end gnulib module verify
+
+## begin gnulib module vsnprintf
+
+
+EXTRA_DIST += vsnprintf.c
+
+EXTRA_libgnu_a_SOURCES += vsnprintf.c
+
+## end gnulib module vsnprintf
+
+## begin gnulib module wchar
+
+BUILT_SOURCES += wchar.h
+
+# We need the following in order to create <wchar.h> when the system
+# version does not work standalone.
+wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
+ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_BTOWC''@/$(GL_GNULIB_BTOWC)/g' \
+ -e 's/@''GNULIB_WCTOB''@/$(GL_GNULIB_WCTOB)/g' \
+ -e 's/@''GNULIB_MBSINIT''@/$(GL_GNULIB_MBSINIT)/g' \
+ -e 's/@''GNULIB_MBRTOWC''@/$(GL_GNULIB_MBRTOWC)/g' \
+ -e 's/@''GNULIB_MBRLEN''@/$(GL_GNULIB_MBRLEN)/g' \
+ -e 's/@''GNULIB_MBSRTOWCS''@/$(GL_GNULIB_MBSRTOWCS)/g' \
+ -e 's/@''GNULIB_MBSNRTOWCS''@/$(GL_GNULIB_MBSNRTOWCS)/g' \
+ -e 's/@''GNULIB_WCRTOMB''@/$(GL_GNULIB_WCRTOMB)/g' \
+ -e 's/@''GNULIB_WCSRTOMBS''@/$(GL_GNULIB_WCSRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSNRTOMBS''@/$(GL_GNULIB_WCSNRTOMBS)/g' \
+ -e 's/@''GNULIB_WCWIDTH''@/$(GL_GNULIB_WCWIDTH)/g' \
+ -e 's/@''GNULIB_WMEMCHR''@/$(GL_GNULIB_WMEMCHR)/g' \
+ -e 's/@''GNULIB_WMEMCMP''@/$(GL_GNULIB_WMEMCMP)/g' \
+ -e 's/@''GNULIB_WMEMCPY''@/$(GL_GNULIB_WMEMCPY)/g' \
+ -e 's/@''GNULIB_WMEMMOVE''@/$(GL_GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMPCPY''@/$(GL_GNULIB_WMEMPCPY)/g' \
+ -e 's/@''GNULIB_WMEMSET''@/$(GL_GNULIB_WMEMSET)/g' \
+ -e 's/@''GNULIB_WCSLEN''@/$(GL_GNULIB_WCSLEN)/g' \
+ -e 's/@''GNULIB_WCSNLEN''@/$(GL_GNULIB_WCSNLEN)/g' \
+ -e 's/@''GNULIB_WCSCPY''@/$(GL_GNULIB_WCSCPY)/g' \
+ -e 's/@''GNULIB_WCPCPY''@/$(GL_GNULIB_WCPCPY)/g' \
+ -e 's/@''GNULIB_WCSNCPY''@/$(GL_GNULIB_WCSNCPY)/g' \
+ -e 's/@''GNULIB_WCPNCPY''@/$(GL_GNULIB_WCPNCPY)/g' \
+ -e 's/@''GNULIB_WCSCAT''@/$(GL_GNULIB_WCSCAT)/g' \
+ -e 's/@''GNULIB_WCSNCAT''@/$(GL_GNULIB_WCSNCAT)/g' \
+ -e 's/@''GNULIB_WCSCMP''@/$(GL_GNULIB_WCSCMP)/g' \
+ -e 's/@''GNULIB_WCSNCMP''@/$(GL_GNULIB_WCSNCMP)/g' \
+ -e 's/@''GNULIB_WCSCASECMP''@/$(GL_GNULIB_WCSCASECMP)/g' \
+ -e 's/@''GNULIB_WCSNCASECMP''@/$(GL_GNULIB_WCSNCASECMP)/g' \
+ -e 's/@''GNULIB_WCSCOLL''@/$(GL_GNULIB_WCSCOLL)/g' \
+ -e 's/@''GNULIB_WCSXFRM''@/$(GL_GNULIB_WCSXFRM)/g' \
+ -e 's/@''GNULIB_WCSDUP''@/$(GL_GNULIB_WCSDUP)/g' \
+ -e 's/@''GNULIB_WCSCHR''@/$(GL_GNULIB_WCSCHR)/g' \
+ -e 's/@''GNULIB_WCSRCHR''@/$(GL_GNULIB_WCSRCHR)/g' \
+ -e 's/@''GNULIB_WCSCSPN''@/$(GL_GNULIB_WCSCSPN)/g' \
+ -e 's/@''GNULIB_WCSSPN''@/$(GL_GNULIB_WCSSPN)/g' \
+ -e 's/@''GNULIB_WCSPBRK''@/$(GL_GNULIB_WCSPBRK)/g' \
+ -e 's/@''GNULIB_WCSSTR''@/$(GL_GNULIB_WCSSTR)/g' \
+ -e 's/@''GNULIB_WCSTOK''@/$(GL_GNULIB_WCSTOK)/g' \
+ -e 's/@''GNULIB_WCSWIDTH''@/$(GL_GNULIB_WCSWIDTH)/g' \
+ -e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/g' \
+ -e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_GNULIB_MDA_WCSDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/wchar.in.h | \
+ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
+ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
+ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
+ -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
+ -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
+ -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
+ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
+ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
+ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+ -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+ -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+ -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
+ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+ -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+ -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+ -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+ -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+ -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+ -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+ -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+ -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+ -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+ -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+ -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+ -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+ -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+ -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+ -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+ -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+ -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+ -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+ -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+ -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
+ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
+ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
+ -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
+ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+ | \
+ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
+ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
+ -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
+ -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
+ -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
+ -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
+ -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
+ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
+ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
+ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+ -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+ -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+ -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += wchar.h wchar.h-t
+
+EXTRA_DIST += wchar.in.h
+
+## end gnulib module wchar
+
+## begin gnulib module wcrtomb
+
+if GL_COND_OBJ_WCRTOMB
+libgnu_a_SOURCES += wcrtomb.c
+endif
+
+## end gnulib module wcrtomb
+
+## begin gnulib module wctype-h
+
+BUILT_SOURCES += wctype.h
+libgnu_a_SOURCES += wctype-h.c
+
+# We need the following in order to create <wctype.h> when the system
+# doesn't have one that works with the given compiler.
+wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_ISWBLANK''@/$(GL_GNULIB_ISWBLANK)/g' \
+ -e 's/@''GNULIB_ISWDIGIT''@/$(GL_GNULIB_ISWDIGIT)/g' \
+ -e 's/@''GNULIB_ISWXDIGIT''@/$(GL_GNULIB_ISWXDIGIT)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GL_GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GL_GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GL_GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(GL_GNULIB_TOWCTRANS)/g' \
+ -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
+ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
+ -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
+ -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
+ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+ -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
+ -e 's/@''REPLACE_ISWDIGIT''@/$(REPLACE_ISWDIGIT)/g' \
+ -e 's/@''REPLACE_ISWXDIGIT''@/$(REPLACE_ISWXDIGIT)/g' \
+ -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+ -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/wctype.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+MOSTLYCLEANFILES += wctype.h wctype.h-t
+
+EXTRA_DIST += wctype.in.h
+
+## end gnulib module wctype-h
+
+## begin gnulib module windows-mutex
+
+if GL_COND_OBJ_WINDOWS_MUTEX
+libgnu_a_SOURCES += windows-mutex.c
+endif
+
+EXTRA_DIST += windows-initguard.h windows-mutex.h
+
+## end gnulib module windows-mutex
+
+## begin gnulib module windows-once
+
+if GL_COND_OBJ_WINDOWS_ONCE
+libgnu_a_SOURCES += windows-once.c
+endif
+
+EXTRA_DIST += windows-once.h
+
+## end gnulib module windows-once
+
+## begin gnulib module windows-recmutex
+
+if GL_COND_OBJ_WINDOWS_RECMUTEX
+libgnu_a_SOURCES += windows-recmutex.c
+endif
+
+EXTRA_DIST += windows-initguard.h windows-recmutex.h
+
+## end gnulib module windows-recmutex
+
+## begin gnulib module windows-rwlock
+
+if GL_COND_OBJ_WINDOWS_RWLOCK
+libgnu_a_SOURCES += windows-rwlock.c
+endif
+
+EXTRA_DIST += windows-initguard.h windows-rwlock.h
+
+## end gnulib module windows-rwlock
+
+## begin gnulib module xalloc
+
+libgnu_a_SOURCES += xmalloc.c
+
+EXTRA_DIST += xalloc.h
+
+## end gnulib module xalloc
+
+## begin gnulib module xalloc-die
+
+libgnu_a_SOURCES += xalloc-die.c
+
+EXTRA_DIST += xalloc.h
+
+## end gnulib module xalloc-die
+
+## begin gnulib module xalloc-oversized
+
+
+EXTRA_DIST += xalloc-oversized.h
+
+## end gnulib module xalloc-oversized
+
+## begin gnulib module xsize
+
+libgnu_a_SOURCES += xsize.h xsize.c
+
+## end gnulib module xsize
+
+
+mostlyclean-local: mostlyclean-generic
+ @for dir in '' $(MOSTLYCLEANDIRS); do \
+ if test -n "$$dir" && test -d $$dir; then \
+ echo "rmdir $$dir"; rmdir $$dir; \
+ fi; \
+ done; \
+ :
+distclean-local: distclean-gnulib-libobjs
+distclean-gnulib-libobjs:
+ -rm -f @gl_LIBOBJDEPS@
+maintainer-clean-local: distclean-gnulib-libobjs
diff --git a/gl/Makefile.in b/gl/Makefile.in
new file mode 100644
index 0000000..6ac6da9
--- /dev/null
+++ b/gl/Makefile.in
@@ -0,0 +1,6317 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+# Reproduce by:
+# gnulib-tool --import \
+# --lib=libgnu \
+# --source-base=gl \
+# --m4-base=gl/m4 \
+# --doc-base=doc \
+# --tests-base=tests \
+# --aux-dir=build-aux \
+# --no-conditional-dependencies \
+# --no-libtool \
+# --macro-prefix=gl \
+# --no-vc-files \
+# base64 \
+# crypto/sha256 \
+# dirname \
+# environ \
+# floorf \
+# fsusage \
+# getaddrinfo \
+# gethostname \
+# getloadavg \
+# getopt-gnu \
+# gettext-h \
+# idpriv-droptemp \
+# mountlist \
+# regex \
+# setenv \
+# strcase \
+# strcasestr \
+# strsep \
+# timegm \
+# unsetenv \
+# vasprintf \
+# vsnprintf
+
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@GL_COND_OBJ_BTOWC_TRUE@am__append_1 = btowc.c
+@GL_COND_OBJ_CLOSE_TRUE@am__append_2 = close.c
+@GL_COND_OBJ_DUP2_TRUE@am__append_3 = dup2.c
+@GL_COND_OBJ_ERROR_TRUE@am__append_4 = error.c
+@GL_COND_OBJ_FCNTL_TRUE@am__append_5 = fcntl.c
+@GL_COND_OBJ_FFLUSH_TRUE@am__append_6 = fflush.c
+@GL_COND_OBJ_FLOAT_TRUE@am__append_7 = float.c
+@GL_COND_OBJ_ITOLD_TRUE@am__append_8 = itold.c
+@GL_COND_OBJ_FLOORF_TRUE@am__append_9 = floorf.c
+@GL_COND_OBJ_FPURGE_TRUE@am__append_10 = fpurge.c
+@GL_COND_OBJ_FREE_TRUE@am__append_11 = free.c
+@GL_COND_OBJ_FSEEK_TRUE@am__append_12 = fseek.c
+@GL_COND_OBJ_FSEEKO_TRUE@am__append_13 = fseeko.c
+@GL_COND_OBJ_FSTAT_TRUE@am__append_14 = fstat.c
+@GL_COND_OBJ_FSUSAGE_TRUE@am__append_15 = fsusage.c
+@GL_COND_OBJ_FTELL_TRUE@am__append_16 = ftell.c
+@GL_COND_OBJ_FTELLO_TRUE@am__append_17 = ftello.c
+@GL_COND_OBJ_GETADDRINFO_TRUE@am__append_18 = getaddrinfo.c
+@GL_COND_OBJ_GAI_STRERROR_TRUE@am__append_19 = gai_strerror.c
+@GL_COND_OBJ_GETDELIM_TRUE@am__append_20 = getdelim.c
+@GL_COND_OBJ_GETDTABLESIZE_TRUE@am__append_21 = getdtablesize.c
+@GL_COND_OBJ_GETHOSTNAME_TRUE@am__append_22 = gethostname.c
+@GL_COND_OBJ_GETLINE_TRUE@am__append_23 = getline.c
+@GL_COND_OBJ_GETLOADAVG_TRUE@am__append_24 = getloadavg.c
+@GL_COND_OBJ_GETOPT_TRUE@am__append_25 = getopt.c getopt1.c
+@GL_COND_OBJ_INET_NTOP_TRUE@am__append_26 = inet_ntop.c
+@GL_COND_OBJ_LOCALECONV_TRUE@am__append_27 = localeconv.c
+@GL_COND_OBJ_LSEEK_TRUE@am__append_28 = lseek.c
+@GL_COND_OBJ_MBRTOWC_TRUE@am__append_29 = mbrtowc.c
+@GL_COND_OBJ_MBSINIT_TRUE@am__append_30 = mbsinit.c
+@GL_COND_OBJ_MBTOWC_TRUE@am__append_31 = mbtowc.c
+@GL_COND_OBJ_MEMCHR_TRUE@am__append_32 = memchr.c
+@GL_COND_OBJ_MOUNTLIST_TRUE@am__append_33 = mountlist.c
+@GL_COND_OBJ_MSVC_INVAL_TRUE@am__append_34 = msvc-inval.c
+@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__append_35 = msvc-nothrow.c
+@GL_COND_OBJ_NL_LANGINFO_TRUE@am__append_36 = nl_langinfo.c
+@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__append_37 = nl_langinfo-lock.c
+@GL_COND_OBJ_OPEN_TRUE@am__append_38 = open.c
+@GL_COND_OBJ_REALLOCARRAY_TRUE@am__append_39 = reallocarray.c
+@GL_COND_OBJ_REGEX_TRUE@am__append_40 = regex.c
+@GL_COND_OBJ_SETENV_TRUE@am__append_41 = setenv.c
+@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__append_42 = setlocale-lock.c
+@GL_COND_OBJ_STAT_TRUE@am__append_43 = stat.c
+@GL_COND_OBJ_STDIO_READ_TRUE@am__append_44 = stdio-read.c
+@GL_COND_OBJ_STDIO_WRITE_TRUE@am__append_45 = stdio-write.c
+@GL_COND_OBJ_STRCASECMP_TRUE@am__append_46 = strcasecmp.c
+@GL_COND_OBJ_STRNCASECMP_TRUE@am__append_47 = strncasecmp.c
+@GL_COND_OBJ_STRERROR_TRUE@am__append_48 = strerror.c
+@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__append_49 = strerror-override.c
+@GL_COND_OBJ_STRSEP_TRUE@am__append_50 = strsep.c
+@GL_COND_OBJ_TIME_R_TRUE@am__append_51 = time_r.c
+@GL_COND_OBJ_TIMEGM_TRUE@am__append_52 = timegm.c
+@GL_COND_OBJ_UNSETENV_TRUE@am__append_53 = unsetenv.c
+@GL_COND_OBJ_WCRTOMB_TRUE@am__append_54 = wcrtomb.c
+@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__append_55 = windows-mutex.c
+@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__append_56 = windows-once.c
+@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__append_57 = windows-recmutex.c
+@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__append_58 = windows-rwlock.c
+subdir = gl
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+ $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libgnu_a_AR = $(AR) $(ARFLAGS)
+am__DEPENDENCIES_1 =
+am__libgnu_a_SOURCES_DIST = base64.h base64.c basename-lgpl.c btowc.c \
+ cloexec.c close.c af_alg.c sha256-stream.c sha256.c dirname.c \
+ basename.c dirname-lgpl.c stripslash.c dup2.c error.c \
+ exitfail.c fcntl.c fd-hook.c fflush.c float.c itold.c floorf.c \
+ fpurge.c freading.c free.c fseek.c fseeko.c fstat.c fsusage.c \
+ ftell.c ftello.c getaddrinfo.c gai_strerror.c getdelim.c \
+ getdtablesize.c gethostname.c getline.c getloadavg.c getopt.c \
+ getopt1.c getprogname.h getprogname.c gettext.h \
+ malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c \
+ malloc/dynarray_finalize.c malloc/dynarray_resize.c \
+ malloc/dynarray_resize_clear.c hard-locale.c ialloc.c \
+ idpriv-droptemp.c idx.h inet_ntop.c localcharset.c \
+ localeconv.c glthread/lock.h glthread/lock.c lseek.c malloca.c \
+ math.c mbrtowc.c mbsinit.c mbtowc.c memchr.c minmax.h \
+ mountlist.c msvc-inval.c msvc-nothrow.c nl_langinfo.c \
+ nl_langinfo-lock.c open.c reallocarray.c regex.c setenv.c \
+ setlocale_null.c setlocale-lock.c size_max.h sockets.h \
+ sockets.c stat.c stat-time.c stdio-read.c stdio-write.c \
+ strcasecmp.c strncasecmp.c strerror.c strerror-override.c \
+ strsep.c sys_socket.c glthread/threadlib.c time_r.c timegm.c \
+ unistd.c unsetenv.c wcrtomb.c wctype-h.c windows-mutex.c \
+ windows-once.c windows-recmutex.c windows-rwlock.c xmalloc.c \
+ xalloc-die.c xsize.h xsize.c
+@GL_COND_OBJ_BTOWC_TRUE@am__objects_1 = libgnu_a-btowc.$(OBJEXT)
+@GL_COND_OBJ_CLOSE_TRUE@am__objects_2 = libgnu_a-close.$(OBJEXT)
+@GL_COND_OBJ_DUP2_TRUE@am__objects_3 = libgnu_a-dup2.$(OBJEXT)
+@GL_COND_OBJ_ERROR_TRUE@am__objects_4 = libgnu_a-error.$(OBJEXT)
+@GL_COND_OBJ_FCNTL_TRUE@am__objects_5 = libgnu_a-fcntl.$(OBJEXT)
+@GL_COND_OBJ_FFLUSH_TRUE@am__objects_6 = libgnu_a-fflush.$(OBJEXT)
+@GL_COND_OBJ_FLOAT_TRUE@am__objects_7 = libgnu_a-float.$(OBJEXT)
+@GL_COND_OBJ_ITOLD_TRUE@am__objects_8 = libgnu_a-itold.$(OBJEXT)
+@GL_COND_OBJ_FLOORF_TRUE@am__objects_9 = libgnu_a-floorf.$(OBJEXT)
+@GL_COND_OBJ_FPURGE_TRUE@am__objects_10 = libgnu_a-fpurge.$(OBJEXT)
+@GL_COND_OBJ_FREE_TRUE@am__objects_11 = libgnu_a-free.$(OBJEXT)
+@GL_COND_OBJ_FSEEK_TRUE@am__objects_12 = libgnu_a-fseek.$(OBJEXT)
+@GL_COND_OBJ_FSEEKO_TRUE@am__objects_13 = libgnu_a-fseeko.$(OBJEXT)
+@GL_COND_OBJ_FSTAT_TRUE@am__objects_14 = libgnu_a-fstat.$(OBJEXT)
+@GL_COND_OBJ_FSUSAGE_TRUE@am__objects_15 = libgnu_a-fsusage.$(OBJEXT)
+@GL_COND_OBJ_FTELL_TRUE@am__objects_16 = libgnu_a-ftell.$(OBJEXT)
+@GL_COND_OBJ_FTELLO_TRUE@am__objects_17 = libgnu_a-ftello.$(OBJEXT)
+@GL_COND_OBJ_GETADDRINFO_TRUE@am__objects_18 = \
+@GL_COND_OBJ_GETADDRINFO_TRUE@ libgnu_a-getaddrinfo.$(OBJEXT)
+@GL_COND_OBJ_GAI_STRERROR_TRUE@am__objects_19 = libgnu_a-gai_strerror.$(OBJEXT)
+@GL_COND_OBJ_GETDELIM_TRUE@am__objects_20 = \
+@GL_COND_OBJ_GETDELIM_TRUE@ libgnu_a-getdelim.$(OBJEXT)
+@GL_COND_OBJ_GETDTABLESIZE_TRUE@am__objects_21 = libgnu_a-getdtablesize.$(OBJEXT)
+@GL_COND_OBJ_GETHOSTNAME_TRUE@am__objects_22 = \
+@GL_COND_OBJ_GETHOSTNAME_TRUE@ libgnu_a-gethostname.$(OBJEXT)
+@GL_COND_OBJ_GETLINE_TRUE@am__objects_23 = libgnu_a-getline.$(OBJEXT)
+@GL_COND_OBJ_GETLOADAVG_TRUE@am__objects_24 = \
+@GL_COND_OBJ_GETLOADAVG_TRUE@ libgnu_a-getloadavg.$(OBJEXT)
+@GL_COND_OBJ_GETOPT_TRUE@am__objects_25 = libgnu_a-getopt.$(OBJEXT) \
+@GL_COND_OBJ_GETOPT_TRUE@ libgnu_a-getopt1.$(OBJEXT)
+am__dirstamp = $(am__leading_dot)dirstamp
+@GL_COND_OBJ_INET_NTOP_TRUE@am__objects_26 = \
+@GL_COND_OBJ_INET_NTOP_TRUE@ libgnu_a-inet_ntop.$(OBJEXT)
+@GL_COND_OBJ_LOCALECONV_TRUE@am__objects_27 = \
+@GL_COND_OBJ_LOCALECONV_TRUE@ libgnu_a-localeconv.$(OBJEXT)
+@GL_COND_OBJ_LSEEK_TRUE@am__objects_28 = libgnu_a-lseek.$(OBJEXT)
+@GL_COND_OBJ_MBRTOWC_TRUE@am__objects_29 = libgnu_a-mbrtowc.$(OBJEXT)
+@GL_COND_OBJ_MBSINIT_TRUE@am__objects_30 = libgnu_a-mbsinit.$(OBJEXT)
+@GL_COND_OBJ_MBTOWC_TRUE@am__objects_31 = libgnu_a-mbtowc.$(OBJEXT)
+@GL_COND_OBJ_MEMCHR_TRUE@am__objects_32 = libgnu_a-memchr.$(OBJEXT)
+@GL_COND_OBJ_MOUNTLIST_TRUE@am__objects_33 = \
+@GL_COND_OBJ_MOUNTLIST_TRUE@ libgnu_a-mountlist.$(OBJEXT)
+@GL_COND_OBJ_MSVC_INVAL_TRUE@am__objects_34 = \
+@GL_COND_OBJ_MSVC_INVAL_TRUE@ libgnu_a-msvc-inval.$(OBJEXT)
+@GL_COND_OBJ_MSVC_NOTHROW_TRUE@am__objects_35 = libgnu_a-msvc-nothrow.$(OBJEXT)
+@GL_COND_OBJ_NL_LANGINFO_TRUE@am__objects_36 = \
+@GL_COND_OBJ_NL_LANGINFO_TRUE@ libgnu_a-nl_langinfo.$(OBJEXT)
+@GL_COND_OBJ_NL_LANGINFO_LOCK_TRUE@am__objects_37 = libgnu_a-nl_langinfo-lock.$(OBJEXT)
+@GL_COND_OBJ_OPEN_TRUE@am__objects_38 = libgnu_a-open.$(OBJEXT)
+@GL_COND_OBJ_REALLOCARRAY_TRUE@am__objects_39 = libgnu_a-reallocarray.$(OBJEXT)
+@GL_COND_OBJ_REGEX_TRUE@am__objects_40 = libgnu_a-regex.$(OBJEXT)
+@GL_COND_OBJ_SETENV_TRUE@am__objects_41 = libgnu_a-setenv.$(OBJEXT)
+@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__objects_42 = libgnu_a-setlocale-lock.$(OBJEXT)
+@GL_COND_OBJ_STAT_TRUE@am__objects_43 = libgnu_a-stat.$(OBJEXT)
+@GL_COND_OBJ_STDIO_READ_TRUE@am__objects_44 = \
+@GL_COND_OBJ_STDIO_READ_TRUE@ libgnu_a-stdio-read.$(OBJEXT)
+@GL_COND_OBJ_STDIO_WRITE_TRUE@am__objects_45 = \
+@GL_COND_OBJ_STDIO_WRITE_TRUE@ libgnu_a-stdio-write.$(OBJEXT)
+@GL_COND_OBJ_STRCASECMP_TRUE@am__objects_46 = \
+@GL_COND_OBJ_STRCASECMP_TRUE@ libgnu_a-strcasecmp.$(OBJEXT)
+@GL_COND_OBJ_STRNCASECMP_TRUE@am__objects_47 = \
+@GL_COND_OBJ_STRNCASECMP_TRUE@ libgnu_a-strncasecmp.$(OBJEXT)
+@GL_COND_OBJ_STRERROR_TRUE@am__objects_48 = \
+@GL_COND_OBJ_STRERROR_TRUE@ libgnu_a-strerror.$(OBJEXT)
+@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__objects_49 = libgnu_a-strerror-override.$(OBJEXT)
+@GL_COND_OBJ_STRSEP_TRUE@am__objects_50 = libgnu_a-strsep.$(OBJEXT)
+@GL_COND_OBJ_TIME_R_TRUE@am__objects_51 = libgnu_a-time_r.$(OBJEXT)
+@GL_COND_OBJ_TIMEGM_TRUE@am__objects_52 = libgnu_a-timegm.$(OBJEXT)
+@GL_COND_OBJ_UNSETENV_TRUE@am__objects_53 = \
+@GL_COND_OBJ_UNSETENV_TRUE@ libgnu_a-unsetenv.$(OBJEXT)
+@GL_COND_OBJ_WCRTOMB_TRUE@am__objects_54 = libgnu_a-wcrtomb.$(OBJEXT)
+@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__objects_55 = libgnu_a-windows-mutex.$(OBJEXT)
+@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__objects_56 = libgnu_a-windows-once.$(OBJEXT)
+@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__objects_57 = libgnu_a-windows-recmutex.$(OBJEXT)
+@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__objects_58 = libgnu_a-windows-rwlock.$(OBJEXT)
+am_libgnu_a_OBJECTS = libgnu_a-base64.$(OBJEXT) \
+ libgnu_a-basename-lgpl.$(OBJEXT) $(am__objects_1) \
+ libgnu_a-cloexec.$(OBJEXT) $(am__objects_2) \
+ libgnu_a-af_alg.$(OBJEXT) libgnu_a-sha256-stream.$(OBJEXT) \
+ libgnu_a-sha256.$(OBJEXT) libgnu_a-dirname.$(OBJEXT) \
+ libgnu_a-basename.$(OBJEXT) libgnu_a-dirname-lgpl.$(OBJEXT) \
+ libgnu_a-stripslash.$(OBJEXT) $(am__objects_3) \
+ $(am__objects_4) libgnu_a-exitfail.$(OBJEXT) $(am__objects_5) \
+ libgnu_a-fd-hook.$(OBJEXT) $(am__objects_6) $(am__objects_7) \
+ $(am__objects_8) $(am__objects_9) $(am__objects_10) \
+ libgnu_a-freading.$(OBJEXT) $(am__objects_11) \
+ $(am__objects_12) $(am__objects_13) $(am__objects_14) \
+ $(am__objects_15) $(am__objects_16) $(am__objects_17) \
+ $(am__objects_18) $(am__objects_19) $(am__objects_20) \
+ $(am__objects_21) $(am__objects_22) $(am__objects_23) \
+ $(am__objects_24) $(am__objects_25) \
+ libgnu_a-getprogname.$(OBJEXT) \
+ malloc/libgnu_a-dynarray_at_failure.$(OBJEXT) \
+ malloc/libgnu_a-dynarray_emplace_enlarge.$(OBJEXT) \
+ malloc/libgnu_a-dynarray_finalize.$(OBJEXT) \
+ malloc/libgnu_a-dynarray_resize.$(OBJEXT) \
+ malloc/libgnu_a-dynarray_resize_clear.$(OBJEXT) \
+ libgnu_a-hard-locale.$(OBJEXT) libgnu_a-ialloc.$(OBJEXT) \
+ libgnu_a-idpriv-droptemp.$(OBJEXT) $(am__objects_26) \
+ libgnu_a-localcharset.$(OBJEXT) $(am__objects_27) \
+ glthread/libgnu_a-lock.$(OBJEXT) $(am__objects_28) \
+ libgnu_a-malloca.$(OBJEXT) libgnu_a-math.$(OBJEXT) \
+ $(am__objects_29) $(am__objects_30) $(am__objects_31) \
+ $(am__objects_32) $(am__objects_33) $(am__objects_34) \
+ $(am__objects_35) $(am__objects_36) $(am__objects_37) \
+ $(am__objects_38) $(am__objects_39) $(am__objects_40) \
+ $(am__objects_41) libgnu_a-setlocale_null.$(OBJEXT) \
+ $(am__objects_42) libgnu_a-sockets.$(OBJEXT) $(am__objects_43) \
+ libgnu_a-stat-time.$(OBJEXT) $(am__objects_44) \
+ $(am__objects_45) $(am__objects_46) $(am__objects_47) \
+ $(am__objects_48) $(am__objects_49) $(am__objects_50) \
+ libgnu_a-sys_socket.$(OBJEXT) \
+ glthread/libgnu_a-threadlib.$(OBJEXT) $(am__objects_51) \
+ $(am__objects_52) libgnu_a-unistd.$(OBJEXT) $(am__objects_53) \
+ $(am__objects_54) libgnu_a-wctype-h.$(OBJEXT) \
+ $(am__objects_55) $(am__objects_56) $(am__objects_57) \
+ $(am__objects_58) libgnu_a-xmalloc.$(OBJEXT) \
+ libgnu_a-xalloc-die.$(OBJEXT) libgnu_a-xsize.$(OBJEXT)
+libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/libgnu_a-af_alg.Po \
+ ./$(DEPDIR)/libgnu_a-asnprintf.Po \
+ ./$(DEPDIR)/libgnu_a-asprintf.Po \
+ ./$(DEPDIR)/libgnu_a-base64.Po \
+ ./$(DEPDIR)/libgnu_a-basename-lgpl.Po \
+ ./$(DEPDIR)/libgnu_a-basename.Po ./$(DEPDIR)/libgnu_a-btowc.Po \
+ ./$(DEPDIR)/libgnu_a-calloc.Po ./$(DEPDIR)/libgnu_a-cloexec.Po \
+ ./$(DEPDIR)/libgnu_a-close.Po \
+ ./$(DEPDIR)/libgnu_a-dirname-lgpl.Po \
+ ./$(DEPDIR)/libgnu_a-dirname.Po ./$(DEPDIR)/libgnu_a-dup2.Po \
+ ./$(DEPDIR)/libgnu_a-error.Po ./$(DEPDIR)/libgnu_a-exitfail.Po \
+ ./$(DEPDIR)/libgnu_a-fcntl.Po ./$(DEPDIR)/libgnu_a-fd-hook.Po \
+ ./$(DEPDIR)/libgnu_a-fflush.Po ./$(DEPDIR)/libgnu_a-float.Po \
+ ./$(DEPDIR)/libgnu_a-floor.Po ./$(DEPDIR)/libgnu_a-floorf.Po \
+ ./$(DEPDIR)/libgnu_a-fopen.Po ./$(DEPDIR)/libgnu_a-fpurge.Po \
+ ./$(DEPDIR)/libgnu_a-freading.Po ./$(DEPDIR)/libgnu_a-free.Po \
+ ./$(DEPDIR)/libgnu_a-fseek.Po ./$(DEPDIR)/libgnu_a-fseeko.Po \
+ ./$(DEPDIR)/libgnu_a-fstat.Po ./$(DEPDIR)/libgnu_a-fsusage.Po \
+ ./$(DEPDIR)/libgnu_a-ftell.Po ./$(DEPDIR)/libgnu_a-ftello.Po \
+ ./$(DEPDIR)/libgnu_a-gai_strerror.Po \
+ ./$(DEPDIR)/libgnu_a-getaddrinfo.Po \
+ ./$(DEPDIR)/libgnu_a-getdelim.Po \
+ ./$(DEPDIR)/libgnu_a-getdtablesize.Po \
+ ./$(DEPDIR)/libgnu_a-gethostname.Po \
+ ./$(DEPDIR)/libgnu_a-getline.Po \
+ ./$(DEPDIR)/libgnu_a-getloadavg.Po \
+ ./$(DEPDIR)/libgnu_a-getopt.Po ./$(DEPDIR)/libgnu_a-getopt1.Po \
+ ./$(DEPDIR)/libgnu_a-getprogname.Po \
+ ./$(DEPDIR)/libgnu_a-hard-locale.Po \
+ ./$(DEPDIR)/libgnu_a-ialloc.Po \
+ ./$(DEPDIR)/libgnu_a-idpriv-droptemp.Po \
+ ./$(DEPDIR)/libgnu_a-inet_ntop.Po \
+ ./$(DEPDIR)/libgnu_a-itold.Po \
+ ./$(DEPDIR)/libgnu_a-lc-charset-dispatch.Po \
+ ./$(DEPDIR)/libgnu_a-localcharset.Po \
+ ./$(DEPDIR)/libgnu_a-localeconv.Po \
+ ./$(DEPDIR)/libgnu_a-lseek.Po ./$(DEPDIR)/libgnu_a-malloc.Po \
+ ./$(DEPDIR)/libgnu_a-malloca.Po ./$(DEPDIR)/libgnu_a-math.Po \
+ ./$(DEPDIR)/libgnu_a-mbrtowc.Po \
+ ./$(DEPDIR)/libgnu_a-mbsinit.Po \
+ ./$(DEPDIR)/libgnu_a-mbtowc-lock.Po \
+ ./$(DEPDIR)/libgnu_a-mbtowc.Po ./$(DEPDIR)/libgnu_a-memchr.Po \
+ ./$(DEPDIR)/libgnu_a-mktime.Po \
+ ./$(DEPDIR)/libgnu_a-mountlist.Po \
+ ./$(DEPDIR)/libgnu_a-msvc-inval.Po \
+ ./$(DEPDIR)/libgnu_a-msvc-nothrow.Po \
+ ./$(DEPDIR)/libgnu_a-nl_langinfo-lock.Po \
+ ./$(DEPDIR)/libgnu_a-nl_langinfo.Po \
+ ./$(DEPDIR)/libgnu_a-open.Po \
+ ./$(DEPDIR)/libgnu_a-printf-args.Po \
+ ./$(DEPDIR)/libgnu_a-printf-parse.Po \
+ ./$(DEPDIR)/libgnu_a-realloc.Po \
+ ./$(DEPDIR)/libgnu_a-reallocarray.Po \
+ ./$(DEPDIR)/libgnu_a-regcomp.Po ./$(DEPDIR)/libgnu_a-regex.Po \
+ ./$(DEPDIR)/libgnu_a-regex_internal.Po \
+ ./$(DEPDIR)/libgnu_a-regexec.Po ./$(DEPDIR)/libgnu_a-setenv.Po \
+ ./$(DEPDIR)/libgnu_a-setlocale-lock.Po \
+ ./$(DEPDIR)/libgnu_a-setlocale_null.Po \
+ ./$(DEPDIR)/libgnu_a-sha256-stream.Po \
+ ./$(DEPDIR)/libgnu_a-sha256.Po \
+ ./$(DEPDIR)/libgnu_a-snprintf.Po \
+ ./$(DEPDIR)/libgnu_a-sockets.Po \
+ ./$(DEPDIR)/libgnu_a-stat-time.Po \
+ ./$(DEPDIR)/libgnu_a-stat-w32.Po ./$(DEPDIR)/libgnu_a-stat.Po \
+ ./$(DEPDIR)/libgnu_a-stdio-read.Po \
+ ./$(DEPDIR)/libgnu_a-stdio-write.Po \
+ ./$(DEPDIR)/libgnu_a-strcasecmp.Po \
+ ./$(DEPDIR)/libgnu_a-strcasestr.Po \
+ ./$(DEPDIR)/libgnu_a-strerror-override.Po \
+ ./$(DEPDIR)/libgnu_a-strerror.Po \
+ ./$(DEPDIR)/libgnu_a-stripslash.Po \
+ ./$(DEPDIR)/libgnu_a-strncasecmp.Po \
+ ./$(DEPDIR)/libgnu_a-strsep.Po ./$(DEPDIR)/libgnu_a-strstr.Po \
+ ./$(DEPDIR)/libgnu_a-sys_socket.Po \
+ ./$(DEPDIR)/libgnu_a-time_r.Po ./$(DEPDIR)/libgnu_a-timegm.Po \
+ ./$(DEPDIR)/libgnu_a-unistd.Po \
+ ./$(DEPDIR)/libgnu_a-unsetenv.Po \
+ ./$(DEPDIR)/libgnu_a-vasnprintf.Po \
+ ./$(DEPDIR)/libgnu_a-vasprintf.Po \
+ ./$(DEPDIR)/libgnu_a-vsnprintf.Po \
+ ./$(DEPDIR)/libgnu_a-wcrtomb.Po \
+ ./$(DEPDIR)/libgnu_a-wctype-h.Po \
+ ./$(DEPDIR)/libgnu_a-windows-mutex.Po \
+ ./$(DEPDIR)/libgnu_a-windows-once.Po \
+ ./$(DEPDIR)/libgnu_a-windows-recmutex.Po \
+ ./$(DEPDIR)/libgnu_a-windows-rwlock.Po \
+ ./$(DEPDIR)/libgnu_a-xalloc-die.Po \
+ ./$(DEPDIR)/libgnu_a-xmalloc.Po ./$(DEPDIR)/libgnu_a-xsize.Po \
+ glthread/$(DEPDIR)/libgnu_a-lock.Po \
+ glthread/$(DEPDIR)/libgnu_a-threadlib.Po \
+ malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Po \
+ malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Po \
+ malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Po \
+ malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Po \
+ malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Po \
+ malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Po
+am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES)
+DIST_SOURCES = $(am__libgnu_a_SOURCES_DIST) $(EXTRA_libgnu_a_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+HEADERS = $(noinst_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/mkinstalldirs
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+AUTOMAKE_OPTIONS = 1.14 gnits subdir-objects
+SUBDIRS =
+noinst_HEADERS =
+noinst_LIBRARIES = libgnu.a
+noinst_LTLIBRARIES =
+# No GNU Make output.
+EXTRA_DIST = m4/gnulib-cache.m4 alloca.in.h arpa_inet.in.h assert.in.h \
+ verify.h attribute.h basename-lgpl.h byteswap.in.h calloc.c \
+ calloc.c cloexec.h af_alg.h sys-limits.h gl_openssl.h sha256.h \
+ stripslash.c dirname.h errno.in.h error.h exitfail.h \
+ fcntl.in.h fd-hook.h stdio-impl.h filename.h float.in.h \
+ floor.c fopen.c fopen.c stdio-impl.h freading.h stdio-impl.h \
+ stdio-impl.h stat-w32.c stat-w32.h fsusage.h stdio-impl.h \
+ w32sock.h getopt-cdefs.in.h getopt-core.h getopt-ext.h \
+ getopt-pfx-core.h getopt-pfx-ext.h getopt.in.h getopt_int.h \
+ dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h \
+ hard-locale.h ialloc.h idpriv.h intprops-internal.h intprops.h \
+ inttypes.in.h langinfo.in.h cdefs.h libc-config.h limits.in.h \
+ localcharset.h locale.in.h malloc.c malloc.c malloca.h \
+ math.in.h lc-charset-dispatch.c lc-charset-dispatch.h \
+ mbrtowc-impl-utf8.h mbrtowc-impl.h mbtowc-lock.c mbtowc-lock.h \
+ windows-initguard.h mbtowc-impl.h memchr.valgrind \
+ mktime-internal.h mktime.c mktime-internal.h mktime.c \
+ mountlist.h msvc-inval.h msvc-nothrow.h netdb.in.h \
+ netinet_in.in.h windows-initguard.h pathmax.h realloc.c \
+ realloc.c regcomp.c regex.h regex_internal.c regex_internal.h \
+ regexec.c setlocale_null.h windows-initguard.h _Noreturn.h \
+ arg-nonnull.h c++defs.h warn-on-use.h snprintf.c w32sock.h \
+ stat-w32.c stat-w32.h stat-time.h stdalign.in.h \
+ intprops-internal.h stdckdint.in.h stddef.in.h stdint.in.h \
+ stdio.in.h stdlib.in.h strcasestr.c str-two-way.h strcasestr.c \
+ streq.h strerror-override.h string.in.h strings.in.h \
+ str-two-way.h strstr.c sys_socket.in.h sys_stat.in.h \
+ sys_types.in.h sys_uio.in.h time.in.h mktime-internal.h \
+ unistd.in.h unlocked-io.h asnprintf.c float+.h printf-args.c \
+ printf-args.h printf-parse.c printf-parse.h vasnprintf.c \
+ vasnprintf.h asprintf.c vasprintf.c verify.h vsnprintf.c \
+ wchar.in.h wctype.in.h windows-initguard.h windows-mutex.h \
+ windows-once.h windows-initguard.h windows-recmutex.h \
+ windows-initguard.h windows-rwlock.h xalloc.h xalloc.h \
+ xalloc-oversized.h
+BUILT_SOURCES = $(ALLOCA_H) arpa/inet.h $(ASSERT_H) $(BYTESWAP_H) \
+ $(ERRNO_H) fcntl.h $(FLOAT_H) $(GETOPT_H) $(GETOPT_CDEFS_H) \
+ malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h inttypes.h \
+ langinfo.h $(LIMITS_H) locale.h math.h netdb.h $(NETINET_IN_H) \
+ $(STDALIGN_H) $(STDCKDINT_H) $(STDDEF_H) $(STDINT_H) stdio.h \
+ stdlib.h string.h strings.h sys/socket.h sys/stat.h \
+ sys/types.h sys/uio.h time.h unistd.h wchar.h wctype.h
+SUFFIXES =
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
+ arpa/inet.h-t assert.h assert.h-t byteswap.h byteswap.h-t \
+ errno.h errno.h-t fcntl.h fcntl.h-t float.h float.h-t getopt.h \
+ getopt.h-t getopt-cdefs.h getopt-cdefs.h-t \
+ malloc/dynarray.gl.h malloc/dynarray.gl.h-t \
+ malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t \
+ inttypes.h inttypes.h-t langinfo.h langinfo.h-t limits.h \
+ limits.h-t locale.h locale.h-t math.h math.h-t netdb.h \
+ netdb.h-t netinet/in.h netinet/in.h-t stdalign.h stdalign.h-t \
+ stdckdint.h stdckdint.h-t stddef.h stddef.h-t stdint.h \
+ stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t string.h \
+ string.h-t strings.h strings.h-t sys/socket.h sys/socket.h-t \
+ sys/stat.h sys/stat.h-t sys/types.h sys/types.h-t sys/uio.h \
+ sys/uio.h-t time.h time.h-t unistd.h unistd.h-t wchar.h \
+ wchar.h-t wctype.h wctype.h-t
+MOSTLYCLEANDIRS = arpa netinet sys sys sys
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+AM_CPPFLAGS =
+AM_CFLAGS =
+libgnu_a_SOURCES = base64.h base64.c basename-lgpl.c $(am__append_1) \
+ cloexec.c $(am__append_2) af_alg.c sha256-stream.c sha256.c \
+ dirname.c basename.c dirname-lgpl.c stripslash.c \
+ $(am__append_3) $(am__append_4) exitfail.c $(am__append_5) \
+ fd-hook.c $(am__append_6) $(am__append_7) $(am__append_8) \
+ $(am__append_9) $(am__append_10) freading.c $(am__append_11) \
+ $(am__append_12) $(am__append_13) $(am__append_14) \
+ $(am__append_15) $(am__append_16) $(am__append_17) \
+ $(am__append_18) $(am__append_19) $(am__append_20) \
+ $(am__append_21) $(am__append_22) $(am__append_23) \
+ $(am__append_24) $(am__append_25) getprogname.h getprogname.c \
+ gettext.h malloc/dynarray_at_failure.c \
+ malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c \
+ malloc/dynarray_resize.c malloc/dynarray_resize_clear.c \
+ hard-locale.c ialloc.c idpriv-droptemp.c idx.h \
+ $(am__append_26) localcharset.c $(am__append_27) \
+ glthread/lock.h glthread/lock.c $(am__append_28) malloca.c \
+ math.c $(am__append_29) $(am__append_30) $(am__append_31) \
+ $(am__append_32) minmax.h $(am__append_33) $(am__append_34) \
+ $(am__append_35) $(am__append_36) $(am__append_37) \
+ $(am__append_38) $(am__append_39) $(am__append_40) \
+ $(am__append_41) setlocale_null.c $(am__append_42) size_max.h \
+ sockets.h sockets.c $(am__append_43) stat-time.c \
+ $(am__append_44) $(am__append_45) $(am__append_46) \
+ $(am__append_47) $(am__append_48) $(am__append_49) \
+ $(am__append_50) sys_socket.c glthread/threadlib.c \
+ $(am__append_51) $(am__append_52) unistd.c $(am__append_53) \
+ $(am__append_54) wctype-h.c $(am__append_55) $(am__append_56) \
+ $(am__append_57) $(am__append_58) xmalloc.c xalloc-die.c \
+ xsize.h xsize.c
+libgnu_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
+libgnu_a_LIBADD = $(gl_LIBOBJS)
+libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
+EXTRA_libgnu_a_SOURCES = calloc.c calloc.c stripslash.c floor.c \
+ fopen.c fopen.c stat-w32.c malloc/dynarray-skeleton.c malloc.c \
+ malloc.c lc-charset-dispatch.c mbtowc-lock.c mktime.c mktime.c \
+ realloc.c realloc.c regcomp.c regex_internal.c regexec.c \
+ snprintf.c stat-w32.c strcasestr.c strcasestr.c strstr.c \
+ asnprintf.c printf-args.c printf-parse.c vasnprintf.c \
+ asprintf.c vasprintf.c vsnprintf.c
+
+# Use this preprocessor expression to decide whether #include_next works.
+# Do not rely on a 'configure'-time test for this, since the expression
+# might appear in an installed header, which is used by some other compiler.
+HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
+
+# In 'sed', replace the pattern space with a "DO NOT EDIT" comment.
+SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,
+
+# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT".
+SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G
+
+# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading
+# "DO_NOT_EDIT". Although this could be done more simply via:
+# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t
+# the -n and 'w' avoid a fork+exec, at least when GNU Make is used.
+SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
+
+# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
+gl_V_at = $(AM_V_GEN)
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(srcdir)/_Noreturn.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+ARG_NONNULL_H = $(srcdir)/arg-nonnull.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+CXXDEFS_H = $(srcdir)/c++defs.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+WARN_ON_USE_H = $(srcdir)/warn-on-use.h
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits gl/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnits gl/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+malloc/$(am__dirstamp):
+ @$(MKDIR_P) malloc
+ @: > malloc/$(am__dirstamp)
+malloc/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) malloc/$(DEPDIR)
+ @: > malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_a-dynarray_at_failure.$(OBJEXT): malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_a-dynarray_emplace_enlarge.$(OBJEXT): \
+ malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_a-dynarray_finalize.$(OBJEXT): malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_a-dynarray_resize.$(OBJEXT): malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_a-dynarray_resize_clear.$(OBJEXT): \
+ malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
+glthread/$(am__dirstamp):
+ @$(MKDIR_P) glthread
+ @: > glthread/$(am__dirstamp)
+glthread/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) glthread/$(DEPDIR)
+ @: > glthread/$(DEPDIR)/$(am__dirstamp)
+glthread/libgnu_a-lock.$(OBJEXT): glthread/$(am__dirstamp) \
+ glthread/$(DEPDIR)/$(am__dirstamp)
+glthread/libgnu_a-threadlib.$(OBJEXT): glthread/$(am__dirstamp) \
+ glthread/$(DEPDIR)/$(am__dirstamp)
+malloc/libgnu_a-dynarray-skeleton.$(OBJEXT): malloc/$(am__dirstamp) \
+ malloc/$(DEPDIR)/$(am__dirstamp)
+
+libgnu.a: $(libgnu_a_OBJECTS) $(libgnu_a_DEPENDENCIES) $(EXTRA_libgnu_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libgnu.a
+ $(AM_V_AR)$(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) $(libgnu_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libgnu.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f glthread/*.$(OBJEXT)
+ -rm -f malloc/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-af_alg.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-asnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-asprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-base64.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-basename-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-basename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-btowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-calloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-cloexec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-close.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-dirname-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-dirname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-dup2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-error.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-exitfail.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fcntl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fd-hook.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fflush.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-float.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-floor.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-floorf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fpurge.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-freading.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-free.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fseek.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fseeko.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-fsusage.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-ftell.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-ftello.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-gai_strerror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getaddrinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getdelim.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getdtablesize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-gethostname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getline.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getloadavg.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getopt1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-getprogname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-hard-locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-ialloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-idpriv-droptemp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-inet_ntop.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-itold.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-lc-charset-dispatch.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-localcharset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-localeconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-lseek.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-malloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-malloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-math.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-mbrtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-mbsinit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-mbtowc-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-mbtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-memchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-mktime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-mountlist.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-msvc-inval.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-msvc-nothrow.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-nl_langinfo-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-nl_langinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-open.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-printf-args.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-printf-parse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-realloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-reallocarray.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-regcomp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-regex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-regex_internal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-regexec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-setenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-setlocale-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-setlocale_null.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-sha256-stream.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-sha256.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-snprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-sockets.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-stat-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-stat-w32.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-stat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-stdio-read.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-stdio-write.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-strcasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-strcasestr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-strerror-override.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-strerror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-stripslash.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-strncasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-strsep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-strstr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-sys_socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-time_r.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-timegm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-unistd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-unsetenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-vasnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-vasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-vsnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-wcrtomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-wctype-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-windows-mutex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-windows-once.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-windows-recmutex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-windows-rwlock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-xalloc-die.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-xmalloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_a-xsize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/libgnu_a-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/libgnu_a-threadlib.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+libgnu_a-base64.o: base64.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-base64.o -MD -MP -MF $(DEPDIR)/libgnu_a-base64.Tpo -c -o libgnu_a-base64.o `test -f 'base64.c' || echo '$(srcdir)/'`base64.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-base64.Tpo $(DEPDIR)/libgnu_a-base64.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='base64.c' object='libgnu_a-base64.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-base64.o `test -f 'base64.c' || echo '$(srcdir)/'`base64.c
+
+libgnu_a-base64.obj: base64.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-base64.obj -MD -MP -MF $(DEPDIR)/libgnu_a-base64.Tpo -c -o libgnu_a-base64.obj `if test -f 'base64.c'; then $(CYGPATH_W) 'base64.c'; else $(CYGPATH_W) '$(srcdir)/base64.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-base64.Tpo $(DEPDIR)/libgnu_a-base64.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='base64.c' object='libgnu_a-base64.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-base64.obj `if test -f 'base64.c'; then $(CYGPATH_W) 'base64.c'; else $(CYGPATH_W) '$(srcdir)/base64.c'; fi`
+
+libgnu_a-basename-lgpl.o: basename-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-basename-lgpl.o -MD -MP -MF $(DEPDIR)/libgnu_a-basename-lgpl.Tpo -c -o libgnu_a-basename-lgpl.o `test -f 'basename-lgpl.c' || echo '$(srcdir)/'`basename-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-basename-lgpl.Tpo $(DEPDIR)/libgnu_a-basename-lgpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basename-lgpl.c' object='libgnu_a-basename-lgpl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-basename-lgpl.o `test -f 'basename-lgpl.c' || echo '$(srcdir)/'`basename-lgpl.c
+
+libgnu_a-basename-lgpl.obj: basename-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-basename-lgpl.obj -MD -MP -MF $(DEPDIR)/libgnu_a-basename-lgpl.Tpo -c -o libgnu_a-basename-lgpl.obj `if test -f 'basename-lgpl.c'; then $(CYGPATH_W) 'basename-lgpl.c'; else $(CYGPATH_W) '$(srcdir)/basename-lgpl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-basename-lgpl.Tpo $(DEPDIR)/libgnu_a-basename-lgpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basename-lgpl.c' object='libgnu_a-basename-lgpl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-basename-lgpl.obj `if test -f 'basename-lgpl.c'; then $(CYGPATH_W) 'basename-lgpl.c'; else $(CYGPATH_W) '$(srcdir)/basename-lgpl.c'; fi`
+
+libgnu_a-btowc.o: btowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-btowc.o -MD -MP -MF $(DEPDIR)/libgnu_a-btowc.Tpo -c -o libgnu_a-btowc.o `test -f 'btowc.c' || echo '$(srcdir)/'`btowc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-btowc.Tpo $(DEPDIR)/libgnu_a-btowc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btowc.c' object='libgnu_a-btowc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-btowc.o `test -f 'btowc.c' || echo '$(srcdir)/'`btowc.c
+
+libgnu_a-btowc.obj: btowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-btowc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-btowc.Tpo -c -o libgnu_a-btowc.obj `if test -f 'btowc.c'; then $(CYGPATH_W) 'btowc.c'; else $(CYGPATH_W) '$(srcdir)/btowc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-btowc.Tpo $(DEPDIR)/libgnu_a-btowc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btowc.c' object='libgnu_a-btowc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-btowc.obj `if test -f 'btowc.c'; then $(CYGPATH_W) 'btowc.c'; else $(CYGPATH_W) '$(srcdir)/btowc.c'; fi`
+
+libgnu_a-cloexec.o: cloexec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-cloexec.o -MD -MP -MF $(DEPDIR)/libgnu_a-cloexec.Tpo -c -o libgnu_a-cloexec.o `test -f 'cloexec.c' || echo '$(srcdir)/'`cloexec.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-cloexec.Tpo $(DEPDIR)/libgnu_a-cloexec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cloexec.c' object='libgnu_a-cloexec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-cloexec.o `test -f 'cloexec.c' || echo '$(srcdir)/'`cloexec.c
+
+libgnu_a-cloexec.obj: cloexec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-cloexec.obj -MD -MP -MF $(DEPDIR)/libgnu_a-cloexec.Tpo -c -o libgnu_a-cloexec.obj `if test -f 'cloexec.c'; then $(CYGPATH_W) 'cloexec.c'; else $(CYGPATH_W) '$(srcdir)/cloexec.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-cloexec.Tpo $(DEPDIR)/libgnu_a-cloexec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cloexec.c' object='libgnu_a-cloexec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-cloexec.obj `if test -f 'cloexec.c'; then $(CYGPATH_W) 'cloexec.c'; else $(CYGPATH_W) '$(srcdir)/cloexec.c'; fi`
+
+libgnu_a-close.o: close.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-close.o -MD -MP -MF $(DEPDIR)/libgnu_a-close.Tpo -c -o libgnu_a-close.o `test -f 'close.c' || echo '$(srcdir)/'`close.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-close.Tpo $(DEPDIR)/libgnu_a-close.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='close.c' object='libgnu_a-close.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-close.o `test -f 'close.c' || echo '$(srcdir)/'`close.c
+
+libgnu_a-close.obj: close.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-close.obj -MD -MP -MF $(DEPDIR)/libgnu_a-close.Tpo -c -o libgnu_a-close.obj `if test -f 'close.c'; then $(CYGPATH_W) 'close.c'; else $(CYGPATH_W) '$(srcdir)/close.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-close.Tpo $(DEPDIR)/libgnu_a-close.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='close.c' object='libgnu_a-close.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-close.obj `if test -f 'close.c'; then $(CYGPATH_W) 'close.c'; else $(CYGPATH_W) '$(srcdir)/close.c'; fi`
+
+libgnu_a-af_alg.o: af_alg.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-af_alg.o -MD -MP -MF $(DEPDIR)/libgnu_a-af_alg.Tpo -c -o libgnu_a-af_alg.o `test -f 'af_alg.c' || echo '$(srcdir)/'`af_alg.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-af_alg.Tpo $(DEPDIR)/libgnu_a-af_alg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='af_alg.c' object='libgnu_a-af_alg.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-af_alg.o `test -f 'af_alg.c' || echo '$(srcdir)/'`af_alg.c
+
+libgnu_a-af_alg.obj: af_alg.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-af_alg.obj -MD -MP -MF $(DEPDIR)/libgnu_a-af_alg.Tpo -c -o libgnu_a-af_alg.obj `if test -f 'af_alg.c'; then $(CYGPATH_W) 'af_alg.c'; else $(CYGPATH_W) '$(srcdir)/af_alg.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-af_alg.Tpo $(DEPDIR)/libgnu_a-af_alg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='af_alg.c' object='libgnu_a-af_alg.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-af_alg.obj `if test -f 'af_alg.c'; then $(CYGPATH_W) 'af_alg.c'; else $(CYGPATH_W) '$(srcdir)/af_alg.c'; fi`
+
+libgnu_a-sha256-stream.o: sha256-stream.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sha256-stream.o -MD -MP -MF $(DEPDIR)/libgnu_a-sha256-stream.Tpo -c -o libgnu_a-sha256-stream.o `test -f 'sha256-stream.c' || echo '$(srcdir)/'`sha256-stream.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sha256-stream.Tpo $(DEPDIR)/libgnu_a-sha256-stream.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sha256-stream.c' object='libgnu_a-sha256-stream.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sha256-stream.o `test -f 'sha256-stream.c' || echo '$(srcdir)/'`sha256-stream.c
+
+libgnu_a-sha256-stream.obj: sha256-stream.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sha256-stream.obj -MD -MP -MF $(DEPDIR)/libgnu_a-sha256-stream.Tpo -c -o libgnu_a-sha256-stream.obj `if test -f 'sha256-stream.c'; then $(CYGPATH_W) 'sha256-stream.c'; else $(CYGPATH_W) '$(srcdir)/sha256-stream.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sha256-stream.Tpo $(DEPDIR)/libgnu_a-sha256-stream.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sha256-stream.c' object='libgnu_a-sha256-stream.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sha256-stream.obj `if test -f 'sha256-stream.c'; then $(CYGPATH_W) 'sha256-stream.c'; else $(CYGPATH_W) '$(srcdir)/sha256-stream.c'; fi`
+
+libgnu_a-sha256.o: sha256.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sha256.o -MD -MP -MF $(DEPDIR)/libgnu_a-sha256.Tpo -c -o libgnu_a-sha256.o `test -f 'sha256.c' || echo '$(srcdir)/'`sha256.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sha256.Tpo $(DEPDIR)/libgnu_a-sha256.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sha256.c' object='libgnu_a-sha256.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sha256.o `test -f 'sha256.c' || echo '$(srcdir)/'`sha256.c
+
+libgnu_a-sha256.obj: sha256.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sha256.obj -MD -MP -MF $(DEPDIR)/libgnu_a-sha256.Tpo -c -o libgnu_a-sha256.obj `if test -f 'sha256.c'; then $(CYGPATH_W) 'sha256.c'; else $(CYGPATH_W) '$(srcdir)/sha256.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sha256.Tpo $(DEPDIR)/libgnu_a-sha256.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sha256.c' object='libgnu_a-sha256.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sha256.obj `if test -f 'sha256.c'; then $(CYGPATH_W) 'sha256.c'; else $(CYGPATH_W) '$(srcdir)/sha256.c'; fi`
+
+libgnu_a-dirname.o: dirname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-dirname.o -MD -MP -MF $(DEPDIR)/libgnu_a-dirname.Tpo -c -o libgnu_a-dirname.o `test -f 'dirname.c' || echo '$(srcdir)/'`dirname.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-dirname.Tpo $(DEPDIR)/libgnu_a-dirname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirname.c' object='libgnu_a-dirname.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-dirname.o `test -f 'dirname.c' || echo '$(srcdir)/'`dirname.c
+
+libgnu_a-dirname.obj: dirname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-dirname.obj -MD -MP -MF $(DEPDIR)/libgnu_a-dirname.Tpo -c -o libgnu_a-dirname.obj `if test -f 'dirname.c'; then $(CYGPATH_W) 'dirname.c'; else $(CYGPATH_W) '$(srcdir)/dirname.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-dirname.Tpo $(DEPDIR)/libgnu_a-dirname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirname.c' object='libgnu_a-dirname.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-dirname.obj `if test -f 'dirname.c'; then $(CYGPATH_W) 'dirname.c'; else $(CYGPATH_W) '$(srcdir)/dirname.c'; fi`
+
+libgnu_a-basename.o: basename.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-basename.o -MD -MP -MF $(DEPDIR)/libgnu_a-basename.Tpo -c -o libgnu_a-basename.o `test -f 'basename.c' || echo '$(srcdir)/'`basename.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-basename.Tpo $(DEPDIR)/libgnu_a-basename.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basename.c' object='libgnu_a-basename.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-basename.o `test -f 'basename.c' || echo '$(srcdir)/'`basename.c
+
+libgnu_a-basename.obj: basename.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-basename.obj -MD -MP -MF $(DEPDIR)/libgnu_a-basename.Tpo -c -o libgnu_a-basename.obj `if test -f 'basename.c'; then $(CYGPATH_W) 'basename.c'; else $(CYGPATH_W) '$(srcdir)/basename.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-basename.Tpo $(DEPDIR)/libgnu_a-basename.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basename.c' object='libgnu_a-basename.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-basename.obj `if test -f 'basename.c'; then $(CYGPATH_W) 'basename.c'; else $(CYGPATH_W) '$(srcdir)/basename.c'; fi`
+
+libgnu_a-dirname-lgpl.o: dirname-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-dirname-lgpl.o -MD -MP -MF $(DEPDIR)/libgnu_a-dirname-lgpl.Tpo -c -o libgnu_a-dirname-lgpl.o `test -f 'dirname-lgpl.c' || echo '$(srcdir)/'`dirname-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-dirname-lgpl.Tpo $(DEPDIR)/libgnu_a-dirname-lgpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirname-lgpl.c' object='libgnu_a-dirname-lgpl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-dirname-lgpl.o `test -f 'dirname-lgpl.c' || echo '$(srcdir)/'`dirname-lgpl.c
+
+libgnu_a-dirname-lgpl.obj: dirname-lgpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-dirname-lgpl.obj -MD -MP -MF $(DEPDIR)/libgnu_a-dirname-lgpl.Tpo -c -o libgnu_a-dirname-lgpl.obj `if test -f 'dirname-lgpl.c'; then $(CYGPATH_W) 'dirname-lgpl.c'; else $(CYGPATH_W) '$(srcdir)/dirname-lgpl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-dirname-lgpl.Tpo $(DEPDIR)/libgnu_a-dirname-lgpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dirname-lgpl.c' object='libgnu_a-dirname-lgpl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-dirname-lgpl.obj `if test -f 'dirname-lgpl.c'; then $(CYGPATH_W) 'dirname-lgpl.c'; else $(CYGPATH_W) '$(srcdir)/dirname-lgpl.c'; fi`
+
+libgnu_a-stripslash.o: stripslash.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stripslash.o -MD -MP -MF $(DEPDIR)/libgnu_a-stripslash.Tpo -c -o libgnu_a-stripslash.o `test -f 'stripslash.c' || echo '$(srcdir)/'`stripslash.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stripslash.Tpo $(DEPDIR)/libgnu_a-stripslash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stripslash.c' object='libgnu_a-stripslash.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stripslash.o `test -f 'stripslash.c' || echo '$(srcdir)/'`stripslash.c
+
+libgnu_a-stripslash.obj: stripslash.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stripslash.obj -MD -MP -MF $(DEPDIR)/libgnu_a-stripslash.Tpo -c -o libgnu_a-stripslash.obj `if test -f 'stripslash.c'; then $(CYGPATH_W) 'stripslash.c'; else $(CYGPATH_W) '$(srcdir)/stripslash.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stripslash.Tpo $(DEPDIR)/libgnu_a-stripslash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stripslash.c' object='libgnu_a-stripslash.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stripslash.obj `if test -f 'stripslash.c'; then $(CYGPATH_W) 'stripslash.c'; else $(CYGPATH_W) '$(srcdir)/stripslash.c'; fi`
+
+libgnu_a-dup2.o: dup2.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-dup2.o -MD -MP -MF $(DEPDIR)/libgnu_a-dup2.Tpo -c -o libgnu_a-dup2.o `test -f 'dup2.c' || echo '$(srcdir)/'`dup2.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-dup2.Tpo $(DEPDIR)/libgnu_a-dup2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dup2.c' object='libgnu_a-dup2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-dup2.o `test -f 'dup2.c' || echo '$(srcdir)/'`dup2.c
+
+libgnu_a-dup2.obj: dup2.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-dup2.obj -MD -MP -MF $(DEPDIR)/libgnu_a-dup2.Tpo -c -o libgnu_a-dup2.obj `if test -f 'dup2.c'; then $(CYGPATH_W) 'dup2.c'; else $(CYGPATH_W) '$(srcdir)/dup2.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-dup2.Tpo $(DEPDIR)/libgnu_a-dup2.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dup2.c' object='libgnu_a-dup2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-dup2.obj `if test -f 'dup2.c'; then $(CYGPATH_W) 'dup2.c'; else $(CYGPATH_W) '$(srcdir)/dup2.c'; fi`
+
+libgnu_a-error.o: error.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-error.o -MD -MP -MF $(DEPDIR)/libgnu_a-error.Tpo -c -o libgnu_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-error.Tpo $(DEPDIR)/libgnu_a-error.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='libgnu_a-error.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c
+
+libgnu_a-error.obj: error.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-error.obj -MD -MP -MF $(DEPDIR)/libgnu_a-error.Tpo -c -o libgnu_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-error.Tpo $(DEPDIR)/libgnu_a-error.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='libgnu_a-error.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi`
+
+libgnu_a-exitfail.o: exitfail.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-exitfail.o -MD -MP -MF $(DEPDIR)/libgnu_a-exitfail.Tpo -c -o libgnu_a-exitfail.o `test -f 'exitfail.c' || echo '$(srcdir)/'`exitfail.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-exitfail.Tpo $(DEPDIR)/libgnu_a-exitfail.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exitfail.c' object='libgnu_a-exitfail.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-exitfail.o `test -f 'exitfail.c' || echo '$(srcdir)/'`exitfail.c
+
+libgnu_a-exitfail.obj: exitfail.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-exitfail.obj -MD -MP -MF $(DEPDIR)/libgnu_a-exitfail.Tpo -c -o libgnu_a-exitfail.obj `if test -f 'exitfail.c'; then $(CYGPATH_W) 'exitfail.c'; else $(CYGPATH_W) '$(srcdir)/exitfail.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-exitfail.Tpo $(DEPDIR)/libgnu_a-exitfail.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='exitfail.c' object='libgnu_a-exitfail.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-exitfail.obj `if test -f 'exitfail.c'; then $(CYGPATH_W) 'exitfail.c'; else $(CYGPATH_W) '$(srcdir)/exitfail.c'; fi`
+
+libgnu_a-fcntl.o: fcntl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fcntl.o -MD -MP -MF $(DEPDIR)/libgnu_a-fcntl.Tpo -c -o libgnu_a-fcntl.o `test -f 'fcntl.c' || echo '$(srcdir)/'`fcntl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fcntl.Tpo $(DEPDIR)/libgnu_a-fcntl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fcntl.c' object='libgnu_a-fcntl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fcntl.o `test -f 'fcntl.c' || echo '$(srcdir)/'`fcntl.c
+
+libgnu_a-fcntl.obj: fcntl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fcntl.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fcntl.Tpo -c -o libgnu_a-fcntl.obj `if test -f 'fcntl.c'; then $(CYGPATH_W) 'fcntl.c'; else $(CYGPATH_W) '$(srcdir)/fcntl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fcntl.Tpo $(DEPDIR)/libgnu_a-fcntl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fcntl.c' object='libgnu_a-fcntl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fcntl.obj `if test -f 'fcntl.c'; then $(CYGPATH_W) 'fcntl.c'; else $(CYGPATH_W) '$(srcdir)/fcntl.c'; fi`
+
+libgnu_a-fd-hook.o: fd-hook.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fd-hook.o -MD -MP -MF $(DEPDIR)/libgnu_a-fd-hook.Tpo -c -o libgnu_a-fd-hook.o `test -f 'fd-hook.c' || echo '$(srcdir)/'`fd-hook.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fd-hook.Tpo $(DEPDIR)/libgnu_a-fd-hook.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fd-hook.c' object='libgnu_a-fd-hook.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fd-hook.o `test -f 'fd-hook.c' || echo '$(srcdir)/'`fd-hook.c
+
+libgnu_a-fd-hook.obj: fd-hook.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fd-hook.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fd-hook.Tpo -c -o libgnu_a-fd-hook.obj `if test -f 'fd-hook.c'; then $(CYGPATH_W) 'fd-hook.c'; else $(CYGPATH_W) '$(srcdir)/fd-hook.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fd-hook.Tpo $(DEPDIR)/libgnu_a-fd-hook.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fd-hook.c' object='libgnu_a-fd-hook.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fd-hook.obj `if test -f 'fd-hook.c'; then $(CYGPATH_W) 'fd-hook.c'; else $(CYGPATH_W) '$(srcdir)/fd-hook.c'; fi`
+
+libgnu_a-fflush.o: fflush.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fflush.o -MD -MP -MF $(DEPDIR)/libgnu_a-fflush.Tpo -c -o libgnu_a-fflush.o `test -f 'fflush.c' || echo '$(srcdir)/'`fflush.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fflush.Tpo $(DEPDIR)/libgnu_a-fflush.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fflush.c' object='libgnu_a-fflush.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fflush.o `test -f 'fflush.c' || echo '$(srcdir)/'`fflush.c
+
+libgnu_a-fflush.obj: fflush.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fflush.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fflush.Tpo -c -o libgnu_a-fflush.obj `if test -f 'fflush.c'; then $(CYGPATH_W) 'fflush.c'; else $(CYGPATH_W) '$(srcdir)/fflush.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fflush.Tpo $(DEPDIR)/libgnu_a-fflush.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fflush.c' object='libgnu_a-fflush.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fflush.obj `if test -f 'fflush.c'; then $(CYGPATH_W) 'fflush.c'; else $(CYGPATH_W) '$(srcdir)/fflush.c'; fi`
+
+libgnu_a-float.o: float.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-float.o -MD -MP -MF $(DEPDIR)/libgnu_a-float.Tpo -c -o libgnu_a-float.o `test -f 'float.c' || echo '$(srcdir)/'`float.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-float.Tpo $(DEPDIR)/libgnu_a-float.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='float.c' object='libgnu_a-float.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-float.o `test -f 'float.c' || echo '$(srcdir)/'`float.c
+
+libgnu_a-float.obj: float.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-float.obj -MD -MP -MF $(DEPDIR)/libgnu_a-float.Tpo -c -o libgnu_a-float.obj `if test -f 'float.c'; then $(CYGPATH_W) 'float.c'; else $(CYGPATH_W) '$(srcdir)/float.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-float.Tpo $(DEPDIR)/libgnu_a-float.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='float.c' object='libgnu_a-float.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-float.obj `if test -f 'float.c'; then $(CYGPATH_W) 'float.c'; else $(CYGPATH_W) '$(srcdir)/float.c'; fi`
+
+libgnu_a-itold.o: itold.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-itold.o -MD -MP -MF $(DEPDIR)/libgnu_a-itold.Tpo -c -o libgnu_a-itold.o `test -f 'itold.c' || echo '$(srcdir)/'`itold.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-itold.Tpo $(DEPDIR)/libgnu_a-itold.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='itold.c' object='libgnu_a-itold.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-itold.o `test -f 'itold.c' || echo '$(srcdir)/'`itold.c
+
+libgnu_a-itold.obj: itold.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-itold.obj -MD -MP -MF $(DEPDIR)/libgnu_a-itold.Tpo -c -o libgnu_a-itold.obj `if test -f 'itold.c'; then $(CYGPATH_W) 'itold.c'; else $(CYGPATH_W) '$(srcdir)/itold.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-itold.Tpo $(DEPDIR)/libgnu_a-itold.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='itold.c' object='libgnu_a-itold.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-itold.obj `if test -f 'itold.c'; then $(CYGPATH_W) 'itold.c'; else $(CYGPATH_W) '$(srcdir)/itold.c'; fi`
+
+libgnu_a-floorf.o: floorf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-floorf.o -MD -MP -MF $(DEPDIR)/libgnu_a-floorf.Tpo -c -o libgnu_a-floorf.o `test -f 'floorf.c' || echo '$(srcdir)/'`floorf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-floorf.Tpo $(DEPDIR)/libgnu_a-floorf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='floorf.c' object='libgnu_a-floorf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-floorf.o `test -f 'floorf.c' || echo '$(srcdir)/'`floorf.c
+
+libgnu_a-floorf.obj: floorf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-floorf.obj -MD -MP -MF $(DEPDIR)/libgnu_a-floorf.Tpo -c -o libgnu_a-floorf.obj `if test -f 'floorf.c'; then $(CYGPATH_W) 'floorf.c'; else $(CYGPATH_W) '$(srcdir)/floorf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-floorf.Tpo $(DEPDIR)/libgnu_a-floorf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='floorf.c' object='libgnu_a-floorf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-floorf.obj `if test -f 'floorf.c'; then $(CYGPATH_W) 'floorf.c'; else $(CYGPATH_W) '$(srcdir)/floorf.c'; fi`
+
+libgnu_a-fpurge.o: fpurge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fpurge.o -MD -MP -MF $(DEPDIR)/libgnu_a-fpurge.Tpo -c -o libgnu_a-fpurge.o `test -f 'fpurge.c' || echo '$(srcdir)/'`fpurge.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fpurge.Tpo $(DEPDIR)/libgnu_a-fpurge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fpurge.c' object='libgnu_a-fpurge.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fpurge.o `test -f 'fpurge.c' || echo '$(srcdir)/'`fpurge.c
+
+libgnu_a-fpurge.obj: fpurge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fpurge.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fpurge.Tpo -c -o libgnu_a-fpurge.obj `if test -f 'fpurge.c'; then $(CYGPATH_W) 'fpurge.c'; else $(CYGPATH_W) '$(srcdir)/fpurge.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fpurge.Tpo $(DEPDIR)/libgnu_a-fpurge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fpurge.c' object='libgnu_a-fpurge.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fpurge.obj `if test -f 'fpurge.c'; then $(CYGPATH_W) 'fpurge.c'; else $(CYGPATH_W) '$(srcdir)/fpurge.c'; fi`
+
+libgnu_a-freading.o: freading.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-freading.o -MD -MP -MF $(DEPDIR)/libgnu_a-freading.Tpo -c -o libgnu_a-freading.o `test -f 'freading.c' || echo '$(srcdir)/'`freading.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-freading.Tpo $(DEPDIR)/libgnu_a-freading.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freading.c' object='libgnu_a-freading.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-freading.o `test -f 'freading.c' || echo '$(srcdir)/'`freading.c
+
+libgnu_a-freading.obj: freading.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-freading.obj -MD -MP -MF $(DEPDIR)/libgnu_a-freading.Tpo -c -o libgnu_a-freading.obj `if test -f 'freading.c'; then $(CYGPATH_W) 'freading.c'; else $(CYGPATH_W) '$(srcdir)/freading.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-freading.Tpo $(DEPDIR)/libgnu_a-freading.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freading.c' object='libgnu_a-freading.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-freading.obj `if test -f 'freading.c'; then $(CYGPATH_W) 'freading.c'; else $(CYGPATH_W) '$(srcdir)/freading.c'; fi`
+
+libgnu_a-free.o: free.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-free.o -MD -MP -MF $(DEPDIR)/libgnu_a-free.Tpo -c -o libgnu_a-free.o `test -f 'free.c' || echo '$(srcdir)/'`free.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-free.Tpo $(DEPDIR)/libgnu_a-free.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='free.c' object='libgnu_a-free.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-free.o `test -f 'free.c' || echo '$(srcdir)/'`free.c
+
+libgnu_a-free.obj: free.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-free.obj -MD -MP -MF $(DEPDIR)/libgnu_a-free.Tpo -c -o libgnu_a-free.obj `if test -f 'free.c'; then $(CYGPATH_W) 'free.c'; else $(CYGPATH_W) '$(srcdir)/free.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-free.Tpo $(DEPDIR)/libgnu_a-free.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='free.c' object='libgnu_a-free.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-free.obj `if test -f 'free.c'; then $(CYGPATH_W) 'free.c'; else $(CYGPATH_W) '$(srcdir)/free.c'; fi`
+
+libgnu_a-fseek.o: fseek.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fseek.o -MD -MP -MF $(DEPDIR)/libgnu_a-fseek.Tpo -c -o libgnu_a-fseek.o `test -f 'fseek.c' || echo '$(srcdir)/'`fseek.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fseek.Tpo $(DEPDIR)/libgnu_a-fseek.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fseek.c' object='libgnu_a-fseek.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fseek.o `test -f 'fseek.c' || echo '$(srcdir)/'`fseek.c
+
+libgnu_a-fseek.obj: fseek.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fseek.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fseek.Tpo -c -o libgnu_a-fseek.obj `if test -f 'fseek.c'; then $(CYGPATH_W) 'fseek.c'; else $(CYGPATH_W) '$(srcdir)/fseek.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fseek.Tpo $(DEPDIR)/libgnu_a-fseek.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fseek.c' object='libgnu_a-fseek.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fseek.obj `if test -f 'fseek.c'; then $(CYGPATH_W) 'fseek.c'; else $(CYGPATH_W) '$(srcdir)/fseek.c'; fi`
+
+libgnu_a-fseeko.o: fseeko.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fseeko.o -MD -MP -MF $(DEPDIR)/libgnu_a-fseeko.Tpo -c -o libgnu_a-fseeko.o `test -f 'fseeko.c' || echo '$(srcdir)/'`fseeko.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fseeko.Tpo $(DEPDIR)/libgnu_a-fseeko.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fseeko.c' object='libgnu_a-fseeko.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fseeko.o `test -f 'fseeko.c' || echo '$(srcdir)/'`fseeko.c
+
+libgnu_a-fseeko.obj: fseeko.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fseeko.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fseeko.Tpo -c -o libgnu_a-fseeko.obj `if test -f 'fseeko.c'; then $(CYGPATH_W) 'fseeko.c'; else $(CYGPATH_W) '$(srcdir)/fseeko.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fseeko.Tpo $(DEPDIR)/libgnu_a-fseeko.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fseeko.c' object='libgnu_a-fseeko.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fseeko.obj `if test -f 'fseeko.c'; then $(CYGPATH_W) 'fseeko.c'; else $(CYGPATH_W) '$(srcdir)/fseeko.c'; fi`
+
+libgnu_a-fstat.o: fstat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fstat.o -MD -MP -MF $(DEPDIR)/libgnu_a-fstat.Tpo -c -o libgnu_a-fstat.o `test -f 'fstat.c' || echo '$(srcdir)/'`fstat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fstat.Tpo $(DEPDIR)/libgnu_a-fstat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat.c' object='libgnu_a-fstat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fstat.o `test -f 'fstat.c' || echo '$(srcdir)/'`fstat.c
+
+libgnu_a-fstat.obj: fstat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fstat.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fstat.Tpo -c -o libgnu_a-fstat.obj `if test -f 'fstat.c'; then $(CYGPATH_W) 'fstat.c'; else $(CYGPATH_W) '$(srcdir)/fstat.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fstat.Tpo $(DEPDIR)/libgnu_a-fstat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fstat.c' object='libgnu_a-fstat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fstat.obj `if test -f 'fstat.c'; then $(CYGPATH_W) 'fstat.c'; else $(CYGPATH_W) '$(srcdir)/fstat.c'; fi`
+
+libgnu_a-fsusage.o: fsusage.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fsusage.o -MD -MP -MF $(DEPDIR)/libgnu_a-fsusage.Tpo -c -o libgnu_a-fsusage.o `test -f 'fsusage.c' || echo '$(srcdir)/'`fsusage.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fsusage.Tpo $(DEPDIR)/libgnu_a-fsusage.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fsusage.c' object='libgnu_a-fsusage.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fsusage.o `test -f 'fsusage.c' || echo '$(srcdir)/'`fsusage.c
+
+libgnu_a-fsusage.obj: fsusage.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fsusage.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fsusage.Tpo -c -o libgnu_a-fsusage.obj `if test -f 'fsusage.c'; then $(CYGPATH_W) 'fsusage.c'; else $(CYGPATH_W) '$(srcdir)/fsusage.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fsusage.Tpo $(DEPDIR)/libgnu_a-fsusage.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fsusage.c' object='libgnu_a-fsusage.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fsusage.obj `if test -f 'fsusage.c'; then $(CYGPATH_W) 'fsusage.c'; else $(CYGPATH_W) '$(srcdir)/fsusage.c'; fi`
+
+libgnu_a-ftell.o: ftell.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-ftell.o -MD -MP -MF $(DEPDIR)/libgnu_a-ftell.Tpo -c -o libgnu_a-ftell.o `test -f 'ftell.c' || echo '$(srcdir)/'`ftell.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-ftell.Tpo $(DEPDIR)/libgnu_a-ftell.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftell.c' object='libgnu_a-ftell.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-ftell.o `test -f 'ftell.c' || echo '$(srcdir)/'`ftell.c
+
+libgnu_a-ftell.obj: ftell.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-ftell.obj -MD -MP -MF $(DEPDIR)/libgnu_a-ftell.Tpo -c -o libgnu_a-ftell.obj `if test -f 'ftell.c'; then $(CYGPATH_W) 'ftell.c'; else $(CYGPATH_W) '$(srcdir)/ftell.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-ftell.Tpo $(DEPDIR)/libgnu_a-ftell.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftell.c' object='libgnu_a-ftell.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-ftell.obj `if test -f 'ftell.c'; then $(CYGPATH_W) 'ftell.c'; else $(CYGPATH_W) '$(srcdir)/ftell.c'; fi`
+
+libgnu_a-ftello.o: ftello.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-ftello.o -MD -MP -MF $(DEPDIR)/libgnu_a-ftello.Tpo -c -o libgnu_a-ftello.o `test -f 'ftello.c' || echo '$(srcdir)/'`ftello.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-ftello.Tpo $(DEPDIR)/libgnu_a-ftello.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftello.c' object='libgnu_a-ftello.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-ftello.o `test -f 'ftello.c' || echo '$(srcdir)/'`ftello.c
+
+libgnu_a-ftello.obj: ftello.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-ftello.obj -MD -MP -MF $(DEPDIR)/libgnu_a-ftello.Tpo -c -o libgnu_a-ftello.obj `if test -f 'ftello.c'; then $(CYGPATH_W) 'ftello.c'; else $(CYGPATH_W) '$(srcdir)/ftello.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-ftello.Tpo $(DEPDIR)/libgnu_a-ftello.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftello.c' object='libgnu_a-ftello.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-ftello.obj `if test -f 'ftello.c'; then $(CYGPATH_W) 'ftello.c'; else $(CYGPATH_W) '$(srcdir)/ftello.c'; fi`
+
+libgnu_a-getaddrinfo.o: getaddrinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getaddrinfo.o -MD -MP -MF $(DEPDIR)/libgnu_a-getaddrinfo.Tpo -c -o libgnu_a-getaddrinfo.o `test -f 'getaddrinfo.c' || echo '$(srcdir)/'`getaddrinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getaddrinfo.Tpo $(DEPDIR)/libgnu_a-getaddrinfo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getaddrinfo.c' object='libgnu_a-getaddrinfo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getaddrinfo.o `test -f 'getaddrinfo.c' || echo '$(srcdir)/'`getaddrinfo.c
+
+libgnu_a-getaddrinfo.obj: getaddrinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getaddrinfo.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getaddrinfo.Tpo -c -o libgnu_a-getaddrinfo.obj `if test -f 'getaddrinfo.c'; then $(CYGPATH_W) 'getaddrinfo.c'; else $(CYGPATH_W) '$(srcdir)/getaddrinfo.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getaddrinfo.Tpo $(DEPDIR)/libgnu_a-getaddrinfo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getaddrinfo.c' object='libgnu_a-getaddrinfo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getaddrinfo.obj `if test -f 'getaddrinfo.c'; then $(CYGPATH_W) 'getaddrinfo.c'; else $(CYGPATH_W) '$(srcdir)/getaddrinfo.c'; fi`
+
+libgnu_a-gai_strerror.o: gai_strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-gai_strerror.o -MD -MP -MF $(DEPDIR)/libgnu_a-gai_strerror.Tpo -c -o libgnu_a-gai_strerror.o `test -f 'gai_strerror.c' || echo '$(srcdir)/'`gai_strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-gai_strerror.Tpo $(DEPDIR)/libgnu_a-gai_strerror.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gai_strerror.c' object='libgnu_a-gai_strerror.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-gai_strerror.o `test -f 'gai_strerror.c' || echo '$(srcdir)/'`gai_strerror.c
+
+libgnu_a-gai_strerror.obj: gai_strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-gai_strerror.obj -MD -MP -MF $(DEPDIR)/libgnu_a-gai_strerror.Tpo -c -o libgnu_a-gai_strerror.obj `if test -f 'gai_strerror.c'; then $(CYGPATH_W) 'gai_strerror.c'; else $(CYGPATH_W) '$(srcdir)/gai_strerror.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-gai_strerror.Tpo $(DEPDIR)/libgnu_a-gai_strerror.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gai_strerror.c' object='libgnu_a-gai_strerror.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-gai_strerror.obj `if test -f 'gai_strerror.c'; then $(CYGPATH_W) 'gai_strerror.c'; else $(CYGPATH_W) '$(srcdir)/gai_strerror.c'; fi`
+
+libgnu_a-getdelim.o: getdelim.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getdelim.o -MD -MP -MF $(DEPDIR)/libgnu_a-getdelim.Tpo -c -o libgnu_a-getdelim.o `test -f 'getdelim.c' || echo '$(srcdir)/'`getdelim.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getdelim.Tpo $(DEPDIR)/libgnu_a-getdelim.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getdelim.c' object='libgnu_a-getdelim.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getdelim.o `test -f 'getdelim.c' || echo '$(srcdir)/'`getdelim.c
+
+libgnu_a-getdelim.obj: getdelim.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getdelim.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getdelim.Tpo -c -o libgnu_a-getdelim.obj `if test -f 'getdelim.c'; then $(CYGPATH_W) 'getdelim.c'; else $(CYGPATH_W) '$(srcdir)/getdelim.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getdelim.Tpo $(DEPDIR)/libgnu_a-getdelim.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getdelim.c' object='libgnu_a-getdelim.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getdelim.obj `if test -f 'getdelim.c'; then $(CYGPATH_W) 'getdelim.c'; else $(CYGPATH_W) '$(srcdir)/getdelim.c'; fi`
+
+libgnu_a-getdtablesize.o: getdtablesize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getdtablesize.o -MD -MP -MF $(DEPDIR)/libgnu_a-getdtablesize.Tpo -c -o libgnu_a-getdtablesize.o `test -f 'getdtablesize.c' || echo '$(srcdir)/'`getdtablesize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getdtablesize.Tpo $(DEPDIR)/libgnu_a-getdtablesize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getdtablesize.c' object='libgnu_a-getdtablesize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getdtablesize.o `test -f 'getdtablesize.c' || echo '$(srcdir)/'`getdtablesize.c
+
+libgnu_a-getdtablesize.obj: getdtablesize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getdtablesize.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getdtablesize.Tpo -c -o libgnu_a-getdtablesize.obj `if test -f 'getdtablesize.c'; then $(CYGPATH_W) 'getdtablesize.c'; else $(CYGPATH_W) '$(srcdir)/getdtablesize.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getdtablesize.Tpo $(DEPDIR)/libgnu_a-getdtablesize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getdtablesize.c' object='libgnu_a-getdtablesize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getdtablesize.obj `if test -f 'getdtablesize.c'; then $(CYGPATH_W) 'getdtablesize.c'; else $(CYGPATH_W) '$(srcdir)/getdtablesize.c'; fi`
+
+libgnu_a-gethostname.o: gethostname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-gethostname.o -MD -MP -MF $(DEPDIR)/libgnu_a-gethostname.Tpo -c -o libgnu_a-gethostname.o `test -f 'gethostname.c' || echo '$(srcdir)/'`gethostname.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-gethostname.Tpo $(DEPDIR)/libgnu_a-gethostname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gethostname.c' object='libgnu_a-gethostname.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-gethostname.o `test -f 'gethostname.c' || echo '$(srcdir)/'`gethostname.c
+
+libgnu_a-gethostname.obj: gethostname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-gethostname.obj -MD -MP -MF $(DEPDIR)/libgnu_a-gethostname.Tpo -c -o libgnu_a-gethostname.obj `if test -f 'gethostname.c'; then $(CYGPATH_W) 'gethostname.c'; else $(CYGPATH_W) '$(srcdir)/gethostname.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-gethostname.Tpo $(DEPDIR)/libgnu_a-gethostname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gethostname.c' object='libgnu_a-gethostname.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-gethostname.obj `if test -f 'gethostname.c'; then $(CYGPATH_W) 'gethostname.c'; else $(CYGPATH_W) '$(srcdir)/gethostname.c'; fi`
+
+libgnu_a-getline.o: getline.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getline.o -MD -MP -MF $(DEPDIR)/libgnu_a-getline.Tpo -c -o libgnu_a-getline.o `test -f 'getline.c' || echo '$(srcdir)/'`getline.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getline.Tpo $(DEPDIR)/libgnu_a-getline.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getline.c' object='libgnu_a-getline.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getline.o `test -f 'getline.c' || echo '$(srcdir)/'`getline.c
+
+libgnu_a-getline.obj: getline.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getline.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getline.Tpo -c -o libgnu_a-getline.obj `if test -f 'getline.c'; then $(CYGPATH_W) 'getline.c'; else $(CYGPATH_W) '$(srcdir)/getline.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getline.Tpo $(DEPDIR)/libgnu_a-getline.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getline.c' object='libgnu_a-getline.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getline.obj `if test -f 'getline.c'; then $(CYGPATH_W) 'getline.c'; else $(CYGPATH_W) '$(srcdir)/getline.c'; fi`
+
+libgnu_a-getloadavg.o: getloadavg.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getloadavg.o -MD -MP -MF $(DEPDIR)/libgnu_a-getloadavg.Tpo -c -o libgnu_a-getloadavg.o `test -f 'getloadavg.c' || echo '$(srcdir)/'`getloadavg.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getloadavg.Tpo $(DEPDIR)/libgnu_a-getloadavg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getloadavg.c' object='libgnu_a-getloadavg.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getloadavg.o `test -f 'getloadavg.c' || echo '$(srcdir)/'`getloadavg.c
+
+libgnu_a-getloadavg.obj: getloadavg.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getloadavg.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getloadavg.Tpo -c -o libgnu_a-getloadavg.obj `if test -f 'getloadavg.c'; then $(CYGPATH_W) 'getloadavg.c'; else $(CYGPATH_W) '$(srcdir)/getloadavg.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getloadavg.Tpo $(DEPDIR)/libgnu_a-getloadavg.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getloadavg.c' object='libgnu_a-getloadavg.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getloadavg.obj `if test -f 'getloadavg.c'; then $(CYGPATH_W) 'getloadavg.c'; else $(CYGPATH_W) '$(srcdir)/getloadavg.c'; fi`
+
+libgnu_a-getopt.o: getopt.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getopt.o -MD -MP -MF $(DEPDIR)/libgnu_a-getopt.Tpo -c -o libgnu_a-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getopt.Tpo $(DEPDIR)/libgnu_a-getopt.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='libgnu_a-getopt.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c
+
+libgnu_a-getopt.obj: getopt.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getopt.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getopt.Tpo -c -o libgnu_a-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getopt.Tpo $(DEPDIR)/libgnu_a-getopt.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='libgnu_a-getopt.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi`
+
+libgnu_a-getopt1.o: getopt1.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getopt1.o -MD -MP -MF $(DEPDIR)/libgnu_a-getopt1.Tpo -c -o libgnu_a-getopt1.o `test -f 'getopt1.c' || echo '$(srcdir)/'`getopt1.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getopt1.Tpo $(DEPDIR)/libgnu_a-getopt1.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt1.c' object='libgnu_a-getopt1.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getopt1.o `test -f 'getopt1.c' || echo '$(srcdir)/'`getopt1.c
+
+libgnu_a-getopt1.obj: getopt1.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getopt1.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getopt1.Tpo -c -o libgnu_a-getopt1.obj `if test -f 'getopt1.c'; then $(CYGPATH_W) 'getopt1.c'; else $(CYGPATH_W) '$(srcdir)/getopt1.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getopt1.Tpo $(DEPDIR)/libgnu_a-getopt1.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt1.c' object='libgnu_a-getopt1.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getopt1.obj `if test -f 'getopt1.c'; then $(CYGPATH_W) 'getopt1.c'; else $(CYGPATH_W) '$(srcdir)/getopt1.c'; fi`
+
+libgnu_a-getprogname.o: getprogname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getprogname.o -MD -MP -MF $(DEPDIR)/libgnu_a-getprogname.Tpo -c -o libgnu_a-getprogname.o `test -f 'getprogname.c' || echo '$(srcdir)/'`getprogname.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getprogname.Tpo $(DEPDIR)/libgnu_a-getprogname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getprogname.c' object='libgnu_a-getprogname.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getprogname.o `test -f 'getprogname.c' || echo '$(srcdir)/'`getprogname.c
+
+libgnu_a-getprogname.obj: getprogname.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-getprogname.obj -MD -MP -MF $(DEPDIR)/libgnu_a-getprogname.Tpo -c -o libgnu_a-getprogname.obj `if test -f 'getprogname.c'; then $(CYGPATH_W) 'getprogname.c'; else $(CYGPATH_W) '$(srcdir)/getprogname.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-getprogname.Tpo $(DEPDIR)/libgnu_a-getprogname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getprogname.c' object='libgnu_a-getprogname.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-getprogname.obj `if test -f 'getprogname.c'; then $(CYGPATH_W) 'getprogname.c'; else $(CYGPATH_W) '$(srcdir)/getprogname.c'; fi`
+
+malloc/libgnu_a-dynarray_at_failure.o: malloc/dynarray_at_failure.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_at_failure.o -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Tpo -c -o malloc/libgnu_a-dynarray_at_failure.o `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_at_failure.c' object='malloc/libgnu_a-dynarray_at_failure.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_at_failure.o `test -f 'malloc/dynarray_at_failure.c' || echo '$(srcdir)/'`malloc/dynarray_at_failure.c
+
+malloc/libgnu_a-dynarray_at_failure.obj: malloc/dynarray_at_failure.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_at_failure.obj -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Tpo -c -o malloc/libgnu_a-dynarray_at_failure.obj `if test -f 'malloc/dynarray_at_failure.c'; then $(CYGPATH_W) 'malloc/dynarray_at_failure.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_at_failure.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_at_failure.c' object='malloc/libgnu_a-dynarray_at_failure.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_at_failure.obj `if test -f 'malloc/dynarray_at_failure.c'; then $(CYGPATH_W) 'malloc/dynarray_at_failure.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_at_failure.c'; fi`
+
+malloc/libgnu_a-dynarray_emplace_enlarge.o: malloc/dynarray_emplace_enlarge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_emplace_enlarge.o -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Tpo -c -o malloc/libgnu_a-dynarray_emplace_enlarge.o `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_emplace_enlarge.c' object='malloc/libgnu_a-dynarray_emplace_enlarge.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_emplace_enlarge.o `test -f 'malloc/dynarray_emplace_enlarge.c' || echo '$(srcdir)/'`malloc/dynarray_emplace_enlarge.c
+
+malloc/libgnu_a-dynarray_emplace_enlarge.obj: malloc/dynarray_emplace_enlarge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_emplace_enlarge.obj -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Tpo -c -o malloc/libgnu_a-dynarray_emplace_enlarge.obj `if test -f 'malloc/dynarray_emplace_enlarge.c'; then $(CYGPATH_W) 'malloc/dynarray_emplace_enlarge.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_emplace_enlarge.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_emplace_enlarge.c' object='malloc/libgnu_a-dynarray_emplace_enlarge.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_emplace_enlarge.obj `if test -f 'malloc/dynarray_emplace_enlarge.c'; then $(CYGPATH_W) 'malloc/dynarray_emplace_enlarge.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_emplace_enlarge.c'; fi`
+
+malloc/libgnu_a-dynarray_finalize.o: malloc/dynarray_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_finalize.o -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Tpo -c -o malloc/libgnu_a-dynarray_finalize.o `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_finalize.c' object='malloc/libgnu_a-dynarray_finalize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_finalize.o `test -f 'malloc/dynarray_finalize.c' || echo '$(srcdir)/'`malloc/dynarray_finalize.c
+
+malloc/libgnu_a-dynarray_finalize.obj: malloc/dynarray_finalize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_finalize.obj -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Tpo -c -o malloc/libgnu_a-dynarray_finalize.obj `if test -f 'malloc/dynarray_finalize.c'; then $(CYGPATH_W) 'malloc/dynarray_finalize.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_finalize.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_finalize.c' object='malloc/libgnu_a-dynarray_finalize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_finalize.obj `if test -f 'malloc/dynarray_finalize.c'; then $(CYGPATH_W) 'malloc/dynarray_finalize.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_finalize.c'; fi`
+
+malloc/libgnu_a-dynarray_resize.o: malloc/dynarray_resize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_resize.o -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Tpo -c -o malloc/libgnu_a-dynarray_resize.o `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize.c' object='malloc/libgnu_a-dynarray_resize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_resize.o `test -f 'malloc/dynarray_resize.c' || echo '$(srcdir)/'`malloc/dynarray_resize.c
+
+malloc/libgnu_a-dynarray_resize.obj: malloc/dynarray_resize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_resize.obj -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Tpo -c -o malloc/libgnu_a-dynarray_resize.obj `if test -f 'malloc/dynarray_resize.c'; then $(CYGPATH_W) 'malloc/dynarray_resize.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_resize.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize.c' object='malloc/libgnu_a-dynarray_resize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_resize.obj `if test -f 'malloc/dynarray_resize.c'; then $(CYGPATH_W) 'malloc/dynarray_resize.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_resize.c'; fi`
+
+malloc/libgnu_a-dynarray_resize_clear.o: malloc/dynarray_resize_clear.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_resize_clear.o -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Tpo -c -o malloc/libgnu_a-dynarray_resize_clear.o `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize_clear.c' object='malloc/libgnu_a-dynarray_resize_clear.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_resize_clear.o `test -f 'malloc/dynarray_resize_clear.c' || echo '$(srcdir)/'`malloc/dynarray_resize_clear.c
+
+malloc/libgnu_a-dynarray_resize_clear.obj: malloc/dynarray_resize_clear.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray_resize_clear.obj -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Tpo -c -o malloc/libgnu_a-dynarray_resize_clear.obj `if test -f 'malloc/dynarray_resize_clear.c'; then $(CYGPATH_W) 'malloc/dynarray_resize_clear.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_resize_clear.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray_resize_clear.c' object='malloc/libgnu_a-dynarray_resize_clear.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray_resize_clear.obj `if test -f 'malloc/dynarray_resize_clear.c'; then $(CYGPATH_W) 'malloc/dynarray_resize_clear.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray_resize_clear.c'; fi`
+
+libgnu_a-hard-locale.o: hard-locale.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-hard-locale.o -MD -MP -MF $(DEPDIR)/libgnu_a-hard-locale.Tpo -c -o libgnu_a-hard-locale.o `test -f 'hard-locale.c' || echo '$(srcdir)/'`hard-locale.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-hard-locale.Tpo $(DEPDIR)/libgnu_a-hard-locale.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hard-locale.c' object='libgnu_a-hard-locale.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-hard-locale.o `test -f 'hard-locale.c' || echo '$(srcdir)/'`hard-locale.c
+
+libgnu_a-hard-locale.obj: hard-locale.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-hard-locale.obj -MD -MP -MF $(DEPDIR)/libgnu_a-hard-locale.Tpo -c -o libgnu_a-hard-locale.obj `if test -f 'hard-locale.c'; then $(CYGPATH_W) 'hard-locale.c'; else $(CYGPATH_W) '$(srcdir)/hard-locale.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-hard-locale.Tpo $(DEPDIR)/libgnu_a-hard-locale.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hard-locale.c' object='libgnu_a-hard-locale.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-hard-locale.obj `if test -f 'hard-locale.c'; then $(CYGPATH_W) 'hard-locale.c'; else $(CYGPATH_W) '$(srcdir)/hard-locale.c'; fi`
+
+libgnu_a-ialloc.o: ialloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-ialloc.o -MD -MP -MF $(DEPDIR)/libgnu_a-ialloc.Tpo -c -o libgnu_a-ialloc.o `test -f 'ialloc.c' || echo '$(srcdir)/'`ialloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-ialloc.Tpo $(DEPDIR)/libgnu_a-ialloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ialloc.c' object='libgnu_a-ialloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-ialloc.o `test -f 'ialloc.c' || echo '$(srcdir)/'`ialloc.c
+
+libgnu_a-ialloc.obj: ialloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-ialloc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-ialloc.Tpo -c -o libgnu_a-ialloc.obj `if test -f 'ialloc.c'; then $(CYGPATH_W) 'ialloc.c'; else $(CYGPATH_W) '$(srcdir)/ialloc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-ialloc.Tpo $(DEPDIR)/libgnu_a-ialloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ialloc.c' object='libgnu_a-ialloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-ialloc.obj `if test -f 'ialloc.c'; then $(CYGPATH_W) 'ialloc.c'; else $(CYGPATH_W) '$(srcdir)/ialloc.c'; fi`
+
+libgnu_a-idpriv-droptemp.o: idpriv-droptemp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-idpriv-droptemp.o -MD -MP -MF $(DEPDIR)/libgnu_a-idpriv-droptemp.Tpo -c -o libgnu_a-idpriv-droptemp.o `test -f 'idpriv-droptemp.c' || echo '$(srcdir)/'`idpriv-droptemp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-idpriv-droptemp.Tpo $(DEPDIR)/libgnu_a-idpriv-droptemp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='idpriv-droptemp.c' object='libgnu_a-idpriv-droptemp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-idpriv-droptemp.o `test -f 'idpriv-droptemp.c' || echo '$(srcdir)/'`idpriv-droptemp.c
+
+libgnu_a-idpriv-droptemp.obj: idpriv-droptemp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-idpriv-droptemp.obj -MD -MP -MF $(DEPDIR)/libgnu_a-idpriv-droptemp.Tpo -c -o libgnu_a-idpriv-droptemp.obj `if test -f 'idpriv-droptemp.c'; then $(CYGPATH_W) 'idpriv-droptemp.c'; else $(CYGPATH_W) '$(srcdir)/idpriv-droptemp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-idpriv-droptemp.Tpo $(DEPDIR)/libgnu_a-idpriv-droptemp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='idpriv-droptemp.c' object='libgnu_a-idpriv-droptemp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-idpriv-droptemp.obj `if test -f 'idpriv-droptemp.c'; then $(CYGPATH_W) 'idpriv-droptemp.c'; else $(CYGPATH_W) '$(srcdir)/idpriv-droptemp.c'; fi`
+
+libgnu_a-inet_ntop.o: inet_ntop.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-inet_ntop.o -MD -MP -MF $(DEPDIR)/libgnu_a-inet_ntop.Tpo -c -o libgnu_a-inet_ntop.o `test -f 'inet_ntop.c' || echo '$(srcdir)/'`inet_ntop.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-inet_ntop.Tpo $(DEPDIR)/libgnu_a-inet_ntop.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inet_ntop.c' object='libgnu_a-inet_ntop.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-inet_ntop.o `test -f 'inet_ntop.c' || echo '$(srcdir)/'`inet_ntop.c
+
+libgnu_a-inet_ntop.obj: inet_ntop.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-inet_ntop.obj -MD -MP -MF $(DEPDIR)/libgnu_a-inet_ntop.Tpo -c -o libgnu_a-inet_ntop.obj `if test -f 'inet_ntop.c'; then $(CYGPATH_W) 'inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/inet_ntop.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-inet_ntop.Tpo $(DEPDIR)/libgnu_a-inet_ntop.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inet_ntop.c' object='libgnu_a-inet_ntop.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-inet_ntop.obj `if test -f 'inet_ntop.c'; then $(CYGPATH_W) 'inet_ntop.c'; else $(CYGPATH_W) '$(srcdir)/inet_ntop.c'; fi`
+
+libgnu_a-localcharset.o: localcharset.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-localcharset.o -MD -MP -MF $(DEPDIR)/libgnu_a-localcharset.Tpo -c -o libgnu_a-localcharset.o `test -f 'localcharset.c' || echo '$(srcdir)/'`localcharset.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-localcharset.Tpo $(DEPDIR)/libgnu_a-localcharset.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='localcharset.c' object='libgnu_a-localcharset.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-localcharset.o `test -f 'localcharset.c' || echo '$(srcdir)/'`localcharset.c
+
+libgnu_a-localcharset.obj: localcharset.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-localcharset.obj -MD -MP -MF $(DEPDIR)/libgnu_a-localcharset.Tpo -c -o libgnu_a-localcharset.obj `if test -f 'localcharset.c'; then $(CYGPATH_W) 'localcharset.c'; else $(CYGPATH_W) '$(srcdir)/localcharset.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-localcharset.Tpo $(DEPDIR)/libgnu_a-localcharset.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='localcharset.c' object='libgnu_a-localcharset.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-localcharset.obj `if test -f 'localcharset.c'; then $(CYGPATH_W) 'localcharset.c'; else $(CYGPATH_W) '$(srcdir)/localcharset.c'; fi`
+
+libgnu_a-localeconv.o: localeconv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-localeconv.o -MD -MP -MF $(DEPDIR)/libgnu_a-localeconv.Tpo -c -o libgnu_a-localeconv.o `test -f 'localeconv.c' || echo '$(srcdir)/'`localeconv.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-localeconv.Tpo $(DEPDIR)/libgnu_a-localeconv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='localeconv.c' object='libgnu_a-localeconv.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-localeconv.o `test -f 'localeconv.c' || echo '$(srcdir)/'`localeconv.c
+
+libgnu_a-localeconv.obj: localeconv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-localeconv.obj -MD -MP -MF $(DEPDIR)/libgnu_a-localeconv.Tpo -c -o libgnu_a-localeconv.obj `if test -f 'localeconv.c'; then $(CYGPATH_W) 'localeconv.c'; else $(CYGPATH_W) '$(srcdir)/localeconv.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-localeconv.Tpo $(DEPDIR)/libgnu_a-localeconv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='localeconv.c' object='libgnu_a-localeconv.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-localeconv.obj `if test -f 'localeconv.c'; then $(CYGPATH_W) 'localeconv.c'; else $(CYGPATH_W) '$(srcdir)/localeconv.c'; fi`
+
+glthread/libgnu_a-lock.o: glthread/lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT glthread/libgnu_a-lock.o -MD -MP -MF glthread/$(DEPDIR)/libgnu_a-lock.Tpo -c -o glthread/libgnu_a-lock.o `test -f 'glthread/lock.c' || echo '$(srcdir)/'`glthread/lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) glthread/$(DEPDIR)/libgnu_a-lock.Tpo glthread/$(DEPDIR)/libgnu_a-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glthread/lock.c' object='glthread/libgnu_a-lock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o glthread/libgnu_a-lock.o `test -f 'glthread/lock.c' || echo '$(srcdir)/'`glthread/lock.c
+
+glthread/libgnu_a-lock.obj: glthread/lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT glthread/libgnu_a-lock.obj -MD -MP -MF glthread/$(DEPDIR)/libgnu_a-lock.Tpo -c -o glthread/libgnu_a-lock.obj `if test -f 'glthread/lock.c'; then $(CYGPATH_W) 'glthread/lock.c'; else $(CYGPATH_W) '$(srcdir)/glthread/lock.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) glthread/$(DEPDIR)/libgnu_a-lock.Tpo glthread/$(DEPDIR)/libgnu_a-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glthread/lock.c' object='glthread/libgnu_a-lock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o glthread/libgnu_a-lock.obj `if test -f 'glthread/lock.c'; then $(CYGPATH_W) 'glthread/lock.c'; else $(CYGPATH_W) '$(srcdir)/glthread/lock.c'; fi`
+
+libgnu_a-lseek.o: lseek.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-lseek.o -MD -MP -MF $(DEPDIR)/libgnu_a-lseek.Tpo -c -o libgnu_a-lseek.o `test -f 'lseek.c' || echo '$(srcdir)/'`lseek.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-lseek.Tpo $(DEPDIR)/libgnu_a-lseek.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lseek.c' object='libgnu_a-lseek.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-lseek.o `test -f 'lseek.c' || echo '$(srcdir)/'`lseek.c
+
+libgnu_a-lseek.obj: lseek.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-lseek.obj -MD -MP -MF $(DEPDIR)/libgnu_a-lseek.Tpo -c -o libgnu_a-lseek.obj `if test -f 'lseek.c'; then $(CYGPATH_W) 'lseek.c'; else $(CYGPATH_W) '$(srcdir)/lseek.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-lseek.Tpo $(DEPDIR)/libgnu_a-lseek.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lseek.c' object='libgnu_a-lseek.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-lseek.obj `if test -f 'lseek.c'; then $(CYGPATH_W) 'lseek.c'; else $(CYGPATH_W) '$(srcdir)/lseek.c'; fi`
+
+libgnu_a-malloca.o: malloca.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-malloca.o -MD -MP -MF $(DEPDIR)/libgnu_a-malloca.Tpo -c -o libgnu_a-malloca.o `test -f 'malloca.c' || echo '$(srcdir)/'`malloca.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-malloca.Tpo $(DEPDIR)/libgnu_a-malloca.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloca.c' object='libgnu_a-malloca.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-malloca.o `test -f 'malloca.c' || echo '$(srcdir)/'`malloca.c
+
+libgnu_a-malloca.obj: malloca.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-malloca.obj -MD -MP -MF $(DEPDIR)/libgnu_a-malloca.Tpo -c -o libgnu_a-malloca.obj `if test -f 'malloca.c'; then $(CYGPATH_W) 'malloca.c'; else $(CYGPATH_W) '$(srcdir)/malloca.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-malloca.Tpo $(DEPDIR)/libgnu_a-malloca.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloca.c' object='libgnu_a-malloca.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-malloca.obj `if test -f 'malloca.c'; then $(CYGPATH_W) 'malloca.c'; else $(CYGPATH_W) '$(srcdir)/malloca.c'; fi`
+
+libgnu_a-math.o: math.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-math.o -MD -MP -MF $(DEPDIR)/libgnu_a-math.Tpo -c -o libgnu_a-math.o `test -f 'math.c' || echo '$(srcdir)/'`math.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-math.Tpo $(DEPDIR)/libgnu_a-math.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='math.c' object='libgnu_a-math.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-math.o `test -f 'math.c' || echo '$(srcdir)/'`math.c
+
+libgnu_a-math.obj: math.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-math.obj -MD -MP -MF $(DEPDIR)/libgnu_a-math.Tpo -c -o libgnu_a-math.obj `if test -f 'math.c'; then $(CYGPATH_W) 'math.c'; else $(CYGPATH_W) '$(srcdir)/math.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-math.Tpo $(DEPDIR)/libgnu_a-math.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='math.c' object='libgnu_a-math.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-math.obj `if test -f 'math.c'; then $(CYGPATH_W) 'math.c'; else $(CYGPATH_W) '$(srcdir)/math.c'; fi`
+
+libgnu_a-mbrtowc.o: mbrtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbrtowc.o -MD -MP -MF $(DEPDIR)/libgnu_a-mbrtowc.Tpo -c -o libgnu_a-mbrtowc.o `test -f 'mbrtowc.c' || echo '$(srcdir)/'`mbrtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbrtowc.Tpo $(DEPDIR)/libgnu_a-mbrtowc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbrtowc.c' object='libgnu_a-mbrtowc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbrtowc.o `test -f 'mbrtowc.c' || echo '$(srcdir)/'`mbrtowc.c
+
+libgnu_a-mbrtowc.obj: mbrtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbrtowc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-mbrtowc.Tpo -c -o libgnu_a-mbrtowc.obj `if test -f 'mbrtowc.c'; then $(CYGPATH_W) 'mbrtowc.c'; else $(CYGPATH_W) '$(srcdir)/mbrtowc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbrtowc.Tpo $(DEPDIR)/libgnu_a-mbrtowc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbrtowc.c' object='libgnu_a-mbrtowc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbrtowc.obj `if test -f 'mbrtowc.c'; then $(CYGPATH_W) 'mbrtowc.c'; else $(CYGPATH_W) '$(srcdir)/mbrtowc.c'; fi`
+
+libgnu_a-mbsinit.o: mbsinit.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbsinit.o -MD -MP -MF $(DEPDIR)/libgnu_a-mbsinit.Tpo -c -o libgnu_a-mbsinit.o `test -f 'mbsinit.c' || echo '$(srcdir)/'`mbsinit.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbsinit.Tpo $(DEPDIR)/libgnu_a-mbsinit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbsinit.c' object='libgnu_a-mbsinit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbsinit.o `test -f 'mbsinit.c' || echo '$(srcdir)/'`mbsinit.c
+
+libgnu_a-mbsinit.obj: mbsinit.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbsinit.obj -MD -MP -MF $(DEPDIR)/libgnu_a-mbsinit.Tpo -c -o libgnu_a-mbsinit.obj `if test -f 'mbsinit.c'; then $(CYGPATH_W) 'mbsinit.c'; else $(CYGPATH_W) '$(srcdir)/mbsinit.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbsinit.Tpo $(DEPDIR)/libgnu_a-mbsinit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbsinit.c' object='libgnu_a-mbsinit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbsinit.obj `if test -f 'mbsinit.c'; then $(CYGPATH_W) 'mbsinit.c'; else $(CYGPATH_W) '$(srcdir)/mbsinit.c'; fi`
+
+libgnu_a-mbtowc.o: mbtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbtowc.o -MD -MP -MF $(DEPDIR)/libgnu_a-mbtowc.Tpo -c -o libgnu_a-mbtowc.o `test -f 'mbtowc.c' || echo '$(srcdir)/'`mbtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbtowc.Tpo $(DEPDIR)/libgnu_a-mbtowc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbtowc.c' object='libgnu_a-mbtowc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbtowc.o `test -f 'mbtowc.c' || echo '$(srcdir)/'`mbtowc.c
+
+libgnu_a-mbtowc.obj: mbtowc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbtowc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-mbtowc.Tpo -c -o libgnu_a-mbtowc.obj `if test -f 'mbtowc.c'; then $(CYGPATH_W) 'mbtowc.c'; else $(CYGPATH_W) '$(srcdir)/mbtowc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbtowc.Tpo $(DEPDIR)/libgnu_a-mbtowc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbtowc.c' object='libgnu_a-mbtowc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbtowc.obj `if test -f 'mbtowc.c'; then $(CYGPATH_W) 'mbtowc.c'; else $(CYGPATH_W) '$(srcdir)/mbtowc.c'; fi`
+
+libgnu_a-memchr.o: memchr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-memchr.o -MD -MP -MF $(DEPDIR)/libgnu_a-memchr.Tpo -c -o libgnu_a-memchr.o `test -f 'memchr.c' || echo '$(srcdir)/'`memchr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-memchr.Tpo $(DEPDIR)/libgnu_a-memchr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memchr.c' object='libgnu_a-memchr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-memchr.o `test -f 'memchr.c' || echo '$(srcdir)/'`memchr.c
+
+libgnu_a-memchr.obj: memchr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-memchr.obj -MD -MP -MF $(DEPDIR)/libgnu_a-memchr.Tpo -c -o libgnu_a-memchr.obj `if test -f 'memchr.c'; then $(CYGPATH_W) 'memchr.c'; else $(CYGPATH_W) '$(srcdir)/memchr.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-memchr.Tpo $(DEPDIR)/libgnu_a-memchr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='memchr.c' object='libgnu_a-memchr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-memchr.obj `if test -f 'memchr.c'; then $(CYGPATH_W) 'memchr.c'; else $(CYGPATH_W) '$(srcdir)/memchr.c'; fi`
+
+libgnu_a-mountlist.o: mountlist.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mountlist.o -MD -MP -MF $(DEPDIR)/libgnu_a-mountlist.Tpo -c -o libgnu_a-mountlist.o `test -f 'mountlist.c' || echo '$(srcdir)/'`mountlist.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mountlist.Tpo $(DEPDIR)/libgnu_a-mountlist.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mountlist.c' object='libgnu_a-mountlist.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mountlist.o `test -f 'mountlist.c' || echo '$(srcdir)/'`mountlist.c
+
+libgnu_a-mountlist.obj: mountlist.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mountlist.obj -MD -MP -MF $(DEPDIR)/libgnu_a-mountlist.Tpo -c -o libgnu_a-mountlist.obj `if test -f 'mountlist.c'; then $(CYGPATH_W) 'mountlist.c'; else $(CYGPATH_W) '$(srcdir)/mountlist.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mountlist.Tpo $(DEPDIR)/libgnu_a-mountlist.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mountlist.c' object='libgnu_a-mountlist.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mountlist.obj `if test -f 'mountlist.c'; then $(CYGPATH_W) 'mountlist.c'; else $(CYGPATH_W) '$(srcdir)/mountlist.c'; fi`
+
+libgnu_a-msvc-inval.o: msvc-inval.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-msvc-inval.o -MD -MP -MF $(DEPDIR)/libgnu_a-msvc-inval.Tpo -c -o libgnu_a-msvc-inval.o `test -f 'msvc-inval.c' || echo '$(srcdir)/'`msvc-inval.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-msvc-inval.Tpo $(DEPDIR)/libgnu_a-msvc-inval.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msvc-inval.c' object='libgnu_a-msvc-inval.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-msvc-inval.o `test -f 'msvc-inval.c' || echo '$(srcdir)/'`msvc-inval.c
+
+libgnu_a-msvc-inval.obj: msvc-inval.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-msvc-inval.obj -MD -MP -MF $(DEPDIR)/libgnu_a-msvc-inval.Tpo -c -o libgnu_a-msvc-inval.obj `if test -f 'msvc-inval.c'; then $(CYGPATH_W) 'msvc-inval.c'; else $(CYGPATH_W) '$(srcdir)/msvc-inval.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-msvc-inval.Tpo $(DEPDIR)/libgnu_a-msvc-inval.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msvc-inval.c' object='libgnu_a-msvc-inval.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-msvc-inval.obj `if test -f 'msvc-inval.c'; then $(CYGPATH_W) 'msvc-inval.c'; else $(CYGPATH_W) '$(srcdir)/msvc-inval.c'; fi`
+
+libgnu_a-msvc-nothrow.o: msvc-nothrow.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-msvc-nothrow.o -MD -MP -MF $(DEPDIR)/libgnu_a-msvc-nothrow.Tpo -c -o libgnu_a-msvc-nothrow.o `test -f 'msvc-nothrow.c' || echo '$(srcdir)/'`msvc-nothrow.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-msvc-nothrow.Tpo $(DEPDIR)/libgnu_a-msvc-nothrow.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msvc-nothrow.c' object='libgnu_a-msvc-nothrow.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-msvc-nothrow.o `test -f 'msvc-nothrow.c' || echo '$(srcdir)/'`msvc-nothrow.c
+
+libgnu_a-msvc-nothrow.obj: msvc-nothrow.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-msvc-nothrow.obj -MD -MP -MF $(DEPDIR)/libgnu_a-msvc-nothrow.Tpo -c -o libgnu_a-msvc-nothrow.obj `if test -f 'msvc-nothrow.c'; then $(CYGPATH_W) 'msvc-nothrow.c'; else $(CYGPATH_W) '$(srcdir)/msvc-nothrow.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-msvc-nothrow.Tpo $(DEPDIR)/libgnu_a-msvc-nothrow.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msvc-nothrow.c' object='libgnu_a-msvc-nothrow.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-msvc-nothrow.obj `if test -f 'msvc-nothrow.c'; then $(CYGPATH_W) 'msvc-nothrow.c'; else $(CYGPATH_W) '$(srcdir)/msvc-nothrow.c'; fi`
+
+libgnu_a-nl_langinfo.o: nl_langinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-nl_langinfo.o -MD -MP -MF $(DEPDIR)/libgnu_a-nl_langinfo.Tpo -c -o libgnu_a-nl_langinfo.o `test -f 'nl_langinfo.c' || echo '$(srcdir)/'`nl_langinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-nl_langinfo.Tpo $(DEPDIR)/libgnu_a-nl_langinfo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nl_langinfo.c' object='libgnu_a-nl_langinfo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-nl_langinfo.o `test -f 'nl_langinfo.c' || echo '$(srcdir)/'`nl_langinfo.c
+
+libgnu_a-nl_langinfo.obj: nl_langinfo.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-nl_langinfo.obj -MD -MP -MF $(DEPDIR)/libgnu_a-nl_langinfo.Tpo -c -o libgnu_a-nl_langinfo.obj `if test -f 'nl_langinfo.c'; then $(CYGPATH_W) 'nl_langinfo.c'; else $(CYGPATH_W) '$(srcdir)/nl_langinfo.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-nl_langinfo.Tpo $(DEPDIR)/libgnu_a-nl_langinfo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nl_langinfo.c' object='libgnu_a-nl_langinfo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-nl_langinfo.obj `if test -f 'nl_langinfo.c'; then $(CYGPATH_W) 'nl_langinfo.c'; else $(CYGPATH_W) '$(srcdir)/nl_langinfo.c'; fi`
+
+libgnu_a-nl_langinfo-lock.o: nl_langinfo-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-nl_langinfo-lock.o -MD -MP -MF $(DEPDIR)/libgnu_a-nl_langinfo-lock.Tpo -c -o libgnu_a-nl_langinfo-lock.o `test -f 'nl_langinfo-lock.c' || echo '$(srcdir)/'`nl_langinfo-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-nl_langinfo-lock.Tpo $(DEPDIR)/libgnu_a-nl_langinfo-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nl_langinfo-lock.c' object='libgnu_a-nl_langinfo-lock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-nl_langinfo-lock.o `test -f 'nl_langinfo-lock.c' || echo '$(srcdir)/'`nl_langinfo-lock.c
+
+libgnu_a-nl_langinfo-lock.obj: nl_langinfo-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-nl_langinfo-lock.obj -MD -MP -MF $(DEPDIR)/libgnu_a-nl_langinfo-lock.Tpo -c -o libgnu_a-nl_langinfo-lock.obj `if test -f 'nl_langinfo-lock.c'; then $(CYGPATH_W) 'nl_langinfo-lock.c'; else $(CYGPATH_W) '$(srcdir)/nl_langinfo-lock.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-nl_langinfo-lock.Tpo $(DEPDIR)/libgnu_a-nl_langinfo-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nl_langinfo-lock.c' object='libgnu_a-nl_langinfo-lock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-nl_langinfo-lock.obj `if test -f 'nl_langinfo-lock.c'; then $(CYGPATH_W) 'nl_langinfo-lock.c'; else $(CYGPATH_W) '$(srcdir)/nl_langinfo-lock.c'; fi`
+
+libgnu_a-open.o: open.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-open.o -MD -MP -MF $(DEPDIR)/libgnu_a-open.Tpo -c -o libgnu_a-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-open.Tpo $(DEPDIR)/libgnu_a-open.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='open.c' object='libgnu_a-open.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c
+
+libgnu_a-open.obj: open.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-open.obj -MD -MP -MF $(DEPDIR)/libgnu_a-open.Tpo -c -o libgnu_a-open.obj `if test -f 'open.c'; then $(CYGPATH_W) 'open.c'; else $(CYGPATH_W) '$(srcdir)/open.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-open.Tpo $(DEPDIR)/libgnu_a-open.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='open.c' object='libgnu_a-open.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-open.obj `if test -f 'open.c'; then $(CYGPATH_W) 'open.c'; else $(CYGPATH_W) '$(srcdir)/open.c'; fi`
+
+libgnu_a-reallocarray.o: reallocarray.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-reallocarray.o -MD -MP -MF $(DEPDIR)/libgnu_a-reallocarray.Tpo -c -o libgnu_a-reallocarray.o `test -f 'reallocarray.c' || echo '$(srcdir)/'`reallocarray.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-reallocarray.Tpo $(DEPDIR)/libgnu_a-reallocarray.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reallocarray.c' object='libgnu_a-reallocarray.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-reallocarray.o `test -f 'reallocarray.c' || echo '$(srcdir)/'`reallocarray.c
+
+libgnu_a-reallocarray.obj: reallocarray.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-reallocarray.obj -MD -MP -MF $(DEPDIR)/libgnu_a-reallocarray.Tpo -c -o libgnu_a-reallocarray.obj `if test -f 'reallocarray.c'; then $(CYGPATH_W) 'reallocarray.c'; else $(CYGPATH_W) '$(srcdir)/reallocarray.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-reallocarray.Tpo $(DEPDIR)/libgnu_a-reallocarray.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='reallocarray.c' object='libgnu_a-reallocarray.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-reallocarray.obj `if test -f 'reallocarray.c'; then $(CYGPATH_W) 'reallocarray.c'; else $(CYGPATH_W) '$(srcdir)/reallocarray.c'; fi`
+
+libgnu_a-regex.o: regex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regex.o -MD -MP -MF $(DEPDIR)/libgnu_a-regex.Tpo -c -o libgnu_a-regex.o `test -f 'regex.c' || echo '$(srcdir)/'`regex.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regex.Tpo $(DEPDIR)/libgnu_a-regex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regex.c' object='libgnu_a-regex.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regex.o `test -f 'regex.c' || echo '$(srcdir)/'`regex.c
+
+libgnu_a-regex.obj: regex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regex.obj -MD -MP -MF $(DEPDIR)/libgnu_a-regex.Tpo -c -o libgnu_a-regex.obj `if test -f 'regex.c'; then $(CYGPATH_W) 'regex.c'; else $(CYGPATH_W) '$(srcdir)/regex.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regex.Tpo $(DEPDIR)/libgnu_a-regex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regex.c' object='libgnu_a-regex.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regex.obj `if test -f 'regex.c'; then $(CYGPATH_W) 'regex.c'; else $(CYGPATH_W) '$(srcdir)/regex.c'; fi`
+
+libgnu_a-setenv.o: setenv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-setenv.o -MD -MP -MF $(DEPDIR)/libgnu_a-setenv.Tpo -c -o libgnu_a-setenv.o `test -f 'setenv.c' || echo '$(srcdir)/'`setenv.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-setenv.Tpo $(DEPDIR)/libgnu_a-setenv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setenv.c' object='libgnu_a-setenv.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-setenv.o `test -f 'setenv.c' || echo '$(srcdir)/'`setenv.c
+
+libgnu_a-setenv.obj: setenv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-setenv.obj -MD -MP -MF $(DEPDIR)/libgnu_a-setenv.Tpo -c -o libgnu_a-setenv.obj `if test -f 'setenv.c'; then $(CYGPATH_W) 'setenv.c'; else $(CYGPATH_W) '$(srcdir)/setenv.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-setenv.Tpo $(DEPDIR)/libgnu_a-setenv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setenv.c' object='libgnu_a-setenv.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-setenv.obj `if test -f 'setenv.c'; then $(CYGPATH_W) 'setenv.c'; else $(CYGPATH_W) '$(srcdir)/setenv.c'; fi`
+
+libgnu_a-setlocale_null.o: setlocale_null.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-setlocale_null.o -MD -MP -MF $(DEPDIR)/libgnu_a-setlocale_null.Tpo -c -o libgnu_a-setlocale_null.o `test -f 'setlocale_null.c' || echo '$(srcdir)/'`setlocale_null.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-setlocale_null.Tpo $(DEPDIR)/libgnu_a-setlocale_null.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setlocale_null.c' object='libgnu_a-setlocale_null.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-setlocale_null.o `test -f 'setlocale_null.c' || echo '$(srcdir)/'`setlocale_null.c
+
+libgnu_a-setlocale_null.obj: setlocale_null.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-setlocale_null.obj -MD -MP -MF $(DEPDIR)/libgnu_a-setlocale_null.Tpo -c -o libgnu_a-setlocale_null.obj `if test -f 'setlocale_null.c'; then $(CYGPATH_W) 'setlocale_null.c'; else $(CYGPATH_W) '$(srcdir)/setlocale_null.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-setlocale_null.Tpo $(DEPDIR)/libgnu_a-setlocale_null.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setlocale_null.c' object='libgnu_a-setlocale_null.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-setlocale_null.obj `if test -f 'setlocale_null.c'; then $(CYGPATH_W) 'setlocale_null.c'; else $(CYGPATH_W) '$(srcdir)/setlocale_null.c'; fi`
+
+libgnu_a-setlocale-lock.o: setlocale-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-setlocale-lock.o -MD -MP -MF $(DEPDIR)/libgnu_a-setlocale-lock.Tpo -c -o libgnu_a-setlocale-lock.o `test -f 'setlocale-lock.c' || echo '$(srcdir)/'`setlocale-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-setlocale-lock.Tpo $(DEPDIR)/libgnu_a-setlocale-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setlocale-lock.c' object='libgnu_a-setlocale-lock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-setlocale-lock.o `test -f 'setlocale-lock.c' || echo '$(srcdir)/'`setlocale-lock.c
+
+libgnu_a-setlocale-lock.obj: setlocale-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-setlocale-lock.obj -MD -MP -MF $(DEPDIR)/libgnu_a-setlocale-lock.Tpo -c -o libgnu_a-setlocale-lock.obj `if test -f 'setlocale-lock.c'; then $(CYGPATH_W) 'setlocale-lock.c'; else $(CYGPATH_W) '$(srcdir)/setlocale-lock.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-setlocale-lock.Tpo $(DEPDIR)/libgnu_a-setlocale-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='setlocale-lock.c' object='libgnu_a-setlocale-lock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-setlocale-lock.obj `if test -f 'setlocale-lock.c'; then $(CYGPATH_W) 'setlocale-lock.c'; else $(CYGPATH_W) '$(srcdir)/setlocale-lock.c'; fi`
+
+libgnu_a-sockets.o: sockets.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sockets.o -MD -MP -MF $(DEPDIR)/libgnu_a-sockets.Tpo -c -o libgnu_a-sockets.o `test -f 'sockets.c' || echo '$(srcdir)/'`sockets.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sockets.Tpo $(DEPDIR)/libgnu_a-sockets.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockets.c' object='libgnu_a-sockets.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sockets.o `test -f 'sockets.c' || echo '$(srcdir)/'`sockets.c
+
+libgnu_a-sockets.obj: sockets.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sockets.obj -MD -MP -MF $(DEPDIR)/libgnu_a-sockets.Tpo -c -o libgnu_a-sockets.obj `if test -f 'sockets.c'; then $(CYGPATH_W) 'sockets.c'; else $(CYGPATH_W) '$(srcdir)/sockets.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sockets.Tpo $(DEPDIR)/libgnu_a-sockets.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockets.c' object='libgnu_a-sockets.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sockets.obj `if test -f 'sockets.c'; then $(CYGPATH_W) 'sockets.c'; else $(CYGPATH_W) '$(srcdir)/sockets.c'; fi`
+
+libgnu_a-stat.o: stat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stat.o -MD -MP -MF $(DEPDIR)/libgnu_a-stat.Tpo -c -o libgnu_a-stat.o `test -f 'stat.c' || echo '$(srcdir)/'`stat.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stat.Tpo $(DEPDIR)/libgnu_a-stat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat.c' object='libgnu_a-stat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stat.o `test -f 'stat.c' || echo '$(srcdir)/'`stat.c
+
+libgnu_a-stat.obj: stat.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stat.obj -MD -MP -MF $(DEPDIR)/libgnu_a-stat.Tpo -c -o libgnu_a-stat.obj `if test -f 'stat.c'; then $(CYGPATH_W) 'stat.c'; else $(CYGPATH_W) '$(srcdir)/stat.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stat.Tpo $(DEPDIR)/libgnu_a-stat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat.c' object='libgnu_a-stat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stat.obj `if test -f 'stat.c'; then $(CYGPATH_W) 'stat.c'; else $(CYGPATH_W) '$(srcdir)/stat.c'; fi`
+
+libgnu_a-stat-time.o: stat-time.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stat-time.o -MD -MP -MF $(DEPDIR)/libgnu_a-stat-time.Tpo -c -o libgnu_a-stat-time.o `test -f 'stat-time.c' || echo '$(srcdir)/'`stat-time.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stat-time.Tpo $(DEPDIR)/libgnu_a-stat-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat-time.c' object='libgnu_a-stat-time.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stat-time.o `test -f 'stat-time.c' || echo '$(srcdir)/'`stat-time.c
+
+libgnu_a-stat-time.obj: stat-time.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stat-time.obj -MD -MP -MF $(DEPDIR)/libgnu_a-stat-time.Tpo -c -o libgnu_a-stat-time.obj `if test -f 'stat-time.c'; then $(CYGPATH_W) 'stat-time.c'; else $(CYGPATH_W) '$(srcdir)/stat-time.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stat-time.Tpo $(DEPDIR)/libgnu_a-stat-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat-time.c' object='libgnu_a-stat-time.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stat-time.obj `if test -f 'stat-time.c'; then $(CYGPATH_W) 'stat-time.c'; else $(CYGPATH_W) '$(srcdir)/stat-time.c'; fi`
+
+libgnu_a-stdio-read.o: stdio-read.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stdio-read.o -MD -MP -MF $(DEPDIR)/libgnu_a-stdio-read.Tpo -c -o libgnu_a-stdio-read.o `test -f 'stdio-read.c' || echo '$(srcdir)/'`stdio-read.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stdio-read.Tpo $(DEPDIR)/libgnu_a-stdio-read.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdio-read.c' object='libgnu_a-stdio-read.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stdio-read.o `test -f 'stdio-read.c' || echo '$(srcdir)/'`stdio-read.c
+
+libgnu_a-stdio-read.obj: stdio-read.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stdio-read.obj -MD -MP -MF $(DEPDIR)/libgnu_a-stdio-read.Tpo -c -o libgnu_a-stdio-read.obj `if test -f 'stdio-read.c'; then $(CYGPATH_W) 'stdio-read.c'; else $(CYGPATH_W) '$(srcdir)/stdio-read.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stdio-read.Tpo $(DEPDIR)/libgnu_a-stdio-read.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdio-read.c' object='libgnu_a-stdio-read.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stdio-read.obj `if test -f 'stdio-read.c'; then $(CYGPATH_W) 'stdio-read.c'; else $(CYGPATH_W) '$(srcdir)/stdio-read.c'; fi`
+
+libgnu_a-stdio-write.o: stdio-write.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stdio-write.o -MD -MP -MF $(DEPDIR)/libgnu_a-stdio-write.Tpo -c -o libgnu_a-stdio-write.o `test -f 'stdio-write.c' || echo '$(srcdir)/'`stdio-write.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stdio-write.Tpo $(DEPDIR)/libgnu_a-stdio-write.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdio-write.c' object='libgnu_a-stdio-write.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stdio-write.o `test -f 'stdio-write.c' || echo '$(srcdir)/'`stdio-write.c
+
+libgnu_a-stdio-write.obj: stdio-write.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stdio-write.obj -MD -MP -MF $(DEPDIR)/libgnu_a-stdio-write.Tpo -c -o libgnu_a-stdio-write.obj `if test -f 'stdio-write.c'; then $(CYGPATH_W) 'stdio-write.c'; else $(CYGPATH_W) '$(srcdir)/stdio-write.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stdio-write.Tpo $(DEPDIR)/libgnu_a-stdio-write.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdio-write.c' object='libgnu_a-stdio-write.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stdio-write.obj `if test -f 'stdio-write.c'; then $(CYGPATH_W) 'stdio-write.c'; else $(CYGPATH_W) '$(srcdir)/stdio-write.c'; fi`
+
+libgnu_a-strcasecmp.o: strcasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strcasecmp.o -MD -MP -MF $(DEPDIR)/libgnu_a-strcasecmp.Tpo -c -o libgnu_a-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strcasecmp.Tpo $(DEPDIR)/libgnu_a-strcasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strcasecmp.c' object='libgnu_a-strcasecmp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+
+libgnu_a-strcasecmp.obj: strcasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strcasecmp.obj -MD -MP -MF $(DEPDIR)/libgnu_a-strcasecmp.Tpo -c -o libgnu_a-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strcasecmp.Tpo $(DEPDIR)/libgnu_a-strcasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strcasecmp.c' object='libgnu_a-strcasecmp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`
+
+libgnu_a-strncasecmp.o: strncasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strncasecmp.o -MD -MP -MF $(DEPDIR)/libgnu_a-strncasecmp.Tpo -c -o libgnu_a-strncasecmp.o `test -f 'strncasecmp.c' || echo '$(srcdir)/'`strncasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strncasecmp.Tpo $(DEPDIR)/libgnu_a-strncasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strncasecmp.c' object='libgnu_a-strncasecmp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strncasecmp.o `test -f 'strncasecmp.c' || echo '$(srcdir)/'`strncasecmp.c
+
+libgnu_a-strncasecmp.obj: strncasecmp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strncasecmp.obj -MD -MP -MF $(DEPDIR)/libgnu_a-strncasecmp.Tpo -c -o libgnu_a-strncasecmp.obj `if test -f 'strncasecmp.c'; then $(CYGPATH_W) 'strncasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strncasecmp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strncasecmp.Tpo $(DEPDIR)/libgnu_a-strncasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strncasecmp.c' object='libgnu_a-strncasecmp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strncasecmp.obj `if test -f 'strncasecmp.c'; then $(CYGPATH_W) 'strncasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strncasecmp.c'; fi`
+
+libgnu_a-strerror.o: strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strerror.o -MD -MP -MF $(DEPDIR)/libgnu_a-strerror.Tpo -c -o libgnu_a-strerror.o `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strerror.Tpo $(DEPDIR)/libgnu_a-strerror.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror.c' object='libgnu_a-strerror.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strerror.o `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c
+
+libgnu_a-strerror.obj: strerror.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strerror.obj -MD -MP -MF $(DEPDIR)/libgnu_a-strerror.Tpo -c -o libgnu_a-strerror.obj `if test -f 'strerror.c'; then $(CYGPATH_W) 'strerror.c'; else $(CYGPATH_W) '$(srcdir)/strerror.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strerror.Tpo $(DEPDIR)/libgnu_a-strerror.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror.c' object='libgnu_a-strerror.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strerror.obj `if test -f 'strerror.c'; then $(CYGPATH_W) 'strerror.c'; else $(CYGPATH_W) '$(srcdir)/strerror.c'; fi`
+
+libgnu_a-strerror-override.o: strerror-override.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strerror-override.o -MD -MP -MF $(DEPDIR)/libgnu_a-strerror-override.Tpo -c -o libgnu_a-strerror-override.o `test -f 'strerror-override.c' || echo '$(srcdir)/'`strerror-override.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strerror-override.Tpo $(DEPDIR)/libgnu_a-strerror-override.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror-override.c' object='libgnu_a-strerror-override.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strerror-override.o `test -f 'strerror-override.c' || echo '$(srcdir)/'`strerror-override.c
+
+libgnu_a-strerror-override.obj: strerror-override.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strerror-override.obj -MD -MP -MF $(DEPDIR)/libgnu_a-strerror-override.Tpo -c -o libgnu_a-strerror-override.obj `if test -f 'strerror-override.c'; then $(CYGPATH_W) 'strerror-override.c'; else $(CYGPATH_W) '$(srcdir)/strerror-override.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strerror-override.Tpo $(DEPDIR)/libgnu_a-strerror-override.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strerror-override.c' object='libgnu_a-strerror-override.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strerror-override.obj `if test -f 'strerror-override.c'; then $(CYGPATH_W) 'strerror-override.c'; else $(CYGPATH_W) '$(srcdir)/strerror-override.c'; fi`
+
+libgnu_a-strsep.o: strsep.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strsep.o -MD -MP -MF $(DEPDIR)/libgnu_a-strsep.Tpo -c -o libgnu_a-strsep.o `test -f 'strsep.c' || echo '$(srcdir)/'`strsep.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strsep.Tpo $(DEPDIR)/libgnu_a-strsep.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strsep.c' object='libgnu_a-strsep.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strsep.o `test -f 'strsep.c' || echo '$(srcdir)/'`strsep.c
+
+libgnu_a-strsep.obj: strsep.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strsep.obj -MD -MP -MF $(DEPDIR)/libgnu_a-strsep.Tpo -c -o libgnu_a-strsep.obj `if test -f 'strsep.c'; then $(CYGPATH_W) 'strsep.c'; else $(CYGPATH_W) '$(srcdir)/strsep.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strsep.Tpo $(DEPDIR)/libgnu_a-strsep.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strsep.c' object='libgnu_a-strsep.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strsep.obj `if test -f 'strsep.c'; then $(CYGPATH_W) 'strsep.c'; else $(CYGPATH_W) '$(srcdir)/strsep.c'; fi`
+
+libgnu_a-sys_socket.o: sys_socket.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sys_socket.o -MD -MP -MF $(DEPDIR)/libgnu_a-sys_socket.Tpo -c -o libgnu_a-sys_socket.o `test -f 'sys_socket.c' || echo '$(srcdir)/'`sys_socket.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sys_socket.Tpo $(DEPDIR)/libgnu_a-sys_socket.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sys_socket.c' object='libgnu_a-sys_socket.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sys_socket.o `test -f 'sys_socket.c' || echo '$(srcdir)/'`sys_socket.c
+
+libgnu_a-sys_socket.obj: sys_socket.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-sys_socket.obj -MD -MP -MF $(DEPDIR)/libgnu_a-sys_socket.Tpo -c -o libgnu_a-sys_socket.obj `if test -f 'sys_socket.c'; then $(CYGPATH_W) 'sys_socket.c'; else $(CYGPATH_W) '$(srcdir)/sys_socket.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-sys_socket.Tpo $(DEPDIR)/libgnu_a-sys_socket.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sys_socket.c' object='libgnu_a-sys_socket.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-sys_socket.obj `if test -f 'sys_socket.c'; then $(CYGPATH_W) 'sys_socket.c'; else $(CYGPATH_W) '$(srcdir)/sys_socket.c'; fi`
+
+glthread/libgnu_a-threadlib.o: glthread/threadlib.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT glthread/libgnu_a-threadlib.o -MD -MP -MF glthread/$(DEPDIR)/libgnu_a-threadlib.Tpo -c -o glthread/libgnu_a-threadlib.o `test -f 'glthread/threadlib.c' || echo '$(srcdir)/'`glthread/threadlib.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) glthread/$(DEPDIR)/libgnu_a-threadlib.Tpo glthread/$(DEPDIR)/libgnu_a-threadlib.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glthread/threadlib.c' object='glthread/libgnu_a-threadlib.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o glthread/libgnu_a-threadlib.o `test -f 'glthread/threadlib.c' || echo '$(srcdir)/'`glthread/threadlib.c
+
+glthread/libgnu_a-threadlib.obj: glthread/threadlib.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT glthread/libgnu_a-threadlib.obj -MD -MP -MF glthread/$(DEPDIR)/libgnu_a-threadlib.Tpo -c -o glthread/libgnu_a-threadlib.obj `if test -f 'glthread/threadlib.c'; then $(CYGPATH_W) 'glthread/threadlib.c'; else $(CYGPATH_W) '$(srcdir)/glthread/threadlib.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) glthread/$(DEPDIR)/libgnu_a-threadlib.Tpo glthread/$(DEPDIR)/libgnu_a-threadlib.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glthread/threadlib.c' object='glthread/libgnu_a-threadlib.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o glthread/libgnu_a-threadlib.obj `if test -f 'glthread/threadlib.c'; then $(CYGPATH_W) 'glthread/threadlib.c'; else $(CYGPATH_W) '$(srcdir)/glthread/threadlib.c'; fi`
+
+libgnu_a-time_r.o: time_r.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-time_r.o -MD -MP -MF $(DEPDIR)/libgnu_a-time_r.Tpo -c -o libgnu_a-time_r.o `test -f 'time_r.c' || echo '$(srcdir)/'`time_r.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-time_r.Tpo $(DEPDIR)/libgnu_a-time_r.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='time_r.c' object='libgnu_a-time_r.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-time_r.o `test -f 'time_r.c' || echo '$(srcdir)/'`time_r.c
+
+libgnu_a-time_r.obj: time_r.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-time_r.obj -MD -MP -MF $(DEPDIR)/libgnu_a-time_r.Tpo -c -o libgnu_a-time_r.obj `if test -f 'time_r.c'; then $(CYGPATH_W) 'time_r.c'; else $(CYGPATH_W) '$(srcdir)/time_r.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-time_r.Tpo $(DEPDIR)/libgnu_a-time_r.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='time_r.c' object='libgnu_a-time_r.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-time_r.obj `if test -f 'time_r.c'; then $(CYGPATH_W) 'time_r.c'; else $(CYGPATH_W) '$(srcdir)/time_r.c'; fi`
+
+libgnu_a-timegm.o: timegm.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-timegm.o -MD -MP -MF $(DEPDIR)/libgnu_a-timegm.Tpo -c -o libgnu_a-timegm.o `test -f 'timegm.c' || echo '$(srcdir)/'`timegm.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-timegm.Tpo $(DEPDIR)/libgnu_a-timegm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timegm.c' object='libgnu_a-timegm.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-timegm.o `test -f 'timegm.c' || echo '$(srcdir)/'`timegm.c
+
+libgnu_a-timegm.obj: timegm.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-timegm.obj -MD -MP -MF $(DEPDIR)/libgnu_a-timegm.Tpo -c -o libgnu_a-timegm.obj `if test -f 'timegm.c'; then $(CYGPATH_W) 'timegm.c'; else $(CYGPATH_W) '$(srcdir)/timegm.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-timegm.Tpo $(DEPDIR)/libgnu_a-timegm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timegm.c' object='libgnu_a-timegm.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-timegm.obj `if test -f 'timegm.c'; then $(CYGPATH_W) 'timegm.c'; else $(CYGPATH_W) '$(srcdir)/timegm.c'; fi`
+
+libgnu_a-unistd.o: unistd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-unistd.o -MD -MP -MF $(DEPDIR)/libgnu_a-unistd.Tpo -c -o libgnu_a-unistd.o `test -f 'unistd.c' || echo '$(srcdir)/'`unistd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-unistd.Tpo $(DEPDIR)/libgnu_a-unistd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unistd.c' object='libgnu_a-unistd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-unistd.o `test -f 'unistd.c' || echo '$(srcdir)/'`unistd.c
+
+libgnu_a-unistd.obj: unistd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-unistd.obj -MD -MP -MF $(DEPDIR)/libgnu_a-unistd.Tpo -c -o libgnu_a-unistd.obj `if test -f 'unistd.c'; then $(CYGPATH_W) 'unistd.c'; else $(CYGPATH_W) '$(srcdir)/unistd.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-unistd.Tpo $(DEPDIR)/libgnu_a-unistd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unistd.c' object='libgnu_a-unistd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-unistd.obj `if test -f 'unistd.c'; then $(CYGPATH_W) 'unistd.c'; else $(CYGPATH_W) '$(srcdir)/unistd.c'; fi`
+
+libgnu_a-unsetenv.o: unsetenv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-unsetenv.o -MD -MP -MF $(DEPDIR)/libgnu_a-unsetenv.Tpo -c -o libgnu_a-unsetenv.o `test -f 'unsetenv.c' || echo '$(srcdir)/'`unsetenv.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-unsetenv.Tpo $(DEPDIR)/libgnu_a-unsetenv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsetenv.c' object='libgnu_a-unsetenv.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-unsetenv.o `test -f 'unsetenv.c' || echo '$(srcdir)/'`unsetenv.c
+
+libgnu_a-unsetenv.obj: unsetenv.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-unsetenv.obj -MD -MP -MF $(DEPDIR)/libgnu_a-unsetenv.Tpo -c -o libgnu_a-unsetenv.obj `if test -f 'unsetenv.c'; then $(CYGPATH_W) 'unsetenv.c'; else $(CYGPATH_W) '$(srcdir)/unsetenv.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-unsetenv.Tpo $(DEPDIR)/libgnu_a-unsetenv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsetenv.c' object='libgnu_a-unsetenv.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-unsetenv.obj `if test -f 'unsetenv.c'; then $(CYGPATH_W) 'unsetenv.c'; else $(CYGPATH_W) '$(srcdir)/unsetenv.c'; fi`
+
+libgnu_a-wcrtomb.o: wcrtomb.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-wcrtomb.o -MD -MP -MF $(DEPDIR)/libgnu_a-wcrtomb.Tpo -c -o libgnu_a-wcrtomb.o `test -f 'wcrtomb.c' || echo '$(srcdir)/'`wcrtomb.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-wcrtomb.Tpo $(DEPDIR)/libgnu_a-wcrtomb.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wcrtomb.c' object='libgnu_a-wcrtomb.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-wcrtomb.o `test -f 'wcrtomb.c' || echo '$(srcdir)/'`wcrtomb.c
+
+libgnu_a-wcrtomb.obj: wcrtomb.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-wcrtomb.obj -MD -MP -MF $(DEPDIR)/libgnu_a-wcrtomb.Tpo -c -o libgnu_a-wcrtomb.obj `if test -f 'wcrtomb.c'; then $(CYGPATH_W) 'wcrtomb.c'; else $(CYGPATH_W) '$(srcdir)/wcrtomb.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-wcrtomb.Tpo $(DEPDIR)/libgnu_a-wcrtomb.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wcrtomb.c' object='libgnu_a-wcrtomb.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-wcrtomb.obj `if test -f 'wcrtomb.c'; then $(CYGPATH_W) 'wcrtomb.c'; else $(CYGPATH_W) '$(srcdir)/wcrtomb.c'; fi`
+
+libgnu_a-wctype-h.o: wctype-h.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-wctype-h.o -MD -MP -MF $(DEPDIR)/libgnu_a-wctype-h.Tpo -c -o libgnu_a-wctype-h.o `test -f 'wctype-h.c' || echo '$(srcdir)/'`wctype-h.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-wctype-h.Tpo $(DEPDIR)/libgnu_a-wctype-h.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wctype-h.c' object='libgnu_a-wctype-h.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-wctype-h.o `test -f 'wctype-h.c' || echo '$(srcdir)/'`wctype-h.c
+
+libgnu_a-wctype-h.obj: wctype-h.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-wctype-h.obj -MD -MP -MF $(DEPDIR)/libgnu_a-wctype-h.Tpo -c -o libgnu_a-wctype-h.obj `if test -f 'wctype-h.c'; then $(CYGPATH_W) 'wctype-h.c'; else $(CYGPATH_W) '$(srcdir)/wctype-h.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-wctype-h.Tpo $(DEPDIR)/libgnu_a-wctype-h.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wctype-h.c' object='libgnu_a-wctype-h.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-wctype-h.obj `if test -f 'wctype-h.c'; then $(CYGPATH_W) 'wctype-h.c'; else $(CYGPATH_W) '$(srcdir)/wctype-h.c'; fi`
+
+libgnu_a-windows-mutex.o: windows-mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-mutex.o -MD -MP -MF $(DEPDIR)/libgnu_a-windows-mutex.Tpo -c -o libgnu_a-windows-mutex.o `test -f 'windows-mutex.c' || echo '$(srcdir)/'`windows-mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-mutex.Tpo $(DEPDIR)/libgnu_a-windows-mutex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-mutex.c' object='libgnu_a-windows-mutex.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-mutex.o `test -f 'windows-mutex.c' || echo '$(srcdir)/'`windows-mutex.c
+
+libgnu_a-windows-mutex.obj: windows-mutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-mutex.obj -MD -MP -MF $(DEPDIR)/libgnu_a-windows-mutex.Tpo -c -o libgnu_a-windows-mutex.obj `if test -f 'windows-mutex.c'; then $(CYGPATH_W) 'windows-mutex.c'; else $(CYGPATH_W) '$(srcdir)/windows-mutex.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-mutex.Tpo $(DEPDIR)/libgnu_a-windows-mutex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-mutex.c' object='libgnu_a-windows-mutex.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-mutex.obj `if test -f 'windows-mutex.c'; then $(CYGPATH_W) 'windows-mutex.c'; else $(CYGPATH_W) '$(srcdir)/windows-mutex.c'; fi`
+
+libgnu_a-windows-once.o: windows-once.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-once.o -MD -MP -MF $(DEPDIR)/libgnu_a-windows-once.Tpo -c -o libgnu_a-windows-once.o `test -f 'windows-once.c' || echo '$(srcdir)/'`windows-once.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-once.Tpo $(DEPDIR)/libgnu_a-windows-once.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-once.c' object='libgnu_a-windows-once.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-once.o `test -f 'windows-once.c' || echo '$(srcdir)/'`windows-once.c
+
+libgnu_a-windows-once.obj: windows-once.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-once.obj -MD -MP -MF $(DEPDIR)/libgnu_a-windows-once.Tpo -c -o libgnu_a-windows-once.obj `if test -f 'windows-once.c'; then $(CYGPATH_W) 'windows-once.c'; else $(CYGPATH_W) '$(srcdir)/windows-once.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-once.Tpo $(DEPDIR)/libgnu_a-windows-once.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-once.c' object='libgnu_a-windows-once.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-once.obj `if test -f 'windows-once.c'; then $(CYGPATH_W) 'windows-once.c'; else $(CYGPATH_W) '$(srcdir)/windows-once.c'; fi`
+
+libgnu_a-windows-recmutex.o: windows-recmutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-recmutex.o -MD -MP -MF $(DEPDIR)/libgnu_a-windows-recmutex.Tpo -c -o libgnu_a-windows-recmutex.o `test -f 'windows-recmutex.c' || echo '$(srcdir)/'`windows-recmutex.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-recmutex.Tpo $(DEPDIR)/libgnu_a-windows-recmutex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-recmutex.c' object='libgnu_a-windows-recmutex.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-recmutex.o `test -f 'windows-recmutex.c' || echo '$(srcdir)/'`windows-recmutex.c
+
+libgnu_a-windows-recmutex.obj: windows-recmutex.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-recmutex.obj -MD -MP -MF $(DEPDIR)/libgnu_a-windows-recmutex.Tpo -c -o libgnu_a-windows-recmutex.obj `if test -f 'windows-recmutex.c'; then $(CYGPATH_W) 'windows-recmutex.c'; else $(CYGPATH_W) '$(srcdir)/windows-recmutex.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-recmutex.Tpo $(DEPDIR)/libgnu_a-windows-recmutex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-recmutex.c' object='libgnu_a-windows-recmutex.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-recmutex.obj `if test -f 'windows-recmutex.c'; then $(CYGPATH_W) 'windows-recmutex.c'; else $(CYGPATH_W) '$(srcdir)/windows-recmutex.c'; fi`
+
+libgnu_a-windows-rwlock.o: windows-rwlock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-rwlock.o -MD -MP -MF $(DEPDIR)/libgnu_a-windows-rwlock.Tpo -c -o libgnu_a-windows-rwlock.o `test -f 'windows-rwlock.c' || echo '$(srcdir)/'`windows-rwlock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-rwlock.Tpo $(DEPDIR)/libgnu_a-windows-rwlock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-rwlock.c' object='libgnu_a-windows-rwlock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-rwlock.o `test -f 'windows-rwlock.c' || echo '$(srcdir)/'`windows-rwlock.c
+
+libgnu_a-windows-rwlock.obj: windows-rwlock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-windows-rwlock.obj -MD -MP -MF $(DEPDIR)/libgnu_a-windows-rwlock.Tpo -c -o libgnu_a-windows-rwlock.obj `if test -f 'windows-rwlock.c'; then $(CYGPATH_W) 'windows-rwlock.c'; else $(CYGPATH_W) '$(srcdir)/windows-rwlock.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-windows-rwlock.Tpo $(DEPDIR)/libgnu_a-windows-rwlock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='windows-rwlock.c' object='libgnu_a-windows-rwlock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-windows-rwlock.obj `if test -f 'windows-rwlock.c'; then $(CYGPATH_W) 'windows-rwlock.c'; else $(CYGPATH_W) '$(srcdir)/windows-rwlock.c'; fi`
+
+libgnu_a-xmalloc.o: xmalloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-xmalloc.o -MD -MP -MF $(DEPDIR)/libgnu_a-xmalloc.Tpo -c -o libgnu_a-xmalloc.o `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-xmalloc.Tpo $(DEPDIR)/libgnu_a-xmalloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmalloc.c' object='libgnu_a-xmalloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-xmalloc.o `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c
+
+libgnu_a-xmalloc.obj: xmalloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-xmalloc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-xmalloc.Tpo -c -o libgnu_a-xmalloc.obj `if test -f 'xmalloc.c'; then $(CYGPATH_W) 'xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/xmalloc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-xmalloc.Tpo $(DEPDIR)/libgnu_a-xmalloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xmalloc.c' object='libgnu_a-xmalloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-xmalloc.obj `if test -f 'xmalloc.c'; then $(CYGPATH_W) 'xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/xmalloc.c'; fi`
+
+libgnu_a-xalloc-die.o: xalloc-die.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-xalloc-die.o -MD -MP -MF $(DEPDIR)/libgnu_a-xalloc-die.Tpo -c -o libgnu_a-xalloc-die.o `test -f 'xalloc-die.c' || echo '$(srcdir)/'`xalloc-die.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-xalloc-die.Tpo $(DEPDIR)/libgnu_a-xalloc-die.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xalloc-die.c' object='libgnu_a-xalloc-die.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-xalloc-die.o `test -f 'xalloc-die.c' || echo '$(srcdir)/'`xalloc-die.c
+
+libgnu_a-xalloc-die.obj: xalloc-die.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-xalloc-die.obj -MD -MP -MF $(DEPDIR)/libgnu_a-xalloc-die.Tpo -c -o libgnu_a-xalloc-die.obj `if test -f 'xalloc-die.c'; then $(CYGPATH_W) 'xalloc-die.c'; else $(CYGPATH_W) '$(srcdir)/xalloc-die.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-xalloc-die.Tpo $(DEPDIR)/libgnu_a-xalloc-die.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xalloc-die.c' object='libgnu_a-xalloc-die.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-xalloc-die.obj `if test -f 'xalloc-die.c'; then $(CYGPATH_W) 'xalloc-die.c'; else $(CYGPATH_W) '$(srcdir)/xalloc-die.c'; fi`
+
+libgnu_a-xsize.o: xsize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-xsize.o -MD -MP -MF $(DEPDIR)/libgnu_a-xsize.Tpo -c -o libgnu_a-xsize.o `test -f 'xsize.c' || echo '$(srcdir)/'`xsize.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-xsize.Tpo $(DEPDIR)/libgnu_a-xsize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xsize.c' object='libgnu_a-xsize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-xsize.o `test -f 'xsize.c' || echo '$(srcdir)/'`xsize.c
+
+libgnu_a-xsize.obj: xsize.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-xsize.obj -MD -MP -MF $(DEPDIR)/libgnu_a-xsize.Tpo -c -o libgnu_a-xsize.obj `if test -f 'xsize.c'; then $(CYGPATH_W) 'xsize.c'; else $(CYGPATH_W) '$(srcdir)/xsize.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-xsize.Tpo $(DEPDIR)/libgnu_a-xsize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xsize.c' object='libgnu_a-xsize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-xsize.obj `if test -f 'xsize.c'; then $(CYGPATH_W) 'xsize.c'; else $(CYGPATH_W) '$(srcdir)/xsize.c'; fi`
+
+libgnu_a-calloc.o: calloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-calloc.o -MD -MP -MF $(DEPDIR)/libgnu_a-calloc.Tpo -c -o libgnu_a-calloc.o `test -f 'calloc.c' || echo '$(srcdir)/'`calloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-calloc.Tpo $(DEPDIR)/libgnu_a-calloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='calloc.c' object='libgnu_a-calloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-calloc.o `test -f 'calloc.c' || echo '$(srcdir)/'`calloc.c
+
+libgnu_a-calloc.obj: calloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-calloc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-calloc.Tpo -c -o libgnu_a-calloc.obj `if test -f 'calloc.c'; then $(CYGPATH_W) 'calloc.c'; else $(CYGPATH_W) '$(srcdir)/calloc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-calloc.Tpo $(DEPDIR)/libgnu_a-calloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='calloc.c' object='libgnu_a-calloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-calloc.obj `if test -f 'calloc.c'; then $(CYGPATH_W) 'calloc.c'; else $(CYGPATH_W) '$(srcdir)/calloc.c'; fi`
+
+libgnu_a-floor.o: floor.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-floor.o -MD -MP -MF $(DEPDIR)/libgnu_a-floor.Tpo -c -o libgnu_a-floor.o `test -f 'floor.c' || echo '$(srcdir)/'`floor.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-floor.Tpo $(DEPDIR)/libgnu_a-floor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='floor.c' object='libgnu_a-floor.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-floor.o `test -f 'floor.c' || echo '$(srcdir)/'`floor.c
+
+libgnu_a-floor.obj: floor.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-floor.obj -MD -MP -MF $(DEPDIR)/libgnu_a-floor.Tpo -c -o libgnu_a-floor.obj `if test -f 'floor.c'; then $(CYGPATH_W) 'floor.c'; else $(CYGPATH_W) '$(srcdir)/floor.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-floor.Tpo $(DEPDIR)/libgnu_a-floor.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='floor.c' object='libgnu_a-floor.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-floor.obj `if test -f 'floor.c'; then $(CYGPATH_W) 'floor.c'; else $(CYGPATH_W) '$(srcdir)/floor.c'; fi`
+
+libgnu_a-fopen.o: fopen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fopen.o -MD -MP -MF $(DEPDIR)/libgnu_a-fopen.Tpo -c -o libgnu_a-fopen.o `test -f 'fopen.c' || echo '$(srcdir)/'`fopen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fopen.Tpo $(DEPDIR)/libgnu_a-fopen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fopen.c' object='libgnu_a-fopen.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fopen.o `test -f 'fopen.c' || echo '$(srcdir)/'`fopen.c
+
+libgnu_a-fopen.obj: fopen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-fopen.obj -MD -MP -MF $(DEPDIR)/libgnu_a-fopen.Tpo -c -o libgnu_a-fopen.obj `if test -f 'fopen.c'; then $(CYGPATH_W) 'fopen.c'; else $(CYGPATH_W) '$(srcdir)/fopen.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-fopen.Tpo $(DEPDIR)/libgnu_a-fopen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fopen.c' object='libgnu_a-fopen.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-fopen.obj `if test -f 'fopen.c'; then $(CYGPATH_W) 'fopen.c'; else $(CYGPATH_W) '$(srcdir)/fopen.c'; fi`
+
+libgnu_a-stat-w32.o: stat-w32.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stat-w32.o -MD -MP -MF $(DEPDIR)/libgnu_a-stat-w32.Tpo -c -o libgnu_a-stat-w32.o `test -f 'stat-w32.c' || echo '$(srcdir)/'`stat-w32.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stat-w32.Tpo $(DEPDIR)/libgnu_a-stat-w32.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat-w32.c' object='libgnu_a-stat-w32.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stat-w32.o `test -f 'stat-w32.c' || echo '$(srcdir)/'`stat-w32.c
+
+libgnu_a-stat-w32.obj: stat-w32.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-stat-w32.obj -MD -MP -MF $(DEPDIR)/libgnu_a-stat-w32.Tpo -c -o libgnu_a-stat-w32.obj `if test -f 'stat-w32.c'; then $(CYGPATH_W) 'stat-w32.c'; else $(CYGPATH_W) '$(srcdir)/stat-w32.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-stat-w32.Tpo $(DEPDIR)/libgnu_a-stat-w32.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stat-w32.c' object='libgnu_a-stat-w32.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-stat-w32.obj `if test -f 'stat-w32.c'; then $(CYGPATH_W) 'stat-w32.c'; else $(CYGPATH_W) '$(srcdir)/stat-w32.c'; fi`
+
+malloc/libgnu_a-dynarray-skeleton.o: malloc/dynarray-skeleton.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray-skeleton.o -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Tpo -c -o malloc/libgnu_a-dynarray-skeleton.o `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray-skeleton.c' object='malloc/libgnu_a-dynarray-skeleton.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray-skeleton.o `test -f 'malloc/dynarray-skeleton.c' || echo '$(srcdir)/'`malloc/dynarray-skeleton.c
+
+malloc/libgnu_a-dynarray-skeleton.obj: malloc/dynarray-skeleton.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT malloc/libgnu_a-dynarray-skeleton.obj -MD -MP -MF malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Tpo -c -o malloc/libgnu_a-dynarray-skeleton.obj `if test -f 'malloc/dynarray-skeleton.c'; then $(CYGPATH_W) 'malloc/dynarray-skeleton.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray-skeleton.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Tpo malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc/dynarray-skeleton.c' object='malloc/libgnu_a-dynarray-skeleton.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o malloc/libgnu_a-dynarray-skeleton.obj `if test -f 'malloc/dynarray-skeleton.c'; then $(CYGPATH_W) 'malloc/dynarray-skeleton.c'; else $(CYGPATH_W) '$(srcdir)/malloc/dynarray-skeleton.c'; fi`
+
+libgnu_a-malloc.o: malloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-malloc.o -MD -MP -MF $(DEPDIR)/libgnu_a-malloc.Tpo -c -o libgnu_a-malloc.o `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-malloc.Tpo $(DEPDIR)/libgnu_a-malloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc.c' object='libgnu_a-malloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-malloc.o `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c
+
+libgnu_a-malloc.obj: malloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-malloc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-malloc.Tpo -c -o libgnu_a-malloc.obj `if test -f 'malloc.c'; then $(CYGPATH_W) 'malloc.c'; else $(CYGPATH_W) '$(srcdir)/malloc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-malloc.Tpo $(DEPDIR)/libgnu_a-malloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='malloc.c' object='libgnu_a-malloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-malloc.obj `if test -f 'malloc.c'; then $(CYGPATH_W) 'malloc.c'; else $(CYGPATH_W) '$(srcdir)/malloc.c'; fi`
+
+libgnu_a-lc-charset-dispatch.o: lc-charset-dispatch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-lc-charset-dispatch.o -MD -MP -MF $(DEPDIR)/libgnu_a-lc-charset-dispatch.Tpo -c -o libgnu_a-lc-charset-dispatch.o `test -f 'lc-charset-dispatch.c' || echo '$(srcdir)/'`lc-charset-dispatch.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-lc-charset-dispatch.Tpo $(DEPDIR)/libgnu_a-lc-charset-dispatch.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lc-charset-dispatch.c' object='libgnu_a-lc-charset-dispatch.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-lc-charset-dispatch.o `test -f 'lc-charset-dispatch.c' || echo '$(srcdir)/'`lc-charset-dispatch.c
+
+libgnu_a-lc-charset-dispatch.obj: lc-charset-dispatch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-lc-charset-dispatch.obj -MD -MP -MF $(DEPDIR)/libgnu_a-lc-charset-dispatch.Tpo -c -o libgnu_a-lc-charset-dispatch.obj `if test -f 'lc-charset-dispatch.c'; then $(CYGPATH_W) 'lc-charset-dispatch.c'; else $(CYGPATH_W) '$(srcdir)/lc-charset-dispatch.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-lc-charset-dispatch.Tpo $(DEPDIR)/libgnu_a-lc-charset-dispatch.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lc-charset-dispatch.c' object='libgnu_a-lc-charset-dispatch.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-lc-charset-dispatch.obj `if test -f 'lc-charset-dispatch.c'; then $(CYGPATH_W) 'lc-charset-dispatch.c'; else $(CYGPATH_W) '$(srcdir)/lc-charset-dispatch.c'; fi`
+
+libgnu_a-mbtowc-lock.o: mbtowc-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbtowc-lock.o -MD -MP -MF $(DEPDIR)/libgnu_a-mbtowc-lock.Tpo -c -o libgnu_a-mbtowc-lock.o `test -f 'mbtowc-lock.c' || echo '$(srcdir)/'`mbtowc-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbtowc-lock.Tpo $(DEPDIR)/libgnu_a-mbtowc-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbtowc-lock.c' object='libgnu_a-mbtowc-lock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbtowc-lock.o `test -f 'mbtowc-lock.c' || echo '$(srcdir)/'`mbtowc-lock.c
+
+libgnu_a-mbtowc-lock.obj: mbtowc-lock.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mbtowc-lock.obj -MD -MP -MF $(DEPDIR)/libgnu_a-mbtowc-lock.Tpo -c -o libgnu_a-mbtowc-lock.obj `if test -f 'mbtowc-lock.c'; then $(CYGPATH_W) 'mbtowc-lock.c'; else $(CYGPATH_W) '$(srcdir)/mbtowc-lock.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mbtowc-lock.Tpo $(DEPDIR)/libgnu_a-mbtowc-lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mbtowc-lock.c' object='libgnu_a-mbtowc-lock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mbtowc-lock.obj `if test -f 'mbtowc-lock.c'; then $(CYGPATH_W) 'mbtowc-lock.c'; else $(CYGPATH_W) '$(srcdir)/mbtowc-lock.c'; fi`
+
+libgnu_a-mktime.o: mktime.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mktime.o -MD -MP -MF $(DEPDIR)/libgnu_a-mktime.Tpo -c -o libgnu_a-mktime.o `test -f 'mktime.c' || echo '$(srcdir)/'`mktime.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mktime.Tpo $(DEPDIR)/libgnu_a-mktime.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mktime.c' object='libgnu_a-mktime.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mktime.o `test -f 'mktime.c' || echo '$(srcdir)/'`mktime.c
+
+libgnu_a-mktime.obj: mktime.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-mktime.obj -MD -MP -MF $(DEPDIR)/libgnu_a-mktime.Tpo -c -o libgnu_a-mktime.obj `if test -f 'mktime.c'; then $(CYGPATH_W) 'mktime.c'; else $(CYGPATH_W) '$(srcdir)/mktime.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-mktime.Tpo $(DEPDIR)/libgnu_a-mktime.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mktime.c' object='libgnu_a-mktime.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-mktime.obj `if test -f 'mktime.c'; then $(CYGPATH_W) 'mktime.c'; else $(CYGPATH_W) '$(srcdir)/mktime.c'; fi`
+
+libgnu_a-realloc.o: realloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-realloc.o -MD -MP -MF $(DEPDIR)/libgnu_a-realloc.Tpo -c -o libgnu_a-realloc.o `test -f 'realloc.c' || echo '$(srcdir)/'`realloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-realloc.Tpo $(DEPDIR)/libgnu_a-realloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='realloc.c' object='libgnu_a-realloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-realloc.o `test -f 'realloc.c' || echo '$(srcdir)/'`realloc.c
+
+libgnu_a-realloc.obj: realloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-realloc.obj -MD -MP -MF $(DEPDIR)/libgnu_a-realloc.Tpo -c -o libgnu_a-realloc.obj `if test -f 'realloc.c'; then $(CYGPATH_W) 'realloc.c'; else $(CYGPATH_W) '$(srcdir)/realloc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-realloc.Tpo $(DEPDIR)/libgnu_a-realloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='realloc.c' object='libgnu_a-realloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-realloc.obj `if test -f 'realloc.c'; then $(CYGPATH_W) 'realloc.c'; else $(CYGPATH_W) '$(srcdir)/realloc.c'; fi`
+
+libgnu_a-regcomp.o: regcomp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regcomp.o -MD -MP -MF $(DEPDIR)/libgnu_a-regcomp.Tpo -c -o libgnu_a-regcomp.o `test -f 'regcomp.c' || echo '$(srcdir)/'`regcomp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regcomp.Tpo $(DEPDIR)/libgnu_a-regcomp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regcomp.c' object='libgnu_a-regcomp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regcomp.o `test -f 'regcomp.c' || echo '$(srcdir)/'`regcomp.c
+
+libgnu_a-regcomp.obj: regcomp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regcomp.obj -MD -MP -MF $(DEPDIR)/libgnu_a-regcomp.Tpo -c -o libgnu_a-regcomp.obj `if test -f 'regcomp.c'; then $(CYGPATH_W) 'regcomp.c'; else $(CYGPATH_W) '$(srcdir)/regcomp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regcomp.Tpo $(DEPDIR)/libgnu_a-regcomp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regcomp.c' object='libgnu_a-regcomp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regcomp.obj `if test -f 'regcomp.c'; then $(CYGPATH_W) 'regcomp.c'; else $(CYGPATH_W) '$(srcdir)/regcomp.c'; fi`
+
+libgnu_a-regex_internal.o: regex_internal.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regex_internal.o -MD -MP -MF $(DEPDIR)/libgnu_a-regex_internal.Tpo -c -o libgnu_a-regex_internal.o `test -f 'regex_internal.c' || echo '$(srcdir)/'`regex_internal.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regex_internal.Tpo $(DEPDIR)/libgnu_a-regex_internal.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regex_internal.c' object='libgnu_a-regex_internal.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regex_internal.o `test -f 'regex_internal.c' || echo '$(srcdir)/'`regex_internal.c
+
+libgnu_a-regex_internal.obj: regex_internal.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regex_internal.obj -MD -MP -MF $(DEPDIR)/libgnu_a-regex_internal.Tpo -c -o libgnu_a-regex_internal.obj `if test -f 'regex_internal.c'; then $(CYGPATH_W) 'regex_internal.c'; else $(CYGPATH_W) '$(srcdir)/regex_internal.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regex_internal.Tpo $(DEPDIR)/libgnu_a-regex_internal.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regex_internal.c' object='libgnu_a-regex_internal.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regex_internal.obj `if test -f 'regex_internal.c'; then $(CYGPATH_W) 'regex_internal.c'; else $(CYGPATH_W) '$(srcdir)/regex_internal.c'; fi`
+
+libgnu_a-regexec.o: regexec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regexec.o -MD -MP -MF $(DEPDIR)/libgnu_a-regexec.Tpo -c -o libgnu_a-regexec.o `test -f 'regexec.c' || echo '$(srcdir)/'`regexec.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regexec.Tpo $(DEPDIR)/libgnu_a-regexec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regexec.c' object='libgnu_a-regexec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regexec.o `test -f 'regexec.c' || echo '$(srcdir)/'`regexec.c
+
+libgnu_a-regexec.obj: regexec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-regexec.obj -MD -MP -MF $(DEPDIR)/libgnu_a-regexec.Tpo -c -o libgnu_a-regexec.obj `if test -f 'regexec.c'; then $(CYGPATH_W) 'regexec.c'; else $(CYGPATH_W) '$(srcdir)/regexec.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-regexec.Tpo $(DEPDIR)/libgnu_a-regexec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='regexec.c' object='libgnu_a-regexec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-regexec.obj `if test -f 'regexec.c'; then $(CYGPATH_W) 'regexec.c'; else $(CYGPATH_W) '$(srcdir)/regexec.c'; fi`
+
+libgnu_a-snprintf.o: snprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-snprintf.o -MD -MP -MF $(DEPDIR)/libgnu_a-snprintf.Tpo -c -o libgnu_a-snprintf.o `test -f 'snprintf.c' || echo '$(srcdir)/'`snprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-snprintf.Tpo $(DEPDIR)/libgnu_a-snprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='snprintf.c' object='libgnu_a-snprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-snprintf.o `test -f 'snprintf.c' || echo '$(srcdir)/'`snprintf.c
+
+libgnu_a-snprintf.obj: snprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-snprintf.obj -MD -MP -MF $(DEPDIR)/libgnu_a-snprintf.Tpo -c -o libgnu_a-snprintf.obj `if test -f 'snprintf.c'; then $(CYGPATH_W) 'snprintf.c'; else $(CYGPATH_W) '$(srcdir)/snprintf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-snprintf.Tpo $(DEPDIR)/libgnu_a-snprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='snprintf.c' object='libgnu_a-snprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-snprintf.obj `if test -f 'snprintf.c'; then $(CYGPATH_W) 'snprintf.c'; else $(CYGPATH_W) '$(srcdir)/snprintf.c'; fi`
+
+libgnu_a-strcasestr.o: strcasestr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strcasestr.o -MD -MP -MF $(DEPDIR)/libgnu_a-strcasestr.Tpo -c -o libgnu_a-strcasestr.o `test -f 'strcasestr.c' || echo '$(srcdir)/'`strcasestr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strcasestr.Tpo $(DEPDIR)/libgnu_a-strcasestr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strcasestr.c' object='libgnu_a-strcasestr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strcasestr.o `test -f 'strcasestr.c' || echo '$(srcdir)/'`strcasestr.c
+
+libgnu_a-strcasestr.obj: strcasestr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strcasestr.obj -MD -MP -MF $(DEPDIR)/libgnu_a-strcasestr.Tpo -c -o libgnu_a-strcasestr.obj `if test -f 'strcasestr.c'; then $(CYGPATH_W) 'strcasestr.c'; else $(CYGPATH_W) '$(srcdir)/strcasestr.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strcasestr.Tpo $(DEPDIR)/libgnu_a-strcasestr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strcasestr.c' object='libgnu_a-strcasestr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strcasestr.obj `if test -f 'strcasestr.c'; then $(CYGPATH_W) 'strcasestr.c'; else $(CYGPATH_W) '$(srcdir)/strcasestr.c'; fi`
+
+libgnu_a-strstr.o: strstr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strstr.o -MD -MP -MF $(DEPDIR)/libgnu_a-strstr.Tpo -c -o libgnu_a-strstr.o `test -f 'strstr.c' || echo '$(srcdir)/'`strstr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strstr.Tpo $(DEPDIR)/libgnu_a-strstr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strstr.c' object='libgnu_a-strstr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strstr.o `test -f 'strstr.c' || echo '$(srcdir)/'`strstr.c
+
+libgnu_a-strstr.obj: strstr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-strstr.obj -MD -MP -MF $(DEPDIR)/libgnu_a-strstr.Tpo -c -o libgnu_a-strstr.obj `if test -f 'strstr.c'; then $(CYGPATH_W) 'strstr.c'; else $(CYGPATH_W) '$(srcdir)/strstr.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-strstr.Tpo $(DEPDIR)/libgnu_a-strstr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='strstr.c' object='libgnu_a-strstr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-strstr.obj `if test -f 'strstr.c'; then $(CYGPATH_W) 'strstr.c'; else $(CYGPATH_W) '$(srcdir)/strstr.c'; fi`
+
+libgnu_a-asnprintf.o: asnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-asnprintf.o -MD -MP -MF $(DEPDIR)/libgnu_a-asnprintf.Tpo -c -o libgnu_a-asnprintf.o `test -f 'asnprintf.c' || echo '$(srcdir)/'`asnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-asnprintf.Tpo $(DEPDIR)/libgnu_a-asnprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asnprintf.c' object='libgnu_a-asnprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-asnprintf.o `test -f 'asnprintf.c' || echo '$(srcdir)/'`asnprintf.c
+
+libgnu_a-asnprintf.obj: asnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-asnprintf.obj -MD -MP -MF $(DEPDIR)/libgnu_a-asnprintf.Tpo -c -o libgnu_a-asnprintf.obj `if test -f 'asnprintf.c'; then $(CYGPATH_W) 'asnprintf.c'; else $(CYGPATH_W) '$(srcdir)/asnprintf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-asnprintf.Tpo $(DEPDIR)/libgnu_a-asnprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asnprintf.c' object='libgnu_a-asnprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-asnprintf.obj `if test -f 'asnprintf.c'; then $(CYGPATH_W) 'asnprintf.c'; else $(CYGPATH_W) '$(srcdir)/asnprintf.c'; fi`
+
+libgnu_a-printf-args.o: printf-args.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-printf-args.o -MD -MP -MF $(DEPDIR)/libgnu_a-printf-args.Tpo -c -o libgnu_a-printf-args.o `test -f 'printf-args.c' || echo '$(srcdir)/'`printf-args.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-printf-args.Tpo $(DEPDIR)/libgnu_a-printf-args.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printf-args.c' object='libgnu_a-printf-args.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-printf-args.o `test -f 'printf-args.c' || echo '$(srcdir)/'`printf-args.c
+
+libgnu_a-printf-args.obj: printf-args.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-printf-args.obj -MD -MP -MF $(DEPDIR)/libgnu_a-printf-args.Tpo -c -o libgnu_a-printf-args.obj `if test -f 'printf-args.c'; then $(CYGPATH_W) 'printf-args.c'; else $(CYGPATH_W) '$(srcdir)/printf-args.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-printf-args.Tpo $(DEPDIR)/libgnu_a-printf-args.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printf-args.c' object='libgnu_a-printf-args.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-printf-args.obj `if test -f 'printf-args.c'; then $(CYGPATH_W) 'printf-args.c'; else $(CYGPATH_W) '$(srcdir)/printf-args.c'; fi`
+
+libgnu_a-printf-parse.o: printf-parse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-printf-parse.o -MD -MP -MF $(DEPDIR)/libgnu_a-printf-parse.Tpo -c -o libgnu_a-printf-parse.o `test -f 'printf-parse.c' || echo '$(srcdir)/'`printf-parse.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-printf-parse.Tpo $(DEPDIR)/libgnu_a-printf-parse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printf-parse.c' object='libgnu_a-printf-parse.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-printf-parse.o `test -f 'printf-parse.c' || echo '$(srcdir)/'`printf-parse.c
+
+libgnu_a-printf-parse.obj: printf-parse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-printf-parse.obj -MD -MP -MF $(DEPDIR)/libgnu_a-printf-parse.Tpo -c -o libgnu_a-printf-parse.obj `if test -f 'printf-parse.c'; then $(CYGPATH_W) 'printf-parse.c'; else $(CYGPATH_W) '$(srcdir)/printf-parse.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-printf-parse.Tpo $(DEPDIR)/libgnu_a-printf-parse.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='printf-parse.c' object='libgnu_a-printf-parse.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-printf-parse.obj `if test -f 'printf-parse.c'; then $(CYGPATH_W) 'printf-parse.c'; else $(CYGPATH_W) '$(srcdir)/printf-parse.c'; fi`
+
+libgnu_a-vasnprintf.o: vasnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-vasnprintf.o -MD -MP -MF $(DEPDIR)/libgnu_a-vasnprintf.Tpo -c -o libgnu_a-vasnprintf.o `test -f 'vasnprintf.c' || echo '$(srcdir)/'`vasnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-vasnprintf.Tpo $(DEPDIR)/libgnu_a-vasnprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vasnprintf.c' object='libgnu_a-vasnprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-vasnprintf.o `test -f 'vasnprintf.c' || echo '$(srcdir)/'`vasnprintf.c
+
+libgnu_a-vasnprintf.obj: vasnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-vasnprintf.obj -MD -MP -MF $(DEPDIR)/libgnu_a-vasnprintf.Tpo -c -o libgnu_a-vasnprintf.obj `if test -f 'vasnprintf.c'; then $(CYGPATH_W) 'vasnprintf.c'; else $(CYGPATH_W) '$(srcdir)/vasnprintf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-vasnprintf.Tpo $(DEPDIR)/libgnu_a-vasnprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vasnprintf.c' object='libgnu_a-vasnprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-vasnprintf.obj `if test -f 'vasnprintf.c'; then $(CYGPATH_W) 'vasnprintf.c'; else $(CYGPATH_W) '$(srcdir)/vasnprintf.c'; fi`
+
+libgnu_a-asprintf.o: asprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-asprintf.o -MD -MP -MF $(DEPDIR)/libgnu_a-asprintf.Tpo -c -o libgnu_a-asprintf.o `test -f 'asprintf.c' || echo '$(srcdir)/'`asprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-asprintf.Tpo $(DEPDIR)/libgnu_a-asprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asprintf.c' object='libgnu_a-asprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-asprintf.o `test -f 'asprintf.c' || echo '$(srcdir)/'`asprintf.c
+
+libgnu_a-asprintf.obj: asprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-asprintf.obj -MD -MP -MF $(DEPDIR)/libgnu_a-asprintf.Tpo -c -o libgnu_a-asprintf.obj `if test -f 'asprintf.c'; then $(CYGPATH_W) 'asprintf.c'; else $(CYGPATH_W) '$(srcdir)/asprintf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-asprintf.Tpo $(DEPDIR)/libgnu_a-asprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='asprintf.c' object='libgnu_a-asprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-asprintf.obj `if test -f 'asprintf.c'; then $(CYGPATH_W) 'asprintf.c'; else $(CYGPATH_W) '$(srcdir)/asprintf.c'; fi`
+
+libgnu_a-vasprintf.o: vasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-vasprintf.o -MD -MP -MF $(DEPDIR)/libgnu_a-vasprintf.Tpo -c -o libgnu_a-vasprintf.o `test -f 'vasprintf.c' || echo '$(srcdir)/'`vasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-vasprintf.Tpo $(DEPDIR)/libgnu_a-vasprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vasprintf.c' object='libgnu_a-vasprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-vasprintf.o `test -f 'vasprintf.c' || echo '$(srcdir)/'`vasprintf.c
+
+libgnu_a-vasprintf.obj: vasprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-vasprintf.obj -MD -MP -MF $(DEPDIR)/libgnu_a-vasprintf.Tpo -c -o libgnu_a-vasprintf.obj `if test -f 'vasprintf.c'; then $(CYGPATH_W) 'vasprintf.c'; else $(CYGPATH_W) '$(srcdir)/vasprintf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-vasprintf.Tpo $(DEPDIR)/libgnu_a-vasprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vasprintf.c' object='libgnu_a-vasprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-vasprintf.obj `if test -f 'vasprintf.c'; then $(CYGPATH_W) 'vasprintf.c'; else $(CYGPATH_W) '$(srcdir)/vasprintf.c'; fi`
+
+libgnu_a-vsnprintf.o: vsnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-vsnprintf.o -MD -MP -MF $(DEPDIR)/libgnu_a-vsnprintf.Tpo -c -o libgnu_a-vsnprintf.o `test -f 'vsnprintf.c' || echo '$(srcdir)/'`vsnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-vsnprintf.Tpo $(DEPDIR)/libgnu_a-vsnprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vsnprintf.c' object='libgnu_a-vsnprintf.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-vsnprintf.o `test -f 'vsnprintf.c' || echo '$(srcdir)/'`vsnprintf.c
+
+libgnu_a-vsnprintf.obj: vsnprintf.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -MT libgnu_a-vsnprintf.obj -MD -MP -MF $(DEPDIR)/libgnu_a-vsnprintf.Tpo -c -o libgnu_a-vsnprintf.obj `if test -f 'vsnprintf.c'; then $(CYGPATH_W) 'vsnprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsnprintf.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_a-vsnprintf.Tpo $(DEPDIR)/libgnu_a-vsnprintf.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vsnprintf.c' object='libgnu_a-vsnprintf.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_a_CFLAGS) $(CFLAGS) -c -o libgnu_a-vsnprintf.obj `if test -f 'vsnprintf.c'; then $(CYGPATH_W) 'vsnprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsnprintf.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f glthread/$(DEPDIR)/$(am__dirstamp)
+ -rm -f glthread/$(am__dirstamp)
+ -rm -f malloc/$(DEPDIR)/$(am__dirstamp)
+ -rm -f malloc/$(am__dirstamp)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/libgnu_a-af_alg.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-asnprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-asprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-base64.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-basename-lgpl.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-basename.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-btowc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-calloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-cloexec.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-close.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-dirname-lgpl.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-dirname.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-dup2.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-error.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-exitfail.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fcntl.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fd-hook.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fflush.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-float.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-floor.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-floorf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fopen.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fpurge.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-freading.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-free.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fseek.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fseeko.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fstat.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fsusage.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-ftell.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-ftello.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-gai_strerror.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getaddrinfo.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getdelim.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getdtablesize.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-gethostname.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getline.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getloadavg.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getopt.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getopt1.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getprogname.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-hard-locale.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-ialloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-idpriv-droptemp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-inet_ntop.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-itold.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-lc-charset-dispatch.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-localcharset.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-localeconv.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-lseek.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-malloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-malloca.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-math.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbrtowc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbsinit.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbtowc-lock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbtowc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-memchr.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mktime.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mountlist.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-msvc-inval.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-msvc-nothrow.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-nl_langinfo-lock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-nl_langinfo.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-open.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-printf-args.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-printf-parse.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-realloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-reallocarray.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regcomp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regex.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regex_internal.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regexec.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-setenv.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-setlocale-lock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-setlocale_null.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sha256-stream.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sha256.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-snprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sockets.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stat-time.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stat-w32.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stat.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stdio-read.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stdio-write.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strcasecmp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strcasestr.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strerror-override.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strerror.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stripslash.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strncasecmp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strsep.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strstr.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sys_socket.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-time_r.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-timegm.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-unistd.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-unsetenv.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-vasnprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-vasprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-vsnprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-wcrtomb.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-wctype-h.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-mutex.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-once.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-recmutex.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-rwlock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-xalloc-die.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-xmalloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-xsize.Po
+ -rm -f glthread/$(DEPDIR)/libgnu_a-lock.Po
+ -rm -f glthread/$(DEPDIR)/libgnu_a-threadlib.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-local distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f ./$(DEPDIR)/libgnu_a-af_alg.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-asnprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-asprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-base64.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-basename-lgpl.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-basename.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-btowc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-calloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-cloexec.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-close.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-dirname-lgpl.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-dirname.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-dup2.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-error.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-exitfail.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fcntl.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fd-hook.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fflush.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-float.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-floor.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-floorf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fopen.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fpurge.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-freading.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-free.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fseek.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fseeko.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fstat.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-fsusage.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-ftell.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-ftello.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-gai_strerror.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getaddrinfo.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getdelim.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getdtablesize.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-gethostname.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getline.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getloadavg.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getopt.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getopt1.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-getprogname.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-hard-locale.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-ialloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-idpriv-droptemp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-inet_ntop.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-itold.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-lc-charset-dispatch.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-localcharset.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-localeconv.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-lseek.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-malloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-malloca.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-math.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbrtowc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbsinit.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbtowc-lock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mbtowc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-memchr.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mktime.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-mountlist.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-msvc-inval.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-msvc-nothrow.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-nl_langinfo-lock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-nl_langinfo.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-open.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-printf-args.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-printf-parse.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-realloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-reallocarray.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regcomp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regex.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regex_internal.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-regexec.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-setenv.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-setlocale-lock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-setlocale_null.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sha256-stream.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sha256.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-snprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sockets.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stat-time.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stat-w32.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stat.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stdio-read.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stdio-write.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strcasecmp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strcasestr.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strerror-override.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strerror.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-stripslash.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strncasecmp.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strsep.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-strstr.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-sys_socket.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-time_r.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-timegm.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-unistd.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-unsetenv.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-vasnprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-vasprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-vsnprintf.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-wcrtomb.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-wctype-h.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-mutex.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-once.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-recmutex.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-windows-rwlock.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-xalloc-die.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-xmalloc.Po
+ -rm -f ./$(DEPDIR)/libgnu_a-xsize.Po
+ -rm -f glthread/$(DEPDIR)/libgnu_a-lock.Po
+ -rm -f glthread/$(DEPDIR)/libgnu_a-threadlib.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray-skeleton.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_at_failure.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_emplace_enlarge.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_finalize.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_resize.Po
+ -rm -f malloc/$(DEPDIR)/libgnu_a-dynarray_resize_clear.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic \
+ maintainer-clean-local
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-local
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) all check install install-am \
+ install-exec install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-am clean clean-generic clean-libtool \
+ clean-noinstLIBRARIES clean-noinstLTLIBRARIES cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-local mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
+ pdf-am ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# We need the following in order to create <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_ALLOCA_H_TRUE@ -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' \
+@GL_GENERATE_ALLOCA_H_TRUE@ $(srcdir)/alloca.in.h > $@-t
+@GL_GENERATE_ALLOCA_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@
+
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_GEN)$(MKDIR_P) 'arpa'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
+ -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
+ -e 's/@''GNULIB_INET_NTOP''@/$(GL_GNULIB_INET_NTOP)/g' \
+ -e 's/@''GNULIB_INET_PTON''@/$(GL_GNULIB_INET_PTON)/g' \
+ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+ -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
+ -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+ -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \
+ -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/arpa_inet.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <assert.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_ASSERT_H_TRUE@assert.h: assert.in.h verify.h $(top_builddir)/config.status
+@GL_GENERATE_ASSERT_H_TRUE@ $(gl_V_at){ $(SED_HEADER_STDOUT) \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|@''NEXT_ASSERT_H''@|$(NEXT_ASSERT_H)|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ < $(srcdir)/assert.in.h && \
+@GL_GENERATE_ASSERT_H_TRUE@ sed -e '/@assert.h omit start@/,/@assert.h omit end@/d' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|_gl_verify|_gl_static_assert|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|_GL_VERIFY|_GL_STATIC_ASSERT|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ -e 's|_GL\(_STATIC_ASSERT_H\)|_GL\1|g' \
+@GL_GENERATE_ASSERT_H_TRUE@ < $(srcdir)/verify.h; \
+@GL_GENERATE_ASSERT_H_TRUE@ } > $@-t
+@GL_GENERATE_ASSERT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_ASSERT_H_FALSE@assert.h: $(top_builddir)/config.status
+@GL_GENERATE_ASSERT_H_FALSE@ rm -f $@
+
+# We need the following in order to create <byteswap.h> when the system
+# doesn't have one.
+@GL_GENERATE_BYTESWAP_H_TRUE@byteswap.h: byteswap.in.h $(top_builddir)/config.status
+@GL_GENERATE_BYTESWAP_H_TRUE@ $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/byteswap.in.h
+@GL_GENERATE_BYTESWAP_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_BYTESWAP_H_FALSE@byteswap.h: $(top_builddir)/config.status
+@GL_GENERATE_BYTESWAP_H_FALSE@ rm -f $@
+
+# We need the following in order to create <errno.h> when the system
+# doesn't have one that is POSIX compliant.
+@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@ $(srcdir)/errno.in.h > $@-t
+@GL_GENERATE_ERRNO_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_FALSE@ rm -f $@
+
+# We need the following in order to create <fcntl.h> when the system
+# doesn't have one that works with the given compiler.
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+ -e 's/@''GNULIB_CREAT''@/$(GL_GNULIB_CREAT)/g' \
+ -e 's/@''GNULIB_FCNTL''@/$(GL_GNULIB_FCNTL)/g' \
+ -e 's/@''GNULIB_NONBLOCKING''@/$(GL_GNULIB_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_OPEN''@/$(GL_GNULIB_OPEN)/g' \
+ -e 's/@''GNULIB_OPENAT''@/$(GL_GNULIB_OPENAT)/g' \
+ -e 's/@''GNULIB_MDA_CREAT''@/$(GL_GNULIB_MDA_CREAT)/g' \
+ -e 's/@''GNULIB_MDA_OPEN''@/$(GL_GNULIB_MDA_OPEN)/g' \
+ -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
+ -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+ -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/fcntl.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <float.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_FLOAT_H_TRUE@float.h: float.in.h $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@ $(srcdir)/float.in.h > $@-t
+@GL_GENERATE_FLOAT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_FLOAT_H_FALSE@float.h: $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_FALSE@ rm -f $@
+
+# We need the following in order to create <getopt.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_GETOPT_H_TRUE@getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+@GL_GENERATE_GETOPT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+@GL_GENERATE_GETOPT_H_TRUE@ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_GETOPT_H_TRUE@ $(srcdir)/getopt.in.h > $@-t
+@GL_GENERATE_GETOPT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_GETOPT_H_FALSE@getopt.h: $(top_builddir)/config.status
+@GL_GENERATE_GETOPT_H_FALSE@ rm -f $@
+
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ $(AM_V_GEN)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ $(srcdir)/getopt-cdefs.in.h > $@-t
+@GL_GENERATE_GETOPT_CDEFS_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_GETOPT_CDEFS_H_FALSE@getopt-cdefs.h: $(top_builddir)/config.status
+@GL_GENERATE_GETOPT_CDEFS_H_FALSE@ rm -f $@
+
+malloc/dynarray.gl.h: malloc/dynarray.h
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e '/libc_hidden_proto/d' \
+ $(srcdir)/malloc/dynarray.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c
+ $(AM_V_GEN)$(MKDIR_P) 'malloc'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \
+ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \
+ -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \
+ -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \
+ -e 's|__glibc_likely|_GL_LIKELY|g' \
+ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \
+ $(srcdir)/malloc/dynarray-skeleton.c > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <inttypes.h> when the system
+# doesn't have one that works with the given compiler.
+inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+ -e 's/@''GNULIB_IMAXABS''@/$(GL_GNULIB_IMAXABS)/g' \
+ -e 's/@''GNULIB_IMAXDIV''@/$(GL_GNULIB_IMAXDIV)/g' \
+ -e 's/@''GNULIB_STRTOIMAX''@/$(GL_GNULIB_STRTOIMAX)/g' \
+ -e 's/@''GNULIB_STRTOUMAX''@/$(GL_GNULIB_STRTOUMAX)/g' \
+ -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
+ -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
+ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
+ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+ -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+ -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
+ -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
+ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
+ -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
+ -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
+ -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/inttypes.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create an empty placeholder for
+# <langinfo.h> when the system doesn't have one.
+langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
+ -e 's/@''GNULIB_NL_LANGINFO''@/$(GL_GNULIB_NL_LANGINFO)/g' \
+ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
+ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \
+ -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \
+ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
+ -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \
+ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
+ -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/langinfo.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <limits.h> when the system
+# doesn't have one that is compatible with GNU.
+@GL_GENERATE_LIMITS_H_TRUE@limits.h: limits.in.h $(top_builddir)/config.status
+@GL_GENERATE_LIMITS_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
+@GL_GENERATE_LIMITS_H_TRUE@ $(srcdir)/limits.in.h > $@-t
+@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status
+@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@
+
+# We need the following in order to create <locale.h> when the system
+# doesn't have one that provides all definitions.
+locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
+ -e 's/@''GNULIB_LOCALECONV''@/$(GL_GNULIB_LOCALECONV)/g' \
+ -e 's/@''GNULIB_SETLOCALE''@/$(GL_GNULIB_SETLOCALE)/g' \
+ -e 's/@''GNULIB_SETLOCALE_NULL''@/$(GL_GNULIB_SETLOCALE_NULL)/g' \
+ -e 's/@''GNULIB_DUPLOCALE''@/$(GL_GNULIB_DUPLOCALE)/g' \
+ -e 's/@''GNULIB_LOCALENAME''@/$(GL_GNULIB_LOCALENAME)/g' \
+ -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \
+ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
+ -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \
+ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
+ -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \
+ -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \
+ -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \
+ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+ -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \
+ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \
+ -e 's|@''LOCALENAME_ENHANCE_LOCALE_FUNCS''@|$(LOCALENAME_ENHANCE_LOCALE_FUNCS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/locale.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <math.h> when the system
+# doesn't have one that works with the given compiler.
+math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
+ -e 's/@''GNULIB_ACOSF''@/$(GL_GNULIB_ACOSF)/g' \
+ -e 's/@''GNULIB_ACOSL''@/$(GL_GNULIB_ACOSL)/g' \
+ -e 's/@''GNULIB_ASINF''@/$(GL_GNULIB_ASINF)/g' \
+ -e 's/@''GNULIB_ASINL''@/$(GL_GNULIB_ASINL)/g' \
+ -e 's/@''GNULIB_ATANF''@/$(GL_GNULIB_ATANF)/g' \
+ -e 's/@''GNULIB_ATANL''@/$(GL_GNULIB_ATANL)/g' \
+ -e 's/@''GNULIB_ATAN2F''@/$(GL_GNULIB_ATAN2F)/g' \
+ -e 's/@''GNULIB_CBRT''@/$(GL_GNULIB_CBRT)/g' \
+ -e 's/@''GNULIB_CBRTF''@/$(GL_GNULIB_CBRTF)/g' \
+ -e 's/@''GNULIB_CBRTL''@/$(GL_GNULIB_CBRTL)/g' \
+ -e 's/@''GNULIB_CEIL''@/$(GL_GNULIB_CEIL)/g' \
+ -e 's/@''GNULIB_CEILF''@/$(GL_GNULIB_CEILF)/g' \
+ -e 's/@''GNULIB_CEILL''@/$(GL_GNULIB_CEILL)/g' \
+ -e 's/@''GNULIB_COPYSIGN''@/$(GL_GNULIB_COPYSIGN)/g' \
+ -e 's/@''GNULIB_COPYSIGNF''@/$(GL_GNULIB_COPYSIGNF)/g' \
+ -e 's/@''GNULIB_COPYSIGNL''@/$(GL_GNULIB_COPYSIGNL)/g' \
+ -e 's/@''GNULIB_COSF''@/$(GL_GNULIB_COSF)/g' \
+ -e 's/@''GNULIB_COSL''@/$(GL_GNULIB_COSL)/g' \
+ -e 's/@''GNULIB_COSHF''@/$(GL_GNULIB_COSHF)/g' \
+ -e 's/@''GNULIB_EXPF''@/$(GL_GNULIB_EXPF)/g' \
+ -e 's/@''GNULIB_EXPL''@/$(GL_GNULIB_EXPL)/g' \
+ -e 's/@''GNULIB_EXP2''@/$(GL_GNULIB_EXP2)/g' \
+ -e 's/@''GNULIB_EXP2F''@/$(GL_GNULIB_EXP2F)/g' \
+ -e 's/@''GNULIB_EXP2L''@/$(GL_GNULIB_EXP2L)/g' \
+ -e 's/@''GNULIB_EXPM1''@/$(GL_GNULIB_EXPM1)/g' \
+ -e 's/@''GNULIB_EXPM1F''@/$(GL_GNULIB_EXPM1F)/g' \
+ -e 's/@''GNULIB_EXPM1L''@/$(GL_GNULIB_EXPM1L)/g' \
+ -e 's/@''GNULIB_FABSF''@/$(GL_GNULIB_FABSF)/g' \
+ -e 's/@''GNULIB_FABSL''@/$(GL_GNULIB_FABSL)/g' \
+ -e 's/@''GNULIB_FLOOR''@/$(GL_GNULIB_FLOOR)/g' \
+ -e 's/@''GNULIB_FLOORF''@/$(GL_GNULIB_FLOORF)/g' \
+ -e 's/@''GNULIB_FLOORL''@/$(GL_GNULIB_FLOORL)/g' \
+ -e 's/@''GNULIB_FMA''@/$(GL_GNULIB_FMA)/g' \
+ -e 's/@''GNULIB_FMAF''@/$(GL_GNULIB_FMAF)/g' \
+ -e 's/@''GNULIB_FMAL''@/$(GL_GNULIB_FMAL)/g' \
+ -e 's/@''GNULIB_FMOD''@/$(GL_GNULIB_FMOD)/g' \
+ -e 's/@''GNULIB_FMODF''@/$(GL_GNULIB_FMODF)/g' \
+ -e 's/@''GNULIB_FMODL''@/$(GL_GNULIB_FMODL)/g' \
+ -e 's/@''GNULIB_FREXPF''@/$(GL_GNULIB_FREXPF)/g' \
+ -e 's/@''GNULIB_FREXP''@/$(GL_GNULIB_FREXP)/g' \
+ -e 's/@''GNULIB_FREXPL''@/$(GL_GNULIB_FREXPL)/g' \
+ -e 's/@''GNULIB_HYPOT''@/$(GL_GNULIB_HYPOT)/g' \
+ -e 's/@''GNULIB_HYPOTF''@/$(GL_GNULIB_HYPOTF)/g' \
+ -e 's/@''GNULIB_HYPOTL''@/$(GL_GNULIB_HYPOTL)/g' \
+ < $(srcdir)/math.in.h | \
+ sed -e 's/@''GNULIB_ILOGB''@/$(GL_GNULIB_ILOGB)/g' \
+ -e 's/@''GNULIB_ILOGBF''@/$(GL_GNULIB_ILOGBF)/g' \
+ -e 's/@''GNULIB_ILOGBL''@/$(GL_GNULIB_ILOGBL)/g' \
+ -e 's/@''GNULIB_ISFINITE''@/$(GL_GNULIB_ISFINITE)/g' \
+ -e 's/@''GNULIB_ISINF''@/$(GL_GNULIB_ISINF)/g' \
+ -e 's/@''GNULIB_ISNAN''@/$(GL_GNULIB_ISNAN)/g' \
+ -e 's/@''GNULIB_ISNANF''@/$(GL_GNULIB_ISNANF)/g' \
+ -e 's/@''GNULIB_ISNAND''@/$(GL_GNULIB_ISNAND)/g' \
+ -e 's/@''GNULIB_ISNANL''@/$(GL_GNULIB_ISNANL)/g' \
+ -e 's/@''GNULIB_LDEXPF''@/$(GL_GNULIB_LDEXPF)/g' \
+ -e 's/@''GNULIB_LDEXPL''@/$(GL_GNULIB_LDEXPL)/g' \
+ -e 's/@''GNULIB_LOG''@/$(GL_GNULIB_LOG)/g' \
+ -e 's/@''GNULIB_LOGF''@/$(GL_GNULIB_LOGF)/g' \
+ -e 's/@''GNULIB_LOGL''@/$(GL_GNULIB_LOGL)/g' \
+ -e 's/@''GNULIB_LOG10''@/$(GL_GNULIB_LOG10)/g' \
+ -e 's/@''GNULIB_LOG10F''@/$(GL_GNULIB_LOG10F)/g' \
+ -e 's/@''GNULIB_LOG10L''@/$(GL_GNULIB_LOG10L)/g' \
+ -e 's/@''GNULIB_LOG1P''@/$(GL_GNULIB_LOG1P)/g' \
+ -e 's/@''GNULIB_LOG1PF''@/$(GL_GNULIB_LOG1PF)/g' \
+ -e 's/@''GNULIB_LOG1PL''@/$(GL_GNULIB_LOG1PL)/g' \
+ -e 's/@''GNULIB_LOG2''@/$(GL_GNULIB_LOG2)/g' \
+ -e 's/@''GNULIB_LOG2F''@/$(GL_GNULIB_LOG2F)/g' \
+ -e 's/@''GNULIB_LOG2L''@/$(GL_GNULIB_LOG2L)/g' \
+ -e 's/@''GNULIB_LOGB''@/$(GL_GNULIB_LOGB)/g' \
+ -e 's/@''GNULIB_LOGBF''@/$(GL_GNULIB_LOGBF)/g' \
+ -e 's/@''GNULIB_LOGBL''@/$(GL_GNULIB_LOGBL)/g' \
+ -e 's/@''GNULIB_MODF''@/$(GL_GNULIB_MODF)/g' \
+ -e 's/@''GNULIB_MODFF''@/$(GL_GNULIB_MODFF)/g' \
+ -e 's/@''GNULIB_MODFL''@/$(GL_GNULIB_MODFL)/g' \
+ -e 's/@''GNULIB_POWF''@/$(GL_GNULIB_POWF)/g' \
+ -e 's/@''GNULIB_REMAINDER''@/$(GL_GNULIB_REMAINDER)/g' \
+ -e 's/@''GNULIB_REMAINDERF''@/$(GL_GNULIB_REMAINDERF)/g' \
+ -e 's/@''GNULIB_REMAINDERL''@/$(GL_GNULIB_REMAINDERL)/g' \
+ -e 's/@''GNULIB_RINT''@/$(GL_GNULIB_RINT)/g' \
+ -e 's/@''GNULIB_RINTF''@/$(GL_GNULIB_RINTF)/g' \
+ -e 's/@''GNULIB_RINTL''@/$(GL_GNULIB_RINTL)/g' \
+ -e 's/@''GNULIB_ROUND''@/$(GL_GNULIB_ROUND)/g' \
+ -e 's/@''GNULIB_ROUNDF''@/$(GL_GNULIB_ROUNDF)/g' \
+ -e 's/@''GNULIB_ROUNDL''@/$(GL_GNULIB_ROUNDL)/g' \
+ -e 's/@''GNULIB_SIGNBIT''@/$(GL_GNULIB_SIGNBIT)/g' \
+ -e 's/@''GNULIB_SINF''@/$(GL_GNULIB_SINF)/g' \
+ -e 's/@''GNULIB_SINL''@/$(GL_GNULIB_SINL)/g' \
+ -e 's/@''GNULIB_SINHF''@/$(GL_GNULIB_SINHF)/g' \
+ -e 's/@''GNULIB_SQRTF''@/$(GL_GNULIB_SQRTF)/g' \
+ -e 's/@''GNULIB_SQRTL''@/$(GL_GNULIB_SQRTL)/g' \
+ -e 's/@''GNULIB_TANF''@/$(GL_GNULIB_TANF)/g' \
+ -e 's/@''GNULIB_TANL''@/$(GL_GNULIB_TANL)/g' \
+ -e 's/@''GNULIB_TANHF''@/$(GL_GNULIB_TANHF)/g' \
+ -e 's/@''GNULIB_TRUNC''@/$(GL_GNULIB_TRUNC)/g' \
+ -e 's/@''GNULIB_TRUNCF''@/$(GL_GNULIB_TRUNCF)/g' \
+ -e 's/@''GNULIB_TRUNCL''@/$(GL_GNULIB_TRUNCL)/g' \
+ -e 's/@''GNULIB_MDA_J0''@/$(GL_GNULIB_MDA_J0)/g' \
+ -e 's/@''GNULIB_MDA_J1''@/$(GL_GNULIB_MDA_J1)/g' \
+ -e 's/@''GNULIB_MDA_JN''@/$(GL_GNULIB_MDA_JN)/g' \
+ -e 's/@''GNULIB_MDA_Y0''@/$(GL_GNULIB_MDA_Y0)/g' \
+ -e 's/@''GNULIB_MDA_Y1''@/$(GL_GNULIB_MDA_Y1)/g' \
+ -e 's/@''GNULIB_MDA_YN''@/$(GL_GNULIB_MDA_YN)/g' \
+ | \
+ sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \
+ -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
+ -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \
+ -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
+ -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \
+ -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
+ -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \
+ -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \
+ -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \
+ -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \
+ -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \
+ -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \
+ -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \
+ -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
+ -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \
+ -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \
+ -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \
+ -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \
+ -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \
+ -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \
+ -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \
+ -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \
+ -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \
+ -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \
+ -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \
+ -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \
+ -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \
+ -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \
+ -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \
+ -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \
+ -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \
+ -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \
+ -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \
+ -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \
+ -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \
+ -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \
+ -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \
+ -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \
+ -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \
+ -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \
+ -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \
+ -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \
+ -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \
+ -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \
+ -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \
+ -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \
+ -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \
+ -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \
+ -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \
+ -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \
+ -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \
+ -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \
+ -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \
+ -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \
+ -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \
+ -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \
+ -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \
+ -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \
+ -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \
+ -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \
+ -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
+ -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
+ -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
+ -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \
+ -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \
+ -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \
+ -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \
+ -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \
+ -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \
+ -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \
+ -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \
+ -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \
+ -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \
+ -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \
+ -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \
+ -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \
+ -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
+ -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
+ -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
+ -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \
+ -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \
+ -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \
+ -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \
+ -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \
+ -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \
+ -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \
+ -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \
+ -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \
+ -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \
+ -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \
+ -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \
+ -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \
+ -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \
+ -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
+ -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
+ -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
+ | \
+ sed -e 's|@''REPLACE_ACOSF''@|$(REPLACE_ACOSF)|g' \
+ -e 's|@''REPLACE_ASINF''@|$(REPLACE_ASINF)|g' \
+ -e 's|@''REPLACE_ATANF''@|$(REPLACE_ATANF)|g' \
+ -e 's|@''REPLACE_ATAN2F''@|$(REPLACE_ATAN2F)|g' \
+ -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
+ -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \
+ -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
+ -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
+ -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
+ -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \
+ -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \
+ -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \
+ -e 's|@''REPLACE_EXPL''@|$(REPLACE_EXPL)|g' \
+ -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
+ -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
+ -e 's|@''REPLACE_EXPM1L''@|$(REPLACE_EXPM1L)|g' \
+ -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
+ -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
+ -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
+ -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \
+ -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
+ -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
+ -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \
+ -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \
+ -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \
+ -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \
+ -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \
+ -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \
+ -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \
+ -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
+ -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
+ -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \
+ -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \
+ -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \
+ -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
+ -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
+ -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
+ -e 's|@''REPLACE_ILOGBL''@|$(REPLACE_ILOGBL)|g' \
+ -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
+ -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
+ -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
+ -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+ -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \
+ -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \
+ -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \
+ -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \
+ -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \
+ -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \
+ -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \
+ -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \
+ -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \
+ -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \
+ -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \
+ -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \
+ -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \
+ -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \
+ -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \
+ -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \
+ -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \
+ -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \
+ -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \
+ -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \
+ -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
+ -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
+ -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
+ -e 's|@''REPLACE_RINTL''@|$(REPLACE_RINTL)|g' \
+ -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
+ -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
+ -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
+ -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
+ -e 's|@''REPLACE_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \
+ -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \
+ -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \
+ -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \
+ -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \
+ -e 's|@''REPLACE_TANF''@|$(REPLACE_TANF)|g' \
+ -e 's|@''REPLACE_TANHF''@|$(REPLACE_TANHF)|g' \
+ -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
+ -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
+ -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <netdb.h> when the system
+# doesn't have one that works with the given compiler.
+netdb.h: netdb.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \
+ -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \
+ -e 's/@''GNULIB_GETADDRINFO''@/$(GL_GNULIB_GETADDRINFO)/g' \
+ -e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \
+ -e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \
+ -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
+ -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
+ -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
+ -e 's|@''REPLACE_GAI_STRERROR''@|$(REPLACE_GAI_STRERROR)|g' \
+ -e 's|@''REPLACE_GETADDRINFO''@|$(REPLACE_GETADDRINFO)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/netdb.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+@GL_GENERATE_NETINET_IN_H_TRUE@netinet/in.h: netinet_in.in.h $(top_builddir)/config.status
+@GL_GENERATE_NETINET_IN_H_TRUE@ $(AM_V_GEN)$(MKDIR_P) 'netinet'
+@GL_GENERATE_NETINET_IN_H_TRUE@ $(AM_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@ $(srcdir)/netinet_in.in.h > $@-t
+@GL_GENERATE_NETINET_IN_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_NETINET_IN_H_FALSE@netinet/in.h: $(top_builddir)/config.status
+@GL_GENERATE_NETINET_IN_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdalign.h> when the system
+# doesn't have one that works.
+@GL_GENERATE_STDALIGN_H_TRUE@stdalign.h: stdalign.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDALIGN_H_TRUE@ $(gl_V_at)$(SED_HEADER_TO_AT_t) $(srcdir)/stdalign.in.h
+@GL_GENERATE_STDALIGN_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDALIGN_H_FALSE@stdalign.h: $(top_builddir)/config.status
+@GL_GENERATE_STDALIGN_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdckdint.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_STDCKDINT_H_TRUE@stdckdint.h: stdckdint.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDCKDINT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDCKDINT_H_TRUE@ $(srcdir)/stdckdint.in.h > $@-t
+@GL_GENERATE_STDCKDINT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDCKDINT_H_FALSE@stdckdint.h: $(top_builddir)/config.status
+@GL_GENERATE_STDCKDINT_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@ $(srcdir)/stddef.in.h > $@-t
+@GL_GENERATE_STDDEF_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdint.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_TRUE@ $(gl_V_at)$(SED_HEADER_STDOUT) \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@ $(srcdir)/stdint.in.h > $@-t
+@GL_GENERATE_STDINT_H_TRUE@ $(AM_V_at)mv $@-t $@
+@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_FALSE@ rm -f $@
+
+# We need the following in order to create <stdio.h> when the system
+# doesn't have one that works with the given compiler.
+stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+ -e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
+ -e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
+ -e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
+ -e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
+ -e 's/@''GNULIB_FGETC''@/$(GL_GNULIB_FGETC)/g' \
+ -e 's/@''GNULIB_FGETS''@/$(GL_GNULIB_FGETS)/g' \
+ -e 's/@''GNULIB_FOPEN''@/$(GL_GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FOPEN_GNU''@/$(GL_GNULIB_FOPEN_GNU)/g' \
+ -e 's/@''GNULIB_FPRINTF''@/$(GL_GNULIB_FPRINTF)/g' \
+ -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GL_GNULIB_FPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_FPURGE''@/$(GL_GNULIB_FPURGE)/g' \
+ -e 's/@''GNULIB_FPUTC''@/$(GL_GNULIB_FPUTC)/g' \
+ -e 's/@''GNULIB_FPUTS''@/$(GL_GNULIB_FPUTS)/g' \
+ -e 's/@''GNULIB_FREAD''@/$(GL_GNULIB_FREAD)/g' \
+ -e 's/@''GNULIB_FREOPEN''@/$(GL_GNULIB_FREOPEN)/g' \
+ -e 's/@''GNULIB_FSCANF''@/$(GL_GNULIB_FSCANF)/g' \
+ -e 's/@''GNULIB_FSEEK''@/$(GL_GNULIB_FSEEK)/g' \
+ -e 's/@''GNULIB_FSEEKO''@/$(GL_GNULIB_FSEEKO)/g' \
+ -e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
+ -e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
+ -e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
+ -e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
+ -e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
+ -e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
+ -e 's/@''GNULIB_GETLINE''@/$(GL_GNULIB_GETLINE)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_GNULIB_OBSTACK_PRINTF)/g' \
+ -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PCLOSE''@/$(GL_GNULIB_PCLOSE)/g' \
+ -e 's/@''GNULIB_PERROR''@/$(GL_GNULIB_PERROR)/g' \
+ -e 's/@''GNULIB_POPEN''@/$(GL_GNULIB_POPEN)/g' \
+ -e 's/@''GNULIB_PRINTF''@/$(GL_GNULIB_PRINTF)/g' \
+ -e 's/@''GNULIB_PRINTF_POSIX''@/$(GL_GNULIB_PRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_PUTC''@/$(GL_GNULIB_PUTC)/g' \
+ -e 's/@''GNULIB_PUTCHAR''@/$(GL_GNULIB_PUTCHAR)/g' \
+ -e 's/@''GNULIB_PUTS''@/$(GL_GNULIB_PUTS)/g' \
+ -e 's/@''GNULIB_REMOVE''@/$(GL_GNULIB_REMOVE)/g' \
+ -e 's/@''GNULIB_RENAME''@/$(GL_GNULIB_RENAME)/g' \
+ -e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
+ -e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
+ -e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
+ -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
+ -e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
+ -e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
+ -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
+ -e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
+ -e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
+ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
+ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
+ -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
+ -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
+ -e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
+ -e 's/@''GNULIB_MDA_GETW''@/$(GL_GNULIB_MDA_GETW)/g' \
+ -e 's/@''GNULIB_MDA_PUTW''@/$(GL_GNULIB_MDA_PUTW)/g' \
+ -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_GNULIB_MDA_TEMPNAM)/g' \
+ < $(srcdir)/stdio.in.h | \
+ sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+ -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
+ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
+ -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
+ -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+ -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+ -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+ -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+ -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
+ -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
+ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
+ -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+ -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+ -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
+ -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FOPEN_FOR_FOPEN_GNU''@|$(REPLACE_FOPEN_FOR_FOPEN_GNU)|g' \
+ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+ -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
+ -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
+ -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
+ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
+ -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
+ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+ -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
+ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+ -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
+ -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+ -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
+ -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+ -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
+ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+ -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
+ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+ -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
+ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+ -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <stdlib.h> when the system
+# doesn't have one that works with the given compiler.
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+ $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+ -e 's/@''GNULIB__EXIT''@/$(GL_GNULIB__EXIT)/g' \
+ -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_GNULIB_ALIGNED_ALLOC)/g' \
+ -e 's/@''GNULIB_ATOLL''@/$(GL_GNULIB_ATOLL)/g' \
+ -e 's/@''GNULIB_CALLOC_GNU''@/$(GL_GNULIB_CALLOC_GNU)/g' \
+ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_GNULIB_CALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_GNULIB_CANONICALIZE_FILE_NAME)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ -e 's/@''GNULIB_GETLOADAVG''@/$(GL_GNULIB_GETLOADAVG)/g' \
+ -e 's/@''GNULIB_GETSUBOPT''@/$(GL_GNULIB_GETSUBOPT)/g' \
+ -e 's/@''GNULIB_GRANTPT''@/$(GL_GNULIB_GRANTPT)/g' \
+ -e 's/@''GNULIB_MALLOC_GNU''@/$(GL_GNULIB_MALLOC_GNU)/g' \
+ -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_GNULIB_MALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_MBTOWC''@/$(GL_GNULIB_MBTOWC)/g' \
+ -e 's/@''GNULIB_MKDTEMP''@/$(GL_GNULIB_MKDTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMP''@/$(GL_GNULIB_MKOSTEMP)/g' \
+ -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_GNULIB_MKOSTEMPS)/g' \
+ -e 's/@''GNULIB_MKSTEMP''@/$(GL_GNULIB_MKSTEMP)/g' \
+ -e 's/@''GNULIB_MKSTEMPS''@/$(GL_GNULIB_MKSTEMPS)/g' \
+ -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_GNULIB_POSIX_MEMALIGN)/g' \
+ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_GNULIB_POSIX_OPENPT)/g' \
+ -e 's/@''GNULIB_PTSNAME''@/$(GL_GNULIB_PTSNAME)/g' \
+ -e 's/@''GNULIB_PTSNAME_R''@/$(GL_GNULIB_PTSNAME_R)/g' \
+ -e 's/@''GNULIB_PUTENV''@/$(GL_GNULIB_PUTENV)/g' \
+ -e 's/@''GNULIB_QSORT_R''@/$(GL_GNULIB_QSORT_R)/g' \
+ -e 's/@''GNULIB_RANDOM''@/$(GL_GNULIB_RANDOM)/g' \
+ -e 's/@''GNULIB_RANDOM_R''@/$(GL_GNULIB_RANDOM_R)/g' \
+ -e 's/@''GNULIB_REALLOC_GNU''@/$(GL_GNULIB_REALLOC_GNU)/g' \
+ -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_GNULIB_REALLOC_POSIX)/g' \
+ -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_GNULIB_REALLOCARRAY)/g' \
+ -e 's/@''GNULIB_REALPATH''@/$(GL_GNULIB_REALPATH)/g' \
+ -e 's/@''GNULIB_RPMATCH''@/$(GL_GNULIB_RPMATCH)/g' \
+ -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \
+ -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \
+ -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \
+ -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \
+ -e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \
+ -e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \
+ -e 's/@''GNULIB_STRTOUL''@/$(GL_GNULIB_STRTOUL)/g' \
+ -e 's/@''GNULIB_STRTOULL''@/$(GL_GNULIB_STRTOULL)/g' \
+ -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_GNULIB_SYSTEM_POSIX)/g' \
+ -e 's/@''GNULIB_UNLOCKPT''@/$(GL_GNULIB_UNLOCKPT)/g' \
+ -e 's/@''GNULIB_UNSETENV''@/$(GL_GNULIB_UNSETENV)/g' \
+ -e 's/@''GNULIB_WCTOMB''@/$(GL_GNULIB_WCTOMB)/g' \
+ -e 's/@''GNULIB_MDA_ECVT''@/$(GL_GNULIB_MDA_ECVT)/g' \
+ -e 's/@''GNULIB_MDA_FCVT''@/$(GL_GNULIB_MDA_FCVT)/g' \
+ -e 's/@''GNULIB_MDA_GCVT''@/$(GL_GNULIB_MDA_GCVT)/g' \
+ -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_GNULIB_MDA_MKTEMP)/g' \
+ -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_GNULIB_MDA_PUTENV)/g' \
+ < $(srcdir)/stdlib.in.h | \
+ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
+ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \
+ -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
+ -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
+ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
+ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
+ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
+ -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
+ -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
+ -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
+ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
+ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+ -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \
+ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+ -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
+ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
+ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
+ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+ -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \
+ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
+ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
+ -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
+ -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
+ -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
+ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
+ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+ -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
+ -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
+ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
+ -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \
+ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
+ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
+ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
+ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
+ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+ -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \
+ -e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+ -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
+ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
+ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
+ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+ -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+ -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
+ -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|$(REPLACE_REALLOC_FOR_REALLOC_GNU)|g' \
+ -e 's|@''REPLACE_REALLOC_FOR_REALLOC_POSIX''@|$(REPLACE_REALLOC_FOR_REALLOC_POSIX)|g' \
+ -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \
+ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
+ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+ -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
+ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+ -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
+ -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
+ -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
+ -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \
+ -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
+ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+ -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+ -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_GNULIB_EXPLICIT_BZERO)/g' \
+ -e 's/@''GNULIB_FFSL''@/$(GL_GNULIB_FFSL)/g' \
+ -e 's/@''GNULIB_FFSLL''@/$(GL_GNULIB_FFSLL)/g' \
+ -e 's/@''GNULIB_MBSLEN''@/$(GL_GNULIB_MBSLEN)/g' \
+ -e 's/@''GNULIB_MBSNLEN''@/$(GL_GNULIB_MBSNLEN)/g' \
+ -e 's/@''GNULIB_MBSCHR''@/$(GL_GNULIB_MBSCHR)/g' \
+ -e 's/@''GNULIB_MBSRCHR''@/$(GL_GNULIB_MBSRCHR)/g' \
+ -e 's/@''GNULIB_MBSSTR''@/$(GL_GNULIB_MBSSTR)/g' \
+ -e 's/@''GNULIB_MBSCASECMP''@/$(GL_GNULIB_MBSCASECMP)/g' \
+ -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_GNULIB_MBSNCASECMP)/g' \
+ -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_GNULIB_MBSPCASECMP)/g' \
+ -e 's/@''GNULIB_MBSCASESTR''@/$(GL_GNULIB_MBSCASESTR)/g' \
+ -e 's/@''GNULIB_MBSCSPN''@/$(GL_GNULIB_MBSCSPN)/g' \
+ -e 's/@''GNULIB_MBSPBRK''@/$(GL_GNULIB_MBSPBRK)/g' \
+ -e 's/@''GNULIB_MBSSPN''@/$(GL_GNULIB_MBSSPN)/g' \
+ -e 's/@''GNULIB_MBSSEP''@/$(GL_GNULIB_MBSSEP)/g' \
+ -e 's/@''GNULIB_MBSTOK_R''@/$(GL_GNULIB_MBSTOK_R)/g' \
+ -e 's/@''GNULIB_MEMCHR''@/$(GL_GNULIB_MEMCHR)/g' \
+ -e 's/@''GNULIB_MEMMEM''@/$(GL_GNULIB_MEMMEM)/g' \
+ -e 's/@''GNULIB_MEMPCPY''@/$(GL_GNULIB_MEMPCPY)/g' \
+ -e 's/@''GNULIB_MEMRCHR''@/$(GL_GNULIB_MEMRCHR)/g' \
+ -e 's/@''GNULIB_MEMSET_EXPLICIT''@/$(GL_GNULIB_MEMSET_EXPLICIT)/g' \
+ -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_GNULIB_RAWMEMCHR)/g' \
+ -e 's/@''GNULIB_STPCPY''@/$(GL_GNULIB_STPCPY)/g' \
+ -e 's/@''GNULIB_STPNCPY''@/$(GL_GNULIB_STPNCPY)/g' \
+ -e 's/@''GNULIB_STRCHRNUL''@/$(GL_GNULIB_STRCHRNUL)/g' \
+ -e 's/@''GNULIB_STRDUP''@/$(GL_GNULIB_STRDUP)/g' \
+ -e 's/@''GNULIB_STRNCAT''@/$(GL_GNULIB_STRNCAT)/g' \
+ -e 's/@''GNULIB_STRNDUP''@/$(GL_GNULIB_STRNDUP)/g' \
+ -e 's/@''GNULIB_STRNLEN''@/$(GL_GNULIB_STRNLEN)/g' \
+ -e 's/@''GNULIB_STRPBRK''@/$(GL_GNULIB_STRPBRK)/g' \
+ -e 's/@''GNULIB_STRSEP''@/$(GL_GNULIB_STRSEP)/g' \
+ -e 's/@''GNULIB_STRSTR''@/$(GL_GNULIB_STRSTR)/g' \
+ -e 's/@''GNULIB_STRCASESTR''@/$(GL_GNULIB_STRCASESTR)/g' \
+ -e 's/@''GNULIB_STRTOK_R''@/$(GL_GNULIB_STRTOK_R)/g' \
+ -e 's/@''GNULIB_STRERROR''@/$(GL_GNULIB_STRERROR)/g' \
+ -e 's/@''GNULIB_STRERROR_R''@/$(GL_GNULIB_STRERROR_R)/g' \
+ -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_GNULIB_STRERRORNAME_NP)/g' \
+ -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_GNULIB_SIGABBREV_NP)/g' \
+ -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_GNULIB_SIGDESCR_NP)/g' \
+ -e 's/@''GNULIB_STRSIGNAL''@/$(GL_GNULIB_STRSIGNAL)/g' \
+ -e 's/@''GNULIB_STRVERSCMP''@/$(GL_GNULIB_STRVERSCMP)/g' \
+ -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_GNULIB_MDA_MEMCCPY)/g' \
+ -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_GNULIB_MDA_STRDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/string.in.h | \
+ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+ -e 's|@''HAVE_MEMSET_EXPLICIT''@|$(HAVE_MEMSET_EXPLICIT)|g' \
+ -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
+ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+ -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+ -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+ -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
+ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+ -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \
+ -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \
+ -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \
+ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
+ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
+ -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
+ -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
+ -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+ -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \
+ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <strings.h> when the system
+# doesn't have one that works with the given compiler.
+strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
+ -e 's/@''GNULIB_FFS''@/$(GL_GNULIB_FFS)/g' \
+ -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \
+ -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
+ -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/strings.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/socket.h> when the system
+# doesn't have one that works with the given compiler.
+sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+ -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_SOCKET''@/$(GL_GNULIB_SOCKET)/g' \
+ -e 's/@''GNULIB_CONNECT''@/$(GL_GNULIB_CONNECT)/g' \
+ -e 's/@''GNULIB_ACCEPT''@/$(GL_GNULIB_ACCEPT)/g' \
+ -e 's/@''GNULIB_BIND''@/$(GL_GNULIB_BIND)/g' \
+ -e 's/@''GNULIB_GETPEERNAME''@/$(GL_GNULIB_GETPEERNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKNAME''@/$(GL_GNULIB_GETSOCKNAME)/g' \
+ -e 's/@''GNULIB_GETSOCKOPT''@/$(GL_GNULIB_GETSOCKOPT)/g' \
+ -e 's/@''GNULIB_LISTEN''@/$(GL_GNULIB_LISTEN)/g' \
+ -e 's/@''GNULIB_RECV''@/$(GL_GNULIB_RECV)/g' \
+ -e 's/@''GNULIB_SEND''@/$(GL_GNULIB_SEND)/g' \
+ -e 's/@''GNULIB_RECVFROM''@/$(GL_GNULIB_RECVFROM)/g' \
+ -e 's/@''GNULIB_SENDTO''@/$(GL_GNULIB_SENDTO)/g' \
+ -e 's/@''GNULIB_SETSOCKOPT''@/$(GL_GNULIB_SETSOCKOPT)/g' \
+ -e 's/@''GNULIB_SHUTDOWN''@/$(GL_GNULIB_SHUTDOWN)/g' \
+ -e 's/@''GNULIB_ACCEPT4''@/$(GL_GNULIB_ACCEPT4)/g' \
+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \
+ -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_socket.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+ -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
+ -e 's/@''GNULIB_CHMOD''@/$(GL_GNULIB_CHMOD)/g' \
+ -e 's/@''GNULIB_FCHMODAT''@/$(GL_GNULIB_FCHMODAT)/g' \
+ -e 's/@''GNULIB_FSTAT''@/$(GL_GNULIB_FSTAT)/g' \
+ -e 's/@''GNULIB_FSTATAT''@/$(GL_GNULIB_FSTATAT)/g' \
+ -e 's/@''GNULIB_FUTIMENS''@/$(GL_GNULIB_FUTIMENS)/g' \
+ -e 's/@''GNULIB_GETUMASK''@/$(GL_GNULIB_GETUMASK)/g' \
+ -e 's/@''GNULIB_LCHMOD''@/$(GL_GNULIB_LCHMOD)/g' \
+ -e 's/@''GNULIB_LSTAT''@/$(GL_GNULIB_LSTAT)/g' \
+ -e 's/@''GNULIB_MKDIR''@/$(GL_GNULIB_MKDIR)/g' \
+ -e 's/@''GNULIB_MKDIRAT''@/$(GL_GNULIB_MKDIRAT)/g' \
+ -e 's/@''GNULIB_MKFIFO''@/$(GL_GNULIB_MKFIFO)/g' \
+ -e 's/@''GNULIB_MKFIFOAT''@/$(GL_GNULIB_MKFIFOAT)/g' \
+ -e 's/@''GNULIB_MKNOD''@/$(GL_GNULIB_MKNOD)/g' \
+ -e 's/@''GNULIB_MKNODAT''@/$(GL_GNULIB_MKNODAT)/g' \
+ -e 's/@''GNULIB_STAT''@/$(GL_GNULIB_STAT)/g' \
+ -e 's/@''GNULIB_UTIMENSAT''@/$(GL_GNULIB_UTIMENSAT)/g' \
+ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GL_GNULIB_OVERRIDES_STRUCT_STAT)/g' \
+ -e 's/@''GNULIB_MDA_CHMOD''@/$(GL_GNULIB_MDA_CHMOD)/g' \
+ -e 's/@''GNULIB_MDA_MKDIR''@/$(GL_GNULIB_MDA_MKDIR)/g' \
+ -e 's/@''GNULIB_MDA_UMASK''@/$(GL_GNULIB_MDA_UMASK)/g' \
+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+ -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \
+ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
+ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \
+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+ -e 's|@''REPLACE_CHMOD''@|$(REPLACE_CHMOD)|g' \
+ -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \
+ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
+ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
+ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
+ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
+ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+ -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \
+ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+ -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \
+ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
+ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/sys_stat.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/types.h> when the system
+# doesn't have one that works with the given compiler.
+sys/types.h: sys_types.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
+ $(srcdir)/sys_types.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <sys/uio.h> when the system
+# doesn't have one that works with the given compiler.
+sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)$(MKDIR_P) 'sys'
+ $(AM_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \
+ -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \
+ $(srcdir)/sys_uio.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <time.h> when the system
+# doesn't have one that works with the given compiler.
+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+ -e 's/@''GNULIB_CTIME''@/$(GL_GNULIB_CTIME)/g' \
+ -e 's/@''GNULIB_LOCALTIME''@/$(GL_GNULIB_LOCALTIME)/g' \
+ -e 's/@''GNULIB_MKTIME''@/$(GL_GNULIB_MKTIME)/g' \
+ -e 's/@''GNULIB_NANOSLEEP''@/$(GL_GNULIB_NANOSLEEP)/g' \
+ -e 's/@''GNULIB_STRFTIME''@/$(GL_GNULIB_STRFTIME)/g' \
+ -e 's/@''GNULIB_STRPTIME''@/$(GL_GNULIB_STRPTIME)/g' \
+ -e 's/@''GNULIB_TIMEGM''@/$(GL_GNULIB_TIMEGM)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_GNULIB_TIMESPEC_GET)/g' \
+ -e 's/@''GNULIB_TIMESPEC_GETRES''@/$(GL_GNULIB_TIMESPEC_GETRES)/g' \
+ -e 's/@''GNULIB_TIME_R''@/$(GL_GNULIB_TIME_R)/g' \
+ -e 's/@''GNULIB_TIME_RZ''@/$(GL_GNULIB_TIME_RZ)/g' \
+ -e 's/@''GNULIB_TZSET''@/$(GL_GNULIB_TZSET)/g' \
+ -e 's/@''GNULIB_MDA_TZSET''@/$(GL_GNULIB_MDA_TZSET)/g' \
+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+ -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \
+ -e 's|@''HAVE_TIMESPEC_GETRES''@|$(HAVE_TIMESPEC_GETRES)|g' \
+ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
+ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
+ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
+ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+ -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
+ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+ -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+ -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/time.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+ -e 's/@''GNULIB_ACCESS''@/$(GL_GNULIB_ACCESS)/g' \
+ -e 's/@''GNULIB_CHDIR''@/$(GL_GNULIB_CHDIR)/g' \
+ -e 's/@''GNULIB_CHOWN''@/$(GL_GNULIB_CHOWN)/g' \
+ -e 's/@''GNULIB_CLOSE''@/$(GL_GNULIB_CLOSE)/g' \
+ -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_GNULIB_COPY_FILE_RANGE)/g' \
+ -e 's/@''GNULIB_DUP''@/$(GL_GNULIB_DUP)/g' \
+ -e 's/@''GNULIB_DUP2''@/$(GL_GNULIB_DUP2)/g' \
+ -e 's/@''GNULIB_DUP3''@/$(GL_GNULIB_DUP3)/g' \
+ -e 's/@''GNULIB_ENVIRON''@/$(GL_GNULIB_ENVIRON)/g' \
+ -e 's/@''GNULIB_EUIDACCESS''@/$(GL_GNULIB_EUIDACCESS)/g' \
+ -e 's/@''GNULIB_EXECL''@/$(GL_GNULIB_EXECL)/g' \
+ -e 's/@''GNULIB_EXECLE''@/$(GL_GNULIB_EXECLE)/g' \
+ -e 's/@''GNULIB_EXECLP''@/$(GL_GNULIB_EXECLP)/g' \
+ -e 's/@''GNULIB_EXECV''@/$(GL_GNULIB_EXECV)/g' \
+ -e 's/@''GNULIB_EXECVE''@/$(GL_GNULIB_EXECVE)/g' \
+ -e 's/@''GNULIB_EXECVP''@/$(GL_GNULIB_EXECVP)/g' \
+ -e 's/@''GNULIB_EXECVPE''@/$(GL_GNULIB_EXECVPE)/g' \
+ -e 's/@''GNULIB_FACCESSAT''@/$(GL_GNULIB_FACCESSAT)/g' \
+ -e 's/@''GNULIB_FCHDIR''@/$(GL_GNULIB_FCHDIR)/g' \
+ -e 's/@''GNULIB_FCHOWNAT''@/$(GL_GNULIB_FCHOWNAT)/g' \
+ -e 's/@''GNULIB_FDATASYNC''@/$(GL_GNULIB_FDATASYNC)/g' \
+ -e 's/@''GNULIB_FSYNC''@/$(GL_GNULIB_FSYNC)/g' \
+ -e 's/@''GNULIB_FTRUNCATE''@/$(GL_GNULIB_FTRUNCATE)/g' \
+ -e 's/@''GNULIB_GETCWD''@/$(GL_GNULIB_GETCWD)/g' \
+ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_GNULIB_GETDOMAINNAME)/g' \
+ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_GNULIB_GETDTABLESIZE)/g' \
+ -e 's/@''GNULIB_GETENTROPY''@/$(GL_GNULIB_GETENTROPY)/g' \
+ -e 's/@''GNULIB_GETGROUPS''@/$(GL_GNULIB_GETGROUPS)/g' \
+ -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_GNULIB_GETHOSTNAME)/g' \
+ -e 's/@''GNULIB_GETLOGIN''@/$(GL_GNULIB_GETLOGIN)/g' \
+ -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_GNULIB_GETLOGIN_R)/g' \
+ -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_GNULIB_GETOPT_POSIX)/g' \
+ -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_GNULIB_GETPAGESIZE)/g' \
+ -e 's/@''GNULIB_GETPASS''@/$(GL_GNULIB_GETPASS)/g' \
+ -e 's/@''GNULIB_GETPASS_GNU''@/$(GL_GNULIB_GETPASS_GNU)/g' \
+ -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_GNULIB_GETUSERSHELL)/g' \
+ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_GNULIB_GROUP_MEMBER)/g' \
+ -e 's/@''GNULIB_ISATTY''@/$(GL_GNULIB_ISATTY)/g' \
+ -e 's/@''GNULIB_LCHOWN''@/$(GL_GNULIB_LCHOWN)/g' \
+ -e 's/@''GNULIB_LINK''@/$(GL_GNULIB_LINK)/g' \
+ -e 's/@''GNULIB_LINKAT''@/$(GL_GNULIB_LINKAT)/g' \
+ -e 's/@''GNULIB_LSEEK''@/$(GL_GNULIB_LSEEK)/g' \
+ -e 's/@''GNULIB_PIPE''@/$(GL_GNULIB_PIPE)/g' \
+ -e 's/@''GNULIB_PIPE2''@/$(GL_GNULIB_PIPE2)/g' \
+ -e 's/@''GNULIB_PREAD''@/$(GL_GNULIB_PREAD)/g' \
+ -e 's/@''GNULIB_PWRITE''@/$(GL_GNULIB_PWRITE)/g' \
+ -e 's/@''GNULIB_READ''@/$(GL_GNULIB_READ)/g' \
+ -e 's/@''GNULIB_READLINK''@/$(GL_GNULIB_READLINK)/g' \
+ -e 's/@''GNULIB_READLINKAT''@/$(GL_GNULIB_READLINKAT)/g' \
+ -e 's/@''GNULIB_RMDIR''@/$(GL_GNULIB_RMDIR)/g' \
+ -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_GNULIB_SETHOSTNAME)/g' \
+ -e 's/@''GNULIB_SLEEP''@/$(GL_GNULIB_SLEEP)/g' \
+ -e 's/@''GNULIB_SYMLINK''@/$(GL_GNULIB_SYMLINK)/g' \
+ -e 's/@''GNULIB_SYMLINKAT''@/$(GL_GNULIB_SYMLINKAT)/g' \
+ -e 's/@''GNULIB_TRUNCATE''@/$(GL_GNULIB_TRUNCATE)/g' \
+ -e 's/@''GNULIB_TTYNAME_R''@/$(GL_GNULIB_TTYNAME_R)/g' \
+ -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_GNULIB_UNISTD_H_GETOPT)/g' \
+ -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_GNULIB_UNISTD_H_NONBLOCKING)/g' \
+ -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_GNULIB_UNISTD_H_SIGPIPE)/g' \
+ -e 's/@''GNULIB_UNLINK''@/$(GL_GNULIB_UNLINK)/g' \
+ -e 's/@''GNULIB_UNLINKAT''@/$(GL_GNULIB_UNLINKAT)/g' \
+ -e 's/@''GNULIB_USLEEP''@/$(GL_GNULIB_USLEEP)/g' \
+ -e 's/@''GNULIB_WRITE''@/$(GL_GNULIB_WRITE)/g' \
+ -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_GNULIB_MDA_ACCESS)/g' \
+ -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_GNULIB_MDA_CHDIR)/g' \
+ -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_GNULIB_MDA_CLOSE)/g' \
+ -e 's/@''GNULIB_MDA_DUP''@/$(GL_GNULIB_MDA_DUP)/g' \
+ -e 's/@''GNULIB_MDA_DUP2''@/$(GL_GNULIB_MDA_DUP2)/g' \
+ -e 's/@''GNULIB_MDA_EXECL''@/$(GL_GNULIB_MDA_EXECL)/g' \
+ -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_GNULIB_MDA_EXECLE)/g' \
+ -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_GNULIB_MDA_EXECLP)/g' \
+ -e 's/@''GNULIB_MDA_EXECV''@/$(GL_GNULIB_MDA_EXECV)/g' \
+ -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_GNULIB_MDA_EXECVE)/g' \
+ -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_GNULIB_MDA_EXECVP)/g' \
+ -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_GNULIB_MDA_EXECVPE)/g' \
+ -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_GNULIB_MDA_GETCWD)/g' \
+ -e 's/@''GNULIB_MDA_GETPID''@/$(GL_GNULIB_MDA_GETPID)/g' \
+ -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_GNULIB_MDA_ISATTY)/g' \
+ -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_GNULIB_MDA_LSEEK)/g' \
+ -e 's/@''GNULIB_MDA_READ''@/$(GL_GNULIB_MDA_READ)/g' \
+ -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_GNULIB_MDA_RMDIR)/g' \
+ -e 's/@''GNULIB_MDA_SWAB''@/$(GL_GNULIB_MDA_SWAB)/g' \
+ -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_GNULIB_MDA_UNLINK)/g' \
+ -e 's/@''GNULIB_MDA_WRITE''@/$(GL_GNULIB_MDA_WRITE)/g' \
+ < $(srcdir)/unistd.in.h | \
+ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
+ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+ -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \
+ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
+ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+ -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
+ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
+ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
+ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+ -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
+ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
+ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
+ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
+ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
+ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+ -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
+ -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
+ -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
+ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+ -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
+ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
+ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
+ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+ -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \
+ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
+ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
+ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
+ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+ -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+ -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
+ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
+ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
+ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
+ | \
+ sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
+ -e 's|@''REPLACE_COPY_FILE_RANGE''@|$(REPLACE_COPY_FILE_RANGE)|g' \
+ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
+ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+ -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
+ -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
+ -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
+ -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \
+ -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \
+ -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
+ -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
+ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
+ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
+ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+ -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+ -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
+ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
+ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
+ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+ -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
+ -e 's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|$(REPLACE_GETPASS_FOR_GETPASS_GNU)|g' \
+ -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
+ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
+ -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
+ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+ -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+ -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
+ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
+ -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
+ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
+ -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+ -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
+ -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \
+ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
+ -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
+ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
+ -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
+ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+ -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <wchar.h> when the system
+# version does not work standalone.
+wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
+ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_BTOWC''@/$(GL_GNULIB_BTOWC)/g' \
+ -e 's/@''GNULIB_WCTOB''@/$(GL_GNULIB_WCTOB)/g' \
+ -e 's/@''GNULIB_MBSINIT''@/$(GL_GNULIB_MBSINIT)/g' \
+ -e 's/@''GNULIB_MBRTOWC''@/$(GL_GNULIB_MBRTOWC)/g' \
+ -e 's/@''GNULIB_MBRLEN''@/$(GL_GNULIB_MBRLEN)/g' \
+ -e 's/@''GNULIB_MBSRTOWCS''@/$(GL_GNULIB_MBSRTOWCS)/g' \
+ -e 's/@''GNULIB_MBSNRTOWCS''@/$(GL_GNULIB_MBSNRTOWCS)/g' \
+ -e 's/@''GNULIB_WCRTOMB''@/$(GL_GNULIB_WCRTOMB)/g' \
+ -e 's/@''GNULIB_WCSRTOMBS''@/$(GL_GNULIB_WCSRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSNRTOMBS''@/$(GL_GNULIB_WCSNRTOMBS)/g' \
+ -e 's/@''GNULIB_WCWIDTH''@/$(GL_GNULIB_WCWIDTH)/g' \
+ -e 's/@''GNULIB_WMEMCHR''@/$(GL_GNULIB_WMEMCHR)/g' \
+ -e 's/@''GNULIB_WMEMCMP''@/$(GL_GNULIB_WMEMCMP)/g' \
+ -e 's/@''GNULIB_WMEMCPY''@/$(GL_GNULIB_WMEMCPY)/g' \
+ -e 's/@''GNULIB_WMEMMOVE''@/$(GL_GNULIB_WMEMMOVE)/g' \
+ -e 's/@''GNULIB_WMEMPCPY''@/$(GL_GNULIB_WMEMPCPY)/g' \
+ -e 's/@''GNULIB_WMEMSET''@/$(GL_GNULIB_WMEMSET)/g' \
+ -e 's/@''GNULIB_WCSLEN''@/$(GL_GNULIB_WCSLEN)/g' \
+ -e 's/@''GNULIB_WCSNLEN''@/$(GL_GNULIB_WCSNLEN)/g' \
+ -e 's/@''GNULIB_WCSCPY''@/$(GL_GNULIB_WCSCPY)/g' \
+ -e 's/@''GNULIB_WCPCPY''@/$(GL_GNULIB_WCPCPY)/g' \
+ -e 's/@''GNULIB_WCSNCPY''@/$(GL_GNULIB_WCSNCPY)/g' \
+ -e 's/@''GNULIB_WCPNCPY''@/$(GL_GNULIB_WCPNCPY)/g' \
+ -e 's/@''GNULIB_WCSCAT''@/$(GL_GNULIB_WCSCAT)/g' \
+ -e 's/@''GNULIB_WCSNCAT''@/$(GL_GNULIB_WCSNCAT)/g' \
+ -e 's/@''GNULIB_WCSCMP''@/$(GL_GNULIB_WCSCMP)/g' \
+ -e 's/@''GNULIB_WCSNCMP''@/$(GL_GNULIB_WCSNCMP)/g' \
+ -e 's/@''GNULIB_WCSCASECMP''@/$(GL_GNULIB_WCSCASECMP)/g' \
+ -e 's/@''GNULIB_WCSNCASECMP''@/$(GL_GNULIB_WCSNCASECMP)/g' \
+ -e 's/@''GNULIB_WCSCOLL''@/$(GL_GNULIB_WCSCOLL)/g' \
+ -e 's/@''GNULIB_WCSXFRM''@/$(GL_GNULIB_WCSXFRM)/g' \
+ -e 's/@''GNULIB_WCSDUP''@/$(GL_GNULIB_WCSDUP)/g' \
+ -e 's/@''GNULIB_WCSCHR''@/$(GL_GNULIB_WCSCHR)/g' \
+ -e 's/@''GNULIB_WCSRCHR''@/$(GL_GNULIB_WCSRCHR)/g' \
+ -e 's/@''GNULIB_WCSCSPN''@/$(GL_GNULIB_WCSCSPN)/g' \
+ -e 's/@''GNULIB_WCSSPN''@/$(GL_GNULIB_WCSSPN)/g' \
+ -e 's/@''GNULIB_WCSPBRK''@/$(GL_GNULIB_WCSPBRK)/g' \
+ -e 's/@''GNULIB_WCSSTR''@/$(GL_GNULIB_WCSSTR)/g' \
+ -e 's/@''GNULIB_WCSTOK''@/$(GL_GNULIB_WCSTOK)/g' \
+ -e 's/@''GNULIB_WCSWIDTH''@/$(GL_GNULIB_WCSWIDTH)/g' \
+ -e 's/@''GNULIB_WCSFTIME''@/$(GL_GNULIB_WCSFTIME)/g' \
+ -e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_GNULIB_MDA_WCSDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GL_GNULIB_FREE_POSIX)/g' \
+ < $(srcdir)/wchar.in.h | \
+ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
+ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
+ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
+ -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
+ -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
+ -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
+ -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
+ -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
+ -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+ -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+ -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+ -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
+ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+ -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+ -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+ -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+ -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+ -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+ -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+ -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+ -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+ -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+ -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+ -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+ -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+ -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+ -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+ -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+ -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+ -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+ -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+ -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+ -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
+ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
+ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
+ -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
+ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
+ | \
+ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+ -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
+ -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
+ -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
+ -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
+ -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
+ -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
+ -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
+ -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
+ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
+ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
+ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
+ -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+ -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+ -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ > $@-t
+ $(AM_V_at)mv $@-t $@
+
+# We need the following in order to create <wctype.h> when the system
+# doesn't have one that works with the given compiler.
+wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+ $(gl_V_at)$(SED_HEADER_STDOUT) \
+ -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+ -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+ -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+ -e 's/@''GNULIB_ISWBLANK''@/$(GL_GNULIB_ISWBLANK)/g' \
+ -e 's/@''GNULIB_ISWDIGIT''@/$(GL_GNULIB_ISWDIGIT)/g' \
+ -e 's/@''GNULIB_ISWXDIGIT''@/$(GL_GNULIB_ISWXDIGIT)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GL_GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GL_GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GL_GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(GL_GNULIB_TOWCTRANS)/g' \
+ -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
+ -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
+ -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
+ -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
+ -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+ -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
+ -e 's/@''REPLACE_ISWDIGIT''@/$(REPLACE_ISWDIGIT)/g' \
+ -e 's/@''REPLACE_ISWXDIGIT''@/$(REPLACE_ISWXDIGIT)/g' \
+ -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+ -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+ $(srcdir)/wctype.in.h > $@-t
+ $(AM_V_at)mv $@-t $@
+
+mostlyclean-local: mostlyclean-generic
+ @for dir in '' $(MOSTLYCLEANDIRS); do \
+ if test -n "$$dir" && test -d $$dir; then \
+ echo "rmdir $$dir"; rmdir $$dir; \
+ fi; \
+ done; \
+ :
+distclean-local: distclean-gnulib-libobjs
+distclean-gnulib-libobjs:
+ -rm -f @gl_LIBOBJDEPS@
+maintainer-clean-local: distclean-gnulib-libobjs
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gl/_Noreturn.h b/gl/_Noreturn.h
new file mode 100644
index 0000000..6ecea98
--- /dev/null
+++ b/gl/_Noreturn.h
@@ -0,0 +1,50 @@
+/* A C macro for declaring that a function does not return.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _Noreturn
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+ && 0)
+ /* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
+# define _Noreturn [[noreturn]]
+# elif (defined __clang__ && __clang_major__ < 16 \
+ && defined _GL_WORK_AROUND_LLVM_BUG_59792)
+ /* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
+ that rare LLVM bug, though you may get many false-alarm warnings. */
+# define _Noreturn
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || (!defined __STRICT_ANSI__ \
+ && (4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+ /* _Noreturn works as-is. */
+# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
diff --git a/gl/af_alg.c b/gl/af_alg.c
new file mode 100644
index 0000000..9f022ce
--- /dev/null
+++ b/gl/af_alg.c
@@ -0,0 +1,213 @@
+/* af_alg.c - Compute message digests from file streams and buffers.
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Matteo Croce <mcroce@redhat.com>, 2018. */
+
+#include <config.h>
+
+#include "af_alg.h"
+
+#if USE_LINUX_CRYPTO_API
+
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <linux/if_alg.h>
+#include <sys/stat.h>
+#include <sys/sendfile.h>
+#include <sys/socket.h>
+
+#include "sys-limits.h"
+
+#define BLOCKSIZE 32768
+
+/* Return a newly created socket for ALG.
+ On error, return a negative error number. */
+static int
+alg_socket (char const *alg)
+{
+ struct sockaddr_alg salg = {
+ .salg_family = AF_ALG,
+ .salg_type = "hash",
+ };
+ /* Copy alg into salg.salg_name, without calling strcpy nor strlen. */
+ for (size_t i = 0; (salg.salg_name[i] = alg[i]) != '\0'; i++)
+ if (i == sizeof salg.salg_name - 1)
+ /* alg is too long. */
+ return -EINVAL;
+
+ int cfd = socket (AF_ALG, SOCK_SEQPACKET | SOCK_CLOEXEC, 0);
+ if (cfd < 0)
+ return -EAFNOSUPPORT;
+ int ofd = (bind (cfd, (struct sockaddr *) &salg, sizeof salg) == 0
+ ? accept4 (cfd, NULL, 0, SOCK_CLOEXEC)
+ : -1);
+ close (cfd);
+ return ofd < 0 ? -EAFNOSUPPORT : ofd;
+}
+
+int
+afalg_buffer (const char *buffer, size_t len, const char *alg,
+ void *resblock, ssize_t hashlen)
+{
+ /* On Linux < 4.9, the value for an empty stream is wrong (all zeroes).
+ See <https://patchwork.kernel.org/patch/9308641/>.
+ This was not fixed properly until November 2016,
+ see <https://patchwork.kernel.org/patch/9434741/>. */
+ if (len == 0)
+ return -EAFNOSUPPORT;
+
+ int ofd = alg_socket (alg);
+ if (ofd < 0)
+ return ofd;
+
+ int result;
+
+ for (;;)
+ {
+ ssize_t size = (len > BLOCKSIZE ? BLOCKSIZE : len);
+ if (send (ofd, buffer, size, MSG_MORE) != size)
+ {
+ result = -EAFNOSUPPORT;
+ break;
+ }
+ buffer += size;
+ len -= size;
+ if (len == 0)
+ {
+ result = read (ofd, resblock, hashlen) == hashlen ? 0 : -EAFNOSUPPORT;
+ break;
+ }
+ }
+
+ close (ofd);
+ return result;
+}
+
+int
+afalg_stream (FILE *stream, const char *alg,
+ void *resblock, ssize_t hashlen)
+{
+ int ofd = alg_socket (alg);
+ if (ofd < 0)
+ return ofd;
+
+ /* If STREAM's size is known and nonzero and not too large, attempt
+ sendfile to pipe the data. The nonzero restriction avoids issues
+ with /proc files that pretend to be empty, and lets the classic
+ read-write loop work around an empty-input bug noted below. */
+ int fd = fileno (stream);
+ int result;
+ struct stat st;
+ off_t off = ftello (stream);
+ if (0 <= off && fstat (fd, &st) == 0
+ && (S_ISREG (st.st_mode) || S_TYPEISSHM (&st) || S_TYPEISTMO (&st))
+ && off < st.st_size && st.st_size - off < SYS_BUFSIZE_MAX)
+ {
+ /* Make sure the offset of fileno (stream) reflects how many bytes
+ have been read from stream before this function got invoked.
+ Note: fflush on an input stream after ungetc does not work as expected
+ on some platforms. Therefore this situation is not supported here. */
+ if (fflush (stream))
+ result = -EIO;
+ else
+ {
+ off_t nbytes = st.st_size - off;
+ if (sendfile (ofd, fd, &off, nbytes) == nbytes)
+ {
+ if (read (ofd, resblock, hashlen) == hashlen)
+ {
+ /* The input buffers of stream are no longer valid. */
+ if (lseek (fd, off, SEEK_SET) != (off_t)-1)
+ result = 0;
+ else
+ /* The file position of fd has not changed. */
+ result = -EAFNOSUPPORT;
+ }
+ else
+ /* The file position of fd has not changed. */
+ result = -EAFNOSUPPORT;
+ }
+ else
+ /* The file position of fd has not changed. */
+ result = -EAFNOSUPPORT;
+ }
+ }
+ else
+ {
+ /* sendfile not possible, do a classic read-write loop. */
+
+ /* Number of bytes to seek (backwards) in case of error. */
+ off_t nseek = 0;
+
+ for (;;)
+ {
+ char buf[BLOCKSIZE];
+ /* When the stream is not seekable, start with a single-byte block,
+ so that we can use ungetc() in the case that send() fails. */
+ size_t blocksize = (nseek == 0 && off < 0 ? 1 : BLOCKSIZE);
+ ssize_t size = fread (buf, 1, blocksize, stream);
+ if (size == 0)
+ {
+ /* On Linux < 4.9, the value for an empty stream is wrong (all 0).
+ See <https://patchwork.kernel.org/patch/9308641/>.
+ This was not fixed properly until November 2016,
+ see <https://patchwork.kernel.org/patch/9434741/>. */
+ result = ferror (stream) ? -EIO : nseek == 0 ? -EAFNOSUPPORT : 0;
+ break;
+ }
+ nseek -= size;
+ if (send (ofd, buf, size, MSG_MORE) != size)
+ {
+ if (nseek == -1)
+ {
+ /* 1 byte of pushback buffer is guaranteed on stream, even
+ if stream is not seekable. */
+ ungetc ((unsigned char) buf[0], stream);
+ result = -EAFNOSUPPORT;
+ }
+ else if (fseeko (stream, nseek, SEEK_CUR) == 0)
+ /* The position of stream has been restored. */
+ result = -EAFNOSUPPORT;
+ else
+ result = -EIO;
+ break;
+ }
+
+ /* Don't assume that EOF is sticky. See:
+ <https://sourceware.org/bugzilla/show_bug.cgi?id=19476>. */
+ if (feof (stream))
+ {
+ result = 0;
+ break;
+ }
+ }
+
+ if (result == 0 && read (ofd, resblock, hashlen) != hashlen)
+ {
+ if (nseek == 0 || fseeko (stream, nseek, SEEK_CUR) == 0)
+ /* The position of stream has been restored. */
+ result = -EAFNOSUPPORT;
+ else
+ result = -EIO;
+ }
+ }
+ close (ofd);
+ return result;
+}
+
+#endif
diff --git a/gl/af_alg.h b/gl/af_alg.h
new file mode 100644
index 0000000..e8ffb3f
--- /dev/null
+++ b/gl/af_alg.h
@@ -0,0 +1,115 @@
+/* af_alg.h - Compute message digests from file streams and buffers.
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Matteo Croce <mcroce@redhat.com>, 2018.
+ Documentation by Bruno Haible <bruno@clisp.org>, 2018. */
+
+/* Declare specific functions for computing message digests
+ using the Linux kernel crypto API, if available. This kernel API gives
+ access to specialized crypto instructions (that would also be available
+ in user space) or to crypto devices (not directly available in user space).
+
+ For a more complete set of facilities that use the Linux kernel crypto API,
+ look at libkcapi. */
+
+#ifndef AF_ALG_H
+# define AF_ALG_H 1
+
+# include <stdio.h>
+# include <errno.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if USE_LINUX_CRYPTO_API
+
+/* Compute a message digest of a memory region.
+
+ The memory region starts at BUFFER and is LEN bytes long.
+
+ ALG is the message digest algorithm; see the file /proc/crypto.
+
+ RESBLOCK points to a block of HASHLEN bytes, for the result.
+ HASHLEN must be the length of the message digest, in bytes, in particular:
+
+ alg | hashlen
+ -------+--------
+ md5 | 16
+ sha1 | 20
+ sha224 | 28
+ sha256 | 32
+ sha384 | 48
+ sha512 | 64
+
+ If successful, fill RESBLOCK and return 0.
+ Upon failure, return a negated error number. */
+int
+afalg_buffer (const char *buffer, size_t len, const char *alg,
+ void *resblock, ssize_t hashlen);
+
+/* Compute a message digest of data read from STREAM.
+
+ STREAM is an open file stream. The last operation on STREAM should
+ not be 'ungetc', and if STREAM is also open for writing it should
+ have been fflushed since its last write. Read from the current
+ position to the end of STREAM. Handle regular files efficiently.
+
+ ALG is the message digest algorithm; see the file /proc/crypto.
+
+ RESBLOCK points to a block of HASHLEN bytes, for the result.
+ HASHLEN must be the length of the message digest, in bytes, in particular:
+
+ alg | hashlen
+ -------+--------
+ md5 | 16
+ sha1 | 20
+ sha224 | 28
+ sha256 | 32
+ sha384 | 48
+ sha512 | 64
+
+ If successful, fill RESBLOCK and return 0.
+ Upon failure, return a negated error number.
+ Unless returning 0 or -EIO, restore STREAM's file position so that
+ the caller can fall back on some other method. */
+int
+afalg_stream (FILE *stream, const char *alg,
+ void *resblock, ssize_t hashlen);
+
+# else
+
+static inline int
+afalg_buffer (const char *buffer, size_t len, const char *alg,
+ void *resblock, ssize_t hashlen)
+{
+ return -EAFNOSUPPORT;
+}
+
+static inline int
+afalg_stream (FILE *stream, const char *alg,
+ void *resblock, ssize_t hashlen)
+{
+ return -EAFNOSUPPORT;
+}
+
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif /* AF_ALG_H */
diff --git a/gl/alloca.in.h b/gl/alloca.in.h
new file mode 100644
index 0000000..a1bb3d7
--- /dev/null
+++ b/gl/alloca.in.h
@@ -0,0 +1,72 @@
+/* Memory allocation on the stack.
+
+ Copyright (C) 1995, 1999, 2001-2004, 2006-2023 Free Software Foundation,
+ Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
+ means there is a real alloca function. */
+#ifndef _GL_ALLOCA_H
+#define _GL_ALLOCA_H
+
+/* alloca (N) returns a pointer to N bytes of memory
+ allocated on the stack, which will last until the function returns.
+ Use of alloca should be avoided:
+ - inside arguments of function calls - undefined behaviour,
+ - in inline functions - the allocation may actually last until the
+ calling function returns,
+ - for huge N (say, N >= 65536) - you never know how large (or small)
+ the stack is, and when the stack cannot fulfill the memory allocation
+ request, the program just crashes.
+ */
+
+#ifndef alloca
+ /* Some version of mingw have an <alloca.h> that causes trouble when
+ included after 'alloca' gets defined as a macro. As a workaround,
+ include this <alloca.h> first and define 'alloca' as a macro afterwards
+ if needed. */
+# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
+# include_next <alloca.h>
+# endif
+#endif
+#ifndef alloca
+# if defined __GNUC__ || (__clang_major__ >= 4)
+# define alloca __builtin_alloca
+# elif defined _AIX
+# define alloca __alloca
+# elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# elif defined __DECC && defined __VMS
+# define alloca __ALLOCA
+# elif defined __TANDEM && defined _TNS_E_TARGET
+# ifdef __cplusplus
+extern "C"
+# endif
+void *_alloca (unsigned short);
+# pragma intrinsic (_alloca)
+# define alloca _alloca
+# elif defined __MVS__
+# include <stdlib.h>
+# else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+# endif
+#endif
+
+#endif /* _GL_ALLOCA_H */
diff --git a/gl/arg-nonnull.h b/gl/arg-nonnull.h
new file mode 100644
index 0000000..9498ae1
--- /dev/null
+++ b/gl/arg-nonnull.h
@@ -0,0 +1,26 @@
+/* A C macro for declaring that specific arguments must not be NULL.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+ that the values passed as arguments n, ..., m must be non-NULL pointers.
+ n = 1 stands for the first argument, n = 2 for the second argument etc. */
+#ifndef _GL_ARG_NONNULL
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
+# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+# else
+# define _GL_ARG_NONNULL(params)
+# endif
+#endif
diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
new file mode 100644
index 0000000..80e6713
--- /dev/null
+++ b/gl/arpa_inet.in.h
@@ -0,0 +1,150 @@
+/* A GNU-like <arpa/inet.h>.
+
+ Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_ARPA_INET_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
+/* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and
+ for pulling in winsock2.h etc. under MinGW.
+ But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
+
+/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
+ But avoid namespace pollution on glibc systems. */
+#if defined __TANDEM && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
+#if @HAVE_ARPA_INET_H@
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_ARPA_INET_H
+#define _@GUARD_PREFIX@_ARPA_INET_H
+
+/* Get all possible declarations of inet_ntop() and inet_pton(). */
+#if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \
+ && @HAVE_WS2TCPIP_H@
+# include <ws2tcpip.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+#if @GNULIB_INET_NTOP@
+/* Converts an internet address from internal format to a printable,
+ presentable format.
+ AF is an internet address family, such as AF_INET or AF_INET6.
+ SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
+ (for AF_INET6).
+ DST points to a buffer having room for CNT bytes.
+ The printable representation of the address (in numeric form, not
+ surrounded by [...], no reverse DNS is done) is placed in DST, and
+ DST is returned. If an error occurs, the return value is NULL and
+ errno is set. If CNT bytes are not sufficient to hold the result,
+ the return value is NULL and errno is set to ENOSPC. A good value
+ for CNT is 46.
+
+ For more details, see the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html>. */
+# if @REPLACE_INET_NTOP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef inet_ntop
+# define inet_ntop rpl_inet_ntop
+# endif
+_GL_FUNCDECL_RPL (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt));
+# else
+# if !@HAVE_DECL_INET_NTOP@
+_GL_FUNCDECL_SYS (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+/* Need to cast, because on NonStop Kernel, the fourth parameter is
+ size_t cnt. */
+_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (inet_ntop);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef inet_ntop
+# if HAVE_RAW_DECL_INET_NTOP
+_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
+ "use gnulib module inet_ntop for portability");
+# endif
+#endif
+
+#if @GNULIB_INET_PTON@
+# if @REPLACE_INET_PTON@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef inet_pton
+# define inet_pton rpl_inet_pton
+# endif
+_GL_FUNCDECL_RPL (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst));
+# else
+# if !@HAVE_DECL_INET_PTON@
+_GL_FUNCDECL_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (inet_pton);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef inet_pton
+# if HAVE_RAW_DECL_INET_PTON
+_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
+ "use gnulib module inet_pton for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
+#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
diff --git a/gl/asnprintf.c b/gl/asnprintf.c
new file mode 100644
index 0000000..f4861bf
--- /dev/null
+++ b/gl/asnprintf.c
@@ -0,0 +1,34 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "vasnprintf.h"
+
+#include <stdarg.h>
+
+char *
+asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+{
+ va_list args;
+ char *result;
+
+ va_start (args, format);
+ result = vasnprintf (resultbuf, lengthp, format, args);
+ va_end (args);
+ return result;
+}
diff --git a/gl/asprintf.c b/gl/asprintf.c
new file mode 100644
index 0000000..ba58e06
--- /dev/null
+++ b/gl/asprintf.c
@@ -0,0 +1,39 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006-2007, 2009-2023 Free Software Foundation,
+ Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#ifdef IN_LIBASPRINTF
+# include "vasprintf.h"
+#else
+# include <stdio.h>
+#endif
+
+#include <stdarg.h>
+
+int
+asprintf (char **resultp, const char *format, ...)
+{
+ va_list args;
+ int result;
+
+ va_start (args, format);
+ result = vasprintf (resultp, format, args);
+ va_end (args);
+ return result;
+}
diff --git a/gl/assert.in.h b/gl/assert.in.h
new file mode 100644
index 0000000..b0ab99c
--- /dev/null
+++ b/gl/assert.in.h
@@ -0,0 +1,27 @@
+/* Substitute for and wrapper around <assert.h>
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Do not guard the include, since <assert.h> is supposed to define
+ the assert macro each time it is included. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#@INCLUDE_NEXT@ @NEXT_ASSERT_H@
+
+/* The definition of static_assert is copied here. */
diff --git a/gl/attribute.h b/gl/attribute.h
new file mode 100644
index 0000000..130644d
--- /dev/null
+++ b/gl/attribute.h
@@ -0,0 +1,226 @@
+/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
+
+ Copyright 2020-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
+ macros used within Gnulib. */
+
+/* These attributes can be placed in two ways:
+ - At the start of a declaration (i.e. even before storage-class
+ specifiers!); then they apply to all entities that are declared
+ by the declaration.
+ - Immediately after the name of an entity being declared by the
+ declaration; then they apply to that entity only. */
+
+#ifndef _GL_ATTRIBUTE_H
+#define _GL_ATTRIBUTE_H
+
+
+/* This file defines two types of attributes:
+ * C23 standard attributes. These have macro names that do not begin with
+ 'ATTRIBUTE_'.
+ * Selected GCC attributes; see:
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
+ https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html
+ These names begin with 'ATTRIBUTE_' to avoid name clashes. */
+
+
+/* =============== Attributes for specific kinds of functions =============== */
+
+/* Attributes for functions that should not be used. */
+
+/* Warn if the entity is used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: namespace, class, template specialization. */
+#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED
+
+/* If a function call is not optimized way, warn with MSG. */
+/* Applies to: functions. */
+#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING (msg)
+
+/* If a function call is not optimized way, report an error with MSG. */
+/* Applies to: functions. */
+#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR (msg)
+
+
+/* Attributes for memory-allocating functions. */
+
+/* The function returns a pointer to freshly allocated memory. */
+/* Applies to: functions. */
+#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC
+
+/* ATTRIBUTE_ALLOC_SIZE ((N)) - The Nth argument of the function
+ is the size of the returned memory block.
+ ATTRIBUTE_ALLOC_SIZE ((M, N)) - Multiply the Mth and Nth arguments
+ to determine the size of the returned memory block. */
+/* Applies to: function, pointer to function, function types. */
+#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE (args)
+
+/* ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F.
+ ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#define ATTRIBUTE_DEALLOC(f, i) _GL_ATTRIBUTE_DEALLOC(f, i)
+#define ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC_FREE
+
+/* Attributes for variadic functions. */
+
+/* The variadic function expects a trailing NULL argument.
+ ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
+ ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
+/* Applies to: functions. */
+#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL (pos)
+
+
+/* ================== Attributes for compiler diagnostics ================== */
+
+/* Attributes that help the compiler diagnose programmer mistakes.
+ Some of them may also help for some compiler optimizations. */
+
+/* ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) -
+ The STRING-INDEXth function argument is a format string of style
+ ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT (spec)
+
+/* ATTRIBUTE_NONNULL ((N1, N2,...)) - Arguments N1, N2,... must not be NULL.
+ ATTRIBUTE_NONNULL () - All pointer arguments must not be null. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args)
+
+/* The function's return value is a non-NULL pointer. */
+/* Applies to: functions. */
+#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL
+
+/* Warn if the caller does not use the return value,
+ unless the caller uses something like ignore_value. */
+/* Applies to: function, enumeration, class. */
+#define NODISCARD _GL_ATTRIBUTE_NODISCARD
+
+
+/* Attributes that disable false alarms when the compiler diagnoses
+ programmer "mistakes". */
+
+/* Do not warn if the entity is not used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: class. */
+#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* The contents of a character array is not meant to be NUL-terminated. */
+/* Applies to: struct/union members and variables that are arrays of element
+ type '[[un]signed] char'. */
+#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING
+
+/* Do not warn if control flow falls through to the immediately
+ following 'case' or 'default' label. */
+/* Applies to: Empty statement (;), inside a 'switch' statement. */
+#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
+
+
+/* ================== Attributes for debugging information ================== */
+
+/* Attributes regarding debugging information emitted by the compiler. */
+
+/* Omit the function from stack traces when debugging. */
+/* Applies to: function. */
+#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
+
+/* Make the entity visible to debuggers etc., even with '-fwhole-program'. */
+/* Applies to: functions, variables. */
+#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+
+
+/* ========== Attributes that mainly direct compiler optimizations ========== */
+
+/* The function does not throw exceptions. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW
+
+/* Do not inline the function. */
+/* Applies to: functions. */
+#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE
+
+/* Always inline the function, and report an error if the compiler
+ cannot inline. */
+/* Applies to: function. */
+#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
+
+/* It is OK for a compiler to omit duplicate calls with the same arguments.
+ This attribute is safe for a function that neither depends on
+ nor affects observable state, and always returns exactly once -
+ e.g., does not loop forever, and does not call longjmp.
+ (This attribute is stricter than ATTRIBUTE_PURE.) */
+/* Applies to: functions. */
+#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
+
+/* It is OK for a compiler to omit duplicate calls with the same
+ arguments if observable state is not changed between calls.
+ This attribute is safe for a function that does not affect
+ observable state, and always returns exactly once.
+ (This attribute is looser than ATTRIBUTE_CONST.) */
+/* Applies to: functions. */
+#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+
+/* The function is rarely executed. */
+/* Applies to: functions. */
+#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
+
+/* If called from some other compilation unit, the function executes
+ code from that unit only by return or by exception handling,
+ letting the compiler optimize that unit more aggressively. */
+/* Applies to: functions. */
+#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF
+
+/* For struct members: The member has the smallest possible alignment.
+ For struct, union, class: All members have the smallest possible alignment,
+ minimizing the memory required. */
+/* Applies to: struct members, struct, union,
+ in C++ also: class. */
+#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED
+
+
+/* ================ Attributes that make invalid code valid ================ */
+
+/* Attributes that prevent fatal compiler optimizations for code that is not
+ fully ISO C compliant. */
+
+/* Pointers to the type may point to the same storage as pointers to
+ other types, thus disabling strict aliasing optimization. */
+/* Applies to: types. */
+#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS
+
+
+#endif /* _GL_ATTRIBUTE_H */
diff --git a/gl/base64.c b/gl/base64.c
new file mode 100644
index 0000000..95b669a
--- /dev/null
+++ b/gl/base64.c
@@ -0,0 +1,598 @@
+/* base64.c -- Encode binary data using printable characters.
+ Copyright (C) 1999-2001, 2004-2006, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson. Partially adapted from GNU MailUtils
+ * (mailbox/filter_trans.c, as of 2004-11-28). Improved by review
+ * from Paul Eggert, Bruno Haible, and Stepan Kasal.
+ *
+ * See also RFC 4648 <https://www.ietf.org/rfc/rfc4648.txt>.
+ *
+ * Be careful with error checking. Here is how you would typically
+ * use these functions:
+ *
+ * bool ok = base64_decode_alloc (in, inlen, &out, &outlen);
+ * if (!ok)
+ * FAIL: input was not valid base64
+ * if (out == NULL)
+ * FAIL: memory allocation error
+ * OK: data in OUT/OUTLEN
+ *
+ * idx_t outlen = base64_encode_alloc (in, inlen, &out);
+ * if (out == NULL && outlen == 0 && inlen != 0)
+ * FAIL: input too long
+ * if (out == NULL)
+ * FAIL: memory allocation error
+ * OK: data in OUT/OUTLEN.
+ *
+ */
+
+#include <config.h>
+
+/* Get prototype. */
+#include "base64.h"
+
+/* Get imalloc. */
+#include <ialloc.h>
+
+#include <intprops.h>
+
+/* Get UCHAR_MAX. */
+#include <limits.h>
+
+#include <string.h>
+
+/* Convert 'char' to 'unsigned char' without casting. */
+static unsigned char
+to_uchar (char ch)
+{
+ return ch;
+}
+
+static const char b64c[64] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+/* Base64 encode IN array of size INLEN into OUT array. OUT needs
+ to be of length >= BASE64_LENGTH(INLEN), and INLEN needs to be
+ a multiple of 3. */
+static void
+base64_encode_fast (const char *restrict in, idx_t inlen, char *restrict out)
+{
+ while (inlen)
+ {
+ *out++ = b64c[(to_uchar (in[0]) >> 2) & 0x3f];
+ *out++ = b64c[((to_uchar (in[0]) << 4) + (to_uchar (in[1]) >> 4)) & 0x3f];
+ *out++ = b64c[((to_uchar (in[1]) << 2) + (to_uchar (in[2]) >> 6)) & 0x3f];
+ *out++ = b64c[to_uchar (in[2]) & 0x3f];
+
+ inlen -= 3;
+ in += 3;
+ }
+}
+
+/* Base64 encode IN array of size INLEN into OUT array of size OUTLEN.
+ If OUTLEN is less than BASE64_LENGTH(INLEN), write as many bytes as
+ possible. If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero
+ terminate the output buffer. */
+void
+base64_encode (const char *restrict in, idx_t inlen,
+ char *restrict out, idx_t outlen)
+{
+ /* Note this outlen constraint can be enforced at compile time.
+ I.E. that the output buffer is exactly large enough to hold
+ the encoded inlen bytes. The inlen constraints (of corresponding
+ to outlen, and being a multiple of 3) can change at runtime
+ at the end of input. However the common case when reading
+ large inputs is to have both constraints satisfied, so we depend
+ on both in base_encode_fast(). */
+ if (outlen % 4 == 0 && inlen == (outlen >> 2) * 3)
+ {
+ base64_encode_fast (in, inlen, out);
+ return;
+ }
+
+ while (inlen && outlen)
+ {
+ *out++ = b64c[(to_uchar (in[0]) >> 2) & 0x3f];
+ if (!--outlen)
+ break;
+ *out++ = b64c[((to_uchar (in[0]) << 4)
+ + (--inlen ? to_uchar (in[1]) >> 4 : 0))
+ & 0x3f];
+ if (!--outlen)
+ break;
+ *out++ =
+ (inlen
+ ? b64c[((to_uchar (in[1]) << 2)
+ + (--inlen ? to_uchar (in[2]) >> 6 : 0))
+ & 0x3f]
+ : '=');
+ if (!--outlen)
+ break;
+ *out++ = inlen ? b64c[to_uchar (in[2]) & 0x3f] : '=';
+ if (!--outlen)
+ break;
+ if (inlen)
+ inlen--;
+ if (inlen)
+ in += 3;
+ }
+
+ if (outlen)
+ *out = '\0';
+}
+
+/* Allocate a buffer and store zero terminated base64 encoded data
+ from array IN of size INLEN, returning BASE64_LENGTH(INLEN), i.e.,
+ the length of the encoded data, excluding the terminating zero. On
+ return, the OUT variable will hold a pointer to newly allocated
+ memory that must be deallocated by the caller. If output string
+ length would overflow, 0 is returned and OUT is set to NULL. If
+ memory allocation failed, OUT is set to NULL, and the return value
+ indicates length of the requested memory block, i.e.,
+ BASE64_LENGTH(inlen) + 1. */
+idx_t
+base64_encode_alloc (const char *in, idx_t inlen, char **out)
+{
+ /* Check for overflow in outlen computation.
+ Treat negative INLEN as overflow, for better compatibility with
+ pre-2021-08-27 API, which used size_t. */
+ idx_t in_over_3 = inlen / 3 + (inlen % 3 != 0), outlen;
+ if (! INT_MULTIPLY_OK (in_over_3, 4, &outlen) || inlen < 0)
+ {
+ *out = NULL;
+ return 0;
+ }
+ outlen++;
+
+ *out = imalloc (outlen);
+ if (!*out)
+ return outlen;
+
+ base64_encode (in, inlen, *out, outlen);
+
+ return outlen - 1;
+}
+
+/* With this approach this file works independent of the charset used
+ (think EBCDIC). However, it does assume that the characters in the
+ Base64 alphabet (A-Za-z0-9+/) are encoded in 0..255. POSIX
+ 1003.1-2001 require that char and unsigned char are 8-bit
+ quantities, though, taking care of that problem. But this may be a
+ potential problem on non-POSIX C99 platforms.
+
+ IBM C V6 for AIX mishandles "#define B64(x) ...'x'...", so use "_"
+ as the formal parameter rather than "x". */
+#define B64(_) \
+ ((_) == 'A' ? 0 \
+ : (_) == 'B' ? 1 \
+ : (_) == 'C' ? 2 \
+ : (_) == 'D' ? 3 \
+ : (_) == 'E' ? 4 \
+ : (_) == 'F' ? 5 \
+ : (_) == 'G' ? 6 \
+ : (_) == 'H' ? 7 \
+ : (_) == 'I' ? 8 \
+ : (_) == 'J' ? 9 \
+ : (_) == 'K' ? 10 \
+ : (_) == 'L' ? 11 \
+ : (_) == 'M' ? 12 \
+ : (_) == 'N' ? 13 \
+ : (_) == 'O' ? 14 \
+ : (_) == 'P' ? 15 \
+ : (_) == 'Q' ? 16 \
+ : (_) == 'R' ? 17 \
+ : (_) == 'S' ? 18 \
+ : (_) == 'T' ? 19 \
+ : (_) == 'U' ? 20 \
+ : (_) == 'V' ? 21 \
+ : (_) == 'W' ? 22 \
+ : (_) == 'X' ? 23 \
+ : (_) == 'Y' ? 24 \
+ : (_) == 'Z' ? 25 \
+ : (_) == 'a' ? 26 \
+ : (_) == 'b' ? 27 \
+ : (_) == 'c' ? 28 \
+ : (_) == 'd' ? 29 \
+ : (_) == 'e' ? 30 \
+ : (_) == 'f' ? 31 \
+ : (_) == 'g' ? 32 \
+ : (_) == 'h' ? 33 \
+ : (_) == 'i' ? 34 \
+ : (_) == 'j' ? 35 \
+ : (_) == 'k' ? 36 \
+ : (_) == 'l' ? 37 \
+ : (_) == 'm' ? 38 \
+ : (_) == 'n' ? 39 \
+ : (_) == 'o' ? 40 \
+ : (_) == 'p' ? 41 \
+ : (_) == 'q' ? 42 \
+ : (_) == 'r' ? 43 \
+ : (_) == 's' ? 44 \
+ : (_) == 't' ? 45 \
+ : (_) == 'u' ? 46 \
+ : (_) == 'v' ? 47 \
+ : (_) == 'w' ? 48 \
+ : (_) == 'x' ? 49 \
+ : (_) == 'y' ? 50 \
+ : (_) == 'z' ? 51 \
+ : (_) == '0' ? 52 \
+ : (_) == '1' ? 53 \
+ : (_) == '2' ? 54 \
+ : (_) == '3' ? 55 \
+ : (_) == '4' ? 56 \
+ : (_) == '5' ? 57 \
+ : (_) == '6' ? 58 \
+ : (_) == '7' ? 59 \
+ : (_) == '8' ? 60 \
+ : (_) == '9' ? 61 \
+ : (_) == '+' ? 62 \
+ : (_) == '/' ? 63 \
+ : -1)
+
+static const signed char b64[0x100] = {
+ B64 (0), B64 (1), B64 (2), B64 (3),
+ B64 (4), B64 (5), B64 (6), B64 (7),
+ B64 (8), B64 (9), B64 (10), B64 (11),
+ B64 (12), B64 (13), B64 (14), B64 (15),
+ B64 (16), B64 (17), B64 (18), B64 (19),
+ B64 (20), B64 (21), B64 (22), B64 (23),
+ B64 (24), B64 (25), B64 (26), B64 (27),
+ B64 (28), B64 (29), B64 (30), B64 (31),
+ B64 (32), B64 (33), B64 (34), B64 (35),
+ B64 (36), B64 (37), B64 (38), B64 (39),
+ B64 (40), B64 (41), B64 (42), B64 (43),
+ B64 (44), B64 (45), B64 (46), B64 (47),
+ B64 (48), B64 (49), B64 (50), B64 (51),
+ B64 (52), B64 (53), B64 (54), B64 (55),
+ B64 (56), B64 (57), B64 (58), B64 (59),
+ B64 (60), B64 (61), B64 (62), B64 (63),
+ B64 (64), B64 (65), B64 (66), B64 (67),
+ B64 (68), B64 (69), B64 (70), B64 (71),
+ B64 (72), B64 (73), B64 (74), B64 (75),
+ B64 (76), B64 (77), B64 (78), B64 (79),
+ B64 (80), B64 (81), B64 (82), B64 (83),
+ B64 (84), B64 (85), B64 (86), B64 (87),
+ B64 (88), B64 (89), B64 (90), B64 (91),
+ B64 (92), B64 (93), B64 (94), B64 (95),
+ B64 (96), B64 (97), B64 (98), B64 (99),
+ B64 (100), B64 (101), B64 (102), B64 (103),
+ B64 (104), B64 (105), B64 (106), B64 (107),
+ B64 (108), B64 (109), B64 (110), B64 (111),
+ B64 (112), B64 (113), B64 (114), B64 (115),
+ B64 (116), B64 (117), B64 (118), B64 (119),
+ B64 (120), B64 (121), B64 (122), B64 (123),
+ B64 (124), B64 (125), B64 (126), B64 (127),
+ B64 (128), B64 (129), B64 (130), B64 (131),
+ B64 (132), B64 (133), B64 (134), B64 (135),
+ B64 (136), B64 (137), B64 (138), B64 (139),
+ B64 (140), B64 (141), B64 (142), B64 (143),
+ B64 (144), B64 (145), B64 (146), B64 (147),
+ B64 (148), B64 (149), B64 (150), B64 (151),
+ B64 (152), B64 (153), B64 (154), B64 (155),
+ B64 (156), B64 (157), B64 (158), B64 (159),
+ B64 (160), B64 (161), B64 (162), B64 (163),
+ B64 (164), B64 (165), B64 (166), B64 (167),
+ B64 (168), B64 (169), B64 (170), B64 (171),
+ B64 (172), B64 (173), B64 (174), B64 (175),
+ B64 (176), B64 (177), B64 (178), B64 (179),
+ B64 (180), B64 (181), B64 (182), B64 (183),
+ B64 (184), B64 (185), B64 (186), B64 (187),
+ B64 (188), B64 (189), B64 (190), B64 (191),
+ B64 (192), B64 (193), B64 (194), B64 (195),
+ B64 (196), B64 (197), B64 (198), B64 (199),
+ B64 (200), B64 (201), B64 (202), B64 (203),
+ B64 (204), B64 (205), B64 (206), B64 (207),
+ B64 (208), B64 (209), B64 (210), B64 (211),
+ B64 (212), B64 (213), B64 (214), B64 (215),
+ B64 (216), B64 (217), B64 (218), B64 (219),
+ B64 (220), B64 (221), B64 (222), B64 (223),
+ B64 (224), B64 (225), B64 (226), B64 (227),
+ B64 (228), B64 (229), B64 (230), B64 (231),
+ B64 (232), B64 (233), B64 (234), B64 (235),
+ B64 (236), B64 (237), B64 (238), B64 (239),
+ B64 (240), B64 (241), B64 (242), B64 (243),
+ B64 (244), B64 (245), B64 (246), B64 (247),
+ B64 (248), B64 (249), B64 (250), B64 (251),
+ B64 (252), B64 (253), B64 (254), B64 (255)
+};
+
+#if UCHAR_MAX == 255
+# define uchar_in_range(c) true
+#else
+# define uchar_in_range(c) ((c) <= 255)
+#endif
+
+/* Return true if CH is a character from the Base64 alphabet, and
+ false otherwise. Note that '=' is padding and not considered to be
+ part of the alphabet. */
+bool
+isbase64 (char ch)
+{
+ return uchar_in_range (to_uchar (ch)) && 0 <= b64[to_uchar (ch)];
+}
+
+/* Initialize decode-context buffer, CTX. */
+void
+base64_decode_ctx_init (struct base64_decode_context *ctx)
+{
+ ctx->i = 0;
+}
+
+/* If CTX->i is 0 or 4, there are four or more bytes in [*IN..IN_END), and
+ none of those four is a newline, then return *IN. Otherwise, copy up to
+ 4 - CTX->i non-newline bytes from that range into CTX->buf, starting at
+ index CTX->i and setting CTX->i to reflect the number of bytes copied,
+ and return CTX->buf. In either case, advance *IN to point to the byte
+ after the last one processed, and set *N_NON_NEWLINE to the number of
+ verified non-newline bytes accessible through the returned pointer. */
+static char *
+get_4 (struct base64_decode_context *ctx,
+ char const *restrict *in, char const *restrict in_end,
+ idx_t *n_non_newline)
+{
+ if (ctx->i == 4)
+ ctx->i = 0;
+
+ if (ctx->i == 0)
+ {
+ char const *t = *in;
+ if (4 <= in_end - *in && memchr (t, '\n', 4) == NULL)
+ {
+ /* This is the common case: no newline. */
+ *in += 4;
+ *n_non_newline = 4;
+ return (char *) t;
+ }
+ }
+
+ {
+ /* Copy non-newline bytes into BUF. */
+ char const *p = *in;
+ while (p < in_end)
+ {
+ char c = *p++;
+ if (c != '\n')
+ {
+ ctx->buf[ctx->i++] = c;
+ if (ctx->i == 4)
+ break;
+ }
+ }
+
+ *in = p;
+ *n_non_newline = ctx->i;
+ return ctx->buf;
+ }
+}
+
+#define return_false \
+ do \
+ { \
+ *outp = out; \
+ return false; \
+ } \
+ while (false)
+
+/* Decode up to four bytes of base64-encoded data, IN, of length INLEN
+ into the output buffer, *OUT, of size *OUTLEN bytes. Return true if
+ decoding is successful, false otherwise. If *OUTLEN is too small,
+ as many bytes as possible are written to *OUT. On return, advance
+ *OUT to point to the byte after the last one written, and decrement
+ *OUTLEN to reflect the number of bytes remaining in *OUT. */
+static bool
+decode_4 (char const *restrict in, idx_t inlen,
+ char *restrict *outp, idx_t *outleft)
+{
+ char *out = *outp;
+ if (inlen < 2)
+ return false;
+
+ if (!isbase64 (in[0]) || !isbase64 (in[1]))
+ return false;
+
+ if (*outleft)
+ {
+ *out++ = ((b64[to_uchar (in[0])] << 2)
+ | (b64[to_uchar (in[1])] >> 4));
+ --*outleft;
+ }
+
+ if (inlen == 2)
+ return_false;
+
+ if (in[2] == '=')
+ {
+ if (inlen != 4)
+ return_false;
+
+ if (in[3] != '=')
+ return_false;
+ }
+ else
+ {
+ if (!isbase64 (in[2]))
+ return_false;
+
+ if (*outleft)
+ {
+ *out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0)
+ | (b64[to_uchar (in[2])] >> 2));
+ --*outleft;
+ }
+
+ if (inlen == 3)
+ return_false;
+
+ if (in[3] == '=')
+ {
+ if (inlen != 4)
+ return_false;
+ }
+ else
+ {
+ if (!isbase64 (in[3]))
+ return_false;
+
+ if (*outleft)
+ {
+ *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0)
+ | b64[to_uchar (in[3])]);
+ --*outleft;
+ }
+ }
+ }
+
+ *outp = out;
+ return true;
+}
+
+/* Decode base64-encoded input array IN of length INLEN to output array
+ OUT that can hold *OUTLEN bytes. The input data may be interspersed
+ with newlines. Return true if decoding was successful, i.e. if the
+ input was valid base64 data, false otherwise. If *OUTLEN is too
+ small, as many bytes as possible will be written to OUT. On return,
+ *OUTLEN holds the length of decoded bytes in OUT. Note that as soon
+ as any non-alphabet, non-newline character is encountered, decoding
+ is stopped and false is returned. If INLEN is zero, then process
+ only whatever data is stored in CTX.
+
+ Initially, CTX must have been initialized via base64_decode_ctx_init.
+ Subsequent calls to this function must reuse whatever state is recorded
+ in that buffer. It is necessary for when a quadruple of base64 input
+ bytes spans two input buffers.
+
+ If CTX is NULL then newlines are treated as garbage and the input
+ buffer is processed as a unit. */
+
+bool
+base64_decode_ctx (struct base64_decode_context *ctx,
+ const char *restrict in, idx_t inlen,
+ char *restrict out, idx_t *outlen)
+{
+ idx_t outleft = *outlen;
+ bool ignore_newlines = ctx != NULL;
+ bool flush_ctx = false;
+ unsigned int ctx_i = 0;
+
+ if (ignore_newlines)
+ {
+ ctx_i = ctx->i;
+ flush_ctx = inlen == 0;
+ }
+
+
+ while (true)
+ {
+ idx_t outleft_save = outleft;
+ if (ctx_i == 0 && !flush_ctx)
+ {
+ while (true)
+ {
+ /* Save a copy of outleft, in case we need to re-parse this
+ block of four bytes. */
+ outleft_save = outleft;
+ if (!decode_4 (in, inlen, &out, &outleft))
+ break;
+
+ in += 4;
+ inlen -= 4;
+ }
+ }
+
+ if (inlen == 0 && !flush_ctx)
+ break;
+
+ /* Handle the common case of 72-byte wrapped lines.
+ This also handles any other multiple-of-4-byte wrapping. */
+ if (inlen && *in == '\n' && ignore_newlines)
+ {
+ ++in;
+ --inlen;
+ continue;
+ }
+
+ /* Restore OUT and OUTLEFT. */
+ out -= outleft_save - outleft;
+ outleft = outleft_save;
+
+ {
+ char const *in_end = in + inlen;
+ char const *non_nl;
+
+ if (ignore_newlines)
+ non_nl = get_4 (ctx, &in, in_end, &inlen);
+ else
+ non_nl = in; /* Might have nl in this case. */
+
+ /* If the input is empty or consists solely of newlines (0 non-newlines),
+ then we're done. Likewise if there are fewer than 4 bytes when not
+ flushing context and not treating newlines as garbage. */
+ if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines))
+ {
+ inlen = 0;
+ break;
+ }
+ if (!decode_4 (non_nl, inlen, &out, &outleft))
+ break;
+
+ inlen = in_end - in;
+ }
+ }
+
+ *outlen -= outleft;
+
+ return inlen == 0;
+}
+
+/* Allocate an output buffer in *OUT, and decode the base64 encoded
+ data stored in IN of size INLEN to the *OUT buffer. On return, the
+ size of the decoded data is stored in *OUTLEN. OUTLEN may be NULL,
+ if the caller is not interested in the decoded length. *OUT may be
+ NULL to indicate an out of memory error, in which case *OUTLEN
+ contains the size of the memory block needed. The function returns
+ true on successful decoding and memory allocation errors. (Use the
+ *OUT and *OUTLEN parameters to differentiate between successful
+ decoding and memory error.) The function returns false if the
+ input was invalid, in which case *OUT is NULL and *OUTLEN is
+ undefined. */
+bool
+base64_decode_alloc_ctx (struct base64_decode_context *ctx,
+ const char *in, idx_t inlen, char **out,
+ idx_t *outlen)
+{
+ /* This may allocate a few bytes too many, depending on input,
+ but it's not worth the extra CPU time to compute the exact size.
+ The exact size is 3 * (inlen + (ctx ? ctx->i : 0)) / 4, minus 1 if the
+ input ends with "=" and minus another 1 if the input ends with "==".
+ Shifting before multiplying avoids the possibility of overflow. */
+ idx_t needlen = 3 * ((inlen >> 2) + 1);
+
+ *out = imalloc (needlen);
+ if (!*out)
+ return true;
+
+ if (!base64_decode_ctx (ctx, in, inlen, *out, &needlen))
+ {
+ free (*out);
+ *out = NULL;
+ return false;
+ }
+
+ if (outlen)
+ *outlen = needlen;
+
+ return true;
+}
diff --git a/gl/base64.h b/gl/base64.h
new file mode 100644
index 0000000..9913765
--- /dev/null
+++ b/gl/base64.h
@@ -0,0 +1,65 @@
+/* base64.h -- Encode binary data using printable characters.
+ Copyright (C) 2004-2006, 2009-2023 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef BASE64_H
+# define BASE64_H
+
+/* Get idx_t. */
+# include <idx.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* This uses that the expression (n+(k-1))/k means the smallest
+ integer >= n/k, i.e., the ceiling of n/k. */
+# define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4)
+
+struct base64_decode_context
+{
+ int i;
+ char buf[4];
+};
+
+extern bool isbase64 (char ch) _GL_ATTRIBUTE_CONST;
+
+extern void base64_encode (const char *restrict in, idx_t inlen,
+ char *restrict out, idx_t outlen);
+
+extern idx_t base64_encode_alloc (const char *in, idx_t inlen, char **out);
+
+extern void base64_decode_ctx_init (struct base64_decode_context *ctx);
+
+extern bool base64_decode_ctx (struct base64_decode_context *ctx,
+ const char *restrict in, idx_t inlen,
+ char *restrict out, idx_t *outlen);
+
+extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx,
+ const char *in, idx_t inlen,
+ char **out, idx_t *outlen);
+
+#define base64_decode(in, inlen, out, outlen) \
+ base64_decode_ctx (NULL, in, inlen, out, outlen)
+
+#define base64_decode_alloc(in, inlen, out, outlen) \
+ base64_decode_alloc_ctx (NULL, in, inlen, out, outlen)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif /* BASE64_H */
diff --git a/gl/basename-lgpl.c b/gl/basename-lgpl.c
new file mode 100644
index 0000000..6de60aa
--- /dev/null
+++ b/gl/basename-lgpl.c
@@ -0,0 +1,70 @@
+/* basename.c -- return the last element in a file name
+
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "basename-lgpl.h"
+
+#include <string.h>
+
+#include "filename.h"
+
+char *
+last_component (char const *name)
+{
+ char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
+ char const *p;
+ bool last_was_slash = false;
+
+ while (ISSLASH (*base))
+ base++;
+
+ for (p = base; *p; p++)
+ {
+ if (ISSLASH (*p))
+ last_was_slash = true;
+ else if (last_was_slash)
+ {
+ base = p;
+ last_was_slash = false;
+ }
+ }
+
+ return (char *) base;
+}
+
+size_t
+base_len (char const *name)
+{
+ size_t len;
+ size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+
+ for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
+ continue;
+
+ if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
+ && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
+ return 2;
+
+ if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
+ && len == prefix_len && ISSLASH (name[prefix_len]))
+ return prefix_len + 1;
+
+ return len;
+}
diff --git a/gl/basename-lgpl.h b/gl/basename-lgpl.h
new file mode 100644
index 0000000..5d996c1
--- /dev/null
+++ b/gl/basename-lgpl.h
@@ -0,0 +1,78 @@
+/* Extract the last component (base name) of a file name.
+
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
+ Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _BASENAME_LGPL_H
+#define _BASENAME_LGPL_H
+
+#include <stddef.h>
+
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Return the address of the last file name component of FILENAME.
+ If FILENAME has some trailing slash(es), they are considered to be
+ part of the last component.
+ If FILENAME has no relative file name components because it is a file
+ system root, return the empty string.
+ Examples:
+ FILENAME RESULT
+ "foo.c" "foo.c"
+ "foo/bar.c" "bar.c"
+ "/foo/bar.c" "bar.c"
+ "foo/bar/" "bar/"
+ "foo/bar//" "bar//"
+ "/" ""
+ "//" ""
+ "" ""
+ The return value is a tail of the given FILENAME; do NOT free() it! */
+
+/* This function was traditionally called 'basename', but we avoid this
+ function name because
+ * Various platforms have different functions in their libc.
+ In particular, the glibc basename(), defined in <string.h>, does
+ not consider trailing slashes to be part of the component:
+ FILENAME RESULT
+ "foo/bar/" ""
+ "foo/bar//" ""
+ * The 'basename' command eliminates trailing slashes and for a root
+ produces a non-empty result:
+ FILENAME RESULT
+ "foo/bar/" "bar"
+ "foo/bar//" "bar"
+ "/" "/"
+ "//" "/"
+ */
+extern char *last_component (char const *filename) _GL_ATTRIBUTE_PURE;
+
+/* Return the length of the basename FILENAME.
+ Typically FILENAME is the value returned by base_name or last_component.
+ Act like strlen (FILENAME), except omit all trailing slashes. */
+extern size_t base_len (char const *filename) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _BASENAME_LGPL_H */
diff --git a/gl/basename.c b/gl/basename.c
new file mode 100644
index 0000000..21fab1e
--- /dev/null
+++ b/gl/basename.c
@@ -0,0 +1,64 @@
+/* basename.c -- return the last element in a file name
+
+ Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <string.h>
+#include "xalloc.h"
+
+char *
+base_name (char const *name)
+{
+ char const *base = last_component (name);
+ idx_t length;
+ int dotslash_len;
+ if (*base)
+ {
+ length = base_len (base);
+
+ /* Collapse a sequence of trailing slashes into one. */
+ length += ISSLASH (base[length]);
+
+ /* On systems with drive letters, "a/b:c" must return "./b:c" rather
+ than "b:c" to avoid confusion with a drive letter. On systems
+ with pure POSIX semantics, this is not an issue. */
+ dotslash_len = FILE_SYSTEM_PREFIX_LEN (base) != 0 ? 2 : 0;
+ }
+ else
+ {
+ /* There is no last component, so NAME is a file system root or
+ the empty string. */
+ base = name;
+ length = base_len (base);
+ dotslash_len = 0;
+ }
+
+ char *p = ximalloc (dotslash_len + length + 1);
+ if (dotslash_len)
+ {
+ p[0] = '.';
+ p[1] = '/';
+ }
+
+ /* Finally, copy the basename. */
+ memcpy (p + dotslash_len, base, length);
+ p[dotslash_len + length] = '\0';
+ return p;
+}
diff --git a/gl/btowc.c b/gl/btowc.c
new file mode 100644
index 0000000..caadbd7
--- /dev/null
+++ b/gl/btowc.c
@@ -0,0 +1,39 @@
+/* Convert unibyte character to wide character.
+ Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+wint_t
+btowc (int c)
+{
+ if (c != EOF)
+ {
+ char buf[1];
+ wchar_t wc;
+
+ buf[0] = c;
+ if (mbtowc (&wc, buf, 1) >= 0)
+ return wc;
+ }
+ return WEOF;
+}
diff --git a/gl/byteswap.in.h b/gl/byteswap.in.h
new file mode 100644
index 0000000..e61be27
--- /dev/null
+++ b/gl/byteswap.in.h
@@ -0,0 +1,44 @@
+/* byteswap.h - Byte swapping
+ Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+ Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_BYTESWAP_H
+#define _GL_BYTESWAP_H
+
+/* Given an unsigned 16-bit argument X, return the value corresponding to
+ X with reversed byte order. */
+#define bswap_16(x) ((((x) & 0x00FF) << 8) | \
+ (((x) & 0xFF00) >> 8))
+
+/* Given an unsigned 32-bit argument X, return the value corresponding to
+ X with reversed byte order. */
+#define bswap_32(x) ((((x) & 0x000000FF) << 24) | \
+ (((x) & 0x0000FF00) << 8) | \
+ (((x) & 0x00FF0000) >> 8) | \
+ (((x) & 0xFF000000) >> 24))
+
+/* Given an unsigned 64-bit argument X, return the value corresponding to
+ X with reversed byte order. */
+#define bswap_64(x) ((((x) & 0x00000000000000FFULL) << 56) | \
+ (((x) & 0x000000000000FF00ULL) << 40) | \
+ (((x) & 0x0000000000FF0000ULL) << 24) | \
+ (((x) & 0x00000000FF000000ULL) << 8) | \
+ (((x) & 0x000000FF00000000ULL) >> 8) | \
+ (((x) & 0x0000FF0000000000ULL) >> 24) | \
+ (((x) & 0x00FF000000000000ULL) >> 40) | \
+ (((x) & 0xFF00000000000000ULL) >> 56))
+
+#endif /* _GL_BYTESWAP_H */
diff --git a/gl/c++defs.h b/gl/c++defs.h
new file mode 100644
index 0000000..8ad4695
--- /dev/null
+++ b/gl/c++defs.h
@@ -0,0 +1,331 @@
+/* C++ compatible function declaration macros.
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_CXXDEFS_H
+#define _GL_CXXDEFS_H
+
+/* Begin/end the GNULIB_NAMESPACE namespace. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
+# define _GL_END_NAMESPACE }
+#else
+# define _GL_BEGIN_NAMESPACE
+# define _GL_END_NAMESPACE
+#endif
+
+/* The three most frequent use cases of these macros are:
+
+ * For providing a substitute for a function that is missing on some
+ platforms, but is declared and works fine on the platforms on which
+ it exists:
+
+ #if @GNULIB_FOO@
+ # if !@HAVE_FOO@
+ _GL_FUNCDECL_SYS (foo, ...);
+ # endif
+ _GL_CXXALIAS_SYS (foo, ...);
+ _GL_CXXALIASWARN (foo);
+ #elif defined GNULIB_POSIXCHECK
+ ...
+ #endif
+
+ * For providing a replacement for a function that exists on all platforms,
+ but is broken/insufficient and needs to be replaced on some platforms:
+
+ #if @GNULIB_FOO@
+ # if @REPLACE_FOO@
+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+ # undef foo
+ # define foo rpl_foo
+ # endif
+ _GL_FUNCDECL_RPL (foo, ...);
+ _GL_CXXALIAS_RPL (foo, ...);
+ # else
+ _GL_CXXALIAS_SYS (foo, ...);
+ # endif
+ _GL_CXXALIASWARN (foo);
+ #elif defined GNULIB_POSIXCHECK
+ ...
+ #endif
+
+ * For providing a replacement for a function that exists on some platforms
+ but is broken/insufficient and needs to be replaced on some of them and
+ is additionally either missing or undeclared on some other platforms:
+
+ #if @GNULIB_FOO@
+ # if @REPLACE_FOO@
+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+ # undef foo
+ # define foo rpl_foo
+ # endif
+ _GL_FUNCDECL_RPL (foo, ...);
+ _GL_CXXALIAS_RPL (foo, ...);
+ # else
+ # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
+ _GL_FUNCDECL_SYS (foo, ...);
+ # endif
+ _GL_CXXALIAS_SYS (foo, ...);
+ # endif
+ _GL_CXXALIASWARN (foo);
+ #elif defined GNULIB_POSIXCHECK
+ ...
+ #endif
+*/
+
+/* _GL_EXTERN_C declaration;
+ performs the declaration with C linkage. */
+#if defined __cplusplus
+# define _GL_EXTERN_C extern "C"
+#else
+# define _GL_EXTERN_C extern
+#endif
+
+/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+ declares a replacement function, named rpl_func, with the given prototype,
+ consisting of return type, parameters, and attributes.
+ Example:
+ _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
+ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
+ _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+
+/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+ declares the system function, named func, with the given prototype,
+ consisting of return type, parameters, and attributes.
+ Example:
+ _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
+ _GL_EXTERN_C rettype func parameters_and_attributes
+
+/* _GL_CXXALIAS_RPL (func, rettype, parameters);
+ declares a C++ alias called GNULIB_NAMESPACE::func
+ that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
+ Example:
+ _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+
+ Wrapping rpl_func in an object with an inline conversion operator
+ avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
+ actually used in the program. */
+#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
+ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return ::rpl_func; \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_MDA (func, rettype, parameters);
+ is to be used when func is a Microsoft deprecated alias, on native Windows.
+ It declares a C++ alias called GNULIB_NAMESPACE::func
+ that redirects to _func, if GNULIB_NAMESPACE is defined.
+ Example:
+ _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+ */
+#define _GL_CXXALIAS_MDA(func,rettype,parameters) \
+ _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
+
+/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+ is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+ except that the C function rpl_func may have a slightly different
+ declaration. A cast is used to silence the "invalid conversion" error
+ that would otherwise occur. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>(::rpl_func); \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
+ is like _GL_CXXALIAS_MDA (func, rettype, parameters);
+ except that the C function func may have a slightly different declaration.
+ A cast is used to silence the "invalid conversion" error that would
+ otherwise occur. */
+#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
+ _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
+
+/* _GL_CXXALIAS_SYS (func, rettype, parameters);
+ declares a C++ alias called GNULIB_NAMESPACE::func
+ that redirects to the system provided function func, if GNULIB_NAMESPACE
+ is defined.
+ Example:
+ _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+
+ Wrapping func in an object with an inline conversion operator
+ avoids a reference to func unless GNULIB_NAMESPACE::func is
+ actually used in the program. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return ::func; \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
+ is like _GL_CXXALIAS_SYS (func, rettype, parameters);
+ except that the C function func may have a slightly different declaration.
+ A cast is used to silence the "invalid conversion" error that would
+ otherwise occur. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>(::func); \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
+ is like _GL_CXXALIAS_SYS (func, rettype, parameters);
+ except that the C function is picked among a set of overloaded functions,
+ namely the one with rettype2 and parameters2. Two consecutive casts
+ are used to silence the "cannot find a match" and "invalid conversion"
+ errors that would otherwise occur. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+ /* The outer cast must be a reinterpret_cast.
+ The inner cast: When the function is defined as a set of overloaded
+ functions, it works as a static_cast<>, choosing the designated variant.
+ When the function is defined as a single variant, it works as a
+ reinterpret_cast<>. The parenthesized cast syntax works both ways. */
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ static const struct _gl_ ## func ## _wrapper \
+ { \
+ typedef rettype (*type) parameters; \
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
+ } \
+ } func = {}; \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN (func);
+ causes a warning to be emitted when ::func is used but not when
+ GNULIB_NAMESPACE::func is used. func must be defined without overloaded
+ variants. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN(func) \
+ _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN_1(func,namespace) \
+ _GL_CXXALIASWARN_2 (func, namespace)
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ _GL_WARN_ON_USE (func, \
+ "The symbol ::" #func " refers to the system function. " \
+ "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ extern __typeof__ (func) func
+# else
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN(func) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
+ causes a warning to be emitted when the given overloaded variant of ::func
+ is used but not when GNULIB_NAMESPACE::func is used. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+ _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
+ GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
+ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
+ "The symbol ::" #func " refers to the system function. " \
+ "Use " #namespace "::" #func " instead.")
+# else
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+#endif /* _GL_CXXDEFS_H */
diff --git a/gl/calloc.c b/gl/calloc.c
new file mode 100644
index 0000000..08843ac
--- /dev/null
+++ b/gl/calloc.c
@@ -0,0 +1,55 @@
+/* calloc() function that is glibc compatible.
+ This wrapper function is required at least on Tru64 UNIX 5.1 and mingw.
+ Copyright (C) 2004-2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Call the system's calloc below. */
+#undef calloc
+
+/* Allocate and zero-fill an NxS-byte block of memory from the heap,
+ even if N or S is zero. */
+
+void *
+rpl_calloc (size_t n, size_t s)
+{
+ if (n == 0 || s == 0)
+ n = s = 1;
+
+ if (xalloc_oversized (n, s))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ void *result = calloc (n, s);
+
+#if !HAVE_MALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/gl/cdefs.h b/gl/cdefs.h
new file mode 100644
index 0000000..09a3d19
--- /dev/null
+++ b/gl/cdefs.h
@@ -0,0 +1,707 @@
+/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
+ Copyright The GNU Toolchain Authors.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_CDEFS_H
+#define _SYS_CDEFS_H 1
+
+/* We are almost always included from features.h. */
+#ifndef _FEATURES_H
+# include <features.h>
+#endif
+
+/* The GNU libc does not support any K&R compilers or the traditional mode
+ of ISO C compilers anymore. Check for some of the combinations not
+ supported anymore. */
+#if defined __GNUC__ && !defined __STDC__
+# error "You need a ISO C conforming compiler to use the glibc headers"
+#endif
+
+/* Some user header file might have defined this before. */
+#undef __P
+#undef __PMT
+
+/* Compilers that lack __has_attribute may object to
+ #if defined __has_attribute && __has_attribute (...)
+ even though they do not need to evaluate the right-hand side of the &&.
+ Similarly for __has_builtin, etc. */
+#if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))
+# define __glibc_has_attribute(attr) __has_attribute (attr)
+#else
+# define __glibc_has_attribute(attr) 0
+#endif
+#ifdef __has_builtin
+# define __glibc_has_builtin(name) __has_builtin (name)
+#else
+# define __glibc_has_builtin(name) 0
+#endif
+#ifdef __has_extension
+# define __glibc_has_extension(ext) __has_extension (ext)
+#else
+# define __glibc_has_extension(ext) 0
+#endif
+
+#if defined __GNUC__ || defined __clang__
+
+/* All functions, except those with callbacks or those that
+ synchronize memory, are leaf functions. */
+# if __GNUC_PREREQ (4, 6) && !defined _LIBC
+# define __LEAF , __leaf__
+# define __LEAF_ATTR __attribute__ ((__leaf__))
+# else
+# define __LEAF
+# define __LEAF_ATTR
+# endif
+
+/* GCC can always grok prototypes. For C++ programs we add throw()
+ to help it optimize the function calls. But this only works with
+ gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions
+ as non-throwing using a function attribute since programs can use
+ the -fexceptions options for C code as well. */
+# if !defined __cplusplus \
+ && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__))
+# define __THROW __attribute__ ((__nothrow__ __LEAF))
+# define __THROWNL __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
+# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
+# else
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
+# if __cplusplus >= 201103L
+# define __THROW noexcept (true)
+# else
+# define __THROW throw ()
+# endif
+# define __THROWNL __THROW
+# define __NTH(fct) __LEAF_ATTR fct __THROW
+# define __NTHNL(fct) fct __THROW
+# else
+# define __THROW
+# define __THROWNL
+# define __NTH(fct) fct
+# define __NTHNL(fct) fct
+# endif
+# endif
+
+#else /* Not GCC or clang. */
+
+# if (defined __cplusplus \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+# define __inline inline
+# else
+# define __inline /* No inline functions. */
+# endif
+
+# define __THROW
+# define __THROWNL
+# define __NTH(fct) fct
+
+#endif /* GCC || clang. */
+
+/* These two macros are not used in glibc anymore. They are kept here
+ only because some other projects expect the macros to be defined. */
+#define __P(args) args
+#define __PMT(args) args
+
+/* For these things, GCC behaves the ANSI way normally,
+ and the non-ANSI way under -traditional. */
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+/* This is not a typedef so `const __ptr_t' does the right thing. */
+#define __ptr_t void *
+
+
+/* C++ needs to know that types and declarations are C, not C++. */
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+
+/* Fortify support. */
+#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
+#define __bos0(ptr) __builtin_object_size (ptr, 0)
+
+/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */
+#if __USE_FORTIFY_LEVEL == 3 && (__glibc_clang_prereq (9, 0) \
+ || __GNUC_PREREQ (12, 0))
+# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
+# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
+#else
+# define __glibc_objsize0(__o) __bos0 (__o)
+# define __glibc_objsize(__o) __bos (__o)
+#endif
+
+/* Compile time conditions to choose between the regular, _chk and _chk_warn
+ variants. These conditions should get evaluated to constant and optimized
+ away. */
+
+#define __glibc_safe_len_cond(__l, __s, __osz) ((__l) <= (__osz) / (__s))
+#define __glibc_unsigned_or_positive(__l) \
+ ((__typeof (__l)) 0 < (__typeof (__l)) -1 \
+ || (__builtin_constant_p (__l) && (__l) > 0))
+
+/* Length is known to be safe at compile time if the __L * __S <= __OBJSZ
+ condition can be folded to a constant and if it is true, or unknown (-1) */
+#define __glibc_safe_or_unknown_len(__l, __s, __osz) \
+ ((__osz) == (__SIZE_TYPE__) -1 \
+ || (__glibc_unsigned_or_positive (__l) \
+ && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
+ (__s), (__osz))) \
+ && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz))))
+
+/* Conversely, we know at compile time that the length is unsafe if the
+ __L * __S <= __OBJSZ condition can be folded to a constant and if it is
+ false. */
+#define __glibc_unsafe_len(__l, __s, __osz) \
+ (__glibc_unsigned_or_positive (__l) \
+ && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \
+ __s, __osz)) \
+ && !__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz))
+
+/* Fortify function f. __f_alias, __f_chk and __f_chk_warn must be
+ declared. */
+
+#define __glibc_fortify(f, __l, __s, __osz, ...) \
+ (__glibc_safe_or_unknown_len (__l, __s, __osz) \
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, __osz) \
+ : __ ## f ## _chk (__VA_ARGS__, __osz))) \
+
+/* Fortify function f, where object size argument passed to f is the number of
+ elements and not total size. */
+
+#define __glibc_fortify_n(f, __l, __s, __osz, ...) \
+ (__glibc_safe_or_unknown_len (__l, __s, __osz) \
+ ? __ ## f ## _alias (__VA_ARGS__) \
+ : (__glibc_unsafe_len (__l, __s, __osz) \
+ ? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
+ : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \
+
+#if __GNUC_PREREQ (4,3)
+# define __warnattr(msg) __attribute__((__warning__ (msg)))
+# define __errordecl(name, msg) \
+ extern void name (void) __attribute__((__error__ (msg)))
+#else
+# define __warnattr(msg)
+# define __errordecl(name, msg) extern void name (void)
+#endif
+
+/* Support for flexible arrays.
+ Headers that should use flexible arrays only if they're "real"
+ (e.g. only if they won't affect sizeof()) should test
+ #if __glibc_c99_flexarr_available. */
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
+# define __flexarr []
+# define __glibc_c99_flexarr_available 1
+#elif __GNUC_PREREQ (2,97) || defined __clang__
+/* GCC 2.97 and clang support C99 flexible array members as an extension,
+ even when in C89 mode or compiling C++ (any version). */
+# define __flexarr []
+# define __glibc_c99_flexarr_available 1
+#elif defined __GNUC__
+/* Pre-2.97 GCC did not support C99 flexible arrays but did have
+ an equivalent extension with slightly different notation. */
+# define __flexarr [0]
+# define __glibc_c99_flexarr_available 1
+#else
+/* Some other non-C99 compiler. Approximate with [1]. */
+# define __flexarr [1]
+# define __glibc_c99_flexarr_available 0
+#endif
+
+
+/* __asm__ ("xyz") is used throughout the headers to rename functions
+ at the assembly language level. This is wrapped by the __REDIRECT
+ macro, in order to support compilers that can do this some other
+ way. When compilers don't support asm-names at all, we have to do
+ preprocessor tricks instead (which don't have exactly the right
+ semantics, but it's the best we can do).
+
+ Example:
+ int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
+
+#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
+
+# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
+# ifdef __cplusplus
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __THROW __asm__ (__ASMNAME (#alias))
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __THROWNL __asm__ (__ASMNAME (#alias))
+# else
+# define __REDIRECT_NTH(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROW
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROWNL
+# endif
+# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
+
+/*
+#elif __SOME_OTHER_COMPILER__
+
+# define __REDIRECT(name, proto, alias) name proto; \
+ _Pragma("let " #name " = " #alias)
+*/
+#endif
+
+/* GCC and clang have various useful declarations that can be made with
+ the '__attribute__' syntax. All of the ways we use this do fine if
+ they are omitted for compilers that don't understand it. */
+#if !(defined __GNUC__ || defined __clang__)
+# define __attribute__(xyz) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.96 development the `malloc' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__)
+# define __attribute_malloc__ __attribute__ ((__malloc__))
+#else
+# define __attribute_malloc__ /* Ignore */
+#endif
+
+/* Tell the compiler which arguments to an allocation function
+ indicate the size of the allocation. */
+#if __GNUC_PREREQ (4, 3)
+# define __attribute_alloc_size__(params) \
+ __attribute__ ((__alloc_size__ params))
+#else
+# define __attribute_alloc_size__(params) /* Ignore. */
+#endif
+
+/* Tell the compiler which argument to an allocation function
+ indicates the alignment of the allocation. */
+#if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__alloc_align__)
+# define __attribute_alloc_align__(param) \
+ __attribute__ ((__alloc_align__ param))
+#else
+# define __attribute_alloc_align__(param) /* Ignore. */
+#endif
+
+/* At some point during the gcc 2.96 development the `pure' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__)
+# define __attribute_pure__ __attribute__ ((__pure__))
+#else
+# define __attribute_pure__ /* Ignore */
+#endif
+
+/* This declaration tells the compiler that the value is constant. */
+#if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
+# define __attribute_const__ __attribute__ ((__const__))
+#else
+# define __attribute_const__ /* Ignore */
+#endif
+
+#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__)
+# define __attribute_maybe_unused__ __attribute__ ((__unused__))
+#else
+# define __attribute_maybe_unused__ /* Ignore */
+#endif
+
+/* At some point during the gcc 3.1 development the `used' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings. */
+#if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__)
+# define __attribute_used__ __attribute__ ((__used__))
+# define __attribute_noinline__ __attribute__ ((__noinline__))
+#else
+# define __attribute_used__ __attribute__ ((__unused__))
+# define __attribute_noinline__ /* Ignore */
+#endif
+
+/* Since version 3.2, gcc allows marking deprecated functions. */
+#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__)
+# define __attribute_deprecated__ __attribute__ ((__deprecated__))
+#else
+# define __attribute_deprecated__ /* Ignore */
+#endif
+
+/* Since version 4.5, gcc also allows one to specify the message printed
+ when a deprecated function is used. clang claims to be gcc 4.2, but
+ may also support this feature. */
+#if __GNUC_PREREQ (4,5) \
+ || __glibc_has_extension (__attribute_deprecated_with_message__)
+# define __attribute_deprecated_msg__(msg) \
+ __attribute__ ((__deprecated__ (msg)))
+#else
+# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
+#endif
+
+/* At some point during the gcc 2.8 development the `format_arg' attribute
+ for functions was introduced. We don't want to use it unconditionally
+ (although this would be possible) since it generates warnings.
+ If several `format_arg' attributes are given for the same function, in
+ gcc-3.0 and older, all but the last one are ignored. In newer gccs,
+ all designated arguments are considered. */
+#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__)
+# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
+#else
+# define __attribute_format_arg__(x) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.97 development the `strfmon' format
+ attribute for functions was introduced. We don't want to use it
+ unconditionally (although this would be possible) since it
+ generates warnings. */
+#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__)
+# define __attribute_format_strfmon__(a,b) \
+ __attribute__ ((__format__ (__strfmon__, a, b)))
+#else
+# define __attribute_format_strfmon__(a,b) /* Ignore */
+#endif
+
+/* The nonnull function attribute marks pointer parameters that
+ must not be NULL. This has the name __nonnull in glibc,
+ and __attribute_nonnull__ in files shared with Gnulib to avoid
+ collision with a different __nonnull in DragonFlyBSD 5.9. */
+#ifndef __attribute_nonnull__
+# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
+# define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
+# else
+# define __attribute_nonnull__(params)
+# endif
+#endif
+#ifndef __nonnull
+# define __nonnull(params) __attribute_nonnull__ (params)
+#endif
+
+/* The returns_nonnull function attribute marks the return type of the function
+ as always being non-null. */
+#ifndef __returns_nonnull
+# if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__)
+# define __returns_nonnull __attribute__ ((__returns_nonnull__))
+# else
+# define __returns_nonnull
+# endif
+#endif
+
+/* If fortification mode, we warn about unused results of certain
+ function calls which can lead to problems. */
+#if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__)
+# define __attribute_warn_unused_result__ \
+ __attribute__ ((__warn_unused_result__))
+# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
+# define __wur __attribute_warn_unused_result__
+# endif
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+#ifndef __wur
+# define __wur /* Ignore */
+#endif
+
+/* Forces a function to be always inlined. */
+#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__)
+/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
+ it conflicts with this definition. Therefore undefine it first to
+ allow either header to be included first. */
+# undef __always_inline
+# define __always_inline __inline __attribute__ ((__always_inline__))
+#else
+# undef __always_inline
+# define __always_inline __inline
+#endif
+
+/* Associate error messages with the source location of the call site rather
+ than with the source location inside the function. */
+#if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__)
+# define __attribute_artificial__ __attribute__ ((__artificial__))
+#else
+# define __attribute_artificial__ /* Ignore */
+#endif
+
+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
+ or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
+ older than 4.3 may define these macros and still not guarantee GNU inlining
+ semantics.
+
+ clang++ identifies itself as gcc-4.2, but has support for GNU inlining
+ semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
+ __GNUC_GNU_INLINE__ macro definitions. */
+#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
+ || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
+ || defined __GNUC_GNU_INLINE__)))
+# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
+# define __extern_always_inline \
+ extern __always_inline __attribute__ ((__gnu_inline__))
+# else
+# define __extern_inline extern __inline
+# define __extern_always_inline extern __always_inline
+# endif
+#endif
+
+#ifdef __extern_always_inline
+# define __fortify_function __extern_always_inline __attribute_artificial__
+#endif
+
+/* GCC 4.3 and above allow passing all anonymous arguments of an
+ __extern_always_inline function to some other vararg function. */
+#if __GNUC_PREREQ (4,3)
+# define __va_arg_pack() __builtin_va_arg_pack ()
+# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
+#endif
+
+/* It is possible to compile containing GCC extensions even if GCC is
+ run in pedantic mode if the uses are carefully marked using the
+ `__extension__' keyword. But this is not generally available before
+ version 2.8. */
+#if !(__GNUC_PREREQ (2,8) || defined __clang__)
+# define __extension__ /* Ignore */
+#endif
+
+/* __restrict is known in EGCS 1.2 and above, and in clang.
+ It works also in C++ mode (outside of arrays), but only when spelled
+ as '__restrict', not 'restrict'. */
+#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3)
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __restrict restrict
+# else
+# define __restrict /* Ignore */
+# endif
+#endif
+
+/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
+ array_name[restrict]
+ GCC 3.1 and clang support this.
+ This syntax is not usable in C++ mode. */
+#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus
+# define __restrict_arr __restrict
+#else
+# ifdef __GNUC__
+# define __restrict_arr /* Not supported in old GCC. */
+# else
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __restrict_arr restrict
+# else
+/* Some other non-C99 compiler. */
+# define __restrict_arr /* Not supported. */
+# endif
+# endif
+#endif
+
+#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect)
+# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
+# define __glibc_likely(cond) __builtin_expect ((cond), 1)
+#else
+# define __glibc_unlikely(cond) (cond)
+# define __glibc_likely(cond) (cond)
+#endif
+
+#if (!defined _Noreturn \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && !(__GNUC_PREREQ (4,7) \
+ || (3 < __clang_major__ + (5 <= __clang_minor__))))
+# if __GNUC_PREREQ (2,8)
+# define _Noreturn __attribute__ ((__noreturn__))
+# else
+# define _Noreturn
+# endif
+#endif
+
+#if __GNUC_PREREQ (8, 0)
+/* Describes a char array whose address can safely be passed as the first
+ argument to strncpy and strncat, as the char array is not necessarily
+ a NUL-terminated string. */
+# define __attribute_nonstring__ __attribute__ ((__nonstring__))
+#else
+# define __attribute_nonstring__
+#endif
+
+/* Undefine (also defined in libc-symbols.h). */
+#undef __attribute_copy__
+#if __GNUC_PREREQ (9, 0)
+/* Copies attributes from the declaration or type referenced by
+ the argument. */
+# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
+#else
+# define __attribute_copy__(arg)
+#endif
+
+#if (!defined _Static_assert && !defined __cplusplus \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \
+ || defined __STRICT_ANSI__))
+# define _Static_assert(expr, diagnostic) \
+ extern int (*__Static_assert_function (void)) \
+ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
+#endif
+
+/* Gnulib avoids including these, as they don't work on non-glibc or
+ older glibc platforms. */
+#ifndef __GNULIB_CDEFS
+# include <bits/wordsize.h>
+# include <bits/long-double.h>
+#endif
+
+#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+# ifdef __REDIRECT
+
+/* Alias name defined automatically. */
+# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
+# define __LDBL_REDIR_DECL(name) \
+ extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
+
+/* Alias name defined automatically, with leading underscores. */
+# define __LDBL_REDIR2_DECL(name) \
+ extern __typeof (__##name) __##name \
+ __asm (__ASMNAME ("__" #name "ieee128"));
+
+/* Alias name defined manually. */
+# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1
+# define __LDBL_REDIR1_DECL(name, alias) \
+ extern __typeof (name) name __asm (__ASMNAME (#alias));
+
+# define __LDBL_REDIR1_NTH(name, proto, alias) \
+ __REDIRECT_NTH (name, proto, alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
+
+/* Unused. */
+# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
+# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
+
+# else
+_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
+# endif
+#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# define __LDBL_COMPAT 1
+# ifdef __REDIRECT
+# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+# define __LDBL_REDIR(name, proto) \
+ __LDBL_REDIR1 (name, proto, __nldbl_##name)
+# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
+# define __LDBL_REDIR_NTH(name, proto) \
+ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
+# define __LDBL_REDIR2_DECL(name) \
+ extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
+# define __LDBL_REDIR1_DECL(name, alias) \
+ extern __typeof (name) name __asm (__ASMNAME (#alias));
+# define __LDBL_REDIR_DECL(name) \
+ extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
+# define __REDIRECT_LDBL(name, proto, alias) \
+ __LDBL_REDIR1 (name, proto, __nldbl_##alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
+# endif
+#endif
+#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
+ || !defined __REDIRECT
+# define __LDBL_REDIR1(name, proto, alias) name proto
+# define __LDBL_REDIR(name, proto) name proto
+# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
+# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
+# define __LDBL_REDIR2_DECL(name)
+# define __LDBL_REDIR_DECL(name)
+# ifdef __REDIRECT
+# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
+# define __REDIRECT_NTH_LDBL(name, proto, alias) \
+ __REDIRECT_NTH (name, proto, alias)
+# endif
+#endif
+
+/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
+ intended for use in preprocessor macros.
+
+ Note: MESSAGE must be a _single_ string; concatenation of string
+ literals is not supported. */
+#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
+# define __glibc_macro_warning1(message) _Pragma (#message)
+# define __glibc_macro_warning(message) \
+ __glibc_macro_warning1 (GCC warning message)
+#else
+# define __glibc_macro_warning(msg)
+#endif
+
+/* Generic selection (ISO C11) is a C-only feature, available in GCC
+ since version 4.9. Previous versions do not provide generic
+ selection, even though they might set __STDC_VERSION__ to 201112L,
+ when in -std=c11 mode. Thus, we must check for !defined __GNUC__
+ when testing __STDC_VERSION__ for generic selection support.
+ On the other hand, Clang also defines __GNUC__, so a clang-specific
+ check is required to enable the use of generic selection. */
+#if !defined __cplusplus \
+ && (__GNUC_PREREQ (4, 9) \
+ || __glibc_has_extension (c_generic_selections) \
+ || (!defined __GNUC__ && defined __STDC_VERSION__ \
+ && __STDC_VERSION__ >= 201112L))
+# define __HAVE_GENERIC_SELECTION 1
+#else
+# define __HAVE_GENERIC_SELECTION 0
+#endif
+
+#if __GNUC_PREREQ (10, 0)
+/* Designates a 1-based positional argument ref-index of pointer type
+ that can be used to access size-index elements of the pointed-to
+ array according to access mode, or at least one element when
+ size-index is not provided:
+ access (access-mode, <ref-index> [, <size-index>]) */
+# define __attr_access(x) __attribute__ ((__access__ x))
+/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may
+ use the access attribute to get object sizes from function definition
+ arguments, so we can't use them on functions we fortify. Drop the object
+ size hints for such functions. */
+# if __USE_FORTIFY_LEVEL == 3
+# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o)))
+# else
+# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s))
+# endif
+# if __GNUC_PREREQ (11, 0)
+# define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno)))
+# else
+# define __attr_access_none(argno)
+# endif
+#else
+# define __fortified_attr_access(a, o, s)
+# define __attr_access(x)
+# define __attr_access_none(argno)
+#endif
+
+#if __GNUC_PREREQ (11, 0)
+/* Designates dealloc as a function to call to deallocate objects
+ allocated by the declared function. */
+# define __attr_dealloc(dealloc, argno) \
+ __attribute__ ((__malloc__ (dealloc, argno)))
+# define __attr_dealloc_free __attr_dealloc (__builtin_free, 1)
+#else
+# define __attr_dealloc(dealloc, argno)
+# define __attr_dealloc_free
+#endif
+
+/* Specify that a function such as setjmp or vfork may return
+ twice. */
+#if __GNUC_PREREQ (4, 1)
+# define __attribute_returns_twice__ __attribute__ ((__returns_twice__))
+#else
+# define __attribute_returns_twice__ /* Ignore. */
+#endif
+
+#endif /* sys/cdefs.h */
diff --git a/gl/cloexec.c b/gl/cloexec.c
new file mode 100644
index 0000000..e4cecbd
--- /dev/null
+++ b/gl/cloexec.c
@@ -0,0 +1,83 @@
+/* cloexec.c - set or clear the close-on-exec descriptor flag
+
+ Copyright (C) 1991, 2004-2006, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* The code is taken from glibc/manual/llio.texi */
+
+#include <config.h>
+
+#include "cloexec.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
+ or clear the flag if VALUE is false.
+ Return 0 on success, or -1 on error with 'errno' set.
+
+ Note that on MingW, this function does NOT protect DESC from being
+ inherited into spawned children. Instead, either use dup_cloexec
+ followed by closing the original DESC, or use interfaces such as
+ open or pipe2 that accept flags like O_CLOEXEC to create DESC
+ non-inheritable in the first place. */
+
+int
+set_cloexec_flag (int desc, bool value)
+{
+#ifdef F_SETFD
+
+ int flags = fcntl (desc, F_GETFD, 0);
+
+ if (0 <= flags)
+ {
+ int newflags = (value ? flags | FD_CLOEXEC : flags & ~FD_CLOEXEC);
+
+ if (flags == newflags
+ || fcntl (desc, F_SETFD, newflags) != -1)
+ return 0;
+ }
+
+ return -1;
+
+#else /* !F_SETFD */
+
+ /* Use dup2 to reject invalid file descriptors; the cloexec flag
+ will be unaffected. */
+ if (desc < 0)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ if (dup2 (desc, desc) < 0)
+ /* errno is EBADF here. */
+ return -1;
+
+ /* There is nothing we can do on this kind of platform. Punt. */
+ return 0;
+#endif /* !F_SETFD */
+}
+
+
+/* Duplicates a file handle FD, while marking the copy to be closed
+ prior to exec or spawn. Returns -1 and sets errno if FD could not
+ be duplicated. */
+
+int
+dup_cloexec (int fd)
+{
+ return fcntl (fd, F_DUPFD_CLOEXEC, 0);
+}
diff --git a/gl/cloexec.h b/gl/cloexec.h
new file mode 100644
index 0000000..057fd66
--- /dev/null
+++ b/gl/cloexec.h
@@ -0,0 +1,34 @@
+/* cloexec.c - set or clear the close-on-exec descriptor flag
+
+ Copyright (C) 2004, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
+ or clear the flag if VALUE is false.
+ Return 0 on success, or -1 on error with 'errno' set.
+
+ Note that on MingW, this function does NOT protect DESC from being
+ inherited into spawned children. Instead, either use dup_cloexec
+ followed by closing the original DESC, or use interfaces such as
+ open or pipe2 that accept flags like O_CLOEXEC to create DESC
+ non-inheritable in the first place. */
+
+int set_cloexec_flag (int desc, bool value);
+
+/* Duplicates a file handle FD, while marking the copy to be closed
+ prior to exec or spawn. Returns -1 and sets errno if FD could not
+ be duplicated. */
+
+int dup_cloexec (int fd);
diff --git a/gl/close.c b/gl/close.c
new file mode 100644
index 0000000..3c1b09e
--- /dev/null
+++ b/gl/close.c
@@ -0,0 +1,75 @@
+/* close replacement.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+
+#include "fd-hook.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#undef close
+
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+close_nothrow (int fd)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _close (fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ errno = EBADF;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define close_nothrow _close
+# endif
+#else
+# define close_nothrow close
+#endif
+
+/* Override close() to call into other gnulib modules. */
+
+int
+rpl_close (int fd)
+{
+#if WINDOWS_SOCKETS
+ int retval = execute_all_close_hooks (close_nothrow, fd);
+#else
+ int retval = close_nothrow (fd);
+#endif
+
+#if REPLACE_FCHDIR
+ if (retval >= 0)
+ _gl_unregister_fd (fd);
+#endif
+
+ return retval;
+}
diff --git a/gl/dirname-lgpl.c b/gl/dirname-lgpl.c
new file mode 100644
index 0000000..e9454af
--- /dev/null
+++ b/gl/dirname-lgpl.c
@@ -0,0 +1,86 @@
+/* dirname.c -- return all but the last element in a file name
+
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/* Return the length of the prefix of FILE that will be used by
+ dir_name. If FILE is in the working directory, this returns zero
+ even though 'dir_name (FILE)' will return ".". Works properly even
+ if there are trailing slashes (by effectively ignoring them). */
+
+size_t
+dir_len (char const *file)
+{
+ size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
+ size_t length;
+
+ /* Advance prefix_length beyond important leading slashes. */
+ prefix_length += (prefix_length != 0
+ ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ && ISSLASH (file[prefix_length]))
+ : (ISSLASH (file[0])
+ ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
+ && ISSLASH (file[1]) && ! ISSLASH (file[2])
+ ? 2 : 1))
+ : 0));
+
+ /* Strip the basename and any redundant slashes before it. */
+ for (length = last_component (file) - file;
+ prefix_length < length; length--)
+ if (! ISSLASH (file[length - 1]))
+ break;
+ return length;
+}
+
+
+/* In general, we can't use the builtin 'dirname' function if available,
+ since it has different meanings in different environments.
+ In some environments the builtin 'dirname' modifies its argument.
+
+ Return the leading directories part of FILE, allocated with malloc.
+ Works properly even if there are trailing slashes (by effectively
+ ignoring them). Return NULL on failure.
+
+ If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
+ lstat (base_name (FILE)); } will access the same file. Likewise,
+ if the sequence { chdir (dir_name (FILE));
+ rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
+ to "foo" in the same directory FILE was in. */
+
+char *
+mdir_name (char const *file)
+{
+ size_t length = dir_len (file);
+ bool append_dot = (length == 0
+ || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ && length == FILE_SYSTEM_PREFIX_LEN (file)
+ && file[2] != '\0' && ! ISSLASH (file[2])));
+ char *dir = malloc (length + append_dot + 1);
+ if (!dir)
+ return NULL;
+ memcpy (dir, file, length);
+ if (append_dot)
+ dir[length++] = '.';
+ dir[length] = '\0';
+ return dir;
+}
diff --git a/gl/dirname.c b/gl/dirname.c
new file mode 100644
index 0000000..e72f713
--- /dev/null
+++ b/gl/dirname.c
@@ -0,0 +1,38 @@
+/* dirname.c -- return all but the last element in a file name
+
+ Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include "xalloc.h"
+
+/* Just like mdir_name (dirname-lgpl.c), except, rather than
+ returning NULL upon malloc failure, here, we report the
+ "memory exhausted" condition and exit. */
+
+char *
+dir_name (char const *file)
+{
+ char *result = mdir_name (file);
+ if (!result)
+ xalloc_die ();
+ return result;
+}
diff --git a/gl/dirname.h b/gl/dirname.h
new file mode 100644
index 0000000..f98e83b
--- /dev/null
+++ b/gl/dirname.h
@@ -0,0 +1,53 @@
+/* Take file names apart into directory and base names.
+
+ Copyright (C) 1998, 2001, 2003-2006, 2009-2023 Free Software Foundation,
+ Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef DIRNAME_H_
+# define DIRNAME_H_ 1
+
+# include <stdlib.h>
+# include "filename.h"
+# include "basename-lgpl.h"
+
+# ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if GNULIB_DIRNAME
+char *base_name (char const *file)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+char *dir_name (char const *file)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+# endif
+
+char *mdir_name (char const *file)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
+
+bool strip_trailing_slashes (char *file);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* not DIRNAME_H_ */
diff --git a/gl/dup2.c b/gl/dup2.c
new file mode 100644
index 0000000..7d197ca
--- /dev/null
+++ b/gl/dup2.c
@@ -0,0 +1,189 @@
+/* Duplicate an open file descriptor to a specified file descriptor.
+
+ Copyright (C) 1999, 2004-2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#include <errno.h>
+#include <fcntl.h>
+
+#undef dup2
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+# endif
+
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+dup2_nothrow (int fd, int desired_fd)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _dup2 (fd, desired_fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ errno = EBADF;
+ result = -1;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define dup2_nothrow _dup2
+# endif
+
+static int
+ms_windows_dup2 (int fd, int desired_fd)
+{
+ int result;
+
+ /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open,
+ dup2 (fd, fd) returns 0, but all further attempts to use fd in
+ future dup2 calls will hang. */
+ if (fd == desired_fd)
+ {
+ if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ return fd;
+ }
+
+ /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
+ https://bugs.winehq.org/show_bug.cgi?id=21289 */
+ if (desired_fd < 0)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ result = dup2_nothrow (fd, desired_fd);
+
+ if (result == 0)
+ result = desired_fd;
+
+ return result;
+}
+
+# define dup2 ms_windows_dup2
+
+#elif defined __KLIBC__
+
+# include <InnoTekLIBC/backend.h>
+
+static int
+klibc_dup2dirfd (int fd, int desired_fd)
+{
+ int tempfd;
+ int dupfd;
+
+ tempfd = open ("NUL", O_RDONLY);
+ if (tempfd == -1)
+ return -1;
+
+ if (tempfd == desired_fd)
+ {
+ close (tempfd);
+
+ char path[_MAX_PATH];
+ if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
+ return -1;
+
+ return open(path, O_RDONLY);
+ }
+
+ dupfd = klibc_dup2dirfd (fd, desired_fd);
+
+ close (tempfd);
+
+ return dupfd;
+}
+
+static int
+klibc_dup2 (int fd, int desired_fd)
+{
+ int dupfd;
+ struct stat sbuf;
+
+ dupfd = dup2 (fd, desired_fd);
+ if (dupfd == -1 && errno == ENOTSUP \
+ && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+ {
+ close (desired_fd);
+
+ return klibc_dup2dirfd (fd, desired_fd);
+ }
+
+ return dupfd;
+}
+
+# define dup2 klibc_dup2
+#endif
+
+int
+rpl_dup2 (int fd, int desired_fd)
+{
+ int result;
+
+#ifdef F_GETFL
+ /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
+ On Cygwin 1.5.x, dup2 (1, 1) returns 0.
+ On Cygwin 1.7.17, dup2 (1, -1) dumps core.
+ On Cygwin 1.7.25, dup2 (1, 256) can dump core.
+ On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */
+# if HAVE_SETDTABLESIZE
+ setdtablesize (desired_fd + 1);
+# endif
+ if (desired_fd < 0)
+ fd = desired_fd;
+ if (fd == desired_fd)
+ return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
+#endif
+
+ result = dup2 (fd, desired_fd);
+
+ /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x. */
+ if (result == -1 && errno == EMFILE)
+ errno = EBADF;
+#if REPLACE_FCHDIR
+ if (fd != desired_fd && result != -1)
+ result = _gl_register_dup (fd, result);
+#endif
+ return result;
+}
diff --git a/gl/dynarray.h b/gl/dynarray.h
new file mode 100644
index 0000000..9155910
--- /dev/null
+++ b/gl/dynarray.h
@@ -0,0 +1,284 @@
+/* Type-safe arrays which grow dynamically.
+ Copyright 2021-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert and Bruno Haible, 2021. */
+
+#ifndef _GL_DYNARRAY_H
+#define _GL_DYNARRAY_H
+
+/* Before including this file, you need to define:
+
+ DYNARRAY_STRUCT
+ The struct tag of dynamic array to be defined.
+
+ DYNARRAY_ELEMENT
+ The type name of the element type. Elements are copied
+ as if by memcpy, and can change address as the dynamic
+ array grows.
+
+ DYNARRAY_PREFIX
+ The prefix of the functions which are defined.
+
+ The following parameters are optional:
+
+ DYNARRAY_ELEMENT_FREE
+ DYNARRAY_ELEMENT_FREE (E) is evaluated to deallocate the
+ contents of elements. E is of type DYNARRAY_ELEMENT *.
+
+ DYNARRAY_ELEMENT_INIT
+ DYNARRAY_ELEMENT_INIT (E) is evaluated to initialize a new
+ element. E is of type DYNARRAY_ELEMENT *.
+ If DYNARRAY_ELEMENT_FREE but not DYNARRAY_ELEMENT_INIT is
+ defined, new elements are automatically zero-initialized.
+ Otherwise, new elements have undefined contents.
+
+ DYNARRAY_INITIAL_SIZE
+ The size of the statically allocated array (default:
+ at least 2, more elements if they fit into 128 bytes).
+ Must be a preprocessor constant. If DYNARRAY_INITIAL_SIZE is 0,
+ there is no statically allocated array at, and all non-empty
+ arrays are heap-allocated.
+
+ DYNARRAY_FINAL_TYPE
+ The name of the type which holds the final array. If not
+ defined, is PREFIX##finalize not provided. DYNARRAY_FINAL_TYPE
+ must be a struct type, with members of type DYNARRAY_ELEMENT and
+ size_t at the start (in this order).
+
+ These macros are undefined after this header file has been
+ included.
+
+ The following types are provided (their members are private to the
+ dynarray implementation):
+
+ struct DYNARRAY_STRUCT
+
+ The following functions are provided:
+ */
+
+/* Initialize a dynamic array object. This must be called before any
+ use of the object. */
+#if 0
+static void
+ DYNARRAY_PREFIX##init (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Deallocate the dynamic array and its elements. */
+#if 0
+static void
+ DYNARRAY_PREFIX##free (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return true if the dynamic array is in an error state. */
+#if 0
+static bool
+ DYNARRAY_PREFIX##has_failed (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Mark the dynamic array as failed. All elements are deallocated as
+ a side effect. */
+#if 0
+static void
+ DYNARRAY_PREFIX##mark_failed (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return the number of elements which have been added to the dynamic
+ array. */
+#if 0
+static size_t
+ DYNARRAY_PREFIX##size (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the first array element, if any. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##begin (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer one element past the last array element. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##end (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the array element at INDEX. Terminate the
+ process if INDEX is out of bounds. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##at (struct DYNARRAY_STRUCT *list, size_t index);
+#endif
+
+/* Add ITEM at the end of the array, enlarging it by one element.
+ Mark *LIST as failed if the dynamic array allocation size cannot be
+ increased. */
+#if 0
+static void
+ DYNARRAY_PREFIX##add (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_ELEMENT item);
+#endif
+
+/* Allocate a place for a new element in *LIST and return a pointer to
+ it. The pointer can be NULL if the dynamic array cannot be
+ enlarged due to a memory allocation failure. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##emplace (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Change the size of *LIST to SIZE. If SIZE is larger than the
+ existing size, new elements are added (which can be initialized).
+ Otherwise, the list is truncated, and elements are freed. Return
+ false on memory allocation failure (and mark *LIST as failed). */
+#if 0
+static bool
+ DYNARRAY_PREFIX##resize (struct DYNARRAY_STRUCT *list, size_t size);
+#endif
+
+/* Remove the last element of LIST if it is present. */
+#if 0
+static void
+ DYNARRAY_PREFIX##remove_last (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Remove all elements from the list. The elements are freed, but the
+ list itself is not. */
+#if 0
+static void
+ DYNARRAY_PREFIX##clear (struct DYNARRAY_STRUCT *list);
+#endif
+
+#if defined DYNARRAY_FINAL_TYPE
+/* Transfer the dynamic array to a permanent location at *RESULT.
+ Returns true on success on false on allocation failure. In either
+ case, *LIST is re-initialized and can be reused. A NULL pointer is
+ stored in *RESULT if LIST refers to an empty list. On success, the
+ pointer in *RESULT is heap-allocated and must be deallocated using
+ free. */
+#if 0
+static bool
+ DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_FINAL_TYPE *result);
+#endif
+#else /* !defined DYNARRAY_FINAL_TYPE */
+/* Transfer the dynamic array to a heap-allocated array and return a
+ pointer to it. The pointer is NULL if memory allocation fails, or
+ if the array is empty, so this function should be used only for
+ arrays which are known not be empty (usually because they always
+ have a sentinel at the end). If LENGTHP is not NULL, the array
+ length is written to *LENGTHP. *LIST is re-initialized and can be
+ reused. */
+#if 0
+static DYNARRAY_ELEMENT *
+ DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+ size_t *lengthp);
+#endif
+#endif
+
+/* A minimal example which provides a growing list of integers can be
+ defined like this:
+
+ struct int_array
+ {
+ // Pointer to result array followed by its length,
+ // as required by DYNARRAY_FINAL_TYPE.
+ int *array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_int
+ #define DYNARRAY_ELEMENT int
+ #define DYNARRAY_PREFIX dynarray_int_
+ #define DYNARRAY_FINAL_TYPE struct int_array
+ #include <malloc/dynarray-skeleton.c>
+
+ To create a three-element array with elements 1, 2, 3, use this
+ code:
+
+ struct dynarray_int dyn;
+ dynarray_int_init (&dyn);
+ for (int i = 1; i <= 3; ++i)
+ {
+ int *place = dynarray_int_emplace (&dyn);
+ assert (place != NULL);
+ *place = i;
+ }
+ struct int_array result;
+ bool ok = dynarray_int_finalize (&dyn, &result);
+ assert (ok);
+ assert (result.length == 3);
+ assert (result.array[0] == 1);
+ assert (result.array[1] == 2);
+ assert (result.array[2] == 3);
+ free (result.array);
+
+ If the elements contain resources which must be freed, define
+ DYNARRAY_ELEMENT_FREE appropriately, like this:
+
+ struct str_array
+ {
+ char **array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_str
+ #define DYNARRAY_ELEMENT char *
+ #define DYNARRAY_ELEMENT_FREE(ptr) free (*ptr)
+ #define DYNARRAY_PREFIX dynarray_str_
+ #define DYNARRAY_FINAL_TYPE struct str_array
+ #include <malloc/dynarray-skeleton.c>
+ */
+
+
+/* The implementation is imported from glibc. */
+
+/* Avoid possible conflicts with symbols exported by the GNU libc. */
+#define __libc_dynarray_at_failure gl_dynarray_at_failure
+#define __libc_dynarray_emplace_enlarge gl_dynarray_emplace_enlarge
+#define __libc_dynarray_finalize gl_dynarray_finalize
+#define __libc_dynarray_resize_clear gl_dynarray_resize_clear
+#define __libc_dynarray_resize gl_dynarray_resize
+
+#if defined DYNARRAY_STRUCT || defined DYNARRAY_ELEMENT || defined DYNARRAY_PREFIX
+
+# ifndef _GL_LIKELY
+/* Rely on __builtin_expect, as provided by the module 'builtin-expect'. */
+# define _GL_LIKELY(cond) __builtin_expect ((cond), 1)
+# define _GL_UNLIKELY(cond) __builtin_expect ((cond), 0)
+# endif
+
+/* Define auxiliary structs and declare auxiliary functions, common to all
+ instantiations of dynarray. */
+# include <malloc/dynarray.gl.h>
+
+/* Define the instantiation, specified through
+ DYNARRAY_STRUCT
+ DYNARRAY_ELEMENT
+ DYNARRAY_PREFIX
+ etc. */
+# include <malloc/dynarray-skeleton.gl.h>
+
+#else
+
+/* This file is being included from one of the malloc/dynarray_*.c files. */
+# include <malloc/dynarray.h>
+
+#endif
+
+#endif /* _GL_DYNARRAY_H */
diff --git a/gl/errno.in.h b/gl/errno.in.h
new file mode 100644
index 0000000..3dda9c2
--- /dev/null
+++ b/gl/errno.in.h
@@ -0,0 +1,279 @@
+/* A POSIX-like <errno.h>.
+
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
+
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+#define _@GUARD_PREFIX@_ERRNO_H
+
+
+/* On native Windows platforms, many macros are not defined. */
+# if defined _WIN32 && ! defined __CYGWIN__
+
+/* These are the same values as defined by MSVC 10, for interoperability. */
+
+# ifndef ENOMSG
+# define ENOMSG 122
+# define GNULIB_defined_ENOMSG 1
+# endif
+
+# ifndef EIDRM
+# define EIDRM 111
+# define GNULIB_defined_EIDRM 1
+# endif
+
+# ifndef ENOLINK
+# define ENOLINK 121
+# define GNULIB_defined_ENOLINK 1
+# endif
+
+# ifndef EPROTO
+# define EPROTO 134
+# define GNULIB_defined_EPROTO 1
+# endif
+
+# ifndef EBADMSG
+# define EBADMSG 104
+# define GNULIB_defined_EBADMSG 1
+# endif
+
+# ifndef EOVERFLOW
+# define EOVERFLOW 132
+# define GNULIB_defined_EOVERFLOW 1
+# endif
+
+# ifndef ENOTSUP
+# define ENOTSUP 129
+# define GNULIB_defined_ENOTSUP 1
+# endif
+
+# ifndef ENETRESET
+# define ENETRESET 117
+# define GNULIB_defined_ENETRESET 1
+# endif
+
+# ifndef ECONNABORTED
+# define ECONNABORTED 106
+# define GNULIB_defined_ECONNABORTED 1
+# endif
+
+# ifndef ECANCELED
+# define ECANCELED 105
+# define GNULIB_defined_ECANCELED 1
+# endif
+
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 133
+# define GNULIB_defined_EOWNERDEAD 1
+# endif
+
+# ifndef ENOTRECOVERABLE
+# define ENOTRECOVERABLE 127
+# define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
+
+# ifndef EINPROGRESS
+# define EINPROGRESS 112
+# define EALREADY 103
+# define ENOTSOCK 128
+# define EDESTADDRREQ 109
+# define EMSGSIZE 115
+# define EPROTOTYPE 136
+# define ENOPROTOOPT 123
+# define EPROTONOSUPPORT 135
+# define EOPNOTSUPP 130
+# define EAFNOSUPPORT 102
+# define EADDRINUSE 100
+# define EADDRNOTAVAIL 101
+# define ENETDOWN 116
+# define ENETUNREACH 118
+# define ECONNRESET 108
+# define ENOBUFS 119
+# define EISCONN 113
+# define ENOTCONN 126
+# define ETIMEDOUT 138
+# define ECONNREFUSED 107
+# define ELOOP 114
+# define EHOSTUNREACH 110
+# define EWOULDBLOCK 140
+# define GNULIB_defined_ESOCK 1
+# endif
+
+# ifndef ETXTBSY
+# define ETXTBSY 139
+# define ENODATA 120 /* not required by POSIX */
+# define ENOSR 124 /* not required by POSIX */
+# define ENOSTR 125 /* not required by POSIX */
+# define ETIME 137 /* not required by POSIX */
+# define EOTHER 131 /* not required by POSIX */
+# define GNULIB_defined_ESTREAMS 1
+# endif
+
+/* These are intentionally the same values as the WSA* error numbers, defined
+ in <winsock2.h>. */
+# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
+# define EPFNOSUPPORT 10046 /* not required by POSIX */
+# define ESHUTDOWN 10058 /* not required by POSIX */
+# define ETOOMANYREFS 10059 /* not required by POSIX */
+# define EHOSTDOWN 10064 /* not required by POSIX */
+# define EPROCLIM 10067 /* not required by POSIX */
+# define EUSERS 10068 /* not required by POSIX */
+# define EDQUOT 10069
+# define ESTALE 10070
+# define EREMOTE 10071 /* not required by POSIX */
+# define GNULIB_defined_EWINSOCK 1
+
+# endif
+
+
+/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
+ EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
+# if @EMULTIHOP_HIDDEN@
+# define EMULTIHOP @EMULTIHOP_VALUE@
+# define GNULIB_defined_EMULTIHOP 1
+# endif
+# if @ENOLINK_HIDDEN@
+# define ENOLINK @ENOLINK_VALUE@
+# define GNULIB_defined_ENOLINK 1
+# endif
+# if @EOVERFLOW_HIDDEN@
+# define EOVERFLOW @EOVERFLOW_VALUE@
+# define GNULIB_defined_EOVERFLOW 1
+# endif
+
+
+/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
+ EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
+ Likewise, on NonStop Kernel, EDQUOT is not defined.
+ Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
+ HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
+
+ Note: When one of these systems defines some of these macros some day,
+ binaries will have to be recompiled so that they recognizes the new
+ errno values from the system. */
+
+# ifndef ENOMSG
+# define ENOMSG 2000
+# define GNULIB_defined_ENOMSG 1
+# endif
+
+# ifndef EIDRM
+# define EIDRM 2001
+# define GNULIB_defined_EIDRM 1
+# endif
+
+# ifndef ENOLINK
+# define ENOLINK 2002
+# define GNULIB_defined_ENOLINK 1
+# endif
+
+# ifndef EPROTO
+# define EPROTO 2003
+# define GNULIB_defined_EPROTO 1
+# endif
+
+# ifndef EMULTIHOP
+# define EMULTIHOP 2004
+# define GNULIB_defined_EMULTIHOP 1
+# endif
+
+# ifndef EBADMSG
+# define EBADMSG 2005
+# define GNULIB_defined_EBADMSG 1
+# endif
+
+# ifndef EOVERFLOW
+# define EOVERFLOW 2006
+# define GNULIB_defined_EOVERFLOW 1
+# endif
+
+# ifndef ENOTSUP
+# define ENOTSUP 2007
+# define GNULIB_defined_ENOTSUP 1
+# endif
+
+# ifndef ENETRESET
+# define ENETRESET 2011
+# define GNULIB_defined_ENETRESET 1
+# endif
+
+# ifndef ECONNABORTED
+# define ECONNABORTED 2012
+# define GNULIB_defined_ECONNABORTED 1
+# endif
+
+# ifndef ESTALE
+# define ESTALE 2009
+# define GNULIB_defined_ESTALE 1
+# endif
+
+# ifndef EDQUOT
+# define EDQUOT 2010
+# define GNULIB_defined_EDQUOT 1
+# endif
+
+# ifndef ECANCELED
+# define ECANCELED 2008
+# define GNULIB_defined_ECANCELED 1
+# endif
+
+/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
+ defined. */
+
+# ifndef EOWNERDEAD
+# if defined __sun
+ /* Use the same values as defined for Solaris >= 8, for
+ interoperability. */
+# define EOWNERDEAD 58
+# define ENOTRECOVERABLE 59
+# elif defined _WIN32 && ! defined __CYGWIN__
+ /* We have a conflict here: pthreads-win32 defines these values
+ differently than MSVC 10. It's hairy to decide which one to use. */
+# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
+ /* Use the same values as defined by pthreads-win32, for
+ interoperability. */
+# define EOWNERDEAD 43
+# define ENOTRECOVERABLE 44
+# else
+ /* Use the same values as defined by MSVC 10, for
+ interoperability. */
+# define EOWNERDEAD 133
+# define ENOTRECOVERABLE 127
+# endif
+# else
+# define EOWNERDEAD 2013
+# define ENOTRECOVERABLE 2014
+# endif
+# define GNULIB_defined_EOWNERDEAD 1
+# define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
+
+# ifndef EILSEQ
+# define EILSEQ 2015
+# define GNULIB_defined_EILSEQ 1
+# endif
+
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
diff --git a/gl/error.c b/gl/error.c
new file mode 100644
index 0000000..6875f13
--- /dev/null
+++ b/gl/error.c
@@ -0,0 +1,411 @@
+/* Error handler for noninteractive utilities
+ Copyright (C) 1990-1998, 2000-2007, 2009-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#if !_LIBC
+# include <config.h>
+#endif
+
+#include "error.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if !_LIBC && ENABLE_NLS
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+# include <stdbool.h>
+# include <stdint.h>
+# include <wchar.h>
+# define mbsrtowcs __mbsrtowcs
+# define USE_UNLOCKED_IO 0
+# define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(a, b)
+# define _GL_ARG_NONNULL(a)
+#else
+# include "getprogname.h"
+#endif
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+#ifndef _
+# define _(String) String
+#endif
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+void (*error_print_progname) (void);
+
+/* This variable is incremented each time 'error' is called. */
+unsigned int error_message_count;
+
+#ifdef _LIBC
+/* In the GNU C library, there is a predefined variable for this. */
+
+# define program_name program_invocation_name
+# include <errno.h>
+# include <limits.h>
+# include <libio/libioP.h>
+
+/* In GNU libc we want do not want to use the common name 'error' directly.
+ Instead make it a weak alias. */
+extern void __error (int status, int errnum, const char *message, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+extern void __error_at_line (int status, int errnum, const char *file_name,
+ unsigned int line_number, const char *message,
+ ...)
+ __attribute__ ((__format__ (__printf__, 5, 6)));
+# define error __error
+# define error_at_line __error_at_line
+
+# include <libio/iolibio.h>
+# define fflush(s) _IO_fflush (s)
+# undef putc
+# define putc(c, fp) _IO_putc (c, fp)
+
+# include <bits/libc-lock.h>
+
+#else /* not _LIBC */
+
+# include <fcntl.h>
+# include <unistd.h>
+
+# if defined _WIN32 && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+# endif
+
+/* The gnulib override of fcntl is not needed in this file. */
+# undef fcntl
+
+# if !(GNULIB_STRERROR_R_POSIX || HAVE_DECL_STRERROR_R)
+# ifndef HAVE_DECL_STRERROR_R
+"this configure-time declaration test was not run"
+# endif
+# if STRERROR_R_CHAR_P
+char *strerror_r (int errnum, char *buf, size_t buflen);
+# else
+int strerror_r (int errnum, char *buf, size_t buflen);
+# endif
+# endif
+
+# define program_name getprogname ()
+
+# if GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r
+# define __strerror_r strerror_r
+# endif /* GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r */
+#endif /* not _LIBC */
+
+#if !_LIBC
+/* Return non-zero if FD is open. */
+static int
+is_open (int fd)
+{
+# if defined _WIN32 && ! defined __CYGWIN__
+ /* On native Windows: The initial state of unassigned standard file
+ descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
+ There is no fcntl, and the gnulib replacement fcntl does not support
+ F_GETFL. */
+ return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+# else
+# ifndef F_GETFL
+# error Please port fcntl to your platform
+# endif
+ return 0 <= fcntl (fd, F_GETFL);
+# endif
+}
+#endif
+
+static void
+flush_stdout (void)
+{
+#if !_LIBC
+ int stdout_fd;
+
+# if GNULIB_FREOPEN_SAFER
+ /* Use of gnulib's freopen-safer module normally ensures that
+ fileno (stdout) == 1
+ whenever stdout is open. */
+ stdout_fd = STDOUT_FILENO;
+# else
+ /* POSIX states that fileno (stdout) after fclose is unspecified. But in
+ practice it is not a problem, because stdout is statically allocated and
+ the fd of a FILE stream is stored as a field in its allocated memory. */
+ stdout_fd = fileno (stdout);
+# endif
+ /* POSIX states that fflush (stdout) after fclose is unspecified; it
+ is safe in glibc, but not on all other platforms. fflush (NULL)
+ is always defined, but too draconian. */
+ if (0 <= stdout_fd && is_open (stdout_fd))
+#endif
+ fflush (stdout);
+}
+
+static void
+print_errno_message (int errnum)
+{
+ char const *s;
+
+#if _LIBC || GNULIB_STRERROR_R_POSIX || defined HAVE_STRERROR_R
+ char errbuf[1024];
+# if _LIBC || (!GNULIB_STRERROR_R_POSIX && STRERROR_R_CHAR_P)
+ s = __strerror_r (errnum, errbuf, sizeof errbuf);
+# else
+ if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
+ s = errbuf;
+ else
+ s = 0;
+# endif
+#else
+ s = strerror (errnum);
+#endif
+
+#if !_LIBC
+ if (! s)
+ s = _("Unknown system error");
+#endif
+
+#if _LIBC
+ __fxprintf (NULL, ": %s", s);
+#else
+ fprintf (stderr, ": %s", s);
+#endif
+}
+
+static void _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))
+error_tail (int status, int errnum, const char *message, va_list args)
+{
+#if _LIBC
+ if (_IO_fwide (stderr, 0) > 0)
+ {
+ size_t len = strlen (message) + 1;
+ wchar_t *wmessage = NULL;
+ mbstate_t st;
+ size_t res;
+ const char *tmp;
+ bool use_malloc = false;
+
+ while (1)
+ {
+ if (__libc_use_alloca (len * sizeof (wchar_t)))
+ wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
+ else
+ {
+ if (!use_malloc)
+ wmessage = NULL;
+
+ wchar_t *p = (wchar_t *) realloc (wmessage,
+ len * sizeof (wchar_t));
+ if (p == NULL)
+ {
+ free (wmessage);
+ fputws_unlocked (L"out of memory\n", stderr);
+ return;
+ }
+ wmessage = p;
+ use_malloc = true;
+ }
+
+ memset (&st, '\0', sizeof (st));
+ tmp = message;
+
+ res = mbsrtowcs (wmessage, &tmp, len, &st);
+ if (res != len)
+ break;
+
+ if (__builtin_expect (len >= SIZE_MAX / sizeof (wchar_t) / 2, 0))
+ {
+ /* This really should not happen if everything is fine. */
+ res = (size_t) -1;
+ break;
+ }
+
+ len *= 2;
+ }
+
+ if (res == (size_t) -1)
+ {
+ /* The string cannot be converted. */
+ if (use_malloc)
+ {
+ free (wmessage);
+ use_malloc = false;
+ }
+ wmessage = (wchar_t *) L"???";
+ }
+
+ __vfwprintf (stderr, wmessage, args);
+
+ if (use_malloc)
+ free (wmessage);
+ }
+ else
+#endif
+ vfprintf (stderr, message, args);
+
+ ++error_message_count;
+ if (errnum)
+ print_errno_message (errnum);
+#if _LIBC
+ __fxprintf (NULL, "\n");
+#else
+ putc ('\n', stderr);
+#endif
+ fflush (stderr);
+ if (status)
+ exit (status);
+}
+
+
+/* Print the program name and error message MESSAGE, which is a printf-style
+ format string with optional args.
+ If ERRNUM is nonzero, print its corresponding system error message.
+ Exit with status STATUS if it is nonzero. */
+void
+error (int status, int errnum, const char *message, ...)
+{
+ va_list args;
+
+#if defined _LIBC && defined __libc_ptf_call
+ /* We do not want this call to be cut short by a thread
+ cancellation. Therefore disable cancellation for now. */
+ int state = PTHREAD_CANCEL_ENABLE;
+ __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
+ 0);
+#endif
+
+ flush_stdout ();
+#ifdef _LIBC
+ _IO_flockfile (stderr);
+#endif
+ if (error_print_progname)
+ (*error_print_progname) ();
+ else
+ {
+#if _LIBC
+ __fxprintf (NULL, "%s: ", program_name);
+#else
+ fprintf (stderr, "%s: ", program_name);
+#endif
+ }
+
+ va_start (args, message);
+ error_tail (status, errnum, message, args);
+ va_end (args);
+
+#ifdef _LIBC
+ _IO_funlockfile (stderr);
+# ifdef __libc_ptf_call
+ __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+# endif
+#endif
+}
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+int error_one_per_line;
+
+void
+error_at_line (int status, int errnum, const char *file_name,
+ unsigned int line_number, const char *message, ...)
+{
+ va_list args;
+
+ if (error_one_per_line)
+ {
+ static const char *old_file_name;
+ static unsigned int old_line_number;
+
+ if (old_line_number == line_number
+ && (file_name == old_file_name
+ || (old_file_name != NULL
+ && file_name != NULL
+ && strcmp (old_file_name, file_name) == 0)))
+
+ /* Simply return and print nothing. */
+ return;
+
+ old_file_name = file_name;
+ old_line_number = line_number;
+ }
+
+#if defined _LIBC && defined __libc_ptf_call
+ /* We do not want this call to be cut short by a thread
+ cancellation. Therefore disable cancellation for now. */
+ int state = PTHREAD_CANCEL_ENABLE;
+ __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
+ 0);
+#endif
+
+ flush_stdout ();
+#ifdef _LIBC
+ _IO_flockfile (stderr);
+#endif
+ if (error_print_progname)
+ (*error_print_progname) ();
+ else
+ {
+#if _LIBC
+ __fxprintf (NULL, "%s:", program_name);
+#else
+ fprintf (stderr, "%s:", program_name);
+#endif
+ }
+
+#if _LIBC
+ __fxprintf (NULL, file_name != NULL ? "%s:%u: " : " ",
+ file_name, line_number);
+#else
+ fprintf (stderr, file_name != NULL ? "%s:%u: " : " ",
+ file_name, line_number);
+#endif
+
+ va_start (args, message);
+ error_tail (status, errnum, message, args);
+ va_end (args);
+
+#ifdef _LIBC
+ _IO_funlockfile (stderr);
+# ifdef __libc_ptf_call
+ __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+# endif
+#endif
+}
+
+#ifdef _LIBC
+/* Make the weak alias. */
+# undef error
+# undef error_at_line
+weak_alias (__error, error)
+weak_alias (__error_at_line, error_at_line)
+#endif
diff --git a/gl/error.h b/gl/error.h
new file mode 100644
index 0000000..a240526
--- /dev/null
+++ b/gl/error.h
@@ -0,0 +1,66 @@
+/* Declaration for error-reporting function
+ Copyright (C) 1995-1997, 2003, 2006, 2008-2023 Free Software Foundation,
+ Inc.
+ This file is part of the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _ERROR_H
+#define _ERROR_H 1
+
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Print a message with 'fprintf (stderr, FORMAT, ...)';
+ if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
+ If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
+
+extern void error (int __status, int __errnum, const char *__format, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 3, 4))
+#endif
+ ;
+
+extern void error_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format, ...)
+#if GNULIB_VFPRINTF_POSIX
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 6))
+#else
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 5, 6))
+#endif
+ ;
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+extern void (*error_print_progname) (void);
+
+/* This variable is incremented each time 'error' is called. */
+extern unsigned int error_message_count;
+
+/* Sometimes we want to have at most one error per line. This
+ variable controls whether this mode is selected or not. */
+extern int error_one_per_line;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* error.h */
diff --git a/gl/exitfail.c b/gl/exitfail.c
new file mode 100644
index 0000000..d67a130
--- /dev/null
+++ b/gl/exitfail.c
@@ -0,0 +1,24 @@
+/* Failure exit status
+
+ Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "exitfail.h"
+
+#include <stdlib.h>
+
+int volatile exit_failure = EXIT_FAILURE;
diff --git a/gl/exitfail.h b/gl/exitfail.h
new file mode 100644
index 0000000..85a6af6
--- /dev/null
+++ b/gl/exitfail.h
@@ -0,0 +1,18 @@
+/* Failure exit status
+
+ Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+extern int volatile exit_failure;
diff --git a/gl/fcntl.c b/gl/fcntl.c
new file mode 100644
index 0000000..e220800
--- /dev/null
+++ b/gl/fcntl.c
@@ -0,0 +1,629 @@
+/* Provide file descriptor control.
+
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake <ebb9@byu.net>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <fcntl.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifdef __KLIBC__
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */
+# define OPEN_MAX_MAX 0x10000
+
+/* Duplicate OLDFD into the first available slot of at least NEWFD,
+ which must be positive, with FLAGS determining whether the duplicate
+ will be inheritable. */
+static int
+dupfd (int oldfd, int newfd, int flags)
+{
+ /* Mingw has no way to create an arbitrary fd. Iterate until all
+ file descriptors less than newfd are filled up. */
+ HANDLE curr_process = GetCurrentProcess ();
+ HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd);
+ unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT];
+ unsigned int fds_to_close_bound = 0;
+ int result;
+ BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE;
+ int mode;
+
+ if (newfd < 0 || getdtablesize () <= newfd)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ if (old_handle == INVALID_HANDLE_VALUE
+ || (mode = _setmode (oldfd, O_BINARY)) == -1)
+ {
+ /* oldfd is not open, or is an unassigned standard file
+ descriptor. */
+ errno = EBADF;
+ return -1;
+ }
+ _setmode (oldfd, mode);
+ flags |= mode;
+
+ for (;;)
+ {
+ HANDLE new_handle;
+ int duplicated_fd;
+ unsigned int index;
+
+ if (!DuplicateHandle (curr_process, /* SourceProcessHandle */
+ old_handle, /* SourceHandle */
+ curr_process, /* TargetProcessHandle */
+ (PHANDLE) &new_handle, /* TargetHandle */
+ (DWORD) 0, /* DesiredAccess */
+ inherit, /* InheritHandle */
+ DUPLICATE_SAME_ACCESS)) /* Options */
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_TOO_MANY_OPEN_FILES:
+ errno = EMFILE;
+ break;
+ case ERROR_INVALID_HANDLE:
+ case ERROR_INVALID_TARGET_HANDLE:
+ case ERROR_DIRECT_ACCESS_HANDLE:
+ errno = EBADF;
+ break;
+ case ERROR_INVALID_PARAMETER:
+ case ERROR_INVALID_FUNCTION:
+ case ERROR_INVALID_ACCESS:
+ errno = EINVAL;
+ break;
+ default:
+ errno = EACCES;
+ break;
+ }
+ result = -1;
+ break;
+ }
+ duplicated_fd = _open_osfhandle ((intptr_t) new_handle, flags);
+ if (duplicated_fd < 0)
+ {
+ CloseHandle (new_handle);
+ result = -1;
+ break;
+ }
+ if (newfd <= duplicated_fd)
+ {
+ result = duplicated_fd;
+ break;
+ }
+
+ /* Set the bit duplicated_fd in fds_to_close[]. */
+ index = (unsigned int) duplicated_fd / CHAR_BIT;
+ if (fds_to_close_bound <= index)
+ {
+ if (sizeof fds_to_close <= index)
+ /* Need to increase OPEN_MAX_MAX. */
+ abort ();
+ memset (fds_to_close + fds_to_close_bound, '\0',
+ index + 1 - fds_to_close_bound);
+ fds_to_close_bound = index + 1;
+ }
+ fds_to_close[index] |= 1 << ((unsigned int) duplicated_fd % CHAR_BIT);
+ }
+
+ /* Close the previous fds that turned out to be too small. */
+ {
+ int saved_errno = errno;
+ unsigned int duplicated_fd;
+
+ for (duplicated_fd = 0;
+ duplicated_fd < fds_to_close_bound * CHAR_BIT;
+ duplicated_fd++)
+ if ((fds_to_close[duplicated_fd / CHAR_BIT]
+ >> (duplicated_fd % CHAR_BIT))
+ & 1)
+ close (duplicated_fd);
+
+ errno = saved_errno;
+ }
+
+# if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (oldfd, result);
+# endif
+ return result;
+}
+#endif /* W32 */
+
+/* Forward declarations, because we '#undef fcntl' in the middle of this
+ compilation unit. */
+/* Our implementation of fcntl (fd, F_DUPFD, target). */
+static int rpl_fcntl_DUPFD (int fd, int target);
+/* Our implementation of fcntl (fd, F_DUPFD_CLOEXEC, target). */
+static int rpl_fcntl_DUPFD_CLOEXEC (int fd, int target);
+#ifdef __KLIBC__
+/* Adds support for fcntl on directories. */
+static int klibc_fcntl (int fd, int action, /* arg */...);
+#endif
+
+
+/* Perform the specified ACTION on the file descriptor FD, possibly
+ using the argument ARG further described below. This replacement
+ handles the following actions, and forwards all others on to the
+ native fcntl. An unrecognized ACTION returns -1 with errno set to
+ EINVAL.
+
+ F_DUPFD - duplicate FD, with int ARG being the minimum target fd.
+ If successful, return the duplicate, which will be inheritable;
+ otherwise return -1 and set errno.
+
+ F_DUPFD_CLOEXEC - duplicate FD, with int ARG being the minimum
+ target fd. If successful, return the duplicate, which will not be
+ inheritable; otherwise return -1 and set errno.
+
+ F_GETFD - ARG need not be present. If successful, return a
+ non-negative value containing the descriptor flags of FD (only
+ FD_CLOEXEC is portable, but other flags may be present); otherwise
+ return -1 and set errno. */
+
+int
+fcntl (int fd, int action, /* arg */...)
+#undef fcntl
+#ifdef __KLIBC__
+# define fcntl klibc_fcntl
+#endif
+{
+ va_list arg;
+ int result = -1;
+ va_start (arg, action);
+ switch (action)
+ {
+ case F_DUPFD:
+ {
+ int target = va_arg (arg, int);
+ result = rpl_fcntl_DUPFD (fd, target);
+ break;
+ }
+
+ case F_DUPFD_CLOEXEC:
+ {
+ int target = va_arg (arg, int);
+ result = rpl_fcntl_DUPFD_CLOEXEC (fd, target);
+ break;
+ }
+
+#if !HAVE_FCNTL
+ case F_GETFD:
+ {
+# if defined _WIN32 && ! defined __CYGWIN__
+ HANDLE handle = (HANDLE) _get_osfhandle (fd);
+ DWORD flags;
+ if (handle == INVALID_HANDLE_VALUE
+ || GetHandleInformation (handle, &flags) == 0)
+ errno = EBADF;
+ else
+ result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC;
+# else /* !W32 */
+ /* Use dup2 to reject invalid file descriptors. No way to
+ access this information, so punt. */
+ if (0 <= dup2 (fd, fd))
+ result = 0;
+# endif /* !W32 */
+ break;
+ } /* F_GETFD */
+#endif /* !HAVE_FCNTL */
+
+ /* Implementing F_SETFD on mingw is not trivial - there is no
+ API for changing the O_NOINHERIT bit on an fd, and merely
+ changing the HANDLE_FLAG_INHERIT bit on the underlying handle
+ can lead to odd state. It may be possible by duplicating the
+ handle, using _open_osfhandle with the right flags, then
+ using dup2 to move the duplicate onto the original, but that
+ is not supported for now. */
+
+ default:
+ {
+#if HAVE_FCNTL
+ switch (action)
+ {
+ #ifdef F_BARRIERFSYNC /* macOS */
+ case F_BARRIERFSYNC:
+ #endif
+ #ifdef F_CHKCLEAN /* macOS */
+ case F_CHKCLEAN:
+ #endif
+ #ifdef F_CLOSEM /* NetBSD, HP-UX */
+ case F_CLOSEM:
+ #endif
+ #ifdef F_FLUSH_DATA /* macOS */
+ case F_FLUSH_DATA:
+ #endif
+ #ifdef F_FREEZE_FS /* macOS */
+ case F_FREEZE_FS:
+ #endif
+ #ifdef F_FULLFSYNC /* macOS */
+ case F_FULLFSYNC:
+ #endif
+ #ifdef F_GETCONFINED /* macOS */
+ case F_GETCONFINED:
+ #endif
+ #ifdef F_GETDEFAULTPROTLEVEL /* macOS */
+ case F_GETDEFAULTPROTLEVEL:
+ #endif
+ #ifdef F_GETFD /* POSIX */
+ case F_GETFD:
+ #endif
+ #ifdef F_GETFL /* POSIX */
+ case F_GETFL:
+ #endif
+ #ifdef F_GETLEASE /* Linux */
+ case F_GETLEASE:
+ #endif
+ #ifdef F_GETNOSIGPIPE /* macOS */
+ case F_GETNOSIGPIPE:
+ #endif
+ #ifdef F_GETOWN /* POSIX */
+ case F_GETOWN:
+ #endif
+ #ifdef F_GETPIPE_SZ /* Linux */
+ case F_GETPIPE_SZ:
+ #endif
+ #ifdef F_GETPROTECTIONCLASS /* macOS */
+ case F_GETPROTECTIONCLASS:
+ #endif
+ #ifdef F_GETPROTECTIONLEVEL /* macOS */
+ case F_GETPROTECTIONLEVEL:
+ #endif
+ #ifdef F_GET_SEALS /* Linux */
+ case F_GET_SEALS:
+ #endif
+ #ifdef F_GETSIG /* Linux */
+ case F_GETSIG:
+ #endif
+ #ifdef F_MAXFD /* NetBSD */
+ case F_MAXFD:
+ #endif
+ #ifdef F_RECYCLE /* macOS */
+ case F_RECYCLE:
+ #endif
+ #ifdef F_SETFIFOENH /* HP-UX */
+ case F_SETFIFOENH:
+ #endif
+ #ifdef F_THAW_FS /* macOS */
+ case F_THAW_FS:
+ #endif
+ /* These actions take no argument. */
+ result = fcntl (fd, action);
+ break;
+
+ #ifdef F_ADD_SEALS /* Linux */
+ case F_ADD_SEALS:
+ #endif
+ #ifdef F_BADFD /* Solaris */
+ case F_BADFD:
+ #endif
+ #ifdef F_CHECK_OPENEVT /* macOS */
+ case F_CHECK_OPENEVT:
+ #endif
+ #ifdef F_DUP2FD /* FreeBSD, AIX, Solaris */
+ case F_DUP2FD:
+ #endif
+ #ifdef F_DUP2FD_CLOEXEC /* FreeBSD, Solaris */
+ case F_DUP2FD_CLOEXEC:
+ #endif
+ #ifdef F_DUP2FD_CLOFORK /* Solaris */
+ case F_DUP2FD_CLOFORK:
+ #endif
+ #ifdef F_DUPFD /* POSIX */
+ case F_DUPFD:
+ #endif
+ #ifdef F_DUPFD_CLOEXEC /* POSIX */
+ case F_DUPFD_CLOEXEC:
+ #endif
+ #ifdef F_DUPFD_CLOFORK /* Solaris */
+ case F_DUPFD_CLOFORK:
+ #endif
+ #ifdef F_GETXFL /* Solaris */
+ case F_GETXFL:
+ #endif
+ #ifdef F_GLOBAL_NOCACHE /* macOS */
+ case F_GLOBAL_NOCACHE:
+ #endif
+ #ifdef F_MAKECOMPRESSED /* macOS */
+ case F_MAKECOMPRESSED:
+ #endif
+ #ifdef F_MOVEDATAEXTENTS /* macOS */
+ case F_MOVEDATAEXTENTS:
+ #endif
+ #ifdef F_NOCACHE /* macOS */
+ case F_NOCACHE:
+ #endif
+ #ifdef F_NODIRECT /* macOS */
+ case F_NODIRECT:
+ #endif
+ #ifdef F_NOTIFY /* Linux */
+ case F_NOTIFY:
+ #endif
+ #ifdef F_OPLKACK /* IRIX */
+ case F_OPLKACK:
+ #endif
+ #ifdef F_OPLKREG /* IRIX */
+ case F_OPLKREG:
+ #endif
+ #ifdef F_RDAHEAD /* macOS */
+ case F_RDAHEAD:
+ #endif
+ #ifdef F_SETBACKINGSTORE /* macOS */
+ case F_SETBACKINGSTORE:
+ #endif
+ #ifdef F_SETCONFINED /* macOS */
+ case F_SETCONFINED:
+ #endif
+ #ifdef F_SETFD /* POSIX */
+ case F_SETFD:
+ #endif
+ #ifdef F_SETFL /* POSIX */
+ case F_SETFL:
+ #endif
+ #ifdef F_SETLEASE /* Linux */
+ case F_SETLEASE:
+ #endif
+ #ifdef F_SETNOSIGPIPE /* macOS */
+ case F_SETNOSIGPIPE:
+ #endif
+ #ifdef F_SETOWN /* POSIX */
+ case F_SETOWN:
+ #endif
+ #ifdef F_SETPIPE_SZ /* Linux */
+ case F_SETPIPE_SZ:
+ #endif
+ #ifdef F_SETPROTECTIONCLASS /* macOS */
+ case F_SETPROTECTIONCLASS:
+ #endif
+ #ifdef F_SETSIG /* Linux */
+ case F_SETSIG:
+ #endif
+ #ifdef F_SINGLE_WRITER /* macOS */
+ case F_SINGLE_WRITER:
+ #endif
+ /* These actions take an 'int' argument. */
+ {
+ int x = va_arg (arg, int);
+ result = fcntl (fd, action, x);
+ }
+ break;
+
+ default:
+ /* Other actions take a pointer argument. */
+ {
+ void *p = va_arg (arg, void *);
+ result = fcntl (fd, action, p);
+ }
+ break;
+ }
+#else
+ errno = EINVAL;
+#endif
+ break;
+ }
+ }
+ va_end (arg);
+ return result;
+}
+
+static int
+rpl_fcntl_DUPFD (int fd, int target)
+{
+ int result;
+#if !HAVE_FCNTL
+ result = dupfd (fd, target, 0);
+#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
+ /* Detect invalid target; needed for cygwin 1.5.x. */
+ if (target < 0 || getdtablesize () <= target)
+ {
+ result = -1;
+ errno = EINVAL;
+ }
+ else
+ {
+ /* Haiku alpha 2 loses fd flags on original. */
+ int flags = fcntl (fd, F_GETFD);
+ if (flags < 0)
+ result = -1;
+ else
+ {
+ result = fcntl (fd, F_DUPFD, target);
+ if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
+ {
+ int saved_errno = errno;
+ close (result);
+ result = -1;
+ errno = saved_errno;
+ }
+# if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (fd, result);
+# endif
+ }
+ }
+#else
+ result = fcntl (fd, F_DUPFD, target);
+#endif
+ return result;
+}
+
+static int
+rpl_fcntl_DUPFD_CLOEXEC (int fd, int target)
+{
+ int result;
+#if !HAVE_FCNTL
+ result = dupfd (fd, target, O_CLOEXEC);
+#else /* HAVE_FCNTL */
+# if defined __NetBSD__ || defined __HAIKU__
+ /* On NetBSD 9.0, the system fcntl (fd, F_DUPFD_CLOEXEC, target)
+ has only the same effect as fcntl (fd, F_DUPFD, target). */
+ /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets
+ the FD_CLOEXEC flag on fd, not on target. Therefore avoid the
+ system fcntl in this case. */
+# define have_dupfd_cloexec -1
+# else
+ /* Try the system call first, if the headers claim it exists
+ (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
+ may be running with a glibc that has the macro but with an
+ older kernel that does not support it. Cache the
+ information on whether the system call really works, but
+ avoid caching failure if the corresponding F_DUPFD fails
+ for any reason. 0 = unknown, 1 = yes, -1 = no. */
+ static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
+ if (0 <= have_dupfd_cloexec)
+ {
+ result = fcntl (fd, F_DUPFD_CLOEXEC, target);
+ if (0 <= result || errno != EINVAL)
+ {
+ have_dupfd_cloexec = 1;
+# if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (fd, result);
+# endif
+ }
+ else
+ {
+ result = rpl_fcntl_DUPFD (fd, target);
+ if (result >= 0)
+ have_dupfd_cloexec = -1;
+ }
+ }
+ else
+# endif
+ result = rpl_fcntl_DUPFD (fd, target);
+ if (0 <= result && have_dupfd_cloexec == -1)
+ {
+ int flags = fcntl (result, F_GETFD);
+ if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
+ {
+ int saved_errno = errno;
+ close (result);
+ errno = saved_errno;
+ result = -1;
+ }
+ }
+#endif /* HAVE_FCNTL */
+ return result;
+}
+
+#undef fcntl
+
+#ifdef __KLIBC__
+
+static int
+klibc_fcntl (int fd, int action, /* arg */...)
+{
+ va_list arg_ptr;
+ int arg;
+ struct stat sbuf;
+ int result;
+
+ va_start (arg_ptr, action);
+ arg = va_arg (arg_ptr, int);
+ result = fcntl (fd, action, arg);
+ /* EPERM for F_DUPFD, ENOTSUP for others */
+ if (result == -1 && (errno == EPERM || errno == ENOTSUP)
+ && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+ {
+ ULONG ulMode;
+
+ switch (action)
+ {
+ case F_DUPFD:
+ /* Find available fd */
+ while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
+ arg++;
+
+ result = dup2 (fd, arg);
+ break;
+
+ /* Using underlying APIs is right ? */
+ case F_GETFD:
+ if (DosQueryFHState (fd, &ulMode))
+ break;
+
+ result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
+ break;
+
+ case F_SETFD:
+ if (arg & ~FD_CLOEXEC)
+ break;
+
+ if (DosQueryFHState (fd, &ulMode))
+ break;
+
+ if (arg & FD_CLOEXEC)
+ ulMode |= OPEN_FLAGS_NOINHERIT;
+ else
+ ulMode &= ~OPEN_FLAGS_NOINHERIT;
+
+ /* Filter supported flags. */
+ ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
+ | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
+
+ if (DosSetFHState (fd, ulMode))
+ break;
+
+ result = 0;
+ break;
+
+ case F_GETFL:
+ result = 0;
+ break;
+
+ case F_SETFL:
+ if (arg != 0)
+ break;
+
+ result = 0;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+ }
+
+ va_end (arg_ptr);
+
+ return result;
+}
+
+#endif
diff --git a/gl/fcntl.in.h b/gl/fcntl.in.h
new file mode 100644
index 0000000..e034eaf
--- /dev/null
+++ b/gl/fcntl.in.h
@@ -0,0 +1,445 @@
+/* Like <fcntl.h>, but with non-working flags defined to 0.
+
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_fcntl_h
+/* Special invocation convention. */
+
+/* Needed before <sys/stat.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
+# include <sys/stat.h>
+#endif
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+
+/* Needed before <sys/stat.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+ <fcntl.h>. On glibc systems, we would like to avoid namespace pollution.
+ But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+ extern "C" { ... } block, which leads to errors in C++ mode with the
+ overridden <sys/stat.h> from gnulib. These errors are known to be gone
+ with g++ version >= 4.3. */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
+# include <sys/stat.h>
+#endif
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+#define _@GUARD_PREFIX@_FCNTL_H
+
+#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
+# include <unistd.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Declare overridden functions. */
+
+#if @GNULIB_CREAT@
+# if @REPLACE_CREAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef creat
+# define creat rpl_creat
+# endif
+_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef creat
+# define creat _creat
+# endif
+_GL_CXXALIAS_MDA (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
+#elif defined GNULIB_POSIXCHECK
+# undef creat
+/* Assume creat is always declared. */
+_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
+ "use gnulib module creat for portability");
+#elif @GNULIB_MDA_CREAT@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::creat always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef creat
+# define creat _creat
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
+#endif
+
+#if @GNULIB_FCNTL@
+# if @REPLACE_FCNTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcntl
+# define fcntl rpl_fcntl
+# endif
+_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
+_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
+# if !GNULIB_defined_rpl_fcntl
+# define GNULIB_defined_rpl_fcntl 1
+# endif
+# else
+# if !@HAVE_FCNTL@
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+# if !GNULIB_defined_fcntl
+# define GNULIB_defined_fcntl 1
+# endif
+# endif
+_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
+# endif
+_GL_CXXALIASWARN (fcntl);
+#elif defined GNULIB_POSIXCHECK
+# undef fcntl
+# if HAVE_RAW_DECL_FCNTL
+_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
+ "use gnulib module fcntl for portability");
+# endif
+#endif
+
+#if @GNULIB_OPEN@
+# if @REPLACE_OPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open rpl_open
+# endif
+_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open _open
+# endif
+_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
+ default argument. _GL_CXXALIASWARN does not work in this case. */
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef open
+/* Assume open is always declared. */
+_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
+ "use gnulib module open for portability");
+#elif @GNULIB_MDA_OPEN@
+/* On native Windows, map 'open' to '_open', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::open always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef open
+# define open _open
+# endif
+_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
+#endif
+
+#if @GNULIB_OPENAT@
+# if @REPLACE_OPENAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef openat
+# define openat rpl_openat
+# endif
+_GL_FUNCDECL_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# else
+# if !@HAVE_OPENAT@
+_GL_FUNCDECL_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (openat, int,
+ (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# endif
+_GL_CXXALIASWARN (openat);
+#elif defined GNULIB_POSIXCHECK
+# undef openat
+# if HAVE_RAW_DECL_OPENAT
+_GL_WARN_ON_USE (openat, "openat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+/* Fix up the FD_* macros, only known to be missing on mingw. */
+
+#ifndef FD_CLOEXEC
+# define FD_CLOEXEC 1
+#endif
+
+/* Fix up the supported F_* macros. Intentionally leave other F_*
+ macros undefined. Only known to be missing on mingw. */
+
+#ifndef F_DUPFD_CLOEXEC
+# define F_DUPFD_CLOEXEC 0x40000000
+/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */
+# define GNULIB_defined_F_DUPFD_CLOEXEC 1
+#else
+# define GNULIB_defined_F_DUPFD_CLOEXEC 0
+#endif
+
+#ifndef F_DUPFD
+# define F_DUPFD 1
+#endif
+
+#ifndef F_GETFD
+# define F_GETFD 2
+#endif
+
+/* Fix up the O_* macros. */
+
+/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
+ to values outside 'int' range, so omit these misdefinitions.
+ But avoid namespace pollution on non-AIX systems. */
+#ifdef _AIX
+# include <limits.h>
+# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
+# undef O_CLOEXEC
+# endif
+# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
+# undef O_NOFOLLOW
+# endif
+# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
+# undef O_TTY_INIT
+# endif
+#endif
+
+#if !defined O_DIRECT && defined O_DIRECTIO
+/* Tru64 spells it 'O_DIRECTIO'. */
+# define O_DIRECT O_DIRECTIO
+#endif
+
+#if !defined O_CLOEXEC && defined O_NOINHERIT
+/* Mingw spells it 'O_NOINHERIT'. */
+# define O_CLOEXEC O_NOINHERIT
+#endif
+
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0x40000000 /* Try to not collide with system O_* flags. */
+# define GNULIB_defined_O_CLOEXEC 1
+#else
+# define GNULIB_defined_O_CLOEXEC 0
+#endif
+
+#ifndef O_DIRECT
+# define O_DIRECT 0
+#endif
+
+#ifndef O_DIRECTORY
+# define O_DIRECTORY 0
+#endif
+
+#ifndef O_DSYNC
+# define O_DSYNC 0
+#endif
+
+#ifndef O_EXEC
+# define O_EXEC O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_IGNORE_CTTY
+# define O_IGNORE_CTTY 0
+#endif
+
+#ifndef O_NDELAY
+# define O_NDELAY 0
+#endif
+
+#ifndef O_NOATIME
+# define O_NOATIME 0
+#endif
+
+#ifndef O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+#endif
+
+/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
+ value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
+ or to 0 as fallback. */
+#if @GNULIB_NONBLOCKING@
+# if O_NONBLOCK
+# define GNULIB_defined_O_NONBLOCK 0
+# else
+# define GNULIB_defined_O_NONBLOCK 1
+# undef O_NONBLOCK
+# define O_NONBLOCK 0x40000000
+# endif
+#endif
+
+#ifndef O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
+#ifndef O_NOLINK
+# define O_NOLINK 0
+#endif
+
+#ifndef O_NOLINKS
+# define O_NOLINKS 0
+#endif
+
+#ifndef O_NOTRANS
+# define O_NOTRANS 0
+#endif
+
+#ifndef O_RSYNC
+# define O_RSYNC 0
+#endif
+
+#ifndef O_SEARCH
+# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */
+#endif
+
+#ifndef O_SYNC
+# define O_SYNC 0
+#endif
+
+#ifndef O_TTY_INIT
+# define O_TTY_INIT 0
+#endif
+
+#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+# undef O_ACCMODE
+# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+#endif
+
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in fcntl.h */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+
+#if defined __BEOS__ || defined __HAIKU__
+ /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+
+#ifndef O_BINARY
+# define O_BINARY 0
+# define O_TEXT 0
+#endif
+
+/* Fix up the AT_* macros. */
+
+/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
+ value exceeds INT_MAX, so its use as an int doesn't conform to the
+ C standard, and GCC and Sun C complain in some cases. If the bug
+ is present, undef AT_FDCWD here, so it can be redefined below. */
+#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
+# undef AT_FDCWD
+#endif
+
+/* Use the same bit pattern as Solaris 9, but with the proper
+ signedness. The bit pattern is important, in case this actually is
+ Solaris with the above workaround. */
+#ifndef AT_FDCWD
+# define AT_FDCWD (-3041965)
+#endif
+
+/* Use the same values as Solaris 9. This shouldn't matter, but
+ there's no real reason to differ. */
+#ifndef AT_SYMLINK_NOFOLLOW
+# define AT_SYMLINK_NOFOLLOW 4096
+#endif
+
+#ifndef AT_REMOVEDIR
+# define AT_REMOVEDIR 1
+#endif
+
+/* Solaris 9 lacks these two, so just pick unique values. */
+#ifndef AT_SYMLINK_FOLLOW
+# define AT_SYMLINK_FOLLOW 2
+#endif
+
+#ifndef AT_EACCESS
+# define AT_EACCESS 4
+#endif
+
+/* Ignore this flag if not supported. */
+#ifndef AT_NO_AUTOMOUNT
+# define AT_NO_AUTOMOUNT 0
+#endif
+
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif
diff --git a/gl/fd-hook.c b/gl/fd-hook.c
new file mode 100644
index 0000000..3626115
--- /dev/null
+++ b/gl/fd-hook.c
@@ -0,0 +1,116 @@
+/* Hook for making file descriptor functions close(), ioctl() extensible.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2009.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "fd-hook.h"
+
+#include <stdlib.h>
+
+/* Currently, this entire code is only needed for the handling of sockets
+ on native Windows platforms. */
+#if WINDOWS_SOCKETS
+
+/* The first and last link in the doubly linked list.
+ Initially the list is empty. */
+static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL };
+
+int
+execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary,
+ int fd)
+{
+ if (remaining_list == &anchor)
+ /* End of list reached. */
+ return primary (fd);
+ else
+ return remaining_list->private_close_fn (remaining_list->private_next,
+ primary, fd);
+}
+
+int
+execute_all_close_hooks (gl_close_fn primary, int fd)
+{
+ return execute_close_hooks (anchor.private_next, primary, fd);
+}
+
+int
+execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary,
+ int fd, int request, void *arg)
+{
+ if (remaining_list == &anchor)
+ /* End of list reached. */
+ return primary (fd, request, arg);
+ else
+ return remaining_list->private_ioctl_fn (remaining_list->private_next,
+ primary, fd, request, arg);
+}
+
+int
+execute_all_ioctl_hooks (gl_ioctl_fn primary,
+ int fd, int request, void *arg)
+{
+ return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg);
+}
+
+void
+register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link)
+{
+ if (close_hook == NULL)
+ close_hook = execute_close_hooks;
+ if (ioctl_hook == NULL)
+ ioctl_hook = execute_ioctl_hooks;
+
+ if (link->private_next == NULL && link->private_prev == NULL)
+ {
+ /* Add the link to the doubly linked list. */
+ link->private_next = anchor.private_next;
+ link->private_prev = &anchor;
+ link->private_close_fn = close_hook;
+ link->private_ioctl_fn = ioctl_hook;
+ anchor.private_next->private_prev = link;
+ anchor.private_next = link;
+ }
+ else
+ {
+ /* The link is already in use. */
+ if (link->private_close_fn != close_hook
+ || link->private_ioctl_fn != ioctl_hook)
+ abort ();
+ }
+}
+
+void
+unregister_fd_hook (struct fd_hook *link)
+{
+ struct fd_hook *next = link->private_next;
+ struct fd_hook *prev = link->private_prev;
+
+ if (next != NULL && prev != NULL)
+ {
+ /* The link is in use. Remove it from the doubly linked list. */
+ prev->private_next = next;
+ next->private_prev = prev;
+ /* Clear the link, to mark it unused. */
+ link->private_next = NULL;
+ link->private_prev = NULL;
+ link->private_close_fn = NULL;
+ link->private_ioctl_fn = NULL;
+ }
+}
+
+#endif
diff --git a/gl/fd-hook.h b/gl/fd-hook.h
new file mode 100644
index 0000000..6bf3c24
--- /dev/null
+++ b/gl/fd-hook.h
@@ -0,0 +1,119 @@
+/* Hook for making file descriptor functions close(), ioctl() extensible.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+
+#ifndef FD_HOOK_H
+#define FD_HOOK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Currently, this entire code is only needed for the handling of sockets
+ on native Windows platforms. */
+#if WINDOWS_SOCKETS
+
+
+/* Type of function that closes FD. */
+typedef int (*gl_close_fn) (int fd);
+
+/* Type of function that applies a control request to FD. */
+typedef int (*gl_ioctl_fn) (int fd, int request, void *arg);
+
+/* An element of the list of file descriptor hooks.
+ In CLOS (Common Lisp Object System) speak, it consists of an "around"
+ method for the close() function and an "around" method for the ioctl()
+ function.
+ The fields of this structure are considered private. */
+struct fd_hook
+{
+ /* Doubly linked list. */
+ struct fd_hook *private_next;
+ struct fd_hook *private_prev;
+ /* Function that treats the types of FD that it knows about and calls
+ execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback. */
+ int (*private_close_fn) (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd);
+ /* Function that treats the types of FD that it knows about and calls
+ execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a
+ fallback. */
+ int (*private_ioctl_fn) (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+};
+
+/* This type of function closes FD, applying special knowledge for the FD
+ types it knows about, and calls
+ execute_close_hooks (REMAINING_LIST, PRIMARY, FD)
+ for the other FD types.
+ In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+ and PRIMARY is the "primary" method for close(). */
+typedef int (*close_hook_fn) (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd);
+
+/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+ Return 0 or -1, like close() would do. */
+extern int execute_close_hooks (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd);
+
+/* Execute all close hooks, with PRIMARY as "primary" method.
+ Return 0 or -1, like close() would do. */
+extern int execute_all_close_hooks (gl_close_fn primary, int fd);
+
+/* This type of function applies a control request to FD, applying special
+ knowledge for the FD types it knows about, and calls
+ execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG)
+ for the other FD types.
+ In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+ and PRIMARY is the "primary" method for ioctl(). */
+typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+
+/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+ Return 0 or -1, like ioctl() would do. */
+extern int execute_ioctl_hooks (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+
+/* Execute all ioctl hooks, with PRIMARY as "primary" method.
+ Return 0 or -1, like ioctl() would do. */
+extern int execute_all_ioctl_hooks (gl_ioctl_fn primary,
+ int fd, int request, void *arg);
+
+/* Add a function pair to the list of file descriptor hooks.
+ CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change.
+ The LINK variable points to a piece of memory which is guaranteed to be
+ accessible until the corresponding call to unregister_fd_hook. */
+extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook,
+ struct fd_hook *link);
+
+/* Removes a hook from the list of file descriptor hooks. */
+extern void unregister_fd_hook (struct fd_hook *link);
+
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FD_HOOK_H */
diff --git a/gl/fflush.c b/gl/fflush.c
new file mode 100644
index 0000000..f3689b3
--- /dev/null
+++ b/gl/fflush.c
@@ -0,0 +1,233 @@
+/* fflush.c -- allow flushing input streams
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "freading.h"
+
+#include "stdio-impl.h"
+
+#undef fflush
+
+
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+/* GNU libc, BeOS, Haiku, Linux libc5 */
+
+/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
+static void
+clear_ungetc_buffer_preserving_position (FILE *fp)
+{
+ if (fp->_flags & _IO_IN_BACKUP)
+ /* _IO_free_backup_area is a bit complicated. Simply call fseek. */
+ fseeko (fp, 0, SEEK_CUR);
+}
+
+#else
+
+/* Clear the stream's ungetc buffer. May modify the value of ftello (fp). */
+static void
+clear_ungetc_buffer (FILE *fp)
+{
+# if defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+ if (HASUB (fp))
+ {
+ fp_->_p += fp_->_r;
+ fp_->_r = 0;
+ }
+# elif defined __EMX__ /* emx+gcc */
+ if (fp->_ungetc_count > 0)
+ {
+ fp->_ungetc_count = 0;
+ fp->_rcount = - fp->_rcount;
+ }
+# elif defined _IOERR /* Minix, AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
+ /* Nothing to do. */
+# else /* other implementations */
+ fseeko (fp, 0, SEEK_CUR);
+# endif
+}
+
+#endif
+
+#if ! (defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1)
+/* GNU libc, BeOS, Haiku, Linux libc5 */
+
+# if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+
+static int
+disable_seek_optimization (FILE *fp)
+{
+ int saved_flags = fp_->_flags & (__SOPT | __SNPT);
+ fp_->_flags = (fp_->_flags & ~__SOPT) | __SNPT;
+ return saved_flags;
+}
+
+static void
+restore_seek_optimization (FILE *fp, int saved_flags)
+{
+ fp_->_flags = (fp_->_flags & ~(__SOPT | __SNPT)) | saved_flags;
+}
+
+# else
+
+static void
+update_fpos_cache (_GL_ATTRIBUTE_MAYBE_UNUSED FILE *fp,
+ _GL_ATTRIBUTE_MAYBE_UNUSED off_t pos)
+{
+# if defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+# if defined __CYGWIN__ || defined __ANDROID__
+ /* fp_->_offset is typed as an integer. */
+ fp_->_offset = pos;
+# else
+ /* fp_->_offset is an fpos_t. */
+ /* Use a union, since on NetBSD, the compilation flags determine
+ whether fpos_t is typedef'd to off_t or a struct containing a
+ single off_t member. */
+ union
+ {
+ fpos_t f;
+ off_t o;
+ } u;
+ u.o = pos;
+ fp_->_offset = u.f;
+# endif
+ fp_->_flags |= __SOFF;
+# endif
+}
+# endif
+#endif
+
+/* Flush all pending data on STREAM according to POSIX rules. Both
+ output and seekable input streams are supported. */
+int
+rpl_fflush (FILE *stream)
+{
+ /* When stream is NULL, POSIX and C99 only require flushing of "output
+ streams and update streams in which the most recent operation was not
+ input", and all implementations do this.
+
+ When stream is "an output stream or an update stream in which the most
+ recent operation was not input", POSIX and C99 requires that fflush
+ writes out any buffered data, and all implementations do this.
+
+ When stream is, however, an input stream or an update stream in
+ which the most recent operation was input, C99 specifies nothing,
+ and POSIX only specifies behavior if the stream is seekable.
+ mingw, in particular, drops the input buffer, leaving the file
+ descriptor positioned at the end of the input buffer. I.e. ftell
+ (stream) is lost. We don't want to call the implementation's
+ fflush in this case.
+
+ We test ! freading (stream) here, rather than fwriting (stream), because
+ what we need to know is whether the stream holds a "read buffer", and on
+ mingw this is indicated by _IOREAD, regardless of _IOWRT. */
+ if (stream == NULL || ! freading (stream))
+ return fflush (stream);
+
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+ /* GNU libc, BeOS, Haiku, Linux libc5 */
+
+ clear_ungetc_buffer_preserving_position (stream);
+
+ return fflush (stream);
+
+#else
+ {
+ /* What POSIX says:
+ 1) About the file-position indicator (-> fseeko, ftello):
+ The file position indicator is incremented by fgetc() and decremented
+ by ungetc():
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fgetc.html>
+ "... the fgetc() function shall ... advance the associated file
+ position indicator for the stream ..."
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ungetc.html>
+ "The file-position indicator is decremented by each successful
+ call to ungetc()..."
+ 2) fflush discards bytes pushed back by ungetc:
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html>
+ "...any characters pushed back onto the stream by ungetc()
+ or ungetwc() that have not subsequently been read from the
+ stream shall be discarded..."
+ This implies implicitly: fflush does not change the file position
+ indicator.
+ 3) Effects on the file descriptor, if the file descriptor is capable of
+ seeking:
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html>
+ "...the file offset of the underlying open file description shall
+ be set to the file position of the stream..." */
+
+ /* POSIX does not specify fflush behavior for non-seekable input
+ streams. Some implementations purge unread data, some return
+ EBADF, some do nothing. */
+ off_t pos = ftello (stream);
+ if (pos == -1)
+ {
+ errno = EBADF;
+ return EOF;
+ }
+
+ /* Clear the ungetc buffer. */
+ clear_ungetc_buffer (stream);
+
+ /* To get here, we must be flushing a seekable input stream, so the
+ semantics of fpurge are now appropriate to clear the buffer. To
+ avoid losing data, the lseek is also necessary. */
+ {
+ int result = fpurge (stream);
+ if (result != 0)
+ return result;
+ }
+
+# if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+
+ {
+ /* Disable seek optimization for the next fseeko call. This tells the
+ following fseeko call to seek to the desired position directly, rather
+ than to seek to a block-aligned boundary. */
+ int saved_flags = disable_seek_optimization (stream);
+ int result = fseeko (stream, pos, SEEK_SET);
+
+ restore_seek_optimization (stream, saved_flags);
+ return result;
+ }
+
+# else
+
+ pos = lseek (fileno (stream), pos, SEEK_SET);
+ if (pos == -1)
+ return EOF;
+ /* After a successful lseek, update the file descriptor's position cache
+ in the stream. */
+ update_fpos_cache (stream, pos);
+
+ return 0;
+
+# endif
+ }
+#endif
+}
diff --git a/gl/filename.h b/gl/filename.h
new file mode 100644
index 0000000..a2400a9
--- /dev/null
+++ b/gl/filename.h
@@ -0,0 +1,112 @@
+/* Basic filename support macros.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* From Paul Eggert and Jim Meyering. */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Filename support.
+ ISSLASH(C) tests whether C is a directory separator
+ character.
+ HAS_DEVICE(Filename) tests whether Filename contains a device
+ specification.
+ FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification
+ at the beginning of Filename,
+ index of the part consisting of
+ alternating components and slashes.
+ FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+ 1 when a non-empty device specification
+ can be followed by an empty or relative
+ part,
+ 0 when a non-empty device specification
+ must be followed by a slash,
+ 0 when device specification don't exist.
+ IS_ABSOLUTE_FILE_NAME(Filename)
+ tests whether Filename is independent of
+ any notion of "current directory".
+ IS_RELATIVE_FILE_NAME(Filename)
+ tests whether Filename may be concatenated
+ to a directory filename.
+ Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
+ relative file name!
+ IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
+ or directory specification.
+ */
+#if defined _WIN32 || defined __CYGWIN__ \
+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
+ /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+ /* Internal macro: Tests whether a character is a drive letter. */
+# define _IS_DRIVE_LETTER(C) \
+ (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
+ /* Help the compiler optimizing it. This assumes ASCII. */
+# undef _IS_DRIVE_LETTER
+# define _IS_DRIVE_LETTER(C) \
+ (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
+# define HAS_DEVICE(Filename) \
+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
+# ifdef __CYGWIN__
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# else
+ /* On native Windows, OS/2, DOS, the system has the notion of a
+ "current directory" on each drive. */
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
+# else
+# define IS_ABSOLUTE_FILE_NAME(Filename) \
+ (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
+# endif
+# define IS_RELATIVE_FILE_NAME(Filename) \
+ (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
+# define IS_FILE_NAME_WITH_DIR(Filename) \
+ (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
+ || HAS_DEVICE (Filename))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
+#endif
+
+/* Deprecated macros. For backward compatibility with old users of the
+ 'filename' module. */
+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */
diff --git a/gl/float+.h b/gl/float+.h
new file mode 100644
index 0000000..e7531e4
--- /dev/null
+++ b/gl/float+.h
@@ -0,0 +1,147 @@
+/* Supplemental information about the floating-point formats.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _FLOATPLUS_H
+#define _FLOATPLUS_H
+
+#include <float.h>
+#include <limits.h>
+
+/* Number of bits in the mantissa of a floating-point number, including the
+ "hidden bit". */
+#if FLT_RADIX == 2
+# define FLT_MANT_BIT FLT_MANT_DIG
+# define DBL_MANT_BIT DBL_MANT_DIG
+# define LDBL_MANT_BIT LDBL_MANT_DIG
+#elif FLT_RADIX == 4
+# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
+# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
+# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
+#elif FLT_RADIX == 16
+# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
+# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
+# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
+#endif
+
+/* Bit mask that can be used to mask the exponent, as an unsigned number. */
+#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
+#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
+#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
+
+/* Number of bits used for the exponent of a floating-point number, including
+ the exponent's sign. */
+#define FLT_EXP_BIT \
+ (FLT_EXP_MASK < 0x100 ? 8 : \
+ FLT_EXP_MASK < 0x200 ? 9 : \
+ FLT_EXP_MASK < 0x400 ? 10 : \
+ FLT_EXP_MASK < 0x800 ? 11 : \
+ FLT_EXP_MASK < 0x1000 ? 12 : \
+ FLT_EXP_MASK < 0x2000 ? 13 : \
+ FLT_EXP_MASK < 0x4000 ? 14 : \
+ FLT_EXP_MASK < 0x8000 ? 15 : \
+ FLT_EXP_MASK < 0x10000 ? 16 : \
+ FLT_EXP_MASK < 0x20000 ? 17 : \
+ FLT_EXP_MASK < 0x40000 ? 18 : \
+ FLT_EXP_MASK < 0x80000 ? 19 : \
+ FLT_EXP_MASK < 0x100000 ? 20 : \
+ FLT_EXP_MASK < 0x200000 ? 21 : \
+ FLT_EXP_MASK < 0x400000 ? 22 : \
+ FLT_EXP_MASK < 0x800000 ? 23 : \
+ FLT_EXP_MASK < 0x1000000 ? 24 : \
+ FLT_EXP_MASK < 0x2000000 ? 25 : \
+ FLT_EXP_MASK < 0x4000000 ? 26 : \
+ FLT_EXP_MASK < 0x8000000 ? 27 : \
+ FLT_EXP_MASK < 0x10000000 ? 28 : \
+ FLT_EXP_MASK < 0x20000000 ? 29 : \
+ FLT_EXP_MASK < 0x40000000 ? 30 : \
+ FLT_EXP_MASK <= 0x7fffffff ? 31 : \
+ 32)
+#define DBL_EXP_BIT \
+ (DBL_EXP_MASK < 0x100 ? 8 : \
+ DBL_EXP_MASK < 0x200 ? 9 : \
+ DBL_EXP_MASK < 0x400 ? 10 : \
+ DBL_EXP_MASK < 0x800 ? 11 : \
+ DBL_EXP_MASK < 0x1000 ? 12 : \
+ DBL_EXP_MASK < 0x2000 ? 13 : \
+ DBL_EXP_MASK < 0x4000 ? 14 : \
+ DBL_EXP_MASK < 0x8000 ? 15 : \
+ DBL_EXP_MASK < 0x10000 ? 16 : \
+ DBL_EXP_MASK < 0x20000 ? 17 : \
+ DBL_EXP_MASK < 0x40000 ? 18 : \
+ DBL_EXP_MASK < 0x80000 ? 19 : \
+ DBL_EXP_MASK < 0x100000 ? 20 : \
+ DBL_EXP_MASK < 0x200000 ? 21 : \
+ DBL_EXP_MASK < 0x400000 ? 22 : \
+ DBL_EXP_MASK < 0x800000 ? 23 : \
+ DBL_EXP_MASK < 0x1000000 ? 24 : \
+ DBL_EXP_MASK < 0x2000000 ? 25 : \
+ DBL_EXP_MASK < 0x4000000 ? 26 : \
+ DBL_EXP_MASK < 0x8000000 ? 27 : \
+ DBL_EXP_MASK < 0x10000000 ? 28 : \
+ DBL_EXP_MASK < 0x20000000 ? 29 : \
+ DBL_EXP_MASK < 0x40000000 ? 30 : \
+ DBL_EXP_MASK <= 0x7fffffff ? 31 : \
+ 32)
+#define LDBL_EXP_BIT \
+ (LDBL_EXP_MASK < 0x100 ? 8 : \
+ LDBL_EXP_MASK < 0x200 ? 9 : \
+ LDBL_EXP_MASK < 0x400 ? 10 : \
+ LDBL_EXP_MASK < 0x800 ? 11 : \
+ LDBL_EXP_MASK < 0x1000 ? 12 : \
+ LDBL_EXP_MASK < 0x2000 ? 13 : \
+ LDBL_EXP_MASK < 0x4000 ? 14 : \
+ LDBL_EXP_MASK < 0x8000 ? 15 : \
+ LDBL_EXP_MASK < 0x10000 ? 16 : \
+ LDBL_EXP_MASK < 0x20000 ? 17 : \
+ LDBL_EXP_MASK < 0x40000 ? 18 : \
+ LDBL_EXP_MASK < 0x80000 ? 19 : \
+ LDBL_EXP_MASK < 0x100000 ? 20 : \
+ LDBL_EXP_MASK < 0x200000 ? 21 : \
+ LDBL_EXP_MASK < 0x400000 ? 22 : \
+ LDBL_EXP_MASK < 0x800000 ? 23 : \
+ LDBL_EXP_MASK < 0x1000000 ? 24 : \
+ LDBL_EXP_MASK < 0x2000000 ? 25 : \
+ LDBL_EXP_MASK < 0x4000000 ? 26 : \
+ LDBL_EXP_MASK < 0x8000000 ? 27 : \
+ LDBL_EXP_MASK < 0x10000000 ? 28 : \
+ LDBL_EXP_MASK < 0x20000000 ? 29 : \
+ LDBL_EXP_MASK < 0x40000000 ? 30 : \
+ LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
+ 32)
+
+/* Number of bits used for a floating-point number: the mantissa (not
+ counting the "hidden bit", since it may or may not be explicit), the
+ exponent, and the sign. */
+#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
+#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
+#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
+
+/* Number of bytes used for a floating-point number.
+ This can be smaller than the 'sizeof'. For example, on i386 systems,
+ 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
+ LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
+ sizeof (long double) = 12 or = 16. */
+#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
+
+/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
+typedef int verify_sizeof_flt[SIZEOF_FLT <= sizeof (float) ? 1 : -1];
+typedef int verify_sizeof_dbl[SIZEOF_DBL <= sizeof (double) ? 1 : - 1];
+typedef int verify_sizeof_ldbl[SIZEOF_LDBL <= sizeof (long double) ? 1 : - 1];
+
+#endif /* _FLOATPLUS_H */
diff --git a/gl/float.c b/gl/float.c
new file mode 100644
index 0000000..f81ff33
--- /dev/null
+++ b/gl/float.c
@@ -0,0 +1,33 @@
+/* Auxiliary definitions for <float.h>.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <float.h>
+
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+const union gl_long_double_union gl_LDBL_MAX =
+ { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+#elif defined __i386__
+const union gl_long_double_union gl_LDBL_MAX =
+ { { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
+#else
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+#endif
diff --git a/gl/float.in.h b/gl/float.in.h
new file mode 100644
index 0000000..bf2c502
--- /dev/null
+++ b/gl/float.in.h
@@ -0,0 +1,194 @@
+/* A correct <float.h>.
+
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_FLOAT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
+
+#ifndef _@GUARD_PREFIX@_FLOAT_H
+#define _@GUARD_PREFIX@_FLOAT_H
+
+/* 'long double' properties. */
+
+#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
+/* Number of mantissa units, in base FLT_RADIX. */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 64
+/* Number of decimal digits that is sufficient for representing a number. */
+# undef LDBL_DIG
+# define LDBL_DIG 18
+/* x-1 where x is the smallest representable number > 1. */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 1.0842021724855044340E-19L
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP 16384
+/* Minimum positive normalized number. */
+# undef LDBL_MIN
+# define LDBL_MIN 3.3621031431120935063E-4932L
+/* Maximum representable finite number. */
+# undef LDBL_MAX
+# define LDBL_MAX 1.1897314953572317650E+4932L
+/* Minimum e such that 10^e is in the range of normalized numbers. */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers. */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
+ precision in the compiler but 64 bits of precision at runtime. See
+ <https://lists.gnu.org/r/bug-gnulib/2008-07/msg00063.html>. */
+#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+/* Number of mantissa units, in base FLT_RADIX. */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 64
+/* Number of decimal digits that is sufficient for representing a number. */
+# undef LDBL_DIG
+# define LDBL_DIG 18
+/* x-1 where x is the smallest representable number > 1. */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP 16384
+/* Minimum positive normalized number. */
+# undef LDBL_MIN
+# define LDBL_MIN 3.362103143112093506262677817321752E-4932L /* = 0x1p-16382L */
+/* Maximum representable finite number. */
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
+ But the largest literal that GCC allows us to write is
+ 0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }.
+ So, define it like this through a reference to an external variable
+
+ const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 };
+ extern const long double LDBL_MAX;
+
+ Unfortunately, this is not a constant expression. */
+# if !GNULIB_defined_long_double_union
+union gl_long_double_union
+ {
+ struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
+ long double ld;
+ };
+# define GNULIB_defined_long_double_union 1
+# endif
+extern const union gl_long_double_union gl_LDBL_MAX;
+# define LDBL_MAX (gl_LDBL_MAX.ld)
+/* Minimum e such that 10^e is in the range of normalized numbers. */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers. */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
+ wrong.
+ On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+# undef LDBL_MIN
+# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
+ It is not easy to define:
+ #define LDBL_MAX 1.79769313486231580793728971405302307166e308L
+ is too small, whereas
+ #define LDBL_MAX 1.79769313486231580793728971405302307167e308L
+ is too large. Apparently a bug in GCC decimal-to-binary conversion.
+ Also, I can't get values larger than
+ #define LDBL63 ((long double) (1ULL << 63))
+ #define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+ #define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+ #define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+ #define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
+ which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
+ So, define it like this through a reference to an external variable
+
+ const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
+ extern const long double LDBL_MAX;
+
+ or through a pointer cast
+
+ #define LDBL_MAX \
+ (*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
+
+ Unfortunately, this is not a constant expression, and the latter expression
+ does not work well when GCC is optimizing.. */
+# if !GNULIB_defined_long_double_union
+union gl_long_double_union
+ {
+ struct { double hi; double lo; } dd;
+ long double ld;
+ };
+# define GNULIB_defined_long_double_union 1
+# endif
+extern const union gl_long_double_union gl_LDBL_MAX;
+# define LDBL_MAX (gl_LDBL_MAX.ld)
+#endif
+
+/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
+ On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON
+ are wrong. */
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 106
+# if defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+# undef LDBL_MIN
+# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
+# endif
+#endif
+
+#if @REPLACE_ITOLD@
+/* Pull in a function that fixes the 'int' to 'long double' conversion
+ of glibc 2.7. */
+extern
+# ifdef __cplusplus
+"C"
+# endif
+void _Qp_itoq (long double *, int);
+static void (*_gl_float_fix_itold) (long double *, int) = _Qp_itoq;
+#endif
+
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
diff --git a/gl/floor.c b/gl/floor.c
new file mode 100644
index 0000000..238f487
--- /dev/null
+++ b/gl/floor.c
@@ -0,0 +1,105 @@
+/* Round towards negative infinity.
+ Copyright (C) 2007, 2010-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#if ! defined USE_LONG_DOUBLE
+# include <config.h>
+#endif
+
+/* Specification. */
+#include <math.h>
+
+#include <float.h>
+
+#ifdef USE_LONG_DOUBLE
+# define FUNC floorl
+# define DOUBLE long double
+# define MANT_DIG LDBL_MANT_DIG
+# define L_(literal) literal##L
+#elif ! defined USE_FLOAT
+# define FUNC floor
+# define DOUBLE double
+# define MANT_DIG DBL_MANT_DIG
+# define L_(literal) literal
+#else /* defined USE_FLOAT */
+# define FUNC floorf
+# define DOUBLE float
+# define MANT_DIG FLT_MANT_DIG
+# define L_(literal) literal##f
+#endif
+
+/* MSVC with option -fp:strict refuses to compile constant initializers that
+ contain floating-point operations. Pacify this compiler. */
+#if defined _MSC_VER && !defined __clang__
+# pragma fenv_access (off)
+#endif
+
+/* 2^(MANT_DIG-1). */
+static const DOUBLE TWO_MANT_DIG =
+ /* Assume MANT_DIG <= 5 * 31.
+ Use the identity
+ n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5). */
+ (DOUBLE) (1U << ((MANT_DIG - 1) / 5))
+ * (DOUBLE) (1U << ((MANT_DIG - 1 + 1) / 5))
+ * (DOUBLE) (1U << ((MANT_DIG - 1 + 2) / 5))
+ * (DOUBLE) (1U << ((MANT_DIG - 1 + 3) / 5))
+ * (DOUBLE) (1U << ((MANT_DIG - 1 + 4) / 5));
+
+DOUBLE
+FUNC (DOUBLE x)
+{
+ /* The use of 'volatile' guarantees that excess precision bits are dropped
+ at each addition step and before the following comparison at the caller's
+ site. It is necessary on x86 systems where double-floats are not IEEE
+ compliant by default, to avoid that the results become platform and compiler
+ option dependent. 'volatile' is a portable alternative to gcc's
+ -ffloat-store option. */
+ volatile DOUBLE y = x;
+ volatile DOUBLE z = y;
+
+ if (z > L_(0.0))
+ {
+ /* For 0 < x < 1, return +0.0 even if the current rounding mode is
+ FE_DOWNWARD. */
+ if (z < L_(1.0))
+ z = L_(0.0);
+ /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */
+ else if (z < TWO_MANT_DIG)
+ {
+ /* Round to the next integer (nearest or up or down, doesn't matter). */
+ z += TWO_MANT_DIG;
+ z -= TWO_MANT_DIG;
+ /* Enforce rounding down. */
+ if (z > y)
+ z -= L_(1.0);
+ }
+ }
+ else if (z < L_(0.0))
+ {
+ /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */
+ if (z > - TWO_MANT_DIG)
+ {
+ /* Round to the next integer (nearest or up or down, doesn't matter). */
+ z -= TWO_MANT_DIG;
+ z += TWO_MANT_DIG;
+ /* Enforce rounding down. */
+ if (z > y)
+ z -= L_(1.0);
+ }
+ }
+ return z;
+}
diff --git a/gl/floorf.c b/gl/floorf.c
new file mode 100644
index 0000000..e465c18
--- /dev/null
+++ b/gl/floorf.c
@@ -0,0 +1,20 @@
+/* Round towards negative infinity.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#define USE_FLOAT
+#include "floor.c"
diff --git a/gl/fopen.c b/gl/fopen.c
new file mode 100644
index 0000000..f8469a0
--- /dev/null
+++ b/gl/fopen.c
@@ -0,0 +1,229 @@
+/* Open a stream to a file.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+/* If the user's config.h happens to include <stdio.h>, let it include only
+ the system's <stdio.h> here, so that orig_fopen doesn't recurse to
+ rpl_fopen. */
+#define _GL_ALREADY_INCLUDING_STDIO_H
+#include <config.h>
+
+/* Get the original definition of fopen. It might be defined as a macro. */
+#include <stdio.h>
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
+static FILE *
+orig_fopen (const char *filename, const char *mode)
+{
+ return fopen (filename, mode);
+}
+
+/* Specification. */
+/* Write "stdio.h" here, not <stdio.h>, otherwise OSF/1 5.1 DTK cc eliminates
+ this include because of the preliminary #include <stdio.h> above. */
+#include "stdio.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+FILE *
+rpl_fopen (const char *filename, const char *mode)
+{
+ int open_direction;
+ int open_flags;
+#if GNULIB_FOPEN_GNU
+ bool open_flags_gnu;
+# define BUF_SIZE 80
+ char fdopen_mode_buf[BUF_SIZE + 1];
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
+ if (strcmp (filename, "/dev/null") == 0)
+ filename = "NUL";
+#endif
+
+ /* Parse the mode. */
+ open_direction = 0;
+ open_flags = 0;
+#if GNULIB_FOPEN_GNU
+ open_flags_gnu = false;
+#endif
+ {
+ const char *p = mode;
+#if GNULIB_FOPEN_GNU
+ char *q = fdopen_mode_buf;
+#endif
+
+ for (; *p != '\0'; p++)
+ {
+ switch (*p)
+ {
+ case 'r':
+ open_direction = O_RDONLY;
+#if GNULIB_FOPEN_GNU
+ if (q < fdopen_mode_buf + BUF_SIZE)
+ *q++ = *p;
+#endif
+ continue;
+ case 'w':
+ open_direction = O_WRONLY;
+ open_flags |= O_CREAT | O_TRUNC;
+#if GNULIB_FOPEN_GNU
+ if (q < fdopen_mode_buf + BUF_SIZE)
+ *q++ = *p;
+#endif
+ continue;
+ case 'a':
+ open_direction = O_WRONLY;
+ open_flags |= O_CREAT | O_APPEND;
+#if GNULIB_FOPEN_GNU
+ if (q < fdopen_mode_buf + BUF_SIZE)
+ *q++ = *p;
+#endif
+ continue;
+ case 'b':
+ /* While it is non-standard, O_BINARY is guaranteed by
+ gnulib <fcntl.h>. We can also assume that orig_fopen
+ supports the 'b' flag. */
+ open_flags |= O_BINARY;
+#if GNULIB_FOPEN_GNU
+ if (q < fdopen_mode_buf + BUF_SIZE)
+ *q++ = *p;
+#endif
+ continue;
+ case '+':
+ open_direction = O_RDWR;
+#if GNULIB_FOPEN_GNU
+ if (q < fdopen_mode_buf + BUF_SIZE)
+ *q++ = *p;
+#endif
+ continue;
+#if GNULIB_FOPEN_GNU
+ case 'x':
+ open_flags |= O_EXCL;
+ open_flags_gnu = true;
+ continue;
+ case 'e':
+ open_flags |= O_CLOEXEC;
+ open_flags_gnu = true;
+ continue;
+#endif
+ default:
+ break;
+ }
+#if GNULIB_FOPEN_GNU
+ /* The rest of the mode string can be a platform-dependent extension.
+ Copy it unmodified. */
+ {
+ size_t len = strlen (p);
+ if (len > fdopen_mode_buf + BUF_SIZE - q)
+ len = fdopen_mode_buf + BUF_SIZE - q;
+ memcpy (q, p, len);
+ q += len;
+ }
+#endif
+ break;
+ }
+#if GNULIB_FOPEN_GNU
+ *q = '\0';
+#endif
+ }
+
+#if FOPEN_TRAILING_SLASH_BUG
+ /* Fail if the mode requires write access and the filename ends in a slash,
+ as POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+ "A pathname that contains at least one non-<slash> character and that
+ ends with one or more trailing <slash> characters shall not be resolved
+ successfully unless the last pathname component before the trailing
+ <slash> characters names an existing directory"
+ If the named file already exists as a directory, then if a mode that
+ requires write access is specified, fopen() must fail because POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html>
+ says that it fails with errno = EISDIR in this case.
+ If the named file does not exist or does not name a directory, then
+ fopen() must fail since the file does not contain a '.' directory. */
+ {
+ size_t len = strlen (filename);
+ if (len > 0 && filename[len - 1] == '/')
+ {
+ int fd;
+ struct stat statbuf;
+ FILE *fp;
+
+ if (open_direction != O_RDONLY)
+ {
+ errno = EISDIR;
+ return NULL;
+ }
+
+ fd = open (filename, open_direction | open_flags,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+ if (fd < 0)
+ return NULL;
+
+ if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
+ {
+ close (fd);
+ errno = ENOTDIR;
+ return NULL;
+ }
+
+# if GNULIB_FOPEN_GNU
+ fp = fdopen (fd, fdopen_mode_buf);
+# else
+ fp = fdopen (fd, mode);
+# endif
+ if (fp == NULL)
+ {
+ int saved_errno = errno;
+ close (fd);
+ errno = saved_errno;
+ }
+ return fp;
+ }
+ }
+#endif
+
+#if GNULIB_FOPEN_GNU
+ if (open_flags_gnu)
+ {
+ int fd;
+ FILE *fp;
+
+ fd = open (filename, open_direction | open_flags,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+ if (fd < 0)
+ return NULL;
+
+ fp = fdopen (fd, fdopen_mode_buf);
+ if (fp == NULL)
+ {
+ int saved_errno = errno;
+ close (fd);
+ errno = saved_errno;
+ }
+ return fp;
+ }
+#endif
+
+ return orig_fopen (filename, mode);
+}
diff --git a/gl/fpurge.c b/gl/fpurge.c
new file mode 100644
index 0000000..0dcb2b7
--- /dev/null
+++ b/gl/fpurge.c
@@ -0,0 +1,150 @@
+/* Flushing buffers of a FILE stream.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.10, Android API >= 23, musl libc */
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
+#endif
+#include <stdlib.h>
+
+#include "stdio-impl.h"
+
+int
+fpurge (FILE *fp)
+{
+#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.10, Android API >= 23, musl libc */
+
+ __fpurge (fp);
+ /* The __fpurge function does not have a return value. */
+ return 0;
+
+#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin >= 1.7 */
+
+ /* Call the system's fpurge function. */
+# undef fpurge
+# if !HAVE_DECL_FPURGE
+ extern int fpurge (FILE *);
+# endif
+ int result = fpurge (fp);
+# if defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+ if (result == 0)
+ /* Correct the invariants that fpurge broke.
+ <stdio.h> on BSD systems says:
+ "The following always hold: if _flags & __SRD, _w is 0."
+ If this invariant is not fulfilled and the stream is read-write but
+ currently reading, subsequent putc or fputc calls will write directly
+ into the buffer, although they shouldn't be allowed to. */
+ if ((fp_->_flags & __SRD) != 0)
+ fp_->_w = 0;
+# endif
+ return result;
+
+#else
+
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+ /* GNU libc, BeOS, Haiku, Linux libc5 */
+ fp->_IO_read_end = fp->_IO_read_ptr;
+ fp->_IO_write_ptr = fp->_IO_write_base;
+ /* Avoid memory leak when there is an active ungetc buffer. */
+ if (fp->_IO_save_base != NULL)
+ {
+ free (fp->_IO_save_base);
+ fp->_IO_save_base = NULL;
+ }
+ return 0;
+# elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+ fp_->_p = fp_->_bf._base;
+ fp_->_r = 0;
+ fp_->_w = ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
+ ? fp_->_bf._size
+ : 0);
+ /* Avoid memory leak when there is an active ungetc buffer. */
+ if (fp_ub._base != NULL)
+ {
+ if (fp_ub._base != fp_->_ubuf)
+ free (fp_ub._base);
+ fp_ub._base = NULL;
+ }
+ return 0;
+# elif defined __EMX__ /* emx+gcc */
+ fp->_ptr = fp->_buffer;
+ fp->_rcount = 0;
+ fp->_wcount = 0;
+ fp->_ungetc_count = 0;
+ return 0;
+# elif defined __minix /* Minix */
+ fp->_ptr = fp->_buf;
+ if (fp->_ptr != NULL)
+ fp->_count = 0;
+ return 0;
+# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
+ fp_->_ptr = fp_->_base;
+ if (fp_->_ptr != NULL)
+ fp_->_cnt = 0;
+ return 0;
+# elif defined __UCLIBC__ /* uClibc */
+# ifdef __STDIO_BUFFERS
+ if (fp->__modeflags & __FLAG_WRITING)
+ fp->__bufpos = fp->__bufstart;
+ else if (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING))
+ fp->__bufpos = fp->__bufread;
+# endif
+ return 0;
+# elif defined __QNX__ /* QNX */
+ fp->_Rback = fp->_Back + sizeof (fp->_Back);
+ fp->_Rsave = NULL;
+ if (fp->_Mode & 0x2000 /* _MWRITE */)
+ /* fp->_Buf <= fp->_Next <= fp->_Wend */
+ fp->_Next = fp->_Buf;
+ else
+ /* fp->_Buf <= fp->_Next <= fp->_Rend */
+ fp->_Rend = fp->_Next;
+ return 0;
+# elif defined __MINT__ /* Atari FreeMiNT */
+ if (fp->__pushed_back)
+ {
+ fp->__bufp = fp->__pushback_bufp;
+ fp->__pushed_back = 0;
+ }
+ /* Preserve the current file position. */
+ if (fp->__target != -1)
+ fp->__target += fp->__bufp - fp->__buffer;
+ fp->__bufp = fp->__buffer;
+ /* Nothing in the buffer, next getc is nontrivial. */
+ fp->__get_limit = fp->__bufp;
+ /* Nothing in the buffer, next putc is nontrivial. */
+ fp->__put_limit = fp->__buffer;
+ return 0;
+# elif defined EPLAN9 /* Plan9 */
+ fp->rp = fp->wp = fp->lp = fp->buf;
+ return 0;
+# else
+# error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib."
+# endif
+
+#endif
+}
diff --git a/gl/freading.c b/gl/freading.c
new file mode 100644
index 0000000..b9377cb
--- /dev/null
+++ b/gl/freading.c
@@ -0,0 +1,76 @@
+/* Retrieve information about a FILE stream.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "freading.h"
+
+#include "stdio-impl.h"
+
+/* Don't use glibc's __freading function in glibc < 2.7, see
+ <https://sourceware.org/bugzilla/show_bug.cgi?id=4359> */
+#if !(HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)))
+
+bool
+freading (FILE *fp)
+{
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+ /* GNU libc, BeOS, Haiku, Linux libc5 */
+ return ((fp->_flags & _IO_NO_WRITES) != 0
+ || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+ && fp->_IO_read_base != NULL));
+# elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */
+ return (fp_->_flags & __SRD) != 0;
+# elif defined __EMX__ /* emx+gcc */
+ return (fp->_flags & _IOREAD) != 0;
+# elif defined __minix /* Minix */
+ return (fp->_flags & _IOREADING) != 0;
+# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
+# if defined __sun /* Solaris */
+ return (fp_->_flag & _IOREAD) != 0 && (fp_->_flag & _IOWRT) == 0;
+# else
+ return (fp_->_flag & _IOREAD) != 0;
+# endif
+# elif defined __UCLIBC__ /* uClibc */
+ return (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) != 0;
+# elif defined __QNX__ /* QNX */
+ return ((fp->_Mode & 0x2 /* _MOPENW */) == 0
+ || (fp->_Mode & 0x1000 /* _MREAD */) != 0);
+# elif defined __MINT__ /* Atari FreeMiNT */
+ if (!fp->__mode.__write)
+ return 1;
+ if (!fp->__mode.__read)
+ return 0;
+# ifdef _IO_CURRENTLY_GETTING /* Flag added on 2009-02-28 */
+ return (fp->__flags & _IO_CURRENTLY_GETTING) != 0;
+# else
+ return (fp->__buffer < fp->__get_limit /*|| fp->__bufp == fp->__put_limit ??*/);
+# endif
+# elif defined EPLAN9 /* Plan9 */
+ if (fp->state == 0 /* CLOSED */ || fp->state == 4 /* WR */)
+ return 0;
+ return (fp->state == 3 /* RD */ && (fp->bufl == 0 || fp->rp < fp->wp));
+# else
+# error "Please port gnulib freading.c to your platform!"
+# endif
+}
+
+#endif
diff --git a/gl/freading.h b/gl/freading.h
new file mode 100644
index 0000000..27b3abb
--- /dev/null
+++ b/gl/freading.h
@@ -0,0 +1,54 @@
+/* Retrieve information about a FILE stream.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+
+/* Return true if the stream STREAM is opened read-only, or if the
+ last operation on the stream was a read operation. Return false if
+ the stream is opened write-only or append-only, or if it supports
+ writing and there is no current read operation (such as fgetc).
+
+ freading and fwriting will never both be true. If STREAM supports
+ both reads and writes, then:
+ - both freading and fwriting might be false when the stream is first
+ opened, after read encounters EOF, or after fflush,
+ - freading might be false or true and fwriting might be false
+ after repositioning (such as fseek, fsetpos, or rewind),
+ depending on the underlying implementation.
+
+ STREAM must not be wide-character oriented. */
+
+#if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
+/* Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc */
+
+# if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+# endif
+# define freading(stream) (__freading (stream) != 0)
+
+#else
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+extern bool freading (FILE *stream) _GL_ATTRIBUTE_PURE;
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
diff --git a/gl/free.c b/gl/free.c
new file mode 100644
index 0000000..372a6b0
--- /dev/null
+++ b/gl/free.c
@@ -0,0 +1,53 @@
+/* Make free() preserve errno.
+
+ Copyright (C) 2003, 2006, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Paul Eggert */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+/* A function definition is only needed if HAVE_FREE_POSIX is not defined. */
+#if !HAVE_FREE_POSIX
+
+# include <errno.h>
+
+void
+rpl_free (void *p)
+# undef free
+{
+# if defined __GNUC__ && !defined __clang__
+ /* An invalid GCC optimization
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396>
+ would optimize away the assignments in the code below, when link-time
+ optimization (LTO) is enabled. Make the code more complicated, so that
+ GCC does not grok how to optimize it. */
+ int err[2];
+ err[0] = errno;
+ err[1] = errno;
+ errno = 0;
+ free (p);
+ errno = err[errno == 0];
+# else
+ int err = errno;
+ free (p);
+ errno = err;
+# endif
+}
+
+#endif
diff --git a/gl/fseek.c b/gl/fseek.c
new file mode 100644
index 0000000..9764375
--- /dev/null
+++ b/gl/fseek.c
@@ -0,0 +1,30 @@
+/* An fseek() function that, together with fflush(), is POSIX compliant.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Get off_t. */
+#include <unistd.h>
+
+int
+fseek (FILE *fp, long offset, int whence)
+{
+ /* Use the replacement fseeko function with all its workarounds. */
+ return fseeko (fp, (off_t)offset, whence);
+}
diff --git a/gl/fseeko.c b/gl/fseeko.c
new file mode 100644
index 0000000..89a7087
--- /dev/null
+++ b/gl/fseeko.c
@@ -0,0 +1,164 @@
+/* An fseeko() function that, together with fflush(), is POSIX compliant.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Get off_t, lseek, _POSIX_VERSION. */
+#include <unistd.h>
+
+#include "stdio-impl.h"
+
+int
+fseeko (FILE *fp, off_t offset, int whence)
+#undef fseeko
+#if !HAVE_FSEEKO
+# undef fseek
+# define fseeko fseek
+#endif
+#if _GL_WINDOWS_64_BIT_OFF_T
+# undef fseeko
+# if HAVE__FSEEKI64 && HAVE_DECL__FSEEKI64 /* msvc, mingw since msvcrt8.0, mingw64 */
+# define fseeko _fseeki64
+# else /* mingw before msvcrt8.0 */
+# define fseeko fseeko64
+# endif
+#endif
+{
+#if LSEEK_PIPE_BROKEN
+ /* mingw gives bogus answers rather than failure on non-seekable files. */
+ if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
+ return EOF;
+#endif
+
+ /* These tests are based on fpurge.c. */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+ /* GNU libc, BeOS, Haiku, Linux libc5 */
+ if (fp->_IO_read_end == fp->_IO_read_ptr
+ && fp->_IO_write_ptr == fp->_IO_write_base
+ && fp->_IO_save_base == NULL)
+#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+# if defined __SL64 && defined __SCLE /* Cygwin */
+ if ((fp->_flags & __SL64) == 0)
+ {
+ /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
+ mode; but has an fseeko that requires 64-bit mode. */
+ FILE *tmp = fopen ("/dev/null", "r");
+ if (!tmp)
+ return -1;
+ fp->_flags |= __SL64;
+ fp->_seek64 = tmp->_seek64;
+ fclose (tmp);
+ }
+# endif
+ if (fp_->_p == fp_->_bf._base
+ && fp_->_r == 0
+ && fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
+ ? fp_->_bf._size
+ : 0)
+ && fp_ub._base == NULL)
+#elif defined __EMX__ /* emx+gcc */
+ if (fp->_ptr == fp->_buffer
+ && fp->_rcount == 0
+ && fp->_wcount == 0
+ && fp->_ungetc_count == 0)
+#elif defined __minix /* Minix */
+ if (fp_->_ptr == fp_->_buf
+ && (fp_->_ptr == NULL || fp_->_count == 0))
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
+ if (fp_->_ptr == fp_->_base
+ && (fp_->_ptr == NULL || fp_->_cnt == 0))
+#elif defined __UCLIBC__ /* uClibc */
+ if (((fp->__modeflags & __FLAG_WRITING) == 0
+ || fp->__bufpos == fp->__bufstart)
+ && ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0
+ || fp->__bufpos == fp->__bufread))
+#elif defined __QNX__ /* QNX */
+ if ((fp->_Mode & 0x2000 /* _MWRITE */ ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
+ && fp->_Rback == fp->_Back + sizeof (fp->_Back)
+ && fp->_Rsave == NULL)
+#elif defined __MINT__ /* Atari FreeMiNT */
+ if (fp->__bufp == fp->__buffer
+ && fp->__get_limit == fp->__bufp
+ && fp->__put_limit == fp->__bufp
+ && !fp->__pushed_back)
+#elif defined EPLAN9 /* Plan9 */
+ if (fp->rp == fp->buf
+ && fp->wp == fp->buf)
+#elif FUNC_FFLUSH_STDIN < 0 && 200809 <= _POSIX_VERSION
+ /* Cross-compiling to some other system advertising conformance to
+ POSIX.1-2008 or later. Assume fseeko and fflush work as advertised.
+ If this assumption is incorrect, please report the bug to
+ bug-gnulib. */
+ if (0)
+#else
+ #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
+#endif
+ {
+ /* We get here when an fflush() call immediately preceded this one (or
+ if ftell() has created buffers but no I/O has occurred on a
+ newly-opened stream). We know there are no buffers. */
+ off_t pos = lseek (fileno (fp), offset, whence);
+ if (pos == -1)
+ {
+#if defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+ fp_->_flags &= ~__SOFF;
+#endif
+ return -1;
+ }
+
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+ /* GNU libc, BeOS, Haiku, Linux libc5 */
+ fp->_flags &= ~_IO_EOF_SEEN;
+ fp->_offset = pos;
+#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >= 600000000) || defined __minix
+ /* fp_->_offset is typed as an integer. */
+ fp_->_offset = pos;
+# else
+ /* fp_->_offset is an fpos_t. */
+ {
+ /* Use a union, since on NetBSD, the compilation flags
+ determine whether fpos_t is typedef'd to off_t or a struct
+ containing a single off_t member. */
+ union
+ {
+ fpos_t f;
+ off_t o;
+ } u;
+ u.o = pos;
+ fp_->_offset = u.f;
+ }
+# endif
+ fp_->_flags |= __SOFF;
+ fp_->_flags &= ~__SEOF;
+#elif defined __EMX__ /* emx+gcc */
+ fp->_flags &= ~_IOEOF;
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
+ fp_->_flag &= ~_IOEOF;
+#elif defined __MINT__ /* Atari FreeMiNT */
+ fp->__offset = pos;
+ fp->__eof = 0;
+#endif
+ return 0;
+ }
+ return fseeko (fp, offset, whence);
+}
diff --git a/gl/fstat.c b/gl/fstat.c
new file mode 100644
index 0000000..6a23500
--- /dev/null
+++ b/gl/fstat.c
@@ -0,0 +1,94 @@
+/* fstat() replacement.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_fstat doesn't recurse to
+ rpl_fstat. */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of fstat. It might be defined as a macro. */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+#endif
+
+#if !defined WINDOWS_NATIVE
+
+static int
+orig_fstat (int fd, struct stat *buf)
+{
+ return fstat (fd, buf);
+}
+
+#endif
+
+/* Specification. */
+#ifdef __osf__
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include <sys/stat.h>
+ above. */
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
+#endif
+
+#include "stat-time.h"
+
+#include <errno.h>
+#include <unistd.h>
+#ifdef WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+# include "stat-w32.h"
+#endif
+
+int
+rpl_fstat (int fd, struct stat *buf)
+{
+#if REPLACE_FCHDIR && REPLACE_OPEN_DIRECTORY
+ /* Handle the case when rpl_open() used a dummy file descriptor to work
+ around an open() that can't normally visit directories. */
+ const char *name = _gl_directory_name (fd);
+ if (name != NULL)
+ return stat (name, buf);
+#endif
+
+#ifdef WINDOWS_NATIVE
+ /* Fill the fields ourselves, because the original fstat function returns
+ values for st_atime, st_mtime, st_ctime that depend on the current time
+ zone. See
+ <https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html> */
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ return _gl_fstat_by_handle (h, NULL, buf);
+#else
+ return stat_time_normalize (orig_fstat (fd, buf), buf);
+#endif
+}
diff --git a/gl/fsusage.c b/gl/fsusage.c
new file mode 100644
index 0000000..f6f4b1c
--- /dev/null
+++ b/gl/fsusage.c
@@ -0,0 +1,233 @@
+/* fsusage.c -- return space usage of mounted file systems
+
+ Copyright (C) 1991-1992, 1996, 1998-1999, 2002-2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "fsusage.h"
+
+#include <limits.h>
+#include <sys/types.h>
+
+#if STAT_STATVFS || STAT_STATVFS64 /* POSIX 1003.1-2001 (and later) with XSI */
+# include <sys/statvfs.h>
+#else
+/* Don't include backward-compatibility files unless they're needed.
+ Eventually we'd like to remove all this cruft. */
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/stat.h>
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
+# if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */
+# include <sys/fs/s5param.h>
+# endif
+# if HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
+# endif
+#endif
+
+/* Many space usage primitives use all 1 bits to denote a value that is
+ not applicable or unknown. Propagate this information by returning
+ a uintmax_t value that is all 1 bits if X is all 1 bits, even if X
+ is unsigned and narrower than uintmax_t. */
+#define PROPAGATE_ALL_ONES(x) \
+ ((sizeof (x) < sizeof (uintmax_t) \
+ && (~ (x) == (sizeof (x) < sizeof (int) \
+ ? - (1 << (sizeof (x) * CHAR_BIT)) \
+ : 0))) \
+ ? UINTMAX_MAX : (uintmax_t) (x))
+
+/* Extract the top bit of X as an uintmax_t value. */
+#define EXTRACT_TOP_BIT(x) ((x) \
+ & ((uintmax_t) 1 << (sizeof (x) * CHAR_BIT - 1)))
+
+/* If a value is negative, many space usage primitives store it into an
+ integer variable by assignment, even if the variable's type is unsigned.
+ So, if a space usage variable X's top bit is set, convert X to the
+ uintmax_t value V such that (- (uintmax_t) V) is the negative of
+ the original value. If X's top bit is clear, just yield X.
+ Use PROPAGATE_TOP_BIT if the original value might be negative;
+ otherwise, use PROPAGATE_ALL_ONES. */
+#define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
+
+#ifdef STAT_STATVFS
+/* Return true if statvfs works. This is false for statvfs on systems
+ with GNU libc on Linux kernels before 2.6.36, which stats all
+ preceding entries in /proc/mounts; that makes df hang if even one
+ of the corresponding file systems is hard-mounted but not available. */
+# if ! (__linux__ && (__GLIBC__ || __UCLIBC__))
+/* The FRSIZE fallback is not required in this case. */
+# undef STAT_STATFS2_FRSIZE
+static int statvfs_works (void) { return 1; }
+# else
+# include <string.h> /* for strverscmp */
+# include <sys/utsname.h>
+# include <sys/statfs.h>
+# define STAT_STATFS2_BSIZE 1
+
+static int
+statvfs_works (void)
+{
+ static int statvfs_works_cache = -1;
+ struct utsname name;
+ if (statvfs_works_cache < 0)
+ statvfs_works_cache = (uname (&name) == 0
+ && 0 <= strverscmp (name.release, "2.6.36"));
+ return statvfs_works_cache;
+}
+# endif
+#endif
+
+
+/* Fill in the fields of FSP with information about space usage for
+ the file system on which FILE resides.
+ DISK is the device on which FILE is mounted, for space-getting
+ methods that need to know it.
+ Return 0 if successful, -1 if not. When returning -1, ensure that
+ ERRNO is either a system error value, or zero if DISK is NULL
+ on a system that requires a non-NULL value. */
+int
+get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
+{
+#ifdef STAT_STATVFS /* POSIX, except pre-2.6.36 glibc/Linux */
+
+ if (statvfs_works ())
+ {
+ struct statvfs vfsd;
+
+ if (statvfs (file, &vfsd) < 0)
+ return -1;
+
+ /* f_frsize isn't guaranteed to be supported. */
+ fsp->fsu_blocksize = (vfsd.f_frsize
+ ? PROPAGATE_ALL_ONES (vfsd.f_frsize)
+ : PROPAGATE_ALL_ONES (vfsd.f_bsize));
+
+ fsp->fsu_blocks = PROPAGATE_ALL_ONES (vfsd.f_blocks);
+ fsp->fsu_bfree = PROPAGATE_ALL_ONES (vfsd.f_bfree);
+ fsp->fsu_bavail = PROPAGATE_TOP_BIT (vfsd.f_bavail);
+ fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (vfsd.f_bavail) != 0;
+ fsp->fsu_files = PROPAGATE_ALL_ONES (vfsd.f_files);
+ fsp->fsu_ffree = PROPAGATE_ALL_ONES (vfsd.f_ffree);
+ return 0;
+ }
+
+#endif
+
+#if defined STAT_STATVFS64 /* AIX */
+
+ struct statvfs64 fsd;
+
+ if (statvfs64 (file, &fsd) < 0)
+ return -1;
+
+ /* f_frsize isn't guaranteed to be supported. */
+ fsp->fsu_blocksize = (fsd.f_frsize
+ ? PROPAGATE_ALL_ONES (fsd.f_frsize)
+ : PROPAGATE_ALL_ONES (fsd.f_bsize));
+
+#elif defined STAT_STATFS3_OSF1 /* OSF/1 */
+
+ struct statfs fsd;
+
+ if (statfs (file, &fsd, sizeof (struct statfs)) != 0)
+ return -1;
+
+ fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
+
+#elif defined STAT_STATFS2_FRSIZE /* 2.6 < glibc/Linux < 2.6.36 */
+
+ struct statfs fsd;
+
+ if (statfs (file, &fsd) < 0)
+ return -1;
+
+ fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_frsize);
+
+#elif defined STAT_STATFS2_BSIZE /* glibc/Linux < 2.6, 4.3BSD, SunOS 4, \
+ Mac OS X < 10.4, FreeBSD < 5.0, \
+ NetBSD < 3.0, OpenBSD < 4.4 */
+
+ struct statfs fsd;
+
+ if (statfs (file, &fsd) < 0)
+ return -1;
+
+ fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
+
+# ifdef STATFS_TRUNCATES_BLOCK_COUNTS
+
+ /* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the
+ struct statfs are truncated to 2GB. These conditions detect that
+ truncation, presumably without botching the 4.1.1 case, in which
+ the values are not truncated. The correct counts are stored in
+ undocumented spare fields. */
+ if (fsd.f_blocks == 0x7fffffff / fsd.f_bsize && fsd.f_spare[0] > 0)
+ {
+ fsd.f_blocks = fsd.f_spare[0];
+ fsd.f_bfree = fsd.f_spare[1];
+ fsd.f_bavail = fsd.f_spare[2];
+ }
+# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
+
+#elif defined STAT_STATFS2_FSIZE /* 4.4BSD and older NetBSD */
+
+ struct statfs fsd;
+
+ if (statfs (file, &fsd) < 0)
+ return -1;
+
+ fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
+
+#elif defined STAT_STATFS4 /* SVR3, old Irix */
+
+ struct statfs fsd;
+
+ if (statfs (file, &fsd, sizeof fsd, 0) < 0)
+ return -1;
+
+ /* Empirically, the block counts on most SVR3 and SVR3-derived
+ systems seem to always be in terms of 512-byte blocks,
+ no matter what value f_bsize has. */
+ fsp->fsu_blocksize = 512;
+
+#endif
+
+#if (defined STAT_STATVFS64 || defined STAT_STATFS3_OSF1 \
+ || defined STAT_STATFS2_FRSIZE || defined STAT_STATFS2_BSIZE \
+ || defined STAT_STATFS2_FSIZE || defined STAT_STATFS4)
+
+ fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.f_blocks);
+ fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.f_bfree);
+ fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.f_bavail);
+ fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.f_bavail) != 0;
+ fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.f_files);
+ fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.f_ffree);
+
+#endif
+
+ (void) disk; /* avoid argument-unused warning */
+ return 0;
+}
diff --git a/gl/fsusage.h b/gl/fsusage.h
new file mode 100644
index 0000000..9630b04
--- /dev/null
+++ b/gl/fsusage.h
@@ -0,0 +1,39 @@
+/* fsusage.h -- declarations for file system space usage info
+
+ Copyright (C) 1991-1992, 1997, 2003-2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Space usage statistics for a file system. Blocks are 512-byte. */
+
+#if !defined FSUSAGE_H_
+# define FSUSAGE_H_
+
+# include <stdint.h>
+
+struct fs_usage
+{
+ uintmax_t fsu_blocksize; /* Size of a block. */
+ uintmax_t fsu_blocks; /* Total blocks. */
+ uintmax_t fsu_bfree; /* Free blocks available to superuser. */
+ uintmax_t fsu_bavail; /* Free blocks available to non-superuser. */
+ bool fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0. */
+ uintmax_t fsu_files; /* Total file nodes. */
+ uintmax_t fsu_ffree; /* Free file nodes. */
+};
+
+int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
+
+#endif
diff --git a/gl/ftell.c b/gl/ftell.c
new file mode 100644
index 0000000..ce2bd54
--- /dev/null
+++ b/gl/ftell.c
@@ -0,0 +1,37 @@
+/* An ftell() function that works around platform bugs.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+#include <limits.h>
+
+long
+ftell (FILE *fp)
+{
+ /* Use the replacement ftello function with all its workarounds. */
+ off_t offset = ftello (fp);
+ if (LONG_MIN <= offset && offset <= LONG_MAX)
+ return /* (long) */ offset;
+ else
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+}
diff --git a/gl/ftello.c b/gl/ftello.c
new file mode 100644
index 0000000..14184e5
--- /dev/null
+++ b/gl/ftello.c
@@ -0,0 +1,157 @@
+/* An ftello() function that works around platform bugs.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+#include "intprops.h"
+
+/* Get lseek. */
+#include <unistd.h>
+
+#include "stdio-impl.h"
+
+off_t
+ftello (FILE *fp)
+#undef ftello
+#if !HAVE_FTELLO
+# undef ftell
+# define ftello ftell
+#endif
+#if _GL_WINDOWS_64_BIT_OFF_T
+# undef ftello
+# if HAVE__FTELLI64 /* msvc, mingw64 */
+# define ftello _ftelli64
+# else /* mingw */
+# define ftello ftello64
+# endif
+#endif
+{
+#if FTELLO_BROKEN_AFTER_UNGETC /* macOS >= 10.15 */
+ /* The system's ftello() is completely broken, because it calls __sflush,
+ which makes side effects on the stream. */
+
+ /* Handle non-seekable files first. */
+ if (fp->_file < 0 || fp->_seek == NULL)
+ {
+ errno = ESPIPE;
+ return -1;
+ }
+
+ /* Determine the current offset, ignoring buffered and pushed-back bytes. */
+ off_t pos;
+
+ if (fp->_flags & __SOFF)
+ pos = fp->_offset;
+ else
+ {
+ pos = fp->_seek (fp->_cookie, 0, SEEK_CUR);
+ if (pos < 0)
+ return -1;
+ if (fp->_flags & __SOPT)
+ {
+ fp->_offset = pos;
+ fp->_flags |= __SOFF;
+ }
+ }
+
+ if (fp->_flags & __SRD)
+ {
+ /* Now consider buffered and pushed-back bytes from ungetc. */
+ if (fp->_ub._base != NULL)
+ /* Considering the buffered bytes, we are at position
+ pos - fp->_ur.
+ Considering also the pushed-back bytes, we are at position
+ pos - fp->_ur - fp->_r. */
+ pos = pos - fp->_ur - fp->_r;
+ else
+ /* Considering the buffered bytes, we are at position
+ pos - fp->_r. */
+ pos = pos - fp->_r;
+ if (pos < 0)
+ {
+ errno = EIO;
+ return -1;
+ }
+ }
+ else if ((fp->_flags & __SWR) && fp->_p != NULL)
+ {
+ /* Consider the buffered bytes. */
+ off_t buffered = fp->_p - fp->_bf._base;
+
+ /* Compute pos + buffered, with overflow check. */
+ off_t sum;
+ if (! INT_ADD_OK (pos, buffered, &sum))
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ pos = sum;
+ }
+
+ return pos;
+
+#else
+
+# if LSEEK_PIPE_BROKEN
+ /* mingw gives bogus answers rather than failure on non-seekable files. */
+ if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
+ return -1;
+# endif
+
+# if FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE /* Solaris */
+ /* The Solaris stdio leaves the _IOREAD flag set after reading from a file
+ reaches EOF and the program then starts writing to the file. ftello
+ gets confused by this. */
+ if (fp_->_flag & _IOWRT)
+ {
+ off_t pos;
+
+ /* Call ftello nevertheless, for the side effects that it does on fp. */
+ ftello (fp);
+
+ /* Compute the file position ourselves. */
+ pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR);
+ if (pos >= 0)
+ {
+ if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL)
+ pos += fp_->_ptr - fp_->_base;
+ }
+ return pos;
+ }
+# endif
+
+# if defined __SL64 && defined __SCLE /* Cygwin */
+ if ((fp->_flags & __SL64) == 0)
+ {
+ /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
+ mode; but has an ftello that requires 64-bit mode. */
+ FILE *tmp = fopen ("/dev/null", "r");
+ if (!tmp)
+ return -1;
+ fp->_flags |= __SL64;
+ fp->_seek64 = tmp->_seek64;
+ fclose (tmp);
+ }
+# endif
+
+ return ftello (fp);
+
+#endif
+}
diff --git a/gl/gai_strerror.c b/gl/gai_strerror.c
new file mode 100644
index 0000000..3436c07
--- /dev/null
+++ b/gl/gai_strerror.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2023 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <netdb.h>
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "gettext.h"
+# define _(String) gettext (String)
+# define N_(String) String
+#endif
+
+#if HAVE_DECL_GAI_STRERROR
+
+# include <sys/socket.h>
+# undef gai_strerror
+# if HAVE_DECL_GAI_STRERRORA
+# define gai_strerror gai_strerrorA
+# endif
+
+const char *
+rpl_gai_strerror (int code)
+{
+ return gai_strerror (code);
+}
+
+#else /* !HAVE_DECL_GAI_STRERROR */
+
+static struct
+ {
+ int code;
+ const char *msg;
+ }
+values[] =
+ {
+ { EAI_ADDRFAMILY, N_("Address family for hostname not supported") },
+ { EAI_AGAIN, N_("Temporary failure in name resolution") },
+ { EAI_BADFLAGS, N_("Bad value for ai_flags") },
+ { EAI_FAIL, N_("Non-recoverable failure in name resolution") },
+ { EAI_FAMILY, N_("ai_family not supported") },
+ { EAI_MEMORY, N_("Memory allocation failure") },
+ { EAI_NODATA, N_("No address associated with hostname") },
+ { EAI_NONAME, N_("Name or service not known") },
+ { EAI_SERVICE, N_("Servname not supported for ai_socktype") },
+ { EAI_SOCKTYPE, N_("ai_socktype not supported") },
+ { EAI_SYSTEM, N_("System error") },
+ { EAI_OVERFLOW, N_("Argument buffer too small") },
+#ifdef EAI_INPROGRESS
+ { EAI_INPROGRESS, N_("Processing request in progress") },
+ { EAI_CANCELED, N_("Request canceled") },
+ { EAI_NOTCANCELED, N_("Request not canceled") },
+ { EAI_ALLDONE, N_("All requests done") },
+ { EAI_INTR, N_("Interrupted by a signal") },
+ { EAI_IDN_ENCODE, N_("Parameter string not correctly encoded") }
+#endif
+ };
+
+const char *
+gai_strerror (int code)
+{
+ size_t i;
+ for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i)
+ if (values[i].code == code)
+ return _(values[i].msg);
+
+ return _("Unknown error");
+}
+# ifdef _LIBC
+libc_hidden_def (gai_strerror)
+# endif
+#endif /* !HAVE_DECL_GAI_STRERROR */
diff --git a/gl/getaddrinfo.c b/gl/getaddrinfo.c
new file mode 100644
index 0000000..6586ee5
--- /dev/null
+++ b/gl/getaddrinfo.c
@@ -0,0 +1,503 @@
+/* Get address information (partial implementation).
+ Copyright (C) 1997, 2001-2002, 2004-2023 Free Software Foundation, Inc.
+ Contributed by Simon Josefsson <simon@josefsson.org>.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the sa == NULL test below. */
+#define _GL_ARG_NONNULL(params)
+
+#include <config.h>
+
+#include <netdb.h>
+
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+/* Get inet_ntop. */
+#include <arpa/inet.h>
+
+/* Get calloc. */
+#include <stdlib.h>
+
+/* Get memcpy, strdup. */
+#include <string.h>
+
+/* Get snprintf. */
+#include <stdio.h>
+
+#include "gettext.h"
+#define _(String) gettext (String)
+#define N_(String) String
+
+/* BeOS has AF_INET, but not PF_INET. */
+#ifndef PF_INET
+# define PF_INET AF_INET
+#endif
+/* BeOS also lacks PF_UNSPEC. */
+#ifndef PF_UNSPEC
+# define PF_UNSPEC 0
+#endif
+
+#if HAVE_GETADDRINFO
+
+/* Override with cdecl calling convention. */
+
+int
+getaddrinfo (const char *restrict nodename,
+ const char *restrict servname,
+ const struct addrinfo *restrict hints,
+ struct addrinfo **restrict res)
+# undef getaddrinfo
+{
+ return getaddrinfo (nodename, servname, hints, res);
+}
+
+void
+freeaddrinfo (struct addrinfo *ai)
+# undef freeaddrinfo
+{
+ freeaddrinfo (ai);
+}
+
+#else
+
+# if defined _WIN32 && !defined __CYGWIN__
+# define WINDOWS_NATIVE
+# endif
+
+/* gl_sockets_startup */
+# include "sockets.h"
+
+# ifdef WINDOWS_NATIVE
+
+/* Don't assume that UNICODE is not defined. */
+# undef GetModuleHandle
+# define GetModuleHandle GetModuleHandleA
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WINXP)
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
+typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
+ const struct addrinfo*,
+ struct addrinfo**);
+typedef void (WSAAPI *freeaddrinfo_func) (struct addrinfo*);
+typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr*,
+ socklen_t, char*, DWORD,
+ char*, DWORD, int);
+
+static getaddrinfo_func getaddrinfo_ptr = NULL;
+static freeaddrinfo_func freeaddrinfo_ptr = NULL;
+static getnameinfo_func getnameinfo_ptr = NULL;
+
+static int
+use_win32_p (void)
+{
+ static int done = 0;
+ HMODULE h;
+
+ if (done)
+ return getaddrinfo_ptr ? 1 : 0;
+
+ done = 1;
+
+ h = GetModuleHandle ("ws2_32.dll");
+
+ if (h)
+ {
+ getaddrinfo_ptr = (getaddrinfo_func) GetProcAddress (h, "getaddrinfo");
+ freeaddrinfo_ptr = (freeaddrinfo_func) GetProcAddress (h, "freeaddrinfo");
+ getnameinfo_ptr = (getnameinfo_func) GetProcAddress (h, "getnameinfo");
+ }
+
+ /* If either is missing, something is odd. */
+ if (!getaddrinfo_ptr || !freeaddrinfo_ptr || !getnameinfo_ptr)
+ {
+ getaddrinfo_ptr = NULL;
+ freeaddrinfo_ptr = NULL;
+ getnameinfo_ptr = NULL;
+ return 0;
+ }
+
+ gl_sockets_startup (SOCKETS_1_1);
+
+ return 1;
+}
+
+# else
+
+static int
+use_win32_p (void)
+{
+ static int done = 0;
+
+ if (!done)
+ {
+ done = 1;
+
+ gl_sockets_startup (SOCKETS_1_1);
+ }
+
+ return 1;
+}
+
+# define getaddrinfo_ptr getaddrinfo
+# define freeaddrinfo_ptr freeaddrinfo
+# define getnameinfo_ptr getnameinfo
+
+# endif
+# endif
+
+static bool
+validate_family (int family)
+{
+ /* FIXME: Support more families. */
+# if HAVE_IPV4
+ if (family == PF_INET)
+ return true;
+# endif
+# if HAVE_IPV6
+ if (family == PF_INET6)
+ return true;
+# endif
+ if (family == PF_UNSPEC)
+ return true;
+ return false;
+}
+
+/* Translate name of a service location and/or a service name to set of
+ socket addresses. */
+int
+getaddrinfo (const char *restrict nodename,
+ const char *restrict servname,
+ const struct addrinfo *restrict hints,
+ struct addrinfo **restrict res)
+#undef getaddrinfo
+{
+ struct addrinfo *tmp;
+ int port = 0;
+ struct hostent *he;
+ void *storage;
+ size_t size;
+# if HAVE_IPV6
+ struct v6_pair {
+ struct addrinfo addrinfo;
+ struct sockaddr_in6 sockaddr_in6;
+ };
+# endif
+# if HAVE_IPV4
+ struct v4_pair {
+ struct addrinfo addrinfo;
+ struct sockaddr_in sockaddr_in;
+ };
+# endif
+
+# ifdef WINDOWS_NATIVE
+ if (use_win32_p ())
+ return getaddrinfo_ptr (nodename, servname, hints, res);
+# endif
+
+ if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
+ /* FIXME: Support more flags. */
+ return EAI_BADFLAGS;
+
+ if (hints && !validate_family (hints->ai_family))
+ return EAI_FAMILY;
+
+ if (hints &&
+ hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != SOCK_DGRAM)
+ /* FIXME: Support other socktype. */
+ return EAI_SOCKTYPE; /* FIXME: Better return code? */
+
+ if (!nodename)
+ {
+ if (!(hints->ai_flags & AI_PASSIVE))
+ return EAI_NONAME;
+
+# ifdef HAVE_IPV6
+ nodename = (hints->ai_family == AF_INET6) ? "::" : "0.0.0.0";
+# else
+ nodename = "0.0.0.0";
+# endif
+ }
+
+ if (servname)
+ {
+ struct servent *se = NULL;
+ const char *proto =
+ (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
+
+ if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV))
+ /* FIXME: Use getservbyname_r if available. */
+ se = getservbyname (servname, proto);
+
+ if (!se)
+ {
+ char *c;
+ if (!(*servname >= '0' && *servname <= '9'))
+ return EAI_NONAME;
+ port = strtoul (servname, &c, 10);
+ if (*c || port > 0xffff)
+ return EAI_NONAME;
+ port = htons (port);
+ }
+ else
+ port = se->s_port;
+ }
+
+ /* FIXME: Use gethostbyname_r if available. */
+ he = gethostbyname (nodename);
+ if (!he || he->h_addr_list[0] == NULL)
+ return EAI_NONAME;
+
+ switch (he->h_addrtype)
+ {
+# if HAVE_IPV6
+ case PF_INET6:
+ size = sizeof (struct v6_pair);
+ break;
+# endif
+
+# if HAVE_IPV4
+ case PF_INET:
+ size = sizeof (struct v4_pair);
+ break;
+# endif
+
+ default:
+ return EAI_NODATA;
+ }
+
+ storage = calloc (1, size);
+ if (!storage)
+ return EAI_MEMORY;
+
+ switch (he->h_addrtype)
+ {
+# if HAVE_IPV6
+ case PF_INET6:
+ {
+ struct v6_pair *p = storage;
+ struct sockaddr_in6 *sinp = &p->sockaddr_in6;
+ tmp = &p->addrinfo;
+
+ if (port)
+ sinp->sin6_port = port;
+
+ if (he->h_length != sizeof (sinp->sin6_addr))
+ {
+ free (storage);
+ return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
+ }
+
+ memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr);
+
+ tmp->ai_addr = (struct sockaddr *) sinp;
+ tmp->ai_addrlen = sizeof *sinp;
+ }
+ break;
+# endif
+
+# if HAVE_IPV4
+ case PF_INET:
+ {
+ struct v4_pair *p = storage;
+ struct sockaddr_in *sinp = &p->sockaddr_in;
+ tmp = &p->addrinfo;
+
+ if (port)
+ sinp->sin_port = port;
+
+ if (he->h_length != sizeof (sinp->sin_addr))
+ {
+ free (storage);
+ return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
+ }
+
+ memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr);
+
+ tmp->ai_addr = (struct sockaddr *) sinp;
+ tmp->ai_addrlen = sizeof *sinp;
+ }
+ break;
+# endif
+
+ default:
+ free (storage);
+ return EAI_NODATA;
+ }
+
+ if (hints && hints->ai_flags & AI_CANONNAME)
+ {
+ const char *cn;
+ if (he->h_name)
+ cn = he->h_name;
+ else
+ cn = nodename;
+
+ tmp->ai_canonname = strdup (cn);
+ if (!tmp->ai_canonname)
+ {
+ free (storage);
+ return EAI_MEMORY;
+ }
+ }
+
+ tmp->ai_protocol = (hints) ? hints->ai_protocol : 0;
+ tmp->ai_socktype = (hints) ? hints->ai_socktype : 0;
+ tmp->ai_addr->sa_family = he->h_addrtype;
+ tmp->ai_family = he->h_addrtype;
+
+# ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
+ switch (he->h_addrtype)
+ {
+# if HAVE_IPV4
+ case AF_INET:
+ tmp->ai_addr->sa_len = sizeof (struct sockaddr_in);
+ break;
+# endif
+# if HAVE_IPV6
+ case AF_INET6:
+ tmp->ai_addr->sa_len = sizeof (struct sockaddr_in6);
+ break;
+# endif
+ }
+# endif
+
+ /* FIXME: If more than one address, create linked list of addrinfo's. */
+
+ *res = tmp;
+
+ return 0;
+}
+
+/* Free 'addrinfo' structure AI including associated storage. */
+void
+freeaddrinfo (struct addrinfo *ai)
+#undef freeaddrinfo
+{
+# ifdef WINDOWS_NATIVE
+ if (use_win32_p ())
+ {
+ freeaddrinfo_ptr (ai);
+ return;
+ }
+# endif
+
+ while (ai)
+ {
+ struct addrinfo *cur;
+
+ cur = ai;
+ ai = ai->ai_next;
+
+ free (cur->ai_canonname);
+ free (cur);
+ }
+}
+
+int
+getnameinfo (const struct sockaddr *restrict sa, socklen_t salen,
+ char *restrict node, socklen_t nodelen,
+ char *restrict service, socklen_t servicelen,
+ int flags)
+#undef getnameinfo
+{
+# ifdef WINDOWS_NATIVE
+ if (use_win32_p ())
+ return getnameinfo_ptr (sa, salen, node, nodelen,
+ service, servicelen, flags);
+# endif
+
+ /* FIXME: Support other flags. */
+ if ((node && nodelen > 0 && !(flags & NI_NUMERICHOST)) ||
+ (service && servicelen > 0 && !(flags & NI_NUMERICHOST)) ||
+ (flags & ~(NI_NUMERICHOST|NI_NUMERICSERV)))
+ return EAI_BADFLAGS;
+
+ if (sa == NULL || salen < sizeof (sa->sa_family))
+ return EAI_FAMILY;
+
+ switch (sa->sa_family)
+ {
+# if HAVE_IPV4
+ case AF_INET:
+ if (salen < sizeof (struct sockaddr_in))
+ return EAI_FAMILY;
+ break;
+# endif
+# if HAVE_IPV6
+ case AF_INET6:
+ if (salen < sizeof (struct sockaddr_in6))
+ return EAI_FAMILY;
+ break;
+# endif
+ default:
+ return EAI_FAMILY;
+ }
+
+ if (node && nodelen > 0 && flags & NI_NUMERICHOST)
+ {
+ switch (sa->sa_family)
+ {
+# if HAVE_IPV4
+ case AF_INET:
+ if (!inet_ntop (AF_INET,
+ &(((const struct sockaddr_in *) sa)->sin_addr),
+ node, nodelen))
+ return EAI_SYSTEM;
+ break;
+# endif
+
+# if HAVE_IPV6
+ case AF_INET6:
+ if (!inet_ntop (AF_INET6,
+ &(((const struct sockaddr_in6 *) sa)->sin6_addr),
+ node, nodelen))
+ return EAI_SYSTEM;
+ break;
+# endif
+
+ default:
+ return EAI_FAMILY;
+ }
+ }
+
+ if (service && servicelen > 0 && flags & NI_NUMERICSERV)
+ switch (sa->sa_family)
+ {
+# if HAVE_IPV4
+ case AF_INET:
+# endif
+# if HAVE_IPV6
+ case AF_INET6:
+# endif
+ {
+ unsigned short int port
+ = ntohs (((const struct sockaddr_in *) sa)->sin_port);
+ if (servicelen <= snprintf (service, servicelen, "%u", port))
+ return EAI_OVERFLOW;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+#endif
diff --git a/gl/getdelim.c b/gl/getdelim.c
new file mode 100644
index 0000000..79ec3dd
--- /dev/null
+++ b/gl/getdelim.c
@@ -0,0 +1,147 @@
+/* getdelim.c --- Implementation of replacement getdelim function.
+ Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Ported from glibc by Simon Josefsson. */
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the lineptr == NULL || n == NULL || fp == NULL tests below. */
+#define _GL_ARG_NONNULL(params)
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <limits.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
+#endif
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+# define getc_maybe_unlocked(fp) getc(fp)
+#elif !HAVE_FLOCKFILE || !HAVE_FUNLOCKFILE || !HAVE_DECL_GETC_UNLOCKED
+# undef flockfile
+# undef funlockfile
+# define flockfile(x) ((void) 0)
+# define funlockfile(x) ((void) 0)
+# define getc_maybe_unlocked(fp) getc(fp)
+#else
+# define getc_maybe_unlocked(fp) getc_unlocked(fp)
+#endif
+
+static void
+alloc_failed (void)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+ /* Avoid errno problem without using the realloc module; see:
+ https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */
+ errno = ENOMEM;
+#endif
+}
+
+/* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
+ NUL-terminate it). *LINEPTR is a pointer returned from malloc (or
+ NULL), pointing to *N characters of space. It is realloc'ed as
+ necessary. Returns the number of characters read (not including
+ the null terminator), or -1 on error or EOF. */
+
+ssize_t
+getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
+{
+ ssize_t result;
+ size_t cur_len = 0;
+
+ if (lineptr == NULL || n == NULL || fp == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ flockfile (fp);
+
+ if (*lineptr == NULL || *n == 0)
+ {
+ char *new_lineptr;
+ *n = 120;
+ new_lineptr = (char *) realloc (*lineptr, *n);
+ if (new_lineptr == NULL)
+ {
+ alloc_failed ();
+ result = -1;
+ goto unlock_return;
+ }
+ *lineptr = new_lineptr;
+ }
+
+ for (;;)
+ {
+ int i;
+
+ i = getc_maybe_unlocked (fp);
+ if (i == EOF)
+ {
+ result = -1;
+ break;
+ }
+
+ /* Make enough space for len+1 (for final NUL) bytes. */
+ if (cur_len + 1 >= *n)
+ {
+ size_t needed_max =
+ SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
+ size_t needed = 2 * *n + 1; /* Be generous. */
+ char *new_lineptr;
+
+ if (needed_max < needed)
+ needed = needed_max;
+ if (cur_len + 1 >= needed)
+ {
+ result = -1;
+ errno = EOVERFLOW;
+ goto unlock_return;
+ }
+
+ new_lineptr = (char *) realloc (*lineptr, needed);
+ if (new_lineptr == NULL)
+ {
+ alloc_failed ();
+ result = -1;
+ goto unlock_return;
+ }
+
+ *lineptr = new_lineptr;
+ *n = needed;
+ }
+
+ (*lineptr)[cur_len] = i;
+ cur_len++;
+
+ if (i == delimiter)
+ break;
+ }
+ (*lineptr)[cur_len] = '\0';
+ result = cur_len ? cur_len : result;
+
+ unlock_return:
+ funlockfile (fp); /* doesn't set errno */
+
+ return result;
+}
diff --git a/gl/getdtablesize.c b/gl/getdtablesize.c
new file mode 100644
index 0000000..ac2d175
--- /dev/null
+++ b/gl/getdtablesize.c
@@ -0,0 +1,124 @@
+/* getdtablesize() function: Return maximum possible file descriptor value + 1.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+# include <stdio.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+# endif
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+_setmaxstdio_nothrow (int newmax)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _setmaxstdio (newmax);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# else
+# define _setmaxstdio_nothrow _setmaxstdio
+# endif
+
+/* Cache for the previous getdtablesize () result. Safe to cache because
+ Windows also lacks setrlimit. */
+static int dtablesize;
+
+int
+getdtablesize (void)
+{
+ if (dtablesize == 0)
+ {
+ /* We are looking for the number N such that the valid file descriptors
+ are 0..N-1. It can be obtained through a loop as follows:
+ {
+ int fd;
+ for (fd = 3; fd < 65536; fd++)
+ if (dup2 (0, fd) == -1)
+ break;
+ return fd;
+ }
+ On Windows XP, the result is 2048.
+ The drawback of this loop is that it allocates memory for a libc
+ internal array that is never freed.
+
+ The number N can also be obtained as the upper bound for
+ _getmaxstdio (). _getmaxstdio () returns the maximum number of open
+ FILE objects. The sanity check in _setmaxstdio reveals the maximum
+ number of file descriptors. This too allocates memory, but it is
+ freed when we call _setmaxstdio with the original value. */
+ int orig_max_stdio = _getmaxstdio ();
+ unsigned int bound;
+ for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2)
+ ;
+ _setmaxstdio_nothrow (orig_max_stdio);
+ dtablesize = bound;
+ }
+ return dtablesize;
+}
+
+#else
+
+# include <limits.h>
+# include <sys/resource.h>
+
+# ifndef RLIM_SAVED_CUR
+# define RLIM_SAVED_CUR RLIM_INFINITY
+# endif
+# ifndef RLIM_SAVED_MAX
+# define RLIM_SAVED_MAX RLIM_INFINITY
+# endif
+
+# ifdef __CYGWIN__
+ /* Cygwin 1.7.25 auto-increases the RLIMIT_NOFILE soft limit until it
+ hits the compile-time constant hard limit of 3200. We might as
+ well just report the hard limit. */
+# define rlim_cur rlim_max
+# endif
+
+int
+getdtablesize (void)
+{
+ struct rlimit lim;
+
+ if (getrlimit (RLIMIT_NOFILE, &lim) == 0
+ && 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX
+ && lim.rlim_cur != RLIM_INFINITY
+ && lim.rlim_cur != RLIM_SAVED_CUR
+ && lim.rlim_cur != RLIM_SAVED_MAX)
+ return lim.rlim_cur;
+
+ return INT_MAX;
+}
+
+#endif
diff --git a/gl/gethostname.c b/gl/gethostname.c
new file mode 100644
index 0000000..0c616c3
--- /dev/null
+++ b/gl/gethostname.c
@@ -0,0 +1,104 @@
+/* gethostname emulation for SysV and POSIX.1.
+
+ Copyright (C) 1992, 2003, 2006, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* David MacKenzie <djm@gnu.ai.mit.edu>
+ Windows port by Simon Josefsson <simon@josefsson.org> */
+
+#include <config.h>
+
+#if !(defined _WIN32 && !defined __CYGWIN__)
+/* Unix API. */
+
+/* Specification. */
+#include <unistd.h>
+
+#ifdef HAVE_UNAME
+# include <sys/utsname.h>
+#endif
+
+#include <string.h>
+
+/* Put up to LEN chars of the host name into NAME.
+ Null terminate it if the name is shorter than LEN.
+ Return 0 if ok, -1 if error. */
+
+#include <stddef.h>
+
+int
+gethostname (char *name, size_t len)
+{
+#ifdef HAVE_UNAME
+ struct utsname uts;
+
+ if (uname (&uts) == -1)
+ return -1;
+ if (len > sizeof (uts.nodename))
+ {
+ /* More space than we need is available. */
+ name[sizeof (uts.nodename)] = '\0';
+ len = sizeof (uts.nodename);
+ }
+ strncpy (name, uts.nodename, len);
+#else
+ strcpy (name, ""); /* Hardcode your system name if you want. */
+#endif
+ return 0;
+}
+
+#else
+/* Native Windows API. Which primitive to choose?
+ - gethostname() requires linking with -lws2_32.
+ - GetComputerName() does not return the right kind of hostname.
+ - GetComputerNameEx(ComputerNameDnsHostname,...) returns the right hostname,
+ but it is hard to use portably:
+ - It requires defining _WIN32_WINNT to at least 0x0500.
+ - With mingw, it also requires
+ "#define GetComputerNameEx GetComputerNameExA".
+ - With older versions of mingw, none of the declarations are present at
+ all, not even of the enum value ComputerNameDnsHostname.
+ So we use gethostname(). Linking with -lws2_32 is the least evil. */
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <unistd.h>
+
+/* Get INT_MAX. */
+#include <limits.h>
+
+/* Get set_winsock_errno. */
+#include "w32sock.h"
+
+#include "sockets.h"
+
+#undef gethostname
+
+int
+rpl_gethostname (char *name, size_t len)
+{
+ int r;
+
+ if (len > INT_MAX)
+ len = INT_MAX;
+ gl_sockets_startup (SOCKETS_1_1);
+ r = gethostname (name, (int) len);
+ if (r < 0)
+ set_winsock_errno ();
+
+ return r;
+}
+
+#endif
diff --git a/gl/getline.c b/gl/getline.c
new file mode 100644
index 0000000..85f16ab
--- /dev/null
+++ b/gl/getline.c
@@ -0,0 +1,27 @@
+/* getline.c --- Implementation of replacement getline function.
+ Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson. */
+
+#include <config.h>
+
+#include <stdio.h>
+
+ssize_t
+getline (char **lineptr, size_t *n, FILE *stream)
+{
+ return getdelim (lineptr, n, '\n', stream);
+}
diff --git a/gl/getloadavg.c b/gl/getloadavg.c
new file mode 100644
index 0000000..59b53e7
--- /dev/null
+++ b/gl/getloadavg.c
@@ -0,0 +1,943 @@
+/* Get the system load averages.
+
+ Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2023 Free Software
+ Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with gnulib.
+ Bugs can be reported to bug-gnulib@gnu.org.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Compile-time symbols that this file uses:
+
+ HAVE_PSTAT_GETDYNAMIC Define this if your system has the
+ pstat_getdynamic function. I think it
+ is unique to HPUX9. The best way to get the
+ definition is through the AC_FUNC_GETLOADAVG
+ macro that comes with autoconf 2.13 or newer.
+ If that isn't an option, then just put
+ AC_CHECK_FUNCS(pstat_getdynamic) in your
+ configure.ac file.
+ HAVE_LIBPERFSTAT Define this if your system has the
+ perfstat_cpu_total function in libperfstat (AIX).
+ FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist.
+ KERNEL_FILE Name of the kernel file to nlist.
+ LDAV_CVT() Scale the load average from the kernel.
+ Returns a double.
+ LDAV_SYMBOL Name of kernel symbol giving load average.
+ LOAD_AVE_TYPE Type of the load average array in the kernel.
+ Must be defined unless one of
+ apollo, DGUX, NeXT, or UMAX is defined;
+ or we have libkstat;
+ otherwise, no load average is available.
+ HAVE_NLIST_H nlist.h is available. NLIST_STRUCT defaults
+ to this.
+ NLIST_STRUCT Include nlist.h, not a.out.h.
+ N_NAME_POINTER The nlist n_name element is a pointer,
+ not an array.
+ HAVE_STRUCT_NLIST_N_UN_N_NAME 'n_un.n_name' is member of 'struct nlist'.
+ LINUX_LDAV_FILE [__linux__, __ANDROID__, __CYGWIN__]: File
+ containing load averages.
+
+ Specific system predefines this file uses, aside from setting
+ default values if not emacs:
+
+ apollo
+ BSD Real BSD, not just BSD-like.
+ DGUX
+ eunice UNIX emulator under VMS.
+ hpux
+ __MSDOS__ No-op for MSDOS.
+ NeXT
+ sgi
+ UMAX
+ UMAX4_3
+ VMS
+ _WIN32 Native Windows (possibly also defined on Cygwin)
+ __linux__, __ANDROID__ Linux: assumes /proc file system mounted.
+ Support from Michael K. Johnson.
+ __CYGWIN__ Cygwin emulates linux /proc/loadavg.
+ __NetBSD__ NetBSD: assumes /kern file system mounted.
+
+ In addition, to avoid nesting many #ifdefs, we internally set
+ LDAV_DONE to indicate that the load average has been computed.
+
+ We also #define LDAV_PRIVILEGED if a program will require
+ special installation to be able to call getloadavg. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#include <stdio.h>
+
+# include <sys/types.h>
+
+# if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+
+# include "intprops.h"
+
+# if defined _WIN32 && ! defined __CYGWIN__ && ! defined WINDOWS32
+# define WINDOWS32
+# endif
+
+# ifdef NeXT
+/* NeXT in the 2.{0,1,2} releases defines BSD in <sys/param.h>, which
+ conflicts with the definition understood in this file, that this
+ really is BSD. */
+# undef BSD
+
+/* NeXT defines FSCALE in <sys/param.h>. However, we take FSCALE being
+ defined to mean that the nlist method should be used, which is not true. */
+# undef FSCALE
+# endif
+
+/* Same issues as for NeXT apply to the HURD-based GNU system. */
+# ifdef __GNU__
+# undef BSD
+# undef FSCALE
+# endif /* __GNU__ */
+
+/* Set values that are different from the defaults, which are
+ set a little farther down with #ifndef. */
+
+
+/* Some shorthands. */
+
+# if defined (HPUX) && !defined (hpux)
+# define hpux
+# endif
+
+# if defined (__hpux) && !defined (hpux)
+# define hpux
+# endif
+
+# if defined (__sun) && !defined (sun)
+# define sun
+# endif
+
+# if defined (hp300) && !defined (hpux)
+# define MORE_BSD
+# endif
+
+# if defined (__SVR4) && !defined (SVR4)
+# define SVR4
+# endif
+
+# if (defined (sun) && defined (SVR4)) || defined (SOLARIS2)
+# define SUNOS_5
+# endif
+
+# if defined (__osf__) && (defined (__alpha) || defined (__alpha__))
+# define OSF_ALPHA
+# include <sys/mbuf.h>
+# include <sys/socket.h>
+# include <net/route.h>
+# include <sys/table.h>
+/* Tru64 4.0D's table.h redefines sys */
+# undef sys
+# endif
+
+# if defined (__osf__) && (defined (mips) || defined (__mips__))
+# define OSF_MIPS
+# include <sys/table.h>
+# endif
+
+
+/* VAX C can't handle multi-line #ifs, or lines longer than 256 chars. */
+# ifndef LOAD_AVE_TYPE
+
+# ifdef MORE_BSD
+# define LOAD_AVE_TYPE long
+# endif
+
+# ifdef sun
+# define LOAD_AVE_TYPE long
+# endif
+
+# ifdef sgi
+# define LOAD_AVE_TYPE long
+# endif
+
+# ifdef SVR4
+# define LOAD_AVE_TYPE long
+# endif
+
+# ifdef OSF_ALPHA
+# define LOAD_AVE_TYPE long
+# endif
+
+# if defined _AIX && ! defined HAVE_LIBPERFSTAT
+# define LOAD_AVE_TYPE long
+# endif
+
+# endif /* No LOAD_AVE_TYPE. */
+
+# ifdef OSF_ALPHA
+/* <sys/param.h> defines an incorrect value for FSCALE on Alpha OSF/1,
+ according to ghazi@noc.rutgers.edu. */
+# undef FSCALE
+# define FSCALE 1024.0
+# endif
+
+
+# ifndef FSCALE
+
+/* SunOS and some others define FSCALE in sys/param.h. */
+
+# ifdef MORE_BSD
+# define FSCALE 2048.0
+# endif
+
+# if defined (MIPS) || defined (SVR4)
+# define FSCALE 256
+# endif
+
+# if defined (sgi)
+/* Sometimes both MIPS and sgi are defined, so FSCALE was just defined
+ above under #ifdef MIPS. But we want the sgi value. */
+# undef FSCALE
+# define FSCALE 1000.0
+# endif
+
+# if defined _AIX && !defined HAVE_LIBPERFSTAT
+# define FSCALE 65536.0
+# endif
+
+# endif /* Not FSCALE. */
+
+# if !defined (LDAV_CVT) && defined (FSCALE)
+# define LDAV_CVT(n) (((double) (n)) / FSCALE)
+# endif
+
+# ifndef NLIST_STRUCT
+# if HAVE_NLIST_H
+# define NLIST_STRUCT
+# endif
+# endif
+
+# if defined (sgi) || (defined (mips) && !defined (BSD))
+# define FIXUP_KERNEL_SYMBOL_ADDR(nl) ((nl)[0].n_value &= ~(1 << 31))
+# endif
+
+
+# if !defined (KERNEL_FILE) && defined (hpux)
+# define KERNEL_FILE "/hp-ux"
+# endif
+
+# if !defined (KERNEL_FILE) && (defined (MIPS) || defined (SVR4) || defined (ISC) || defined (sgi))
+# define KERNEL_FILE "/unix"
+# endif
+
+
+# if !defined (LDAV_SYMBOL) && (defined (hpux) || defined (SVR4) || defined (ISC) || defined (sgi) || (defined (_AIX) && !defined(HAVE_LIBPERFSTAT)))
+# define LDAV_SYMBOL "avenrun"
+# endif
+
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+/* LOAD_AVE_TYPE should only get defined if we're going to use the
+ nlist method. */
+# if !defined (LOAD_AVE_TYPE) && (defined (BSD) || defined (LDAV_CVT) || defined (KERNEL_FILE) || defined (LDAV_SYMBOL))
+# define LOAD_AVE_TYPE double
+# endif
+
+# ifdef LOAD_AVE_TYPE
+
+# ifndef __VMS
+# if !(defined __linux__ || defined __ANDROID__)
+# ifndef NLIST_STRUCT
+# include <a.out.h>
+# else /* NLIST_STRUCT */
+# include <nlist.h>
+# endif /* NLIST_STRUCT */
+
+# ifdef SUNOS_5
+# include <kvm.h>
+# include <kstat.h>
+# endif
+
+# if defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
+# include <sys/pstat.h>
+# endif
+
+# ifndef KERNEL_FILE
+# define KERNEL_FILE "/vmunix"
+# endif /* KERNEL_FILE */
+
+# ifndef LDAV_SYMBOL
+# define LDAV_SYMBOL "_avenrun"
+# endif /* LDAV_SYMBOL */
+# endif /* __linux__ || __ANDROID__ */
+
+# else /* __VMS */
+
+# ifndef eunice
+# include <iodef.h>
+# include <descrip.h>
+# else /* eunice */
+# include <vms/iodef.h>
+# endif /* eunice */
+# endif /* __VMS */
+
+# ifndef LDAV_CVT
+# define LDAV_CVT(n) ((double) (n))
+# endif /* !LDAV_CVT */
+
+# endif /* LOAD_AVE_TYPE */
+
+# if defined HAVE_LIBPERFSTAT
+# include <sys/protosw.h>
+# include <libperfstat.h>
+# include <sys/proc.h>
+# ifndef SBITS
+# define SBITS 16
+# endif
+# endif
+
+# if defined (__GNU__) && !defined (NeXT)
+/* Note that NeXT Openstep defines __GNU__ even though it should not. */
+/* GNU system acts much like NeXT, for load average purposes,
+ but not exactly. */
+# define NeXT
+# define host_self mach_host_self
+# endif
+
+# ifdef NeXT
+# ifdef HAVE_MACH_MACH_H
+# include <mach/mach.h>
+# else
+# include <mach.h>
+# endif
+# endif /* NeXT */
+
+# ifdef sgi
+# include <sys/sysmp.h>
+# endif /* sgi */
+
+# ifdef UMAX
+# include <signal.h>
+# include <sys/time.h>
+# include <sys/wait.h>
+# include <sys/syscall.h>
+
+# ifdef UMAX_43
+# include <machine/cpu.h>
+# include <inq_stats/statistics.h>
+# include <inq_stats/sysstats.h>
+# include <inq_stats/cpustats.h>
+# include <inq_stats/procstats.h>
+# else /* Not UMAX_43. */
+# include <sys/sysdefs.h>
+# include <sys/statistics.h>
+# include <sys/sysstats.h>
+# include <sys/cpudefs.h>
+# include <sys/cpustats.h>
+# include <sys/procstats.h>
+# endif /* Not UMAX_43. */
+# endif /* UMAX */
+
+# ifdef DGUX
+# include <sys/dg_sys_info.h>
+# endif
+
+# if (defined __linux__ || defined __ANDROID__ \
+ || defined __CYGWIN__ || defined SUNOS_5 \
+ || (defined LOAD_AVE_TYPE && ! defined __VMS))
+# include <fcntl.h>
+# endif
+
+/* Avoid static vars inside a function since in HPUX they dump as pure. */
+
+# ifdef NeXT
+static processor_set_t default_set;
+static bool getloadavg_initialized;
+# endif /* NeXT */
+
+# ifdef UMAX
+static unsigned int cpus = 0;
+static unsigned int samples;
+# endif /* UMAX */
+
+# ifdef DGUX
+static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */
+# endif /* DGUX */
+
+# if !defined (HAVE_LIBKSTAT) && defined (LOAD_AVE_TYPE)
+/* File descriptor open to /dev/kmem or VMS load ave driver. */
+static int channel;
+/* True if channel is valid. */
+static bool getloadavg_initialized;
+/* Offset in kmem to seek to read load average, or 0 means invalid. */
+static long offset;
+
+# if ! defined __VMS && ! defined sgi && ! (defined __linux__ || defined __ANDROID__)
+static struct nlist name_list[2];
+# endif
+
+# ifdef SUNOS_5
+static kvm_t *kd;
+# endif /* SUNOS_5 */
+
+# endif /* LOAD_AVE_TYPE && !HAVE_LIBKSTAT */
+
+/* Put the 1 minute, 5 minute and 15 minute load averages
+ into the first NELEM elements of LOADAVG.
+ Return the number written (never more than 3, but may be less than NELEM),
+ or -1 (setting errno) if an error occurred. */
+
+int
+getloadavg (double loadavg[], int nelem)
+{
+ int elem = 0; /* Return value. */
+
+# ifdef NO_GET_LOAD_AVG
+# define LDAV_DONE
+ errno = ENOSYS;
+ elem = -1;
+# endif
+
+# if !defined (LDAV_DONE) && defined (HAVE_LIBKSTAT) /* Solaris <= 2.6 */
+/* Use libkstat because we don't have to be root. */
+# define LDAV_DONE
+ kstat_ctl_t *kc;
+ kstat_t *ksp;
+ kstat_named_t *kn;
+ int saved_errno;
+
+ kc = kstat_open ();
+ if (kc == NULL)
+ return -1;
+ ksp = kstat_lookup (kc, "unix", 0, "system_misc");
+ if (ksp == NULL)
+ return -1;
+ if (kstat_read (kc, ksp, 0) == -1)
+ return -1;
+
+
+ kn = kstat_data_lookup (ksp, "avenrun_1min");
+ if (kn == NULL)
+ {
+ /* Return -1 if no load average information is available. */
+ nelem = 0;
+ elem = -1;
+ }
+
+ if (nelem >= 1)
+ loadavg[elem++] = (double) kn->value.ul / FSCALE;
+
+ if (nelem >= 2)
+ {
+ kn = kstat_data_lookup (ksp, "avenrun_5min");
+ if (kn != NULL)
+ {
+ loadavg[elem++] = (double) kn->value.ul / FSCALE;
+
+ if (nelem >= 3)
+ {
+ kn = kstat_data_lookup (ksp, "avenrun_15min");
+ if (kn != NULL)
+ loadavg[elem++] = (double) kn->value.ul / FSCALE;
+ }
+ }
+ }
+
+ saved_errno = errno;
+ kstat_close (kc);
+ errno = saved_errno;
+# endif /* HAVE_LIBKSTAT */
+
+# if !defined (LDAV_DONE) && defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
+ /* HP-UX */
+/* Use pstat_getdynamic() because we don't have to be root. */
+# define LDAV_DONE
+# undef LOAD_AVE_TYPE
+
+ struct pst_dynamic dyn_info;
+ if (pstat_getdynamic (&dyn_info, sizeof (dyn_info), 0, 0) < 0)
+ return -1;
+ if (nelem > 0)
+ loadavg[elem++] = dyn_info.psd_avg_1_min;
+ if (nelem > 1)
+ loadavg[elem++] = dyn_info.psd_avg_5_min;
+ if (nelem > 2)
+ loadavg[elem++] = dyn_info.psd_avg_15_min;
+
+# endif /* hpux && HAVE_PSTAT_GETDYNAMIC */
+
+# if ! defined LDAV_DONE && defined HAVE_LIBPERFSTAT /* AIX */
+# define LDAV_DONE
+# undef LOAD_AVE_TYPE
+/* Use perfstat_cpu_total because we don't have to be root. */
+ {
+ perfstat_cpu_total_t cpu_stats;
+ int result = perfstat_cpu_total (NULL, &cpu_stats, sizeof cpu_stats, 1);
+ if (result == -1)
+ return result;
+ loadavg[0] = cpu_stats.loadavg[0] / (double)(1 << SBITS);
+ loadavg[1] = cpu_stats.loadavg[1] / (double)(1 << SBITS);
+ loadavg[2] = cpu_stats.loadavg[2] / (double)(1 << SBITS);
+ elem = 3;
+ }
+# endif
+
+# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__ || defined __CYGWIN__)
+ /* Linux without glibc, Android, Cygwin */
+# define LDAV_DONE
+# undef LOAD_AVE_TYPE
+
+# ifndef LINUX_LDAV_FILE
+# define LINUX_LDAV_FILE "/proc/loadavg"
+# endif
+
+ char ldavgbuf[3 * (INT_STRLEN_BOUND (int) + sizeof ".00 ")];
+ char const *ptr = ldavgbuf;
+ int fd, count, saved_errno;
+
+ fd = open (LINUX_LDAV_FILE, O_RDONLY | O_CLOEXEC);
+ if (fd == -1)
+ return -1;
+ count = read (fd, ldavgbuf, sizeof ldavgbuf - 1);
+ saved_errno = errno;
+ (void) close (fd);
+ errno = saved_errno;
+ if (count <= 0)
+ return -1;
+ ldavgbuf[count] = '\0';
+
+ for (elem = 0; elem < nelem; elem++)
+ {
+ double numerator = 0;
+ double denominator = 1;
+
+ while (*ptr == ' ')
+ ptr++;
+
+ /* Finish if this number is missing, and report an error if all
+ were missing. */
+ if (! ('0' <= *ptr && *ptr <= '9'))
+ {
+ if (elem == 0)
+ {
+ errno = ENOTSUP;
+ return -1;
+ }
+ break;
+ }
+
+ while ('0' <= *ptr && *ptr <= '9')
+ numerator = 10 * numerator + (*ptr++ - '0');
+
+ if (*ptr == '.')
+ for (ptr++; '0' <= *ptr && *ptr <= '9'; ptr++)
+ numerator = 10 * numerator + (*ptr - '0'), denominator *= 10;
+
+ loadavg[elem] = numerator / denominator;
+ }
+
+ return elem;
+
+# endif /* __linux__ || __ANDROID__ || __CYGWIN__ */
+
+# if !defined (LDAV_DONE) && defined (__NetBSD__) /* NetBSD < 0.9 */
+# define LDAV_DONE
+# undef LOAD_AVE_TYPE
+
+# ifndef NETBSD_LDAV_FILE
+# define NETBSD_LDAV_FILE "/kern/loadavg"
+# endif
+
+ unsigned long int load_ave[3], scale;
+ int count;
+ char readbuf[4 * INT_BUFSIZE_BOUND (unsigned long int) + 1];
+ int fd = open (NETBSD_LDAV_FILE, O_RDONLY | O_CLOEXEC);
+ if (fd < 0)
+ return fd;
+ int nread = read (fd, readbuf, sizeof readbuf - 1);
+ int err = errno;
+ close (fd);
+ if (nread < 0)
+ {
+ errno = err;
+ return -1;
+ }
+ readbuf[nread] = '\0';
+ count = sscanf (readbuf, "%lu %lu %lu %lu\n",
+ &load_ave[0], &load_ave[1], &load_ave[2],
+ &scale);
+ if (count != 4)
+ {
+ errno = ENOTSUP;
+ return -1;
+ }
+
+ for (elem = 0; elem < nelem; elem++)
+ loadavg[elem] = (double) load_ave[elem] / (double) scale;
+
+ return elem;
+
+# endif /* __NetBSD__ */
+
+# if !defined (LDAV_DONE) && defined (NeXT) /* NeXTStep */
+# define LDAV_DONE
+ /* The NeXT code was adapted from iscreen 3.2. */
+
+ host_t host;
+ struct processor_set_basic_info info;
+ unsigned int info_count;
+
+ /* We only know how to get the 1-minute average for this system,
+ so even if the caller asks for more than 1, we only return 1. */
+
+ if (!getloadavg_initialized)
+ {
+ if (processor_set_default (host_self (), &default_set) == KERN_SUCCESS)
+ getloadavg_initialized = true;
+ }
+
+ if (getloadavg_initialized)
+ {
+ info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
+ if (processor_set_info (default_set, PROCESSOR_SET_BASIC_INFO, &host,
+ (processor_set_info_t) &info, &info_count)
+ != KERN_SUCCESS)
+ getloadavg_initialized = false;
+ else
+ {
+ if (nelem > 0)
+ loadavg[elem++] = (double) info.load_average / LOAD_SCALE;
+ }
+ }
+
+ if (!getloadavg_initialized)
+ {
+ errno = ENOTSUP;
+ return -1;
+ }
+# endif /* NeXT */
+
+# if !defined (LDAV_DONE) && defined (UMAX)
+# define LDAV_DONE
+/* UMAX 4.2, which runs on the Encore Multimax multiprocessor, does not
+ have a /dev/kmem. Information about the workings of the running kernel
+ can be gathered with inq_stats system calls.
+ We only know how to get the 1-minute average for this system. */
+
+ struct proc_summary proc_sum_data;
+ struct stat_descr proc_info;
+ double load;
+ register unsigned int i, j;
+
+ if (cpus == 0)
+ {
+ register unsigned int c, i;
+ struct cpu_config conf;
+ struct stat_descr desc;
+
+ desc.sd_next = 0;
+ desc.sd_subsys = SUBSYS_CPU;
+ desc.sd_type = CPUTYPE_CONFIG;
+ desc.sd_addr = (char *) &conf;
+ desc.sd_size = sizeof conf;
+
+ if (inq_stats (1, &desc))
+ return -1;
+
+ c = 0;
+ for (i = 0; i < conf.config_maxclass; ++i)
+ {
+ struct class_stats stats;
+ memset (&stats, 0, sizeof stats);
+
+ desc.sd_type = CPUTYPE_CLASS;
+ desc.sd_objid = i;
+ desc.sd_addr = (char *) &stats;
+ desc.sd_size = sizeof stats;
+
+ if (inq_stats (1, &desc))
+ return -1;
+
+ c += stats.class_numcpus;
+ }
+ cpus = c;
+ samples = cpus < 2 ? 3 : (2 * cpus / 3);
+ }
+
+ proc_info.sd_next = 0;
+ proc_info.sd_subsys = SUBSYS_PROC;
+ proc_info.sd_type = PROCTYPE_SUMMARY;
+ proc_info.sd_addr = (char *) &proc_sum_data;
+ proc_info.sd_size = sizeof (struct proc_summary);
+ proc_info.sd_sizeused = 0;
+
+ if (inq_stats (1, &proc_info) != 0)
+ return -1;
+
+ load = proc_sum_data.ps_nrunnable;
+ j = 0;
+ for (i = samples - 1; i > 0; --i)
+ {
+ load += proc_sum_data.ps_nrun[j];
+ if (j++ == PS_NRUNSIZE)
+ j = 0;
+ }
+
+ if (nelem > 0)
+ loadavg[elem++] = load / samples / cpus;
+# endif /* UMAX */
+
+# if !defined (LDAV_DONE) && defined (DGUX)
+# define LDAV_DONE
+ /* This call can return -1 for an error, but with good args
+ it's not supposed to fail. The first argument is for no
+ apparent reason of type 'long int *'. */
+ dg_sys_info ((long int *) &load_info,
+ DG_SYS_INFO_LOAD_INFO_TYPE,
+ DG_SYS_INFO_LOAD_VERSION_0);
+
+ if (nelem > 0)
+ loadavg[elem++] = load_info.one_minute;
+ if (nelem > 1)
+ loadavg[elem++] = load_info.five_minute;
+ if (nelem > 2)
+ loadavg[elem++] = load_info.fifteen_minute;
+# endif /* DGUX */
+
+# if !defined (LDAV_DONE) && defined (apollo)
+# define LDAV_DONE
+/* Apollo code from lisch@mentorg.com (Ray Lischner).
+
+ This system call is not documented. The load average is obtained as
+ three long integers, for the load average over the past minute,
+ five minutes, and fifteen minutes. Each value is a scaled integer,
+ with 16 bits of integer part and 16 bits of fraction part.
+
+ I'm not sure which operating system first supported this system call,
+ but I know that SR10.2 supports it. */
+
+ extern void proc1_$get_loadav ();
+ unsigned long load_ave[3];
+
+ proc1_$get_loadav (load_ave);
+
+ if (nelem > 0)
+ loadavg[elem++] = load_ave[0] / 65536.0;
+ if (nelem > 1)
+ loadavg[elem++] = load_ave[1] / 65536.0;
+ if (nelem > 2)
+ loadavg[elem++] = load_ave[2] / 65536.0;
+# endif /* apollo */
+
+# if !defined (LDAV_DONE) && defined (OSF_MIPS)
+# define LDAV_DONE
+
+ struct tbl_loadavg load_ave;
+ table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave));
+ loadavg[elem++]
+ = (load_ave.tl_lscale == 0
+ ? load_ave.tl_avenrun.d[0]
+ : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
+# endif /* OSF_MIPS */
+
+# if !defined (LDAV_DONE) && (defined (__MSDOS__) || defined (WINDOWS32))
+ /* DJGPP */
+# define LDAV_DONE
+
+ /* A faithful emulation is going to have to be saved for a rainy day. */
+ for ( ; elem < nelem; elem++)
+ {
+ loadavg[elem] = 0.0;
+ }
+# endif /* __MSDOS__ || WINDOWS32 */
+
+# if !defined (LDAV_DONE) && defined (OSF_ALPHA) /* OSF/1 */
+# define LDAV_DONE
+
+ struct tbl_loadavg load_ave;
+ table (TBL_LOADAVG, 0, &load_ave, 1, sizeof (load_ave));
+ for (elem = 0; elem < nelem; elem++)
+ loadavg[elem]
+ = (load_ave.tl_lscale == 0
+ ? load_ave.tl_avenrun.d[elem]
+ : (load_ave.tl_avenrun.l[elem] / (double) load_ave.tl_lscale));
+# endif /* OSF_ALPHA */
+
+# if ! defined LDAV_DONE && defined __VMS /* VMS */
+ /* VMS specific code -- read from the Load Ave driver. */
+
+ LOAD_AVE_TYPE load_ave[3];
+ static bool getloadavg_initialized;
+# ifdef eunice
+ struct
+ {
+ int dsc$w_length;
+ char *dsc$a_pointer;
+ } descriptor;
+# endif
+
+ /* Ensure that there is a channel open to the load ave device. */
+ if (!getloadavg_initialized)
+ {
+ /* Attempt to open the channel. */
+# ifdef eunice
+ descriptor.dsc$w_length = 18;
+ descriptor.dsc$a_pointer = "$$VMS_LOAD_AVERAGE";
+# else
+ $DESCRIPTOR (descriptor, "LAV0:");
+# endif
+ if (sys$assign (&descriptor, &channel, 0, 0) & 1)
+ getloadavg_initialized = true;
+ }
+
+ /* Read the load average vector. */
+ if (getloadavg_initialized
+ && !(sys$qiow (0, channel, IO$_READVBLK, 0, 0, 0,
+ load_ave, 12, 0, 0, 0, 0) & 1))
+ {
+ sys$dassgn (channel);
+ getloadavg_initialized = false;
+ }
+
+ if (!getloadavg_initialized)
+ {
+ errno = ENOTSUP;
+ return -1;
+ }
+# endif /* ! defined LDAV_DONE && defined __VMS */
+
+# if ! defined LDAV_DONE && defined LOAD_AVE_TYPE && ! defined __VMS
+ /* IRIX, other old systems */
+
+ /* UNIX-specific code -- read the average from /dev/kmem. */
+
+# define LDAV_PRIVILEGED /* This code requires special installation. */
+
+ LOAD_AVE_TYPE load_ave[3];
+
+ /* Get the address of LDAV_SYMBOL. */
+ if (offset == 0)
+ {
+# ifndef sgi
+# if ! defined NLIST_STRUCT || ! defined N_NAME_POINTER
+ strcpy (name_list[0].n_name, LDAV_SYMBOL);
+ strcpy (name_list[1].n_name, "");
+# else /* NLIST_STRUCT */
+# ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
+ name_list[0].n_un.n_name = LDAV_SYMBOL;
+ name_list[1].n_un.n_name = 0;
+# else /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */
+ name_list[0].n_name = LDAV_SYMBOL;
+ name_list[1].n_name = 0;
+# endif /* not HAVE_STRUCT_NLIST_N_UN_N_NAME */
+# endif /* NLIST_STRUCT */
+
+# ifndef SUNOS_5
+ if (
+# if !defined (_AIX)
+ nlist (KERNEL_FILE, name_list)
+# else /* _AIX */
+ knlist (name_list, 1, sizeof (name_list[0]))
+# endif
+ >= 0)
+ /* Omit "&& name_list[0].n_type != 0 " -- it breaks on Sun386i. */
+ {
+# ifdef FIXUP_KERNEL_SYMBOL_ADDR
+ FIXUP_KERNEL_SYMBOL_ADDR (name_list);
+# endif
+ offset = name_list[0].n_value;
+ }
+# endif /* !SUNOS_5 */
+# else /* sgi */
+ ptrdiff_t ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN);
+ if (ldav_off != -1)
+ offset = (long int) ldav_off & 0x7fffffff;
+# endif /* sgi */
+ }
+
+ /* Make sure we have /dev/kmem open. */
+ if (!getloadavg_initialized)
+ {
+# ifndef SUNOS_5
+ int fd = open ("/dev/kmem", O_RDONLY | O_CLOEXEC);
+ if (0 <= fd)
+ {
+ channel = fd;
+ getloadavg_initialized = true;
+ }
+# else /* SUNOS_5 */
+ /* We pass 0 for the kernel, corefile, and swapfile names
+ to use the currently running kernel. */
+ kd = kvm_open (0, 0, 0, O_RDONLY, 0);
+ if (kd != NULL)
+ {
+ /* nlist the currently running kernel. */
+ kvm_nlist (kd, name_list);
+ offset = name_list[0].n_value;
+ getloadavg_initialized = true;
+ }
+# endif /* SUNOS_5 */
+ }
+
+ /* If we can, get the load average values. */
+ if (offset && getloadavg_initialized)
+ {
+ /* Try to read the load. */
+# ifndef SUNOS_5
+ if (lseek (channel, offset, 0) == -1L
+ || read (channel, (char *) load_ave, sizeof (load_ave))
+ != sizeof (load_ave))
+ {
+ close (channel);
+ getloadavg_initialized = false;
+ }
+# else /* SUNOS_5 */
+ if (kvm_read (kd, offset, (char *) load_ave, sizeof (load_ave))
+ != sizeof (load_ave))
+ {
+ kvm_close (kd);
+ getloadavg_initialized = false;
+ }
+# endif /* SUNOS_5 */
+ }
+
+ if (offset == 0 || !getloadavg_initialized)
+ {
+ errno = ENOTSUP;
+ return -1;
+ }
+# endif /* ! defined LDAV_DONE && defined LOAD_AVE_TYPE && ! defined __VMS */
+
+# if !defined (LDAV_DONE) && defined (LOAD_AVE_TYPE) /* Including VMS. */
+ if (nelem > 0)
+ loadavg[elem++] = LDAV_CVT (load_ave[0]);
+ if (nelem > 1)
+ loadavg[elem++] = LDAV_CVT (load_ave[1]);
+ if (nelem > 2)
+ loadavg[elem++] = LDAV_CVT (load_ave[2]);
+
+# define LDAV_DONE
+# endif /* !LDAV_DONE && LOAD_AVE_TYPE */
+
+# if !defined LDAV_DONE
+ errno = ENOSYS;
+ elem = -1;
+# endif
+ return elem;
+}
diff --git a/gl/getopt-cdefs.in.h b/gl/getopt-cdefs.in.h
new file mode 100644
index 0000000..e76c78c
--- /dev/null
+++ b/gl/getopt-cdefs.in.h
@@ -0,0 +1,66 @@
+/* getopt-on-non-glibc compatibility macros.
+ Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_CDEFS_H
+#define _GETOPT_CDEFS_H 1
+
+/* This header should not be used directly; include getopt.h or
+ unistd.h instead. It does not have a protective #error, because
+ the guard macro for getopt.h in gnulib is not fixed. */
+
+/* getopt-core.h and getopt-ext.h are shared with GNU libc, and expect
+ a number of the internal macros supplied to GNU libc's headers by
+ sys/cdefs.h. Provide fallback definitions for all of them. */
+#if @HAVE_SYS_CDEFS_H@
+# include <sys/cdefs.h>
+#endif
+
+#ifndef __BEGIN_DECLS
+# ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# else
+# define __BEGIN_DECLS /* nothing */
+# endif
+#endif
+#ifndef __END_DECLS
+# ifdef __cplusplus
+# define __END_DECLS }
+# else
+# define __END_DECLS /* nothing */
+# endif
+#endif
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_VERSION__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#ifndef __THROW
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
+#endif /* _GETOPT_CDEFS_H */
diff --git a/gl/getopt-core.h b/gl/getopt-core.h
new file mode 100644
index 0000000..c5dd493
--- /dev/null
+++ b/gl/getopt-core.h
@@ -0,0 +1,96 @@
+/* Declarations for getopt (basic, portable features only).
+ Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_CORE_H
+#define _GETOPT_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+ unistd.h instead. Unlike most bits headers, it does not have
+ a protective #error, because the guard macro for getopt.h in
+ gnulib is not fixed. */
+
+__BEGIN_DECLS
+
+/* For communication from 'getopt' to the caller.
+ When 'getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when 'ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to 'getopt'.
+
+ On entry to 'getopt', zero means this is the first call; initialize.
+
+ When 'getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, 'optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message 'getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS.
+
+ Return the option character from OPTS just read. Return -1 when
+ there are no more options. For unrecognized options, or options
+ missing arguments, 'optopt' is set to the option letter, and '?' is
+ returned.
+
+ The OPTS string is a list of characters which are recognized option
+ letters, optionally followed by colons, specifying that that letter
+ takes an argument, to be placed in 'optarg'.
+
+ If a letter in OPTS is followed by two colons, its argument is
+ optional. This behavior is specific to the GNU 'getopt'.
+
+ The argument '--' causes premature termination of argument
+ scanning, explicitly telling 'getopt' that there are no more
+ options.
+
+ If OPTS begins with '-', then non-option arguments are treated as
+ arguments to the option '\1'. This behavior is specific to the GNU
+ 'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in
+ the environment, then do not permute arguments.
+
+ For standards compliance, the 'argv' argument has the type
+ char *const *, but this is inaccurate; if argument permutation is
+ enabled, the argv array (not the strings it points to) must be
+ writable. */
+
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_CORE_H */
diff --git a/gl/getopt-ext.h b/gl/getopt-ext.h
new file mode 100644
index 0000000..d37c293
--- /dev/null
+++ b/gl/getopt-ext.h
@@ -0,0 +1,77 @@
+/* Declarations for getopt (GNU extensions).
+ Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_EXT_H
+#define _GETOPT_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+ Unlike most bits headers, it does not have a protective #error,
+ because the guard macro for getopt.h in gnulib is not fixed. */
+
+__BEGIN_DECLS
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of 'struct option' terminated by an element containing a name which is
+ zero.
+
+ The field 'has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field 'flag' is not NULL, it points to a variable that is set
+ to the value given in the field 'val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an 'int' to
+ a compiled-in constant, such as set a value from 'optarg', set the
+ option's 'flag' field to zero and its 'val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero 'flag' field, 'getopt'
+ returns the contents of the 'val' field. */
+
+struct option
+{
+ const char *name;
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the 'has_arg' field of 'struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_EXT_H */
diff --git a/gl/getopt-pfx-core.h b/gl/getopt-pfx-core.h
new file mode 100644
index 0000000..3a2fde5
--- /dev/null
+++ b/gl/getopt-pfx-core.h
@@ -0,0 +1,66 @@
+/* getopt (basic, portable features) gnulib wrapper header.
+ Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_PFX_CORE_H
+#define _GETOPT_PFX_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+ unistd.h instead. It does not have a protective #error, because
+ the guard macro for getopt.h in gnulib is not fixed. */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in getopt-core.h and getopt-ext.h. Systematically
+ rename identifiers so that they do not collide with the system
+ functions and variables. Renaming avoids problems with some
+ compilers and linkers. */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+# define __GETOPT_CONCAT(x, y) x ## y
+# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt
+# undef optarg
+# undef opterr
+# undef optind
+# undef optopt
+# define getopt __GETOPT_ID (getopt)
+# define optarg __GETOPT_ID (optarg)
+# define opterr __GETOPT_ID (opterr)
+# define optind __GETOPT_ID (optind)
+# define optopt __GETOPT_ID (optopt)
+
+/* Work around a a problem on macOS, which declares getopt with a
+ trailing __DARWIN_ALIAS(getopt) that would expand to something like
+ __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following
+ hack to suppress the macOS declaration <https://bugs.gnu.org/40205>. */
+# ifdef __APPLE__
+# define _GETOPT
+# endif
+
+/* The system's getopt.h may have already included getopt-core.h to
+ declare the unprefixed identifiers. Undef _GETOPT_CORE_H so that
+ getopt-core.h declares them with prefixes. */
+# undef _GETOPT_CORE_H
+#endif
+
+#include <getopt-core.h>
+
+#endif /* _GETOPT_PFX_CORE_H */
diff --git a/gl/getopt-pfx-ext.h b/gl/getopt-pfx-ext.h
new file mode 100644
index 0000000..8578d72
--- /dev/null
+++ b/gl/getopt-pfx-ext.h
@@ -0,0 +1,70 @@
+/* getopt (GNU extensions) gnulib wrapper header.
+ Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_PFX_EXT_H
+#define _GETOPT_PFX_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+ It does not have a protective #error, because the guard macro for
+ getopt.h in gnulib is not fixed. */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in getopt-core.h and getopt-ext.h. Systematically
+ rename identifiers so that they do not collide with the system
+ functions and variables. Renaming avoids problems with some
+ compilers and linkers. */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+# define __GETOPT_CONCAT(x, y) x ## y
+# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt_long
+# undef getopt_long_only
+# undef option
+# undef _getopt_internal
+# define getopt_long __GETOPT_ID (getopt_long)
+# define getopt_long_only __GETOPT_ID (getopt_long_only)
+# define option __GETOPT_ID (option)
+# define _getopt_internal __GETOPT_ID (getopt_internal)
+
+/* The system's getopt.h may have already included getopt-ext.h to
+ declare the unprefixed identifiers. Undef _GETOPT_EXT_H so that
+ getopt-ext.h declares them with prefixes. */
+# undef _GETOPT_EXT_H
+#endif
+
+/* Standalone applications get correct prototypes for getopt_long and
+ getopt_long_only; they declare "char **argv". For backward
+ compatibility with old applications, if __GETOPT_PREFIX is not
+ defined, we supply GNU-libc-compatible, but incorrect, prototypes
+ using "char *const *argv". (GNU libc is stuck with the incorrect
+ prototypes, as they are baked into older versions of LSB.) */
+#ifndef __getopt_argv_const
+# if defined __GETOPT_PREFIX
+# define __getopt_argv_const /* empty */
+# else
+# define __getopt_argv_const const
+# endif
+#endif
+
+#include <getopt-ext.h>
+
+#endif /* _GETOPT_PFX_EXT_H */
diff --git a/gl/getopt.c b/gl/getopt.c
new file mode 100644
index 0000000..1e2441c
--- /dev/null
+++ b/gl/getopt.c
@@ -0,0 +1,811 @@
+/* Getopt for GNU.
+ Copyright (C) 1987-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include "getopt.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef _LIBC
+/* When used as part of glibc, error printing must be done differently
+ for standards compliance. getopt is not a cancellation point, so
+ it must not call functions that are, and it is specified by an
+ older standard than stdio locking, so it must not refer to
+ functions in the "user namespace" related to stdio locking.
+ Finally, it must use glibc's internal message translation so that
+ the messages are looked up in the proper text domain. */
+# include <libintl.h>
+# define fprintf __fxprintf_nocancel
+# define flockfile(fp) _IO_flockfile (fp)
+# define funlockfile(fp) _IO_funlockfile (fp)
+#else
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
+/* When used standalone, flockfile and funlockfile might not be
+ available. */
+# if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \
+ || (defined _WIN32 && ! defined __CYGWIN__))
+# define flockfile(fp) /* nop */
+# define funlockfile(fp) /* nop */
+# endif
+/* When used standalone, do not attempt to use alloca. */
+# define __libc_use_alloca(size) 0
+# undef alloca
+# define alloca(size) (abort (), (void *)0)
+#endif
+
+/* This implementation of 'getopt' has three modes for handling
+ options interspersed with non-option arguments. It can stop
+ scanning for options at the first non-option argument encountered,
+ as POSIX specifies. It can continue scanning for options after the
+ first non-option argument, but permute 'argv' as it goes so that,
+ after 'getopt' is done, all the options precede all the non-option
+ arguments and 'optind' points to the first non-option argument.
+ Or, it can report non-option arguments as if they were arguments to
+ the option character '\x01'.
+
+ The default behavior of 'getopt_long' is to permute the argument list.
+ When this implementation is used standalone, the default behavior of
+ 'getopt' is to stop at the first non-option argument, but when it is
+ used as part of GNU libc it also permutes the argument list. In both
+ cases, setting the environment variable POSIXLY_CORRECT to any value
+ disables permutation.
+
+ If the first character of the OPTSTRING argument to 'getopt' or
+ 'getopt_long' is '+', both functions will stop at the first
+ non-option argument. If it is '-', both functions will report
+ non-option arguments as arguments to the option character '\x01'. */
+
+#include "getopt_int.h"
+
+/* For communication from 'getopt' to the caller.
+ When 'getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when 'ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to 'getopt'.
+
+ On entry to 'getopt', zero means this is the first call; initialize.
+
+ When 'getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, 'optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* 1003.2 says this must be 1 before any call. */
+int optind = 1;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Keep a global copy of all internal members of getopt_data. */
+
+static struct _getopt_data getopt_data;
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ 'first_nonopt' and 'last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+static void
+exchange (char **argv, struct _getopt_data *d)
+{
+ int bottom = d->__first_nonopt;
+ int middle = d->__last_nonopt;
+ int top = d->optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ d->__first_nonopt += (d->optind - d->__last_nonopt);
+ d->__last_nonopt = d->optind;
+}
+
+/* Process the argument starting with d->__nextchar as a long option.
+ d->optind should *not* have been advanced over this argument.
+
+ If the value returned is -1, it was not actually a long option, the
+ state is unchanged, and the argument should be processed as a set
+ of short options (this can only happen when long_only is true).
+ Otherwise, the option (and its argument, if any) have been consumed
+ and the return value is the value to return from _getopt_internal_r. */
+static int
+process_long_option (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind,
+ int long_only, struct _getopt_data *d,
+ int print_errors, const char *prefix)
+{
+ char *nameend;
+ size_t namelen;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int n_options;
+ int option_index;
+
+ for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+ namelen = nameend - d->__nextchar;
+
+ /* First look for an exact match, counting the options as a side
+ effect. */
+ for (p = longopts, n_options = 0; p->name; p++, n_options++)
+ if (!strncmp (p->name, d->__nextchar, namelen)
+ && namelen == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ option_index = n_options;
+ break;
+ }
+
+ if (pfound == NULL)
+ {
+ /* Didn't find an exact match, so look for abbreviations. */
+ unsigned char *ambig_set = NULL;
+ int ambig_malloced = 0;
+ int ambig_fallback = 0;
+ int indfound = -1;
+
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, d->__nextchar, namelen))
+ {
+ if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else if (long_only
+ || pfound->has_arg != p->has_arg
+ || pfound->flag != p->flag
+ || pfound->val != p->val)
+ {
+ /* Second or later nonexact match found. */
+ if (!ambig_fallback)
+ {
+ if (!print_errors)
+ /* Don't waste effort tracking the ambig set if
+ we're not going to print it anyway. */
+ ambig_fallback = 1;
+ else if (!ambig_set)
+ {
+ if (__libc_use_alloca (n_options))
+ ambig_set = alloca (n_options);
+ else if ((ambig_set = malloc (n_options)) == NULL)
+ /* Fall back to simpler error message. */
+ ambig_fallback = 1;
+ else
+ ambig_malloced = 1;
+
+ if (ambig_set)
+ {
+ memset (ambig_set, 0, n_options);
+ ambig_set[indfound] = 1;
+ }
+ }
+ if (ambig_set)
+ ambig_set[option_index] = 1;
+ }
+ }
+ }
+
+ if (ambig_set || ambig_fallback)
+ {
+ if (print_errors)
+ {
+ if (ambig_fallback)
+ fprintf (stderr, _("%s: option '%s%s' is ambiguous\n"),
+ argv[0], prefix, d->__nextchar);
+ else
+ {
+ flockfile (stderr);
+ fprintf (stderr,
+ _("%s: option '%s%s' is ambiguous; possibilities:"),
+ argv[0], prefix, d->__nextchar);
+
+ for (option_index = 0; option_index < n_options; option_index++)
+ if (ambig_set[option_index])
+ fprintf (stderr, " '%s%s'",
+ prefix, longopts[option_index].name);
+
+ /* This must use 'fprintf' even though it's only
+ printing a single character, so that it goes through
+ __fxprintf_nocancel when compiled as part of glibc. */
+ fprintf (stderr, "\n");
+ funlockfile (stderr);
+ }
+ }
+ if (ambig_malloced)
+ free (ambig_set);
+ d->__nextchar += strlen (d->__nextchar);
+ d->optind++;
+ d->optopt = 0;
+ return '?';
+ }
+
+ option_index = indfound;
+ }
+
+ if (pfound == NULL)
+ {
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short option,
+ then it's an error. */
+ if (!long_only || argv[d->optind][1] == '-'
+ || strchr (optstring, *d->__nextchar) == NULL)
+ {
+ if (print_errors)
+ fprintf (stderr, _("%s: unrecognized option '%s%s'\n"),
+ argv[0], prefix, d->__nextchar);
+
+ d->__nextchar = NULL;
+ d->optind++;
+ d->optopt = 0;
+ return '?';
+ }
+
+ /* Otherwise interpret it as a short option. */
+ return -1;
+ }
+
+ /* We have found a matching long option. Consume it. */
+ d->optind++;
+ d->__nextchar = NULL;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ d->optarg = nameend + 1;
+ else
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option '%s%s' doesn't allow an argument\n"),
+ argv[0], prefix, pfound->name);
+
+ d->optopt = pfound->val;
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (d->optind < argc)
+ d->optarg = argv[d->optind++];
+ else
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option '%s%s' requires an argument\n"),
+ argv[0], prefix, pfound->name);
+
+ d->optopt = pfound->val;
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+}
+
+/* Initialize internal data upon the first call to getopt. */
+
+static const char *
+_getopt_initialize (_GL_UNUSED int argc,
+ _GL_UNUSED char **argv, const char *optstring,
+ struct _getopt_data *d, int posixly_correct)
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+ if (d->optind == 0)
+ d->optind = 1;
+
+ d->__first_nonopt = d->__last_nonopt = d->optind;
+ d->__nextchar = NULL;
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+ if (optstring[0] == '-')
+ {
+ d->__ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ d->__ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (posixly_correct || !!getenv ("POSIXLY_CORRECT"))
+ d->__ordering = REQUIRE_ORDER;
+ else
+ d->__ordering = PERMUTE;
+
+ d->__initialized = 1;
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If 'getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If 'getopt' finds another option character, it returns that character,
+ updating 'optind' and 'nextchar' so that the next call to 'getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, 'getopt' returns -1.
+ Then 'optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set 'opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in 'optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in 'optarg', otherwise 'optarg' is set to zero.
+
+ If OPTSTRING starts with '-' or '+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with '--' instead of '-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a '=', or else the in next ARGV-element.
+ When 'getopt' finds a long-named option, it returns 0 if that option's
+ 'flag' field is nonzero, the value of the option's 'val' field
+ if the 'flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of 'struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal_r (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind,
+ int long_only, struct _getopt_data *d, int posixly_correct)
+{
+ int print_errors = d->opterr;
+
+ if (argc < 1)
+ return -1;
+
+ d->optarg = NULL;
+
+ if (d->optind == 0 || !d->__initialized)
+ optstring = _getopt_initialize (argc, argv, optstring, d, posixly_correct);
+ else if (optstring[0] == '-' || optstring[0] == '+')
+ optstring++;
+
+ if (optstring[0] == ':')
+ print_errors = 0;
+
+ /* Test whether ARGV[optind] points to a non-option argument. */
+#define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
+
+ if (d->__nextchar == NULL || *d->__nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+ moved back by the user (who may also have changed the arguments). */
+ if (d->__last_nonopt > d->optind)
+ d->__last_nonopt = d->optind;
+ if (d->__first_nonopt > d->optind)
+ d->__first_nonopt = d->optind;
+
+ if (d->__ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (d->__first_nonopt != d->__last_nonopt
+ && d->__last_nonopt != d->optind)
+ exchange (argv, d);
+ else if (d->__last_nonopt != d->optind)
+ d->__first_nonopt = d->optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (d->optind < argc && NONOPTION_P)
+ d->optind++;
+ d->__last_nonopt = d->optind;
+ }
+
+ /* The special ARGV-element '--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (d->optind != argc && !strcmp (argv[d->optind], "--"))
+ {
+ d->optind++;
+
+ if (d->__first_nonopt != d->__last_nonopt
+ && d->__last_nonopt != d->optind)
+ exchange (argv, d);
+ else if (d->__first_nonopt == d->__last_nonopt)
+ d->__first_nonopt = d->optind;
+ d->__last_nonopt = argc;
+
+ d->optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (d->optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (d->__first_nonopt != d->__last_nonopt)
+ d->optind = d->__first_nonopt;
+ return -1;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if (NONOPTION_P)
+ {
+ if (d->__ordering == REQUIRE_ORDER)
+ return -1;
+ d->optarg = argv[d->optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Check whether it might be a long option. */
+ if (longopts)
+ {
+ if (argv[d->optind][1] == '-')
+ {
+ /* "--foo" is always a long option. The special option
+ "--" was handled above. */
+ d->__nextchar = argv[d->optind] + 2;
+ return process_long_option (argc, argv, optstring, longopts,
+ longind, long_only, d,
+ print_errors, "--");
+ }
+
+ /* If long_only and the ARGV-element has the form "-f",
+ where f is a valid short option, don't consider it an
+ abbreviated form of a long option that starts with f.
+ Otherwise there would be no way to give the -f short
+ option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an
+ abbreviation of the long option, just like "--fu", and
+ not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+ if (long_only && (argv[d->optind][2]
+ || !strchr (optstring, argv[d->optind][1])))
+ {
+ int code;
+ d->__nextchar = argv[d->optind] + 1;
+ code = process_long_option (argc, argv, optstring, longopts,
+ longind, long_only, d,
+ print_errors, "-");
+ if (code != -1)
+ return code;
+ }
+ }
+
+ /* It is not a long option. Skip the initial punctuation. */
+ d->__nextchar = argv[d->optind] + 1;
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *d->__nextchar++;
+ const char *temp = strchr (optstring, c);
+
+ /* Increment 'optind' when we start to process its last character. */
+ if (*d->__nextchar == '\0')
+ ++d->optind;
+
+ if (temp == NULL || c == ':' || c == ';')
+ {
+ if (print_errors)
+ fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
+ d->optopt = c;
+ return '?';
+ }
+
+ /* Convenience. Treat POSIX -W foo same as long option --foo */
+ if (temp[0] == 'W' && temp[1] == ';' && longopts != NULL)
+ {
+ /* This is an option that requires an argument. */
+ if (*d->__nextchar != '\0')
+ d->optarg = d->__nextchar;
+ else if (d->optind == argc)
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option requires an argument -- '%c'\n"),
+ argv[0], c);
+
+ d->optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ return c;
+ }
+ else
+ d->optarg = argv[d->optind];
+
+ d->__nextchar = d->optarg;
+ d->optarg = NULL;
+ return process_long_option (argc, argv, optstring, longopts, longind,
+ 0 /* long_only */, d, print_errors, "-W ");
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*d->__nextchar != '\0')
+ {
+ d->optarg = d->__nextchar;
+ d->optind++;
+ }
+ else
+ d->optarg = NULL;
+ d->__nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*d->__nextchar != '\0')
+ {
+ d->optarg = d->__nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ d->optind++;
+ }
+ else if (d->optind == argc)
+ {
+ if (print_errors)
+ fprintf (stderr,
+ _("%s: option requires an argument -- '%c'\n"),
+ argv[0], c);
+
+ d->optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented 'optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ d->optarg = argv[d->optind++];
+ d->__nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+_getopt_internal (int argc, char **argv, const char *optstring,
+ const struct option *longopts, int *longind, int long_only,
+ int posixly_correct)
+{
+ int result;
+
+ getopt_data.optind = optind;
+ getopt_data.opterr = opterr;
+
+ result = _getopt_internal_r (argc, argv, optstring, longopts,
+ longind, long_only, &getopt_data,
+ posixly_correct);
+
+ optind = getopt_data.optind;
+ optarg = getopt_data.optarg;
+ optopt = getopt_data.optopt;
+
+ return result;
+}
+
+/* glibc gets a LSB-compliant getopt and a POSIX-complaint __posix_getopt.
+ Standalone applications just get a POSIX-compliant getopt.
+ POSIX and LSB both require these functions to take 'char *const *argv'
+ even though this is incorrect (because of the permutation). */
+#define GETOPT_ENTRY(NAME, POSIXLY_CORRECT) \
+ int \
+ NAME (int argc, char *const *argv, const char *optstring) \
+ { \
+ return _getopt_internal (argc, (char **)argv, optstring, \
+ 0, 0, 0, POSIXLY_CORRECT); \
+ }
+
+#ifdef _LIBC
+GETOPT_ENTRY(getopt, 0)
+GETOPT_ENTRY(__posix_getopt, 1)
+#else
+GETOPT_ENTRY(getopt, 1)
+#endif
+
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of 'getopt'. */
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value '%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/gl/getopt.in.h b/gl/getopt.in.h
new file mode 100644
index 0000000..0867d36
--- /dev/null
+++ b/gl/getopt.in.h
@@ -0,0 +1,61 @@
+/* Declarations for getopt.
+ Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ This file is part of gnulib.
+ Unlike most of the getopt implementation, it is NOT shared
+ with the GNU C Library, which supplies a different version of
+ this file.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_GETOPT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. We must
+ also inform the replacement unistd.h to not recursively use
+ <getopt.h>; our definitions will be present soon enough. */
+#if @HAVE_GETOPT_H@
+# define _GL_SYSTEM_GETOPT
+# @INCLUDE_NEXT@ @NEXT_GETOPT_H@
+# undef _GL_SYSTEM_GETOPT
+#endif
+
+#define _@GUARD_PREFIX@_GETOPT_H 1
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in getopt-core.h and getopt-ext.h. When this happens,
+ include the headers that might declare getopt so that they will not
+ cause confusion if included after this file (if the system had
+ <getopt.h>, we have already included it). */
+#if defined __GETOPT_PREFIX
+# if !@HAVE_GETOPT_H@
+# define __need_system_stdlib_h
+# include <stdlib.h>
+# undef __need_system_stdlib_h
+# include <stdio.h>
+# include <unistd.h>
+# endif
+#endif
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+#include <getopt-cdefs.h>
+#include <getopt-pfx-core.h>
+#include <getopt-pfx-ext.h>
+
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
diff --git a/gl/getopt1.c b/gl/getopt1.c
new file mode 100644
index 0000000..49323aa
--- /dev/null
+++ b/gl/getopt1.c
@@ -0,0 +1,159 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include "getopt.h"
+#include "getopt_int.h"
+
+int
+getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
+ const struct option *long_options, int *opt_index)
+{
+ return _getopt_internal (argc, (char **) argv, options, long_options,
+ opt_index, 0, 0);
+}
+
+int
+_getopt_long_r (int argc, char **argv, const char *options,
+ const struct option *long_options, int *opt_index,
+ struct _getopt_data *d)
+{
+ return _getopt_internal_r (argc, argv, options, long_options, opt_index,
+ 0, d, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (int argc, char *__getopt_argv_const *argv,
+ const char *options,
+ const struct option *long_options, int *opt_index)
+{
+ return _getopt_internal (argc, (char **) argv, options, long_options,
+ opt_index, 1, 0);
+}
+
+int
+_getopt_long_only_r (int argc, char **argv, const char *options,
+ const struct option *long_options, int *opt_index,
+ struct _getopt_data *d)
+{
+ return _getopt_internal_r (argc, argv, options, long_options, opt_index,
+ 1, d, 0);
+}
+
+
+#ifdef TEST
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char **argv)
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static const struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value '%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value '%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/gl/getopt_int.h b/gl/getopt_int.h
new file mode 100644
index 0000000..4d9e24b
--- /dev/null
+++ b/gl/getopt_int.h
@@ -0,0 +1,118 @@
+/* Internal declarations for getopt.
+ Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library and is also part of gnulib.
+ Patches to this file should be submitted to both projects.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _GETOPT_INT_H
+#define _GETOPT_INT_H 1
+
+#include <getopt.h>
+
+extern int _getopt_internal (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, int __posixly_correct);
+
+
+/* Reentrant versions which can handle parsing multiple argument
+ vectors at the same time. */
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ REQUIRE_ORDER means don't recognize them as options; stop option
+ processing when the first non-option is seen. This is what POSIX
+ specifies should happen.
+
+ PERMUTE means permute the contents of ARGV as we scan, so that
+ eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written
+ to expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were
+ written to expect options and other ARGV-elements in any order
+ and that care about the ordering of the two. We describe each
+ non-option ARGV-element as if it were the argument of an option
+ with character code 1.
+
+ The special argument '--' forces an end of option-scanning regardless
+ of the value of 'ordering'. In the case of RETURN_IN_ORDER, only
+ '--' can cause 'getopt' to return -1 with 'optind' != ARGC. */
+
+enum __ord
+ {
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+ };
+
+/* Data type for reentrant functions. */
+struct _getopt_data
+{
+ /* These have exactly the same meaning as the corresponding global
+ variables, except that they are used for the reentrant
+ versions of getopt. */
+ int optind;
+ int opterr;
+ int optopt;
+ char *optarg;
+
+ /* Internal members. */
+
+ /* True if the internal members have been initialized. */
+ int __initialized;
+
+ /* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+ char *__nextchar;
+
+ /* See __ord above. */
+ enum __ord __ordering;
+
+ /* Handle permutation of arguments. */
+
+ /* Describe the part of ARGV that contains non-options that have
+ been skipped. 'first_nonopt' is the index in ARGV of the first
+ of them; 'last_nonopt' is the index after the last of them. */
+
+ int __first_nonopt;
+ int __last_nonopt;
+};
+
+/* The initializer is necessary to set OPTIND and OPTERR to their
+ default values and to clear the initialization flag. */
+#define _GETOPT_DATA_INITIALIZER { 1, 1 }
+
+extern int _getopt_internal_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, struct _getopt_data *__data,
+ int __posixly_correct);
+
+extern int _getopt_long_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ struct _getopt_data *__data);
+
+extern int _getopt_long_only_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts,
+ int *__longind,
+ struct _getopt_data *__data);
+
+#endif /* getopt_int.h */
diff --git a/gl/getprogname.c b/gl/getprogname.c
new file mode 100644
index 0000000..32c9604
--- /dev/null
+++ b/gl/getprogname.c
@@ -0,0 +1,302 @@
+/* Program name management.
+ Copyright (C) 2016-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "getprogname.h"
+
+#include <errno.h> /* get program_invocation_name declaration */
+#include <stdlib.h> /* get __argv declaration */
+
+#ifdef _AIX
+# include <unistd.h>
+# include <procinfo.h>
+# include <string.h>
+#endif
+
+#ifdef __MVS__
+# ifndef _OPEN_SYS
+# define _OPEN_SYS
+# endif
+# include <string.h>
+# include <sys/ps.h>
+#endif
+
+#ifdef __hpux
+# include <unistd.h>
+# include <sys/param.h>
+# include <sys/pstat.h>
+# include <string.h>
+#endif
+
+#if defined __sgi || defined __osf__
+# include <string.h>
+# include <unistd.h>
+# include <stdio.h>
+# include <fcntl.h>
+# include <sys/procfs.h>
+#endif
+
+#if defined __SCO_VERSION__ || defined __sysv5__
+# include <fcntl.h>
+# include <stdlib.h>
+# include <string.h>
+#endif
+
+#include "basename-lgpl.h"
+
+#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
+char const *
+getprogname (void)
+{
+# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* glibc, BeOS */
+ /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
+ return program_invocation_short_name;
+# elif HAVE_DECL_PROGRAM_INVOCATION_NAME /* glibc, BeOS */
+ /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
+ return last_component (program_invocation_name);
+# elif HAVE_GETEXECNAME /* Solaris */
+ /* https://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
+ const char *p = getexecname ();
+ if (!p)
+ p = "?";
+ return last_component (p);
+# elif HAVE_DECL___ARGV /* mingw, MSVC */
+ /* https://docs.microsoft.com/en-us/cpp/c-runtime-library/argc-argv-wargv */
+ const char *p = __argv && __argv[0] ? __argv[0] : "?";
+ return last_component (p);
+# elif HAVE_VAR___PROGNAME /* OpenBSD, Android, QNX */
+ /* https://man.openbsd.org/style.9 */
+ /* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */
+ /* Be careful to declare this only when we absolutely need it
+ (OpenBSD 5.1), rather than when it's available. Otherwise,
+ its mere declaration makes program_invocation_short_name
+ malfunction (have zero length) with Fedora 25's glibc. */
+ extern char *__progname;
+ const char *p = __progname;
+# if defined __ANDROID__
+ return last_component (p);
+# else
+ return p && p[0] ? p : "?";
+# endif
+# elif _AIX /* AIX */
+ /* Idea by Bastien ROUCARIÈS,
+ https://lists.gnu.org/r/bug-gnulib/2010-12/msg00095.html
+ Reference: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/getprocs.htm
+ */
+ static char *p;
+ static int first = 1;
+ if (first)
+ {
+ first = 0;
+ pid_t pid = getpid ();
+ struct procentry64 procs;
+ p = (0 < getprocs64 (&procs, sizeof procs, NULL, 0, &pid, 1)
+ ? strdup (procs.pi_comm)
+ : NULL);
+ if (!p)
+ p = "?";
+ }
+ return p;
+# elif defined __hpux
+ static char *p;
+ static int first = 1;
+ if (first)
+ {
+ first = 0;
+ pid_t pid = getpid ();
+ struct pst_status status;
+ if (pstat_getproc (&status, sizeof status, 0, pid) > 0)
+ {
+ char *ucomm = status.pst_ucomm;
+ char *cmd = status.pst_cmd;
+ if (strlen (ucomm) < PST_UCOMMLEN - 1)
+ p = ucomm;
+ else
+ {
+ /* ucomm is truncated to length PST_UCOMMLEN - 1.
+ Look at cmd instead. */
+ char *space = strchr (cmd, ' ');
+ if (space != NULL)
+ *space = '\0';
+ p = strrchr (cmd, '/');
+ if (p != NULL)
+ p++;
+ else
+ p = cmd;
+ if (strlen (p) > PST_UCOMMLEN - 1
+ && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+ /* p is less truncated than ucomm. */
+ ;
+ else
+ p = ucomm;
+ }
+ p = strdup (p);
+ }
+ else
+ {
+# if !defined __LP64__
+ /* Support for 32-bit programs running in 64-bit HP-UX.
+ The documented way to do this is to use the same source code
+ as above, but in a compilation unit where '#define _PSTAT64 1'
+ is in effect. I prefer a single compilation unit; the struct
+ size and the offsets are not going to change. */
+ char status64[1216];
+ if (__pstat_getproc64 (status64, sizeof status64, 0, pid) > 0)
+ {
+ char *ucomm = status64 + 288;
+ char *cmd = status64 + 168;
+ if (strlen (ucomm) < PST_UCOMMLEN - 1)
+ p = ucomm;
+ else
+ {
+ /* ucomm is truncated to length PST_UCOMMLEN - 1.
+ Look at cmd instead. */
+ char *space = strchr (cmd, ' ');
+ if (space != NULL)
+ *space = '\0';
+ p = strrchr (cmd, '/');
+ if (p != NULL)
+ p++;
+ else
+ p = cmd;
+ if (strlen (p) > PST_UCOMMLEN - 1
+ && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+ /* p is less truncated than ucomm. */
+ ;
+ else
+ p = ucomm;
+ }
+ p = strdup (p);
+ }
+ else
+# endif
+ p = NULL;
+ }
+ if (!p)
+ p = "?";
+ }
+ return p;
+# elif __MVS__ /* z/OS */
+ /* https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtwgetp.htm */
+ static char *p = "?";
+ static int first = 1;
+ if (first)
+ {
+ pid_t pid = getpid ();
+ int token;
+ W_PSPROC buf;
+ first = 0;
+ memset (&buf, 0, sizeof(buf));
+ buf.ps_cmdptr = (char *) malloc (buf.ps_cmdlen = PS_CMDBLEN_LONG);
+ buf.ps_conttyptr = (char *) malloc (buf.ps_conttylen = PS_CONTTYBLEN);
+ buf.ps_pathptr = (char *) malloc (buf.ps_pathlen = PS_PATHBLEN);
+ if (buf.ps_cmdptr && buf.ps_conttyptr && buf.ps_pathptr)
+ {
+ for (token = 0; token >= 0;
+ token = w_getpsent (token, &buf, sizeof(buf)))
+ {
+ if (token > 0 && buf.ps_pid == pid)
+ {
+ char *s = strdup (last_component (buf.ps_pathptr));
+ if (s)
+ p = s;
+ break;
+ }
+ }
+ }
+ free (buf.ps_cmdptr);
+ free (buf.ps_conttyptr);
+ free (buf.ps_pathptr);
+ }
+ return p;
+# elif defined __sgi || defined __osf__ /* IRIX or Tru64 */
+ char filename[50];
+ int fd;
+
+ # if defined __sgi
+ sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
+ # else
+ sprintf (filename, "/proc/%d", (int) getpid ());
+ # endif
+ fd = open (filename, O_RDONLY | O_CLOEXEC);
+ if (0 <= fd)
+ {
+ prpsinfo_t buf;
+ int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf);
+ close (fd);
+ if (ioctl_ok)
+ {
+ char *name = buf.pr_fname;
+ size_t namesize = sizeof buf.pr_fname;
+ /* It may not be NUL-terminated. */
+ char *namenul = memchr (name, '\0', namesize);
+ size_t namelen = namenul ? namenul - name : namesize;
+ char *namecopy = malloc (namelen + 1);
+ if (namecopy)
+ {
+ namecopy[namelen] = '\0';
+ return memcpy (namecopy, name, namelen);
+ }
+ }
+ }
+ return NULL;
+# elif defined __SCO_VERSION__ || defined __sysv5__ /* SCO OpenServer6/UnixWare */
+ char buf[80];
+ int fd;
+ sprintf (buf, "/proc/%d/cmdline", getpid());
+ fd = open (buf, O_RDONLY);
+ if (0 <= fd)
+ {
+ size_t n = read (fd, buf, 79);
+ if (n > 0)
+ {
+ buf[n] = '\0'; /* Guarantee null-termination */
+ char *progname;
+ progname = strrchr (buf, '/');
+ if (progname)
+ {
+ progname = progname + 1; /* Skip the '/' */
+ }
+ else
+ {
+ progname = buf;
+ }
+ char *ret;
+ ret = malloc (strlen (progname) + 1);
+ if (ret)
+ {
+ strcpy (ret, progname);
+ return ret;
+ }
+ }
+ close (fd);
+ }
+ return "?";
+# else
+# error "getprogname module not ported to this OS"
+# endif
+}
+
+#endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
diff --git a/gl/getprogname.h b/gl/getprogname.h
new file mode 100644
index 0000000..4b9126f
--- /dev/null
+++ b/gl/getprogname.h
@@ -0,0 +1,40 @@
+/* Program name management.
+ Copyright (C) 2016-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_GETPROGNAME_H
+#define _GL_GETPROGNAME_H
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Return the base name of the executing program.
+ On native Windows this will usually end in ".exe" or ".EXE". */
+#ifndef HAVE_GETPROGNAME
+extern char const *getprogname (void)
+# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+ _GL_ATTRIBUTE_PURE
+# endif
+ ;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/gl/gettext.h b/gl/gettext.h
new file mode 100644
index 0000000..d0462c4
--- /dev/null
+++ b/gl/gettext.h
@@ -0,0 +1,300 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option
+ or through "#define ENABLE NLS 0" before including this file. */
+#if defined ENABLE_NLS && ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
+ the gettext() and ngettext() macros. This is an alternative to calling
+ textdomain(), and is useful for libraries. */
+# ifdef DEFAULT_TEXT_DOMAIN
+# undef gettext
+# define gettext(Msgid) \
+ dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
+# endif
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+ <libintl.h>, which chokes if dcgettext is defined as a macro. So include
+ it now, to make later inclusions of <libintl.h> a NOP. */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
+# include <libintl.h>
+# endif
+#endif
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# undef gettext
+# define gettext(Msgid) ((const char *) (Msgid))
+# undef dgettext
+# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# undef dcgettext
+# define dcgettext(Domainname, Msgid, Category) \
+ ((void) (Category), dgettext (Domainname, Msgid))
+# undef ngettext
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 \
+ ? ((void) (Msgid2), (const char *) (Msgid1)) \
+ : ((void) (Msgid1), (const char *) (Msgid2)))
+# undef dngettext
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# undef dcngettext
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
+# undef textdomain
+# define textdomain(Domainname) ((const char *) (Domainname))
+# undef bindtextdomain
+# define bindtextdomain(Domainname, Dirname) \
+ ((void) (Domainname), (const char *) (Dirname))
+# undef bind_textdomain_codeset
+# define bind_textdomain_codeset(Domainname, Codeset) \
+ ((void) (Domainname), (const char *) (Codeset))
+
+#endif
+
+/* Prefer gnulib's setlocale override over libintl's setlocale override. */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+/* The separator between msgctxt and msgid in a .mo file. */
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+ MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
+ short and rarely need to change.
+ The letter 'p' stands for 'particular' or 'special'. */
+#ifdef DEFAULT_TEXT_DOMAIN
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#else
+# define pgettext(Msgctxt, Msgid) \
+ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#endif
+#define dpgettext(Domainname, Msgctxt, Msgid) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#else
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#endif
+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+pgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ int category)
+{
+ const char *translation = dcgettext (domain, msg_ctxt_id, category);
+ if (translation == msg_ctxt_id)
+ return msgid;
+ else
+ return translation;
+}
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+npgettext_aux (const char *domain,
+ const char *msg_ctxt_id, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ const char *translation =
+ dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ if (translation == msg_ctxt_id || translation == msgid_plural)
+ return (n == 1 ? msgid : msgid_plural);
+ else
+ return translation;
+}
+
+/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
+ can be arbitrary expressions. But for string literals these macros are
+ less efficient than those above. */
+
+#include <string.h>
+
+/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported.
+ This relates to the -Wvla and -Wvla-larger-than warnings, enabled in
+ the default GCC many warnings set. This allows programs to disable use
+ of VLAs, which may be unintended, or may be awkward to support portably,
+ or may have security implications due to non-deterministic stack usage. */
+
+#if (!defined GNULIB_NO_VLA \
+ && defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ \
+ && !defined __STDC_NO_VLA__)
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
+
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+#include <stdlib.h>
+#endif
+
+#define pgettext_expr(Msgctxt, Msgid) \
+ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ int found_translation;
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcgettext (domain, msg_ctxt_id, category);
+ found_translation = (translation != msg_ctxt_id);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (found_translation)
+ return translation;
+ }
+ return msgid;
+}
+
+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+
+#if defined __GNUC__ || defined __clang__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcnpgettext_expr (const char *domain,
+ const char *msgctxt, const char *msgid,
+ const char *msgid_plural, unsigned long int n,
+ int category)
+{
+ size_t msgctxt_len = strlen (msgctxt) + 1;
+ size_t msgid_len = strlen (msgid) + 1;
+ const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+ char buf[1024];
+ char *msg_ctxt_id =
+ (msgctxt_len + msgid_len <= sizeof (buf)
+ ? buf
+ : (char *) malloc (msgctxt_len + msgid_len));
+ if (msg_ctxt_id != NULL)
+#endif
+ {
+ int found_translation;
+ memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+ msg_ctxt_id[msgctxt_len - 1] = '\004';
+ memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+ translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+ found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+ if (msg_ctxt_id != buf)
+ free (msg_ctxt_id);
+#endif
+ if (found_translation)
+ return translation;
+ }
+ return (n == 1 ? msgid : msgid_plural);
+}
+
+#endif /* _LIBGETTEXT_H */
diff --git a/gl/gl_openssl.h b/gl/gl_openssl.h
new file mode 100644
index 0000000..f63c386
--- /dev/null
+++ b/gl/gl_openssl.h
@@ -0,0 +1,116 @@
+/* Wrap openssl crypto hash routines in gnulib interface. -*- coding: utf-8 -*-
+
+ Copyright (C) 2013-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Pádraig Brady */
+
+#ifndef GL_OPENSSL_NAME
+# error "Please define GL_OPENSSL_NAME to 1,5,256 etc."
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+# error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_OPENSSL_INLINE
+# define GL_OPENSSL_INLINE _GL_INLINE
+#endif
+
+/* Concatenate two preprocessor tokens. */
+#define _GLCRYPTO_CONCAT_(prefix, suffix) prefix##suffix
+#define _GLCRYPTO_CONCAT(prefix, suffix) _GLCRYPTO_CONCAT_ (prefix, suffix)
+
+#if GL_OPENSSL_NAME == 5
+# define OPENSSL_ALG md5
+#else
+# define OPENSSL_ALG _GLCRYPTO_CONCAT (sha, GL_OPENSSL_NAME)
+#endif
+
+/* Context type mappings. */
+#if BASE_OPENSSL_TYPE != GL_OPENSSL_NAME
+# undef BASE_OPENSSL_TYPE
+# if GL_OPENSSL_NAME == 224
+# define BASE_OPENSSL_TYPE 256
+# elif GL_OPENSSL_NAME == 384
+# define BASE_OPENSSL_TYPE 512
+# endif
+# define md5_CTX MD5_CTX
+# define sha1_CTX SHA_CTX
+# define sha224_CTX SHA256_CTX
+# define sha224_ctx sha256_ctx
+# define sha256_CTX SHA256_CTX
+# define sha384_CTX SHA512_CTX
+# define sha384_ctx sha512_ctx
+# define sha512_CTX SHA512_CTX
+# undef _gl_CTX
+# undef _gl_ctx
+# define _gl_CTX _GLCRYPTO_CONCAT (OPENSSL_ALG, _CTX) /* openssl type. */
+# define _gl_ctx _GLCRYPTO_CONCAT (OPENSSL_ALG, _ctx) /* gnulib type. */
+
+struct _gl_ctx { _gl_CTX CTX; };
+#endif
+
+/* Function name mappings. */
+#define md5_prefix MD5
+#define sha1_prefix SHA1
+#define sha224_prefix SHA224
+#define sha256_prefix SHA256
+#define sha384_prefix SHA384
+#define sha512_prefix SHA512
+#define _GLCRYPTO_PREFIX _GLCRYPTO_CONCAT (OPENSSL_ALG, _prefix)
+#define OPENSSL_FN(suffix) _GLCRYPTO_CONCAT (_GLCRYPTO_PREFIX, suffix)
+#define GL_CRYPTO_FN(suffix) _GLCRYPTO_CONCAT (OPENSSL_ALG, suffix)
+
+GL_OPENSSL_INLINE void
+GL_CRYPTO_FN (_init_ctx) (struct _gl_ctx *ctx)
+{ (void) OPENSSL_FN (_Init) ((_gl_CTX *) ctx); }
+
+/* These were never exposed by gnulib. */
+#if ! (GL_OPENSSL_NAME == 224 || GL_OPENSSL_NAME == 384)
+GL_OPENSSL_INLINE void
+GL_CRYPTO_FN (_process_bytes) (const void *buf, size_t len, struct _gl_ctx *ctx)
+{ OPENSSL_FN (_Update) ((_gl_CTX *) ctx, buf, len); }
+
+GL_OPENSSL_INLINE void
+GL_CRYPTO_FN (_process_block) (const void *buf, size_t len, struct _gl_ctx *ctx)
+{ GL_CRYPTO_FN (_process_bytes) (buf, len, ctx); }
+#endif
+
+GL_OPENSSL_INLINE void *
+GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void *restrict res)
+{ OPENSSL_FN (_Final) ((unsigned char *) res, (_gl_CTX *) ctx); return res; }
+
+GL_OPENSSL_INLINE void *
+GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void *restrict res)
+{ return OPENSSL_FN () ((const unsigned char *) buf, len, (unsigned char *) res); }
+
+GL_OPENSSL_INLINE void *
+GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *restrict res)
+{
+ /* Assume any unprocessed bytes in ctx are not to be ignored. */
+ _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
+ OPENSSL_FN (_Final) ((unsigned char *) res, &tmp_ctx);
+ return res;
+}
+
+/* Undef so we can include multiple times. */
+#undef GL_CRYPTO_FN
+#undef OPENSSL_FN
+#undef _GLCRYPTO_PREFIX
+#undef OPENSSL_ALG
+#undef GL_OPENSSL_NAME
+
+_GL_INLINE_HEADER_END
diff --git a/gl/glthread/lock.c b/gl/glthread/lock.c
new file mode 100644
index 0000000..82fb755
--- /dev/null
+++ b/gl/glthread/lock.c
@@ -0,0 +1,749 @@
+/* Locking in multithreaded situations.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h. */
+
+#include <config.h>
+
+#include "glthread/lock.h"
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+int
+glthread_lock_init (gl_lock_t *lock)
+{
+ if (mtx_init (&lock->mutex, mtx_plain) != thrd_success)
+ return ENOMEM;
+ lock->init_needed = 0;
+ return 0;
+}
+
+int
+glthread_lock_lock (gl_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->mutex) != thrd_success)
+ return EAGAIN;
+ return 0;
+}
+
+int
+glthread_lock_unlock (gl_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_unlock (&lock->mutex) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_lock_destroy (gl_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ mtx_destroy (&lock->mutex);
+ return 0;
+}
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+int
+glthread_rwlock_init (gl_rwlock_t *lock)
+{
+ if (mtx_init (&lock->lock, mtx_plain) != thrd_success
+ || cnd_init (&lock->waiting_readers) != thrd_success
+ || cnd_init (&lock->waiting_writers) != thrd_success)
+ return ENOMEM;
+ lock->waiting_writers_count = 0;
+ lock->runcount = 0;
+ lock->init_needed = 0;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->lock) != thrd_success)
+ return EAGAIN;
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ if (cnd_wait (&lock->waiting_readers, &lock->lock) != thrd_success)
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ }
+ lock->runcount++;
+ if (mtx_unlock (&lock->lock) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_rwlock_wrlock (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->lock) != thrd_success)
+ return EAGAIN;
+ /* Test whether no readers or writers are currently running. */
+ while (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ lock->waiting_writers_count++;
+ if (cnd_wait (&lock->waiting_writers, &lock->lock) != thrd_success)
+ {
+ lock->waiting_writers_count--;
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->waiting_writers_count--;
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ if (mtx_unlock (&lock->lock) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_rwlock_unlock (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->lock) != thrd_success)
+ return EAGAIN;
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers_count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ if (cnd_signal (&lock->waiting_writers) != thrd_success)
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ if (cnd_broadcast (&lock->waiting_readers) != thrd_success)
+ {
+ mtx_unlock (&lock->lock);
+ return EINVAL;
+ }
+ }
+ }
+ if (mtx_unlock (&lock->lock) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_rwlock_destroy (gl_rwlock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ mtx_destroy (&lock->lock);
+ cnd_destroy (&lock->waiting_readers);
+ cnd_destroy (&lock->waiting_writers);
+ return 0;
+}
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+int
+glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+{
+ if (mtx_init (&lock->mutex, mtx_plain | mtx_recursive) != thrd_success)
+ return ENOMEM;
+ lock->init_needed = 0;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_lock (&lock->mutex) != thrd_success)
+ return EAGAIN;
+ return 0;
+}
+
+int
+glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ if (mtx_unlock (&lock->mutex) != thrd_success)
+ return EINVAL;
+ return 0;
+}
+
+int
+glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+{
+ if (lock->init_needed)
+ call_once (&lock->init_once, lock->init_func);
+ mtx_destroy (&lock->mutex);
+ return 0;
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
+
+# if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP
+
+# if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+ /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+
+int
+glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock)
+{
+ pthread_rwlockattr_t attributes;
+ int err;
+
+ err = pthread_rwlockattr_init (&attributes);
+ if (err != 0)
+ return err;
+ /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that
+ causes the writer to be preferred. PTHREAD_RWLOCK_PREFER_WRITER_NP does not
+ do this; see
+ http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html */
+ err = pthread_rwlockattr_setkind_np (&attributes,
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+ if (err == 0)
+ err = pthread_rwlock_init(lock, &attributes);
+ /* pthread_rwlockattr_destroy always returns 0. It cannot influence the
+ return value. */
+ pthread_rwlockattr_destroy (&attributes);
+ return err;
+}
+
+# endif
+# else
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_rwlock_init (&lock->rwlock, NULL);
+ if (err != 0)
+ return err;
+ lock->initialized = 1;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_rwlock_rdlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_rwlock_wrlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ return EINVAL;
+ return pthread_rwlock_unlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ if (!lock->initialized)
+ return EINVAL;
+ err = pthread_rwlock_destroy (&lock->rwlock);
+ if (err != 0)
+ return err;
+ lock->initialized = 0;
+ return 0;
+}
+
+# endif
+
+# else
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_init (&lock->lock, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_readers, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_writers, NULL);
+ if (err != 0)
+ return err;
+ lock->waiting_writers_count = 0;
+ lock->runcount = 0;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ err = pthread_cond_wait (&lock->waiting_readers, &lock->lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ lock->runcount++;
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ /* Test whether no readers or writers are currently running. */
+ while (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ lock->waiting_writers_count++;
+ err = pthread_cond_wait (&lock->waiting_writers, &lock->lock);
+ if (err != 0)
+ {
+ lock->waiting_writers_count--;
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ lock->waiting_writers_count--;
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers_count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ err = pthread_cond_signal (&lock->waiting_writers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ err = pthread_cond_broadcast (&lock->waiting_readers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ }
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_destroy (&lock->lock);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_readers);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_writers);
+ if (err != 0)
+ return err;
+ return 0;
+}
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_mutexattr_t attributes;
+ int err;
+
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (lock, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
+ return 0;
+}
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_mutexattr_t attributes;
+ int err;
+
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (&lock->recmutex, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
+ lock->initialized = 1;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_recursive_lock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_mutex_lock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (!lock->initialized)
+ return EINVAL;
+ return pthread_mutex_unlock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+ int err;
+
+ if (!lock->initialized)
+ return EINVAL;
+ err = pthread_mutex_destroy (&lock->recmutex);
+ if (err != 0)
+ return err;
+ lock->initialized = 0;
+ return 0;
+}
+
+# endif
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_init (&lock->mutex, NULL);
+ if (err != 0)
+ return err;
+ lock->owner = (pthread_t) 0;
+ lock->depth = 0;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_t self = pthread_self ();
+ if (lock->owner != self)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->mutex);
+ if (err != 0)
+ return err;
+ lock->owner = self;
+ }
+ if (++(lock->depth) == 0) /* wraparound? */
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
+ return 0;
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != pthread_self ())
+ return EPERM;
+ if (lock->depth == 0)
+ return EINVAL;
+ if (--(lock->depth) == 0)
+ {
+ lock->owner = (pthread_t) 0;
+ return pthread_mutex_unlock (&lock->mutex);
+ }
+ else
+ return 0;
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != (pthread_t) 0)
+ return EBUSY;
+ return pthread_mutex_destroy (&lock->mutex);
+}
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
+
+int
+glthread_once_singlethreaded (pthread_once_t *once_control)
+{
+ /* We don't know whether pthread_once_t is an integer type, a floating-point
+ type, a pointer type, or a structure type. */
+ char *firstbyte = (char *)once_control;
+ if (*firstbyte == *(const char *)&fresh_once)
+ {
+ /* First time use of once_control. Invert the first byte. */
+ *firstbyte = ~ *(const char *)&fresh_once;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK)
+
+int
+glthread_once_multithreaded (pthread_once_t *once_control,
+ void (*init_function) (void))
+{
+ int err = pthread_once (once_control, init_function);
+ if (err == ENOSYS)
+ {
+ /* This happens on FreeBSD 11: The pthread_once function in libc returns
+ ENOSYS. */
+ if (glthread_once_singlethreaded (once_control))
+ init_function ();
+ return 0;
+ }
+ return err;
+}
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+#endif
+
+/* ========================================================================= */
diff --git a/gl/glthread/lock.h b/gl/glthread/lock.h
new file mode 100644
index 0000000..ae3ee2d
--- /dev/null
+++ b/gl/glthread/lock.h
@@ -0,0 +1,791 @@
+/* Locking in multithreaded situations.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
+
+/* This file contains locking primitives for use with a given thread library.
+ It does not contain primitives for creating threads or for other
+ synchronization primitives.
+
+ Normal (non-recursive) locks:
+ Type: gl_lock_t
+ Declaration: gl_lock_define(extern, name)
+ Initializer: gl_lock_define_initialized(, name)
+ Initialization: gl_lock_init (name);
+ Taking the lock: gl_lock_lock (name);
+ Releasing the lock: gl_lock_unlock (name);
+ De-initialization: gl_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_lock_init (&name);
+ Taking the lock: err = glthread_lock_lock (&name);
+ Releasing the lock: err = glthread_lock_unlock (&name);
+ De-initialization: err = glthread_lock_destroy (&name);
+
+ Read-Write (non-recursive) locks:
+ Type: gl_rwlock_t
+ Declaration: gl_rwlock_define(extern, name)
+ Initializer: gl_rwlock_define_initialized(, name)
+ Initialization: gl_rwlock_init (name);
+ Taking the lock: gl_rwlock_rdlock (name);
+ gl_rwlock_wrlock (name);
+ Releasing the lock: gl_rwlock_unlock (name);
+ De-initialization: gl_rwlock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_rwlock_init (&name);
+ Taking the lock: err = glthread_rwlock_rdlock (&name);
+ err = glthread_rwlock_wrlock (&name);
+ Releasing the lock: err = glthread_rwlock_unlock (&name);
+ De-initialization: err = glthread_rwlock_destroy (&name);
+
+ Recursive locks:
+ Type: gl_recursive_lock_t
+ Declaration: gl_recursive_lock_define(extern, name)
+ Initializer: gl_recursive_lock_define_initialized(, name)
+ Initialization: gl_recursive_lock_init (name);
+ Taking the lock: gl_recursive_lock_lock (name);
+ Releasing the lock: gl_recursive_lock_unlock (name);
+ De-initialization: gl_recursive_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_recursive_lock_init (&name);
+ Taking the lock: err = glthread_recursive_lock_lock (&name);
+ Releasing the lock: err = glthread_recursive_lock_unlock (&name);
+ De-initialization: err = glthread_recursive_lock_destroy (&name);
+
+ Once-only execution:
+ Type: gl_once_t
+ Initializer: gl_once_define(extern, name)
+ Execution: gl_once (name, initfunction);
+ Equivalent functions with control of error handling:
+ Execution: err = glthread_once (&name, initfunction);
+*/
+
+
+#ifndef _LOCK_H
+#define _LOCK_H
+
+#include <errno.h>
+#include <stdlib.h>
+
+#if !defined c11_threads_in_use
+# if HAVE_THREADS_H && USE_POSIX_THREADS_FROM_LIBC
+# define c11_threads_in_use() 1
+# elif HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+#endif
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the ISO C threads library. */
+
+# include <threads.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef struct
+ {
+ int volatile init_needed;
+ once_flag init_once;
+ void (*init_func) (void);
+ mtx_t mutex;
+ }
+ gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ static void _atomic_init_##NAME (void); \
+ STORAGECLASS gl_lock_t NAME = \
+ { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+ static void _atomic_init_##NAME (void) \
+ { \
+ if (glthread_lock_init (&(NAME))) \
+ abort (); \
+ }
+extern int glthread_lock_init (gl_lock_t *lock);
+extern int glthread_lock_lock (gl_lock_t *lock);
+extern int glthread_lock_unlock (gl_lock_t *lock);
+extern int glthread_lock_destroy (gl_lock_t *lock);
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef struct
+ {
+ int volatile init_needed;
+ once_flag init_once;
+ void (*init_func) (void);
+ mtx_t lock; /* protects the remaining fields */
+ cnd_t waiting_readers; /* waiting readers */
+ cnd_t waiting_writers; /* waiting writers */
+ unsigned int waiting_writers_count; /* number of waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ static void _atomic_init_##NAME (void); \
+ STORAGECLASS gl_rwlock_t NAME = \
+ { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+ static void _atomic_init_##NAME (void) \
+ { \
+ if (glthread_rwlock_init (&(NAME))) \
+ abort (); \
+ }
+extern int glthread_rwlock_init (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy (gl_rwlock_t *lock);
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef struct
+ {
+ int volatile init_needed;
+ once_flag init_once;
+ void (*init_func) (void);
+ mtx_t mutex;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ static void _atomic_init_##NAME (void); \
+ STORAGECLASS gl_recursive_lock_t NAME = \
+ { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+ static void _atomic_init_##NAME (void) \
+ { \
+ if (glthread_recursive_lock_init (&(NAME))) \
+ abort (); \
+ }
+extern int glthread_recursive_lock_init (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef once_flag gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS once_flag NAME = ONCE_FLAG_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (call_once (ONCE_CONTROL, INITFUNCTION), 0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <pthread.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The pthread_in_use() detection needs to be done at runtime. */
+# define pthread_in_use() \
+ glthread_in_use ()
+extern int glthread_in_use (void);
+
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+
+/* Use weak references to the POSIX threads library. */
+
+/* Weak references avoid dragging in external libraries if the other parts
+ of the program don't use them. Here we use them, because we don't want
+ every program that uses libintl to depend on libpthread. This assumes
+ that libpthread would not be loaded after libintl; i.e. if libintl is
+ loaded first, by an executable that does not depend on libpthread, and
+ then a module is dynamically loaded that depends on libpthread, libintl
+ will not be multithread-safe. */
+
+/* The way to test at runtime whether libpthread is present is to test
+ whether a function pointer's value, such as &pthread_mutex_init, is
+ non-NULL. However, some versions of GCC have a bug through which, in
+ PIC mode, &foo != NULL always evaluates to true if there is a direct
+ call to foo(...) in the same function. To avoid this, we test the
+ address of a function in libpthread that we don't use. */
+
+# pragma weak pthread_mutex_init
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+# pragma weak pthread_mutex_destroy
+# pragma weak pthread_rwlock_init
+# pragma weak pthread_rwlock_rdlock
+# pragma weak pthread_rwlock_wrlock
+# pragma weak pthread_rwlock_unlock
+# pragma weak pthread_rwlock_destroy
+# pragma weak pthread_once
+# pragma weak pthread_cond_init
+# pragma weak pthread_cond_wait
+# pragma weak pthread_cond_signal
+# pragma weak pthread_cond_broadcast
+# pragma weak pthread_cond_destroy
+# pragma weak pthread_mutexattr_init
+# pragma weak pthread_mutexattr_settype
+# pragma weak pthread_mutexattr_destroy
+# pragma weak pthread_rwlockattr_init
+# if __GNU_LIBRARY__ > 1
+# pragma weak pthread_rwlockattr_setkind_np
+# endif
+# pragma weak pthread_rwlockattr_destroy
+# ifndef pthread_self
+# pragma weak pthread_self
+# endif
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+ /* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols
+ can be used to determine whether libpthread is in use. These are:
+ pthread_mutexattr_gettype
+ pthread_rwlockattr_destroy
+ pthread_rwlockattr_init
+ */
+# pragma weak pthread_mutexattr_gettype
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+# endif
+
+# else
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+# define pthread_in_use() 1
+# endif
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pthread_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ PTHREAD_MUTEX_INITIALIZER
+# define glthread_lock_init(LOCK) \
+ (pthread_in_use () ? pthread_mutex_init (LOCK, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
+
+# if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP
+
+typedef pthread_rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
+# if HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+# if defined PTHREAD_RWLOCK_INITIALIZER
+# define gl_rwlock_initializer \
+ PTHREAD_RWLOCK_INITIALIZER
+# else
+# define gl_rwlock_initializer \
+ PTHREAD_RWLOCK_INITIALIZER_NP
+# endif
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+# else /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+# define gl_rwlock_initializer \
+ PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_for_glibc (LOCK) : 0)
+extern int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock);
+# endif
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_wrlock (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_unlock (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_destroy (LOCK) : 0)
+
+# else
+
+typedef struct
+ {
+ int initialized;
+ pthread_mutex_t guard; /* protects the initialization */
+ pthread_rwlock_t rwlock; /* read-write lock */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ { 0, PTHREAD_MUTEX_INITIALIZER }
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
+# else
+
+typedef struct
+ {
+ pthread_mutex_t lock; /* protects the remaining fields */
+ pthread_cond_t waiting_readers; /* waiting readers */
+ pthread_cond_t waiting_writers; /* waiting writers */
+ unsigned int waiting_writers_count; /* number of waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+typedef pthread_mutex_t gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer;
+# ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+# define gl_recursive_lock_initializer \
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+# else
+# define gl_recursive_lock_initializer \
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+# endif
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+
+# else
+
+typedef struct
+ {
+ pthread_mutex_t recmutex; /* recursive mutex */
+ pthread_mutex_t guard; /* protects the initialization */
+ int initialized;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+# endif
+
+# else
+
+/* Old versions of POSIX threads on Solaris did not have recursive locks.
+ We have to implement them ourselves. */
+
+typedef struct
+ {
+ pthread_mutex_t mutex;
+ pthread_t owner;
+ unsigned long depth;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
+# if PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use () \
+ ? pthread_once (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+# else
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use () \
+ ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (pthread_once_t *once_control,
+ void (*init_function) (void));
+# endif
+extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-mutex.h"
+# include "windows-rwlock.h"
+# include "windows-recmutex.h"
+# include "windows-once.h"
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* We can use CRITICAL_SECTION directly, rather than the native Windows Event,
+ Mutex, Semaphore types, because
+ - we need only to synchronize inside a single process (address space),
+ not inter-process locking,
+ - we don't need to support trylock operations. (TryEnterCriticalSection
+ does not work on Windows 95/98/ME. Packages that need trylock usually
+ define their own mutex type.) */
+
+/* There is no way to statically initialize a CRITICAL_SECTION. It needs
+ to be done lazily, once only. For this we need spinlocks. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef glwthread_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ GLWTHREAD_MUTEX_INIT
+# define glthread_lock_init(LOCK) \
+ (glwthread_mutex_init (LOCK), 0)
+# define glthread_lock_lock(LOCK) \
+ glwthread_mutex_lock (LOCK)
+# define glthread_lock_unlock(LOCK) \
+ glwthread_mutex_unlock (LOCK)
+# define glthread_lock_destroy(LOCK) \
+ glwthread_mutex_destroy (LOCK)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef glwthread_rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ GLWTHREAD_RWLOCK_INIT
+# define glthread_rwlock_init(LOCK) \
+ (glwthread_rwlock_init (LOCK), 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ glwthread_rwlock_rdlock (LOCK)
+# define glthread_rwlock_wrlock(LOCK) \
+ glwthread_rwlock_wrlock (LOCK)
+# define glthread_rwlock_unlock(LOCK) \
+ glwthread_rwlock_unlock (LOCK)
+# define glthread_rwlock_destroy(LOCK) \
+ glwthread_rwlock_destroy (LOCK)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef glwthread_recmutex_t gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ GLWTHREAD_RECMUTEX_INIT
+# define glthread_recursive_lock_init(LOCK) \
+ (glwthread_recmutex_init (LOCK), 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ glwthread_recmutex_lock (LOCK)
+# define glthread_recursive_lock_unlock(LOCK) \
+ glwthread_recmutex_unlock (LOCK)
+# define glthread_recursive_lock_destroy(LOCK) \
+ glwthread_recmutex_destroy (LOCK)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef glwthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = GLWTHREAD_ONCE_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (glwthread_once (ONCE_CONTROL, INITFUNCTION), 0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
+
+/* Provide dummy implementation if threads are not supported. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef int gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME)
+# define gl_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_lock_init(NAME) 0
+# define glthread_lock_lock(NAME) 0
+# define glthread_lock_unlock(NAME) 0
+# define glthread_lock_destroy(NAME) 0
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef int gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME)
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME)
+# define glthread_rwlock_init(NAME) 0
+# define glthread_rwlock_rdlock(NAME) 0
+# define glthread_rwlock_wrlock(NAME) 0
+# define glthread_rwlock_unlock(NAME) 0
+# define glthread_rwlock_destroy(NAME) 0
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef int gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME)
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_recursive_lock_init(NAME) 0
+# define glthread_recursive_lock_lock(NAME) 0
+# define glthread_recursive_lock_unlock(NAME) 0
+# define glthread_recursive_lock_destroy(NAME) 0
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef int gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = 0;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0)
+
+#endif
+
+/* ========================================================================= */
+
+/* Macros with built-in error handling. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+#define gl_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+#define gl_rwlock_init(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_rdlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_rdlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_wrlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_wrlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+#define gl_recursive_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#define gl_once(NAME, INITFUNCTION) \
+ do \
+ { \
+ if (glthread_once (&NAME, INITFUNCTION)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ========================================================================= */
+
+#endif /* _LOCK_H */
diff --git a/gl/glthread/threadlib.c b/gl/glthread/threadlib.c
new file mode 100644
index 0000000..5ecf827
--- /dev/null
+++ b/gl/glthread/threadlib.c
@@ -0,0 +1,108 @@
+/* Multithreading primitives.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
+
+#include <config.h>
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <errno.h>
+# include <pthread.h>
+# include <stdlib.h>
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+# if defined __FreeBSD__ || defined __DragonFly__ /* FreeBSD */
+
+/* Test using pthread_key_create. */
+
+int
+glthread_in_use (void)
+{
+ static int tested;
+ static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+ if (!tested)
+ {
+ pthread_key_t key;
+ int err = pthread_key_create (&key, NULL);
+
+ if (err == ENOSYS)
+ result = 0;
+ else
+ {
+ result = 1;
+ if (err == 0)
+ pthread_key_delete (key);
+ }
+ tested = 1;
+ }
+ return result;
+}
+
+# else /* Solaris, HP-UX */
+
+/* Test using pthread_create. */
+
+/* The function to be executed by a dummy thread. */
+static void *
+dummy_thread_func (void *arg)
+{
+ return arg;
+}
+
+int
+glthread_in_use (void)
+{
+ static int tested;
+ static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+ if (!tested)
+ {
+ pthread_t thread;
+
+ if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
+ /* Thread creation failed. */
+ result = 0;
+ else
+ {
+ /* Thread creation works. */
+ void *retval;
+ if (pthread_join (thread, &retval) != 0)
+ abort ();
+ result = 1;
+ }
+ tested = 1;
+ }
+ return result;
+}
+
+# endif
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
diff --git a/gl/hard-locale.c b/gl/hard-locale.c
new file mode 100644
index 0000000..0a28552
--- /dev/null
+++ b/gl/hard-locale.c
@@ -0,0 +1,35 @@
+/* hard-locale.c -- Determine whether a locale is hard.
+
+ Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "hard-locale.h"
+
+#include <locale.h>
+#include <string.h>
+
+bool
+hard_locale (int category)
+{
+ char locale[SETLOCALE_NULL_MAX];
+
+ if (setlocale_null_r (category, locale, sizeof (locale)))
+ return false;
+
+ return !(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0);
+}
diff --git a/gl/hard-locale.h b/gl/hard-locale.h
new file mode 100644
index 0000000..880c9e8
--- /dev/null
+++ b/gl/hard-locale.h
@@ -0,0 +1,26 @@
+/* Determine whether a locale is hard.
+
+ Copyright (C) 1999, 2003-2004, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef HARD_LOCALE_H_
+# define HARD_LOCALE_H_ 1
+
+/* Return true if the specified CATEGORY of the current locale is hard, i.e.
+ different from the C or POSIX locale that has a fixed behavior.
+ CATEGORY must be one of the LC_* values, but not LC_ALL. */
+extern bool hard_locale (int category);
+
+#endif /* HARD_LOCALE_H_ */
diff --git a/gl/ialloc.c b/gl/ialloc.c
new file mode 100644
index 0000000..cd44d8c
--- /dev/null
+++ b/gl/ialloc.c
@@ -0,0 +1,21 @@
+/* malloc with idx_t rather than size_t
+
+ Copyright 2021-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define IALLOC_INLINE _GL_EXTERN_INLINE
+#include "ialloc.h"
diff --git a/gl/ialloc.h b/gl/ialloc.h
new file mode 100644
index 0000000..1d43faf
--- /dev/null
+++ b/gl/ialloc.h
@@ -0,0 +1,100 @@
+/* ialloc.h -- malloc with idx_t rather than size_t
+
+ Copyright 2021-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef IALLOC_H_
+#define IALLOC_H_
+
+#include "idx.h"
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef IALLOC_INLINE
+# define IALLOC_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+IALLOC_INLINE void * _GL_ATTRIBUTE_COLD
+_gl_alloc_nomem (void)
+{
+ errno = ENOMEM;
+ return NULL;
+}
+
+IALLOC_INLINE
+_GL_ATTRIBUTE_MALLOC /*_GL_ATTRIBUTE_DEALLOC_FREE*/
+void *
+imalloc (idx_t s)
+{
+ return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem ();
+}
+
+IALLOC_INLINE
+/*_GL_ATTRIBUTE_DEALLOC_FREE*/
+void *
+irealloc (void *p, idx_t s)
+{
+ /* Work around GNU realloc glitch by treating a zero size as if it
+ were 1, so that returning NULL is equivalent to failing. */
+ return s <= SIZE_MAX ? realloc (p, s | !s) : _gl_alloc_nomem ();
+}
+
+IALLOC_INLINE
+_GL_ATTRIBUTE_MALLOC /*_GL_ATTRIBUTE_DEALLOC_FREE*/
+void *
+icalloc (idx_t n, idx_t s)
+{
+ if (SIZE_MAX < n)
+ {
+ if (s != 0)
+ return _gl_alloc_nomem ();
+ n = 0;
+ }
+ if (SIZE_MAX < s)
+ {
+ if (n != 0)
+ return _gl_alloc_nomem ();
+ s = 0;
+ }
+ return calloc (n, s);
+}
+
+IALLOC_INLINE void *
+ireallocarray (void *p, idx_t n, idx_t s)
+{
+ /* Work around GNU reallocarray glitch by treating a zero size as if
+ it were 1, so that returning NULL is equivalent to failing. */
+ if (n == 0 || s == 0)
+ n = s = 1;
+ return (n <= SIZE_MAX && s <= SIZE_MAX
+ ? reallocarray (p, n, s)
+ : _gl_alloc_nomem ());
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/gl/idpriv-droptemp.c b/gl/idpriv-droptemp.c
new file mode 100644
index 0000000..2a85431
--- /dev/null
+++ b/gl/idpriv-droptemp.c
@@ -0,0 +1,208 @@
+/* Dropping uid/gid privileges of the current process temporarily.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "idpriv.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* The privileged uid and gid that the process had earlier. */
+#if HAVE_GETUID
+static int saved_uid = -1;
+#endif
+#if HAVE_GETGID
+static int saved_gid = -1;
+#endif
+
+int
+idpriv_temp_drop (void)
+{
+#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
+ int uid = getuid ();
+ int gid = getgid ();
+
+ /* Find out about the privileged uid and gid at the first call. */
+ if (saved_uid == -1)
+ saved_uid = geteuid ();
+ if (saved_gid == -1)
+ saved_gid = getegid ();
+
+ /* Drop the gid privilege first, because in some cases the gid privilege
+ cannot be dropped after the uid privilege has been dropped. */
+
+ /* This is for executables that have the setgid bit set. */
+# if HAVE_SETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ if (setresgid (-1, gid, saved_gid) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setregid (-1, gid) < 0)
+ return -1;
+# endif
+
+ /* This is for executables that have the setuid bit set. */
+# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ /* See
+ Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ figure 14. */
+ if (setresuid (-1, uid, saved_uid) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setreuid (-1, uid) < 0)
+ return -1;
+# endif
+
+ /* Verify that the privileges have really been dropped.
+ This verification is here for security reasons. Doesn't matter if it
+ takes a couple of system calls.
+ When the verification fails, it indicates that we need to use different
+ API in the code above. Therefore 'abort ()', not 'return -1'. */
+# if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresuid (&real, &effective, &saved) < 0
+ || real != uid
+ || effective != uid
+ || saved != saved_uid)
+ abort ();
+ }
+# else
+# if HAVE_GETEUID
+ if (geteuid () != uid)
+ abort ();
+# endif
+ if (getuid () != uid)
+ abort ();
+# endif
+# if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresgid (&real, &effective, &saved) < 0
+ || real != gid
+ || effective != gid
+ || saved != saved_gid)
+ abort ();
+ }
+# else
+# if HAVE_GETEGID
+ if (getegid () != gid)
+ abort ();
+# endif
+ if (getgid () != gid)
+ abort ();
+# endif
+
+ return 0;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+
+int
+idpriv_temp_restore (void)
+{
+#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
+ int uid = getuid ();
+ int gid = getgid ();
+
+ if (saved_uid == -1 || saved_gid == -1)
+ /* Caller error: idpriv_temp_drop was never invoked. */
+ abort ();
+
+ /* Acquire the gid privilege last, because in some cases the gid privilege
+ cannot be acquired before the uid privilege has been acquired. */
+
+ /* This is for executables that have the setuid bit set. */
+# if HAVE_SETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ /* See
+ Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ figure 14. */
+ if (setresuid (-1, saved_uid, -1) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setreuid (-1, saved_uid) < 0)
+ return -1;
+# endif
+
+ /* This is for executables that have the setgid bit set. */
+# if HAVE_SETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ if (setresgid (-1, saved_gid, -1) < 0)
+ return -1;
+# else /* Mac OS X, NetBSD, AIX, IRIX, Solaris >= 2.5, OSF/1, Cygwin */
+ if (setregid (-1, saved_gid) < 0)
+ return -1;
+# endif
+
+ /* Verify that the privileges have really been acquired.
+ This verification is here for security reasons. Doesn't matter if it
+ takes a couple of system calls.
+ When the verification fails, it indicates that we need to use different
+ API in the code above. Therefore 'abort ()', not 'return -1'. */
+# if HAVE_GETRESUID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresuid (&real, &effective, &saved) < 0
+ || real != uid
+ || effective != saved_uid
+ || saved != saved_uid)
+ abort ();
+ }
+# else
+# if HAVE_GETEUID
+ if (geteuid () != saved_uid)
+ abort ();
+# endif
+ if (getuid () != uid)
+ abort ();
+# endif
+# if HAVE_GETRESGID /* glibc, FreeBSD, OpenBSD, HP-UX */
+ {
+ uid_t real;
+ uid_t effective;
+ uid_t saved;
+ if (getresgid (&real, &effective, &saved) < 0
+ || real != gid
+ || effective != saved_gid
+ || saved != saved_gid)
+ abort ();
+ }
+# else
+# if HAVE_GETEGID
+ if (getegid () != saved_gid)
+ abort ();
+# endif
+ if (getgid () != gid)
+ abort ();
+# endif
+
+ return 0;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
diff --git a/gl/idpriv.h b/gl/idpriv.h
new file mode 100644
index 0000000..99f87c0
--- /dev/null
+++ b/gl/idpriv.h
@@ -0,0 +1,116 @@
+/* Dropping uid/gid privileges of the current process.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _IDPRIV_H
+#define _IDPRIV_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This module allows programs which are installed with setuid or setgid bit
+ (and which therefore initially run with an effective user id or group id
+ different from the one of the current user) to drop their uid or gid
+ privilege, either permanently or temporarily.
+
+ It is absolutely necessary to minimize the amount of code that is running
+ with escalated privileges (e.g. with effective uid = root). The reason is
+ that any bug or exploit in a part of a program that is running with
+ escalated privileges is a security vulnerability that - upon discovery -
+ puts the users in danger and requires immediate fixing. Then consider that
+ there's a bug every 10 or 20 lines of code on average...
+
+ For programs that temporarily drop privileges but have the ability to
+ restore them later, there are additionally the dangers that
+ - Any bug in the non-privileged part of the program may be used to
+ create invalid data structures that will trigger security
+ vulnerabilities in the privileged part of the program.
+ - Code execution exploits in the non-privileged part of the program may
+ be used to invoke the function that restores high privileges and then
+ execute additional arbitrary code.
+
+ 1) The usual, and reasonably safe, way to minimize the amount of code
+ running with privileges is to create a separate executable, with setuid
+ or setgid bit, that contains only code for the tasks that require
+ privileges (and,of course, strict checking of the arguments, so that the
+ program cannot be abused). The main program is installed without setuid
+ or setgid bit.
+
+ 2) A less safe way is to do some privileged tasks at the beginning of the
+ program's run, and drop privileges permanently as soon as possible.
+
+ Note: There may still be security issues if the privileged task puts
+ sensitive data into the process memory or opens communication channels
+ to restricted facilities.
+
+ 3) The most unsafe way is to drop privileges temporarily for most of the
+ main program but to re-enable them for the duration of privileged tasks.
+
+ As explained above, this approach has uncontrollable dangers for
+ security.
+
+ This approach is normally not usable in multithreaded programs, because
+ you cannot know what kind of system calls the other threads could be
+ doing during the time the privileges are enabled.
+
+ With approach 1, you don't need gnulib modules.
+ With approach 2, you need the gnulib module 'idpriv-drop'.
+ With approach 3, you need the gnulib module 'idpriv-droptemp'. But really,
+ you should better stay away from this approach.
+ */
+
+/* For more in-depth discussion of these topics, see the papers/articles
+ * Hao Chen, David Wagner, Drew Dean: Setuid Demystified
+ <https://www.usenix.org/legacy/publications/library/proceedings/sec02/full_papers/chen/chen.pdf>
+ * Dan Tsafrir, Dilma da Silva, David Wagner: The Murky Issue of Changing
+ Process Identity: Revising "Setuid Demystified"
+ <https://people.eecs.berkeley.edu/~daw/papers/setuid-login08b.pdf>
+ <https://code.google.com/archive/p/change-process-identity/>
+ * Dhruv Mohindra: Observe correct revocation order while relinquishing
+ privileges
+ <https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges>
+ */
+
+
+/* For approach 2. */
+
+/* Drop the uid and gid privileges of the current process.
+ Return 0 if successful, or -1 with errno set upon failure. The recommended
+ handling of failure is to terminate the process. */
+extern int idpriv_drop (void);
+
+
+/* For approach 3. */
+
+/* Drop the uid and gid privileges of the current process in a way that allows
+ them to be restored later.
+ Return 0 if successful, or -1 with errno set upon failure. The recommended
+ handling of failure is to terminate the process. */
+extern int idpriv_temp_drop (void);
+
+/* Restore the uid and gid privileges of the current process.
+ Return 0 if successful, or -1 with errno set upon failure. The recommended
+ handling of failure is to not perform the actions that require the escalated
+ privileges. */
+extern int idpriv_temp_restore (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _IDPRIV_H */
diff --git a/gl/idx.h b/gl/idx.h
new file mode 100644
index 0000000..23020b7
--- /dev/null
+++ b/gl/idx.h
@@ -0,0 +1,134 @@
+/* A type for indices and sizes.
+ Copyright (C) 2020-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _IDX_H
+#define _IDX_H
+
+/* Get ptrdiff_t. */
+#include <stddef.h>
+
+/* Get PTRDIFF_MAX. */
+#include <stdint.h>
+
+/* The type 'idx_t' holds an (array) index or an (object) size.
+ Its implementation promotes to a signed integer type,
+ which can hold the values
+ 0..2^63-1 (on 64-bit platforms) or
+ 0..2^31-1 (on 32-bit platforms).
+
+ Why a signed integer type?
+
+ * Security: Signed types can be checked for overflow via
+ '-fsanitize=undefined', but unsigned types cannot.
+
+ * Comparisons without surprises: ISO C99 § 6.3.1.8 specifies a few
+ surprising results for comparisons, such as
+
+ (int) -3 < (unsigned long) 7 => false
+ (int) -3 < (unsigned int) 7 => false
+ and on 32-bit machines:
+ (long) -3 < (unsigned int) 7 => false
+
+ This is surprising because the natural comparison order is by
+ value in the realm of infinite-precision signed integers (ℤ).
+
+ The best way to get rid of such surprises is to use signed types
+ for numerical integer values, and use unsigned types only for
+ bit masks and enums.
+
+ Why not use 'size_t' directly?
+
+ * Because 'size_t' is an unsigned type, and a signed type is better.
+ See above.
+
+ Why not use 'ssize_t'?
+
+ * 'ptrdiff_t' is more portable; it is standardized by ISO C
+ whereas 'ssize_t' is standardized only by POSIX.
+
+ * 'ssize_t' is not required to be as wide as 'size_t', and some
+ now-obsolete POSIX platforms had 'size_t' wider than 'ssize_t'.
+
+ * Conversely, some now-obsolete platforms had 'ptrdiff_t' wider
+ than 'size_t', which can be a win and conforms to POSIX.
+
+ Won't this cause a problem with objects larger than PTRDIFF_MAX?
+
+ * Typical modern or large platforms do not allocate such objects,
+ so this is not much of a problem in practice; for example, you
+ can safely write 'idx_t len = strlen (s);'. To port to older
+ small platforms where allocations larger than PTRDIFF_MAX could
+ in theory be a problem, you can use Gnulib's ialloc module, or
+ functions like ximalloc in Gnulib's xalloc module.
+
+ Why not use 'ptrdiff_t' directly?
+
+ * Maintainability: When reading and modifying code, it helps to know that
+ a certain variable cannot have negative values. For example, when you
+ have a loop
+
+ int n = ...;
+ for (int i = 0; i < n; i++) ...
+
+ or
+
+ ptrdiff_t n = ...;
+ for (ptrdiff_t i = 0; i < n; i++) ...
+
+ you have to ask yourself "what if n < 0?". Whereas in
+
+ idx_t n = ...;
+ for (idx_t i = 0; i < n; i++) ...
+
+ you know that this case cannot happen.
+
+ Similarly, when a programmer writes
+
+ idx_t = ptr2 - ptr1;
+
+ there is an implied assertion that ptr1 and ptr2 point into the same
+ object and that ptr1 <= ptr2.
+
+ * Being future-proof: In the future, range types (integers which are
+ constrained to a certain range of values) may be added to C compilers
+ or to the C standard. Several programming languages (Ada, Haskell,
+ Common Lisp, Pascal) already have range types. Such range types may
+ help producing good code and good warnings. The type 'idx_t' could
+ then be typedef'ed to a range type that is signed after promotion. */
+
+/* In the future, idx_t could be typedef'ed to a signed range type.
+ The clang "extended integer types", supported in Clang 11 or newer
+ <https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
+ are a special case of range types. However, these types don't support binary
+ operators with plain integer types (e.g. expressions such as x > 1).
+ Therefore, they don't behave like signed types (and not like unsigned types
+ either). So, we cannot use them here. */
+
+/* Use the signed type 'ptrdiff_t'. */
+/* Note: ISO C does not mandate that 'size_t' and 'ptrdiff_t' have the same
+ size, but it is so on all platforms we have seen since 1990. */
+typedef ptrdiff_t idx_t;
+
+/* IDX_MAX is the maximum value of an idx_t. */
+#define IDX_MAX PTRDIFF_MAX
+
+/* So far no need has been found for an IDX_WIDTH macro.
+ Perhaps there should be another macro IDX_VALUE_BITS that does not
+ count the sign bit and is therefore one less than PTRDIFF_WIDTH. */
+
+#endif /* _IDX_H */
diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c
new file mode 100644
index 0000000..9e2d412
--- /dev/null
+++ b/gl/inet_ntop.c
@@ -0,0 +1,260 @@
+/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
+
+ Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/*
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include <config.h>
+
+/* Specification. */
+#include <arpa/inet.h>
+
+/* Use this to suppress gcc's "...may be used before initialized" warnings.
+ Beware: The Code argument must not contain commas. */
+#ifndef IF_LINT
+# if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+# else
+# define IF_LINT(Code) /* empty */
+# endif
+#endif
+
+#if HAVE_DECL_INET_NTOP
+
+# undef inet_ntop
+
+const char *
+rpl_inet_ntop (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+{
+ return inet_ntop (af, src, dst, cnt);
+}
+
+#else
+
+# include <stdio.h>
+# include <string.h>
+# include <errno.h>
+
+# define NS_IN6ADDRSZ 16
+# define NS_INT16SZ 2
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+typedef int verify_int_size[4 <= sizeof (int) ? 1 : -1];
+
+static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t size);
+# if HAVE_IPV6
+static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t size);
+# endif
+
+
+/* char *
+ * inet_ntop(af, src, dst, size)
+ * convert a network format address to presentation format.
+ * return:
+ * pointer to presentation format address ('dst'), or NULL (see errno).
+ * author:
+ * Paul Vixie, 1996.
+ */
+const char *
+inet_ntop (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+{
+ switch (af)
+ {
+# if HAVE_IPV4
+ case AF_INET:
+ return (inet_ntop4 (src, dst, cnt));
+# endif
+
+# if HAVE_IPV6
+ case AF_INET6:
+ return (inet_ntop6 (src, dst, cnt));
+# endif
+
+ default:
+ errno = EAFNOSUPPORT;
+ return (NULL);
+ }
+ /* NOTREACHED */
+}
+
+/* const char *
+ * inet_ntop4(src, dst, size)
+ * format an IPv4 address
+ * return:
+ * 'dst' (as a const)
+ * notes:
+ * (1) uses no statics
+ * (2) takes a u_char* not an in_addr as input
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
+{
+ char tmp[sizeof "255.255.255.255"];
+ int len;
+
+ len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]);
+ if (len < 0)
+ return NULL;
+
+ if (len > size)
+ {
+ errno = ENOSPC;
+ return NULL;
+ }
+
+ return strcpy (dst, tmp);
+}
+
+# if HAVE_IPV6
+
+/* const char *
+ * inet_ntop6(src, dst, size)
+ * convert IPv6 binary address into presentation (printable) format
+ * author:
+ * Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
+{
+ /*
+ * Note that int32_t and int16_t need only be "at least" large enough
+ * to contain a value of the specified size. On some systems, like
+ * Crays, there is no such thing as an integer variable with 16 bits.
+ * Keep this in mind if you think this function should have been coded
+ * to use pointer overlays. All the world's not a VAX.
+ */
+ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+ struct
+ {
+ int base, len;
+ } best, cur;
+ unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+ int i;
+
+ /*
+ * Preprocess:
+ * Copy the input (bytewise) array into a wordwise array.
+ * Find the longest run of 0x00's in src[] for :: shorthanding.
+ */
+ memset (words, '\0', sizeof words);
+ for (i = 0; i < NS_IN6ADDRSZ; i += 2)
+ words[i / 2] = (src[i] << 8) | src[i + 1];
+ best.base = -1;
+ cur.base = -1;
+ IF_LINT(best.len = 0);
+ IF_LINT(cur.len = 0);
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
+ {
+ if (words[i] == 0)
+ {
+ if (cur.base == -1)
+ cur.base = i, cur.len = 1;
+ else
+ cur.len++;
+ }
+ else
+ {
+ if (cur.base != -1)
+ {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ cur.base = -1;
+ }
+ }
+ }
+ if (cur.base != -1)
+ {
+ if (best.base == -1 || cur.len > best.len)
+ best = cur;
+ }
+ if (best.base != -1 && best.len < 2)
+ best.base = -1;
+
+ /*
+ * Format the result.
+ */
+ tp = tmp;
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
+ {
+ /* Are we inside the best run of 0x00's? */
+ if (best.base != -1 && i >= best.base && i < (best.base + best.len))
+ {
+ if (i == best.base)
+ *tp++ = ':';
+ continue;
+ }
+ /* Are we following an initial run of 0x00s or any real hex? */
+ if (i != 0)
+ *tp++ = ':';
+ /* Is this address an encapsulated IPv4? */
+ if (i == 6 && best.base == 0 &&
+ (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
+ {
+ if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
+ return (NULL);
+ tp += strlen (tp);
+ break;
+ }
+ {
+ int len = sprintf (tp, "%x", words[i]);
+ if (len < 0)
+ return NULL;
+ tp += len;
+ }
+ }
+ /* Was it a trailing run of 0x00's? */
+ if (best.base != -1 && (best.base + best.len) ==
+ (NS_IN6ADDRSZ / NS_INT16SZ))
+ *tp++ = ':';
+ *tp++ = '\0';
+
+ /*
+ * Check for overflow, copy, and we're done.
+ */
+ if ((socklen_t) (tp - tmp) > size)
+ {
+ errno = ENOSPC;
+ return NULL;
+ }
+
+ return strcpy (dst, tmp);
+}
+
+# endif
+
+#endif
diff --git a/gl/intprops-internal.h b/gl/intprops-internal.h
new file mode 100644
index 0000000..0467a9c
--- /dev/null
+++ b/gl/intprops-internal.h
@@ -0,0 +1,392 @@
+/* intprops-internal.h -- properties of integer types not visible to users
+
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_INTPROPS_INTERNAL_H
+#define _GL_INTPROPS_INTERNAL_H
+
+#include <limits.h>
+
+/* Return a value with the common real type of E and V and the value of V.
+ Do not evaluate E. */
+#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
+
+/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+ <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
+#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
+
+/* The extra casts in the following macros work around compiler bugs,
+ e.g., in Cray C 5.0.3.0. */
+
+/* True if the real type T is signed. */
+#define _GL_TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* Return 1 if the real expression E, after promotion, has a
+ signed or floating type. Do not evaluate E. */
+#define _GL_EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
+
+/* Minimum and maximum values for integer types and expressions. */
+
+/* The width in bits of the integer type or expression T.
+ Do not evaluate T. T must not be a bit-field expression.
+ Padding bits are not supported; this is checked at compile-time below. */
+#define _GL_TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+
+/* The maximum and minimum values for the type of the expression E,
+ after integer promotion. E is not evaluated. */
+#define _GL_INT_MINIMUM(e) \
+ (_GL_EXPR_SIGNED (e) \
+ ? ~ _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_CONVERT (e, 0))
+#define _GL_INT_MAXIMUM(e) \
+ (_GL_EXPR_SIGNED (e) \
+ ? _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_NEGATE_CONVERT (e, 1))
+#define _GL_SIGNED_INT_MAXIMUM(e) \
+ (((_GL_INT_CONVERT (e, 1) << (_GL_TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
+
+/* Work around OpenVMS incompatibility with C99. */
+#if !defined LLONG_MAX && defined __INT64_MAX
+# define LLONG_MAX __INT64_MAX
+# define LLONG_MIN __INT64_MIN
+#endif
+
+/* This include file assumes that signed types are two's complement without
+ padding bits; the above macros have undefined behavior otherwise.
+ If this is a problem for you, please let us know how to fix it for your host.
+ This assumption is tested by the intprops-tests module. */
+
+/* Does the __typeof__ keyword work? This could be done by
+ 'configure', but for now it's easier to do it by hand. */
+#if (2 <= __GNUC__ \
+ || (4 <= __clang_major__) \
+ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+# define _GL_HAVE___TYPEOF__ 1
+#else
+# define _GL_HAVE___TYPEOF__ 0
+#endif
+
+/* Return 1 if the integer type or expression T might be signed. Return 0
+ if it is definitely unsigned. T must not be a bit-field expression.
+ This macro does not evaluate its argument, and expands to an
+ integer constant expression. */
+#if _GL_HAVE___TYPEOF__
+# define _GL_SIGNED_TYPE_OR_EXPR(t) _GL_TYPE_SIGNED (__typeof__ (t))
+#else
+# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
+#endif
+
+/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
+ A should not have side effects, and A's type should be an
+ integer with minimum value MIN and maximum MAX. */
+#define _GL_INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
+ ((min) < 0 ? (a) < - (max) : 0 < (a))
+
+/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
+ (A, B, P) work when P is non-null. */
+#ifdef __EDG__
+/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
+ <https://bugs.gnu.org/53256>. */
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
+/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
+ see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */
+#elif 7 <= __GNUC__
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
+#else
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#endif
+
+/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
+#if defined __clang_major__ && __clang_major__ < 14
+/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
+#else
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
+#endif
+
+/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
+ __builtin_sub_overflow_p and __builtin_mul_overflow_p. */
+#ifdef __EDG__
+/* In EDG-based compilers like ICC 2021.3 and earlier,
+ __builtin_add_overflow_p etc. are not treated as integral constant
+ expressions even when all arguments are. */
+# define _GL_HAS_BUILTIN_OVERFLOW_P 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
+#else
+# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#endif
+
+#if (!defined _GL_STDCKDINT_H && 202311 <= __STDC_VERSION__ \
+ && ! (_GL_HAS_BUILTIN_ADD_OVERFLOW && _GL_HAS_BUILTIN_MUL_OVERFLOW))
+# include <stdckdint.h>
+#endif
+
+/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
+ Return 1 if the result overflows. Arguments should not have side
+ effects and A, B and *R can be of any integer type other than char,
+ bool, a bit-precise integer type, or an enumeration type. */
+#if _GL_HAS_BUILTIN_ADD_OVERFLOW
+# define _GL_INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
+# define _GL_INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
+#elif defined ckd_add && defined ckd_sub && !defined _GL_STDCKDINT_H
+# define _GL_INT_ADD_WRAPV(a, b, r) ckd_add (r, + (a), + (b))
+# define _GL_INT_SUBTRACT_WRAPV(a, b, r) ckd_sub (r, + (a), + (b))
+#else
+# define _GL_INT_ADD_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
+# define _GL_INT_SUBTRACT_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
+#endif
+#if _GL_HAS_BUILTIN_MUL_OVERFLOW
+# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
+ || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
+ && !defined __EDG__)
+# define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
+# else
+ /* Work around GCC bug 91450. */
+# define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
+ ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) && _GL_EXPR_SIGNED (b) \
+ && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
+ ? ((void) __builtin_mul_overflow (a, b, r), 1) \
+ : __builtin_mul_overflow (a, b, r))
+# endif
+#elif defined ckd_mul && !defined _GL_STDCKDINT_H
+# define _GL_INT_MULTIPLY_WRAPV(a, b, r) ckd_mul (r, + (a), + (b))
+#else
+# define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
+#endif
+
+/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+ https://llvm.org/bugs/show_bug.cgi?id=25390
+ For now, assume all versions of GCC-like compilers generate bogus
+ warnings for _Generic. This matters only for compilers that
+ lack relevant builtins. */
+#if __GNUC__ || defined __clang__
+# define _GL__GENERIC_BOGUS 1
+#else
+# define _GL__GENERIC_BOGUS 0
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+ the operation and OVERFLOW the overflow predicate. Return 1 if the
+ result overflows. Arguments should not have side effects,
+ and A, B and *R can be of any integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type. */
+#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
+ (_Generic \
+ (*(r), \
+ signed char: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ signed char, SCHAR_MIN, SCHAR_MAX), \
+ unsigned char: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned char, 0, UCHAR_MAX), \
+ short int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ short int, SHRT_MIN, SHRT_MAX), \
+ unsigned short int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned short int, 0, USHRT_MAX), \
+ int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_MAX), \
+ unsigned int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned int, 0, UINT_MAX), \
+ long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX), \
+ unsigned long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX), \
+ long long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ long long int, LLONG_MIN, LLONG_MAX), \
+ unsigned long long int: \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ unsigned long long int, 0, ULLONG_MAX)))
+#else
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+ the operation and OVERFLOW the overflow predicate. If *R is
+ signed, its type is ST with bounds SMIN..SMAX; otherwise its type
+ is UT with bounds U..UMAX. ST and UT are narrower than int.
+ Return 1 if the result overflows. Arguments should not have side
+ effects, and A, B and *R can be of any integer type other than
+ char, bool, a bit-precise integer type, or an enumeration type. */
+# if _GL_HAVE___TYPEOF__
+# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+ (_GL_TYPE_SIGNED (__typeof__ (*(r))) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
+# else
+# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+ (overflow (a, b, smin, smax) \
+ ? (overflow (a, b, 0, umax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
+ : (overflow (a, b, 0, umax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
+# endif
+
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
+ (sizeof *(r) == sizeof (signed char) \
+ ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+ signed char, SCHAR_MIN, SCHAR_MAX, \
+ unsigned char, UCHAR_MAX) \
+ : sizeof *(r) == sizeof (short int) \
+ ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+ short int, SHRT_MIN, SHRT_MAX, \
+ unsigned short int, USHRT_MAX) \
+ : sizeof *(r) == sizeof (int) \
+ ? (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ int, INT_MIN, INT_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+ unsigned int, 0, UINT_MAX)) \
+ : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
+# ifdef LLONG_MAX
+# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ (sizeof *(r) == sizeof (long int) \
+ ? (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX)) \
+ : (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ long long int, LLONG_MIN, LLONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+ unsigned long long int, 0, ULLONG_MAX)))
+# else
+# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ (_GL_EXPR_SIGNED (*(r)) \
+ ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ long int, LONG_MIN, LONG_MAX) \
+ : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+ unsigned long int, 0, ULONG_MAX))
+# endif
+#endif
+
+/* Store the low-order bits of A <op> B into *R, where the operation
+ is given by OP. Use the unsigned type UT for calculation to avoid
+ overflow problems. *R's type is T, with extrema TMIN and TMAX.
+ T can be any signed integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type.
+ Return 1 if the result overflows. */
+#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
+ (overflow (a, b, tmin, tmax) \
+ ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
+ : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
+
+/* Return 1 if the integer expressions A - B and -A would overflow,
+ respectively. Arguments should not have side effects,
+ and can be any signed integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type.
+ These macros are tuned for their last input argument being a constant. */
+
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define _GL_INT_NEGATE_OVERFLOW(a) \
+ __builtin_sub_overflow_p (0, a, (__typeof__ (- (a))) 0)
+#else
+# define _GL_INT_NEGATE_OVERFLOW(a) \
+ _GL_INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#endif
+
+/* Return the low-order bits of A <op> B, where the operation is given
+ by OP. Use the unsigned type UT for calculation to avoid undefined
+ behavior on signed integer overflow, and convert the result to type T.
+ UT is at least as wide as T and is no narrower than unsigned int,
+ T is two's complement, and there is no padding or trap representations.
+ Assume that converting UT to T yields the low-order bits, as is
+ done in all known two's-complement C compilers. E.g., see:
+ https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
+
+ According to the C standard, converting UT to T yields an
+ implementation-defined result or signal for values outside T's
+ range. However, code that works around this theoretical problem
+ runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
+ https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
+ As the compiler bug is real, don't try to work around the
+ theoretical problem. */
+
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
+ ((t) ((ut) (a) op (ut) (b)))
+
+/* Return true if the numeric values A + B, A - B, A * B fall outside
+ the range TMIN..TMAX. Arguments should not have side effects
+ and can be any integer type other than char, bool,
+ a bit-precise integer type, or an enumeration type.
+ TMIN should be signed and nonpositive.
+ TMAX should be positive, and should be signed unless TMIN is zero. */
+#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ ((b) < 0 \
+ ? (((tmin) \
+ ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
+ && (a) < (tmin) - (b)) \
+ : (a) <= -1 - (b)) \
+ || ((_GL_EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
+ : (a) < 0 \
+ ? (((tmin) \
+ ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
+ && (b) < (tmin) - (a)) \
+ : (b) <= -1 - (a)) \
+ || ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
+ && (tmax) < (a) + (b))) \
+ : (tmax) < (b) || (tmax) - (b) < (a))
+#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ (((a) < 0) == ((b) < 0) \
+ ? ((a) < (b) \
+ ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
+ : (tmax) < (a) - (b)) \
+ : (a) < 0 \
+ ? ((!_GL_EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
+ || (a) - (tmin) < (b)) \
+ : ((! (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+ && _GL_EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
+ && (tmax) <= -1 - (b)) \
+ || (tmax) + (b) < (a)))
+#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
+ ((b) < 0 \
+ ? ((a) < 0 \
+ ? (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+ ? (a) < (tmax) / (b) \
+ : ((_GL_INT_NEGATE_OVERFLOW (b) \
+ ? _GL_INT_CONVERT (b, tmax) >> (_GL_TYPE_WIDTH (+ (b)) - 1) \
+ : (tmax) / -(b)) \
+ <= -1 - (a))) \
+ : _GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
+ ? (_GL_EXPR_SIGNED (a) \
+ ? 0 < (a) + (tmin) \
+ : 0 < (a) && -1 - (tmin) < (a) - 1) \
+ : (tmin) / (b) < (a)) \
+ : (b) == 0 \
+ ? 0 \
+ : ((a) < 0 \
+ ? (_GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
+ ? (_GL_EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
+ : (tmin) / (a) < (b)) \
+ : (tmax) / (b) < (a)))
+
+#endif /* _GL_INTPROPS_INTERNAL_H */
diff --git a/gl/intprops.h b/gl/intprops.h
new file mode 100644
index 0000000..44b5e60
--- /dev/null
+++ b/gl/intprops.h
@@ -0,0 +1,335 @@
+/* intprops.h -- properties of integer types
+
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_INTPROPS_H
+#define _GL_INTPROPS_H
+
+#include "intprops-internal.h"
+
+/* The extra casts in the following macros work around compiler bugs,
+ e.g., in Cray C 5.0.3.0. */
+
+/* True if the arithmetic type T is an integer type. bool counts as
+ an integer. */
+#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
+
+/* True if the real type T is signed. */
+#define TYPE_SIGNED(t) _GL_TYPE_SIGNED (t)
+
+/* Return 1 if the real expression E, after promotion, has a
+ signed or floating type. Do not evaluate E. */
+#define EXPR_SIGNED(e) _GL_EXPR_SIGNED (e)
+
+
+/* Minimum and maximum values for integer types and expressions. */
+
+/* The width in bits of the integer type or expression T.
+ Do not evaluate T. T must not be a bit-field expression.
+ Padding bits are not supported; this is checked at compile-time below. */
+#define TYPE_WIDTH(t) _GL_TYPE_WIDTH (t)
+
+/* The maximum and minimum values for the integer type T. */
+#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
+#define TYPE_MAXIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) -1 \
+ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
+
+/* Bound on length of the string representing an unsigned integer
+ value representable in B bits. log10 (2.0) < 146/485. The
+ smallest value of B where this bound is not tight is 2621. */
+#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
+
+/* Bound on length of the string representing an integer type or expression T.
+ T must not be a bit-field expression.
+
+ Subtract 1 for the sign bit if T is signed, and then add 1 more for
+ a minus sign if needed.
+
+ Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 1 when its argument is
+ unsigned, this macro may overestimate the true bound by one byte when
+ applied to unsigned types of size 2, 4, 16, ... bytes. */
+#define INT_STRLEN_BOUND(t) \
+ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
+ + _GL_SIGNED_TYPE_OR_EXPR (t))
+
+/* Bound on buffer size needed to represent an integer type or expression T,
+ including the terminating null. T must not be a bit-field expression. */
+#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
+
+
+/* Range overflow checks.
+
+ The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
+ operators overflow arithmetically when given the same arguments.
+ These macros do not rely on undefined or implementation-defined behavior.
+ Although their implementations are simple and straightforward,
+ they are harder to use and may be less efficient than the
+ INT_<op>_WRAPV, INT_<op>_OK, and INT_<op>_OVERFLOW macros described below.
+
+ Example usage:
+
+ long int i = ...;
+ long int j = ...;
+ if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX))
+ printf ("multiply would overflow");
+ else
+ printf ("product is %ld", i * j);
+
+ Restrictions on *_RANGE_OVERFLOW macros:
+
+ These macros do not check for all possible numerical problems or
+ undefined or unspecified behavior: they do not check for division
+ by zero, for bad shift counts, or for shifting negative numbers.
+
+ These macros may evaluate their arguments zero or multiple times,
+ so the arguments should not have side effects. The arithmetic
+ arguments (including the MIN and MAX arguments) must be of the same
+ integer type after the usual arithmetic conversions, and the type
+ must have minimum value MIN and maximum MAX. Unsigned types should
+ use a zero MIN of the proper type.
+
+ Because all arguments are subject to integer promotions, these
+ macros typically do not work on types narrower than 'int'.
+
+ These macros are tuned for constant MIN and MAX. For commutative
+ operations such as A + B, they are also tuned for constant B. */
+
+/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_ADD_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? (a) < (min) - (b) \
+ : (max) - (b) < (a))
+
+/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? (max) + (b) < (a) \
+ : (a) < (min) + (b))
+
+/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. */
+#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
+ _GL_INT_NEGATE_RANGE_OVERFLOW (a, min, max)
+
+/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Avoid && and || as they tickle
+ bugs in Sun C 5.11 2010/08/13 and other compilers; see
+ <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>. */
+#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
+ ((b) < 0 \
+ ? ((a) < 0 \
+ ? (a) < (max) / (b) \
+ : (b) == -1 \
+ ? 0 \
+ : (min) / (b) < (a)) \
+ : (b) == 0 \
+ ? 0 \
+ : ((a) < 0 \
+ ? (a) < (min) / (b) \
+ : (max) / (b) < (a)))
+
+/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Do not check for division by zero. */
+#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max) \
+ ((min) < 0 && (b) == -1 && (a) < - (max))
+
+/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Do not check for division by zero.
+ Mathematically, % should never overflow, but on x86-like hosts
+ INT_MIN % -1 traps, and the C standard permits this, so treat this
+ as an overflow too. */
+#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max) \
+ INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
+
+/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
+ See above for restrictions. Here, MIN and MAX are for A only, and B need
+ not be of the same type as the other arguments. The C standard says that
+ behavior is undefined for shifts unless 0 <= B < wordwidth, and that when
+ A is negative then A << B has undefined behavior and A >> B has
+ implementation-defined behavior, but do not check these other
+ restrictions. */
+#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max) \
+ ((a) < 0 \
+ ? (a) < (min) >> (b) \
+ : (max) >> (b) < (a))
+
+/* The _GL*_OVERFLOW macros have the same restrictions as the
+ *_RANGE_OVERFLOW macros, except that they do not assume that operands
+ (e.g., A and B) have the same type as MIN and MAX. Instead, they assume
+ that the result (e.g., A + B) has that type. */
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define _GL_ADD_OVERFLOW(a, b, min, max) \
+ __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
+ __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
+ __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
+#else
+# define _GL_ADD_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
+ : (a) < 0 ? (b) <= (a) + (b) \
+ : (b) < 0 ? (a) <= (a) + (b) \
+ : (a) + (b) < (b))
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \
+ : (a) < 0 ? 1 \
+ : (b) < 0 ? (a) - (b) <= (a) \
+ : (a) < (b))
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
+ (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \
+ || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#endif
+#define _GL_DIVIDE_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
+ : (a) < 0 ? (b) <= (a) + (b) - 1 \
+ : (b) < 0 && (a) + (b) <= (a))
+#define _GL_REMAINDER_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
+ : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \
+ : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
+
+/* Return a nonzero value if A is a mathematical multiple of B, where
+ A is unsigned, B is negative, and MAX is the maximum value of A's
+ type. A's type must be the same as (A % B)'s type. Normally (A %
+ -B == 0) suffices, but things get tricky if -B would overflow. */
+#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max) \
+ (((b) < -_GL_SIGNED_INT_MAXIMUM (b) \
+ ? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \
+ ? (a) \
+ : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \
+ : (a) % - (b)) \
+ == 0)
+
+/* Check for integer overflow, and report low order bits of answer.
+
+ The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
+ might not yield numerically correct answers due to arithmetic overflow.
+ The INT_<op>_WRAPV macros compute the low-order bits of the sum,
+ difference, and product of two C integers, and return 1 if these
+ low-order bits are not numerically correct.
+ These macros work correctly on all known practical hosts, and do not rely
+ on undefined behavior due to signed arithmetic overflow.
+
+ Example usage, assuming A and B are long int:
+
+ if (INT_MULTIPLY_OVERFLOW (a, b))
+ printf ("result would overflow\n");
+ else
+ printf ("result is %ld (no overflow)\n", a * b);
+
+ Example usage with WRAPV flavor:
+
+ long int result;
+ bool overflow = INT_MULTIPLY_WRAPV (a, b, &result);
+ printf ("result is %ld (%s)\n", result,
+ overflow ? "after overflow" : "no overflow");
+
+ Restrictions on these macros:
+
+ These macros do not check for all possible numerical problems or
+ undefined or unspecified behavior: they do not check for division
+ by zero, for bad shift counts, or for shifting negative numbers.
+
+ These macros may evaluate their arguments zero or multiple times, so the
+ arguments should not have side effects.
+
+ The WRAPV macros are not constant expressions. They support only
+ +, binary -, and *.
+
+ Because the WRAPV macros convert the result, they report overflow
+ in different circumstances than the OVERFLOW macros do. For
+ example, in the typical case with 16-bit 'short' and 32-bit 'int',
+ if A, B and *R are all of type 'short' then INT_ADD_OVERFLOW (A, B)
+ returns false because the addition cannot overflow after A and B
+ are converted to 'int', whereas INT_ADD_WRAPV (A, B, R) returns
+ true or false depending on whether the sum fits into 'short'.
+
+ These macros are tuned for their last input argument being a constant.
+
+ A, B, and *R should be integers; they need not be the same type,
+ and they need not be all signed or all unsigned.
+ However, none of the integer types should be bit-precise,
+ and *R's type should not be char, bool, or an enumeration type.
+
+ Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
+ A % B, and A << B would overflow, respectively. */
+
+#define INT_ADD_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+#define INT_SUBTRACT_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+#define INT_NEGATE_OVERFLOW(a) _GL_INT_NEGATE_OVERFLOW (a)
+#define INT_MULTIPLY_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
+#define INT_DIVIDE_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
+#define INT_REMAINDER_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
+#define INT_LEFT_SHIFT_OVERFLOW(a, b) \
+ INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \
+ _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+
+/* Return 1 if the expression A <op> B would overflow,
+ where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
+ assuming MIN and MAX are the minimum and maximum for the result type.
+ Arguments should be free of side effects. */
+#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
+ op_result_overflow (a, b, \
+ _GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \
+ _GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b)))
+
+/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
+ Return 1 if the result overflows. See above for restrictions. */
+#define INT_ADD_WRAPV(a, b, r) _GL_INT_ADD_WRAPV (a, b, r)
+#define INT_SUBTRACT_WRAPV(a, b, r) _GL_INT_SUBTRACT_WRAPV (a, b, r)
+#define INT_MULTIPLY_WRAPV(a, b, r) _GL_INT_MULTIPLY_WRAPV (a, b, r)
+
+/* The following macros compute A + B, A - B, and A * B, respectively.
+ If no overflow occurs, they set *R to the result and return 1;
+ otherwise, they return 0 and may modify *R.
+
+ Example usage:
+
+ long int result;
+ if (INT_ADD_OK (a, b, &result))
+ printf ("result is %ld\n", result);
+ else
+ printf ("overflow\n");
+
+ A, B, and *R should be integers; they need not be the same type,
+ and they need not be all signed or all unsigned.
+ However, none of the integer types should be bit-precise,
+ and *R's type should not be char, bool, or an enumeration type.
+
+ These macros work correctly on all known practical hosts, and do not rely
+ on undefined behavior due to signed arithmetic overflow.
+
+ These macros are not constant expressions.
+
+ These macros may evaluate their arguments zero or multiple times, so the
+ arguments should not have side effects.
+
+ These macros are tuned for B being a constant. */
+
+#define INT_ADD_OK(a, b, r) (! INT_ADD_WRAPV (a, b, r))
+#define INT_SUBTRACT_OK(a, b, r) (! INT_SUBTRACT_WRAPV (a, b, r))
+#define INT_MULTIPLY_OK(a, b, r) (! INT_MULTIPLY_WRAPV (a, b, r))
+
+#endif /* _GL_INTPROPS_H */
diff --git a/gl/inttypes.in.h b/gl/inttypes.in.h
new file mode 100644
index 0000000..50a2bbf
--- /dev/null
+++ b/gl/inttypes.in.h
@@ -0,0 +1,1002 @@
+/* Copyright (C) 2006-2023 Free Software Foundation, Inc.
+ Written by Paul Eggert, Bruno Haible, Derek Price.
+ This file is part of gnulib.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C 99 <inttypes.h> for platforms that lack it.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html>
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Include the original <inttypes.h> if it exists, and if this file
+ has not been included yet or if this file includes gnulib stdint.h
+ which in turn includes this file.
+ The include_next requires a split double-inclusion guard. */
+#if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# if @HAVE_INTTYPES_H@
+
+ /* Some pre-C++11 <stdint.h> implementations need this. */
+# if defined __cplusplus && ! defined __STDC_FORMAT_MACROS
+# define __STDC_FORMAT_MACROS 1
+# endif
+
+# @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
+
+# define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H
+# endif
+#endif
+
+#if ! defined INTTYPES_H && ! defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+#define INTTYPES_H
+
+/* Include <stdint.h> or the gnulib replacement.
+ But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <stdint.h>
+#endif
+/* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */
+#include <limits.h>
+/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
+#if defined _WIN32 && ! defined __CYGWIN__
+# include <stdio.h>
+#endif
+
+#if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1)
+# error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <bug-gnulib@gnu.org>."
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* 7.8.1 Macros for format specifiers */
+
+#if defined _TNS_R_TARGET
+ /* Tandem NonStop R series and compatible platforms released before
+ July 2005 support %Ld but not %lld. */
+# define _LONG_LONG_FORMAT_PREFIX "L"
+#else
+# define _LONG_LONG_FORMAT_PREFIX "ll"
+#endif
+
+#if !defined PRId8
+# ifdef INT8_MAX
+# define PRId8 "d"
+# endif
+#endif
+#if !defined PRIi8
+# ifdef INT8_MAX
+# define PRIi8 "i"
+# endif
+#endif
+#if !defined PRIo8
+# ifdef UINT8_MAX
+# define PRIo8 "o"
+# endif
+#endif
+#if !defined PRIu8
+# ifdef UINT8_MAX
+# define PRIu8 "u"
+# endif
+#endif
+#if !defined PRIx8
+# ifdef UINT8_MAX
+# define PRIx8 "x"
+# endif
+#endif
+#if !defined PRIX8
+# ifdef UINT8_MAX
+# define PRIX8 "X"
+# endif
+#endif
+#if !defined PRId16
+# ifdef INT16_MAX
+# define PRId16 "d"
+# endif
+#endif
+#if !defined PRIi16
+# ifdef INT16_MAX
+# define PRIi16 "i"
+# endif
+#endif
+#if !defined PRIo16
+# ifdef UINT16_MAX
+# define PRIo16 "o"
+# endif
+#endif
+#if !defined PRIu16
+# ifdef UINT16_MAX
+# define PRIu16 "u"
+# endif
+#endif
+#if !defined PRIx16
+# ifdef UINT16_MAX
+# define PRIx16 "x"
+# endif
+#endif
+#if !defined PRIX16
+# ifdef UINT16_MAX
+# define PRIX16 "X"
+# endif
+#endif
+#if !defined PRId32
+# ifdef INT32_MAX
+# define PRId32 "d"
+# endif
+#endif
+#if !defined PRIi32
+# ifdef INT32_MAX
+# define PRIi32 "i"
+# endif
+#endif
+#if !defined PRIo32
+# ifdef UINT32_MAX
+# define PRIo32 "o"
+# endif
+#endif
+#if !defined PRIu32
+# ifdef UINT32_MAX
+# define PRIu32 "u"
+# endif
+#endif
+#if !defined PRIx32
+# ifdef UINT32_MAX
+# define PRIx32 "x"
+# endif
+#endif
+#if !defined PRIX32
+# ifdef UINT32_MAX
+# define PRIX32 "X"
+# endif
+#endif
+#ifdef INT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+# define _PRI64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _PRI64_PREFIX "I64"
+# elif LONG_MAX >> 30 == 1
+# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRId64
+# define PRId64 _PRI64_PREFIX "d"
+# endif
+# if !defined PRIi64
+# define PRIi64 _PRI64_PREFIX "i"
+# endif
+#endif
+#ifdef UINT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+# define _PRIu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _PRIu64_PREFIX "I64"
+# elif ULONG_MAX >> 31 == 1
+# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined PRIo64
+# define PRIo64 _PRIu64_PREFIX "o"
+# endif
+# if !defined PRIu64
+# define PRIu64 _PRIu64_PREFIX "u"
+# endif
+# if !defined PRIx64
+# define PRIx64 _PRIu64_PREFIX "x"
+# endif
+# if !defined PRIX64
+# define PRIX64 _PRIu64_PREFIX "X"
+# endif
+#endif
+
+#if !defined PRIdLEAST8
+# define PRIdLEAST8 "d"
+#endif
+#if !defined PRIiLEAST8
+# define PRIiLEAST8 "i"
+#endif
+#if !defined PRIoLEAST8
+# define PRIoLEAST8 "o"
+#endif
+#if !defined PRIuLEAST8
+# define PRIuLEAST8 "u"
+#endif
+#if !defined PRIxLEAST8
+# define PRIxLEAST8 "x"
+#endif
+#if !defined PRIXLEAST8
+# define PRIXLEAST8 "X"
+#endif
+#if !defined PRIdLEAST16
+# define PRIdLEAST16 "d"
+#endif
+#if !defined PRIiLEAST16
+# define PRIiLEAST16 "i"
+#endif
+#if !defined PRIoLEAST16
+# define PRIoLEAST16 "o"
+#endif
+#if !defined PRIuLEAST16
+# define PRIuLEAST16 "u"
+#endif
+#if !defined PRIxLEAST16
+# define PRIxLEAST16 "x"
+#endif
+#if !defined PRIXLEAST16
+# define PRIXLEAST16 "X"
+#endif
+#if !defined PRIdLEAST32
+# define PRIdLEAST32 "d"
+#endif
+#if !defined PRIiLEAST32
+# define PRIiLEAST32 "i"
+#endif
+#if !defined PRIoLEAST32
+# define PRIoLEAST32 "o"
+#endif
+#if !defined PRIuLEAST32
+# define PRIuLEAST32 "u"
+#endif
+#if !defined PRIxLEAST32
+# define PRIxLEAST32 "x"
+#endif
+#if !defined PRIXLEAST32
+# define PRIXLEAST32 "X"
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdLEAST64
+# define PRIdLEAST64 PRId64
+# endif
+# if !defined PRIiLEAST64
+# define PRIiLEAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoLEAST64
+# define PRIoLEAST64 PRIo64
+# endif
+# if !defined PRIuLEAST64
+# define PRIuLEAST64 PRIu64
+# endif
+# if !defined PRIxLEAST64
+# define PRIxLEAST64 PRIx64
+# endif
+# if !defined PRIXLEAST64
+# define PRIXLEAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define PRIdFAST8 PRId64
+# else
+# define PRIdFAST8 "d"
+# endif
+#endif
+#if !defined PRIiFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define PRIiFAST8 PRIi64
+# else
+# define PRIiFAST8 "i"
+# endif
+#endif
+#if !defined PRIoFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIoFAST8 PRIo64
+# else
+# define PRIoFAST8 "o"
+# endif
+#endif
+#if !defined PRIuFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIuFAST8 PRIu64
+# else
+# define PRIuFAST8 "u"
+# endif
+#endif
+#if !defined PRIxFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIxFAST8 PRIx64
+# else
+# define PRIxFAST8 "x"
+# endif
+#endif
+#if !defined PRIXFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define PRIXFAST8 PRIX64
+# else
+# define PRIXFAST8 "X"
+# endif
+#endif
+#if !defined PRIdFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define PRIdFAST16 PRId64
+# else
+# define PRIdFAST16 "d"
+# endif
+#endif
+#if !defined PRIiFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define PRIiFAST16 PRIi64
+# else
+# define PRIiFAST16 "i"
+# endif
+#endif
+#if !defined PRIoFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIoFAST16 PRIo64
+# else
+# define PRIoFAST16 "o"
+# endif
+#endif
+#if !defined PRIuFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIuFAST16 PRIu64
+# else
+# define PRIuFAST16 "u"
+# endif
+#endif
+#if !defined PRIxFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIxFAST16 PRIx64
+# else
+# define PRIxFAST16 "x"
+# endif
+#endif
+#if !defined PRIXFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define PRIXFAST16 PRIX64
+# else
+# define PRIXFAST16 "X"
+# endif
+#endif
+#if !defined PRIdFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define PRIdFAST32 PRId64
+# else
+# define PRIdFAST32 "d"
+# endif
+#endif
+#if !defined PRIiFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define PRIiFAST32 PRIi64
+# else
+# define PRIiFAST32 "i"
+# endif
+#endif
+#if !defined PRIoFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIoFAST32 PRIo64
+# else
+# define PRIoFAST32 "o"
+# endif
+#endif
+#if !defined PRIuFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIuFAST32 PRIu64
+# else
+# define PRIuFAST32 "u"
+# endif
+#endif
+#if !defined PRIxFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIxFAST32 PRIx64
+# else
+# define PRIxFAST32 "x"
+# endif
+#endif
+#if !defined PRIXFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define PRIXFAST32 PRIX64
+# else
+# define PRIXFAST32 "X"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined PRIdFAST64
+# define PRIdFAST64 PRId64
+# endif
+# if !defined PRIiFAST64
+# define PRIiFAST64 PRIi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined PRIoFAST64
+# define PRIoFAST64 PRIo64
+# endif
+# if !defined PRIuFAST64
+# define PRIuFAST64 PRIu64
+# endif
+# if !defined PRIxFAST64
+# define PRIxFAST64 PRIx64
+# endif
+# if !defined PRIXFAST64
+# define PRIXFAST64 PRIX64
+# endif
+#endif
+
+#if !defined PRIdMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define PRIdMAX PRId64
+# else
+# define PRIdMAX "ld"
+# endif
+#endif
+#if !defined PRIiMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define PRIiMAX PRIi64
+# else
+# define PRIiMAX "li"
+# endif
+#endif
+#if !defined PRIoMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIoMAX PRIo64
+# else
+# define PRIoMAX "lo"
+# endif
+#endif
+#if !defined PRIuMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIuMAX PRIu64
+# else
+# define PRIuMAX "lu"
+# endif
+#endif
+#if !defined PRIxMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIxMAX PRIx64
+# else
+# define PRIxMAX "lx"
+# endif
+#endif
+#if !defined PRIXMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define PRIXMAX PRIX64
+# else
+# define PRIXMAX "lX"
+# endif
+#endif
+
+#if !defined PRIdPTR
+# ifdef INTPTR_MAX
+# define PRIdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined PRIiPTR
+# ifdef INTPTR_MAX
+# define PRIiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined PRIoPTR
+# ifdef UINTPTR_MAX
+# define PRIoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined PRIuPTR
+# ifdef UINTPTR_MAX
+# define PRIuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined PRIxPTR
+# ifdef UINTPTR_MAX
+# define PRIxPTR @PRIPTR_PREFIX@ "x"
+# endif
+#endif
+#if !defined PRIXPTR
+# ifdef UINTPTR_MAX
+# define PRIXPTR @PRIPTR_PREFIX@ "X"
+# endif
+#endif
+
+#if !defined SCNd8
+# ifdef INT8_MAX
+# define SCNd8 "hhd"
+# endif
+#endif
+#if !defined SCNi8
+# ifdef INT8_MAX
+# define SCNi8 "hhi"
+# endif
+#endif
+#if !defined SCNo8
+# ifdef UINT8_MAX
+# define SCNo8 "hho"
+# endif
+#endif
+#if !defined SCNu8
+# ifdef UINT8_MAX
+# define SCNu8 "hhu"
+# endif
+#endif
+#if !defined SCNx8
+# ifdef UINT8_MAX
+# define SCNx8 "hhx"
+# endif
+#endif
+#if !defined SCNd16
+# ifdef INT16_MAX
+# define SCNd16 "hd"
+# endif
+#endif
+#if !defined SCNi16
+# ifdef INT16_MAX
+# define SCNi16 "hi"
+# endif
+#endif
+#if !defined SCNo16
+# ifdef UINT16_MAX
+# define SCNo16 "ho"
+# endif
+#endif
+#if !defined SCNu16
+# ifdef UINT16_MAX
+# define SCNu16 "hu"
+# endif
+#endif
+#if !defined SCNx16
+# ifdef UINT16_MAX
+# define SCNx16 "hx"
+# endif
+#endif
+#if !defined SCNd32
+# ifdef INT32_MAX
+# define SCNd32 "d"
+# endif
+#endif
+#if !defined SCNi32
+# ifdef INT32_MAX
+# define SCNi32 "i"
+# endif
+#endif
+#if !defined SCNo32
+# ifdef UINT32_MAX
+# define SCNo32 "o"
+# endif
+#endif
+#if !defined SCNu32
+# ifdef UINT32_MAX
+# define SCNu32 "u"
+# endif
+#endif
+#if !defined SCNx32
+# ifdef UINT32_MAX
+# define SCNx32 "x"
+# endif
+#endif
+#ifdef INT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @INT64_MAX_EQ_LONG_MAX@)
+# define _SCN64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _SCN64_PREFIX "I64"
+# elif LONG_MAX >> 30 == 1
+# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNd64
+# define SCNd64 _SCN64_PREFIX "d"
+# endif
+# if !defined SCNi64
+# define SCNi64 _SCN64_PREFIX "i"
+# endif
+#endif
+#ifdef UINT64_MAX
+# if (@APPLE_UNIVERSAL_BUILD@ ? defined _LP64 : @UINT64_MAX_EQ_ULONG_MAX@)
+# define _SCNu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _SCNu64_PREFIX "I64"
+# elif ULONG_MAX >> 31 == 1
+# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
+# endif
+# if !defined SCNo64
+# define SCNo64 _SCNu64_PREFIX "o"
+# endif
+# if !defined SCNu64
+# define SCNu64 _SCNu64_PREFIX "u"
+# endif
+# if !defined SCNx64
+# define SCNx64 _SCNu64_PREFIX "x"
+# endif
+#endif
+
+#if !defined SCNdLEAST8
+# define SCNdLEAST8 "hhd"
+#endif
+#if !defined SCNiLEAST8
+# define SCNiLEAST8 "hhi"
+#endif
+#if !defined SCNoLEAST8
+# define SCNoLEAST8 "hho"
+#endif
+#if !defined SCNuLEAST8
+# define SCNuLEAST8 "hhu"
+#endif
+#if !defined SCNxLEAST8
+# define SCNxLEAST8 "hhx"
+#endif
+#if !defined SCNdLEAST16
+# define SCNdLEAST16 "hd"
+#endif
+#if !defined SCNiLEAST16
+# define SCNiLEAST16 "hi"
+#endif
+#if !defined SCNoLEAST16
+# define SCNoLEAST16 "ho"
+#endif
+#if !defined SCNuLEAST16
+# define SCNuLEAST16 "hu"
+#endif
+#if !defined SCNxLEAST16
+# define SCNxLEAST16 "hx"
+#endif
+#if !defined SCNdLEAST32
+# define SCNdLEAST32 "d"
+#endif
+#if !defined SCNiLEAST32
+# define SCNiLEAST32 "i"
+#endif
+#if !defined SCNoLEAST32
+# define SCNoLEAST32 "o"
+#endif
+#if !defined SCNuLEAST32
+# define SCNuLEAST32 "u"
+#endif
+#if !defined SCNxLEAST32
+# define SCNxLEAST32 "x"
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdLEAST64
+# define SCNdLEAST64 SCNd64
+# endif
+# if !defined SCNiLEAST64
+# define SCNiLEAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoLEAST64
+# define SCNoLEAST64 SCNo64
+# endif
+# if !defined SCNuLEAST64
+# define SCNuLEAST64 SCNu64
+# endif
+# if !defined SCNxLEAST64
+# define SCNxLEAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define SCNdFAST8 SCNd64
+# elif INT_FAST8_MAX == 0x7fff
+# define SCNdFAST8 "hd"
+# elif INT_FAST8_MAX == 0x7f
+# define SCNdFAST8 "hhd"
+# else
+# define SCNdFAST8 "d"
+# endif
+#endif
+#if !defined SCNiFAST8
+# if INT_FAST8_MAX > INT32_MAX
+# define SCNiFAST8 SCNi64
+# elif INT_FAST8_MAX == 0x7fff
+# define SCNiFAST8 "hi"
+# elif INT_FAST8_MAX == 0x7f
+# define SCNiFAST8 "hhi"
+# else
+# define SCNiFAST8 "i"
+# endif
+#endif
+#if !defined SCNoFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define SCNoFAST8 SCNo64
+# elif UINT_FAST8_MAX == 0xffff
+# define SCNoFAST8 "ho"
+# elif UINT_FAST8_MAX == 0xff
+# define SCNoFAST8 "hho"
+# else
+# define SCNoFAST8 "o"
+# endif
+#endif
+#if !defined SCNuFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define SCNuFAST8 SCNu64
+# elif UINT_FAST8_MAX == 0xffff
+# define SCNuFAST8 "hu"
+# elif UINT_FAST8_MAX == 0xff
+# define SCNuFAST8 "hhu"
+# else
+# define SCNuFAST8 "u"
+# endif
+#endif
+#if !defined SCNxFAST8
+# if UINT_FAST8_MAX > UINT32_MAX
+# define SCNxFAST8 SCNx64
+# elif UINT_FAST8_MAX == 0xffff
+# define SCNxFAST8 "hx"
+# elif UINT_FAST8_MAX == 0xff
+# define SCNxFAST8 "hhx"
+# else
+# define SCNxFAST8 "x"
+# endif
+#endif
+#if !defined SCNdFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define SCNdFAST16 SCNd64
+# elif INT_FAST16_MAX == 0x7fff
+# define SCNdFAST16 "hd"
+# else
+# define SCNdFAST16 "d"
+# endif
+#endif
+#if !defined SCNiFAST16
+# if INT_FAST16_MAX > INT32_MAX
+# define SCNiFAST16 SCNi64
+# elif INT_FAST16_MAX == 0x7fff
+# define SCNiFAST16 "hi"
+# else
+# define SCNiFAST16 "i"
+# endif
+#endif
+#if !defined SCNoFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define SCNoFAST16 SCNo64
+# elif UINT_FAST16_MAX == 0xffff
+# define SCNoFAST16 "ho"
+# else
+# define SCNoFAST16 "o"
+# endif
+#endif
+#if !defined SCNuFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define SCNuFAST16 SCNu64
+# elif UINT_FAST16_MAX == 0xffff
+# define SCNuFAST16 "hu"
+# else
+# define SCNuFAST16 "u"
+# endif
+#endif
+#if !defined SCNxFAST16
+# if UINT_FAST16_MAX > UINT32_MAX
+# define SCNxFAST16 SCNx64
+# elif UINT_FAST16_MAX == 0xffff
+# define SCNxFAST16 "hx"
+# else
+# define SCNxFAST16 "x"
+# endif
+#endif
+#if !defined SCNdFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define SCNdFAST32 SCNd64
+# else
+# define SCNdFAST32 "d"
+# endif
+#endif
+#if !defined SCNiFAST32
+# if INT_FAST32_MAX > INT32_MAX
+# define SCNiFAST32 SCNi64
+# else
+# define SCNiFAST32 "i"
+# endif
+#endif
+#if !defined SCNoFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNoFAST32 SCNo64
+# else
+# define SCNoFAST32 "o"
+# endif
+#endif
+#if !defined SCNuFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNuFAST32 SCNu64
+# else
+# define SCNuFAST32 "u"
+# endif
+#endif
+#if !defined SCNxFAST32
+# if UINT_FAST32_MAX > UINT32_MAX
+# define SCNxFAST32 SCNx64
+# else
+# define SCNxFAST32 "x"
+# endif
+#endif
+#ifdef INT64_MAX
+# if !defined SCNdFAST64
+# define SCNdFAST64 SCNd64
+# endif
+# if !defined SCNiFAST64
+# define SCNiFAST64 SCNi64
+# endif
+#endif
+#ifdef UINT64_MAX
+# if !defined SCNoFAST64
+# define SCNoFAST64 SCNo64
+# endif
+# if !defined SCNuFAST64
+# define SCNuFAST64 SCNu64
+# endif
+# if !defined SCNxFAST64
+# define SCNxFAST64 SCNx64
+# endif
+#endif
+
+#if !defined SCNdMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define SCNdMAX SCNd64
+# else
+# define SCNdMAX "ld"
+# endif
+#endif
+#if !defined SCNiMAX
+# if @INT32_MAX_LT_INTMAX_MAX@
+# define SCNiMAX SCNi64
+# else
+# define SCNiMAX "li"
+# endif
+#endif
+#if !defined SCNoMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNoMAX SCNo64
+# else
+# define SCNoMAX "lo"
+# endif
+#endif
+#if !defined SCNuMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNuMAX SCNu64
+# else
+# define SCNuMAX "lu"
+# endif
+#endif
+#if !defined SCNxMAX
+# if @UINT32_MAX_LT_UINTMAX_MAX@
+# define SCNxMAX SCNx64
+# else
+# define SCNxMAX "lx"
+# endif
+#endif
+
+#if !defined SCNdPTR
+# ifdef INTPTR_MAX
+# define SCNdPTR @PRIPTR_PREFIX@ "d"
+# endif
+#endif
+#if !defined SCNiPTR
+# ifdef INTPTR_MAX
+# define SCNiPTR @PRIPTR_PREFIX@ "i"
+# endif
+#endif
+#if !defined SCNoPTR
+# ifdef UINTPTR_MAX
+# define SCNoPTR @PRIPTR_PREFIX@ "o"
+# endif
+#endif
+#if !defined SCNuPTR
+# ifdef UINTPTR_MAX
+# define SCNuPTR @PRIPTR_PREFIX@ "u"
+# endif
+#endif
+#if !defined SCNxPTR
+# ifdef UINTPTR_MAX
+# define SCNxPTR @PRIPTR_PREFIX@ "x"
+# endif
+#endif
+
+/* 7.8.2 Functions for greatest-width integer types */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if @GNULIB_IMAXABS@
+# if !@HAVE_DECL_IMAXABS@
+extern intmax_t imaxabs (intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxabs
+# if HAVE_RAW_DECL_IMAXABS
+_GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
+ "use gnulib module imaxabs for portability");
+# endif
+#endif
+
+#if @GNULIB_IMAXDIV@
+# if !@HAVE_IMAXDIV_T@
+# if !GNULIB_defined_imaxdiv_t
+typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+# define GNULIB_defined_imaxdiv_t 1
+# endif
+# endif
+# if !@HAVE_DECL_IMAXDIV@
+extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxdiv
+# if HAVE_RAW_DECL_IMAXDIV
+_GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
+ "use gnulib module imaxdiv for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOIMAX@
+# if @REPLACE_STRTOIMAX@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strtoimax
+# define strtoimax rpl_strtoimax
+# endif
+_GL_FUNCDECL_RPL (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int));
+# else
+# if !@HAVE_DECL_STRTOIMAX@
+# undef strtoimax
+_GL_FUNCDECL_SYS (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoimax, intmax_t,
+ (const char *restrict, char **restrict, int));
+# endif
+_GL_CXXALIASWARN (strtoimax);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoimax
+# if HAVE_RAW_DECL_STRTOIMAX
+_GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
+ "use gnulib module strtoimax for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOUMAX@
+# if @REPLACE_STRTOUMAX@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strtoumax
+# define strtoumax rpl_strtoumax
+# endif
+_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int));
+# else
+# if !@HAVE_DECL_STRTOUMAX@
+# undef strtoumax
+_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoumax, uintmax_t,
+ (const char *restrict, char **restrict, int));
+# endif
+_GL_CXXALIASWARN (strtoumax);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoumax
+# if HAVE_RAW_DECL_STRTOUMAX
+_GL_WARN_ON_USE (strtoumax, "strtoumax is unportable - "
+ "use gnulib module strtoumax for portability");
+# endif
+#endif
+
+/* Don't bother defining or declaring wcstoimax and wcstoumax, since
+ wide-character functions like this are hardly ever useful. */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !defined INTTYPES_H && !defined _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H */
diff --git a/gl/itold.c b/gl/itold.c
new file mode 100644
index 0000000..0ef4464
--- /dev/null
+++ b/gl/itold.c
@@ -0,0 +1,28 @@
+/* Replacement for 'int' to 'long double' conversion routine.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <float.h>
+
+void
+_Qp_itoq (long double *result, int a)
+{
+ /* Convert from 'int' to 'double', then from 'double' to 'long double'. */
+ *result = (double) a;
+}
diff --git a/gl/langinfo.in.h b/gl/langinfo.in.h
new file mode 100644
index 0000000..c7555a6
--- /dev/null
+++ b/gl/langinfo.in.h
@@ -0,0 +1,222 @@
+/* Substitute for and wrapper around <langinfo.h>.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/*
+ * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
+ */
+
+#ifndef _@GUARD_PREFIX@_LANGINFO_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_LANGINFO_H@
+# @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_LANGINFO_H
+#define _@GUARD_PREFIX@_LANGINFO_H
+
+
+#if !@HAVE_LANGINFO_H@
+
+/* A platform that lacks <langinfo.h>. */
+
+/* Assume that it also lacks <nl_types.h> and the nl_item type. */
+# if !GNULIB_defined_nl_item
+typedef int nl_item;
+# define GNULIB_defined_nl_item 1
+# endif
+
+/* nl_langinfo items of the LC_CTYPE category */
+# define CODESET 10000
+/* nl_langinfo items of the LC_NUMERIC category */
+# define RADIXCHAR 10001
+# define DECIMAL_POINT RADIXCHAR
+# define THOUSEP 10002
+# define THOUSANDS_SEP THOUSEP
+# define GROUPING 10114
+/* nl_langinfo items of the LC_TIME category */
+# define D_T_FMT 10003
+# define D_FMT 10004
+# define T_FMT 10005
+# define T_FMT_AMPM 10006
+# define AM_STR 10007
+# define PM_STR 10008
+# define DAY_1 10009
+# define DAY_2 (DAY_1 + 1)
+# define DAY_3 (DAY_1 + 2)
+# define DAY_4 (DAY_1 + 3)
+# define DAY_5 (DAY_1 + 4)
+# define DAY_6 (DAY_1 + 5)
+# define DAY_7 (DAY_1 + 6)
+# define ABDAY_1 10016
+# define ABDAY_2 (ABDAY_1 + 1)
+# define ABDAY_3 (ABDAY_1 + 2)
+# define ABDAY_4 (ABDAY_1 + 3)
+# define ABDAY_5 (ABDAY_1 + 4)
+# define ABDAY_6 (ABDAY_1 + 5)
+# define ABDAY_7 (ABDAY_1 + 6)
+# define MON_1 10023
+# define MON_2 (MON_1 + 1)
+# define MON_3 (MON_1 + 2)
+# define MON_4 (MON_1 + 3)
+# define MON_5 (MON_1 + 4)
+# define MON_6 (MON_1 + 5)
+# define MON_7 (MON_1 + 6)
+# define MON_8 (MON_1 + 7)
+# define MON_9 (MON_1 + 8)
+# define MON_10 (MON_1 + 9)
+# define MON_11 (MON_1 + 10)
+# define MON_12 (MON_1 + 11)
+# define ALTMON_1 10200
+# define ALTMON_2 (ALTMON_1 + 1)
+# define ALTMON_3 (ALTMON_1 + 2)
+# define ALTMON_4 (ALTMON_1 + 3)
+# define ALTMON_5 (ALTMON_1 + 4)
+# define ALTMON_6 (ALTMON_1 + 5)
+# define ALTMON_7 (ALTMON_1 + 6)
+# define ALTMON_8 (ALTMON_1 + 7)
+# define ALTMON_9 (ALTMON_1 + 8)
+# define ALTMON_10 (ALTMON_1 + 9)
+# define ALTMON_11 (ALTMON_1 + 10)
+# define ALTMON_12 (ALTMON_1 + 11)
+# define ABMON_1 10035
+# define ABMON_2 (ABMON_1 + 1)
+# define ABMON_3 (ABMON_1 + 2)
+# define ABMON_4 (ABMON_1 + 3)
+# define ABMON_5 (ABMON_1 + 4)
+# define ABMON_6 (ABMON_1 + 5)
+# define ABMON_7 (ABMON_1 + 6)
+# define ABMON_8 (ABMON_1 + 7)
+# define ABMON_9 (ABMON_1 + 8)
+# define ABMON_10 (ABMON_1 + 9)
+# define ABMON_11 (ABMON_1 + 10)
+# define ABMON_12 (ABMON_1 + 11)
+# define ERA 10047
+# define ERA_D_FMT 10048
+# define ERA_D_T_FMT 10049
+# define ERA_T_FMT 10050
+# define ALT_DIGITS 10051
+/* nl_langinfo items of the LC_MONETARY category */
+# define CRNCYSTR 10052
+# define CURRENCY_SYMBOL CRNCYSTR
+# define INT_CURR_SYMBOL 10100
+# define MON_DECIMAL_POINT 10101
+# define MON_THOUSANDS_SEP 10102
+# define MON_GROUPING 10103
+# define POSITIVE_SIGN 10104
+# define NEGATIVE_SIGN 10105
+# define FRAC_DIGITS 10106
+# define INT_FRAC_DIGITS 10107
+# define P_CS_PRECEDES 10108
+# define N_CS_PRECEDES 10109
+# define P_SEP_BY_SPACE 10110
+# define N_SEP_BY_SPACE 10111
+# define P_SIGN_POSN 10112
+# define N_SIGN_POSN 10113
+/* nl_langinfo items of the LC_MESSAGES category */
+# define YESEXPR 10053
+# define NOEXPR 10054
+
+#else
+
+/* A platform that has <langinfo.h>. */
+
+# if !@HAVE_LANGINFO_CODESET@
+# define CODESET 10000
+# define GNULIB_defined_CODESET 1
+# endif
+
+# if !@HAVE_LANGINFO_T_FMT_AMPM@
+# define T_FMT_AMPM 10006
+# define GNULIB_defined_T_FMT_AMPM 1
+# endif
+
+# if !@HAVE_LANGINFO_ALTMON@
+# define ALTMON_1 10200
+# define ALTMON_2 (ALTMON_1 + 1)
+# define ALTMON_3 (ALTMON_1 + 2)
+# define ALTMON_4 (ALTMON_1 + 3)
+# define ALTMON_5 (ALTMON_1 + 4)
+# define ALTMON_6 (ALTMON_1 + 5)
+# define ALTMON_7 (ALTMON_1 + 6)
+# define ALTMON_8 (ALTMON_1 + 7)
+# define ALTMON_9 (ALTMON_1 + 8)
+# define ALTMON_10 (ALTMON_1 + 9)
+# define ALTMON_11 (ALTMON_1 + 10)
+# define ALTMON_12 (ALTMON_1 + 11)
+# define GNULIB_defined_ALTMON 1
+# endif
+
+# if !@HAVE_LANGINFO_ERA@
+# define ERA 10047
+# define ERA_D_FMT 10048
+# define ERA_D_T_FMT 10049
+# define ERA_T_FMT 10050
+# define ALT_DIGITS 10051
+# define GNULIB_defined_ERA 1
+# endif
+
+# if !@HAVE_LANGINFO_YESEXPR@
+# define YESEXPR 10053
+# define NOEXPR 10054
+# define GNULIB_defined_YESEXPR 1
+# endif
+
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Declare overridden functions. */
+
+
+/* Return a piece of locale dependent information.
+ Note: The difference between nl_langinfo (CODESET) and locale_charset ()
+ is that the latter normalizes the encoding names to GNU conventions. */
+
+#if @GNULIB_NL_LANGINFO@
+# if @REPLACE_NL_LANGINFO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef nl_langinfo
+# define nl_langinfo rpl_nl_langinfo
+# endif
+_GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item));
+_GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item));
+# else
+# if !@HAVE_NL_LANGINFO@
+_GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item));
+# endif
+_GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item));
+# endif
+_GL_CXXALIASWARN (nl_langinfo);
+#elif defined GNULIB_POSIXCHECK
+# undef nl_langinfo
+# if HAVE_RAW_DECL_NL_LANGINFO
+_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
+ "use gnulib module nl_langinfo for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_LANGINFO_H */
+#endif /* _@GUARD_PREFIX@_LANGINFO_H */
diff --git a/gl/lc-charset-dispatch.c b/gl/lc-charset-dispatch.c
new file mode 100644
index 0000000..cd74466
--- /dev/null
+++ b/gl/lc-charset-dispatch.c
@@ -0,0 +1,82 @@
+/* Dispatching based on the current locale's character encoding.
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018. */
+
+#include <config.h>
+
+/* Specification. */
+#include "lc-charset-dispatch.h"
+
+#if GNULIB_defined_mbstate_t
+
+# include "localcharset.h"
+# include "streq.h"
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+/* When we know that the locale does not change, provide a speedup by
+ caching the value of locale_encoding_classification. */
+# define locale_encoding_classification_cached locale_encoding_classification
+# else
+/* By default, don't make assumptions, hence no caching. */
+# define locale_encoding_classification_uncached locale_encoding_classification
+# endif
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+static inline
+# endif
+enc_t
+locale_encoding_classification_uncached (void)
+{
+ const char *encoding = locale_charset ();
+ if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
+ return enc_utf8;
+ if (STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
+ return enc_eucjp;
+ if (STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+ || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+ || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
+ return enc_94;
+ if (STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
+ return enc_euctw;
+ if (STREQ_OPT (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
+ return enc_gb18030;
+ if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
+ return enc_sjis;
+ return enc_other;
+}
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+
+static int cached_locale_enc = -1;
+
+enc_t
+locale_encoding_classification_cached (void)
+{
+ if (cached_locale_enc < 0)
+ cached_locale_enc = locale_encoding_classification_uncached ();
+ return cached_locale_enc;
+}
+
+# endif
+
+#else
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#endif
diff --git a/gl/lc-charset-dispatch.h b/gl/lc-charset-dispatch.h
new file mode 100644
index 0000000..c82b6a6
--- /dev/null
+++ b/gl/lc-charset-dispatch.h
@@ -0,0 +1,40 @@
+/* Dispatching based on the current locale's character encoding.
+ Copyright (C) 2018-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018. */
+
+#include <wchar.h>
+
+#if GNULIB_defined_mbstate_t
+
+/* A classification of special values of the encoding of the current locale. */
+typedef enum
+ {
+ enc_other, /* other */
+ enc_utf8, /* UTF-8 */
+ enc_eucjp, /* EUC-JP */
+ enc_94, /* EUC-KR, GB2312, BIG5 */
+ enc_euctw, /* EUC-TW */
+ enc_gb18030, /* GB18030 */
+ enc_sjis /* SJIS */
+ }
+ enc_t;
+
+/* Returns a classification of special values of the encoding of the current
+ locale. */
+extern enc_t locale_encoding_classification (void);
+
+#endif
diff --git a/gl/libc-config.h b/gl/libc-config.h
new file mode 100644
index 0000000..1d28e58
--- /dev/null
+++ b/gl/libc-config.h
@@ -0,0 +1,202 @@
+/* System definitions for code taken from the GNU C Library
+
+ Copyright 2017-2023 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+/* This is intended to be a good-enough substitute for glibc system
+ macros like those defined in <sys/cdefs.h>, so that Gnulib code
+ shared with glibc can do this as the first #include:
+
+ #ifndef _LIBC
+ # include <libc-config.h>
+ #endif
+
+ When compiled as part of glibc this is a no-op; when compiled as
+ part of Gnulib this includes Gnulib's <config.h> and defines macros
+ that glibc library code would normally assume.
+
+ Note: This header file MUST NOT be included by public header files
+ of Gnulib. */
+
+#include <config.h>
+
+/* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
+ _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 and
+ DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull.
+ Elsewhere it is harmless. */
+#include <errno.h>
+
+/* From glibc <errno.h>. */
+#ifndef __set_errno
+# define __set_errno(val) (errno = (val))
+#endif
+
+/* From glibc <features.h>. */
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#ifndef __glibc_clang_prereq
+# if defined __clang_major__ && defined __clang_minor__
+# ifdef __apple_build_version__
+/* Apple for some reason renumbers __clang_major__ and __clang_minor__.
+ Gnulib code uses only __glibc_clang_prereq (3, 5); map it to
+ 6000000 <= __apple_build_version__. Support for other calls to
+ __glibc_clang_prereq can be added here as needed. */
+# define __glibc_clang_prereq(maj, min) \
+ ((maj) == 3 && (min) == 5 ? 6000000 <= __apple_build_version__ : 0)
+# else
+# define __glibc_clang_prereq(maj, min) \
+ ((maj) < __clang_major__ + ((min) <= __clang_minor__))
+# endif
+# else
+# define __glibc_clang_prereq(maj, min) 0
+# endif
+#endif
+
+#ifndef __attribute_nonnull__
+/* <sys/cdefs.h> either does not exist, or is too old for Gnulib.
+ Prepare to include <cdefs.h>, which is Gnulib's version of a
+ more-recent glibc <sys/cdefs.h>. */
+
+/* Define _FEATURES_H so that <cdefs.h> does not include <features.h>. */
+# ifndef _FEATURES_H
+# define _FEATURES_H 1
+# endif
+/* Define __GNULIB_CDEFS so that <cdefs.h> does not attempt to include
+ nonexistent files. */
+# define __GNULIB_CDEFS
+/* Undef the macros unconditionally defined by our copy of glibc
+ <sys/cdefs.h>, so that they do not clash with any system-defined
+ versions. */
+# undef _SYS_CDEFS_H
+# undef __ASMNAME
+# undef __ASMNAME2
+# undef __BEGIN_DECLS
+# undef __CONCAT
+# undef __END_DECLS
+# undef __HAVE_GENERIC_SELECTION
+# undef __LDBL_COMPAT
+# undef __LDBL_REDIR
+# undef __LDBL_REDIR1
+# undef __LDBL_REDIR1_DECL
+# undef __LDBL_REDIR1_NTH
+# undef __LDBL_REDIR2_DECL
+# undef __LDBL_REDIR_DECL
+# undef __LDBL_REDIR_NTH
+# undef __LEAF
+# undef __LEAF_ATTR
+# undef __NTH
+# undef __NTHNL
+# undef __REDIRECT
+# undef __REDIRECT_LDBL
+# undef __REDIRECT_NTH
+# undef __REDIRECT_NTHNL
+# undef __REDIRECT_NTH_LDBL
+# undef __STRING
+# undef __THROW
+# undef __THROWNL
+# undef __attr_access
+# undef __attr_access_none
+# undef __attr_dealloc
+# undef __attr_dealloc_free
+# undef __attribute__
+# undef __attribute_alloc_align__
+# undef __attribute_alloc_size__
+# undef __attribute_artificial__
+# undef __attribute_const__
+# undef __attribute_deprecated__
+# undef __attribute_deprecated_msg__
+# undef __attribute_format_arg__
+# undef __attribute_format_strfmon__
+# undef __attribute_malloc__
+# undef __attribute_maybe_unused__
+# undef __attribute_noinline__
+# undef __attribute_nonstring__
+# undef __attribute_pure__
+# undef __attribute_returns_twice__
+# undef __attribute_used__
+# undef __attribute_warn_unused_result__
+# undef __bos
+# undef __bos0
+# undef __errordecl
+# undef __extension__
+# undef __extern_always_inline
+# undef __extern_inline
+# undef __flexarr
+# undef __fortified_attr_access
+# undef __fortify_function
+# undef __glibc_c99_flexarr_available
+# undef __glibc_fortify
+# undef __glibc_fortify_n
+# undef __glibc_has_attribute
+# undef __glibc_has_builtin
+# undef __glibc_has_extension
+# undef __glibc_likely
+# undef __glibc_macro_warning
+# undef __glibc_macro_warning1
+# undef __glibc_objsize
+# undef __glibc_objsize0
+# undef __glibc_safe_len_cond
+# undef __glibc_safe_or_unknown_len
+# undef __glibc_unlikely
+# undef __glibc_unsafe_len
+# undef __glibc_unsigned_or_positive
+# undef __inline
+# undef __ptr_t
+# undef __restrict
+# undef __restrict_arr
+# undef __va_arg_pack
+# undef __va_arg_pack_len
+# undef __warnattr
+# undef __wur
+
+/* Include our copy of glibc <sys/cdefs.h>. */
+# include <cdefs.h>
+
+/* <cdefs.h> __inline is too pessimistic for non-GCC. */
+# undef __inline
+# ifndef HAVE___INLINE
+# if 199901 <= __STDC_VERSION__ || defined inline
+# define __inline inline
+# else
+# define __inline
+# endif
+# endif
+
+#endif /* defined __glibc_likely */
+
+
+/* A substitute for glibc <libc-symbols.h>, good enough for Gnulib. */
+#define attribute_hidden
+#define libc_hidden_proto(name)
+#define libc_hidden_def(name)
+#define libc_hidden_weak(name)
+#define libc_hidden_ver(local, name)
+#define strong_alias(name, aliasname)
+#define weak_alias(name, aliasname)
+
+/* A substitute for glibc <shlib-compat.h>, good enough for Gnulib. */
+#define SHLIB_COMPAT(lib, introduced, obsoleted) 0
+#define compat_symbol(lib, local, symbol, version) extern int dummy
+#define versioned_symbol(lib, local, symbol, version) extern int dummy
diff --git a/gl/limits.in.h b/gl/limits.in.h
new file mode 100644
index 0000000..eaeac47
--- /dev/null
+++ b/gl/limits.in.h
@@ -0,0 +1,131 @@
+/* A GNU-like <limits.h>.
+
+ Copyright 2016-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_LIMITS_H
+/* Special invocation convention:
+ On Haiku/x86_64, we have a sequence of nested includes
+ <limits.h> -> <syslimits.h> -> <limits.h>.
+ In this situation, LONG_MAX and INT_MAX are not yet defined,
+ therefore we should not attempt to define LONG_BIT. */
+
+#@INCLUDE_NEXT@ @NEXT_LIMITS_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_LIMITS_H
+
+# define _GL_ALREADY_INCLUDING_LIMITS_H
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_LIMITS_H@
+
+# undef _GL_ALREADY_INCLUDING_LIMITS_H
+
+#ifndef _@GUARD_PREFIX@_LIMITS_H
+#define _@GUARD_PREFIX@_LIMITS_H
+
+#ifndef LLONG_MIN
+# if defined LONG_LONG_MIN /* HP-UX 11.31 */
+# define LLONG_MIN LONG_LONG_MIN
+# elif defined LONGLONG_MIN /* IRIX 6.5 */
+# define LLONG_MIN LONGLONG_MIN
+# elif defined __GNUC__
+# define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
+# endif
+#endif
+#ifndef LLONG_MAX
+# if defined LONG_LONG_MAX /* HP-UX 11.31 */
+# define LLONG_MAX LONG_LONG_MAX
+# elif defined LONGLONG_MAX /* IRIX 6.5 */
+# define LLONG_MAX LONGLONG_MAX
+# elif defined __GNUC__
+# define LLONG_MAX __LONG_LONG_MAX__
+# endif
+#endif
+#ifndef ULLONG_MAX
+# if defined ULONG_LONG_MAX /* HP-UX 11.31 */
+# define ULLONG_MAX ULONG_LONG_MAX
+# elif defined ULONGLONG_MAX /* IRIX 6.5 */
+# define ULLONG_MAX ULONGLONG_MAX
+# elif defined __GNUC__
+# define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
+# endif
+#endif
+
+/* The number of usable bits in an unsigned or signed integer type
+ with minimum value MIN and maximum value MAX, as an int expression
+ suitable in #if. Cover all known practical hosts. This
+ implementation exploits the fact that MAX is 1 less than a power of
+ 2, and merely counts the number of 1 bits in MAX; "COBn" means
+ "count the number of 1 bits in the low-order n bits"). */
+#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
+#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
+#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
+#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
+#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
+#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
+#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
+
+#ifndef WORD_BIT
+/* Assume 'int' is 32 bits wide. */
+# define WORD_BIT 32
+#endif
+#ifndef LONG_BIT
+/* Assume 'long' is 32 or 64 bits wide. */
+# if LONG_MAX == INT_MAX
+# define LONG_BIT 32
+# else
+# define LONG_BIT 64
+# endif
+#endif
+
+/* Macros specified by C23 and by ISO/IEC TS 18661-1:2014. */
+
+#if (! defined ULLONG_WIDTH \
+ && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__ \
+ || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__)))
+# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
+# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
+# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
+# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
+# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
+# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
+# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
+# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
+# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
+# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
+# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
+#endif
+
+/* Macros specified by C23. */
+
+#if (! defined BOOL_WIDTH \
+ && (defined _GNU_SOURCE \
+ || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__)))
+# define BOOL_MAX 1
+# define BOOL_WIDTH 1
+#endif
+
+#endif /* _@GUARD_PREFIX@_LIMITS_H */
+#endif /* _@GUARD_PREFIX@_LIMITS_H */
+#endif
diff --git a/gl/localcharset.c b/gl/localcharset.c
new file mode 100644
index 0000000..7ed9c95
--- /dev/null
+++ b/gl/localcharset.c
@@ -0,0 +1,1159 @@
+/* Determine a canonical name for the current locale's character encoding.
+
+ Copyright (C) 2000-2006, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "localcharset.h"
+
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
+# define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
+#endif
+
+#if defined _WIN32 && !defined __CYGWIN__
+# define WINDOWS_NATIVE
+# include <locale.h>
+#endif
+
+#if defined __EMX__
+/* Assume EMX program runs on OS/2, even if compiled under DOS. */
+# ifndef OS2
+# define OS2
+# endif
+#endif
+
+#if !defined WINDOWS_NATIVE
+# if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+# else
+# if 0 /* see comment regarding use of setlocale(), below */
+# include <locale.h>
+# endif
+# endif
+# ifdef __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# endif
+#elif defined WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+ /* For the use of setlocale() below, the Gnulib override in setlocale.c is
+ not needed; see the platform lists in setlocale_null.m4. */
+# undef setlocale
+#endif
+#if defined OS2
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+/* For MB_CUR_MAX_L */
+#if defined DARWIN7
+# include <xlocale.h>
+#endif
+
+
+#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
+
+/* On these platforms, we use a mapping from non-canonical encoding name
+ to GNU canonical encoding name. */
+
+/* With glibc-2.1 or newer, we don't need any canonicalization,
+ because glibc has iconv and both glibc and libiconv support all
+ GNU canonical names directly. */
+# if !((defined __GNU_LIBRARY__ && __GLIBC__ >= 2) || defined __UCLIBC__)
+
+struct table_entry
+{
+ const char alias[11+1];
+ const char canonical[11+1];
+};
+
+/* Table of platform-dependent mappings, sorted in ascending order. */
+static const struct table_entry alias_table[] =
+ {
+# if defined __FreeBSD__ /* FreeBSD */
+ /*{ "ARMSCII-8", "ARMSCII-8" },*/
+ { "Big5", "BIG5" },
+ { "C", "ASCII" },
+ /*{ "CP1131", "CP1131" },*/
+ /*{ "CP1251", "CP1251" },*/
+ /*{ "CP866", "CP866" },*/
+ /*{ "GB18030", "GB18030" },*/
+ /*{ "GB2312", "GB2312" },*/
+ /*{ "GBK", "GBK" },*/
+ /*{ "ISCII-DEV", "?" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-9", "ISO-8859-9" },
+ /*{ "KOI8-R", "KOI8-R" },*/
+ /*{ "KOI8-U", "KOI8-U" },*/
+ { "SJIS", "SHIFT_JIS" },
+ { "US-ASCII", "ASCII" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" }
+# define alias_table_defined
+# endif
+# if defined __NetBSD__ /* NetBSD */
+ { "646", "ASCII" },
+ /*{ "ARMSCII-8", "ARMSCII-8" },*/
+ /*{ "BIG5", "BIG5" },*/
+ { "Big5-HKSCS", "BIG5-HKSCS" },
+ /*{ "CP1251", "CP1251" },*/
+ /*{ "CP866", "CP866" },*/
+ /*{ "GB18030", "GB18030" },*/
+ /*{ "GB2312", "GB2312" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ /*{ "KOI8-R", "KOI8-R" },*/
+ /*{ "KOI8-U", "KOI8-U" },*/
+ /*{ "PT154", "PT154" },*/
+ { "SJIS", "SHIFT_JIS" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" }
+# define alias_table_defined
+# endif
+# if defined __OpenBSD__ /* OpenBSD */
+ { "646", "ASCII" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "US-ASCII", "ASCII" }
+# define alias_table_defined
+# endif
+# if defined __APPLE__ && defined __MACH__ /* Mac OS X */
+ /* Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
+ useless:
+ - It returns the empty string when LANG is set to a locale of the
+ form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
+ LC_CTYPE file.
+ - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
+ the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
+ - The documentation says:
+ "... all code that calls BSD system routines should ensure
+ that the const *char parameters of these routines are in UTF-8
+ encoding. All BSD system functions expect their string
+ parameters to be in UTF-8 encoding and nothing else."
+ It also says
+ "An additional caveat is that string parameters for files,
+ paths, and other file-system entities must be in canonical
+ UTF-8. In a canonical UTF-8 Unicode string, all decomposable
+ characters are decomposed ..."
+ but this is not true: You can pass non-decomposed UTF-8 strings
+ to file system functions, and it is the OS which will convert
+ them to decomposed UTF-8 before accessing the file system.
+ - The Apple Terminal application displays UTF-8 by default.
+ - However, other applications are free to use different encodings:
+ - xterm uses ISO-8859-1 by default.
+ - TextEdit uses MacRoman by default.
+ We prefer UTF-8 over decomposed UTF-8-MAC because one should
+ minimize the use of decomposed Unicode. Unfortunately, through the
+ Darwin file system, decomposed UTF-8 strings are leaked into user
+ space nevertheless.
+ Then there are also the locales with encodings other than US-ASCII
+ and UTF-8. These locales can be occasionally useful to users (e.g.
+ when grepping through ISO-8859-1 encoded text files), when all their
+ file names are in US-ASCII.
+ */
+ { "ARMSCII-8", "ARMSCII-8" },
+ { "Big5", "BIG5" },
+ { "Big5HKSCS", "BIG5-HKSCS" },
+ { "CP1131", "CP1131" },
+ { "CP1251", "CP1251" },
+ { "CP866", "CP866" },
+ { "CP949", "CP949" },
+ { "GB18030", "GB18030" },
+ { "GB2312", "GB2312" },
+ { "GBK", "GBK" },
+ /*{ "ISCII-DEV", "?" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "KOI8-R", "KOI8-R" },
+ { "KOI8-U", "KOI8-U" },
+ { "PT154", "PT154" },
+ { "SJIS", "SHIFT_JIS" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" }
+# define alias_table_defined
+# endif
+# if defined _AIX /* AIX */
+ /*{ "GBK", "GBK" },*/
+ { "IBM-1046", "CP1046" },
+ { "IBM-1124", "CP1124" },
+ { "IBM-1129", "CP1129" },
+ { "IBM-1252", "CP1252" },
+ { "IBM-850", "CP850" },
+ { "IBM-856", "CP856" },
+ { "IBM-921", "ISO-8859-13" },
+ { "IBM-922", "CP922" },
+ { "IBM-932", "CP932" },
+ { "IBM-943", "CP943" },
+ { "IBM-eucCN", "GB2312" },
+ { "IBM-eucJP", "EUC-JP" },
+ { "IBM-eucKR", "EUC-KR" },
+ { "IBM-eucTW", "EUC-TW" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-6", "ISO-8859-6" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "TIS-620", "TIS-620" },
+ /*{ "UTF-8", "UTF-8" },*/
+ { "big5", "BIG5" }
+# define alias_table_defined
+# endif
+# if defined __hpux /* HP-UX */
+ { "SJIS", "SHIFT_JIS" },
+ { "arabic8", "HP-ARABIC8" },
+ { "big5", "BIG5" },
+ { "cp1251", "CP1251" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" },
+ { "gb18030", "GB18030" },
+ { "greek8", "HP-GREEK8" },
+ { "hebrew8", "HP-HEBREW8" },
+ { "hkbig5", "BIG5-HKSCS" },
+ { "hp15CN", "GB2312" },
+ { "iso88591", "ISO-8859-1" },
+ { "iso885913", "ISO-8859-13" },
+ { "iso885915", "ISO-8859-15" },
+ { "iso88592", "ISO-8859-2" },
+ { "iso88594", "ISO-8859-4" },
+ { "iso88595", "ISO-8859-5" },
+ { "iso88596", "ISO-8859-6" },
+ { "iso88597", "ISO-8859-7" },
+ { "iso88598", "ISO-8859-8" },
+ { "iso88599", "ISO-8859-9" },
+ { "kana8", "HP-KANA8" },
+ { "koi8r", "KOI8-R" },
+ { "roman8", "HP-ROMAN8" },
+ { "tis620", "TIS-620" },
+ { "turkish8", "HP-TURKISH8" },
+ { "utf8", "UTF-8" }
+# define alias_table_defined
+# endif
+# if defined __sgi /* IRIX */
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "eucCN", "GB2312" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" }
+# define alias_table_defined
+# endif
+# if defined __osf__ /* OSF/1 */
+ /*{ "GBK", "GBK" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "KSC5601", "CP949" },
+ { "SJIS", "SHIFT_JIS" },
+ { "TACTIS", "TIS-620" },
+ /*{ "UTF-8", "UTF-8" },*/
+ { "big5", "BIG5" },
+ { "cp850", "CP850" },
+ { "dechanyu", "DEC-HANYU" },
+ { "dechanzi", "GB2312" },
+ { "deckanji", "DEC-KANJI" },
+ { "deckorean", "EUC-KR" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW", "EUC-TW" },
+ { "sdeckanji", "EUC-JP" }
+# define alias_table_defined
+# endif
+# if defined __sun /* Solaris */
+ { "5601", "EUC-KR" },
+ { "646", "ASCII" },
+ /*{ "BIG5", "BIG5" },*/
+ { "Big5-HKSCS", "BIG5-HKSCS" },
+ { "GB18030", "GB18030" },
+ /*{ "GBK", "GBK" },*/
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-11", "TIS-620" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-3", "ISO-8859-3" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-6", "ISO-8859-6" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "PCK", "SHIFT_JIS" },
+ { "TIS620.2533", "TIS-620" },
+ /*{ "UTF-8", "UTF-8" },*/
+ { "ansi-1251", "CP1251" },
+ { "cns11643", "EUC-TW" },
+ { "eucJP", "EUC-JP" },
+ { "gb2312", "GB2312" },
+ { "koi8-r", "KOI8-R" }
+# define alias_table_defined
+# endif
+# if defined __minix /* Minix */
+ { "646", "ASCII" }
+# define alias_table_defined
+# endif
+# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Windows */
+ { "CP1361", "JOHAB" },
+ { "CP20127", "ASCII" },
+ { "CP20866", "KOI8-R" },
+ { "CP20936", "GB2312" },
+ { "CP21866", "KOI8-RU" },
+ { "CP28591", "ISO-8859-1" },
+ { "CP28592", "ISO-8859-2" },
+ { "CP28593", "ISO-8859-3" },
+ { "CP28594", "ISO-8859-4" },
+ { "CP28595", "ISO-8859-5" },
+ { "CP28596", "ISO-8859-6" },
+ { "CP28597", "ISO-8859-7" },
+ { "CP28598", "ISO-8859-8" },
+ { "CP28599", "ISO-8859-9" },
+ { "CP28605", "ISO-8859-15" },
+ { "CP38598", "ISO-8859-8" },
+ { "CP51932", "EUC-JP" },
+ { "CP51936", "GB2312" },
+ { "CP51949", "EUC-KR" },
+ { "CP51950", "EUC-TW" },
+ { "CP54936", "GB18030" },
+ { "CP65001", "UTF-8" },
+ { "CP936", "GBK" }
+# define alias_table_defined
+# endif
+# if defined OS2 /* OS/2 */
+ /* The list of encodings is taken from "List of OS/2 Codepages"
+ by Alex Taylor:
+ <http://altsan.org/os2/toolkits/uls/index.html#codepages>.
+ See also "__convcp() of kLIBC":
+ <https://github.com/bitwiseworks/libc/blob/master/src/emx/src/lib/locale/__convcp.c>. */
+ { "CP1004", "CP1252" },
+ /*{ "CP1041", "CP943" },*/
+ /*{ "CP1088", "CP949" },*/
+ { "CP1089", "ISO-8859-6" },
+ /*{ "CP1114", "CP950" },*/
+ /*{ "CP1115", "GB2312" },*/
+ { "CP1208", "UTF-8" },
+ /*{ "CP1380", "GB2312" },*/
+ { "CP1381", "GB2312" },
+ { "CP1383", "GB2312" },
+ { "CP1386", "GBK" },
+ /*{ "CP301", "CP943" },*/
+ { "CP3372", "EUC-JP" },
+ { "CP4946", "CP850" },
+ /*{ "CP5048", "JIS_X0208-1990" },*/
+ /*{ "CP5049", "JIS_X0212-1990" },*/
+ /*{ "CP5067", "KS_C_5601-1987" },*/
+ { "CP813", "ISO-8859-7" },
+ { "CP819", "ISO-8859-1" },
+ { "CP878", "KOI8-R" },
+ /*{ "CP897", "CP943" },*/
+ { "CP912", "ISO-8859-2" },
+ { "CP913", "ISO-8859-3" },
+ { "CP914", "ISO-8859-4" },
+ { "CP915", "ISO-8859-5" },
+ { "CP916", "ISO-8859-8" },
+ { "CP920", "ISO-8859-9" },
+ { "CP921", "ISO-8859-13" },
+ { "CP923", "ISO-8859-15" },
+ /*{ "CP941", "CP943" },*/
+ /*{ "CP947", "CP950" },*/
+ /*{ "CP951", "CP949" },*/
+ /*{ "CP952", "JIS_X0208-1990" },*/
+ /*{ "CP953", "JIS_X0212-1990" },*/
+ { "CP954", "EUC-JP" },
+ { "CP964", "EUC-TW" },
+ { "CP970", "EUC-KR" },
+ /*{ "CP971", "KS_C_5601-1987" },*/
+ { "IBM-1004", "CP1252" },
+ /*{ "IBM-1006", "?" },*/
+ /*{ "IBM-1008", "?" },*/
+ /*{ "IBM-1041", "CP943" },*/
+ /*{ "IBM-1051", "?" },*/
+ /*{ "IBM-1088", "CP949" },*/
+ { "IBM-1089", "ISO-8859-6" },
+ /*{ "IBM-1098", "?" },*/
+ /*{ "IBM-1114", "CP950" },*/
+ /*{ "IBM-1115", "GB2312" },*/
+ /*{ "IBM-1116", "?" },*/
+ /*{ "IBM-1117", "?" },*/
+ /*{ "IBM-1118", "?" },*/
+ /*{ "IBM-1119", "?" },*/
+ { "IBM-1124", "CP1124" },
+ { "IBM-1125", "CP1125" },
+ { "IBM-1131", "CP1131" },
+ { "IBM-1208", "UTF-8" },
+ { "IBM-1250", "CP1250" },
+ { "IBM-1251", "CP1251" },
+ { "IBM-1252", "CP1252" },
+ { "IBM-1253", "CP1253" },
+ { "IBM-1254", "CP1254" },
+ { "IBM-1255", "CP1255" },
+ { "IBM-1256", "CP1256" },
+ { "IBM-1257", "CP1257" },
+ /*{ "IBM-1275", "?" },*/
+ /*{ "IBM-1276", "?" },*/
+ /*{ "IBM-1277", "?" },*/
+ /*{ "IBM-1280", "?" },*/
+ /*{ "IBM-1281", "?" },*/
+ /*{ "IBM-1282", "?" },*/
+ /*{ "IBM-1283", "?" },*/
+ /*{ "IBM-1380", "GB2312" },*/
+ { "IBM-1381", "GB2312" },
+ { "IBM-1383", "GB2312" },
+ { "IBM-1386", "GBK" },
+ /*{ "IBM-301", "CP943" },*/
+ { "IBM-3372", "EUC-JP" },
+ { "IBM-367", "ASCII" },
+ { "IBM-437", "CP437" },
+ { "IBM-4946", "CP850" },
+ /*{ "IBM-5048", "JIS_X0208-1990" },*/
+ /*{ "IBM-5049", "JIS_X0212-1990" },*/
+ /*{ "IBM-5067", "KS_C_5601-1987" },*/
+ { "IBM-813", "ISO-8859-7" },
+ { "IBM-819", "ISO-8859-1" },
+ { "IBM-850", "CP850" },
+ /*{ "IBM-851", "?" },*/
+ { "IBM-852", "CP852" },
+ { "IBM-855", "CP855" },
+ { "IBM-856", "CP856" },
+ { "IBM-857", "CP857" },
+ /*{ "IBM-859", "?" },*/
+ { "IBM-860", "CP860" },
+ { "IBM-861", "CP861" },
+ { "IBM-862", "CP862" },
+ { "IBM-863", "CP863" },
+ { "IBM-864", "CP864" },
+ { "IBM-865", "CP865" },
+ { "IBM-866", "CP866" },
+ /*{ "IBM-868", "?" },*/
+ { "IBM-869", "CP869" },
+ { "IBM-874", "CP874" },
+ { "IBM-878", "KOI8-R" },
+ /*{ "IBM-895", "?" },*/
+ /*{ "IBM-897", "CP943" },*/
+ /*{ "IBM-907", "?" },*/
+ /*{ "IBM-909", "?" },*/
+ { "IBM-912", "ISO-8859-2" },
+ { "IBM-913", "ISO-8859-3" },
+ { "IBM-914", "ISO-8859-4" },
+ { "IBM-915", "ISO-8859-5" },
+ { "IBM-916", "ISO-8859-8" },
+ { "IBM-920", "ISO-8859-9" },
+ { "IBM-921", "ISO-8859-13" },
+ { "IBM-922", "CP922" },
+ { "IBM-923", "ISO-8859-15" },
+ { "IBM-932", "CP932" },
+ /*{ "IBM-941", "CP943" },*/
+ /*{ "IBM-942", "?" },*/
+ { "IBM-943", "CP943" },
+ /*{ "IBM-947", "CP950" },*/
+ { "IBM-949", "CP949" },
+ { "IBM-950", "CP950" },
+ /*{ "IBM-951", "CP949" },*/
+ /*{ "IBM-952", "JIS_X0208-1990" },*/
+ /*{ "IBM-953", "JIS_X0212-1990" },*/
+ { "IBM-954", "EUC-JP" },
+ /*{ "IBM-955", "?" },*/
+ { "IBM-964", "EUC-TW" },
+ { "IBM-970", "EUC-KR" },
+ /*{ "IBM-971", "KS_C_5601-1987" },*/
+ { "IBM-eucCN", "GB2312" },
+ { "IBM-eucJP", "EUC-JP" },
+ { "IBM-eucKR", "EUC-KR" },
+ { "IBM-eucTW", "EUC-TW" },
+ { "IBM33722", "EUC-JP" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-3", "ISO-8859-3" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-6", "ISO-8859-6" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ /*{ "JISX0201-1976", "JISX0201-1976" },*/
+ /*{ "JISX0208-1978", "?" },*/
+ /*{ "JISX0208-1983", "JIS_X0208-1983" },*/
+ /*{ "JISX0208-1990", "JIS_X0208-1990" },*/
+ /*{ "JISX0212-1990", "JIS_X0212-1990" },*/
+ /*{ "KSC5601-1987", "KS_C_5601-1987" },*/
+ { "SJIS-1", "CP943" },
+ { "SJIS-2", "CP943" },
+ { "eucJP", "EUC-JP" },
+ { "eucKR", "EUC-KR" },
+ { "eucTW-1993", "EUC-TW" }
+# define alias_table_defined
+# endif
+# if defined VMS /* OpenVMS */
+ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
+ "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
+ section 10.7 "Handling Different Character Sets". */
+ { "DECHANYU", "DEC-HANYU" },
+ { "DECHANZI", "GB2312" },
+ { "DECKANJI", "DEC-KANJI" },
+ { "DECKOREAN", "EUC-KR" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "SDECKANJI", "EUC-JP" },
+ { "SJIS", "SHIFT_JIS" },
+ { "eucJP", "EUC-JP" },
+ { "eucTW", "EUC-TW" }
+# define alias_table_defined
+# endif
+# ifndef alias_table_defined
+ /* Just a dummy entry, to avoid a C syntax error. */
+ { "", "" }
+# endif
+ };
+
+# endif
+
+#else
+
+/* On these platforms, we use a mapping from locale name to GNU canonical
+ encoding name. */
+
+struct table_entry
+{
+ const char locale[17+1];
+ const char canonical[11+1];
+};
+
+/* Table of platform-dependent mappings, sorted in ascending order. */
+static const struct table_entry locale_table[] =
+ {
+# if defined __FreeBSD__ /* FreeBSD 4.2 */
+ { "cs_CZ.ISO_8859-2", "ISO-8859-2" },
+ { "da_DK.DIS_8859-15", "ISO-8859-15" },
+ { "da_DK.ISO_8859-1", "ISO-8859-1" },
+ { "de_AT.DIS_8859-15", "ISO-8859-15" },
+ { "de_AT.ISO_8859-1", "ISO-8859-1" },
+ { "de_CH.DIS_8859-15", "ISO-8859-15" },
+ { "de_CH.ISO_8859-1", "ISO-8859-1" },
+ { "de_DE.DIS_8859-15", "ISO-8859-15" },
+ { "de_DE.ISO_8859-1", "ISO-8859-1" },
+ { "en_AU.DIS_8859-15", "ISO-8859-15" },
+ { "en_AU.ISO_8859-1", "ISO-8859-1" },
+ { "en_CA.DIS_8859-15", "ISO-8859-15" },
+ { "en_CA.ISO_8859-1", "ISO-8859-1" },
+ { "en_GB.DIS_8859-15", "ISO-8859-15" },
+ { "en_GB.ISO_8859-1", "ISO-8859-1" },
+ { "en_US.DIS_8859-15", "ISO-8859-15" },
+ { "en_US.ISO_8859-1", "ISO-8859-1" },
+ { "es_ES.DIS_8859-15", "ISO-8859-15" },
+ { "es_ES.ISO_8859-1", "ISO-8859-1" },
+ { "fi_FI.DIS_8859-15", "ISO-8859-15" },
+ { "fi_FI.ISO_8859-1", "ISO-8859-1" },
+ { "fr_BE.DIS_8859-15", "ISO-8859-15" },
+ { "fr_BE.ISO_8859-1", "ISO-8859-1" },
+ { "fr_CA.DIS_8859-15", "ISO-8859-15" },
+ { "fr_CA.ISO_8859-1", "ISO-8859-1" },
+ { "fr_CH.DIS_8859-15", "ISO-8859-15" },
+ { "fr_CH.ISO_8859-1", "ISO-8859-1" },
+ { "fr_FR.DIS_8859-15", "ISO-8859-15" },
+ { "fr_FR.ISO_8859-1", "ISO-8859-1" },
+ { "hr_HR.ISO_8859-2", "ISO-8859-2" },
+ { "hu_HU.ISO_8859-2", "ISO-8859-2" },
+ { "is_IS.DIS_8859-15", "ISO-8859-15" },
+ { "is_IS.ISO_8859-1", "ISO-8859-1" },
+ { "it_CH.DIS_8859-15", "ISO-8859-15" },
+ { "it_CH.ISO_8859-1", "ISO-8859-1" },
+ { "it_IT.DIS_8859-15", "ISO-8859-15" },
+ { "it_IT.ISO_8859-1", "ISO-8859-1" },
+ { "ja_JP.EUC", "EUC-JP" },
+ { "ja_JP.SJIS", "SHIFT_JIS" },
+ { "ja_JP.Shift_JIS", "SHIFT_JIS" },
+ { "ko_KR.EUC", "EUC-KR" },
+ { "la_LN.ASCII", "ASCII" },
+ { "la_LN.DIS_8859-15", "ISO-8859-15" },
+ { "la_LN.ISO_8859-1", "ISO-8859-1" },
+ { "la_LN.ISO_8859-2", "ISO-8859-2" },
+ { "la_LN.ISO_8859-4", "ISO-8859-4" },
+ { "lt_LN.ASCII", "ASCII" },
+ { "lt_LN.DIS_8859-15", "ISO-8859-15" },
+ { "lt_LN.ISO_8859-1", "ISO-8859-1" },
+ { "lt_LN.ISO_8859-2", "ISO-8859-2" },
+ { "lt_LT.ISO_8859-4", "ISO-8859-4" },
+ { "nl_BE.DIS_8859-15", "ISO-8859-15" },
+ { "nl_BE.ISO_8859-1", "ISO-8859-1" },
+ { "nl_NL.DIS_8859-15", "ISO-8859-15" },
+ { "nl_NL.ISO_8859-1", "ISO-8859-1" },
+ { "no_NO.DIS_8859-15", "ISO-8859-15" },
+ { "no_NO.ISO_8859-1", "ISO-8859-1" },
+ { "pl_PL.ISO_8859-2", "ISO-8859-2" },
+ { "pt_PT.DIS_8859-15", "ISO-8859-15" },
+ { "pt_PT.ISO_8859-1", "ISO-8859-1" },
+ { "ru_RU.CP866", "CP866" },
+ { "ru_RU.ISO_8859-5", "ISO-8859-5" },
+ { "ru_RU.KOI8-R", "KOI8-R" },
+ { "ru_SU.CP866", "CP866" },
+ { "ru_SU.ISO_8859-5", "ISO-8859-5" },
+ { "ru_SU.KOI8-R", "KOI8-R" },
+ { "sl_SI.ISO_8859-2", "ISO-8859-2" },
+ { "sv_SE.DIS_8859-15", "ISO-8859-15" },
+ { "sv_SE.ISO_8859-1", "ISO-8859-1" },
+ { "uk_UA.KOI8-U", "KOI8-U" },
+ { "zh_CN.EUC", "GB2312" },
+ { "zh_TW.BIG5", "BIG5" },
+ { "zh_TW.Big5", "BIG5" }
+# define locale_table_defined
+# endif
+# if defined __DJGPP__ /* DOS / DJGPP 2.03 */
+ /* The encodings given here may not all be correct.
+ If you find that the encoding given for your language and
+ country is not the one your DOS machine actually uses, just
+ correct it in this file, and send a mail to
+ Juan Manuel Guerrero <juan.guerrero@gmx.de>
+ and <bug-gnulib@gnu.org>. */
+ { "C", "ASCII" },
+ { "ar", "CP864" },
+ { "ar_AE", "CP864" },
+ { "ar_DZ", "CP864" },
+ { "ar_EG", "CP864" },
+ { "ar_IQ", "CP864" },
+ { "ar_IR", "CP864" },
+ { "ar_JO", "CP864" },
+ { "ar_KW", "CP864" },
+ { "ar_MA", "CP864" },
+ { "ar_OM", "CP864" },
+ { "ar_QA", "CP864" },
+ { "ar_SA", "CP864" },
+ { "ar_SY", "CP864" },
+ { "be", "CP866" },
+ { "be_BE", "CP866" },
+ { "bg", "CP866" }, /* not CP855 ?? */
+ { "bg_BG", "CP866" }, /* not CP855 ?? */
+ { "ca", "CP850" },
+ { "ca_ES", "CP850" },
+ { "cs", "CP852" },
+ { "cs_CZ", "CP852" },
+ { "da", "CP865" }, /* not CP850 ?? */
+ { "da_DK", "CP865" }, /* not CP850 ?? */
+ { "de", "CP850" },
+ { "de_AT", "CP850" },
+ { "de_CH", "CP850" },
+ { "de_DE", "CP850" },
+ { "el", "CP869" },
+ { "el_GR", "CP869" },
+ { "en", "CP850" },
+ { "en_AU", "CP850" }, /* not CP437 ?? */
+ { "en_CA", "CP850" },
+ { "en_GB", "CP850" },
+ { "en_NZ", "CP437" },
+ { "en_US", "CP437" },
+ { "en_ZA", "CP850" }, /* not CP437 ?? */
+ { "eo", "CP850" },
+ { "eo_EO", "CP850" },
+ { "es", "CP850" },
+ { "es_AR", "CP850" },
+ { "es_BO", "CP850" },
+ { "es_CL", "CP850" },
+ { "es_CO", "CP850" },
+ { "es_CR", "CP850" },
+ { "es_CU", "CP850" },
+ { "es_DO", "CP850" },
+ { "es_EC", "CP850" },
+ { "es_ES", "CP850" },
+ { "es_GT", "CP850" },
+ { "es_HN", "CP850" },
+ { "es_MX", "CP850" },
+ { "es_NI", "CP850" },
+ { "es_PA", "CP850" },
+ { "es_PE", "CP850" },
+ { "es_PY", "CP850" },
+ { "es_SV", "CP850" },
+ { "es_UY", "CP850" },
+ { "es_VE", "CP850" },
+ { "et", "CP850" },
+ { "et_EE", "CP850" },
+ { "eu", "CP850" },
+ { "eu_ES", "CP850" },
+ { "fi", "CP850" },
+ { "fi_FI", "CP850" },
+ { "fr", "CP850" },
+ { "fr_BE", "CP850" },
+ { "fr_CA", "CP850" },
+ { "fr_CH", "CP850" },
+ { "fr_FR", "CP850" },
+ { "ga", "CP850" },
+ { "ga_IE", "CP850" },
+ { "gd", "CP850" },
+ { "gd_GB", "CP850" },
+ { "gl", "CP850" },
+ { "gl_ES", "CP850" },
+ { "he", "CP862" },
+ { "he_IL", "CP862" },
+ { "hr", "CP852" },
+ { "hr_HR", "CP852" },
+ { "hu", "CP852" },
+ { "hu_HU", "CP852" },
+ { "id", "CP850" }, /* not CP437 ?? */
+ { "id_ID", "CP850" }, /* not CP437 ?? */
+ { "is", "CP861" }, /* not CP850 ?? */
+ { "is_IS", "CP861" }, /* not CP850 ?? */
+ { "it", "CP850" },
+ { "it_CH", "CP850" },
+ { "it_IT", "CP850" },
+ { "ja", "CP932" },
+ { "ja_JP", "CP932" },
+ { "kr", "CP949" }, /* not CP934 ?? */
+ { "kr_KR", "CP949" }, /* not CP934 ?? */
+ { "lt", "CP775" },
+ { "lt_LT", "CP775" },
+ { "lv", "CP775" },
+ { "lv_LV", "CP775" },
+ { "mk", "CP866" }, /* not CP855 ?? */
+ { "mk_MK", "CP866" }, /* not CP855 ?? */
+ { "mt", "CP850" },
+ { "mt_MT", "CP850" },
+ { "nb", "CP865" }, /* not CP850 ?? */
+ { "nb_NO", "CP865" }, /* not CP850 ?? */
+ { "nl", "CP850" },
+ { "nl_BE", "CP850" },
+ { "nl_NL", "CP850" },
+ { "nn", "CP865" }, /* not CP850 ?? */
+ { "nn_NO", "CP865" }, /* not CP850 ?? */
+ { "no", "CP865" }, /* not CP850 ?? */
+ { "no_NO", "CP865" }, /* not CP850 ?? */
+ { "pl", "CP852" },
+ { "pl_PL", "CP852" },
+ { "pt", "CP850" },
+ { "pt_BR", "CP850" },
+ { "pt_PT", "CP850" },
+ { "ro", "CP852" },
+ { "ro_RO", "CP852" },
+ { "ru", "CP866" },
+ { "ru_RU", "CP866" },
+ { "sk", "CP852" },
+ { "sk_SK", "CP852" },
+ { "sl", "CP852" },
+ { "sl_SI", "CP852" },
+ { "sq", "CP852" },
+ { "sq_AL", "CP852" },
+ { "sr", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+ { "sr_CS", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+ { "sr_YU", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+ { "sv", "CP850" },
+ { "sv_SE", "CP850" },
+ { "th", "CP874" },
+ { "th_TH", "CP874" },
+ { "tr", "CP857" },
+ { "tr_TR", "CP857" },
+ { "uk", "CP1125" },
+ { "uk_UA", "CP1125" },
+ { "zh_CN", "GBK" },
+ { "zh_TW", "CP950" } /* not CP938 ?? */
+# define locale_table_defined
+# endif
+# ifndef locale_table_defined
+ /* Just a dummy entry, to avoid a C syntax error. */
+ { "", "" }
+# endif
+ };
+
+#endif
+
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed below.
+ The result must not be freed; it is statically allocated. The result
+ becomes invalid when setlocale() is used to change the global locale, or
+ when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
+ is changed; threads in multithreaded programs should not do this.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+
+#ifdef STATIC
+STATIC
+#endif
+const char *
+locale_charset (void)
+{
+ const char *codeset;
+
+ /* This function must be multithread-safe. To achieve this without using
+ thread-local storage, we use a simple strcpy or memcpy to fill this static
+ buffer. Filling it through, for example, strcpy + strcat would not be
+ guaranteed to leave the buffer's contents intact if another thread is
+ currently accessing it. If necessary, the contents is first assembled in
+ a stack-allocated buffer. */
+
+#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
+
+# if HAVE_LANGINFO_CODESET
+
+ /* Most systems support nl_langinfo (CODESET) nowadays. */
+ codeset = nl_langinfo (CODESET);
+
+# ifdef __CYGWIN__
+ /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
+ returns "US-ASCII". Return the suffix of the locale name from the
+ environment variables (if present) or the codepage as a number. */
+ if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
+ {
+ const char *locale;
+ static char resultbuf[2 + 10 + 1];
+
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ if (locale != NULL && locale[0] != '\0')
+ {
+ /* If the locale name contains an encoding after the dot, return
+ it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (resultbuf))
+ {
+ /* This way of filling resultbuf is multithread-safe. */
+ memcpy (resultbuf, dot, modifier - dot);
+ resultbuf [modifier - dot] = '\0';
+ return resultbuf;
+ }
+ }
+ }
+
+ /* The Windows API has a function returning the locale's codepage as a
+ number: GetACP(). This encoding is used by Cygwin, unless the user
+ has set the environment variable CYGWIN=codepage:oem (which very few
+ people do).
+ Output directed to console windows needs to be converted (to
+ GetOEMCP() if the console is using a raster font, or to
+ GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
+ this conversion transparently (see winsup/cygwin/fhandler_console.cc),
+ converting to GetConsoleOutputCP(). This leads to correct results,
+ except when SetConsoleOutputCP has been called and a raster font is
+ in use. */
+ {
+ char buf[2 + 10 + 1];
+
+ sprintf (buf, "CP%u", GetACP ());
+ strcpy (resultbuf, buf);
+ codeset = resultbuf;
+ }
+ }
+# endif
+
+ if (codeset == NULL)
+ /* The canonical name cannot be determined. */
+ codeset = "";
+
+# elif defined WINDOWS_NATIVE
+
+ char buf[2 + 10 + 1];
+ static char resultbuf[2 + 10 + 1];
+
+ /* The Windows API has a function returning the locale's codepage as
+ a number, but the value doesn't change according to what the
+ 'setlocale' call specified. So we use it as a last resort, in
+ case the string returned by 'setlocale' doesn't specify the
+ codepage. */
+ char *current_locale = setlocale (LC_CTYPE, NULL);
+ char *pdot = strrchr (current_locale, '.');
+
+ if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
+ sprintf (buf, "CP%s", pdot + 1);
+ else
+ {
+ /* The Windows API has a function returning the locale's codepage as a
+ number: GetACP().
+ When the output goes to a console window, it needs to be provided in
+ GetOEMCP() encoding if the console is using a raster font, or in
+ GetConsoleOutputCP() encoding if it is using a TrueType font.
+ But in GUI programs and for output sent to files and pipes, GetACP()
+ encoding is the best bet. */
+ sprintf (buf, "CP%u", GetACP ());
+ }
+ /* For a locale name such as "French_France.65001", in Windows 10,
+ setlocale now returns "French_France.utf8" instead. */
+ if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+ codeset = "UTF-8";
+ else
+ {
+ strcpy (resultbuf, buf);
+ codeset = resultbuf;
+ }
+
+# elif defined OS2
+
+ const char *locale;
+ static char resultbuf[2 + 10 + 1];
+ ULONG cp[3];
+ ULONG cplen;
+
+ codeset = NULL;
+
+ /* Allow user to override the codeset, as set in the operating system,
+ with standard language environment variables. */
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ if (locale != NULL && locale[0] != '\0')
+ {
+ /* If the locale name contains an encoding after the dot, return it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (resultbuf))
+ {
+ /* This way of filling resultbuf is multithread-safe. */
+ memcpy (resultbuf, dot, modifier - dot);
+ resultbuf [modifier - dot] = '\0';
+ return resultbuf;
+ }
+ }
+
+ /* For the POSIX locale, don't use the system's codepage. */
+ if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+ codeset = "";
+ }
+
+ if (codeset == NULL)
+ {
+ /* OS/2 has a function returning the locale's codepage as a number. */
+ if (DosQueryCp (sizeof (cp), cp, &cplen))
+ codeset = "";
+ else
+ {
+ char buf[2 + 10 + 1];
+
+ sprintf (buf, "CP%u", cp[0]);
+ strcpy (resultbuf, buf);
+ codeset = resultbuf;
+ }
+ }
+
+# else
+
+# error "Add code for other platforms here."
+
+# endif
+
+ /* Resolve alias. */
+ {
+# ifdef alias_table_defined
+ /* On some platforms, UTF-8 locales are the most frequently used ones.
+ Speed up the common case and slow down the less common cases by
+ testing for this case first. */
+# if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
+ if (strcmp (codeset, "UTF-8") == 0)
+ goto done_table_lookup;
+ else
+# endif
+ {
+ const struct table_entry * const table = alias_table;
+ size_t const table_size =
+ sizeof (alias_table) / sizeof (struct table_entry);
+ /* The table is sorted. Perform a binary search. */
+ size_t hi = table_size;
+ size_t lo = 0;
+ while (lo < hi)
+ {
+ /* Invariant:
+ for i < lo, strcmp (table[i].alias, codeset) < 0,
+ for i >= hi, strcmp (table[i].alias, codeset) > 0. */
+ size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+ int cmp = strcmp (table[mid].alias, codeset);
+ if (cmp < 0)
+ lo = mid + 1;
+ else if (cmp > 0)
+ hi = mid;
+ else
+ {
+ /* Found an i with
+ strcmp (table[i].alias, codeset) == 0. */
+ codeset = table[mid].canonical;
+ goto done_table_lookup;
+ }
+ }
+ }
+ if (0)
+ done_table_lookup: ;
+ else
+# endif
+ {
+ /* Did not find it in the table. */
+ /* On Mac OS X, all modern locales use the UTF-8 encoding.
+ BeOS and Haiku have a single locale, and it has UTF-8 encoding. */
+# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
+ codeset = "UTF-8";
+# else
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",
+ thus GNU libiconv would call this function a second time. */
+ if (codeset[0] == '\0')
+ codeset = "ASCII";
+# endif
+ }
+ }
+
+#else
+
+ /* On old systems which lack it, use setlocale or getenv. */
+ const char *locale = NULL;
+
+ /* But most old systems don't have a complete set of locales. Some
+ (like DJGPP) have only the C locale. Therefore we don't use setlocale
+ here; it would return "C" when it doesn't support the locale name the
+ user has set. */
+# if 0
+ locale = setlocale (LC_CTYPE, NULL);
+# endif
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ if (locale == NULL)
+ locale = "";
+ }
+ }
+
+ /* Map locale name to canonical encoding name. */
+ {
+# ifdef locale_table_defined
+ const struct table_entry * const table = locale_table;
+ size_t const table_size =
+ sizeof (locale_table) / sizeof (struct table_entry);
+ /* The table is sorted. Perform a binary search. */
+ size_t hi = table_size;
+ size_t lo = 0;
+ while (lo < hi)
+ {
+ /* Invariant:
+ for i < lo, strcmp (table[i].locale, locale) < 0,
+ for i >= hi, strcmp (table[i].locale, locale) > 0. */
+ size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+ int cmp = strcmp (table[mid].locale, locale);
+ if (cmp < 0)
+ lo = mid + 1;
+ else if (cmp > 0)
+ hi = mid;
+ else
+ {
+ /* Found an i with
+ strcmp (table[i].locale, locale) == 0. */
+ codeset = table[mid].canonical;
+ goto done_table_lookup;
+ }
+ }
+ if (0)
+ done_table_lookup: ;
+ else
+# endif
+ {
+ /* Did not find it in the table. */
+ /* On Mac OS X, all modern locales use the UTF-8 encoding.
+ BeOS and Haiku have a single locale, and it has UTF-8 encoding. */
+# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
+ codeset = "UTF-8";
+# else
+ /* The canonical name cannot be determined. */
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",
+ thus GNU libiconv would call this function a second time. */
+ codeset = "ASCII";
+# endif
+ }
+ }
+
+#endif
+
+#ifdef DARWIN7
+ /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
+ (the default codeset) does not work when MB_CUR_MAX is 1. */
+ if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
+ codeset = "ASCII";
+#endif
+
+ return codeset;
+}
diff --git a/gl/localcharset.h b/gl/localcharset.h
new file mode 100644
index 0000000..29ee8dc
--- /dev/null
+++ b/gl/localcharset.h
@@ -0,0 +1,137 @@
+/* Determine a canonical name for the current locale's character encoding.
+ Copyright (C) 2000-2003, 2009-2023 Free Software Foundation, Inc.
+ This file is part of the GNU CHARSET Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _LOCALCHARSET_H
+#define _LOCALCHARSET_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed below.
+ The result must not be freed; it is statically allocated. The result
+ becomes invalid when setlocale() is used to change the global locale, or
+ when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
+ is changed; threads in multithreaded programs should not do this.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+extern const char * locale_charset (void);
+
+/* About GNU canonical names for character encodings:
+
+ Every canonical name must be supported by GNU libiconv. Support by GNU libc
+ is also desirable.
+
+ The name is case insensitive. Usually an upper case MIME charset name is
+ preferred.
+
+ The current list of these GNU canonical names is:
+
+ name MIME? used by which systems
+ (darwin = Mac OS X, windows = native Windows)
+
+ ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin
+ ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-3 Y glibc solaris cygwin
+ ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin
+ ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-6 Y glibc aix hpux solaris cygwin
+ ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+ ISO-8859-8 Y glibc aix hpux osf solaris cygwin zos
+ ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin zos
+ ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin
+ ISO-8859-14 glibc cygwin
+ ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin
+ KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin
+ KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
+ KOI8-T glibc
+ CP437 dos
+ CP775 dos
+ CP850 aix osf dos
+ CP852 dos
+ CP855 dos
+ CP856 aix
+ CP857 dos
+ CP861 dos
+ CP862 dos
+ CP864 dos
+ CP865 dos
+ CP866 freebsd netbsd openbsd darwin dos
+ CP869 dos
+ CP874 windows dos
+ CP922 aix
+ CP932 aix cygwin windows dos
+ CP943 aix zos
+ CP949 osf darwin windows dos
+ CP950 windows dos
+ CP1046 aix
+ CP1124 aix
+ CP1125 dos
+ CP1129 aix
+ CP1131 freebsd darwin
+ CP1250 windows
+ CP1251 glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows
+ CP1252 aix windows
+ CP1253 windows
+ CP1254 windows
+ CP1255 glibc windows
+ CP1256 windows
+ CP1257 windows
+ GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos
+ EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
+ EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos
+ EUC-TW glibc aix hpux irix osf solaris netbsd
+ BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos
+ BIG5-HKSCS glibc hpux solaris netbsd darwin
+ GBK glibc aix osf solaris freebsd darwin cygwin windows dos
+ GB18030 glibc hpux solaris freebsd netbsd darwin
+ SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
+ JOHAB glibc solaris windows
+ TIS-620 glibc aix hpux osf solaris cygwin zos
+ VISCII Y glibc
+ TCVN5712-1 glibc
+ ARMSCII-8 glibc freebsd netbsd darwin
+ GEORGIAN-PS glibc cygwin
+ PT154 glibc netbsd cygwin
+ HP-ROMAN8 hpux
+ HP-ARABIC8 hpux
+ HP-GREEK8 hpux
+ HP-HEBREW8 hpux
+ HP-TURKISH8 hpux
+ HP-KANA8 hpux
+ DEC-KANJI osf
+ DEC-HANYU osf
+ UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin zos
+
+ Note: Names which are not marked as being a MIME name should not be used in
+ Internet protocols for information interchange (mail, news, etc.).
+
+ Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
+ must understand both names and treat them as equivalent.
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _LOCALCHARSET_H */
diff --git a/gl/locale.in.h b/gl/locale.in.h
new file mode 100644
index 0000000..538b834
--- /dev/null
+++ b/gl/locale.in.h
@@ -0,0 +1,305 @@
+/* A POSIX <locale.h>.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
+ || defined _GL_ALREADY_INCLUDING_LOCALE_H
+
+/* Special invocation convention:
+ - Inside mingw header files,
+ - To handle Solaris header files (through Solaris 10) when combined
+ with gettext's libintl.h. */
+
+#@INCLUDE_NEXT@ @NEXT_LOCALE_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_LOCALE_H
+
+#define _GL_ALREADY_INCLUDING_LOCALE_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_LOCALE_H@
+
+#undef _GL_ALREADY_INCLUDING_LOCALE_H
+
+#ifndef _@GUARD_PREFIX@_LOCALE_H
+#define _@GUARD_PREFIX@_LOCALE_H
+
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
+
+/* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */
+#if @HAVE_XLOCALE_H@
+# include <xlocale.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* The LC_MESSAGES locale category is specified in POSIX, but not in ISO C.
+ On systems that don't define it, use the same value as GNU libintl. */
+#if !defined LC_MESSAGES
+# define LC_MESSAGES 1729
+#endif
+
+/* On native Windows with MSVC, 'struct lconv' lacks the members int_p_* and
+ int_n_*. Instead of overriding 'struct lconv', merely define these member
+ names as macros. This avoids trouble in C++ mode. */
+#if defined _MSC_VER
+# define int_p_cs_precedes p_cs_precedes
+# define int_p_sign_posn p_sign_posn
+# define int_p_sep_by_space p_sep_by_space
+# define int_n_cs_precedes n_cs_precedes
+# define int_n_sign_posn n_sign_posn
+# define int_n_sep_by_space n_sep_by_space
+#endif
+
+/* Bionic libc's 'struct lconv' is just a dummy. */
+#if @REPLACE_STRUCT_LCONV@
+# define lconv rpl_lconv
+struct lconv
+{
+ /* All 'char *' are actually 'const char *'. */
+
+ /* Members that depend on the LC_NUMERIC category of the locale. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
+
+ /* Symbol used as decimal point. */
+ char *decimal_point;
+ /* Symbol used to separate groups of digits to the left of the decimal
+ point. */
+ char *thousands_sep;
+ /* Definition of the size of groups of digits to the left of the decimal
+ point. */
+ char *grouping;
+
+ /* Members that depend on the LC_MONETARY category of the locale. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
+
+ /* Symbol used as decimal point. */
+ char *mon_decimal_point;
+ /* Symbol used to separate groups of digits to the left of the decimal
+ point. */
+ char *mon_thousands_sep;
+ /* Definition of the size of groups of digits to the left of the decimal
+ point. */
+ char *mon_grouping;
+ /* Sign used to indicate a value >= 0. */
+ char *positive_sign;
+ /* Sign used to indicate a value < 0. */
+ char *negative_sign;
+
+ /* For formatting local currency. */
+ /* Currency symbol (3 characters) followed by separator (1 character). */
+ char *currency_symbol;
+ /* Number of digits after the decimal point. */
+ char frac_digits;
+ /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char p_cs_precedes;
+ /* For values >= 0: Position of the sign. */
+ char p_sign_posn;
+ /* For values >= 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char p_sep_by_space;
+ /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char n_cs_precedes;
+ /* For values < 0: Position of the sign. */
+ char n_sign_posn;
+ /* For values < 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char n_sep_by_space;
+
+ /* For formatting international currency. */
+ /* Currency symbol (3 characters) followed by separator (1 character). */
+ char *int_curr_symbol;
+ /* Number of digits after the decimal point. */
+ char int_frac_digits;
+ /* For values >= 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char int_p_cs_precedes;
+ /* For values >= 0: Position of the sign. */
+ char int_p_sign_posn;
+ /* For values >= 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char int_p_sep_by_space;
+ /* For values < 0: 1 if the currency symbol precedes the number, 0 if it
+ comes after the number. */
+ char int_n_cs_precedes;
+ /* For values < 0: Position of the sign. */
+ char int_n_sign_posn;
+ /* For values < 0: Placement of spaces between currency symbol, sign, and
+ number. */
+ char int_n_sep_by_space;
+};
+#endif
+
+#if @GNULIB_LOCALECONV@
+# if @REPLACE_LOCALECONV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef localeconv
+# define localeconv rpl_localeconv
+# endif
+_GL_FUNCDECL_RPL (localeconv, struct lconv *, (void));
+_GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
+# else
+_GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (localeconv);
+# endif
+#elif @REPLACE_STRUCT_LCONV@
+# undef localeconv
+# define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
+#elif defined GNULIB_POSIXCHECK
+# undef localeconv
+# if HAVE_RAW_DECL_LOCALECONV
+_GL_WARN_ON_USE (localeconv,
+ "localeconv returns too few information on some platforms - "
+ "use gnulib module localeconv for portability");
+# endif
+#endif
+
+#if @GNULIB_SETLOCALE@
+# if @REPLACE_SETLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setlocale
+# define setlocale rpl_setlocale
+# define GNULIB_defined_setlocale 1
+# endif
+_GL_FUNCDECL_RPL (setlocale, char *, (int category, const char *locale));
+_GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
+# else
+_GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (setlocale);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef setlocale
+# if HAVE_RAW_DECL_SETLOCALE
+_GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
+ "use gnulib module setlocale for portability");
+# endif
+#endif
+
+#if @GNULIB_SETLOCALE_NULL@
+/* Included here for convenience. */
+# include "setlocale_null.h"
+#endif
+
+#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_NEWLOCALE@)
+# if @REPLACE_NEWLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef newlocale
+# define newlocale rpl_newlocale
+# define GNULIB_defined_newlocale 1
+# endif
+_GL_FUNCDECL_RPL (newlocale, locale_t,
+ (int category_mask, const char *name, locale_t base)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (newlocale, locale_t,
+ (int category_mask, const char *name, locale_t base));
+# else
+# if @HAVE_NEWLOCALE@
+_GL_CXXALIAS_SYS (newlocale, locale_t,
+ (int category_mask, const char *name, locale_t base));
+# endif
+# endif
+# if @HAVE_NEWLOCALE@
+_GL_CXXALIASWARN (newlocale);
+# endif
+# if @HAVE_NEWLOCALE@ || @REPLACE_NEWLOCALE@
+# ifndef HAVE_WORKING_NEWLOCALE
+# define HAVE_WORKING_NEWLOCALE 1
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef newlocale
+# if HAVE_RAW_DECL_NEWLOCALE
+_GL_WARN_ON_USE (newlocale, "newlocale is not portable");
+# endif
+#endif
+
+#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
+# if @REPLACE_DUPLOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef duplocale
+# define duplocale rpl_duplocale
+# define GNULIB_defined_duplocale 1
+# endif
+_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
+# else
+# if @HAVE_DUPLOCALE@
+_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
+# endif
+# endif
+# if @HAVE_DUPLOCALE@
+_GL_CXXALIASWARN (duplocale);
+# endif
+# if @HAVE_DUPLOCALE@ || @REPLACE_DUPLOCALE@
+# ifndef HAVE_WORKING_DUPLOCALE
+# define HAVE_WORKING_DUPLOCALE 1
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef duplocale
+# if HAVE_RAW_DECL_DUPLOCALE
+_GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
+ "use gnulib module duplocale for portability");
+# endif
+#endif
+
+#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_FREELOCALE@)
+# if @REPLACE_FREELOCALE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef freelocale
+# define freelocale rpl_freelocale
+# define GNULIB_defined_freelocale 1
+# endif
+_GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
+# else
+# if @HAVE_FREELOCALE@
+/* Need to cast, because on FreeBSD and Mac OS X 10.13, the return type is
+ int. */
+_GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
+# endif
+# endif
+# if @HAVE_FREELOCALE@
+_GL_CXXALIASWARN (freelocale);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef freelocale
+# if HAVE_RAW_DECL_FREELOCALE
+_GL_WARN_ON_USE (freelocale, "freelocale is not portable");
+# endif
+#endif
+
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */
diff --git a/gl/localeconv.c b/gl/localeconv.c
new file mode 100644
index 0000000..60c050f
--- /dev/null
+++ b/gl/localeconv.c
@@ -0,0 +1,103 @@
+/* Query locale dependent information for formatting numbers.
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <locale.h>
+
+#if HAVE_STRUCT_LCONV_DECIMAL_POINT
+
+/* Override for platforms where 'struct lconv' lacks the int_p_*, int_n_*
+ members. */
+
+struct lconv *
+localeconv (void)
+{
+ static struct lconv result;
+# undef lconv
+# undef localeconv
+ struct lconv *sys_result = localeconv ();
+
+ result.decimal_point = sys_result->decimal_point;
+ result.thousands_sep = sys_result->thousands_sep;
+ result.grouping = sys_result->grouping;
+ result.mon_decimal_point = sys_result->mon_decimal_point;
+ result.mon_thousands_sep = sys_result->mon_thousands_sep;
+ result.mon_grouping = sys_result->mon_grouping;
+ result.positive_sign = sys_result->positive_sign;
+ result.negative_sign = sys_result->negative_sign;
+ result.currency_symbol = sys_result->currency_symbol;
+ result.frac_digits = sys_result->frac_digits;
+ result.p_cs_precedes = sys_result->p_cs_precedes;
+ result.p_sign_posn = sys_result->p_sign_posn;
+ result.p_sep_by_space = sys_result->p_sep_by_space;
+ result.n_cs_precedes = sys_result->n_cs_precedes;
+ result.n_sign_posn = sys_result->n_sign_posn;
+ result.n_sep_by_space = sys_result->n_sep_by_space;
+ result.int_curr_symbol = sys_result->int_curr_symbol;
+ result.int_frac_digits = sys_result->int_frac_digits;
+ result.int_p_cs_precedes = sys_result->p_cs_precedes;
+ result.int_p_sign_posn = sys_result->p_sign_posn;
+ result.int_p_sep_by_space = sys_result->p_sep_by_space;
+ result.int_n_cs_precedes = sys_result->n_cs_precedes;
+ result.int_n_sign_posn = sys_result->n_sign_posn;
+ result.int_n_sep_by_space = sys_result->n_sep_by_space;
+
+ return &result;
+}
+
+#else
+
+/* Override for platforms where 'struct lconv' is a dummy. */
+
+# include <limits.h>
+
+struct lconv *
+localeconv (void)
+{
+ static /*const*/ struct lconv result =
+ {
+ /* decimal_point */ ".",
+ /* thousands_sep */ "",
+ /* grouping */ "",
+ /* mon_decimal_point */ "",
+ /* mon_thousands_sep */ "",
+ /* mon_grouping */ "",
+ /* positive_sign */ "",
+ /* negative_sign */ "",
+ /* currency_symbol */ "",
+ /* frac_digits */ CHAR_MAX,
+ /* p_cs_precedes */ CHAR_MAX,
+ /* p_sign_posn */ CHAR_MAX,
+ /* p_sep_by_space */ CHAR_MAX,
+ /* n_cs_precedes */ CHAR_MAX,
+ /* n_sign_posn */ CHAR_MAX,
+ /* n_sep_by_space */ CHAR_MAX,
+ /* int_curr_symbol */ "",
+ /* int_frac_digits */ CHAR_MAX,
+ /* int_p_cs_precedes */ CHAR_MAX,
+ /* int_p_sign_posn */ CHAR_MAX,
+ /* int_p_sep_by_space */ CHAR_MAX,
+ /* int_n_cs_precedes */ CHAR_MAX,
+ /* int_n_sign_posn */ CHAR_MAX,
+ /* int_n_sep_by_space */ CHAR_MAX
+ };
+
+ return &result;
+}
+
+#endif
diff --git a/gl/lseek.c b/gl/lseek.c
new file mode 100644
index 0000000..7919b03
--- /dev/null
+++ b/gl/lseek.c
@@ -0,0 +1,89 @@
+/* An lseek() function that detects pipes.
+ Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Windows platforms. */
+/* Get GetFileType. */
+# include <windows.h>
+/* Get _get_osfhandle. */
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+#else
+# include <sys/stat.h>
+#endif
+#include <errno.h>
+
+#undef lseek
+
+off_t
+rpl_lseek (int fd, off_t offset, int whence)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+ /* mingw lseek mistakenly succeeds on pipes, sockets, and terminals. */
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ if (GetFileType (h) != FILE_TYPE_DISK)
+ {
+ errno = ESPIPE;
+ return -1;
+ }
+#elif defined __APPLE__ && defined __MACH__ && defined SEEK_DATA
+ if (whence == SEEK_DATA)
+ {
+ /* If OFFSET points to data, macOS lseek+SEEK_DATA returns the
+ start S of the first data region that begins *after* OFFSET,
+ where the region from OFFSET to S consists of possibly-empty
+ data followed by a possibly-empty hole. To work around this
+ portability glitch, check whether OFFSET is within data by
+ using lseek+SEEK_HOLE, and if so return to OFFSET by using
+ lseek+SEEK_SET. Also, contrary to the macOS documentation,
+ lseek+SEEK_HOLE can fail with ENXIO if there are no holes on
+ or after OFFSET. What a mess! */
+ off_t next_hole = lseek (fd, offset, SEEK_HOLE);
+ if (next_hole < 0)
+ return errno == ENXIO ? offset : next_hole;
+ if (next_hole != offset)
+ whence = SEEK_SET;
+ }
+#else
+ /* BeOS lseek mistakenly succeeds on pipes... */
+ struct stat statbuf;
+ if (fstat (fd, &statbuf) < 0)
+ return -1;
+ if (!S_ISREG (statbuf.st_mode))
+ {
+ errno = ESPIPE;
+ return -1;
+ }
+#endif
+#if _GL_WINDOWS_64_BIT_OFF_T || (defined __MINGW32__ && defined _FILE_OFFSET_BITS && (_FILE_OFFSET_BITS == 64))
+ return _lseeki64 (fd, offset, whence);
+#else
+ return lseek (fd, offset, whence);
+#endif
+}
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
new file mode 100644
index 0000000..7fe03e0
--- /dev/null
+++ b/gl/m4/00gnulib.m4
@@ -0,0 +1,85 @@
+# 00gnulib.m4 serial 8
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This file must be named something that sorts before all other
+dnl gnulib-provided .m4 files. It is needed until the clang fix has
+dnl been included in Autoconf.
+
+# The following definitions arrange to use a compiler option
+# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the
+# compiler is clang. Without it, clang implicitly declares "known"
+# library functions in C mode, but not in C++ mode, which would cause
+# Gnulib to omit a declaration and thus later produce an error in C++
+# mode. As of clang 9.0, these "known" functions are identified through
+# LIBBUILTIN invocations in the LLVM source file
+# llvm/tools/clang/include/clang/Basic/Builtins.def.
+# It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL,
+# because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed
+# to AC_REQUIRE anything: some configure.ac files have their first
+# AC_CHECK_DECL executed conditionally. Therefore append the extra tests
+# to AC_PROG_CC.
+AC_DEFUN([gl_COMPILER_CLANG],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether the compiler is clang],
+ [gl_cv_compiler_clang],
+ [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
+ dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
+ dnl not yet been invoked.
+ _AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef __clang__
+ barfbarf
+ #endif
+ ]],[[]])
+ ],
+ [gl_cv_compiler_clang=no],
+ [gl_cv_compiler_clang=yes])
+ ])
+])
+AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+dnl AC_REQUIRE([gl_COMPILER_CLANG])
+ AC_CACHE_CHECK([for compiler option needed when checking for declarations],
+ [gl_cv_compiler_check_decl_option],
+ [if test $gl_cv_compiler_clang = yes; then
+ dnl Test whether the compiler supports the option
+ dnl '-Werror=implicit-function-declaration'.
+ save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile -Werror=implicit-function-declaration"
+ dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
+ dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+ [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
+ [gl_cv_compiler_check_decl_option=none])
+ ac_compile="$save_ac_compile"
+ else
+ gl_cv_compiler_check_decl_option=none
+ fi
+ ])
+ if test "x$gl_cv_compiler_check_decl_option" != xnone; then
+ ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
+ else
+ ac_compile_for_check_decl="$ac_compile"
+ fi
+])
+dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
+dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
+dnl in zzgnulib.m4 is inactive, use the original ac_compile.
+m4_define([_AC_CHECK_DECL_BODY],
+[ ac_save_ac_compile="$ac_compile"
+ if test -n "$ac_compile_for_check_decl"; then
+ ac_compile="$ac_compile_for_check_decl"
+ fi]
+m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
+])
+
+# gl_00GNULIB
+# -----------
+# Witness macro that this file has been included. Needed to force
+# Automake to include this file prior to all other gnulib .m4 files.
+AC_DEFUN([gl_00GNULIB])
diff --git a/gl/m4/__inline.m4 b/gl/m4/__inline.m4
new file mode 100644
index 0000000..acf8668
--- /dev/null
+++ b/gl/m4/__inline.m4
@@ -0,0 +1,22 @@
+# Test for __inline keyword
+dnl Copyright 2017-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl___INLINE],
+[
+ AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
+ [gl_cv_c___inline],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[typedef int foo_t;
+ static __inline foo_t foo (void) { return 0; }]],
+ [[return foo ();]])],
+ [gl_cv_c___inline=yes],
+ [gl_cv_c___inline=no])])
+ if test $gl_cv_c___inline = yes; then
+ AC_DEFINE([HAVE___INLINE], [1],
+ [Define to 1 if the compiler supports the keyword '__inline'.])
+ fi
+])
diff --git a/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4
new file mode 100644
index 0000000..e794764
--- /dev/null
+++ b/gl/m4/absolute-header.m4
@@ -0,0 +1,100 @@
+# absolute-header.m4 serial 17
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price.
+
+# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
+# ---------------------------------------
+# Find the absolute name of a header file, testing first if the header exists.
+# If the header were sys/inttypes.h, this macro would define
+# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h
+# in config.h
+# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
+# Note: This macro assumes that the header file is not empty after
+# preprocessing, i.e. it does not only define preprocessor macros but also
+# provides some type/enum definitions or function/variable declarations.
+AC_DEFUN([gl_ABSOLUTE_HEADER],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_PREPROC_REQUIRE()dnl
+m4_foreach_w([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_absolute_header],
+ [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
+ AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+ [gl_absolute_header],
+ [AS_VAR_PUSHDEF([ac_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
+ AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
+ if test AS_VAR_GET([ac_header_exists]) = yes; then
+ gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
+ fi
+ AS_VAR_POPDEF([ac_header_exists])dnl
+ ])dnl
+ AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
+ ["AS_VAR_GET([gl_absolute_header])"],
+ [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
+ AS_VAR_POPDEF([gl_absolute_header])dnl
+])dnl
+])# gl_ABSOLUTE_HEADER
+
+# gl_ABSOLUTE_HEADER_ONE(HEADER)
+# ------------------------------
+# Like gl_ABSOLUTE_HEADER, except that:
+# - it assumes that the header exists,
+# - it uses the current CPPFLAGS,
+# - it does not cache the result,
+# - it is silent.
+AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])])
+ dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
+ dnl that contain only a #include of other header files and no
+ dnl non-comment tokens of their own. This leads to a failure to
+ dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
+ dnl and others. The workaround is to force preservation of comments
+ dnl through option -C. This ensures all necessary #line directives
+ dnl are present. GCC supports option -C as well.
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+changequote(,)
+ case "$host_os" in
+ mingw*)
+ dnl For the sake of native Windows compilers (excluding gcc),
+ dnl treat backslash as a directory separator, like /.
+ dnl Actually, these compilers use a double-backslash as
+ dnl directory separator, inside the
+ dnl # line "filename"
+ dnl directives.
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ dnl A sed expression that turns a string into a basic regular
+ dnl expression, for use within "/.../".
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+ gl_header_literal_regex=`echo '$1' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+ s|^/[^/]|//&|
+ p
+ q
+ }'
+changequote([,])
+ dnl eval is necessary to expand gl_absname_cpp.
+ dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+ dnl so use subshell.
+ AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]),
+[`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ sed -n "$gl_absolute_header_sed"`])
+])
diff --git a/gl/m4/af_alg.m4 b/gl/m4/af_alg.m4
new file mode 100644
index 0000000..f4c0d62
--- /dev/null
+++ b/gl/m4/af_alg.m4
@@ -0,0 +1,57 @@
+# af_alg.m4 serial 6
+dnl Copyright 2018-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Matteo Croce.
+
+AC_DEFUN_ONCE([gl_AF_ALG],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H])
+ AC_REQUIRE([AC_C_INLINE])
+
+ dnl Check whether linux/if_alg.h has needed features.
+ AC_CACHE_CHECK([whether linux/if_alg.h has struct sockaddr_alg.],
+ [gl_cv_header_linux_if_alg_salg],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/socket.h>
+ #include <linux/if_alg.h>
+ struct sockaddr_alg salg = {
+ .salg_family = AF_ALG,
+ .salg_type = "hash",
+ .salg_name = "sha1",
+ };]])],
+ [gl_cv_header_linux_if_alg_salg=yes],
+ [gl_cv_header_linux_if_alg_salg=no])])
+ if test "$gl_cv_header_linux_if_alg_salg" = yes; then
+ AC_DEFINE([HAVE_LINUX_IF_ALG_H], [1],
+ [Define to 1 if you have 'struct sockaddr_alg' defined.])
+ fi
+
+ dnl The default is to not use AF_ALG if available,
+ dnl as it's system dependent as to whether the kernel
+ dnl routines are faster than libcrypto for example.
+ use_af_alg=no
+ AC_ARG_WITH([linux-crypto],
+ [AS_HELP_STRING([[--with-linux-crypto]],
+ [use Linux kernel cryptographic API (if available) for the hash functions
+ MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 on files])],
+ [use_af_alg=$withval],
+ [use_af_alg=no])
+ dnl We cannot use it if it is not available.
+ if test "$gl_cv_header_linux_if_alg_salg" != yes; then
+ if test "$use_af_alg" != no; then
+ AC_MSG_WARN([Linux kernel cryptographic API not found])
+ fi
+ use_af_alg=no
+ fi
+
+ if test "$use_af_alg" != no; then
+ USE_AF_ALG=1
+ else
+ USE_AF_ALG=0
+ fi
+ AC_DEFINE_UNQUOTED([USE_LINUX_CRYPTO_API], [$USE_AF_ALG],
+ [Define to 1 if you want to use the Linux kernel cryptographic API.])
+])
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
new file mode 100644
index 0000000..c685fac
--- /dev/null
+++ b/gl/m4/alloca.m4
@@ -0,0 +1,106 @@
+# alloca.m4 serial 21
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ALLOCA],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ if test $ac_cv_func_alloca_works = no; then
+ gl_PREREQ_ALLOCA
+ fi
+
+ # Define an additional variable used in the Makefile substitution.
+ if test $ac_cv_working_alloca_h = yes; then
+ AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
+ AC_EGREP_CPP([Need own alloca], [
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+ Need own alloca
+#endif
+ ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
+ ])
+ if test $gl_cv_rpl_alloca = yes; then
+ dnl OK, alloca can be implemented through a compiler built-in.
+ AC_DEFINE([HAVE_ALLOCA], [1],
+ [Define to 1 if you have 'alloca' after including <alloca.h>,
+ a header that may be supplied by this distribution.])
+ GL_GENERATE_ALLOCA_H=true
+ else
+ dnl alloca exists as a library function, i.e. it is slow and probably
+ dnl a memory leak. Don't define HAVE_ALLOCA in this case.
+ GL_GENERATE_ALLOCA_H=false
+ fi
+ else
+ GL_GENERATE_ALLOCA_H=true
+ fi
+
+ if test $ac_cv_working_alloca_h = yes; then
+ HAVE_ALLOCA_H=1
+ else
+ HAVE_ALLOCA_H=0
+ fi
+ AC_SUBST([HAVE_ALLOCA_H])
+])
+
+# Prerequisites of lib/alloca.c.
+# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
+AC_DEFUN([gl_PREREQ_ALLOCA], [:])
+
+m4_version_prereq([2.70], [], [
+
+# This works around a bug in autoconf <= 2.68 and has simplifications
+# from 2.70. See:
+# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a
+
+# _AC_LIBOBJ_ALLOCA
+# -----------------
+# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly
+# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
+# Nevertheless, for Automake, AC_LIBSOURCES it.
+m4_define([_AC_LIBOBJ_ALLOCA],
+[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+AC_LIBSOURCES(alloca.c)
+AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
+AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
+
+AC_CACHE_CHECK([stack direction for C alloca],
+ [ac_cv_c_stack_direction],
+[AC_RUN_IFELSE([AC_LANG_SOURCE(
+[AC_INCLUDES_DEFAULT
+int
+find_stack_direction (int *addr, int depth)
+{
+ int dir, dummy = 0;
+ if (! addr)
+ addr = &dummy;
+ *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+ dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+ return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+ return find_stack_direction (0, argc + !argv + 20) < 0;
+}])],
+ [ac_cv_c_stack_direction=1],
+ [ac_cv_c_stack_direction=-1],
+ [ac_cv_c_stack_direction=0])])
+AH_VERBATIM([STACK_DIRECTION],
+[/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION])dnl
+AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
+])# _AC_LIBOBJ_ALLOCA
+])
diff --git a/gl/m4/arpa_inet_h.m4 b/gl/m4/arpa_inet_h.m4
new file mode 100644
index 0000000..fa5fe83
--- /dev/null
+++ b/gl/m4/arpa_inet_h.m4
@@ -0,0 +1,74 @@
+# arpa_inet_h.m4 serial 17
+dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Simon Josefsson and Bruno Haible
+
+AC_DEFUN_ONCE([gl_ARPA_INET_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
+ AC_CHECK_HEADERS_ONCE([arpa/inet.h])
+ if test $ac_cv_header_arpa_inet_h = yes; then
+ HAVE_ARPA_INET_H=1
+ else
+ HAVE_ARPA_INET_H=0
+ fi
+ AC_SUBST([HAVE_ARPA_INET_H])
+ dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([arpa/inet.h])
+
+ AC_REQUIRE([gl_FEATURES_H])
+
+ gl_PREREQ_SYS_H_WS2TCPIP
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+/* On some systems, this header is not self-consistent. */
+#if !(defined __GLIBC__ || defined __UCLIBC__)
+# include <sys/socket.h>
+#endif
+#ifdef __TANDEM
+# include <netdb.h>
+#endif
+#include <arpa/inet.h>
+ ]], [inet_ntop inet_pton])
+])
+
+# gl_ARPA_INET_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_ARPA_INET_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_ARPA_INET_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_ARPA_INET_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_INET_NTOP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_INET_PTON])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_ARPA_INET_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
+ HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
+ REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP])
+ REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON])
+])
diff --git a/gl/m4/assert_h.m4 b/gl/m4/assert_h.m4
new file mode 100644
index 0000000..abba4fa
--- /dev/null
+++ b/gl/m4/assert_h.m4
@@ -0,0 +1,67 @@
+# assert-h.m4
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_DEFUN([gl_ASSERT_H],
+[
+ AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
+ [gl_save_CFLAGS=$CFLAGS
+ for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do
+ AS_CASE([$gl_working],
+ [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"])
+
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if defined __clang__ && __STDC_VERSION__ < 202311
+ #pragma clang diagnostic error "-Wc2x-extensions"
+ #pragma clang diagnostic error "-Wc++17-extensions"
+ #endif
+ #ifdef INCLUDE_ASSERT_H
+ #include <assert.h>
+ #endif
+ static_assert (2 + 2 == 4, "arithmetic does not work");
+ static_assert (2 + 2 == 4);
+ ]],
+ [[
+ static_assert (sizeof (char) == 1, "sizeof does not work");
+ static_assert (sizeof (char) == 1);
+ ]])],
+ [gl_cv_static_assert=$gl_working],
+ [gl_cv_static_assert=no])
+ CFLAGS=$gl_save_CFLAGS
+ test "$gl_cv_static_assert" != no && break
+ done])
+
+ GL_GENERATE_ASSERT_H=false
+ AS_CASE([$gl_cv_static_assert],
+ [yes*keyword*],
+ [AC_DEFINE([HAVE_C_STATIC_ASSERT], [1],
+ [Define to 1 if the static_assert keyword works.])],
+ [no],
+ [GL_GENERATE_ASSERT_H=true
+ gl_NEXT_HEADERS([assert.h])])
+
+ dnl The "zz" puts this toward config.h's end, to avoid potential
+ dnl collisions with other definitions. #undef assert so that
+ dnl programs are not tempted to use it without specifically
+ dnl including assert.h. Break the #undef apart with a comment
+ dnl so that 'configure' does not comment it out.
+ AH_VERBATIM([zzstatic_assert],
+[#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \
+ && (!defined __cplusplus \
+ || (__cpp_static_assert < 201411 \
+ && __GNUG__ < 6 && __clang_major__ < 6)))
+ #include <assert.h>
+ #undef/**/assert
+ /* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments.
+ We need it also to be invocable with a single argument. */
+ #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus
+ #undef/**/static_assert
+ #define static_assert _Static_assert
+ #endif
+#endif])
+])
diff --git a/gl/m4/base64.m4 b/gl/m4/base64.m4
new file mode 100644
index 0000000..987930a
--- /dev/null
+++ b/gl/m4/base64.m4
@@ -0,0 +1,15 @@
+# base64.m4 serial 4
+dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_BASE64],
+[
+ gl_PREREQ_BASE64
+])
+
+# Prerequisites of lib/base64.c.
+AC_DEFUN([gl_PREREQ_BASE64], [
+ AC_REQUIRE([AC_C_RESTRICT])
+])
diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4
new file mode 100644
index 0000000..77218a7
--- /dev/null
+++ b/gl/m4/btowc.m4
@@ -0,0 +1,105 @@
+# btowc.m4 serial 12
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_BTOWC],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
+ dnl program below may lead to an endless loop. See
+ dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
+ AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+
+ AC_CHECK_FUNCS_ONCE([btowc])
+ if test $ac_cv_func_btowc = no; then
+ HAVE_BTOWC=0
+ else
+
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Cygwin 1.7.2 btowc('\0') is WEOF, not 0.
+ AC_CACHE_CHECK([whether btowc(0) is correct],
+ [gl_cv_func_btowc_nul],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <wchar.h>
+int main ()
+{
+ if (btowc ('\0') != 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_btowc_nul=yes],
+ [gl_cv_func_btowc_nul=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Cygwin.
+ cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_nul="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ ])
+
+ dnl IRIX 6.5 btowc(EOF) is 0xFF, not WEOF.
+ AC_CACHE_CHECK([whether btowc(EOF) is correct],
+ [gl_cv_func_btowc_eof],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on IRIX.
+ irix*) gl_cv_func_btowc_eof="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_eof="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdio.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ if (btowc (EOF) != WEOF)
+ return 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_btowc_eof=yes],
+ [gl_cv_func_btowc_eof=no],
+ [:])
+ fi
+ ])
+
+ case "$gl_cv_func_btowc_nul" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ case "$gl_cv_func_btowc_eof" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/btowc.c.
+AC_DEFUN([gl_PREREQ_BTOWC], [
+ :
+])
diff --git a/gl/m4/builtin-expect.m4 b/gl/m4/builtin-expect.m4
new file mode 100644
index 0000000..531ed48
--- /dev/null
+++ b/gl/m4/builtin-expect.m4
@@ -0,0 +1,49 @@
+dnl Check for __builtin_expect.
+
+dnl Copyright 2016-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl___BUILTIN_EXPECT],
+[
+ AC_CACHE_CHECK([for __builtin_expect],
+ [gl_cv___builtin_expect],
+ [AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+ int
+ main (int argc, char **argv)
+ {
+ argc = __builtin_expect (argc, 100);
+ return argv[argc != 100][0];
+ }]])],
+ [gl_cv___builtin_expect=yes],
+ [AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <builtins.h>
+ int
+ main (int argc, char **argv)
+ {
+ argc = __builtin_expect (argc, 100);
+ return argv[argc != 100][0];
+ }]])],
+ [gl_cv___builtin_expect="in <builtins.h>"],
+ [gl_cv___builtin_expect=no])])])
+ if test "$gl_cv___builtin_expect" = yes; then
+ AC_DEFINE([HAVE___BUILTIN_EXPECT], [1])
+ elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
+ AC_DEFINE([HAVE___BUILTIN_EXPECT], [2])
+ fi
+ AH_VERBATIM([HAVE___BUILTIN_EXPECT],
+ [/* Define to 1 if the compiler supports __builtin_expect,
+ and to 2 if <builtins.h> does. */
+#undef HAVE___BUILTIN_EXPECT
+#ifndef HAVE___BUILTIN_EXPECT
+# define __builtin_expect(e, c) (e)
+#elif HAVE___BUILTIN_EXPECT == 2
+# include <builtins.h>
+#endif
+ ])
+])
diff --git a/gl/m4/byteswap.m4 b/gl/m4/byteswap.m4
new file mode 100644
index 0000000..8058d17
--- /dev/null
+++ b/gl/m4/byteswap.m4
@@ -0,0 +1,17 @@
+# byteswap.m4 serial 5
+dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Oskar Liljeblad.
+
+AC_DEFUN([gl_BYTESWAP],
+[
+ dnl Prerequisites of lib/byteswap.in.h.
+ AC_CHECK_HEADERS([byteswap.h], [
+ GL_GENERATE_BYTESWAP_H=false
+ ], [
+ GL_GENERATE_BYTESWAP_H=true
+ ])
+])
diff --git a/gl/m4/c-bool.m4 b/gl/m4/c-bool.m4
new file mode 100644
index 0000000..f614371
--- /dev/null
+++ b/gl/m4/c-bool.m4
@@ -0,0 +1,51 @@
+# Check for bool that conforms to C2023.
+
+dnl Copyright 2022-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_C_BOOL],
+[
+ AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+ #if true == false
+ #error "true == false"
+ #endif
+ extern bool b;
+ bool b = true == false;]])],
+ [gl_cv_c_bool=yes],
+ [gl_cv_c_bool=no])])
+ if test "$gl_cv_c_bool" = yes; then
+ AC_DEFINE([HAVE_C_BOOL], [1],
+ [Define to 1 if bool, true and false work as per C2023.])
+ fi
+
+ AC_CHECK_HEADERS_ONCE([stdbool.h])
+
+ dnl The "zz" puts this toward config.h's end, to avoid potential
+ dnl collisions with other definitions.
+ dnl If 'bool', 'true' and 'false' do not work, arrange for them to work.
+ dnl In C, this means including <stdbool.h> if it is not already included.
+ dnl However, if the preprocessor mistakenly treats 'true' as 0,
+ dnl define it to a bool expression equal to 1; this is needed in
+ dnl Sun C++ 5.11 (Oracle Solaris Studio 12.2, 2010) and older.
+ AH_VERBATIM([zzbool],
+[#ifndef HAVE_C_BOOL
+# if !defined __cplusplus && !defined __bool_true_false_are_defined
+# if HAVE_STDBOOL_H
+# include <stdbool.h>
+# else
+# if defined __SUNPRO_C
+# error "<stdbool.h> is not usable with this configuration. To make it usable, add -D_STDC_C99= to $CC."
+# else
+# error "<stdbool.h> does not exist on this platform. Use gnulib module 'stdbool-c99' instead of gnulib module 'stdbool'."
+# endif
+# endif
+# endif
+# if !true
+# define true (!false)
+# endif
+#endif])
+])
diff --git a/gl/m4/calloc.m4 b/gl/m4/calloc.m4
new file mode 100644
index 0000000..23c0dd9
--- /dev/null
+++ b/gl/m4/calloc.m4
@@ -0,0 +1,83 @@
+# calloc.m4 serial 29
+
+# Copyright (C) 2004-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+# Determine whether calloc (N, S) returns non-NULL when N*S is zero,
+# and returns NULL when N*S overflows.
+# If so, define HAVE_CALLOC. Otherwise, define calloc to rpl_calloc
+# and arrange to use a calloc wrapper function that does work in that case.
+
+# _AC_FUNC_CALLOC_IF([IF-WORKS], [IF-NOT])
+# -------------------------------------
+# If calloc is compatible with GNU calloc, run IF-WORKS, otherwise, IF-NOT.
+AC_DEFUN([_AC_FUNC_CALLOC_IF],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether calloc (0, n) and calloc (n, 0) return nonnull],
+ [ac_cv_func_calloc_0_nonnull],
+ [if test $cross_compiling != yes; then
+ ac_cv_func_calloc_0_nonnull=yes
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT],
+ [[int result = 0;
+ char * volatile p = calloc (0, 0);
+ if (!p)
+ result |= 1;
+ free (p);
+ return result;
+ ]])],
+ [],
+ [ac_cv_func_calloc_0_nonnull=no])
+ else
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+ fi
+ ])
+ AS_CASE([$ac_cv_func_calloc_0_nonnull], [*yes], [$1], [$2])
+])
+
+
+# gl_FUNC_CALLOC_GNU
+# ------------------
+# Replace calloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_CALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_CALLOC_POSIX])
+ REPLACE_CALLOC_FOR_CALLOC_GNU="$REPLACE_CALLOC_FOR_CALLOC_POSIX"
+ if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 0; then
+ _AC_FUNC_CALLOC_IF([], [REPLACE_CALLOC_FOR_CALLOC_GNU=1])
+ fi
+])# gl_FUNC_CALLOC_GNU
+
+# gl_FUNC_CALLOC_POSIX
+# --------------------
+# Test whether 'calloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t or size_t overflow),
+# and replace calloc if it is not.
+AC_DEFUN([gl_FUNC_CALLOC_POSIX],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_CALLOC_FOR_CALLOC_POSIX=1
+ fi
+ dnl Although in theory we should also test for size_t overflow,
+ dnl in practice testing for ptrdiff_t overflow suffices
+ dnl since PTRDIFF_MAX <= SIZE_MAX on all known Gnulib porting targets.
+ dnl A separate size_t test would slow down 'configure'.
+])
diff --git a/gl/m4/close.m4 b/gl/m4/close.m4
new file mode 100644
index 0000000..9f95c67
--- /dev/null
+++ b/gl/m4/close.m4
@@ -0,0 +1,35 @@
+# close.m4 serial 9
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_CLOSE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_CLOSE=1
+ fi
+ ])
+ m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
+ gl_PREREQ_SYS_H_WINSOCK2
+ if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+ dnl Even if the 'socket' module is not used here, another part of the
+ dnl application may use it and pass file descriptors that refer to
+ dnl sockets to the close() function. So enable the support for sockets.
+ REPLACE_CLOSE=1
+ fi
+ ])
+ dnl Replace close() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ if test $REPLACE_CLOSE = 0; then
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_CLOSE=1
+ fi
+ fi
+ ])
+])
diff --git a/gl/m4/codeset.m4 b/gl/m4/codeset.m4
new file mode 100644
index 0000000..5804f47
--- /dev/null
+++ b/gl/m4/codeset.m4
@@ -0,0 +1,24 @@
+# codeset.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2023 Free Software
+dnl Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <langinfo.h>]],
+ [[char* cs = nl_langinfo(CODESET); return !cs;]])],
+ [am_cv_langinfo_codeset=yes],
+ [am_cv_langinfo_codeset=no])
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4
new file mode 100644
index 0000000..1776e5e
--- /dev/null
+++ b/gl/m4/double-slash-root.m4
@@ -0,0 +1,38 @@
+# double-slash-root.m4 serial 4 -*- Autoconf -*-
+dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
+ [ if test x"$cross_compiling" = xyes ; then
+ # When cross-compiling, there is no way to tell whether // is special
+ # short of a list of hosts. However, the only known hosts to date
+ # that have a distinct // are Apollo DomainOS (too old to port to),
+ # Cygwin, and z/OS. If anyone knows of another system for which // has
+ # special semantics and is distinct from /, please report it to
+ # <bug-gnulib@gnu.org>.
+ case $host in
+ *-cygwin | i370-ibm-openedition)
+ gl_cv_double_slash_root=yes ;;
+ *)
+ # Be optimistic and assume that / and // are the same when we
+ # don't know.
+ gl_cv_double_slash_root='unknown, assuming no' ;;
+ esac
+ else
+ set x `ls -di / // 2>/dev/null`
+ if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
+ gl_cv_double_slash_root=no
+ else
+ gl_cv_double_slash_root=yes
+ fi
+ fi])
+ if test "$gl_cv_double_slash_root" = yes; then
+ AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
+ [Define to 1 if // is a file system root distinct from /.])
+ fi
+])
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
new file mode 100644
index 0000000..e1cc73e
--- /dev/null
+++ b/gl/m4/dup2.m4
@@ -0,0 +1,105 @@
+#serial 27
+dnl Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_DUP2],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
+ [AC_RUN_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ ]GL_MDA_DEFINES[
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+ ]],
+ [[int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+ result |= 1;
+ #endif
+ if (dup2 (1, 1) != 1)
+ result |= 2;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+ result |= 4;
+ #endif
+ close (0);
+ if (dup2 (0, 0) != -1)
+ result |= 8;
+ /* Many gnulib modules require POSIX conformance of EBADF. */
+ if (dup2 (2, bad_fd) == -1 && errno != EBADF)
+ result |= 16;
+ /* Flush out some cygwin core dumps. */
+ if (dup2 (2, -1) != -1 || errno != EBADF)
+ result |= 32;
+ dup2 (2, 255);
+ dup2 (2, 256);
+ /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
+ {
+ int fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 64;
+ else if (dup2 (fd, fd + 1) == -1)
+ result |= 128;
+ close (fd);
+ }
+ return result;]])
+ ],
+ [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
+ [case "$host_os" in
+ mingw*) # on this platform, dup2 always returns 0 for success
+ gl_cv_func_dup2_works="guessing no" ;;
+ cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+ gl_cv_func_dup2_works="guessing no" ;;
+ aix* | freebsd*)
+ # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
+ # not EBADF.
+ gl_cv_func_dup2_works="guessing no" ;;
+ haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *-android*) # implemented using dup3(), which fails if oldfd == newfd
+ gl_cv_func_dup2_works="guessing no" ;;
+ os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *) gl_cv_func_dup2_works="guessing yes" ;;
+ esac])
+ ])
+ case "$gl_cv_func_dup2_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP2=1
+ AC_CHECK_FUNCS([setdtablesize])
+ ;;
+ esac
+ dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_DUP2=1
+ fi
+ ])
+])
+
+# Prerequisites of lib/dup2.c.
+AC_DEFUN([gl_PREREQ_DUP2], [])
diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4
new file mode 100644
index 0000000..cb3e08f
--- /dev/null
+++ b/gl/m4/eealloc.m4
@@ -0,0 +1,31 @@
+# eealloc.m4 serial 3
+dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_EEALLOC],
+[
+ AC_REQUIRE([gl_EEMALLOC])
+ AC_REQUIRE([gl_EEREALLOC])
+])
+
+AC_DEFUN([gl_EEMALLOC],
+[
+ _AC_FUNC_MALLOC_IF(
+ [gl_cv_func_malloc_0_nonnull=1],
+ [gl_cv_func_malloc_0_nonnull=0])
+ AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull],
+ [If malloc(0) is != NULL, define this to 1. Otherwise define this
+ to 0.])
+])
+
+AC_DEFUN([gl_EEREALLOC],
+[
+ _AC_FUNC_REALLOC_IF(
+ [gl_cv_func_realloc_0_nonnull=1],
+ [gl_cv_func_realloc_0_nonnull=0])
+ AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull],
+ [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this
+ to 0.])
+])
diff --git a/gl/m4/environ.m4 b/gl/m4/environ.m4
new file mode 100644
index 0000000..741dfc5
--- /dev/null
+++ b/gl/m4/environ.m4
@@ -0,0 +1,46 @@
+# environ.m4 serial 8
+dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_ENVIRON],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ dnl Persuade glibc <unistd.h> to declare environ.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ gt_CHECK_VAR_DECL(
+ [#if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
+ #include <stdlib.h>
+ ],
+ [environ])
+ if test $gt_cv_var_environ_declaration != yes; then
+ HAVE_DECL_ENVIRON=0
+ fi
+])
+
+# Check if a variable is properly declared.
+# gt_CHECK_VAR_DECL(includes,variable)
+AC_DEFUN([gt_CHECK_VAR_DECL],
+[
+ define([gt_cv_var], [gt_cv_var_]$2[_declaration])
+ AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[$1
+ typedef struct { int foo; } foo_t;
+ extern foo_t $2;]],
+ [[$2.foo = 1;]])],
+ [gt_cv_var=no],
+ [gt_cv_var=yes])])
+ if test $gt_cv_var = yes; then
+ AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
+ [Define if you have the declaration of $2.])
+ fi
+ undefine([gt_cv_var])
+])
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
new file mode 100644
index 0000000..4c70d22
--- /dev/null
+++ b/gl/m4/errno_h.m4
@@ -0,0 +1,131 @@
+# errno_h.m4 serial 14
+dnl Copyright (C) 2004, 2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_PREREQ([2.61])
+
+AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
+ AC_EGREP_CPP([booboo],[
+#include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
+#if !defined ENOMSG
+booboo
+#endif
+#if !defined EIDRM
+booboo
+#endif
+#if !defined ENOLINK
+booboo
+#endif
+#if !defined EPROTO
+booboo
+#endif
+#if !defined EMULTIHOP
+booboo
+#endif
+#if !defined EBADMSG
+booboo
+#endif
+#if !defined EOVERFLOW
+booboo
+#endif
+#if !defined ENOTSUP
+booboo
+#endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
+#if !defined ESTALE
+booboo
+#endif
+#if !defined EDQUOT
+booboo
+#endif
+#if !defined ECANCELED
+booboo
+#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
+#if !defined EILSEQ
+booboo
+#endif
+ ],
+ [gl_cv_header_errno_h_complete=no],
+ [gl_cv_header_errno_h_complete=yes])
+ ])
+ if test $gl_cv_header_errno_h_complete = yes; then
+ GL_GENERATE_ERRNO_H=false
+ else
+ gl_NEXT_HEADERS([errno.h])
+ GL_GENERATE_ERRNO_H=true
+ fi
+ gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
+ gl_REPLACE_ERRNO_VALUE([ENOLINK])
+ gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
+])
+
+# Assuming $1 = EOVERFLOW.
+# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
+# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
+# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
+# Check for the value of EOVERFLOW.
+# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
+AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
+[
+ if $GL_GENERATE_ERRNO_H; then
+ AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
+ AC_EGREP_CPP([yes],[
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+ ],
+ [gl_cv_header_errno_h_]$1[=yes],
+ [gl_cv_header_errno_h_]$1[=no])
+ if test $gl_cv_header_errno_h_]$1[ = no; then
+ AC_EGREP_CPP([yes],[
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef ]$1[
+yes
+#endif
+ ], [gl_cv_header_errno_h_]$1[=hidden])
+ if test $gl_cv_header_errno_h_]$1[ = hidden; then
+ dnl The macro exists but is hidden.
+ dnl Define it to the same value.
+ AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug. */
+#include <stdio.h>
+#include <stdlib.h>
+])
+ fi
+ fi
+ ])
+ case $gl_cv_header_errno_h_]$1[ in
+ yes | no)
+ ]$1[_HIDDEN=0; ]$1[_VALUE=
+ ;;
+ *)
+ ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
+ ;;
+ esac
+ AC_SUBST($1[_HIDDEN])
+ AC_SUBST($1[_VALUE])
+ fi
+])
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
new file mode 100644
index 0000000..8cc75df
--- /dev/null
+++ b/gl/m4/error.m4
@@ -0,0 +1,31 @@
+#serial 15
+
+# Copyright (C) 1996-1998, 2001-2004, 2009-2023 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_ERROR],
+[
+ dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+ dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
+ AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <error.h>]],
+ [[error_at_line (0, 0, "", 0, "an error occurred");]])],
+ [ac_cv_lib_error_at_line=yes],
+ [ac_cv_lib_error_at_line=no])])
+])
+
+# Prerequisites of lib/error.c.
+AC_DEFUN([gl_PREREQ_ERROR],
+[
+ dnl Use system extensions on Android, so that AC_FUNC_STRERROR_R
+ dnl discovers the GNU API for strerror_r on Android API level 23 and later.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([AC_FUNC_STRERROR_R])
+ :
+])
diff --git a/gl/m4/exponentd.m4 b/gl/m4/exponentd.m4
new file mode 100644
index 0000000..2ef4643
--- /dev/null
+++ b/gl/m4/exponentd.m4
@@ -0,0 +1,116 @@
+# exponentd.m4 serial 3
+dnl Copyright (C) 2007-2008, 2010-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION],
+[
+ AC_CACHE_CHECK([where to find the exponent in a 'double'],
+ [gl_cv_cc_double_expbit0],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (double x)
+{
+ memory_double m;
+ size_t i;
+ /* Clear it first, in case sizeof (double) < sizeof (memory_double). */
+ memset (&m, 0, sizeof (memory_double));
+ m.value = x;
+ for (i = 0; i < NWORDS; i++)
+ {
+ ored_words[i] |= m.word[i];
+ anded_words[i] &= m.word[i];
+ }
+}
+int main ()
+{
+ size_t j;
+ FILE *fp = fopen ("conftest.out", "w");
+ if (fp == NULL)
+ return 1;
+ for (j = 0; j < NWORDS; j++)
+ anded_words[j] = ~ (unsigned int) 0;
+ add_to_ored_words (0.25);
+ add_to_ored_words (0.5);
+ add_to_ored_words (1.0);
+ add_to_ored_words (2.0);
+ add_to_ored_words (4.0);
+ /* Remove bits that are common (e.g. if representation of the first mantissa
+ bit is explicit). */
+ for (j = 0; j < NWORDS; j++)
+ ored_words[j] &= ~anded_words[j];
+ /* Now find the nonzero word. */
+ for (j = 0; j < NWORDS; j++)
+ if (ored_words[j] != 0)
+ break;
+ if (j < NWORDS)
+ {
+ size_t i;
+ for (i = j + 1; i < NWORDS; i++)
+ if (ored_words[i] != 0)
+ {
+ fprintf (fp, "unknown");
+ return (fclose (fp) != 0);
+ }
+ for (i = 0; ; i++)
+ if ((ored_words[j] >> i) & 1)
+ {
+ fprintf (fp, "word %d bit %d", (int) j, (int) i);
+ return (fclose (fp) != 0);
+ }
+ }
+ fprintf (fp, "unknown");
+ return (fclose (fp) != 0);
+}
+ ]])],
+ [gl_cv_cc_double_expbit0=`cat conftest.out`],
+ [gl_cv_cc_double_expbit0="unknown"],
+ [
+ dnl On ARM, there are two 'double' floating-point formats, used by
+ dnl different sets of instructions: The older FPA instructions assume
+ dnl that they are stored in big-endian word order, while the words
+ dnl (like integer types) are stored in little-endian byte order.
+ dnl The newer VFP instructions assume little-endian order
+ dnl consistently.
+ AC_EGREP_CPP([mixed_endianness], [
+#if defined arm || defined __arm || defined __arm__
+ mixed_endianness
+#endif
+ ],
+ [gl_cv_cc_double_expbit0="unknown"],
+ [
+ pushdef([AC_MSG_CHECKING],[:])dnl
+ pushdef([AC_MSG_RESULT],[:])dnl
+ pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl
+ AC_C_BIGENDIAN(
+ [gl_cv_cc_double_expbit0="word 0 bit 20"],
+ [gl_cv_cc_double_expbit0="word 1 bit 20"],
+ [gl_cv_cc_double_expbit0="unknown"])
+ popdef([AC_MSG_RESULT_UNQUOTED])dnl
+ popdef([AC_MSG_RESULT])dnl
+ popdef([AC_MSG_CHECKING])dnl
+ ])
+ ])
+ rm -f conftest.out
+ ])
+ case "$gl_cv_cc_double_expbit0" in
+ word*bit*)
+ word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+ bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+ AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word],
+ [Define as the word index where to find the exponent of 'double'.])
+ AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit],
+ [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.])
+ ;;
+ esac
+])
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
new file mode 100644
index 0000000..5336b8d
--- /dev/null
+++ b/gl/m4/extensions.m4
@@ -0,0 +1,232 @@
+# serial 23 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
+dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
+m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
+ [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# is recent-enough everywhere, but since Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# If autoconf reports a warning
+# warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+# the fix is
+# 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked
+# but always AC_REQUIREd,
+# 2) to ensure that for each occurrence of
+# AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+# or
+# AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+# the corresponding gnulib module description has 'extensions' among
+# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
+# invocation occurs in gl_EARLY, not in gl_INIT.
+
+m4_version_prereq([2.72], [], [
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+# We unconditionally define as many of the known feature-enabling
+# as possible, reserving conditional behavior for macros that are
+# known to cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl
+dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE.
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+dnl The macros below are in alphabetical order ignoring leading _ or __
+dnl prefixes.
+AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
+#ifndef _NETBSD_SOURCE
+# undef _NETBSD_SOURCE
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# undef __STDC_WANT_IEC_60559_BFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# undef __STDC_WANT_IEC_60559_DFP_EXT__
+#endif
+/* Enable extensions specified by C23 Annex F. */
+#ifndef __STDC_WANT_IEC_60559_EXT__
+# undef __STDC_WANT_IEC_60559_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#endif
+/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# undef __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+# undef __STDC_WANT_LIB_EXT2__
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# undef __STDC_WANT_MATH_SPEC_FUNCS__
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
+])dnl
+
+ AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
+ _AC_CHECK_HEADER_ONCE([wchar.h])
+ _AC_CHECK_HEADER_ONCE([minix/config.h])
+
+dnl Defining __EXTENSIONS__ may break the system headers on some systems.
+dnl (FIXME: Which ones?)
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+
+dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to
+dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.
+dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms
+dnl not covered by turn-on-extensions macros (notably Dragonfly, Free,
+dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so
+dnl it should only be defined when necessary.
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ AS_IF([test $ac_cv_header_wchar_h = yes],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [ac_cv_should_define__xopen_source=yes])])])])
+
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_DARWIN_C_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
+ AC_DEFINE([_NETBSD_SOURCE])
+ AC_DEFINE([_OPENBSD_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__])
+ AC_DEFINE([__STDC_WANT_LIB_EXT2__])
+ AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
+ AC_DEFINE([_TANDEM_SOURCE])
+ AS_IF([test $ac_cv_header_minix_config_h = yes],
+ [MINIX=yes
+ AC_DEFINE([_MINIX])
+ AC_DEFINE([_POSIX_SOURCE])
+ AC_DEFINE([_POSIX_1_SOURCE], [2])],
+ [MINIX=])
+ AS_IF([test $ac_cv_safe_to_define___extensions__ = yes],
+ [AC_DEFINE([__EXTENSIONS__])])
+ AS_IF([test $ac_cv_should_define__xopen_source = yes],
+ [AC_DEFINE([_XOPEN_SOURCE], [500])])
+])# AC_USE_SYSTEM_EXTENSIONS
+])
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
+[
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl On OpenBSD 6.8 with GCC, the include files contain a couple of
+ dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE.
+ dnl That's because this version of GCC (4.2.1) supports the option
+ dnl '-std=gnu99' but not the option '-std=gnu11'.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ openbsd*)
+ AC_DEFINE([_ISOC11_SOURCE], [1],
+ [Define to enable the declarations of ISO C 11 types and functions.])
+ ;;
+ esac
+])
diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
new file mode 100644
index 0000000..c001b1c
--- /dev/null
+++ b/gl/m4/extern-inline.m4
@@ -0,0 +1,130 @@
+dnl 'extern inline' a la ISO C99.
+
+dnl Copyright 2012-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_EXTERN_INLINE],
+[
+ AC_CACHE_CHECK([whether ctype.h defines __header_inline],
+ [gl_cv_have___header_inline],
+ [AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE([[#include <ctype.h>
+ #ifndef __header_inline
+ #error "<ctype.h> does not define __header_inline"
+ #endif
+ ]])],
+ [gl_cv_have___header_inline=yes],
+ [gl_cv_have___header_inline=no])])
+ if test "$gl_cv_have___header_inline" = yes; then
+ AC_DEFINE([HAVE___HEADER_INLINE], [1],
+ [Define to 1 if ctype.h defines __header_inline.])
+ fi
+
+ AH_VERBATIM([HAVE___HEADER_INLINE_1],
+[/* Please see the Gnulib manual for how to use these macros.
+
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
+
+ Suppress extern inline with Sun C in standards-conformance mode, as it
+ mishandles inline functions that call each other. E.g., for 'inline void f
+ (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+ 'reference to static identifier "f" in extern inline function'.
+ This bug was observed with Oracle Developer Studio 12.6
+ (Sun C 5.15 SunOS_sparc 2017/05/30).
+
+ Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+ on configurations that mistakenly use 'static inline' to implement
+ functions or macros in standard C headers like <ctype.h>. For example,
+ if isdigit is mistakenly implemented via a static inline function,
+ a program containing an extern inline function that calls isdigit
+ may not work since the C standard prohibits extern inline functions
+ from calling static functions (ISO C 99 section 6.7.4.(3).
+ This bug is known to occur on:
+
+ OS X 10.8 and earlier; see:
+ https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
+
+ DragonFly; see
+ http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
+
+ FreeBSD; see:
+ https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
+
+ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+ for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar.
+
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. It defines a macro
+ __GNUC_STDC_INLINE__ to indicate this situation or a macro
+ __GNUC_GNU_INLINE__ to indicate the opposite situation.
+ GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+ semantics but warns, unless -fgnu89-inline is used:
+ warning: C99 inline functions are not supported; using GNU89
+ warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+ It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
+#if (((defined __APPLE__ && defined __MACH__) \
+ || defined __DragonFly__ || defined __FreeBSD__) \
+ && (defined HAVE___HEADER_INLINE \
+ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+ && ! defined __clang__) \
+ : ((! defined _DONT_USE_CTYPE_INLINE_ \
+ && (defined __GNUC__ || defined __cplusplus)) \
+ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+ && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : (199901L <= __STDC_VERSION__ \
+ && !defined __HP_cc \
+ && !defined __PGI \
+ && !(defined __SUNPRO_C && __STDC__))) \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
+# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+# define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE _GL_UNUSED static
+# define _GL_EXTERN_INLINE _GL_UNUSED static
+#endif
+
+/* In GCC 4.6 (inclusive) to 5.1 (exclusive),
+ suppress bogus "no previous prototype for 'FOO'"
+ and "no previous declaration for 'FOO'" diagnostics,
+ when FOO is an inline function in the header; see
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
+#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+# define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+# define _GL_INLINE_HEADER_CONST_PRAGMA \
+ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+ _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif])
+])
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
new file mode 100644
index 0000000..59d558b
--- /dev/null
+++ b/gl/m4/fcntl-o.m4
@@ -0,0 +1,140 @@
+# fcntl-o.m4 serial 7
+dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_PREREQ([2.60])
+
+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
+AC_DEFUN([gl_FCNTL_O_FLAGS],
+[
+ dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_FUNCS_ONCE([symlink])
+ AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <io.h>
+ # include <stdlib.h>
+ # defined sleep(n) _sleep ((n) * 1000)
+ #endif
+ #include <fcntl.h>
+ ]GL_MDA_DEFINES[
+ #ifndef O_NOATIME
+ #define O_NOATIME 0
+ #endif
+ #ifndef O_NOFOLLOW
+ #define O_NOFOLLOW 0
+ #endif
+ static int const constants[] =
+ {
+ O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+ O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+ };
+ ]],
+ [[
+ int result = !constants;
+ #if HAVE_SYMLINK
+ {
+ static char const sym[] = "conftest.sym";
+ if (symlink ("/dev/null", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ if (unlink (sym) != 0 || symlink (".", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ unlink (sym);
+ }
+ #endif
+ {
+ static char const file[] = "confdefs.h";
+ int fd = open (file, O_RDONLY | O_NOATIME);
+ if (fd < 0)
+ result |= 8;
+ else
+ {
+ struct stat st0;
+ if (fstat (fd, &st0) != 0)
+ result |= 16;
+ else
+ {
+ char c;
+ sleep (1);
+ if (read (fd, &c, 1) != 1)
+ result |= 24;
+ else
+ {
+ if (close (fd) != 0)
+ result |= 32;
+ else
+ {
+ struct stat st1;
+ if (stat (file, &st1) != 0)
+ result |= 40;
+ else
+ if (st0.st_atime != st1.st_atime)
+ result |= 64;
+ }
+ }
+ }
+ }
+ }
+ return result;]])],
+ [gl_cv_header_working_fcntl_h=yes],
+ [case $? in #(
+ 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+ 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+ 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+ *) gl_cv_header_working_fcntl_h='no';;
+ esac],
+ [case "$host_os" in
+ # Guess 'no' on native Windows.
+ mingw*) gl_cv_header_working_fcntl_h='no' ;;
+ *) gl_cv_header_working_fcntl_h=cross-compiling ;;
+ esac
+ ])
+ ])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
+ [Define to 1 if O_NOATIME works.])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
+ [Define to 1 if O_NOFOLLOW works.])
+])
diff --git a/gl/m4/fcntl.m4 b/gl/m4/fcntl.m4
new file mode 100644
index 0000000..524a99a
--- /dev/null
+++ b/gl/m4/fcntl.m4
@@ -0,0 +1,151 @@
+# fcntl.m4 serial 11
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# For now, this module ensures that fcntl()
+# - supports F_DUPFD correctly
+# - supports or emulates F_DUPFD_CLOEXEC
+# - supports F_GETFD
+# Still to be ported to mingw:
+# - F_SETFD
+# - F_GETFL, F_SETFL
+# - F_GETOWN, F_SETOWN
+# - F_GETLK, F_SETLK, F_SETLKW
+AC_DEFUN([gl_FUNC_FCNTL],
+[
+ dnl Persuade glibc to expose F_DUPFD_CLOEXEC.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([fcntl])
+ if test $ac_cv_func_fcntl = no; then
+ gl_REPLACE_FCNTL
+ else
+ dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target
+ dnl haiku alpha 2 F_DUPFD has wrong errno
+ AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
+ [gl_cv_func_fcntl_f_dupfd_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ ]GL_MDA_DEFINES[
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+ ]],
+ [[int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+ if (errno != EINVAL) result |= 2;
+ if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
+ if (errno != EINVAL) result |= 8;
+ /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
+ {
+ int fd;
+ fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 16;
+ else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
+ result |= 32;
+
+ close (fd);
+ }
+ return result;]])],
+ [gl_cv_func_fcntl_f_dupfd_works=yes],
+ [gl_cv_func_fcntl_f_dupfd_works=no],
+ [case $host_os in
+ aix* | cygwin* | haiku*)
+ gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
+ esac])])
+ case $gl_cv_func_fcntl_f_dupfd_works in
+ *yes) ;;
+ *) gl_REPLACE_FCNTL
+ AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD
+ behavior does not match POSIX]) ;;
+ esac
+
+ dnl Many systems lack F_DUPFD_CLOEXEC.
+ dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
+ AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
+ [gl_cv_func_fcntl_f_dupfd_cloexec],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <fcntl.h>
+ #include <unistd.h>
+ int main (int argc, char *argv[])
+ {
+ if (argc == 1)
+ /* parent process */
+ {
+ if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
+ return 1;
+ return execl ("./conftest", "./conftest", "child", NULL);
+ }
+ else
+ /* child process */
+ return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
+ }
+ ]])
+ ],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#ifdef __linux__
+/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
+ it to support the semantics on older kernels that failed with EINVAL. */
+choke me
+#endif
+ ]])],
+ [gl_cv_func_fcntl_f_dupfd_cloexec=yes],
+ [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])
+ ],
+ [gl_cv_func_fcntl_f_dupfd_cloexec=no],
+ [case "$host_os" in
+ # Guess no on NetBSD.
+ netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
+ *yes) ;;
+ *) gl_REPLACE_FCNTL
+ dnl No witness macro needed for this bug.
+ ;;
+ esac
+ fi
+ dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ gl_REPLACE_FCNTL
+ fi
+ ])
+])
+
+AC_DEFUN([gl_REPLACE_FCNTL],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([fcntl])
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+])
diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
new file mode 100644
index 0000000..68f4e64
--- /dev/null
+++ b/gl/m4/fcntl_h.m4
@@ -0,0 +1,70 @@
+# serial 20
+# Configure fcntl.h.
+dnl Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_FCNTL_H],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ gl_NEXT_HEADERS([fcntl.h])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
+ ]], [fcntl openat])
+])
+
+# gl_FCNTL_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_FCNTL_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_FCNTL_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CREAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCNTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NONBLOCKING])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CREAT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_OPEN], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_FCNTL_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
+ HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
+ REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT])
+ REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+])
diff --git a/gl/m4/fflush.m4 b/gl/m4/fflush.m4
new file mode 100644
index 0000000..3e3c890
--- /dev/null
+++ b/gl/m4/fflush.m4
@@ -0,0 +1,100 @@
+# fflush.m4 serial 18
+
+# Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Eric Blake
+
+dnl Find out how to obey POSIX semantics of fflush(stdin) discarding
+dnl unread input on seekable streams, rather than C99 undefined semantics.
+
+AC_DEFUN([gl_FUNC_FFLUSH],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_FUNC_FFLUSH_STDIN
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) ;;
+ *) REPLACE_FFLUSH=1 ;;
+ esac
+])
+
+dnl Determine whether fflush works on input streams.
+dnl Sets gl_cv_func_fflush_stdin.
+
+AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CACHE_CHECK([whether fflush works on input streams],
+ [gl_cv_func_fflush_stdin],
+ [echo hello world > conftest.txt
+ AC_RUN_IFELSE([AC_LANG_PROGRAM(
+ [[
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+ ]GL_MDA_DEFINES],
+ [[FILE *f = fopen ("conftest.txt", "r");
+ char buffer[10];
+ int fd;
+ int c;
+ if (f == NULL)
+ return 1;
+ fd = fileno (f);
+ if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+ { fclose (f); return 2; }
+ /* For deterministic results, ensure f read a bigger buffer. */
+ if (lseek (fd, 0, SEEK_CUR) == 5)
+ { fclose (f); return 3; }
+ /* POSIX requires fflush-fseek to set file offset of fd. This fails
+ on BSD systems and on mingw. */
+ if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+ { fclose (f); return 4; }
+ if (lseek (fd, 0, SEEK_CUR) != 5)
+ { fclose (f); return 5; }
+ /* Verify behaviour of fflush after ungetc. See
+ <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
+ /* Verify behaviour of fflush after a backup ungetc. This fails on
+ mingw. */
+ c = fgetc (f);
+ ungetc (c, f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 6; }
+ /* Verify behaviour of fflush after a non-backup ungetc. This fails
+ on glibc 2.8 and on BSD systems. */
+ c = fgetc (f);
+ ungetc ('@', f);
+ fflush (f);
+ if (fgetc (f) != c)
+ { fclose (f); return 7; }
+ fclose (f);
+ return 0;
+ ]])],
+ [gl_cv_func_fflush_stdin=yes],
+ [gl_cv_func_fflush_stdin=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+ *) gl_cv_func_fflush_stdin=cross ;;
+ esac
+ ])
+ rm conftest.txt
+ ])
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) gl_func_fflush_stdin=1 ;;
+ *no) gl_func_fflush_stdin=0 ;;
+ *) gl_func_fflush_stdin='(-1)' ;;
+ esac
+ AC_DEFINE_UNQUOTED([FUNC_FFLUSH_STDIN], [$gl_func_fflush_stdin],
+ [Define to 1 if fflush is known to work on stdin as per POSIX.1-2008,
+ 0 if fflush is known to not work, -1 if unknown.])
+])
+
+# Prerequisites of lib/fflush.c.
+AC_DEFUN([gl_PREREQ_FFLUSH], [:])
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4
new file mode 100644
index 0000000..2f0c9c4
--- /dev/null
+++ b/gl/m4/float_h.m4
@@ -0,0 +1,106 @@
+# float_h.m4 serial 13
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FLOAT_H],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ GL_GENERATE_FLOAT_H=false
+ REPLACE_FLOAT_LDBL=0
+ case "$host_os" in
+ aix* | beos* | openbsd* | mirbsd* | irix*)
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ freebsd* | dragonfly*)
+ case "$host_cpu" in
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ x86_64 )
+ # On x86_64 systems, the C compiler may still be generating
+ # 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [],
+ [GL_GENERATE_FLOAT_H=true])
+ ;;
+ esac
+ ;;
+ linux*)
+ case "$host_cpu" in
+ powerpc*)
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ esac
+ ;;
+ esac
+ case "$host_os" in
+ aix* | freebsd* | dragonfly* | linux*)
+ if $GL_GENERATE_FLOAT_H; then
+ REPLACE_FLOAT_LDBL=1
+ fi
+ ;;
+ esac
+
+ dnl Test against glibc-2.7 Linux/SPARC64 bug.
+ REPLACE_ITOLD=0
+ AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
+ [gl_cv_func_itold_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+int i = -1;
+volatile long double ld;
+int main ()
+{
+ ld += i * 1.0L;
+ if (ld > 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_itold_works=yes],
+ [gl_cv_func_itold_works=no],
+ [case "$host" in
+ sparc*-*-linux*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_itold_works="guessing no"],
+ [gl_cv_func_itold_works="guessing yes"])
+ ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_itold_works="guessing yes" ;;
+ *) gl_cv_func_itold_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_itold_works" in
+ *no)
+ REPLACE_ITOLD=1
+ dnl We add the workaround to <float.h> but also to <math.h>,
+ dnl to increase the chances that the fix function gets pulled in.
+ GL_GENERATE_FLOAT_H=true
+ ;;
+ esac
+
+ if $GL_GENERATE_FLOAT_H; then
+ gl_NEXT_HEADERS([float.h])
+ fi
+ AC_SUBST([REPLACE_ITOLD])
+])
diff --git a/gl/m4/floorf.m4 b/gl/m4/floorf.m4
new file mode 100644
index 0000000..c49ffa6
--- /dev/null
+++ b/gl/m4/floorf.m4
@@ -0,0 +1,113 @@
+# floorf.m4 serial 18
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FLOORF],
+[
+ m4_divert_text([DEFAULTS], [gl_floorf_required=plain])
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ dnl Persuade glibc <math.h> to declare floorf().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ dnl Test whether floorf() is declared.
+ AC_CHECK_DECLS([floorf], , , [[#include <math.h>]])
+ if test "$ac_cv_have_decl_floorf" = yes; then
+ dnl Test whether floorf() can be used without libm.
+ gl_FUNC_FLOORF_LIBS
+ if test "$FLOORF_LIBM" = "?"; then
+ dnl Sun C 5.0 on Solaris declares floorf() and has it in the system-wide
+ dnl libm.so, but not in the libm.so that the compiler uses.
+ REPLACE_FLOORF=1
+ fi
+ m4_ifdef([gl_FUNC_FLOORF_IEEE], [
+ if test $gl_floorf_required = ieee && test $REPLACE_FLOORF = 0; then
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether floorf works according to ISO C 99 with IEC 60559],
+ [gl_cv_func_floorf_ieee],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $FLOORF_LIBM"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#ifndef __NO_MATH_INLINES
+# define __NO_MATH_INLINES 1 /* for glibc */
+#endif
+#include <math.h>
+]gl_FLOAT_MINUS_ZERO_CODE[
+]gl_FLOAT_SIGNBIT_CODE[
+static float dummy (float f) { return 0; }
+int main (int argc, char *argv[])
+{
+ float (* volatile my_floorf) (float) = argc ? floorf : dummy;
+ /* Test whether floorf (-0.0f) is -0.0f. */
+ if (signbitf (minus_zerof) && !signbitf (my_floorf (minus_zerof)))
+ return 1;
+ return 0;
+}
+ ]])],
+ [gl_cv_func_floorf_ieee=yes],
+ [gl_cv_func_floorf_ieee=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_floorf_ieee="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_floorf_ieee="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_floorf_ieee="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_floorf_ieee="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ LIBS="$save_LIBS"
+ ])
+ case "$gl_cv_func_floorf_ieee" in
+ *yes) ;;
+ *) REPLACE_FLOORF=1 ;;
+ esac
+ fi
+ ])
+ else
+ HAVE_DECL_FLOORF=0
+ fi
+ if test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1; then
+ dnl No libraries are needed to link lib/floorf.c.
+ FLOORF_LIBM=
+ fi
+ AC_SUBST([FLOORF_LIBM])
+])
+
+# Determines the libraries needed to get the floorf() function.
+# Sets FLOORF_LIBM.
+AC_DEFUN([gl_FUNC_FLOORF_LIBS],
+[
+ gl_CACHE_VAL_SILENT([gl_cv_func_floorf_libm], [
+ gl_cv_func_floorf_libm=?
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ float (*funcptr) (float) = floorf;
+ float x;]],
+ [[x = funcptr(x) + floorf(x);]])],
+ [gl_cv_func_floorf_libm=])
+ if test "$gl_cv_func_floorf_libm" = "?"; then
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifndef __NO_MATH_INLINES
+ # define __NO_MATH_INLINES 1 /* for glibc */
+ #endif
+ #include <math.h>
+ float (*funcptr) (float) = floorf;
+ float x;]],
+ [[x = funcptr(x) + floorf(x);]])],
+ [gl_cv_func_floorf_libm="-lm"])
+ LIBS="$save_LIBS"
+ fi
+ ])
+ FLOORF_LIBM="$gl_cv_func_floorf_libm"
+])
diff --git a/gl/m4/fopen.m4 b/gl/m4/fopen.m4
new file mode 100644
index 0000000..9c39ff7
--- /dev/null
+++ b/gl/m4/fopen.m4
@@ -0,0 +1,149 @@
+# fopen.m4 serial 13
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FOPEN],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw* | pw*)
+ dnl Replace fopen, for handling of "/dev/null".
+ REPLACE_FOPEN=1
+ dnl fopen on mingw also has the trailing slash bug.
+ gl_cv_func_fopen_slash="guessing no"
+ ;;
+ *)
+ dnl fopen("foo/", "w") should not create a file when the file name has a
+ dnl trailing slash.
+ AC_CACHE_CHECK([whether fopen recognizes a trailing slash],
+ [gl_cv_func_fopen_slash],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stddef.h>
+#include <stdio.h>
+int main ()
+{
+ FILE *fp = fopen ("conftest.sl/", "w");
+ int result = (fp != NULL);
+ if (fp != NULL)
+ fclose (fp);
+ return result;
+}]])],
+ [gl_cv_func_fopen_slash=yes],
+ [gl_cv_func_fopen_slash=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+ gl_cv_func_fopen_slash="guessing no" ;;
+ *)
+ gl_cv_func_fopen_slash="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ rm -f conftest.sl
+ ])
+ ;;
+ esac
+ case "$gl_cv_func_fopen_slash" in
+ *no)
+ AC_DEFINE([FOPEN_TRAILING_SLASH_BUG], [1],
+ [Define to 1 if fopen() fails to recognize a trailing slash.])
+ REPLACE_FOPEN=1
+ ;;
+ esac
+])
+
+AC_DEFUN([gl_FUNC_FOPEN_GNU],
+[
+ AC_REQUIRE([gl_FUNC_FOPEN])
+ AC_CACHE_CHECK([whether fopen supports the mode character 'x'],
+ [gl_cv_func_fopen_mode_x],
+ [rm -f conftest.x
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <errno.h>
+int main ()
+{
+ FILE *fp;
+ fp = fopen ("conftest.x", "w");
+ fclose (fp);
+ fp = fopen ("conftest.x", "wx");
+ if (fp != NULL)
+ /* 'x' ignored */
+ return 1;
+ else if (errno == EEXIST)
+ return 0;
+ else
+ /* 'x' rejected */
+ return 2;
+}]])],
+ [gl_cv_func_fopen_mode_x=yes],
+ [gl_cv_func_fopen_mode_x=no],
+ [case "$host_os" in
+ # Guess yes on glibc and musl systems.
+ linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+ gl_cv_func_fopen_mode_x="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_fopen_mode_x="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.x
+ ])
+ AC_CACHE_CHECK([whether fopen supports the mode character 'e'],
+ [gl_cv_func_fopen_mode_e],
+ [echo foo > conftest.x
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+]GL_MDA_DEFINES[
+int main ()
+{
+ FILE *fp = fopen ("conftest.x", "re");
+ if (fp != NULL)
+ {
+ if (fcntl (fileno (fp), F_GETFD) & FD_CLOEXEC)
+ return 0;
+ else
+ /* 'e' ignored */
+ return 1;
+ }
+ else
+ /* 'e' rejected */
+ return 2;
+}]])],
+ [gl_cv_func_fopen_mode_e=yes],
+ [gl_cv_func_fopen_mode_e=no],
+ [case "$host_os" in
+ # Guess yes on glibc and musl systems.
+ linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+ gl_cv_func_fopen_mode_e="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*)
+ gl_cv_func_fopen_mode_e="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_fopen_mode_e="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.x
+ ])
+ REPLACE_FOPEN_FOR_FOPEN_GNU="$REPLACE_FOPEN"
+ case "$gl_cv_func_fopen_mode_x" in
+ *no) REPLACE_FOPEN_FOR_FOPEN_GNU=1 ;;
+ esac
+ case "$gl_cv_func_fopen_mode_e" in
+ *no) REPLACE_FOPEN_FOR_FOPEN_GNU=1 ;;
+ esac
+])
+
+# Prerequisites of lib/fopen.c.
+AC_DEFUN([gl_PREREQ_FOPEN], [:])
diff --git a/gl/m4/fpurge.m4 b/gl/m4/fpurge.m4
new file mode 100644
index 0000000..b365409
--- /dev/null
+++ b/gl/m4/fpurge.m4
@@ -0,0 +1,73 @@
+# fpurge.m4 serial 12
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FPURGE],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
+ AC_CHECK_FUNCS_ONCE([fpurge])
+ AC_CHECK_FUNCS_ONCE([__fpurge])
+ AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
+ if test "x$ac_cv_func_fpurge" = xyes; then
+ HAVE_FPURGE=1
+ # Detect BSD bug. Only cygwin 1.7 and musl are known to be immune.
+ AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>
+]],
+ [[FILE *f = fopen ("conftest.txt", "w+");
+ if (!f)
+ return 1;
+ if (fputc ('a', f) != 'a')
+ { fclose (f); return 2; }
+ rewind (f);
+ if (fgetc (f) != 'a')
+ { fclose (f); return 3; }
+ if (fgetc (f) != EOF)
+ { fclose (f); return 4; }
+ if (fpurge (f) != 0)
+ { fclose (f); return 5; }
+ if (putc ('b', f) != 'b')
+ { fclose (f); return 6; }
+ if (fclose (f) != 0)
+ return 7;
+ if ((f = fopen ("conftest.txt", "r")) == NULL)
+ return 8;
+ if (fgetc (f) != 'a')
+ { fclose (f); return 9; }
+ if (fgetc (f) != 'b')
+ { fclose (f); return 10; }
+ if (fgetc (f) != EOF)
+ { fclose (f); return 11; }
+ if (fclose (f) != 0)
+ return 12;
+ if (remove ("conftest.txt") != 0)
+ return 13;
+ return 0;
+ ]])],
+ [gl_cv_func_fpurge_works=yes],
+ [gl_cv_func_fpurge_works=no],
+ [case "$host_os" in
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_fpurge_works="guessing yes" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_fpurge_works" in
+ *yes) ;;
+ *) REPLACE_FPURGE=1 ;;
+ esac
+ else
+ HAVE_FPURGE=0
+ fi
+ if test "x$ac_cv_have_decl_fpurge" = xno; then
+ HAVE_DECL_FPURGE=0
+ fi
+])
diff --git a/gl/m4/freading.m4 b/gl/m4/freading.m4
new file mode 100644
index 0000000..3533336
--- /dev/null
+++ b/gl/m4/freading.m4
@@ -0,0 +1,11 @@
+# freading.m4 serial 2
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FREADING],
+[
+ AC_CHECK_HEADERS_ONCE([stdio_ext.h])
+ AC_CHECK_FUNCS_ONCE([__freading])
+])
diff --git a/gl/m4/free.m4 b/gl/m4/free.m4
new file mode 100644
index 0000000..0389dea
--- /dev/null
+++ b/gl/m4/free.m4
@@ -0,0 +1,52 @@
+# free.m4 serial 6
+# Copyright (C) 2003-2005, 2009-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert and Bruno Haible.
+
+AC_DEFUN([gl_FUNC_FREE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+ dnl In the next release of POSIX, free must preserve errno.
+ dnl https://www.austingroupbugs.net/view.php?id=385
+ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924
+ dnl So far, we know of three platforms that do this:
+ dnl * glibc >= 2.33, thanks to the fix for this bug:
+ dnl <https://sourceware.org/bugzilla/show_bug.cgi?id=17924>
+ dnl * OpenBSD >= 4.5, thanks to this commit:
+ dnl <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c.diff?r1=1.100&r2=1.101&f=h>
+ dnl * Solaris, because its malloc() implementation is based on brk(),
+ dnl not mmap(); hence its free() implementation makes no system calls.
+ dnl For other platforms, you can only be sure if they state it in their
+ dnl documentation, or by code inspection of the free() implementation in libc.
+ AC_CACHE_CHECK([whether free is known to preserve errno],
+ [gl_cv_func_free_preserves_errno],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ ]],
+ [[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
+ #elif defined __OpenBSD__
+ #elif defined __sun
+ #else
+ #error "'free' is not known to preserve errno"
+ #endif
+ ]])],
+ [gl_cv_func_free_preserves_errno=yes],
+ [gl_cv_func_free_preserves_errno=no])
+ ])
+
+ case $gl_cv_func_free_preserves_errno in
+ *yes)
+ AC_DEFINE([HAVE_FREE_POSIX], [1],
+ [Define if the 'free' function is guaranteed to preserve errno.])
+ ;;
+ *) REPLACE_FREE=1 ;;
+ esac
+])
+
+# Prerequisites of lib/free.c.
+AC_DEFUN([gl_PREREQ_FREE], [:])
diff --git a/gl/m4/fseek.m4 b/gl/m4/fseek.m4
new file mode 100644
index 0000000..c5fe688
--- /dev/null
+++ b/gl/m4/fseek.m4
@@ -0,0 +1,15 @@
+# fseek.m4 serial 4
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FSEEK],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_FSEEKO])
+ dnl When fseeko needs fixes, fseek needs them too.
+ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+ REPLACE_FSEEK=1
+ fi
+])
diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4
new file mode 100644
index 0000000..05ee06b
--- /dev/null
+++ b/gl/m4/fseeko.m4
@@ -0,0 +1,77 @@
+# fseeko.m4 serial 20
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FSEEKO],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+ AC_REQUIRE([gl_SYS_TYPES_H])
+ AC_REQUIRE([AC_PROG_CC])
+
+ dnl Persuade glibc <stdio.h> to declare fseeko().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
+ [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+]], [[fseeko (stdin, 0, 0);]])],
+ [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
+ ])
+
+ AC_CHECK_DECLS_ONCE([fseeko])
+ if test $ac_cv_have_decl_fseeko = no; then
+ HAVE_DECL_FSEEKO=0
+ fi
+
+ if test $gl_cv_func_fseeko = no; then
+ HAVE_FSEEKO=0
+ else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FSEEKO=1
+ fi
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FSEEKO=1
+ fi
+ m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
+ gl_FUNC_FFLUSH_STDIN
+ case "$gl_cv_func_fflush_stdin" in
+ *yes) ;;
+ *) REPLACE_FSEEKO=1 ;;
+ esac
+ ])
+ fi
+])
+
+dnl Code shared by fseeko and ftello. Determine if large files are supported,
+dnl but stdin does not start as a large file by default.
+AC_DEFUN([gl_STDIN_LARGE_OFFSET],
+ [
+ AC_CACHE_CHECK([whether stdin defaults to large file offsets],
+ [gl_cv_var_stdin_large_offset],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+[[#if defined __SL64 && defined __SCLE /* cygwin */
+ /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+ fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
+ it is easier to do a version check than building a runtime test. */
+# include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
+ choke me
+# endif
+#endif]])],
+ [gl_cv_var_stdin_large_offset=yes],
+ [gl_cv_var_stdin_large_offset=no])])
+])
+
+# Prerequisites of lib/fseeko.c.
+AC_DEFUN([gl_PREREQ_FSEEKO],
+[
+ dnl Native Windows has the function _fseeki64. mingw hides it in some
+ dnl circumstances, but mingw64 makes it usable again.
+ AC_CHECK_FUNCS([_fseeki64])
+ if test $ac_cv_func__fseeki64 = yes; then
+ AC_CHECK_DECLS([_fseeki64])
+ fi
+])
diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4
new file mode 100644
index 0000000..7cb2edb
--- /dev/null
+++ b/gl/m4/fstat.m4
@@ -0,0 +1,40 @@
+# fstat.m4 serial 8
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FSTAT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
+ case "$host_os" in
+ mingw* | solaris*)
+ dnl On MinGW, the original stat() returns st_atime, st_mtime,
+ dnl st_ctime values that are affected by the time zone.
+ dnl Solaris stat can return a negative tv_nsec.
+ REPLACE_FSTAT=1
+ ;;
+ esac
+
+ dnl Replace fstat() for supporting the gnulib-defined open() on directories.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ case "$gl_cv_func_open_directory_works" in
+ *yes) ;;
+ *)
+ REPLACE_FSTAT=1
+ ;;
+ esac
+ fi
+ ])
+])
+
+# Prerequisites of lib/fstat.c and lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_FSTAT], [
+ AC_REQUIRE([gl_SYS_STAT_H])
+ AC_REQUIRE([gl_PREREQ_STAT_W32])
+ :
+])
diff --git a/gl/m4/fstypename.m4 b/gl/m4/fstypename.m4
new file mode 100644
index 0000000..f65c459
--- /dev/null
+++ b/gl/m4/fstypename.m4
@@ -0,0 +1,23 @@
+#serial 6
+
+dnl From Jim Meyering.
+dnl
+dnl See if struct statfs has the f_fstypename member.
+dnl If so, define HAVE_STRUCT_STATFS_F_FSTYPENAME.
+dnl
+
+# Copyright (C) 1998-1999, 2001, 2004, 2006, 2009-2023 Free Software
+# Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FSTYPENAME],
+[
+ AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,
+ [
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ ])
+])
diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4
new file mode 100644
index 0000000..88f3ca8
--- /dev/null
+++ b/gl/m4/fsusage.m4
@@ -0,0 +1,306 @@
+# serial 35
+# Obtaining file system usage information.
+
+# Copyright (C) 1997-1998, 2000-2001, 2003-2023 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FSUSAGE],
+[
+ AC_CHECK_HEADERS_ONCE([sys/param.h])
+ AC_CHECK_HEADERS_ONCE([sys/vfs.h sys/fs_types.h])
+ AC_CHECK_HEADERS([sys/mount.h], [], [],
+ [AC_INCLUDES_DEFAULT
+ [#if HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif]])
+ gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
+])
+
+# Try to determine how a program can obtain file system usage information.
+# If successful, define the appropriate symbol (see fsusage.c) and
+# execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
+#
+# gl_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+
+AC_DEFUN([gl_FILE_SYSTEM_USAGE],
+[
+ dnl Enable large-file support. This has the effect of changing the size
+ dnl of field f_blocks in 'struct statvfs' from 32 bit to 64 bit on
+ dnl glibc/Hurd, HP-UX 11, Solaris (32-bit mode). It also changes the size
+ dnl of field f_blocks in 'struct statfs' from 32 bit to 64 bit on
+ dnl Mac OS X >= 10.5 (32-bit mode).
+ AC_REQUIRE([AC_SYS_LARGEFILE])
+
+ ac_fsusage_space=no
+
+ # Perform only the link test since it seems there are no variants of the
+ # statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs])
+ # because that got a false positive on SCO OSR5. Adding the declaration
+ # of a 'struct statvfs' causes this test to fail (as it should) on such
+ # systems. That system is reported to work fine with STAT_STATFS4 which
+ # is what it gets when this test fails.
+ if test $ac_fsusage_space = no; then
+ # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
+ # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
+ AC_CACHE_CHECK([for statvfs function (SVR4)],
+ [fu_cv_sys_stat_statvfs],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#ifdef __osf__
+"Do not use Tru64's statvfs implementation"
+#endif
+
+#include <sys/statvfs.h>
+
+struct statvfs fsd;
+
+#if defined __APPLE__ && defined __MACH__
+#include <limits.h>
+/* On Mac OS X >= 10.5, f_blocks in 'struct statvfs' is a 32-bit quantity;
+ that commonly limits file systems to 4 TiB. Whereas f_blocks in
+ 'struct statfs' is a 64-bit type, thanks to the large-file support
+ that was enabled above. In this case, don't use statvfs(); use statfs()
+ instead. */
+int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
+#endif
+]],
+ [[statvfs (0, &fsd);]])],
+ [fu_cv_sys_stat_statvfs=yes],
+ [fu_cv_sys_stat_statvfs=no])
+ ])
+ if test $fu_cv_sys_stat_statvfs = yes; then
+ ac_fsusage_space=yes
+ # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
+ # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems
+ # statvfs with large-file support is already equivalent to statvfs64.
+ AC_CACHE_CHECK([whether to use statvfs64],
+ [fu_cv_sys_stat_statvfs64],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/statvfs.h>
+ struct statvfs64 fsd;
+ int check_f_blocks_larger_in_statvfs64
+ [sizeof (((struct statvfs64 *) 0)->f_blocks)
+ > sizeof (((struct statvfs *) 0)->f_blocks)
+ ? 1 : -1];
+ ]],
+ [[statvfs64 (0, &fsd);]])],
+ [fu_cv_sys_stat_statvfs64=yes],
+ [fu_cv_sys_stat_statvfs64=no])
+ ])
+ if test $fu_cv_sys_stat_statvfs64 = yes; then
+ AC_DEFINE([STAT_STATVFS64], [1],
+ [Define if statvfs64 should be preferred over statvfs.])
+ else
+ AC_DEFINE([STAT_STATVFS], [1],
+ [Define if there is a function named statvfs. (SVR4)])
+ fi
+ fi
+ fi
+
+ # Check for this unconditionally so we have a
+ # good fallback on glibc/Linux > 2.6 < 2.6.36
+ AC_CACHE_CHECK([for two-argument statfs with statfs.f_frsize member],
+ [fu_cv_sys_stat_statfs2_frsize],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_frsize = 0;
+ return statfs (".", &fsd) != 0;
+ }]])],
+ [fu_cv_sys_stat_statfs2_frsize=yes],
+ [fu_cv_sys_stat_statfs2_frsize=no],
+ [fu_cv_sys_stat_statfs2_frsize=no])
+ ])
+ if test $fu_cv_sys_stat_statfs2_frsize = yes; then
+ ac_fsusage_space=yes
+ AC_DEFINE([STAT_STATFS2_FRSIZE], [1],
+ [Define if statfs takes 2 args and struct statfs has a field named f_frsize.
+ (glibc/Linux > 2.6)])
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # DEC Alpha running OSF/1
+ AC_CACHE_CHECK([for 3-argument statfs function (DEC OSF/1)],
+ [fu_cv_sys_stat_statfs3_osf1],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_fsize = 0;
+ return statfs (".", &fsd, sizeof (struct statfs)) != 0;
+ }]])],
+ [fu_cv_sys_stat_statfs3_osf1=yes],
+ [fu_cv_sys_stat_statfs3_osf1=no],
+ [fu_cv_sys_stat_statfs3_osf1=no])
+ ])
+ if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
+ ac_fsusage_space=yes
+ AC_DEFINE([STAT_STATFS3_OSF1], [1],
+ [Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
+ fi
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
+ # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
+ # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
+ # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
+ # <sys/vfs.h>.)
+ # (On Solaris, statfs has 4 arguments.)
+ AC_CACHE_CHECK([for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)],
+ [fu_cv_sys_stat_statfs2_bsize],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_bsize = 0;
+ return statfs (".", &fsd) != 0;
+ }]])],
+ [fu_cv_sys_stat_statfs2_bsize=yes],
+ [fu_cv_sys_stat_statfs2_bsize=no],
+ [fu_cv_sys_stat_statfs2_bsize=no])
+ ])
+ if test $fu_cv_sys_stat_statfs2_bsize = yes; then
+ ac_fsusage_space=yes
+ AC_DEFINE([STAT_STATFS2_BSIZE], [1],
+ [Define if statfs takes 2 args and struct statfs has a field named f_bsize.
+ (4.3BSD, SunOS 4, HP-UX)])
+ fi
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # SVR3
+ # (Solaris already handled above.)
+ AC_CACHE_CHECK([for four-argument statfs (SVR3)],
+ [fu_cv_sys_stat_statfs4],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/statfs.h>
+ int
+ main ()
+ {
+ struct statfs fsd;
+ return statfs (".", &fsd, sizeof fsd, 0) != 0;
+ }]])],
+ [fu_cv_sys_stat_statfs4=yes],
+ [fu_cv_sys_stat_statfs4=no],
+ [fu_cv_sys_stat_statfs4=no])
+ ])
+ if test $fu_cv_sys_stat_statfs4 = yes; then
+ ac_fsusage_space=yes
+ AC_DEFINE([STAT_STATFS4], [1],
+ [Define if statfs takes 4 args. (SVR3, old Irix)])
+ fi
+ fi
+
+ if test $ac_fsusage_space = no; then
+ # 4.4BSD and older NetBSD
+ # (OSF/1 already handled above.)
+ # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
+ # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
+ # <sys/mount.h>.)
+ AC_CACHE_CHECK([for two-argument statfs with statfs.f_fsize member (4.4BSD and NetBSD)],
+ [fu_cv_sys_stat_statfs2_fsize],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+ int
+ main ()
+ {
+ struct statfs fsd;
+ fsd.f_fsize = 0;
+ return statfs (".", &fsd) != 0;
+ }]])],
+ [fu_cv_sys_stat_statfs2_fsize=yes],
+ [fu_cv_sys_stat_statfs2_fsize=no],
+ [fu_cv_sys_stat_statfs2_fsize=no])
+ ])
+ if test $fu_cv_sys_stat_statfs2_fsize = yes; then
+ ac_fsusage_space=yes
+ AC_DEFINE([STAT_STATFS2_FSIZE], [1],
+ [Define if statfs takes 2 args and struct statfs has a field named f_fsize.
+ (4.4BSD, NetBSD)])
+ fi
+ fi
+
+ AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
+
+])
+
+
+# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
+# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
+# enable the work-around code in fsusage.c.
+AC_DEFUN([gl_STATFS_TRUNCATES],
+[
+ AC_CACHE_CHECK([for statfs that truncates block counts],
+ [fu_cv_sys_truncating_statfs],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#if !defined(sun) && !defined(__sun)
+choke -- this is a workaround for a Sun-specific problem
+#endif
+#include <sys/types.h>
+#include <sys/vfs.h>
+ ]],
+ [[struct statfs t; long c = *(t.f_spare);
+ if (c) return 0;
+ ]])],
+ [fu_cv_sys_truncating_statfs=yes],
+ [fu_cv_sys_truncating_statfs=no])
+ ])
+ if test $fu_cv_sys_truncating_statfs = yes; then
+ AC_DEFINE([STATFS_TRUNCATES_BLOCK_COUNTS], [1],
+ [Define if the block counts reported by statfs may be truncated to 2GB
+ and the correct values may be stored in the f_spare array.
+ (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
+ SunOS 4.1.1 seems not to be affected.)])
+ fi
+])
+
+
+# Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE.
+AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA],
+[
+ AC_CHECK_HEADERS([sys/fs/s5param.h sys/statfs.h])
+ gl_STATFS_TRUNCATES
+])
diff --git a/gl/m4/ftell.m4 b/gl/m4/ftell.m4
new file mode 100644
index 0000000..79f1aaf
--- /dev/null
+++ b/gl/m4/ftell.m4
@@ -0,0 +1,15 @@
+# ftell.m4 serial 3
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FTELL],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_FTELLO])
+ dnl When ftello needs fixes, ftell needs them too.
+ if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+ REPLACE_FTELL=1
+ fi
+])
diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4
new file mode 100644
index 0000000..4901b16
--- /dev/null
+++ b/gl/m4/ftello.m4
@@ -0,0 +1,151 @@
+# ftello.m4 serial 14
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FTELLO],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+ AC_REQUIRE([gl_SYS_TYPES_H])
+
+ dnl Persuade glibc <stdio.h> to declare ftello().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([ftello])
+ if test $ac_cv_have_decl_ftello = no; then
+ HAVE_DECL_FTELLO=0
+ fi
+
+ AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>]],
+ [[ftello (stdin);]])],
+ [gl_cv_func_ftello=yes],
+ [gl_cv_func_ftello=no])
+ ])
+ if test $gl_cv_func_ftello = no; then
+ HAVE_FTELLO=0
+ else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FTELLO=1
+ fi
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FTELLO=1
+ fi
+ if test $REPLACE_FTELLO = 0; then
+ dnl Detect bug on Solaris.
+ dnl ftell and ftello produce incorrect results after putc that followed a
+ dnl getc call that reached EOF on Solaris. This is because the _IOREAD
+ dnl flag does not get cleared in this case, even though _IOWRT gets set,
+ dnl and ftell and ftello look whether the _IOREAD flag is set.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether ftello works],
+ [gl_cv_func_ftello_works],
+ [
+ dnl Initial guess, used when cross-compiling or when /dev/tty cannot
+ dnl be opened.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_func_ftello_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_ftello_works="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_ftello_works="guessing yes" ;;
+ esac
+changequote([,])dnl
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+ FILE *fp;
+
+ /* Create a file with some contents. */
+ fp = fopen (TESTFILE, "w");
+ if (fp == NULL)
+ return 70;
+ if (fwrite ("foogarsh", 1, 8, fp) < 8)
+ { fclose (fp); return 71; }
+ if (fclose (fp))
+ return 72;
+
+ /* The file's contents is now "foogarsh". */
+
+ /* Try writing after reading to EOF. */
+ fp = fopen (TESTFILE, "r+");
+ if (fp == NULL)
+ return 73;
+ if (fseek (fp, -1, SEEK_END))
+ { fclose (fp); return 74; }
+ if (!(getc (fp) == 'h'))
+ { fclose (fp); return 1; }
+ if (!(getc (fp) == EOF))
+ { fclose (fp); return 2; }
+ if (!(ftell (fp) == 8))
+ { fclose (fp); return 3; }
+ if (!(ftell (fp) == 8))
+ { fclose (fp); return 4; }
+ if (!(putc ('!', fp) == '!'))
+ { fclose (fp); return 5; }
+ if (!(ftell (fp) == 9))
+ { fclose (fp); return 6; }
+ if (!(fclose (fp) == 0))
+ return 7;
+ fp = fopen (TESTFILE, "r");
+ if (fp == NULL)
+ return 75;
+ {
+ char buf[10];
+ if (!(fread (buf, 1, 10, fp) == 9))
+ { fclose (fp); return 10; }
+ if (!(memcmp (buf, "foogarsh!", 9) == 0))
+ { fclose (fp); return 11; }
+ }
+ if (!(fclose (fp) == 0))
+ return 12;
+
+ /* The file's contents is now "foogarsh!". */
+
+ return 0;
+}]])],
+ [gl_cv_func_ftello_works=yes],
+ [gl_cv_func_ftello_works=no], [:])
+ ])
+ case "$gl_cv_func_ftello_works" in
+ *yes) ;;
+ *)
+ REPLACE_FTELLO=1
+ AC_DEFINE([FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE], [1],
+ [Define to 1 if the system's ftello function has the Solaris bug.])
+ ;;
+ esac
+ fi
+ if test $REPLACE_FTELLO = 0; then
+ dnl Detect bug on macOS >= 10.15.
+ gl_FUNC_UNGETC_WORKS
+ if test $gl_ftello_broken_after_ungetc = yes; then
+ REPLACE_FTELLO=1
+ AC_DEFINE([FTELLO_BROKEN_AFTER_UNGETC], [1],
+ [Define to 1 if the system's ftello function has the macOS bug.])
+ fi
+ fi
+ fi
+])
+
+# Prerequisites of lib/ftello.c.
+AC_DEFUN([gl_PREREQ_FTELLO],
+[
+ dnl Native Windows has the function _ftelli64. mingw hides it, but mingw64
+ dnl makes it usable again.
+ AC_CHECK_FUNCS([_ftelli64])
+])
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4
new file mode 100644
index 0000000..15f09ff
--- /dev/null
+++ b/gl/m4/getaddrinfo.m4
@@ -0,0 +1,238 @@
+# getaddrinfo.m4 serial 34
+dnl Copyright (C) 2004-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_GETADDRINFO],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
+ AC_REQUIRE([gl_NETDB_H])dnl for HAVE_NETDB_H
+ GETADDRINFO_LIB=
+ gai_saved_LIBS="$LIBS"
+
+ dnl Where is getaddrinfo()?
+ dnl - On Solaris, it is in libsocket.
+ dnl - On Haiku, it is in libnetwork.
+ dnl - On BeOS, it is in libnet.
+ dnl - On native Windows, it is in ws2_32.dll.
+ dnl - Otherwise it is in libc.
+ AC_SEARCH_LIBS([getaddrinfo], [socket network net],
+ [if test "$ac_cv_search_getaddrinfo" != "none required"; then
+ GETADDRINFO_LIB="$ac_cv_search_getaddrinfo"
+ fi])
+ LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
+
+ HAVE_GETADDRINFO=1
+ AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#include <stddef.h>
+]], [[getaddrinfo("", "", NULL, NULL);]])],
+ [gl_cv_func_getaddrinfo=yes],
+ [gl_cv_func_getaddrinfo=no])])
+ if test $gl_cv_func_getaddrinfo = no; then
+ AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32],
+ gl_cv_w32_getaddrinfo, [
+ gl_cv_w32_getaddrinfo=no
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes])
+ LIBS="$am_save_LIBS"
+ ])
+ if test "$gl_cv_w32_getaddrinfo" = "yes"; then
+ GETADDRINFO_LIB="-lws2_32"
+ LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
+ dnl Check for correct signature, in particular for a cdecl-compatible
+ dnl calling convention.
+ AC_CACHE_CHECK([for getaddrinfo with POSIX signature],
+ [gl_cv_func_getaddrinfo_posix_signature],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int getaddrinfo (const char *, const char *, const struct addrinfo *, struct addrinfo **);
+]])],
+ [gl_cv_func_getaddrinfo_posix_signature=yes],
+ [gl_cv_func_getaddrinfo_posix_signature=no])
+ ])
+ if test $gl_cv_func_getaddrinfo_posix_signature = no; then
+ REPLACE_GETADDRINFO=1
+ fi
+ else
+ HAVE_GETADDRINFO=0
+ fi
+ fi
+ AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO], [$HAVE_GETADDRINFO],
+ [Define to 1 if getaddrinfo exists, or to 0 otherwise.])
+
+ # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
+ # inline function declared in ws2tcpip.h, so we need to get that
+ # header included somehow.
+ AC_CHECK_DECLS([gai_strerror], [], [], [[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+]])
+ if test $ac_cv_have_decl_gai_strerror = yes; then
+ AC_CHECK_DECLS([gai_strerrorA], [], [], [[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+]])
+ dnl check for correct signature
+ AC_CACHE_CHECK([for gai_strerror with POSIX signature],
+ [gl_cv_func_gai_strerror_posix_signature], [
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *gai_strerror(int);]])],
+ [gl_cv_func_gai_strerror_posix_signature=yes],
+ [gl_cv_func_gai_strerror_posix_signature=no])])
+ if test $gl_cv_func_gai_strerror_posix_signature = no; then
+ REPLACE_GAI_STRERROR=1
+ fi
+ fi
+
+ LIBS="$gai_saved_LIBS"
+
+ gl_PREREQ_GETADDRINFO
+
+ AC_SUBST([GETADDRINFO_LIB])
+])
+
+# Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c.
+AC_DEFUN([gl_PREREQ_GETADDRINFO], [
+ AC_REQUIRE([gl_NETDB_H_DEFAULTS])
+ AC_REQUIRE([gl_SYS_SOCKET_H])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
+ AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB
+ AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB
+ AC_REQUIRE([gl_FUNC_INET_NTOP]) dnl for INET_NTOP_LIB
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([gl_SOCKET_FAMILIES])
+ AC_REQUIRE([gl_SYS_SOCKET_H])
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl Including sys/socket.h is wrong for Windows, but Windows does not
+ dnl have sa_len so the result is correct anyway.
+ AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [
+#include <sys/types.h>
+#include <sys/socket.h>
+])
+
+ AC_CHECK_HEADERS_ONCE([netinet/in.h])
+
+ AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[[
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+]])
+ if test $ac_cv_have_decl_getaddrinfo = no; then
+ HAVE_DECL_GETADDRINFO=0
+ fi
+ if test $ac_cv_have_decl_freeaddrinfo = no; then
+ HAVE_DECL_FREEADDRINFO=0
+ fi
+ if test $ac_cv_have_decl_gai_strerror = no; then
+ HAVE_DECL_GAI_STRERROR=0
+ fi
+ if test $ac_cv_have_decl_getnameinfo = no; then
+ HAVE_DECL_GETNAMEINFO=0
+ fi
+
+ AC_CHECK_TYPES([struct addrinfo],,,[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+ if test $ac_cv_type_struct_addrinfo = no; then
+ HAVE_STRUCT_ADDRINFO=0
+ fi
+
+ dnl Append $HOSTENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
+ case " $GETADDRINFO_LIB " in
+ *" $HOSTENT_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;;
+ esac
+
+ dnl Append $SERVENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
+ case " $GETADDRINFO_LIB " in
+ *" $SERVENT_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
+ esac
+
+ dnl Append $INET_NTOP_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
+ case " $GETADDRINFO_LIB " in
+ *" $INET_NTOP_LIB "*) ;;
+ *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;;
+ esac
+])
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
new file mode 100644
index 0000000..9aaed20
--- /dev/null
+++ b/gl/m4/getdelim.m4
@@ -0,0 +1,111 @@
+# getdelim.m4 serial 16
+
+dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
+dnl
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_PREREQ([2.59])
+
+AC_DEFUN([gl_FUNC_GETDELIM],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ dnl Persuade glibc <stdio.h> to declare getdelim().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([getdelim])
+
+ AC_CHECK_FUNCS_ONCE([getdelim])
+ if test $ac_cv_func_getdelim = yes; then
+ HAVE_GETDELIM=1
+ dnl Found it in some library. Verify that it works.
+ AC_CACHE_CHECK([for working getdelim function],
+ [gl_cv_func_working_getdelim],
+ [case "$host_os" in
+ darwin*)
+ dnl On macOS 10.13, valgrind detected an out-of-bounds read during
+ dnl the GNU sed test suite:
+ dnl Invalid read of size 16
+ dnl at 0x100EE6A05: _platform_memchr$VARIANT$Base (in /usr/lib/system/libsystem_platform.dylib)
+ dnl by 0x100B7B0BD: getdelim (in /usr/lib/system/libsystem_c.dylib)
+ dnl by 0x10000B0BE: ck_getdelim (utils.c:254)
+ gl_cv_func_working_getdelim=no ;;
+ *)
+ echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+ int main ()
+ {
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ {
+ /* Test result for a NULL buffer and a zero size.
+ Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len = getdelim (&line, &siz, '\n', in);
+ if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
+ { free (line); fclose (in); return 2; }
+ free (line);
+ }
+ {
+ /* Test result for a NULL buffer and a non-zero size.
+ This crashes on FreeBSD 8.0. */
+ char *line = NULL;
+ size_t siz = (size_t)(~0) / 4;
+ if (getdelim (&line, &siz, '\n', in) == -1)
+ { fclose (in); return 3; }
+ free (line);
+ }
+ fclose (in);
+ return 0;
+ }
+ ]])],
+ [gl_cv_func_working_getdelim=yes],
+ [gl_cv_func_working_getdelim=no],
+ [dnl We're cross compiling.
+ dnl Guess it works on glibc2 systems and musl systems.
+ AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ [gl_cv_func_working_getdelim="guessing yes"],
+ [case "$host_os" in
+ *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
+ *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ ;;
+ esac
+ ])
+ case "$gl_cv_func_working_getdelim" in
+ *yes) ;;
+ *) REPLACE_GETDELIM=1 ;;
+ esac
+ else
+ HAVE_GETDELIM=0
+ fi
+
+ if test $ac_cv_have_decl_getdelim = no; then
+ HAVE_DECL_GETDELIM=0
+ fi
+])
+
+# Prerequisites of lib/getdelim.c.
+AC_DEFUN([gl_PREREQ_GETDELIM],
+[
+ AC_CHECK_FUNCS([flockfile funlockfile])
+ AC_CHECK_DECLS([getc_unlocked])
+])
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
new file mode 100644
index 0000000..8bcda90
--- /dev/null
+++ b/gl/m4/getdtablesize.m4
@@ -0,0 +1,63 @@
+# getdtablesize.m4 serial 8
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_GETDTABLESIZE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([getdtablesize])
+ AC_CHECK_DECLS_ONCE([getdtablesize])
+ if test $ac_cv_func_getdtablesize = yes &&
+ test $ac_cv_have_decl_getdtablesize = yes; then
+ AC_CACHE_CHECK([whether getdtablesize works],
+ [gl_cv_func_getdtablesize_works],
+ [dnl There are two concepts: the "maximum possible file descriptor value + 1"
+ dnl and the "maximum number of open file descriptors in a process".
+ dnl Per SUSv2 and POSIX, getdtablesize() should return the first one.
+ dnl On most platforms, the first and the second concept are the same.
+ dnl On OpenVMS, however, they are different and getdtablesize() returns
+ dnl the second one; thus the test below fails. But we don't care
+ dnl because there's no good way to write a replacement getdtablesize().
+ case "$host_os" in
+ vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
+ *)
+ dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft
+ dnl limit up to an unchangeable hard limit; all other platforms
+ dnl correctly require setrlimit before getdtablesize() can report
+ dnl a larger value.
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <unistd.h>]
+ GL_MDA_DEFINES
+ ],
+ [[int size = getdtablesize();
+ if (dup2 (0, getdtablesize()) != -1)
+ return 1;
+ if (size != getdtablesize())
+ return 2;
+ ]])],
+ [gl_cv_func_getdtablesize_works=yes],
+ [gl_cv_func_getdtablesize_works=no],
+ [case "$host_os" in
+ cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+ gl_cv_func_getdtablesize_works="guessing no" ;;
+ *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+ esac
+ ])
+ ;;
+ esac
+ ])
+ case "$gl_cv_func_getdtablesize_works" in
+ *yes | "no (limitation)") ;;
+ *) REPLACE_GETDTABLESIZE=1 ;;
+ esac
+ else
+ HAVE_GETDTABLESIZE=0
+ fi
+])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
diff --git a/gl/m4/gethostname.m4 b/gl/m4/gethostname.m4
new file mode 100644
index 0000000..63f5f63
--- /dev/null
+++ b/gl/m4/gethostname.m4
@@ -0,0 +1,107 @@
+# gethostname.m4 serial 15
+dnl Copyright (C) 2002, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Ensure
+# - the gethostname() function,
+# - the HOST_NAME_MAX macro in <limits.h>.
+AC_DEFUN([gl_FUNC_GETHOSTNAME],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ gl_PREREQ_SYS_H_WINSOCK2
+
+ dnl Where is gethostname() defined?
+ dnl - On native Windows, it is in ws2_32.dll.
+ dnl - Otherwise it is in libc.
+ GETHOSTNAME_LIB=
+ AC_CHECK_FUNCS([gethostname], , [
+ AC_CACHE_CHECK([for gethostname in winsock2.h and -lws2_32],
+ [gl_cv_w32_gethostname],
+ [gl_cv_w32_gethostname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+]], [[gethostname(NULL, 0);]])], [gl_cv_w32_gethostname=yes])
+ LIBS="$gl_save_LIBS"
+ ])
+ if test "$gl_cv_w32_gethostname" = "yes"; then
+ GETHOSTNAME_LIB="-lws2_32"
+ fi
+ ])
+ AC_SUBST([GETHOSTNAME_LIB])
+
+ if test "$ac_cv_func_gethostname" = no; then
+ HAVE_GETHOSTNAME=0
+ fi
+
+ gl_PREREQ_HOST_NAME_MAX
+])
+
+# Provide HOST_NAME_MAX when <limits.h> lacks it.
+AC_DEFUN([gl_PREREQ_HOST_NAME_MAX], [
+ dnl - On most Unix systems, use MAXHOSTNAMELEN from <sys/param.h> instead.
+ dnl - On Solaris, Cygwin, BeOS, use MAXHOSTNAMELEN from <netdb.h> instead.
+ dnl - On mingw, use 256, because
+ dnl <https://docs.microsoft.com/en-us/windows/desktop/api/winsock/nf-winsock-gethostname> says:
+ dnl "if a buffer of 256 bytes is passed in the name parameter and
+ dnl the namelen parameter is set to 256, the buffer size will always
+ dnl be adequate."
+ dnl With this, there is no need to use sysconf (_SC_HOST_NAME_MAX), which
+ dnl is not a compile-time constant.
+ dnl We cannot override <limits.h> using the usual technique, because
+ dnl gl_CHECK_NEXT_HEADERS does not work for <limits.h>. Therefore retrieve
+ dnl the value of HOST_NAME_MAX at configure time.
+ AC_CHECK_HEADERS_ONCE([sys/param.h])
+ AC_CHECK_HEADERS_ONCE([sys/socket.h])
+ AC_CHECK_HEADERS_ONCE([netdb.h])
+ AC_CACHE_CHECK([for HOST_NAME_MAX], [gl_cv_decl_HOST_NAME_MAX], [
+ gl_cv_decl_HOST_NAME_MAX=
+ AC_EGREP_CPP([lucky], [
+#include <limits.h>
+#ifdef HOST_NAME_MAX
+lucky
+#endif
+ ], [gl_cv_decl_HOST_NAME_MAX=yes])
+ if test -z "$gl_cv_decl_HOST_NAME_MAX"; then
+ dnl It's not defined in <limits.h>. Substitute it.
+ if test "$gl_cv_w32_gethostname" = yes; then
+ dnl mingw.
+ gl_cv_decl_HOST_NAME_MAX=256
+ else
+ AC_COMPUTE_INT([gl_cv_decl_HOST_NAME_MAX], [MAXHOSTNAMELEN], [
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
+# include <netdb.h>
+#endif
+],
+ [dnl The system does not define MAXHOSTNAMELEN in any of the common
+ dnl headers. Use a safe fallback.
+ gl_cv_decl_HOST_NAME_MAX=256
+ ])
+ fi
+ fi
+ ])
+ if test "$gl_cv_decl_HOST_NAME_MAX" != yes; then
+ AC_DEFINE_UNQUOTED([HOST_NAME_MAX], [$gl_cv_decl_HOST_NAME_MAX],
+ [Define HOST_NAME_MAX when <limits.h> does not define it.])
+ fi
+])
+
+# Prerequisites of lib/gethostname.c.
+AC_DEFUN([gl_PREREQ_GETHOSTNAME], [
+ if test "$gl_cv_w32_gethostname" != "yes"; then
+ AC_CHECK_FUNCS([uname])
+ fi
+])
diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4
new file mode 100644
index 0000000..03569f0
--- /dev/null
+++ b/gl/m4/getline.m4
@@ -0,0 +1,109 @@
+# getline.m4 serial 30
+
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2023 Free Software Foundation,
+dnl Inc.
+dnl
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_PREREQ([2.59])
+
+dnl See if there's a working, system-supplied version of the getline function.
+dnl We can't just do AC_REPLACE_FUNCS([getline]) because some systems
+dnl have a function by that name in -linet that doesn't have anything
+dnl to do with the function we need.
+AC_DEFUN([gl_FUNC_GETLINE],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade glibc <stdio.h> to declare getline().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([getline])
+
+ gl_getline_needs_run_time_check=no
+ AC_CHECK_FUNC([getline],
+ [dnl Found it in some library. Verify that it works.
+ gl_getline_needs_run_time_check=yes],
+ [am_cv_func_working_getline=no])
+ if test $gl_getline_needs_run_time_check = yes; then
+ AC_CACHE_CHECK([for working getline function],
+ [am_cv_func_working_getline],
+ [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+ int main ()
+ {
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ {
+ /* Test result for a NULL buffer and a zero size.
+ Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len = getline (&line, &siz, in);
+ if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
+ { free (line); fclose (in); return 2; }
+ free (line);
+ }
+ {
+ /* Test result for a NULL buffer and a non-zero size.
+ This crashes on FreeBSD 8.0. */
+ char *line = NULL;
+ size_t siz = (size_t)(~0) / 4;
+ if (getline (&line, &siz, in) == -1)
+ { fclose (in); return 3; }
+ free (line);
+ }
+ fclose (in);
+ return 0;
+ }
+ ]])],
+ [am_cv_func_working_getline=yes],
+ [am_cv_func_working_getline=no],
+ [dnl We're cross compiling.
+ dnl Guess it works on glibc2 systems and musl systems.
+ AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2) && !defined __UCLIBC__
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ [am_cv_func_working_getline="guessing yes"],
+ [case "$host_os" in
+ *-musl*) am_cv_func_working_getline="guessing yes" ;;
+ *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ ])
+ fi
+
+ if test $ac_cv_have_decl_getline = no; then
+ HAVE_DECL_GETLINE=0
+ fi
+
+ case "$am_cv_func_working_getline" in
+ *yes) ;;
+ *)
+ dnl Set REPLACE_GETLINE always: Even if we have not found the broken
+ dnl getline function among $LIBS, it may exist in libinet and the
+ dnl executable may be linked with -linet.
+ REPLACE_GETLINE=1
+ ;;
+ esac
+])
+
+# Prerequisites of lib/getline.c.
+AC_DEFUN([gl_PREREQ_GETLINE],
+[
+ :
+])
diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4
new file mode 100644
index 0000000..79e420b
--- /dev/null
+++ b/gl/m4/getloadavg.m4
@@ -0,0 +1,161 @@
+# Check for getloadavg.
+
+# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2023 Free Software
+# Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 10
+
+# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
+# New applications should use gl_GETLOADAVG instead.
+
+# gl_GETLOADAVG
+# -------------
+AC_DEFUN([gl_GETLOADAVG],
+[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+# Persuade glibc <stdlib.h> to declare getloadavg().
+AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+gl_save_LIBS=$LIBS
+
+# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
+# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
+HAVE_GETLOADAVG=1
+AC_CHECK_FUNC([getloadavg], [],
+ [gl_func_getloadavg_done=no
+
+ # Some systems with -lutil have (and need) -lkvm as well, some do not.
+ # On Solaris, -lkvm requires nlist from -lelf, so check that first
+ # to get the right answer into the cache.
+ # For kstat on solaris, we need to test for libelf and libkvm to force the
+ # definition of SVR4 below.
+ if test $gl_func_getloadavg_done = no; then
+ AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
+ AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
+ # Check for the 4.4BSD definition of getloadavg.
+ AC_CHECK_LIB([util], [getloadavg],
+ [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
+ fi
+
+ if test $gl_func_getloadavg_done = no; then
+ # There is a commonly available library for RS/6000 AIX.
+ # Since it is not a standard part of AIX, it might be installed locally.
+ gl_getloadavg_LIBS=$LIBS
+ if test $cross_compiling != yes; then
+ LIBS="-L/usr/local/lib $LIBS"
+ fi
+ AC_CHECK_LIB([getloadavg], [getloadavg],
+ [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
+ [LIBS=$gl_getloadavg_LIBS])
+ fi
+
+ # Set up the replacement function if necessary.
+ if test $gl_func_getloadavg_done = no; then
+ HAVE_GETLOADAVG=0
+
+ # Solaris has libkstat which does not require root.
+ AC_CHECK_LIB([kstat], [kstat_open])
+ test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
+
+ # AIX has libperfstat which does not require root
+ if test $gl_func_getloadavg_done = no; then
+ AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
+ test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
+ fi
+
+ if test $gl_func_getloadavg_done = no; then
+ AC_CHECK_HEADER([sys/dg_sys_info.h],
+ [gl_func_getloadavg_done=yes
+ AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
+ AC_CHECK_LIB([dgc], [dg_sys_info])])
+ fi
+ fi])
+
+if test "x$gl_save_LIBS" = x; then
+ GETLOADAVG_LIBS=$LIBS
+else
+ GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
+fi
+LIBS=$gl_save_LIBS
+
+AC_SUBST([GETLOADAVG_LIBS])dnl
+
+# Test whether the system declares getloadavg. Solaris has the function
+# but declares it in <sys/loadavg.h>, not <stdlib.h>.
+AC_CHECK_HEADERS([sys/loadavg.h])
+if test $ac_cv_header_sys_loadavg_h = yes; then
+ HAVE_SYS_LOADAVG_H=1
+else
+ HAVE_SYS_LOADAVG_H=0
+fi
+AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
+ [[#if HAVE_SYS_LOADAVG_H
+ /* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+ # include <sys/time.h>
+ # include <sys/loadavg.h>
+ #endif
+ #include <stdlib.h>]])
+])# gl_GETLOADAVG
+
+
+# gl_PREREQ_GETLOADAVG
+# --------------------
+# Set up the AC_LIBOBJ replacement of 'getloadavg'.
+AC_DEFUN([gl_PREREQ_GETLOADAVG],
+[
+# Figure out what our getloadavg.c needs.
+
+AC_CHECK_HEADERS_ONCE([sys/param.h unistd.h])
+
+# On HPUX9, an unprivileged user can get load averages this way.
+if test $gl_func_getloadavg_done = no; then
+ AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])
+fi
+
+# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
+# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
+# Irix 4.0.5F has the header but not the library.
+if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
+ && test "$ac_cv_lib_kvm_kvm_open" = yes; then
+ gl_func_getloadavg_done=yes
+ AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
+fi
+
+if test $gl_func_getloadavg_done = no; then
+ AC_CHECK_HEADER([inq_stats/cpustats.h],
+ [gl_func_getloadavg_done=yes
+ AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
+ AC_DEFINE([UMAX4_3], [1],
+ [Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
+ instead of <sys/cpustats.h>.])])
+fi
+
+if test $gl_func_getloadavg_done = no; then
+ AC_CHECK_HEADER([sys/cpustats.h],
+ [gl_func_getloadavg_done=yes; AC_DEFINE([UMAX])])
+fi
+
+if test $gl_func_getloadavg_done = no; then
+ AC_CHECK_HEADERS([mach/mach.h])
+fi
+
+AC_CHECK_HEADERS([nlist.h],
+[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
+ [], [],
+ [#include <nlist.h>])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
+ [[struct nlist x;
+ #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
+ x.n_un.n_name = "";
+ #else
+ x.n_name = "";
+ #endif]])],
+ [AC_DEFINE([N_NAME_POINTER], [1],
+ [Define to 1 if the nlist n_name member is a pointer])])
+])dnl
+])# gl_PREREQ_GETLOADAVG
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
new file mode 100644
index 0000000..7981a09
--- /dev/null
+++ b/gl/m4/getopt.m4
@@ -0,0 +1,381 @@
+# getopt.m4 serial 48
+dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Request a POSIX compliant getopt function.
+AC_DEFUN([gl_FUNC_GETOPT_POSIX],
+[
+ m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+ dnl Other modules can request the gnulib implementation of the getopt
+ dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+ dnl argp.m4 does this.
+ m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+ REPLACE_GETOPT=1
+ ], [
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+ ])
+ GL_GENERATE_GETOPT_H=false
+ GL_GENERATE_GETOPT_CDEFS_H=false
+ if test $REPLACE_GETOPT = 1; then
+ dnl Arrange for getopt.h to be created.
+ gl_GETOPT_SUBSTITUTE_HEADER
+ fi
+])
+
+# Request a POSIX compliant getopt function with GNU extensions (such as
+# options with optional arguments) and the functions getopt_long,
+# getopt_long_only.
+AC_DEFUN([gl_FUNC_GETOPT_GNU],
+[
+ dnl Set the variable gl_getopt_required, so that all invocations of
+ dnl gl_GETOPT_CHECK_HEADERS in the scope of the current configure file
+ dnl will check for getopt with GNU extensions.
+ dnl This means that if one gnulib-tool invocation requests getopt-posix
+ dnl and another gnulib-tool invocation requests getopt-gnu, it is as if
+ dnl both had requested getopt-gnu.
+ m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
+
+ dnl No need to invoke gl_FUNC_GETOPT_POSIX here; this is automatically
+ dnl done through the module dependency getopt-gnu -> getopt-posix.
+])
+
+# Determine whether to replace the entire getopt facility.
+AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
+
+ dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ gl_CHECK_NEXT_HEADERS([getopt.h])
+ if test $ac_cv_header_getopt_h = yes; then
+ HAVE_GETOPT_H=1
+ else
+ HAVE_GETOPT_H=0
+ fi
+ AC_SUBST([HAVE_GETOPT_H])
+
+ gl_replace_getopt=
+
+ dnl Test whether <getopt.h> is available.
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
+ fi
+
+ dnl Test whether the function getopt_long is available.
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
+ fi
+
+ dnl POSIX 2008 does not specify leading '+' behavior, but see
+ dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
+ dnl the next version of POSIX. For now, we only guarantee leading '+'
+ dnl behavior with getopt-gnu.
+ if test -z "$gl_replace_getopt"; then
+ AC_CACHE_CHECK([whether getopt is POSIX compatible],
+ [gl_cv_func_getopt_posix],
+ [
+ dnl Merging these three different test programs into a single one
+ dnl would require a reset mechanism. On BSD systems, it can be done
+ dnl through 'optreset'; on some others (glibc), it can be done by
+ dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+ dnl Solaris 9, musl libc), there is no such mechanism.
+ if test $cross_compiling = no; then
+ dnl Sanity check. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
+ int c;
+
+ c = getopt (4, argv, "ab");
+ if (!(c == 'a'))
+ return 1;
+ c = getopt (4, argv, "ab");
+ if (!(c == -1))
+ return 2;
+ if (!(optind == 2))
+ return 3;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ int c;
+
+ c = getopt (7, argv, "+abp:q:");
+ if (!(c == -1))
+ return 4;
+ if (!(strcmp (argv[0], "program") == 0))
+ return 5;
+ if (!(strcmp (argv[1], "donald") == 0))
+ return 6;
+ if (!(strcmp (argv[2], "-p") == 0))
+ return 7;
+ if (!(strcmp (argv[3], "billy") == 0))
+ return 8;
+ if (!(strcmp (argv[4], "duck") == 0))
+ return 9;
+ if (!(strcmp (argv[5], "-a") == 0))
+ return 10;
+ if (!(strcmp (argv[6], "bar") == 0))
+ return 11;
+ if (!(optind == 1))
+ return 12;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
+ if (getopt (2, argv, "ab:") != 'a')
+ return 13;
+ if (getopt (2, argv, "ab:") != '?')
+ return 14;
+ if (optopt != 'b')
+ return 15;
+ if (optind != 2)
+ return 16;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=yes],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ else
+ case "$host_os" in
+ darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+ *) gl_cv_func_getopt_posix="guessing yes";;
+ esac
+ fi
+ ])
+ case "$gl_cv_func_getopt_posix" in
+ *no) gl_replace_getopt=yes ;;
+ esac
+ fi
+
+ if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+ AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu],
+ [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+ # optstring is necessary for programs like m4 that have POSIX-mandated
+ # semantics for supporting options interspersed with files.
+ # Also, since getopt_long is a GNU extension, we require optind=0.
+ # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+ # so take care to revert to the correct (non-)export state.
+dnl GNU Coding Standards currently allow awk but not env; besides, env
+dnl is ambiguous with environment values that contain newlines.
+ gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+ case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+ xx) gl_had_POSIXLY_CORRECT=exported ;;
+ x) gl_had_POSIXLY_CORRECT=yes ;;
+ *) gl_had_POSIXLY_CORRECT= ;;
+ esac
+ POSIXLY_CORRECT=1
+ export POSIXLY_CORRECT
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]GL_NOCRASH[
+ ]], [[
+ int result = 0;
+
+ nocrash_init();
+
+ /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
+ and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+ OSF/1 5.1, Solaris 10. */
+ {
+ static char conftest[] = "conftest";
+ static char plus[] = "-+";
+ char *argv[3] = { conftest, plus, NULL };
+ opterr = 0;
+ if (getopt (2, argv, "+a") != '?')
+ result |= 1;
+ }
+ /* This code succeeds on glibc 2.8, mingw,
+ and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+ IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
+ {
+ static char program[] = "program";
+ static char p[] = "-p";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, p, foo, bar, NULL };
+
+ optind = 1;
+ if (getopt (4, argv, "p::") != 'p')
+ result |= 2;
+ else if (optarg != NULL)
+ result |= 4;
+ else if (getopt (4, argv, "p::") != -1)
+ result |= 6;
+ else if (optind != 2)
+ result |= 8;
+ }
+ /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
+ {
+ static char program[] = "program";
+ static char foo[] = "foo";
+ static char p[] = "-p";
+ char *argv[] = { program, foo, p, NULL };
+ optind = 0;
+ if (getopt (3, argv, "-p") != 1)
+ result |= 16;
+ else if (getopt (3, argv, "-p") != 'p')
+ result |= 16;
+ }
+ /* This code fails on glibc 2.11. */
+ {
+ static char program[] = "program";
+ static char b[] = "-b";
+ static char a[] = "-a";
+ char *argv[] = { program, b, a, NULL };
+ optind = opterr = 0;
+ if (getopt (3, argv, "+:a:b") != 'b')
+ result |= 32;
+ else if (getopt (3, argv, "+:a:b") != ':')
+ result |= 32;
+ }
+ /* This code dumps core on glibc 2.14. */
+ {
+ static char program[] = "program";
+ static char w[] = "-W";
+ static char dummy[] = "dummy";
+ char *argv[] = { program, w, dummy, NULL };
+ optind = opterr = 1;
+ if (getopt (3, argv, "W;") != 'W')
+ result |= 64;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_getopt_gnu=yes],
+ [gl_cv_func_getopt_gnu=no],
+ [dnl Cross compiling.
+ dnl Assume the worst, even on glibc platforms.
+ dnl But obey --enable-cross-guesses.
+ gl_cv_func_getopt_gnu="$gl_cross_guess_normal"
+ ])
+ case $gl_had_POSIXLY_CORRECT in
+ exported) ;;
+ yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
+ *) AS_UNSET([POSIXLY_CORRECT]) ;;
+ esac
+ ])
+ if test "$gl_cv_func_getopt_gnu" != yes; then
+ gl_replace_getopt=yes
+ else
+ AC_CACHE_CHECK([for working GNU getopt_long function],
+ [gl_cv_func_getopt_long_gnu],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]],
+ [[static const struct option long_options[] =
+ {
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+ /* This code fails on OpenBSD 5.0. */
+ {
+ static char program[] = "program";
+ static char xtremel[] = "--xtremel";
+ char *argv[] = { program, xtremel, NULL };
+ int option_index;
+ optind = 1; opterr = 0;
+ if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+ return 1;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_getopt_long_gnu=yes],
+ [gl_cv_func_getopt_long_gnu=no],
+ [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
+ fi
+ fi
+])
+
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
+[
+ AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
+ if test $ac_cv_header_sys_cdefs_h = yes; then
+ HAVE_SYS_CDEFS_H=1
+ else
+ HAVE_SYS_CDEFS_H=0
+ fi
+ AC_SUBST([HAVE_SYS_CDEFS_H])
+
+ AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
+ [Define to rpl_ if the getopt replacement functions and variables
+ should be used.])
+ GL_GENERATE_GETOPT_H=true
+ GL_GENERATE_GETOPT_CDEFS_H=true
+])
diff --git a/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4
new file mode 100644
index 0000000..b67c527
--- /dev/null
+++ b/gl/m4/getprogname.m4
@@ -0,0 +1,43 @@
+# getprogname.m4 - check for getprogname or replacements for it
+
+# Copyright (C) 2016-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([gl_FUNC_GETPROGNAME],
+[
+ AC_CHECK_FUNCS_ONCE([getprogname getexecname])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ ac_found=0
+ AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [],
+ [#include <errno.h>])
+ AC_CHECK_DECLS([program_invocation_short_name], [ac_found=1], [],
+ [#include <errno.h>])
+ AC_CHECK_DECLS([__argv], [ac_found=1], [], [#include <stdlib.h>])
+
+ # Incur the cost of this test only if none of the above worked.
+ if test $ac_found = 0; then
+ # On OpenBSD 5.1, using the global __progname variable appears to be
+ # the only way to implement getprogname.
+ AC_CACHE_CHECK([whether __progname is defined in default libraries],
+ [gl_cv_var___progname],
+ [
+ gl_cv_var___progname=
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern char *__progname;]],
+ [[return *__progname;]]
+ )],
+ [gl_cv_var___progname=yes]
+ )
+ ]
+ )
+ if test "$gl_cv_var___progname" = yes; then
+ AC_DEFINE([HAVE_VAR___PROGNAME], 1,
+ [Define if you have a global __progname variable])
+ fi
+ fi
+])
diff --git a/gl/m4/gl-openssl.m4 b/gl/m4/gl-openssl.m4
new file mode 100644
index 0000000..7eab4e1
--- /dev/null
+++ b/gl/m4/gl-openssl.m4
@@ -0,0 +1,76 @@
+# gl-openssl.m4 serial 6
+dnl Copyright (C) 2013-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SET_CRYPTO_CHECK_DEFAULT],
+[
+ m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1])
+])
+gl_SET_CRYPTO_CHECK_DEFAULT([no])
+
+AC_DEFUN([gl_CRYPTO_CHECK],
+[
+ dnl gnulib users set this before gl_INIT with gl_SET_CRYPTO_CHECK_DEFAULT()
+ m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT'])
+
+ dnl Only clear once, so crypto routines can be checked for individually
+ m4_divert_once([DEFAULTS], [LIB_CRYPTO=])
+
+ AC_ARG_WITH([openssl],
+ [[ --with-openssl[=ARG] use libcrypto hash routines for the hash functions
+ MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512.
+ Valid ARGs are:
+ 'yes',
+ 'no',
+ 'auto' => use if any version available,
+ 'auto-gpl-compat' => use if GPL compatible version
+ available,
+ 'optional' => use if available
+ and warn if not available;
+ Default is ']gl_CRYPTO_CHECK_DEFAULT['.]m4_ifdef([gl_AF_ALG], [
+ Note also --with-linux-crypto, which will enable the
+ use of Linux kernel crypto routines (if available),
+ which has precedence for files.])],
+ [],
+ [with_openssl=$with_openssl_default])
+
+ AC_SUBST([LIB_CRYPTO])
+ if test "x$with_openssl" != xno; then
+ if test "x$with_openssl" = xauto-gpl-compat; then
+ AC_CACHE_CHECK([whether openssl is GPL compatible],
+ [gl_cv_openssl_gpl_compat],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <openssl/opensslv.h>
+ #if OPENSSL_VERSION_MAJOR < 3
+ #error "openssl >= version 3 not found"
+ #endif
+ ]])],
+ [gl_cv_openssl_gpl_compat=yes],
+ [gl_cv_openssl_gpl_compat=no])])
+ fi
+ if test "x$with_openssl" != xauto-gpl-compat ||
+ test "x$gl_cv_openssl_gpl_compat" = xyes; then
+ AC_CHECK_LIB([crypto], [$1],
+ [AC_CHECK_HEADERS(
+ m4_if([$1], [MD5], [openssl/md5.h], [openssl/sha.h]),
+ [LIB_CRYPTO=-lcrypto
+ AC_DEFINE([HAVE_OPENSSL_$1], [1],
+ [Define to 1 if libcrypto is used for $1.])])])
+ fi
+ if test "x$LIB_CRYPTO" = x; then
+ message='openssl development library not found for $1.
+ If you want to install it, first find the pre-built package name:
+ - On Debian and Debian-based systems: libssl-dev,
+ - On Red Hat distributions: openssl-devel.
+ - Other: https://repology.org/project/openssl/versions'
+ if test "x$with_openssl" = xyes; then
+ AC_MSG_ERROR([$message])
+ elif test "x$with_openssl" = xoptional; then
+ AC_MSG_WARN([$message])
+ fi
+ fi
+ fi
+])
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
new file mode 100644
index 0000000..267f069
--- /dev/null
+++ b/gl/m4/gnulib-cache.m4
@@ -0,0 +1,101 @@
+# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the specification of how gnulib-tool is used.
+# It acts as a cache: It is written and read by gnulib-tool.
+# In projects that use version control, this file is meant to be put under
+# version control, like the configure.ac and various Makefile.am files.
+
+
+# Specification in the form of a command-line invocation:
+# gnulib-tool --import \
+# --lib=libgnu \
+# --source-base=gl \
+# --m4-base=gl/m4 \
+# --doc-base=doc \
+# --tests-base=tests \
+# --aux-dir=build-aux \
+# --no-conditional-dependencies \
+# --no-libtool \
+# --macro-prefix=gl \
+# --no-vc-files \
+# base64 \
+# crypto/sha256 \
+# dirname \
+# environ \
+# floorf \
+# fsusage \
+# getaddrinfo \
+# gethostname \
+# getloadavg \
+# getopt-gnu \
+# gettext-h \
+# idpriv-droptemp \
+# mountlist \
+# regex \
+# setenv \
+# strcase \
+# strcasestr \
+# strsep \
+# timegm \
+# unsetenv \
+# vasprintf \
+# vsnprintf
+
+# Specification in the form of a few gnulib-tool.m4 macro invocations:
+gl_LOCAL_DIR([])
+gl_MODULES([
+ base64
+ crypto/sha256
+ dirname
+ environ
+ floorf
+ fsusage
+ getaddrinfo
+ gethostname
+ getloadavg
+ getopt-gnu
+ gettext-h
+ idpriv-droptemp
+ mountlist
+ regex
+ setenv
+ strcase
+ strcasestr
+ strsep
+ timegm
+ unsetenv
+ vasprintf
+ vsnprintf
+])
+gl_AVOID([])
+gl_SOURCE_BASE([gl])
+gl_M4_BASE([gl/m4])
+gl_PO_BASE([])
+gl_DOC_BASE([doc])
+gl_TESTS_BASE([tests])
+gl_LIB([libgnu])
+gl_MAKEFILE_NAME([])
+gl_MACRO_PREFIX([gl])
+gl_PO_DOMAIN([])
+gl_WITNESS_C_MACRO([])
+gl_VC_FILES([false])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
new file mode 100644
index 0000000..facc340
--- /dev/null
+++ b/gl/m4/gnulib-common.m4
@@ -0,0 +1,1151 @@
+# gnulib-common.m4 serial 75a
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_PREREQ([2.62])
+
+# gl_COMMON
+# is expanded unconditionally through gnulib-tool magic.
+AC_DEFUN([gl_COMMON], [
+ dnl Use AC_REQUIRE here, so that the code is expanded once only.
+ AC_REQUIRE([gl_00GNULIB])
+ AC_REQUIRE([gl_COMMON_BODY])
+ AC_REQUIRE([gl_ZZGNULIB])
+])
+AC_DEFUN([gl_COMMON_BODY], [
+ AH_VERBATIM([_GL_GNUC_PREREQ],
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+])
+ AH_VERBATIM([_Noreturn],
+[/* The _Noreturn keyword of C11. */
+#ifndef _Noreturn
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+ && 0)
+ /* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
+# define _Noreturn [[noreturn]]
+# elif (defined __clang__ && __clang_major__ < 16 \
+ && defined _GL_WORK_AROUND_LLVM_BUG_59792)
+ /* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
+ that rare LLVM bug, though you may get many false-alarm warnings. */
+# define _Noreturn
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || (!defined __STRICT_ANSI__ \
+ && (_GL_GNUC_PREREQ (4, 7) \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+ /* _Noreturn works as-is. */
+# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+])
+ AH_VERBATIM([isoc99_inline],
+[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+ the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+ earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+ __APPLE__ && __MACH__ test for Mac OS X.
+ __APPLE_CC__ tests for the Apple compiler and its version.
+ __STDC_VERSION__ tests for the C99 mode. */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+# define __GNUC_STDC_INLINE__ 1
+#endif])
+ AH_VERBATIM([attribute],
+[/* Attributes. */
+#if (defined __has_attribute \
+ && (!defined __clang_minor__ \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
+#else
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# ifdef _ICC
+# define _GL_ATTR_may_alias 0
+# else
+# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
+#endif
+
+/* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */
+#if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)
+# pragma GCC diagnostic ignored "-Wpedantic"
+#endif
+
+]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead.
+[
+/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
+ is the size of the returned memory block.
+ _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied
+ by the Nth argument of the function is the size of the returned memory block.
+ */
+/* Applies to: function, pointer to function, function types. */
+#ifndef _GL_ATTRIBUTE_ALLOC_SIZE
+# if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+# else
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
+ function and report an error if it cannot do so. */
+/* Applies to: function. */
+#ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
+# if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
+# else
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
+ in stack traces when debugging. The compiler should omit the function from
+ stack traces. */
+/* Applies to: function. */
+#ifndef _GL_ATTRIBUTE_ARTIFICIAL
+# if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
+# else
+# define _GL_ATTRIBUTE_ARTIFICIAL
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */
+/* Applies to: functions. */
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+ <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+ Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
+#ifndef _GL_ATTRIBUTE_COLD
+# if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# ifndef __SUNPRO_C
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
+# else
+# define _GL_ATTRIBUTE_COLD
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
+ calls to the function with the same arguments.
+ This attribute is safe for a function that neither depends on nor affects
+ observable state, and always returns exactly once - e.g., does not loop
+ forever, and does not call longjmp.
+ (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_CONST
+# if _GL_HAS_ATTRIBUTE (const)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+# else
+# define _GL_ATTRIBUTE_CONST
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F.
+ _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if _GL_GNUC_PREREQ (11, 0)
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+/* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
+ to use this earlier definition, since <stdlib.h> may not have been included
+ yet. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
+ The compiler may warn if the entity is used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: namespace, class, template specialization. */
+#ifndef _GL_ATTRIBUTE_DEPRECATED
+# ifdef __has_c_attribute
+# if __has_c_attribute (__deprecated__)
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+# endif
+# ifndef _GL_ATTRIBUTE_DEPRECATED
+# define _GL_ATTRIBUTE_DEPRECATED
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and
+ the function call is not optimized away.
+ _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and
+ the function call is not optimized away. */
+/* Applies to: functions. */
+#if !(defined _GL_ATTRIBUTE_ERROR && defined _GL_ATTRIBUTE_WARNING)
+# if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+# elif _GL_HAS_ATTRIBUTE (diagnose_if)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+# else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain
+ visible to debuggers etc., even with '-fwhole-program'. */
+/* Applies to: functions, variables. */
+#ifndef _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+# if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+# else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if
+ the control flow falls through to the immediately following 'case' or
+ 'default' label. The compiler should not warn in this case. */
+/* Applies to: Empty statement (;), inside a 'switch' statement. */
+/* Always expands to something. */
+#ifndef _GL_ATTRIBUTE_FALLTHROUGH
+# ifdef __has_c_attribute
+# if __has_c_attribute (__fallthrough__)
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_FALLTHROUGH && _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+# endif
+# ifndef _GL_ATTRIBUTE_FALLTHROUGH
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
+ declares that the STRING-INDEXth function argument is a format string of
+ style ARCHETYPE, which is one of:
+ printf, gnu_printf
+ scanf, gnu_scanf,
+ strftime, gnu_strftime,
+ strfmon,
+ or the same thing prefixed and suffixed with '__'.
+ If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+ are suitable for the format string. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_FORMAT
+# if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other
+ compilation unit, it executes code from that unit only by return or by
+ exception handling. This declaration lets the compiler optimize that unit
+ more aggressively. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_LEAF
+# if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+# else
+# define _GL_ATTRIBUTE_LEAF
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if _GL_HAS_ATTRIBUTE (malloc)
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the
+ same storage as pointers to other types. Thus this declaration disables
+ strict aliasing optimization. */
+/* Applies to: types. */
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
+#ifndef _GL_ATTRIBUTE_MAY_ALIAS
+# if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+# else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
+ the entity is not used. The compiler should not warn if the entity is not
+ used. */
+/* Applies to:
+ - function, variable,
+ - struct, union, struct/union member,
+ - enumeration, enumeration item,
+ - typedef,
+ in C++ also: class. */
+/* In C++ and C23, this is spelled [[__maybe_unused__]].
+ GCC's syntax is __attribute__ ((__unused__)).
+ clang supports both syntaxes. */
+#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+# ifdef __has_c_attribute
+# if __has_c_attribute (__maybe_unused__)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+# endif
+# endif
+# ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
+# endif
+#endif
+/* Alternative spelling of this macro, for convenience and for
+ compatibility with glibc/include/libc-symbols.h. */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+/* Earlier spellings of this macro. */
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not
+ discard the return value. The compiler may warn if the caller does not use
+ the return value, unless the caller uses something like ignore_value. */
+/* Applies to: function, enumeration, class. */
+#ifndef _GL_ATTRIBUTE_NODISCARD
+# ifdef __has_c_attribute
+# if __has_c_attribute (__nodiscard__)
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+# endif
+# ifndef _GL_ATTRIBUTE_NODISCARD
+# define _GL_ATTRIBUTE_NODISCARD
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the
+ function. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NOINLINE
+# if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+# else
+# define _GL_ATTRIBUTE_NOINLINE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
+ must not be NULL.
+ _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be
+ null. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NONNULL
+# if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+# else
+# define _GL_ATTRIBUTE_NONNULL(args)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
+ not meant to be NUL-terminated. */
+/* Applies to: struct/union members and variables that are arrays of element
+ type '[[un]signed] char'. */
+#ifndef _GL_ATTRIBUTE_NONSTRING
+# if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+# else
+# define _GL_ATTRIBUTE_NONSTRING
+# endif
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
+
+/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
+ */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_NOTHROW
+# if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+# else
+# define _GL_ATTRIBUTE_NOTHROW
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_PACKED declares:
+ For struct members: The member has the smallest possible alignment.
+ For struct, union, class: All members have the smallest possible alignment,
+ minimizing the memory required. */
+/* Applies to: struct members, struct, union,
+ in C++ also: class. */
+#ifndef _GL_ATTRIBUTE_PACKED
+# if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+# else
+# define _GL_ATTRIBUTE_PACKED
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
+ calls to the function with the same arguments if observable state is not
+ changed between calls.
+ This attribute is safe for a function that does not affect
+ observable state, and always returns exactly once.
+ (This attribute is looser than _GL_ATTRIBUTE_CONST.) */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is
+ a non-NULL pointer. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_RETURNS_NONNULL
+# if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+# else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a
+ trailing NULL argument.
+ _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
+ _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_SENTINEL
+# if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+# else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+# endif
+#endif
+
+/* A helper macro. Don't use it directly. */
+#ifndef _GL_ATTRIBUTE_UNUSED
+# if _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# else
+# define _GL_ATTRIBUTE_UNUSED
+# endif
+#endif
+
+]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
+[
+/* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the
+ immediately preceding label is not used. The compiler should not warn
+ if the label is not used. */
+/* Applies to: label (both in C and C++). */
+/* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
+ syntax. But clang does. */
+#ifndef _GL_UNUSED_LABEL
+# if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
+# else
+# define _GL_UNUSED_LABEL
+# endif
+#endif
+])
+ AH_VERBATIM([async_safe],
+[/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+ signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+ invoked from such signal handlers. Such functions have some restrictions:
+ * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+ or should be listed as async-signal-safe in POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+ section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
+ particular, are NOT async-signal-safe.
+ * All memory locations (variables and struct fields) that these functions
+ access must be marked 'volatile'. This holds for both read and write
+ accesses. Otherwise the compiler might optimize away stores to and
+ reads from such locations that occur in the program, depending on its
+ data flow analysis. For example, when the program contains a loop
+ that is intended to inspect a variable set from within a signal handler
+ while (!signal_occurred)
+ ;
+ the compiler is allowed to transform this into an endless loop if the
+ variable 'signal_occurred' is not declared 'volatile'.
+ Additionally, recall that:
+ * A signal handler should not modify errno (except if it is a handler
+ for a fatal signal and ends by raising the same signal again, thus
+ provoking the termination of the process). If it invokes a function
+ that may clobber errno, it needs to save and restore the value of
+ errno. */
+#define _GL_ASYNC_SAFE
+])
+ AH_VERBATIM([micro_optimizations],
+[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
+ n1 and n2 are expressions without side effects, that evaluate to real
+ numbers (excluding NaN).
+ It returns
+ 1 if n1 > n2
+ 0 if n1 == n2
+ -1 if n1 < n2
+ The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
+ jump with nearly all GCC versions up to GCC 10.
+ This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
+ GCC versions up to GCC 9.
+ The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
+ avoids conditional jumps in all GCC versions >= 3.4. */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+])
+ dnl Hint which direction to take regarding cross-compilation guesses:
+ dnl When a user installs a program on a platform they are not intimately
+ dnl familiar with, --enable-cross-guesses=conservative is the appropriate
+ dnl choice. It implements the "If we don't know, assume the worst" principle.
+ dnl However, when an operating system developer (on a platform which is not
+ dnl yet known to gnulib) builds packages for their platform, they want to
+ dnl expose, not hide, possible platform bugs; in this case,
+ dnl --enable-cross-guesses=risky is the appropriate choice.
+ dnl Sets the variables
+ dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad),
+ dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad).
+ AC_ARG_ENABLE([cross-guesses],
+ [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}],
+ [specify policy for cross-compilation guesses])],
+ [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
+ AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
+ enableval=conservative
+ fi
+ gl_cross_guesses="$enableval"],
+ [gl_cross_guesses=conservative])
+ if test $gl_cross_guesses = risky; then
+ gl_cross_guess_normal="guessing yes"
+ gl_cross_guess_inverted="guessing no"
+ else
+ gl_cross_guess_normal="guessing no"
+ gl_cross_guess_inverted="guessing yes"
+ fi
+ dnl Preparation for running test programs:
+ dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+ dnl to /dev/tty, so they can be redirected to log files. Such diagnostics
+ dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+ LIBC_FATAL_STDERR_=1
+ export LIBC_FATAL_STDERR_
+])
+
+# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename])
+# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename], [initialvalue])
+# initializes the shell variable that indicates the presence of the given module
+# as a C preprocessor expression.
+AC_DEFUN([gl_MODULE_INDICATOR_INIT_VARIABLE],
+[
+ GL_MODULE_INDICATOR_PREFIX[]_[$1]=m4_if([$2], , [0], [$2])
+ AC_SUBST(GL_MODULE_INDICATOR_PREFIX[]_[$1])
+])
+
+# gl_MODULE_INDICATOR_CONDITION
+# expands to a C preprocessor expression that evaluates to 1 or 0, depending
+# whether a gnulib module that has been requested shall be considered present
+# or not.
+m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
+# sets the shell variable that indicates the presence of the given module to
+# a C preprocessor expression that will evaluate to 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
+[
+ gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+ [GL_MODULE_INDICATOR_PREFIX[]_GNULIB_[]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+ [gl_MODULE_INDICATOR_CONDITION])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+# The shell variable's value is a C preprocessor expression that evaluates
+# to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+[
+ m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+ [
+ dnl Simplify the expression VALUE || 1 to 1.
+ $1=1
+ ],
+ [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+ [gl_MODULE_INDICATOR_CONDITION])])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+# modifies the shell variable to include the given condition. The shell
+# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+[
+ dnl Simplify the expression 1 || CONDITION to 1.
+ if test "$[]$1" != 1; then
+ dnl Simplify the expression 0 || CONDITION to CONDITION.
+ if test "$[]$1" = 0; then
+ $1=$2
+ else
+ $1="($[]$1 || $2)"
+ fi
+ fi
+])
+
+# gl_MODULE_INDICATOR([modulename])
+# defines a C macro indicating the presence of the given module
+# in a location where it can be used.
+# | Value | Value |
+# | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules: | 1 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: | 0 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module not present at all: | 0 | 0 |
+# --------------------------------------------+---------+-----------+
+AC_DEFUN([gl_MODULE_INDICATOR],
+[
+ AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
+ [gl_MODULE_INDICATOR_CONDITION],
+ [Define to a C preprocessor expression that evaluates to 1 or 0,
+ depending whether the gnulib module $1 shall be considered present.])
+])
+
+# gl_MODULE_INDICATOR_FOR_TESTS([modulename])
+# defines a C macro indicating the presence of the given module
+# in lib or tests. This is useful to determine whether the module
+# should be tested.
+# | Value | Value |
+# | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules: | 1 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: | 1 | 1 |
+# --------------------------------------------+---------+-----------+
+# Module not present at all: | 0 | 0 |
+# --------------------------------------------+---------+-----------+
+AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
+[
+ AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
+ [Define to 1 when the gnulib module $1 should be tested.])
+])
+
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+ dnl Override gl_WARN_ON_USE_PREPARE.
+ dnl But hide this definition from 'aclocal'.
+ AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+ dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
+# Test whether <features.h> exists.
+# Set HAVE_FEATURES_H.
+AC_DEFUN([gl_FEATURES_H],
+[
+ AC_CHECK_HEADERS_ONCE([features.h])
+ if test $ac_cv_header_features_h = yes; then
+ HAVE_FEATURES_H=1
+ else
+ HAVE_FEATURES_H=0
+ fi
+ AC_SUBST([HAVE_FEATURES_H])
+])
+
+# gl_PROG_CC_C99
+# Modifies the value of the shell variable CC in an attempt to make $CC
+# understand ISO C99 source code.
+AC_DEFUN([gl_PROG_CC_C99],
+[
+ dnl Just use AC_PROG_CC_C99.
+ dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted
+ dnl value of CC will contain the C99 enabling options twice. But this is only
+ dnl a cosmetic problem.
+ dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99;
+ dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete."
+ m4_version_prereq([2.70],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [AC_REQUIRE([AC_PROG_CC_C99])])
+])
+
+# gl_PROG_AR_RANLIB
+# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
+# the values.
+AC_DEFUN([gl_PROG_AR_RANLIB],
+[
+ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+ dnl as "cc", and GCC as "gcc". They have different object file formats and
+ dnl library formats. In particular, the GNU binutils programs ar and ranlib
+ dnl produce libraries that work only with gcc, not with cc.
+ AC_REQUIRE([AC_PROG_CC])
+ dnl The '][' hides this use from 'aclocal'.
+ AC_BEFORE([$0], [A][M_PROG_AR])
+ AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
+ [
+ AC_EGREP_CPP([Amsterdam],
+ [
+#ifdef __ACK__
+Amsterdam
+#endif
+ ],
+ [gl_cv_c_amsterdam_compiler=yes],
+ [gl_cv_c_amsterdam_compiler=no])
+ ])
+
+ dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not
+ dnl building with __ACK__.
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ if test -z "$AR"; then
+ AR='cc -c.a'
+ fi
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='-o'
+ fi
+ else
+ dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST
+ dnl ARFLAGS variable (it is filed into Makefile.in directly by automake
+ dnl script on-demand, if not specified by ./configure of course).
+ dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above
+ dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block
+ dnl because AM_PROG_AR is written so it could re-set AR variable even for
+ dnl __ACK__. It may seem like its easier to avoid calling the macro here,
+ dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
+ dnl default value and automake should usually know them).
+ dnl
+ dnl The '][' hides this use from 'aclocal'.
+ m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
+ fi
+
+ dnl In case the code above has not helped with setting AR/ARFLAGS, use
+ dnl Automake-documented default values for AR and ARFLAGS, but prefer
+ dnl ${host}-ar over ar (useful for cross-compiling).
+ AC_CHECK_TOOL([AR], [ar], [ar])
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cr'
+ fi
+
+ AC_SUBST([AR])
+ AC_SUBST([ARFLAGS])
+ if test -z "$RANLIB"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ RANLIB=':'
+ else
+ dnl Use the ranlib program if it is available.
+ AC_PROG_RANLIB
+ fi
+ fi
+ AC_SUBST([RANLIB])
+])
+
+# AC_C_RESTRICT
+# This definition is copied from post-2.70 Autoconf and overrides the
+# AC_C_RESTRICT macro from autoconf 2.60..2.70.
+m4_version_prereq([2.70.1], [], [
+AC_DEFUN([AC_C_RESTRICT],
+[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
+ [ac_cv_c_restrict=no
+ # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+ # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+ # Put 'restrict' last, because C++ lacks it.
+ for ac_kw in __restrict__ __restrict _Restrict restrict; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[typedef int *int_ptr;
+ int foo (int_ptr $ac_kw ip) { return ip[0]; }
+ int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
+ int bar (int ip[$ac_kw]) { return ip[0]; }
+ ]],
+ [[int s[1];
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+ ]])],
+ [ac_cv_c_restrict=$ac_kw])
+ test "$ac_cv_c_restrict" != no && break
+ done
+ ])
+ AH_VERBATIM([restrict],
+[/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported only directly. */
+#undef restrict
+/* Work around a bug in older versions of Sun C++, which did not
+ #define __restrict__ or support _Restrict or __restrict__
+ even though the corresponding Sun C compiler ended up with
+ "#define restrict _Restrict" or "#define restrict __restrict__"
+ in the previous line. This workaround can be removed once
+ we assume Oracle Developer Studio 12.5 (2016) or later. */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
+# define _Restrict
+# define __restrict__
+#endif])
+ case $ac_cv_c_restrict in
+ restrict) ;;
+ no) AC_DEFINE([restrict], []) ;;
+ *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
+ esac
+])# AC_C_RESTRICT
+])
+
+# gl_BIGENDIAN
+# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
+# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some
+# macros invoke AC_C_BIGENDIAN with arguments.
+AC_DEFUN([gl_BIGENDIAN],
+[
+ AC_C_BIGENDIAN
+])
+
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
+# gl_SILENT(command)
+# executes command, but without the normal configure output.
+# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
+# inside another AC_CACHE_CHECK.
+AC_DEFUN([gl_SILENT],
+[
+ exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+ $1
+ exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
+])
+
+# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
+# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
+# output a spurious "(cached)" mark in the midst of other configure output.
+# This macro should be used instead of AC_CACHE_VAL when it is not surrounded
+# by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
+AC_DEFUN([gl_CACHE_VAL_SILENT],
+[
+ gl_SILENT([
+ AC_CACHE_VAL([$1], [$2])
+ ])
+])
+
+# gl_CONDITIONAL(conditional, condition)
+# is like AM_CONDITIONAL(conditional, condition), except that it does not
+# produce an error
+# configure: error: conditional "..." was never defined.
+# Usually this means the macro was only invoked conditionally.
+# when only invoked conditionally. Instead, in that case, both the _TRUE
+# and the _FALSE case are disabled.
+AC_DEFUN([gl_CONDITIONAL],
+[
+ pushdef([AC_CONFIG_COMMANDS_PRE], [:])dnl
+ AM_CONDITIONAL([$1], [$2])
+ popdef([AC_CONFIG_COMMANDS_PRE])dnl
+ if test -z "${[$1]_TRUE}" && test -z "${[$1]_FALSE}"; then
+ [$1]_TRUE='#'
+ [$1]_FALSE='#'
+ fi
+])
+
+# gl_CC_ALLOW_WARNINGS
+# sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option
+# that reverts a preceding '-Werror' option, if available.
+# This is expected to be '-Wno-error' on gcc, clang (except clang/MSVC), xlclang
+# and empty otherwise.
+AC_DEFUN([gl_CC_ALLOW_WARNINGS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for C compiler option to allow warnings],
+ [gl_cv_cc_wallow],
+ [rm -f conftest*
+ echo 'int dummy;' > conftest.c
+ AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c 2>conftest1.err]) >/dev/null
+ AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Wno-error -c conftest.c 2>conftest2.err]) >/dev/null
+ dnl Test the number of error output lines, because AIX xlc accepts the
+ dnl option '-Wno-error', just to produce a warning
+ dnl "Option -Wno-error was incorrectly specified. The option will be ignored."
+ dnl afterwards.
+ if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then
+ gl_cv_cc_wallow='-Wno-error'
+ else
+ gl_cv_cc_wallow=none
+ fi
+ rm -f conftest*
+ ])
+ case "$gl_cv_cc_wallow" in
+ none) GL_CFLAG_ALLOW_WARNINGS='' ;;
+ *) GL_CFLAG_ALLOW_WARNINGS="$gl_cv_cc_wallow" ;;
+ esac
+ AC_SUBST([GL_CFLAG_ALLOW_WARNINGS])
+])
+
+# gl_CXX_ALLOW_WARNINGS
+# sets and substitutes a variable GL_CXXFLAG_ALLOW_WARNINGS, to a $(CC) option
+# that reverts a preceding '-Werror' option, if available.
+AC_DEFUN([gl_CXX_ALLOW_WARNINGS],
+[
+ dnl Requires AC_PROG_CXX or gl_PROG_ANSI_CXX.
+ if test -n "$CXX" && test "$CXX" != no; then
+ AC_CACHE_CHECK([for C++ compiler option to allow warnings],
+ [gl_cv_cxx_wallow],
+ [rm -f conftest*
+ echo 'int dummy;' > conftest.cc
+ AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>conftest1.err]) >/dev/null
+ AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -Wno-error -c conftest.cc 2>conftest2.err]) >/dev/null
+ dnl Test the number of error output lines, because AIX xlC accepts the
+ dnl option '-Wno-error', just to produce a warning
+ dnl "Option -Wno-error was incorrectly specified. The option will be ignored."
+ dnl afterwards.
+ if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then
+ gl_cv_cxx_wallow='-Wno-error'
+ else
+ gl_cv_cxx_wallow=none
+ fi
+ rm -f conftest*
+ ])
+ case "$gl_cv_cxx_wallow" in
+ none) GL_CXXFLAG_ALLOW_WARNINGS='' ;;
+ *) GL_CXXFLAG_ALLOW_WARNINGS="$gl_cv_cxx_wallow" ;;
+ esac
+ else
+ GL_CXXFLAG_ALLOW_WARNINGS=''
+ fi
+ AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS])
+])
+
+# gl_CC_GNULIB_WARNINGS
+# sets and substitutes a variable GL_CFLAG_GNULIB_WARNINGS, to a $(CC) option
+# set that enables or disables warnings as suitable for the Gnulib coding style.
+AC_DEFUN([gl_CC_GNULIB_WARNINGS],
+[
+ AC_REQUIRE([gl_CC_ALLOW_WARNINGS])
+ dnl Assume that the compiler supports -Wno-* options only if it also supports
+ dnl -Wno-error.
+ GL_CFLAG_GNULIB_WARNINGS=''
+ if test -n "$GL_CFLAG_ALLOW_WARNINGS"; then
+ dnl Enable these warning options:
+ dnl
+ dnl GCC clang
+ dnl -Wno-cast-qual >= 3 >= 3.9
+ dnl -Wno-conversion >= 3 >= 3.9
+ dnl -Wno-float-conversion >= 4.9 >= 3.9
+ dnl -Wno-float-equal >= 3 >= 3.9
+ dnl -Wimplicit-fallthrough >= 7 >= 3.9
+ dnl -Wno-pedantic >= 4.8 >= 3.9
+ dnl -Wno-sign-compare >= 3 >= 3.9
+ dnl -Wno-sign-conversion >= 4.3 >= 3.9
+ dnl -Wno-type-limits >= 4.3 >= 3.9
+ dnl -Wno-undef >= 3 >= 3.9
+ dnl -Wno-unsuffixed-float-constants >= 4.5
+ dnl -Wno-unused-function >= 3 >= 3.9
+ dnl -Wno-unused-parameter >= 3 >= 3.9
+ dnl
+ cat > conftest.c <<\EOF
+ #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-cast-qual
+ -Wno-conversion
+ -Wno-float-equal
+ -Wno-sign-compare
+ -Wno-undef
+ -Wno-unused-function
+ -Wno-unused-parameter
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-float-conversion
+ #endif
+ #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wimplicit-fallthrough
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-pedantic
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
+ -Wno-sign-conversion
+ -Wno-type-limits
+ #endif
+ #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4
+ -Wno-unsuffixed-float-constants
+ #endif
+EOF
+ gl_command="$CC $CFLAGS $CPPFLAGS -E conftest.c > conftest.out"
+ if AC_TRY_EVAL([gl_command]); then
+ gl_options=`grep -v '#' conftest.out`
+ for word in $gl_options; do
+ GL_CFLAG_GNULIB_WARNINGS="$GL_CFLAG_GNULIB_WARNINGS $word"
+ done
+ fi
+ rm -f conftest.c conftest.out
+ fi
+ AC_SUBST([GL_CFLAG_GNULIB_WARNINGS])
+])
+
+dnl gl_CONDITIONAL_HEADER([foo.h])
+dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input
+dnl and produces
+dnl - an AC_SUBSTed variable FOO_H that is either a file name or empty, based
+dnl on whether GL_GENERATE_FOO_H is true or false,
+dnl - an Automake conditional GL_GENERATE_FOO_H that evaluates to the value of
+dnl the shell variable GL_GENERATE_FOO_H.
+AC_DEFUN([gl_CONDITIONAL_HEADER],
+[
+ m4_pushdef([gl_header_name], AS_TR_SH(m4_toupper($1)))
+ m4_pushdef([gl_generate_var], [GL_GENERATE_]AS_TR_SH(m4_toupper($1)))
+ m4_pushdef([gl_generate_cond], [GL_GENERATE_]AS_TR_SH(m4_toupper($1)))
+ case "$gl_generate_var" in
+ false) gl_header_name='' ;;
+ true)
+ dnl It is OK to use a .h file in lib/ from within tests/, but not vice
+ dnl versa.
+ if test -z "$gl_header_name"; then
+ gl_header_name="${gl_source_base_prefix}$1"
+ fi
+ ;;
+ *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;;
+ esac
+ AC_SUBST(gl_header_name)
+ gl_CONDITIONAL(gl_generate_cond, [$gl_generate_var])
+ m4_popdef([gl_generate_cond])
+ m4_popdef([gl_generate_var])
+ m4_popdef([gl_header_name])
+])
+
+dnl Expands to some code for use in .c programs that, on native Windows, defines
+dnl the Microsoft deprecated alias function names to the underscore-prefixed
+dnl actual function names. With this macro, these function names are available
+dnl without linking with '-loldnames' and without generating warnings.
+dnl Usage: Use it after all system header files are included.
+dnl #include <...>
+dnl #include <...>
+dnl ]GL_MDA_DEFINES[
+dnl ...
+AC_DEFUN([GL_MDA_DEFINES],[
+AC_REQUIRE([_GL_MDA_DEFINES])
+[$gl_mda_defines]
+])
+AC_DEFUN([_GL_MDA_DEFINES],
+[gl_mda_defines='
+#if defined _WIN32 && !defined __CYGWIN__
+#define access _access
+#define chdir _chdir
+#define chmod _chmod
+#define close _close
+#define creat _creat
+#define dup _dup
+#define dup2 _dup2
+#define ecvt _ecvt
+#define execl _execl
+#define execle _execle
+#define execlp _execlp
+#define execv _execv
+#define execve _execve
+#define execvp _execvp
+#define execvpe _execvpe
+#define fcloseall _fcloseall
+#define fcvt _fcvt
+#define fdopen _fdopen
+#define fileno _fileno
+#define gcvt _gcvt
+#define getcwd _getcwd
+#define getpid _getpid
+#define getw _getw
+#define isatty _isatty
+#define j0 _j0
+#define j1 _j1
+#define jn _jn
+#define lfind _lfind
+#define lsearch _lsearch
+#define lseek _lseek
+#define memccpy _memccpy
+#define mkdir _mkdir
+#define mktemp _mktemp
+#define open _open
+#define putenv _putenv
+#define putw _putw
+#define read _read
+#define rmdir _rmdir
+#define strdup _strdup
+#define swab _swab
+#define tempnam _tempnam
+#define tzset _tzset
+#define umask _umask
+#define unlink _unlink
+#define utime _utime
+#define wcsdup _wcsdup
+#define write _write
+#define y0 _y0
+#define y1 _y1
+#define yn _yn
+#endif
+'
+])
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
new file mode 100644
index 0000000..4764622
--- /dev/null
+++ b/gl/m4/gnulib-comp.m4
@@ -0,0 +1,1354 @@
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
+# Copyright (C) 2002-2023 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the compiled summary of the specification in
+# gnulib-cache.m4. It lists the computed macro invocations that need
+# to be invoked from configure.ac.
+# In projects that use version control, this file can be treated like
+# other built files.
+
+
+# This macro should be invoked from ./configure.ac, in the section
+# "Checks for programs", right after AC_PROG_CC, and certainly before
+# any checks for libraries, header files, types and library functions.
+AC_DEFUN([gl_EARLY],
+[
+ m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
+ m4_pattern_allow([^gl_ES$])dnl a valid locale name
+ m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+ m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+
+ # Pre-early section.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_PROG_AR_RANLIB])
+
+ # Code from module absolute-header:
+ # Code from module alloca-opt:
+ # Code from module arpa_inet:
+ # Code from module assert-h:
+ # Code from module attribute:
+ # Code from module base64:
+ # Code from module basename-lgpl:
+ # Code from module btowc:
+ # Code from module builtin-expect:
+ # Code from module byteswap:
+ # Code from module c99:
+ # Code from module calloc-gnu:
+ # Code from module calloc-posix:
+ # Code from module cloexec:
+ # Code from module close:
+ # Code from module crypto/af_alg:
+ # Code from module crypto/sha256:
+ # Code from module crypto/sha256-buffer:
+ # Code from module dirname:
+ # Code from module dirname-lgpl:
+ # Code from module double-slash-root:
+ # Code from module dup2:
+ # Code from module environ:
+ # Code from module errno:
+ # Code from module error:
+ # Code from module exitfail:
+ # Code from module extensions:
+ # Code from module extern-inline:
+ # Code from module fcntl:
+ # Code from module fcntl-h:
+ # Code from module fd-hook:
+ # Code from module fflush:
+ AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
+ # Code from module filename:
+ # Code from module float:
+ # Code from module floorf:
+ # Code from module fopen:
+ # Code from module fopen-gnu:
+ # Code from module fpurge:
+ # Code from module freading:
+ # Code from module free-posix:
+ # Code from module fseek:
+ # Code from module fseeko:
+ AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
+ # Code from module fstat:
+ # Code from module fsusage:
+ # Code from module ftell:
+ # Code from module ftello:
+ AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
+ # Code from module gen-header:
+ # Code from module getaddrinfo:
+ # Code from module getdelim:
+ # Code from module getdtablesize:
+ # Code from module gethostname:
+ # Code from module getline:
+ # Code from module getloadavg:
+ # Code from module getopt-gnu:
+ # Code from module getopt-posix:
+ # Code from module getprogname:
+ # Code from module gettext-h:
+ # Code from module glibc-internal/dynarray:
+ # Code from module hard-locale:
+ # Code from module hostent:
+ # Code from module ialloc:
+ # Code from module idpriv-droptemp:
+ # Code from module idx:
+ # Code from module include_next:
+ # Code from module inet_ntop:
+ # Code from module intprops:
+ # Code from module inttypes-incomplete:
+ # Code from module langinfo:
+ # Code from module largefile:
+ AC_REQUIRE([AC_SYS_LARGEFILE])
+ # Code from module libc-config:
+ # Code from module limits-h:
+ # Code from module localcharset:
+ # Code from module locale:
+ # Code from module localeconv:
+ # Code from module lock:
+ # Code from module lseek:
+ # Code from module malloc-gnu:
+ # Code from module malloc-posix:
+ # Code from module malloca:
+ # Code from module math:
+ # Code from module mbrtowc:
+ # Code from module mbsinit:
+ # Code from module mbtowc:
+ # Code from module memchr:
+ # Code from module minmax:
+ # Code from module mktime:
+ # Code from module mktime-internal:
+ # Code from module mountlist:
+ # Code from module msvc-inval:
+ # Code from module msvc-nothrow:
+ # Code from module multiarch:
+ # Code from module netdb:
+ # Code from module netinet_in:
+ # Code from module nl_langinfo:
+ # Code from module nocrash:
+ # Code from module open:
+ # Code from module pathmax:
+ # Code from module realloc-gnu:
+ # Code from module realloc-posix:
+ # Code from module reallocarray:
+ # Code from module regex:
+ # Code from module servent:
+ # Code from module setenv:
+ # Code from module setlocale-null:
+ # Code from module size_max:
+ # Code from module snippet/_Noreturn:
+ # Code from module snippet/arg-nonnull:
+ # Code from module snippet/c++defs:
+ # Code from module snippet/warn-on-use:
+ # Code from module snprintf:
+ # Code from module socketlib:
+ # Code from module sockets:
+ # Code from module socklen:
+ # Code from module ssize_t:
+ # Code from module stat:
+ # Code from module stat-time:
+ # Code from module std-gnu11:
+ # Code from module stdalign:
+ # Code from module stdbool:
+ # Code from module stdckdint:
+ # Code from module stddef:
+ # Code from module stdint:
+ # Code from module stdio:
+ # Code from module stdlib:
+ # Code from module strcase:
+ # Code from module strcasestr:
+ # Code from module strcasestr-simple:
+ # Code from module streq:
+ # Code from module strerror:
+ # Code from module strerror-override:
+ # Code from module string:
+ # Code from module strings:
+ # Code from module strsep:
+ # Code from module strstr-simple:
+ # Code from module sys_socket:
+ # Code from module sys_stat:
+ # Code from module sys_types:
+ # Code from module sys_uio:
+ # Code from module threadlib:
+ gl_THREADLIB_EARLY
+ # Code from module time:
+ # Code from module time_r:
+ # Code from module timegm:
+ # Code from module unistd:
+ # Code from module unlocked-io-internal:
+ # Code from module unsetenv:
+ # Code from module vararrays:
+ # Code from module vasnprintf:
+ # Code from module vasprintf:
+ # Code from module verify:
+ # Code from module vsnprintf:
+ # Code from module wchar:
+ # Code from module wcrtomb:
+ # Code from module wctype-h:
+ # Code from module windows-mutex:
+ # Code from module windows-once:
+ # Code from module windows-recmutex:
+ # Code from module windows-rwlock:
+ # Code from module xalloc:
+ # Code from module xalloc-die:
+ # Code from module xalloc-oversized:
+ # Code from module xsize:
+])
+
+# This macro should be invoked from ./configure.ac, in the section
+# "Check for header files, types and library functions".
+AC_DEFUN([gl_INIT],
+[
+ AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
+ gl_cond_libtool=false
+ gl_libdeps=
+ gl_ltlibdeps=
+ gl_m4_base='gl/m4'
+ m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
+ m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
+ m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
+ m4_pushdef([gl_LIBSOURCES_LIST], [])
+ m4_pushdef([gl_LIBSOURCES_DIR], [])
+ m4_pushdef([GL_MACRO_PREFIX], [gl])
+ m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL])
+ gl_COMMON
+ gl_source_base='gl'
+ gl_source_base_prefix=
+ gl_FUNC_ALLOCA
+ gl_CONDITIONAL_HEADER([alloca.h])
+ AC_PROG_MKDIR_P
+ gl_ARPA_INET_H
+ gl_ARPA_INET_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_ASSERT_H
+ gl_CONDITIONAL_HEADER([assert.h])
+ AC_PROG_MKDIR_P
+ gl_FUNC_BASE64
+ gl_FUNC_BTOWC
+ gl_CONDITIONAL([GL_COND_OBJ_BTOWC],
+ [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1])
+ AM_COND_IF([GL_COND_OBJ_BTOWC], [
+ gl_PREREQ_BTOWC
+ ])
+ gl_WCHAR_MODULE_INDICATOR([btowc])
+ gl___BUILTIN_EXPECT
+ gl_BYTESWAP
+ gl_CONDITIONAL_HEADER([byteswap.h])
+ AC_PROG_MKDIR_P
+ gl_FUNC_CALLOC_GNU
+ if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then
+ AC_LIBOBJ([calloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([calloc-gnu])
+ gl_FUNC_CALLOC_POSIX
+ if test $REPLACE_CALLOC_FOR_CALLOC_POSIX = 1; then
+ AC_LIBOBJ([calloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([calloc-posix])
+ gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
+ gl_FUNC_CLOSE
+ gl_CONDITIONAL([GL_COND_OBJ_CLOSE], [test $REPLACE_CLOSE = 1])
+ gl_UNISTD_MODULE_INDICATOR([close])
+ gl_AF_ALG
+ AC_REQUIRE([AC_C_RESTRICT])
+ gl_SHA256
+ gl_MODULE_INDICATOR([dirname])
+ gl_DOUBLE_SLASH_ROOT
+ gl_FUNC_DUP2
+ gl_CONDITIONAL([GL_COND_OBJ_DUP2], [test $REPLACE_DUP2 = 1])
+ AM_COND_IF([GL_COND_OBJ_DUP2], [
+ gl_PREREQ_DUP2
+ ])
+ gl_UNISTD_MODULE_INDICATOR([dup2])
+ gl_ENVIRON
+ gl_UNISTD_MODULE_INDICATOR([environ])
+ gl_HEADER_ERRNO_H
+ gl_CONDITIONAL_HEADER([errno.h])
+ AC_PROG_MKDIR_P
+ gl_ERROR
+ gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test "$ac_cv_lib_error_at_line" = no])
+ AM_COND_IF([GL_COND_OBJ_ERROR], [
+ gl_PREREQ_ERROR
+ ])
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
+ AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+ AC_REQUIRE([gl_EXTERN_INLINE])
+ gl_FUNC_FCNTL
+ gl_CONDITIONAL([GL_COND_OBJ_FCNTL],
+ [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1])
+ gl_FCNTL_MODULE_INDICATOR([fcntl])
+ gl_FCNTL_H
+ gl_FCNTL_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_FFLUSH
+ gl_CONDITIONAL([GL_COND_OBJ_FFLUSH], [test $REPLACE_FFLUSH = 1])
+ AM_COND_IF([GL_COND_OBJ_FFLUSH], [
+ gl_PREREQ_FFLUSH
+ ])
+ gl_MODULE_INDICATOR([fflush])
+ gl_STDIO_MODULE_INDICATOR([fflush])
+ gl_FLOAT_H
+ gl_CONDITIONAL_HEADER([float.h])
+ AC_PROG_MKDIR_P
+ gl_CONDITIONAL([GL_COND_OBJ_FLOAT], [test $REPLACE_FLOAT_LDBL = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_ITOLD], [test $REPLACE_ITOLD = 1])
+ gl_FUNC_FLOORF
+ gl_CONDITIONAL([GL_COND_OBJ_FLOORF],
+ [test $HAVE_DECL_FLOORF = 0 || test $REPLACE_FLOORF = 1])
+ gl_MATH_MODULE_INDICATOR([floorf])
+ gl_FUNC_FOPEN
+ if test $REPLACE_FOPEN = 1; then
+ AC_LIBOBJ([fopen])
+ gl_PREREQ_FOPEN
+ fi
+ gl_STDIO_MODULE_INDICATOR([fopen])
+ gl_FUNC_FOPEN_GNU
+ if test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1; then
+ AC_LIBOBJ([fopen])
+ gl_PREREQ_FOPEN
+ fi
+ gl_MODULE_INDICATOR([fopen-gnu])
+ gl_STDIO_MODULE_INDICATOR([fopen-gnu])
+ gl_FUNC_FPURGE
+ gl_CONDITIONAL([GL_COND_OBJ_FPURGE],
+ [test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1])
+ gl_STDIO_MODULE_INDICATOR([fpurge])
+ gl_FUNC_FREADING
+ gl_FUNC_FREE
+ gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1])
+ AM_COND_IF([GL_COND_OBJ_FREE], [
+ gl_PREREQ_FREE
+ ])
+ gl_STDLIB_MODULE_INDICATOR([free-posix])
+ gl_FUNC_FSEEK
+ gl_CONDITIONAL([GL_COND_OBJ_FSEEK], [test $REPLACE_FSEEK = 1])
+ gl_STDIO_MODULE_INDICATOR([fseek])
+ gl_FUNC_FSEEKO
+ gl_CONDITIONAL([GL_COND_OBJ_FSEEKO],
+ [test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1])
+ AM_COND_IF([GL_COND_OBJ_FSEEKO], [
+ gl_PREREQ_FSEEKO
+ ])
+ gl_STDIO_MODULE_INDICATOR([fseeko])
+ gl_FUNC_FSTAT
+ gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1])
+ AM_COND_IF([GL_COND_OBJ_FSTAT], [
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([stat-w32])
+ ;;
+ esac
+ gl_PREREQ_FSTAT
+ ])
+ gl_SYS_STAT_MODULE_INDICATOR([fstat])
+ gl_FSUSAGE
+ gl_CONDITIONAL([GL_COND_OBJ_FSUSAGE], [test $gl_cv_fs_space = yes])
+ AM_COND_IF([GL_COND_OBJ_FSUSAGE], [
+ gl_PREREQ_FSUSAGE_EXTRA
+ ])
+ gl_FUNC_FTELL
+ gl_CONDITIONAL([GL_COND_OBJ_FTELL], [test $REPLACE_FTELL = 1])
+ gl_STDIO_MODULE_INDICATOR([ftell])
+ gl_FUNC_FTELLO
+ gl_CONDITIONAL([GL_COND_OBJ_FTELLO],
+ [test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1])
+ AM_COND_IF([GL_COND_OBJ_FTELLO], [
+ gl_PREREQ_FTELLO
+ ])
+ gl_STDIO_MODULE_INDICATOR([ftello])
+ gl_GETADDRINFO
+ gl_CONDITIONAL([GL_COND_OBJ_GETADDRINFO],
+ [test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_GAI_STRERROR],
+ [test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1])
+ gl_NETDB_MODULE_INDICATOR([getaddrinfo])
+ gl_FUNC_GETDELIM
+ gl_CONDITIONAL([GL_COND_OBJ_GETDELIM],
+ [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1])
+ AM_COND_IF([GL_COND_OBJ_GETDELIM], [
+ gl_PREREQ_GETDELIM
+ ])
+ gl_STDIO_MODULE_INDICATOR([getdelim])
+ gl_FUNC_GETDTABLESIZE
+ gl_CONDITIONAL([GL_COND_OBJ_GETDTABLESIZE],
+ [test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1])
+ AM_COND_IF([GL_COND_OBJ_GETDTABLESIZE], [
+ gl_PREREQ_GETDTABLESIZE
+ ])
+ gl_UNISTD_MODULE_INDICATOR([getdtablesize])
+ gl_FUNC_GETHOSTNAME
+ gl_CONDITIONAL([GL_COND_OBJ_GETHOSTNAME], [test $HAVE_GETHOSTNAME = 0])
+ AM_COND_IF([GL_COND_OBJ_GETHOSTNAME], [
+ gl_PREREQ_GETHOSTNAME
+ ])
+ gl_UNISTD_MODULE_INDICATOR([gethostname])
+ gl_FUNC_GETLINE
+ gl_CONDITIONAL([GL_COND_OBJ_GETLINE], [test $REPLACE_GETLINE = 1])
+ AM_COND_IF([GL_COND_OBJ_GETLINE], [
+ gl_PREREQ_GETLINE
+ ])
+ gl_STDIO_MODULE_INDICATOR([getline])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_GETLOADAVG
+ gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0])
+ AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [
+ gl_PREREQ_GETLOADAVG
+ ])
+ gl_STDLIB_MODULE_INDICATOR([getloadavg])
+ gl_FUNC_GETOPT_GNU
+ dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required
+ dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are
+ dnl done in the getopt-posix module.
+ gl_FUNC_GETOPT_POSIX
+ gl_CONDITIONAL_HEADER([getopt.h])
+ gl_CONDITIONAL_HEADER([getopt-cdefs.h])
+ AC_PROG_MKDIR_P
+ gl_CONDITIONAL([GL_COND_OBJ_GETOPT], [test $REPLACE_GETOPT = 1])
+ AM_COND_IF([GL_COND_OBJ_GETOPT], [
+ dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1.
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
+ ])
+ gl_UNISTD_MODULE_INDICATOR([getopt-posix])
+ gl_FUNC_GETPROGNAME
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+ AC_SUBST([LIB_HARD_LOCALE])
+ gl_HOSTENT
+ gl_IDPRIV
+ gl_FUNC_INET_NTOP
+ gl_CONDITIONAL([GL_COND_OBJ_INET_NTOP],
+ [test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1])
+ AM_COND_IF([GL_COND_OBJ_INET_NTOP], [
+ gl_PREREQ_INET_NTOP
+ ])
+ gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
+ gl_INTTYPES_INCOMPLETE
+ gl_INTTYPES_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_LANGINFO_H
+ gl_LANGINFO_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_LARGEFILE])
+ gl___INLINE
+ gl_LIMITS_H
+ gl_CONDITIONAL_HEADER([limits.h])
+ AC_PROG_MKDIR_P
+ gl_LOCALCHARSET
+ dnl For backward compatibility. Some packages still use this.
+ LOCALCHARSET_TESTS_ENVIRONMENT=
+ AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+ gl_LOCALE_H
+ gl_LOCALE_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_LOCALECONV
+ gl_CONDITIONAL([GL_COND_OBJ_LOCALECONV], [test $REPLACE_LOCALECONV = 1])
+ AM_COND_IF([GL_COND_OBJ_LOCALECONV], [
+ gl_PREREQ_LOCALECONV
+ ])
+ gl_LOCALE_MODULE_INDICATOR([localeconv])
+ gl_LOCK
+ gl_MODULE_INDICATOR([lock])
+ gl_FUNC_LSEEK
+ gl_CONDITIONAL([GL_COND_OBJ_LSEEK], [test $REPLACE_LSEEK = 1])
+ gl_UNISTD_MODULE_INDICATOR([lseek])
+ gl_FUNC_MALLOC_GNU
+ if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1; then
+ AC_LIBOBJ([malloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([malloc-gnu])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ AC_LIBOBJ([malloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+ gl_MALLOCA
+ gl_MATH_H
+ gl_MATH_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_MBRTOWC
+ gl_CONDITIONAL([GL_COND_OBJ_MBRTOWC],
+ [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1])
+ AM_COND_IF([GL_COND_OBJ_MBRTOWC], [
+ if test $REPLACE_MBSTATE_T = 1; then
+ AC_LIBOBJ([lc-charset-dispatch])
+ AC_LIBOBJ([mbtowc-lock])
+ gl_PREREQ_MBTOWC_LOCK
+ fi
+ gl_PREREQ_MBRTOWC
+ ])
+ gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+ gl_FUNC_MBSINIT
+ gl_CONDITIONAL([GL_COND_OBJ_MBSINIT],
+ [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1])
+ AM_COND_IF([GL_COND_OBJ_MBSINIT], [
+ gl_PREREQ_MBSINIT
+ ])
+ gl_WCHAR_MODULE_INDICATOR([mbsinit])
+ gl_FUNC_MBTOWC
+ gl_CONDITIONAL([GL_COND_OBJ_MBTOWC],
+ [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1])
+ AM_COND_IF([GL_COND_OBJ_MBTOWC], [
+ gl_PREREQ_MBTOWC
+ ])
+ gl_STDLIB_MODULE_INDICATOR([mbtowc])
+ gl_FUNC_MEMCHR
+ gl_CONDITIONAL([GL_COND_OBJ_MEMCHR], [test $REPLACE_MEMCHR = 1])
+ AM_COND_IF([GL_COND_OBJ_MEMCHR], [
+ gl_PREREQ_MEMCHR
+ ])
+ gl_STRING_MODULE_INDICATOR([memchr])
+ gl_MINMAX
+ gl_FUNC_MKTIME
+ if test $REPLACE_MKTIME = 1; then
+ AC_LIBOBJ([mktime])
+ gl_PREREQ_MKTIME
+ fi
+ gl_TIME_MODULE_INDICATOR([mktime])
+ gl_FUNC_MKTIME_INTERNAL
+ if test $WANT_MKTIME_INTERNAL = 1; then
+ AC_LIBOBJ([mktime])
+ gl_PREREQ_MKTIME
+ fi
+ gl_MOUNTLIST
+ gl_CONDITIONAL([GL_COND_OBJ_MOUNTLIST], [test $gl_cv_list_mounted_fs = yes])
+ AM_COND_IF([GL_COND_OBJ_MOUNTLIST], [
+ gl_PREREQ_MOUNTLIST_EXTRA
+ ])
+ AC_REQUIRE([gl_MSVC_INVAL])
+ gl_CONDITIONAL([GL_COND_OBJ_MSVC_INVAL],
+ [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1])
+ AC_REQUIRE([gl_MSVC_NOTHROW])
+ gl_CONDITIONAL([GL_COND_OBJ_MSVC_NOTHROW],
+ [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1])
+ gl_MODULE_INDICATOR([msvc-nothrow])
+ gl_MULTIARCH
+ gl_NETDB_H
+ gl_NETDB_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_HEADER_NETINET_IN
+ gl_CONDITIONAL_HEADER([netinet/in.h])
+ AC_PROG_MKDIR_P
+ gl_FUNC_NL_LANGINFO
+ gl_CONDITIONAL([GL_COND_OBJ_NL_LANGINFO],
+ [test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_NL_LANGINFO_LOCK],
+ [test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0])
+ if test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0; then
+ gl_PREREQ_NL_LANGINFO_LOCK
+ fi
+ gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
+ gl_FUNC_OPEN
+ gl_CONDITIONAL([GL_COND_OBJ_OPEN], [test $REPLACE_OPEN = 1])
+ AM_COND_IF([GL_COND_OBJ_OPEN], [
+ gl_PREREQ_OPEN
+ ])
+ gl_FCNTL_MODULE_INDICATOR([open])
+ gl_PATHMAX
+ gl_FUNC_REALLOC_GNU
+ if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 1; then
+ AC_LIBOBJ([realloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([realloc-gnu])
+ gl_FUNC_REALLOC_POSIX
+ if test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1; then
+ AC_LIBOBJ([realloc])
+ fi
+ gl_STDLIB_MODULE_INDICATOR([realloc-posix])
+ gl_FUNC_REALLOCARRAY
+ gl_CONDITIONAL([GL_COND_OBJ_REALLOCARRAY],
+ [test $HAVE_REALLOCARRAY = 0 || test $REPLACE_REALLOCARRAY = 1])
+ AM_COND_IF([GL_COND_OBJ_REALLOCARRAY], [
+ gl_PREREQ_REALLOCARRAY
+ ])
+ gl_MODULE_INDICATOR([reallocarray])
+ gl_STDLIB_MODULE_INDICATOR([reallocarray])
+ gl_REGEX
+ gl_CONDITIONAL([GL_COND_OBJ_REGEX], [test $ac_use_included_regex = yes])
+ AM_COND_IF([GL_COND_OBJ_REGEX], [
+ gl_PREREQ_REGEX
+ ])
+ gl_SERVENT
+ gl_FUNC_SETENV
+ gl_CONDITIONAL([GL_COND_OBJ_SETENV],
+ [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1])
+ gl_STDLIB_MODULE_INDICATOR([setenv])
+ gl_FUNC_SETLOCALE_NULL
+ gl_CONDITIONAL([GL_COND_OBJ_SETLOCALE_LOCK],
+ [test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0])
+ AM_COND_IF([GL_COND_OBJ_SETLOCALE_LOCK], [
+ gl_PREREQ_SETLOCALE_LOCK
+ ])
+ gl_LOCALE_MODULE_INDICATOR([setlocale_null])
+ gl_SIZE_MAX
+ gl_FUNC_SNPRINTF
+ gl_STDIO_MODULE_INDICATOR([snprintf])
+ gl_MODULE_INDICATOR([snprintf])
+ AC_REQUIRE([gl_SOCKETLIB])
+ AC_REQUIRE([gl_SOCKETS])
+ gl_TYPE_SOCKLEN_T
+ gt_TYPE_SSIZE_T
+ gl_FUNC_STAT
+ gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1])
+ AM_COND_IF([GL_COND_OBJ_STAT], [
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([stat-w32])
+ ;;
+ esac
+ gl_PREREQ_STAT
+ ])
+ gl_SYS_STAT_MODULE_INDICATOR([stat])
+ gl_STAT_TIME
+ gl_STAT_BIRTHTIME
+ gl_STDALIGN_H
+ gl_CONDITIONAL_HEADER([stdalign.h])
+ AC_PROG_MKDIR_P
+ gl_C_BOOL
+ AC_CHECK_HEADERS_ONCE([stdckdint.h])
+ if test $ac_cv_header_stdckdint_h = yes; then
+ GL_GENERATE_STDCKDINT_H=false
+ else
+ GL_GENERATE_STDCKDINT_H=true
+ fi
+ gl_CONDITIONAL_HEADER([stdckdint.h])
+ AC_PROG_MKDIR_P
+ gl_STDDEF_H
+ gl_STDDEF_H_REQUIRE_DEFAULTS
+ gl_CONDITIONAL_HEADER([stddef.h])
+ AC_PROG_MKDIR_P
+ gl_STDINT_H
+ gl_CONDITIONAL_HEADER([stdint.h])
+ dnl Because of gl_REPLACE_LIMITS_H:
+ gl_CONDITIONAL_HEADER([limits.h])
+ AC_PROG_MKDIR_P
+ gl_STDIO_H
+ gl_STDIO_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1])
+ gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1])
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ gl_STDIO_MODULE_INDICATOR([fscanf])
+ gl_MODULE_INDICATOR([fscanf])
+ gl_STDIO_MODULE_INDICATOR([scanf])
+ gl_MODULE_INDICATOR([scanf])
+ gl_STDIO_MODULE_INDICATOR([fgetc])
+ gl_STDIO_MODULE_INDICATOR([getc])
+ gl_STDIO_MODULE_INDICATOR([getchar])
+ gl_STDIO_MODULE_INDICATOR([fgets])
+ gl_STDIO_MODULE_INDICATOR([fread])
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ gl_STDIO_MODULE_INDICATOR([fprintf])
+ gl_STDIO_MODULE_INDICATOR([printf])
+ gl_STDIO_MODULE_INDICATOR([vfprintf])
+ gl_STDIO_MODULE_INDICATOR([vprintf])
+ gl_STDIO_MODULE_INDICATOR([fputc])
+ gl_STDIO_MODULE_INDICATOR([putc])
+ gl_STDIO_MODULE_INDICATOR([putchar])
+ gl_STDIO_MODULE_INDICATOR([fputs])
+ gl_STDIO_MODULE_INDICATOR([puts])
+ gl_STDIO_MODULE_INDICATOR([fwrite])
+ gl_STDLIB_H
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_STRCASE
+ gl_CONDITIONAL([GL_COND_OBJ_STRCASECMP], [test $HAVE_STRCASECMP = 0])
+ AM_COND_IF([GL_COND_OBJ_STRCASECMP], [
+ gl_PREREQ_STRCASECMP
+ ])
+ gl_CONDITIONAL([GL_COND_OBJ_STRNCASECMP], [test $HAVE_STRNCASECMP = 0])
+ AM_COND_IF([GL_COND_OBJ_STRNCASECMP], [
+ gl_PREREQ_STRNCASECMP
+ ])
+ gl_FUNC_STRCASESTR
+ if test $HAVE_STRCASESTR = 0 || test $REPLACE_STRCASESTR = 1; then
+ AC_LIBOBJ([strcasestr])
+ gl_PREREQ_STRCASESTR
+ fi
+ gl_FUNC_STRCASESTR_SIMPLE
+ if test $HAVE_STRCASESTR = 0 || test $REPLACE_STRCASESTR = 1; then
+ AC_LIBOBJ([strcasestr])
+ gl_PREREQ_STRCASESTR
+ fi
+ gl_STRING_MODULE_INDICATOR([strcasestr])
+ gl_FUNC_STRERROR
+ gl_CONDITIONAL([GL_COND_OBJ_STRERROR], [test $REPLACE_STRERROR = 1])
+ gl_MODULE_INDICATOR([strerror])
+ gl_STRING_MODULE_INDICATOR([strerror])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ gl_CONDITIONAL([GL_COND_OBJ_STRERROR_OVERRIDE],
+ [test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1])
+ AM_COND_IF([GL_COND_OBJ_STRERROR_OVERRIDE], [
+ gl_PREREQ_SYS_H_WINSOCK2
+ ])
+ gl_STRING_H
+ gl_STRING_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_STRINGS_H
+ gl_STRINGS_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_STRSEP
+ gl_CONDITIONAL([GL_COND_OBJ_STRSEP], [test $HAVE_STRSEP = 0])
+ AM_COND_IF([GL_COND_OBJ_STRSEP], [
+ gl_PREREQ_STRSEP
+ ])
+ gl_STRING_MODULE_INDICATOR([strsep])
+ gl_FUNC_STRSTR_SIMPLE
+ if test $REPLACE_STRSTR = 1; then
+ AC_LIBOBJ([strstr])
+ fi
+ gl_STRING_MODULE_INDICATOR([strstr])
+ gl_SYS_SOCKET_H
+ gl_SYS_SOCKET_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_STAT_H
+ gl_SYS_STAT_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_TYPES_H
+ gl_SYS_TYPES_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_SYS_UIO_H
+ gl_SYS_UIO_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_THREADLIB])
+ gl_TIME_H
+ gl_TIME_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_TIME_R
+ gl_CONDITIONAL([GL_COND_OBJ_TIME_R],
+ [test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1])
+ AM_COND_IF([GL_COND_OBJ_TIME_R], [
+ gl_PREREQ_TIME_R
+ ])
+ gl_TIME_MODULE_INDICATOR([time_r])
+ gl_FUNC_TIMEGM
+ gl_CONDITIONAL([GL_COND_OBJ_TIMEGM],
+ [test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1])
+ AM_COND_IF([GL_COND_OBJ_TIMEGM], [
+ gl_PREREQ_TIMEGM
+ ])
+ gl_TIME_MODULE_INDICATOR([timegm])
+ gl_UNISTD_H
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_GLIBC_UNLOCKED_IO
+ gl_FUNC_UNSETENV
+ gl_CONDITIONAL([GL_COND_OBJ_UNSETENV],
+ [test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1])
+ AM_COND_IF([GL_COND_OBJ_UNSETENV], [
+ gl_PREREQ_UNSETENV
+ ])
+ gl_STDLIB_MODULE_INDICATOR([unsetenv])
+ AC_C_VARARRAYS
+ AC_REQUIRE([AC_C_RESTRICT])
+ gl_FUNC_VASNPRINTF
+ gl_FUNC_VASPRINTF
+ gl_STDIO_MODULE_INDICATOR([vasprintf])
+ m4_ifdef([AM_XGETTEXT_OPTION],
+ [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
+ AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
+ gl_FUNC_VSNPRINTF
+ gl_STDIO_MODULE_INDICATOR([vsnprintf])
+ gl_WCHAR_H
+ gl_WCHAR_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ gl_FUNC_WCRTOMB
+ gl_CONDITIONAL([GL_COND_OBJ_WCRTOMB],
+ [test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1])
+ AM_COND_IF([GL_COND_OBJ_WCRTOMB], [
+ gl_PREREQ_WCRTOMB
+ ])
+ gl_WCHAR_MODULE_INDICATOR([wcrtomb])
+ gl_WCTYPE_H
+ gl_WCTYPE_H_REQUIRE_DEFAULTS
+ AC_PROG_MKDIR_P
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_MUTEX],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_ONCE],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RECMUTEX],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RWLOCK],
+ [case "$host_os" in mingw*) true;; *) false;; esac])
+ gl_XALLOC
+ gl_MODULE_INDICATOR([xalloc])
+ gl_MODULE_INDICATOR([xalloc-die])
+ gl_XSIZE
+ # End of code from modules
+ m4_ifval(gl_LIBSOURCES_LIST, [
+ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
+ for gl_file in ]gl_LIBSOURCES_LIST[ ; do
+ if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
+ echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
+ exit 1
+ fi
+ done])dnl
+ m4_if(m4_sysval, [0], [],
+ [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
+ ])
+ m4_popdef([GL_MODULE_INDICATOR_PREFIX])
+ m4_popdef([GL_MACRO_PREFIX])
+ m4_popdef([gl_LIBSOURCES_DIR])
+ m4_popdef([gl_LIBSOURCES_LIST])
+ m4_popdef([AC_LIBSOURCES])
+ m4_popdef([AC_REPLACE_FUNCS])
+ m4_popdef([AC_LIBOBJ])
+ AC_CONFIG_COMMANDS_PRE([
+ gl_libobjs=
+ gl_ltlibobjs=
+ gl_libobjdeps=
+ if test -n "$gl_LIBOBJS"; then
+ # Remove the extension.
+changequote(,)dnl
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ sed_dirname1='s,//*,/,g'
+ sed_dirname2='s,\(.\)/$,\1,'
+ sed_dirname3='s,^[^/]*$,.,'
+ sed_dirname4='s,\(.\)/[^/]*$,\1,'
+ sed_basename1='s,.*/,,'
+changequote([, ])dnl
+ for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
+ gl_libobjs="$gl_libobjs $i.$ac_objext"
+ gl_ltlibobjs="$gl_ltlibobjs $i.lo"
+ i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
+ i_base=`echo "$i" | sed -e "$sed_basename1"`
+ gl_libobjdeps="$gl_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
+ done
+ fi
+ AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
+ AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
+ AC_SUBST([gl_LIBOBJDEPS], [$gl_libobjdeps])
+ ])
+ gltests_libdeps=
+ gltests_ltlibdeps=
+ m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
+ m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
+ m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
+ m4_pushdef([gltests_LIBSOURCES_LIST], [])
+ m4_pushdef([gltests_LIBSOURCES_DIR], [])
+ m4_pushdef([GL_MACRO_PREFIX], [gltests])
+ m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL])
+ gl_COMMON
+ gl_source_base='tests'
+ gl_source_base_prefix=
+changequote(,)dnl
+ gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+changequote([, ])dnl
+ AC_SUBST([gltests_WITNESS])
+ gl_module_indicator_condition=$gltests_WITNESS
+ m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+ m4_popdef([gl_MODULE_INDICATOR_CONDITION])
+ m4_ifval(gltests_LIBSOURCES_LIST, [
+ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
+ for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
+ if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
+ echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
+ exit 1
+ fi
+ done])dnl
+ m4_if(m4_sysval, [0], [],
+ [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
+ ])
+ m4_popdef([GL_MODULE_INDICATOR_PREFIX])
+ m4_popdef([GL_MACRO_PREFIX])
+ m4_popdef([gltests_LIBSOURCES_DIR])
+ m4_popdef([gltests_LIBSOURCES_LIST])
+ m4_popdef([AC_LIBSOURCES])
+ m4_popdef([AC_REPLACE_FUNCS])
+ m4_popdef([AC_LIBOBJ])
+ AC_CONFIG_COMMANDS_PRE([
+ gltests_libobjs=
+ gltests_ltlibobjs=
+ gltests_libobjdeps=
+ if test -n "$gltests_LIBOBJS"; then
+ # Remove the extension.
+changequote(,)dnl
+ sed_drop_objext='s/\.o$//;s/\.obj$//'
+ sed_dirname1='s,//*,/,g'
+ sed_dirname2='s,\(.\)/$,\1,'
+ sed_dirname3='s,^[^/]*$,.,'
+ sed_dirname4='s,\(.\)/[^/]*$,\1,'
+ sed_basename1='s,.*/,,'
+changequote([, ])dnl
+ for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
+ gltests_libobjs="$gltests_libobjs $i.$ac_objext"
+ gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
+ i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"`
+ i_base=`echo "$i" | sed -e "$sed_basename1"`
+ gltests_libobjdeps="$gltests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po"
+ done
+ fi
+ AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
+ AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
+ AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps])
+ ])
+ AC_REQUIRE([gl_CC_GNULIB_WARNINGS])
+ LIBGNU_LIBDEPS="$gl_libdeps"
+ AC_SUBST([LIBGNU_LIBDEPS])
+ LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
+ AC_SUBST([LIBGNU_LTLIBDEPS])
+])
+
+# Like AC_LIBOBJ, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_LIBOBJ], [
+ AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
+ gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
+])
+
+# Like AC_REPLACE_FUNCS, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_REPLACE_FUNCS], [
+ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
+ AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
+])
+
+# Like AC_LIBSOURCES, except the directory where the source file is
+# expected is derived from the gnulib-tool parameterization,
+# and alloca is special cased (for the alloca-opt module).
+# We could also entirely rely on EXTRA_lib..._SOURCES.
+AC_DEFUN([gl_LIBSOURCES], [
+ m4_foreach([_gl_NAME], [$1], [
+ m4_if(_gl_NAME, [alloca.c], [], [
+ m4_define([gl_LIBSOURCES_DIR], [gl])
+ m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
+ ])
+ ])
+])
+
+# Like AC_LIBOBJ, except that the module name goes
+# into gltests_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gltests_LIBOBJ], [
+ AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
+ gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
+])
+
+# Like AC_REPLACE_FUNCS, except that the module name goes
+# into gltests_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gltests_REPLACE_FUNCS], [
+ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
+ AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
+])
+
+# Like AC_LIBSOURCES, except the directory where the source file is
+# expected is derived from the gnulib-tool parameterization,
+# and alloca is special cased (for the alloca-opt module).
+# We could also entirely rely on EXTRA_lib..._SOURCES.
+AC_DEFUN([gltests_LIBSOURCES], [
+ m4_foreach([_gl_NAME], [$1], [
+ m4_if(_gl_NAME, [alloca.c], [], [
+ m4_define([gltests_LIBSOURCES_DIR], [tests])
+ m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
+ ])
+ ])
+])
+
+# This macro records the list of files which have been installed by
+# gnulib-tool and may be removed by future gnulib-tool invocations.
+AC_DEFUN([gl_FILE_LIST], [
+ lib/_Noreturn.h
+ lib/af_alg.c
+ lib/af_alg.h
+ lib/alloca.in.h
+ lib/arg-nonnull.h
+ lib/arpa_inet.in.h
+ lib/asnprintf.c
+ lib/asprintf.c
+ lib/assert.in.h
+ lib/attribute.h
+ lib/base64.c
+ lib/base64.h
+ lib/basename-lgpl.c
+ lib/basename-lgpl.h
+ lib/basename.c
+ lib/btowc.c
+ lib/byteswap.in.h
+ lib/c++defs.h
+ lib/calloc.c
+ lib/cdefs.h
+ lib/cloexec.c
+ lib/cloexec.h
+ lib/close.c
+ lib/dirname-lgpl.c
+ lib/dirname.c
+ lib/dirname.h
+ lib/dup2.c
+ lib/dynarray.h
+ lib/errno.in.h
+ lib/error.c
+ lib/error.h
+ lib/exitfail.c
+ lib/exitfail.h
+ lib/fcntl.c
+ lib/fcntl.in.h
+ lib/fd-hook.c
+ lib/fd-hook.h
+ lib/fflush.c
+ lib/filename.h
+ lib/float+.h
+ lib/float.c
+ lib/float.in.h
+ lib/floor.c
+ lib/floorf.c
+ lib/fopen.c
+ lib/fpurge.c
+ lib/freading.c
+ lib/freading.h
+ lib/free.c
+ lib/fseek.c
+ lib/fseeko.c
+ lib/fstat.c
+ lib/fsusage.c
+ lib/fsusage.h
+ lib/ftell.c
+ lib/ftello.c
+ lib/gai_strerror.c
+ lib/getaddrinfo.c
+ lib/getdelim.c
+ lib/getdtablesize.c
+ lib/gethostname.c
+ lib/getline.c
+ lib/getloadavg.c
+ lib/getopt-cdefs.in.h
+ lib/getopt-core.h
+ lib/getopt-ext.h
+ lib/getopt-pfx-core.h
+ lib/getopt-pfx-ext.h
+ lib/getopt.c
+ lib/getopt.in.h
+ lib/getopt1.c
+ lib/getopt_int.h
+ lib/getprogname.c
+ lib/getprogname.h
+ lib/gettext.h
+ lib/gl_openssl.h
+ lib/glthread/lock.c
+ lib/glthread/lock.h
+ lib/glthread/threadlib.c
+ lib/hard-locale.c
+ lib/hard-locale.h
+ lib/ialloc.c
+ lib/ialloc.h
+ lib/idpriv-droptemp.c
+ lib/idpriv.h
+ lib/idx.h
+ lib/inet_ntop.c
+ lib/intprops-internal.h
+ lib/intprops.h
+ lib/inttypes.in.h
+ lib/itold.c
+ lib/langinfo.in.h
+ lib/lc-charset-dispatch.c
+ lib/lc-charset-dispatch.h
+ lib/libc-config.h
+ lib/limits.in.h
+ lib/localcharset.c
+ lib/localcharset.h
+ lib/locale.in.h
+ lib/localeconv.c
+ lib/lseek.c
+ lib/malloc.c
+ lib/malloc/dynarray-skeleton.c
+ lib/malloc/dynarray.h
+ lib/malloc/dynarray_at_failure.c
+ lib/malloc/dynarray_emplace_enlarge.c
+ lib/malloc/dynarray_finalize.c
+ lib/malloc/dynarray_resize.c
+ lib/malloc/dynarray_resize_clear.c
+ lib/malloca.c
+ lib/malloca.h
+ lib/math.c
+ lib/math.in.h
+ lib/mbrtowc-impl-utf8.h
+ lib/mbrtowc-impl.h
+ lib/mbrtowc.c
+ lib/mbsinit.c
+ lib/mbtowc-impl.h
+ lib/mbtowc-lock.c
+ lib/mbtowc-lock.h
+ lib/mbtowc.c
+ lib/memchr.c
+ lib/memchr.valgrind
+ lib/minmax.h
+ lib/mktime-internal.h
+ lib/mktime.c
+ lib/mountlist.c
+ lib/mountlist.h
+ lib/msvc-inval.c
+ lib/msvc-inval.h
+ lib/msvc-nothrow.c
+ lib/msvc-nothrow.h
+ lib/netdb.in.h
+ lib/netinet_in.in.h
+ lib/nl_langinfo-lock.c
+ lib/nl_langinfo.c
+ lib/open.c
+ lib/pathmax.h
+ lib/printf-args.c
+ lib/printf-args.h
+ lib/printf-parse.c
+ lib/printf-parse.h
+ lib/realloc.c
+ lib/reallocarray.c
+ lib/regcomp.c
+ lib/regex.c
+ lib/regex.h
+ lib/regex_internal.c
+ lib/regex_internal.h
+ lib/regexec.c
+ lib/setenv.c
+ lib/setlocale-lock.c
+ lib/setlocale_null.c
+ lib/setlocale_null.h
+ lib/sha256-stream.c
+ lib/sha256.c
+ lib/sha256.h
+ lib/size_max.h
+ lib/snprintf.c
+ lib/sockets.c
+ lib/sockets.h
+ lib/stat-time.c
+ lib/stat-time.h
+ lib/stat-w32.c
+ lib/stat-w32.h
+ lib/stat.c
+ lib/stdalign.in.h
+ lib/stdckdint.in.h
+ lib/stddef.in.h
+ lib/stdint.in.h
+ lib/stdio-impl.h
+ lib/stdio-read.c
+ lib/stdio-write.c
+ lib/stdio.in.h
+ lib/stdlib.in.h
+ lib/str-two-way.h
+ lib/strcasecmp.c
+ lib/strcasestr.c
+ lib/streq.h
+ lib/strerror-override.c
+ lib/strerror-override.h
+ lib/strerror.c
+ lib/string.in.h
+ lib/strings.in.h
+ lib/stripslash.c
+ lib/strncasecmp.c
+ lib/strsep.c
+ lib/strstr.c
+ lib/sys-limits.h
+ lib/sys_socket.c
+ lib/sys_socket.in.h
+ lib/sys_stat.in.h
+ lib/sys_types.in.h
+ lib/sys_uio.in.h
+ lib/time.in.h
+ lib/time_r.c
+ lib/timegm.c
+ lib/unistd.c
+ lib/unistd.in.h
+ lib/unlocked-io.h
+ lib/unsetenv.c
+ lib/vasnprintf.c
+ lib/vasnprintf.h
+ lib/vasprintf.c
+ lib/verify.h
+ lib/vsnprintf.c
+ lib/w32sock.h
+ lib/warn-on-use.h
+ lib/wchar.in.h
+ lib/wcrtomb.c
+ lib/wctype-h.c
+ lib/wctype.in.h
+ lib/windows-initguard.h
+ lib/windows-mutex.c
+ lib/windows-mutex.h
+ lib/windows-once.c
+ lib/windows-once.h
+ lib/windows-recmutex.c
+ lib/windows-recmutex.h
+ lib/windows-rwlock.c
+ lib/windows-rwlock.h
+ lib/xalloc-die.c
+ lib/xalloc-oversized.h
+ lib/xalloc.h
+ lib/xmalloc.c
+ lib/xsize.c
+ lib/xsize.h
+ m4/00gnulib.m4
+ m4/__inline.m4
+ m4/absolute-header.m4
+ m4/af_alg.m4
+ m4/alloca.m4
+ m4/arpa_inet_h.m4
+ m4/assert_h.m4
+ m4/base64.m4
+ m4/btowc.m4
+ m4/builtin-expect.m4
+ m4/byteswap.m4
+ m4/c-bool.m4
+ m4/calloc.m4
+ m4/close.m4
+ m4/codeset.m4
+ m4/double-slash-root.m4
+ m4/dup2.m4
+ m4/eealloc.m4
+ m4/environ.m4
+ m4/errno_h.m4
+ m4/error.m4
+ m4/exponentd.m4
+ m4/extensions.m4
+ m4/extern-inline.m4
+ m4/fcntl-o.m4
+ m4/fcntl.m4
+ m4/fcntl_h.m4
+ m4/fflush.m4
+ m4/float_h.m4
+ m4/floorf.m4
+ m4/fopen.m4
+ m4/fpurge.m4
+ m4/freading.m4
+ m4/free.m4
+ m4/fseek.m4
+ m4/fseeko.m4
+ m4/fstat.m4
+ m4/fstypename.m4
+ m4/fsusage.m4
+ m4/ftell.m4
+ m4/ftello.m4
+ m4/getaddrinfo.m4
+ m4/getdelim.m4
+ m4/getdtablesize.m4
+ m4/gethostname.m4
+ m4/getline.m4
+ m4/getloadavg.m4
+ m4/getopt.m4
+ m4/getprogname.m4
+ m4/gl-openssl.m4
+ m4/gnulib-common.m4
+ m4/hostent.m4
+ m4/idpriv.m4
+ m4/include_next.m4
+ m4/inet_ntop.m4
+ m4/intmax_t.m4
+ m4/inttypes.m4
+ m4/inttypes_h.m4
+ m4/langinfo_h.m4
+ m4/largefile.m4
+ m4/limits-h.m4
+ m4/localcharset.m4
+ m4/locale-fr.m4
+ m4/locale-ja.m4
+ m4/locale-zh.m4
+ m4/locale_h.m4
+ m4/localeconv.m4
+ m4/lock.m4
+ m4/lseek.m4
+ m4/malloc.m4
+ m4/malloca.m4
+ m4/math_h.m4
+ m4/mbrtowc.m4
+ m4/mbsinit.m4
+ m4/mbstate_t.m4
+ m4/mbtowc.m4
+ m4/memchr.m4
+ m4/minmax.m4
+ m4/mktime.m4
+ m4/mmap-anon.m4
+ m4/mode_t.m4
+ m4/mountlist.m4
+ m4/msvc-inval.m4
+ m4/msvc-nothrow.m4
+ m4/multiarch.m4
+ m4/netdb_h.m4
+ m4/netinet_in_h.m4
+ m4/nl_langinfo.m4
+ m4/nocrash.m4
+ m4/off_t.m4
+ m4/open-cloexec.m4
+ m4/open-slash.m4
+ m4/open.m4
+ m4/pathmax.m4
+ m4/pid_t.m4
+ m4/printf.m4
+ m4/pthread_rwlock_rdlock.m4
+ m4/realloc.m4
+ m4/reallocarray.m4
+ m4/regex.m4
+ m4/servent.m4
+ m4/setenv.m4
+ m4/setlocale_null.m4
+ m4/sha256.m4
+ m4/size_max.m4
+ m4/snprintf.m4
+ m4/socketlib.m4
+ m4/sockets.m4
+ m4/socklen.m4
+ m4/sockpfaf.m4
+ m4/ssize_t.m4
+ m4/stat-time.m4
+ m4/stat.m4
+ m4/std-gnu11.m4
+ m4/stdalign.m4
+ m4/stddef_h.m4
+ m4/stdint.m4
+ m4/stdint_h.m4
+ m4/stdio_h.m4
+ m4/stdlib_h.m4
+ m4/strcase.m4
+ m4/strcasestr.m4
+ m4/strerror.m4
+ m4/string_h.m4
+ m4/strings_h.m4
+ m4/strsep.m4
+ m4/strstr.m4
+ m4/sys_socket_h.m4
+ m4/sys_stat_h.m4
+ m4/sys_types_h.m4
+ m4/sys_uio_h.m4
+ m4/threadlib.m4
+ m4/time_h.m4
+ m4/time_r.m4
+ m4/timegm.m4
+ m4/ungetc.m4
+ m4/unistd_h.m4
+ m4/unlocked-io.m4
+ m4/vararrays.m4
+ m4/vasnprintf.m4
+ m4/vasprintf.m4
+ m4/visibility.m4
+ m4/vsnprintf.m4
+ m4/warn-on-use.m4
+ m4/wchar_h.m4
+ m4/wchar_t.m4
+ m4/wcrtomb.m4
+ m4/wctype_h.m4
+ m4/wint_t.m4
+ m4/xalloc.m4
+ m4/xsize.m4
+ m4/zzgnulib.m4
+])
diff --git a/gl/m4/hostent.m4 b/gl/m4/hostent.m4
new file mode 100644
index 0000000..3b2cc2b
--- /dev/null
+++ b/gl/m4/hostent.m4
@@ -0,0 +1,49 @@
+# hostent.m4 serial 4
+dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_HOSTENT],
+[
+ dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(),
+ dnl gethostbyaddr() defined?
+ dnl - On Solaris < 11.4, they are in libnsl. Ignore libxnet.
+ dnl - On Haiku, they are in libnetwork.
+ dnl - On BeOS, they are in libnet.
+ dnl - On native Windows, they are in ws2_32.dll.
+ dnl - Otherwise they are in libc.
+ AC_REQUIRE([gl_SYS_SOCKET_H])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
+ HOSTENT_LIB=
+ gl_saved_libs="$LIBS"
+ AC_SEARCH_LIBS([gethostbyname], [nsl network net],
+ [if test "$ac_cv_search_gethostbyname" != "none required"; then
+ HOSTENT_LIB="$ac_cv_search_gethostbyname"
+ fi])
+ LIBS="$gl_saved_libs"
+ if test -z "$HOSTENT_LIB"; then
+ AC_CHECK_FUNCS([gethostbyname], , [
+ AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32],
+ [gl_cv_w32_gethostbyname],
+ [gl_cv_w32_gethostbyname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+ ]],
+ [[gethostbyname(NULL);]])],
+ [gl_cv_w32_gethostbyname=yes])
+ LIBS="$gl_save_LIBS"
+ ])
+ if test "$gl_cv_w32_gethostbyname" = "yes"; then
+ HOSTENT_LIB="-lws2_32"
+ fi
+ ])
+ fi
+ AC_SUBST([HOSTENT_LIB])
+])
diff --git a/gl/m4/idpriv.m4 b/gl/m4/idpriv.m4
new file mode 100644
index 0000000..fc3dd17
--- /dev/null
+++ b/gl/m4/idpriv.m4
@@ -0,0 +1,14 @@
+# idpriv.m4 serial 1
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_IDPRIV],
+[
+ dnl Persuade glibc <unistd.h> to declare {get,set}res{uid,gid}.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS_ONCE([getuid geteuid getresuid getgid getegid getresgid])
+ AC_CHECK_FUNCS_ONCE([setresuid setreuid seteuid setresgid setregid setegid])
+])
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
new file mode 100644
index 0000000..9f19215
--- /dev/null
+++ b/gl/m4/include_next.m4
@@ -0,0 +1,224 @@
+# include_next.m4 serial 26
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert and Derek Price.
+
+dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER,
+dnl and PRAGMA_COLUMNS.
+dnl
+dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
+dnl 'include' otherwise.
+dnl
+dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler
+dnl supports it in the special case that it is the first include directive in
+dnl the given file, or to 'include' otherwise.
+dnl
+dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
+dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
+dnl '#pragma GCC system_header' has the same effect as if the file was found
+dnl through the include search path specified with '-isystem' options (as
+dnl opposed to the search path specified with '-I' options). Namely, gcc
+dnl does not warn about some things, and on some systems (Solaris and Interix)
+dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
+dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
+dnl of plain '__STDC__'.
+dnl
+dnl PRAGMA_COLUMNS can be used in files that override system header files, so
+dnl as to avoid compilation errors on HP NonStop systems when the gnulib file
+dnl is included by a system header file that does a "#pragma COLUMNS 80" (which
+dnl has the effect of truncating the lines of that file and all files that it
+dnl includes to 80 columns) and the gnulib file has lines longer than 80
+dnl columns.
+
+AC_DEFUN([gl_INCLUDE_NEXT],
+[
+ AC_LANG_PREPROC_REQUIRE()
+ AC_CACHE_CHECK([whether the preprocessor supports include_next],
+ [gl_cv_have_include_next],
+ [rm -rf conftestd1a conftestd1b conftestd2
+ mkdir conftestd1a conftestd1b conftestd2
+ dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on
+ dnl AIX 6.1 support include_next when used as first preprocessor directive
+ dnl in a file, but not when preceded by another include directive. Check
+ dnl for this bug by including <stdio.h>.
+ dnl Additionally, with this same compiler, include_next is a no-op when
+ dnl used in a header file that was included by specifying its absolute
+ dnl file name. Despite these two bugs, include_next is used in the
+ dnl compiler's <math.h>. By virtue of the second bug, we need to use
+ dnl include_next as well in this case.
+ cat <<EOF > conftestd1a/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+ cat <<EOF > conftestd1b/conftest.h
+#define DEFINED_IN_CONFTESTD1
+#include <stdio.h>
+#include_next <conftest.h>
+#ifdef DEFINED_IN_CONFTESTD2
+int foo;
+#else
+#error "include_next doesn't work"
+#endif
+EOF
+ cat <<EOF > conftestd2/conftest.h
+#ifndef DEFINED_IN_CONFTESTD1
+#error "include_next test doesn't work"
+#endif
+#define DEFINED_IN_CONFTESTD2
+EOF
+ gl_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
+dnl We intentionally avoid using AC_LANG_SOURCE here.
+ AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
+ [gl_cv_have_include_next=yes],
+ [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
+ AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
+ [gl_cv_have_include_next=buggy],
+ [gl_cv_have_include_next=no])
+ ])
+ CPPFLAGS="$gl_save_CPPFLAGS"
+ rm -rf conftestd1a conftestd1b conftestd2
+ ])
+ PRAGMA_SYSTEM_HEADER=
+ if test $gl_cv_have_include_next = yes; then
+ INCLUDE_NEXT=include_next
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+ if test -n "$GCC"; then
+ PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
+ fi
+ else
+ if test $gl_cv_have_include_next = buggy; then
+ INCLUDE_NEXT=include
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next
+ else
+ INCLUDE_NEXT=include
+ INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include
+ fi
+ fi
+ AC_SUBST([INCLUDE_NEXT])
+ AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
+ AC_SUBST([PRAGMA_SYSTEM_HEADER])
+
+ dnl HP NonStop systems, which define __TANDEM, limit the line length
+ dnl after including some system header files.
+ AC_CACHE_CHECK([whether source code line length is unlimited],
+ [gl_cv_source_line_length_unlimited],
+ [AC_EGREP_CPP([choke me],
+ [
+#ifdef __TANDEM
+choke me
+#endif
+ ],
+ [gl_cv_source_line_length_unlimited=no],
+ [gl_cv_source_line_length_unlimited=yes])
+ ])
+ if test $gl_cv_source_line_length_unlimited = no; then
+ PRAGMA_COLUMNS="#pragma COLUMNS 10000"
+ else
+ PRAGMA_COLUMNS=
+ fi
+ AC_SUBST([PRAGMA_COLUMNS])
+])
+
+# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------------
+# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
+# '<foo.h>'; otherwise define it to be
+# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
+# Also, if #include_next works as first preprocessing directive in a file,
+# define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be '<foo.h>'; otherwise define it to
+# be
+# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
+# That way, a header file with the following line:
+# #@INCLUDE_NEXT@ @NEXT_FOO_H@
+# or
+# #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
+# behaves (after sed substitution) as if it contained
+# #include_next <foo.h>
+# even if the compiler does not support include_next.
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
+# Note: This macro assumes that the header file is not empty after
+# preprocessing, i.e. it does not only define preprocessor macros but also
+# provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
+AC_DEFUN([gl_CHECK_NEXT_HEADERS],
+[
+ gl_NEXT_HEADERS_INTERNAL([$1], [check])
+])
+
+# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------
+# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
+# This is suitable for headers like <stddef.h> that are standardized by C89
+# and therefore can be assumed to exist.
+AC_DEFUN([gl_NEXT_HEADERS],
+[
+ gl_NEXT_HEADERS_INTERNAL([$1], [assume])
+])
+
+# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
+AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
+[
+ AC_REQUIRE([gl_INCLUDE_NEXT])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ m4_if([$2], [check],
+ [AC_CHECK_HEADERS_ONCE([$1])
+ ])
+
+ m4_foreach_w([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_next_header],
+ [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
+ if test $gl_cv_have_include_next = yes; then
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ else
+ AC_CACHE_CHECK(
+ [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+ [gl_next_header],
+ [m4_if([$2], [check],
+ [AS_VAR_PUSHDEF([gl_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+ if test AS_VAR_GET([gl_header_exists]) = yes; then
+ AS_VAR_POPDEF([gl_header_exists])
+ ])
+ gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
+ AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
+ AS_VAR_SET([gl_next_header], ['"'$gl_header'"'])
+ m4_if([$2], [check],
+ [else
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ fi
+ ])
+ ])
+ fi
+ AC_SUBST(
+ AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
+ [AS_VAR_GET([gl_next_header])])
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'gl_HEADER_NAME'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+ fi
+ AC_SUBST(
+ AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
+ [$gl_next_as_first_directive])
+ AS_VAR_POPDEF([gl_next_header])])
+])
+
+# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
+# this fallback is safe for all earlier autoconf versions.
+m4_define_default([AC_LANG_DEFINES_PROVIDED])
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
new file mode 100644
index 0000000..48822d6
--- /dev/null
+++ b/gl/m4/inet_ntop.m4
@@ -0,0 +1,70 @@
+# inet_ntop.m4 serial 21
+dnl Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_INET_NTOP],
+[
+ AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
+ dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ dnl Most platforms that provide inet_ntop define it in libc.
+ dnl Solaris 8..10 provide inet_ntop in libnsl instead.
+ dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
+ dnl Haiku provides it in -lnetwork.
+ dnl Native Windows provides it in -lws2_32 instead, with a declaration in
+ dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
+ dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
+ HAVE_INET_NTOP=1
+ INET_NTOP_LIB=
+ gl_PREREQ_SYS_H_WINSOCK2
+ if test $HAVE_WINSOCK2_H = 1; then
+ dnl It needs to be overridden, because the stdcall calling convention
+ dnl is not compliant with POSIX. Set REPLACE_INET_NTOP in order to avoid
+ dnl a name conflict at the linker level, even though the header file
+ dnl <ws2tcpip.h> declares inet_ntop only if _WIN32_WINNT >= 0x0600.
+ REPLACE_INET_NTOP=1
+ AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]])
+ if test $ac_cv_have_decl_inet_ntop = yes; then
+ INET_NTOP_LIB="-lws2_32"
+ else
+ HAVE_DECL_INET_NTOP=0
+ fi
+ else
+ gl_save_LIBS=$LIBS
+ AC_SEARCH_LIBS([inet_ntop], [nsl resolv network], [],
+ [AC_CHECK_FUNCS([inet_ntop])
+ if test $ac_cv_func_inet_ntop = no; then
+ HAVE_INET_NTOP=0
+ fi
+ ])
+ LIBS=$gl_save_LIBS
+
+ if test "$ac_cv_search_inet_ntop" != "no" \
+ && test "$ac_cv_search_inet_ntop" != "none required"; then
+ INET_NTOP_LIB="$ac_cv_search_inet_ntop"
+ fi
+
+ AC_CHECK_HEADERS_ONCE([netdb.h])
+ AC_CHECK_DECLS([inet_ntop],,,
+ [[#include <arpa/inet.h>
+ #if HAVE_NETDB_H
+ # include <netdb.h>
+ #endif
+ ]])
+ if test $ac_cv_have_decl_inet_ntop = no; then
+ HAVE_DECL_INET_NTOP=0
+ fi
+ fi
+ AC_SUBST([INET_NTOP_LIB])
+])
+
+# Prerequisites of lib/inet_ntop.c.
+AC_DEFUN([gl_PREREQ_INET_NTOP], [
+ AC_REQUIRE([gl_SOCKET_FAMILIES])
+])
diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4
new file mode 100644
index 0000000..ef32e1b
--- /dev/null
+++ b/gl/m4/intmax_t.m4
@@ -0,0 +1,59 @@
+# intmax_t.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_PREREQ([2.53])
+
+# Define intmax_t to 'long' or 'long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([gl_AC_TYPE_INTMAX_T],
+[
+ dnl For simplicity, we assume that a header file defines 'intmax_t' if and
+ dnl only if it defines 'uintmax_t'.
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
+ [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
+ else
+ AC_DEFINE([HAVE_INTMAX_T], [1],
+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
+
+dnl An alternative would be to explicitly test for 'intmax_t'.
+
+AC_DEFUN([gt_AC_TYPE_INTMAX_T],
+[
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+ ]],
+ [[intmax_t x = -1; return !x;]])],
+ [gt_cv_c_intmax_t=yes],
+ [gt_cv_c_intmax_t=no])])
+ if test $gt_cv_c_intmax_t = yes; then
+ AC_DEFINE([HAVE_INTMAX_T], [1],
+ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+ else
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
+ [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
+ fi
+])
diff --git a/gl/m4/inttypes.m4 b/gl/m4/inttypes.m4
new file mode 100644
index 0000000..bf2eab2
--- /dev/null
+++ b/gl/m4/inttypes.m4
@@ -0,0 +1,180 @@
+# inttypes.m4 serial 36
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price, Bruno Haible.
+dnl Test whether <inttypes.h> is supported or must be substituted.
+
+AC_DEFUN_ONCE([gl_INTTYPES_H],
+[
+ AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
+ gl_INTTYPES_PRI_SCN
+])
+
+AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
+[
+ AC_REQUIRE([gl_STDINT_H])
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
+
+ dnl Override <inttypes.h> always, so that the portability warnings work.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([inttypes.h])
+
+ AC_REQUIRE([gl_MULTIARCH])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
+ ]], [imaxabs imaxdiv strtoimax strtoumax])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# Ensure that the PRI* and SCN* macros are defined appropriately.
+AC_DEFUN([gl_INTTYPES_PRI_SCN],
+[
+ PRIPTR_PREFIX=
+ if $GL_GENERATE_STDINT_H; then
+ dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
+ dnl 'long long', depending on _WIN64.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef _WIN64
+ LLP64
+ #endif
+ ]])
+ ],
+ [PRIPTR_PREFIX='"l"'],
+ [PRIPTR_PREFIX='"ll"'])
+ else
+ dnl Using the system's <stdint.h>.
+ for glpfx in '' l ll I64; do
+ case $glpfx in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ I64) gltype1='__int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>
+ extern intptr_t foo;
+ extern $gltype1 foo;]])],
+ [PRIPTR_PREFIX='"'$glpfx'"'])
+ test -n "$PRIPTR_PREFIX" && break
+ done
+ fi
+ AC_SUBST([PRIPTR_PREFIX])
+
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT32_MAX_LT_INTMAX_MAX],
+ [defined INT32_MAX && defined INTMAX_MAX],
+ [INT32_MAX < INTMAX_MAX],
+ [sizeof (int) < sizeof (long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT64_MAX_EQ_LONG_MAX],
+ [defined INT64_MAX],
+ [INT64_MAX == LONG_MAX],
+ [sizeof (long long int) == sizeof (long int)])
+ else
+ INT64_MAX_EQ_LONG_MAX=-1
+ fi
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT32_MAX_LT_UINTMAX_MAX],
+ [defined UINT32_MAX && defined UINTMAX_MAX],
+ [UINT32_MAX < UINTMAX_MAX],
+ [sizeof (unsigned int) < sizeof (unsigned long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT64_MAX_EQ_ULONG_MAX],
+ [defined UINT64_MAX],
+ [UINT64_MAX == ULONG_MAX],
+ [sizeof (unsigned long long int) == sizeof (unsigned long int)])
+ else
+ UINT64_MAX_EQ_ULONG_MAX=-1
+ fi
+])
+
+# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
+# If $2 is true, the condition is $3; otherwise if long long int is supported
+# approximate the condition with $4; otherwise, assume the condition is false.
+# The condition should work on all C99 platforms; the approximations should be
+# good enough to work on all practical pre-C99 platforms.
+# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
+AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
+[
+ AC_CACHE_CHECK([whether $3],
+ [gl_cv_test_$1],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Work also in C++ mode. */
+ #define __STDC_LIMIT_MACROS 1
+
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+
+ #include <limits.h>
+ #if HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+
+ #if $2
+ #define CONDITION ($3)
+ #else
+ #define CONDITION ($4)
+ #endif
+ int test[CONDITION ? 1 : -1];]])],
+ [gl_cv_test_$1=yes],
+ [gl_cv_test_$1=no])])
+ if test $gl_cv_test_$1 = yes; then
+ $1=1;
+ else
+ $1=0;
+ fi
+ AC_SUBST([$1])
+])
+
+# gl_INTTYPES_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_INTTYPES_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_INTTYPES_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXABS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXDIV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOIMAX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUMAX])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS])
+ HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
+ HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
+ HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+ HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
+ REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
+ REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
+ INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
+ INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
+ PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX])
+ UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
+])
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
new file mode 100644
index 0000000..68c60e9
--- /dev/null
+++ b/gl/m4/inttypes_h.m4
@@ -0,0 +1,29 @@
+# inttypes_h.m4 serial 10
+dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/types.h>
+#include <inttypes.h>
+ ]],
+ [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+ [gl_cv_header_inttypes_h=yes],
+ [gl_cv_header_inttypes_h=no])])
+ if test $gl_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
+ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/gl/m4/langinfo_h.m4 b/gl/m4/langinfo_h.m4
new file mode 100644
index 0000000..b17a526
--- /dev/null
+++ b/gl/m4/langinfo_h.m4
@@ -0,0 +1,137 @@
+# langinfo_h.m4 serial 12
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_LANGINFO_H],
+[
+ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+
+ dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl <langinfo.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([langinfo.h])
+
+ dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
+ HAVE_LANGINFO_CODESET=0
+ HAVE_LANGINFO_T_FMT_AMPM=0
+ HAVE_LANGINFO_ALTMON=0
+ HAVE_LANGINFO_ERA=0
+ HAVE_LANGINFO_YESEXPR=0
+ AC_CHECK_HEADERS_ONCE([langinfo.h])
+ if test $ac_cv_header_langinfo_h = yes; then
+ HAVE_LANGINFO_H=1
+ dnl Determine what <langinfo.h> defines.
+ dnl CODESET is missing on OpenBSD 3.8.
+ dnl ERA etc. are missing on OpenBSD 6.7.
+ dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
+ dnl ALTMON_* are missing on glibc 2.26 and many other systems.
+ AC_CACHE_CHECK([whether langinfo.h defines CODESET],
+ [gl_cv_header_langinfo_codeset],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = CODESET;
+]])],
+ [gl_cv_header_langinfo_codeset=yes],
+ [gl_cv_header_langinfo_codeset=no])
+ ])
+ if test $gl_cv_header_langinfo_codeset = yes; then
+ HAVE_LANGINFO_CODESET=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM],
+ [gl_cv_header_langinfo_t_fmt_ampm],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = T_FMT_AMPM;
+]])],
+ [gl_cv_header_langinfo_t_fmt_ampm=yes],
+ [gl_cv_header_langinfo_t_fmt_ampm=no])
+ ])
+ if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
+ HAVE_LANGINFO_T_FMT_AMPM=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1],
+ [gl_cv_header_langinfo_altmon],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ALTMON_1;
+]])],
+ [gl_cv_header_langinfo_altmon=yes],
+ [gl_cv_header_langinfo_altmon=no])
+ ])
+ if test $gl_cv_header_langinfo_altmon = yes; then
+ HAVE_LANGINFO_ALTMON=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines ERA],
+ [gl_cv_header_langinfo_era],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ERA;
+]])],
+ [gl_cv_header_langinfo_era=yes],
+ [gl_cv_header_langinfo_era=no])
+ ])
+ if test $gl_cv_header_langinfo_era = yes; then
+ HAVE_LANGINFO_ERA=1
+ fi
+ AC_CACHE_CHECK([whether langinfo.h defines YESEXPR],
+ [gl_cv_header_langinfo_yesexpr],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = YESEXPR;
+]])],
+ [gl_cv_header_langinfo_yesexpr=yes],
+ [gl_cv_header_langinfo_yesexpr=no])
+ ])
+ if test $gl_cv_header_langinfo_yesexpr = yes; then
+ HAVE_LANGINFO_YESEXPR=1
+ fi
+ else
+ HAVE_LANGINFO_H=0
+ fi
+ AC_SUBST([HAVE_LANGINFO_H])
+ AC_SUBST([HAVE_LANGINFO_CODESET])
+ AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM])
+ AC_SUBST([HAVE_LANGINFO_ALTMON])
+ AC_SUBST([HAVE_LANGINFO_ERA])
+ AC_SUBST([HAVE_LANGINFO_YESEXPR])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <langinfo.h>
+ ]], [nl_langinfo])
+])
+
+# gl_LANGINFO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_LANGINFO_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_LANGINFO_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NL_LANGINFO])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_LANGINFO_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO])
+ REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO])
+])
diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4
new file mode 100644
index 0000000..7fb81b8
--- /dev/null
+++ b/gl/m4/largefile.m4
@@ -0,0 +1,376 @@
+# Enable large files on systems where this is not the default.
+# Enable support for files on Linux file systems with 64-bit inode numbers.
+
+# Copyright 1992-1996, 1998-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO:
+# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
+# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
+# and ftello in C++ mode as well.
+# Fixed in Autoconf 2.72, which has AC_SYS_YEAR2038.
+AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
+ m4_ifndef([AC_SYS_YEAR2038], [[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_FUNC_FSEEKO
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_LARGEFILE_SOURCE], [1],
+ [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).])
+ ;;
+ esac
+ ]])
+)
+
+# Work around a problem in autoconf <= 2.69:
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
+# or configures them incorrectly in some cases.
+m4_version_prereq([2.70], [], [
+
+# _AC_SYS_LARGEFILE_TEST_INCLUDES
+# -------------------------------
+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+[#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
+ int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1]];[]dnl
+])
+])# m4_version_prereq 2.70
+
+# Support AC_SYS_YEAR2038, even if Autoconf 2.71 or earlier.
+# This code is taken from Autoconf master.
+m4_ifndef([AC_SYS_YEAR2038], [
+
+# _AC_SYS_YEAR2038_TEST_CODE
+# --------------------------
+# C code used to probe for time_t that can represent time points more
+# than 2**31 - 1 seconds after the epoch. With the usual Unix epoch,
+# these correspond to dates after 2038-01-18 22:14:07 +0000 (Gregorian),
+# hence the name.
+AC_DEFUN([_AC_SYS_YEAR2038_TEST_CODE],
+[[
+ #include <time.h>
+ /* Check that time_t can represent 2**32 - 1 correctly. */
+ #define LARGE_TIME_T \\
+ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))
+ int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535
+ && LARGE_TIME_T % 65537 == 0)
+ ? 1 : -1];
+]])
+
+# _AC_SYS_YEAR2038_OPTIONS
+# ------------------------
+# List of known ways to enable support for large time_t. If you change
+# this list you probably also need to change the AS_CASE at the end of
+# _AC_SYS_YEAR2038_PROBE.
+m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
+ ["none needed"] dnl 64-bit and newer 32-bit Unix
+ ["-D_TIME_BITS=64"] dnl glibc 2.34 with some 32-bit ABIs
+ ["-D__MINGW_USE_VC2005_COMPAT"] dnl 32-bit MinGW
+ ["-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"]
+ dnl 32-bit MinGW (misconfiguration)
+))
+
+# _AC_SYS_YEAR2038_PROBE([IF-NOT-DETECTED])
+# -----------------------------------------
+# Subroutine of AC_SYS_YEAR2038. Probe for time_t that can represent
+# time points more than 2**31 - 1 seconds after the epoch (dates after
+# 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts
+# to one of the values in the _AC_SYS_YEAR2038_OPTIONS list, or to
+# "support not detected" if none of them worked. Then, set compilation
+# options and #defines as necessary to enable large time_t support.
+#
+# Note that we do not test whether mktime, localtime, etc. handle
+# large values of time_t correctly, as that would require use of
+# AC_TRY_RUN. Note also that some systems only support large time_t
+# together with large off_t.
+#
+# If support is not detected, the behavior depends on which of the
+# top-level AC_SYS_YEAR2038 macros was used (see below).
+#
+# If you change this macro you may also need to change
+# _AC_SYS_YEAR2038_OPTIONS.
+AC_DEFUN([_AC_SYS_YEAR2038_PROBE],
+[AC_CACHE_CHECK([for $CC option to enable timestamps after Jan 2038],
+ [ac_cv_sys_year2038_opts],
+ [ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_opt_found=no
+ for ac_opt in _AC_SYS_YEAR2038_OPTIONS; do
+ AS_IF([test x"$ac_opt" != x"none needed"],
+ [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_YEAR2038_TEST_CODE])],
+ [ac_cv_sys_year2038_opts="$ac_opt"
+ ac_opt_found=yes])
+ test $ac_opt_found = no || break
+ done
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected"])
+
+ac_have_year2038=yes
+AS_CASE([$ac_cv_sys_year2038_opts],
+ ["none needed"], [],
+ ["support not detected"],
+ [ac_have_year2038=no
+ AS_CASE([$enable_year2038],
+ [yes],
+ [# If we're not cross compiling and 'touch' works with a large
+ # timestamp, then we can presume the system supports wider time_t
+ # *somehow* and we just weren't able to detect it. One common
+ # case that we deliberately *don't* probe for is a system that
+ # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
+ # wide time_t. (It would be inappropriate for us to override an
+ # intentional use of -m32.) Error out, demanding use of
+ # --disable-year2038 if this is intentional.
+ AS_IF([test $cross_compiling = no],
+ [AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null],
+ [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`],
+ [*'Feb 7 2106'* | *'Feb 7 17:10'*],
+ [AC_MSG_FAILURE(m4_text_wrap(
+ [this system appears to support timestamps after January 2038,
+ but no mechanism for enabling wide 'time_t' was detected.
+ Did you mean to build a 64-bit binary? (e.g. 'CC="${CC} -m64"'.)
+ To proceed with 32-bit time_t, configure with '--disable-year2038'.],
+ [], [], [55]))])])])])],
+
+ ["-D_TIME_BITS=64"],
+ [AC_DEFINE([_TIME_BITS], [64],
+ [Number of bits in time_t, on hosts where this is settable.])],
+
+ ["-D__MINGW_USE_VC2005_COMPAT=1"],
+ [AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1],
+ [Define to 1 on platforms where this makes time_t a 64-bit type.])],
+
+ ["-U_USE_32_BIT_TIME_T"*],
+ [AC_MSG_FAILURE(m4_text_wrap(
+ [the 'time_t' type is currently forced to be 32-bit.
+ It will stop working after January 2038.
+ Remove _USE_32BIT_TIME_T from the compiler flags.],
+ [], [], [55]))],
+
+ [AC_MSG_ERROR(
+ [internal error: bad value for \$ac_cv_sys_year2038_opts])])
+])
+
+# _AC_SYS_YEAR2038_ENABLE
+# -----------------------
+# Subroutine of AC_SYS_YEAR2038 and _AC_SYS_YEAR2038_OPT_IN.
+# Depending on which of the YEAR2038 macros was used, add either an
+# --enable-year2038, or a --disable-year2038, or no option at all to
+# the configure script. Note that this is expanded very late and
+# therefore there cannot be any code in the AC_ARG_ENABLE. The
+# default value for enable_year2038 is emitted unconditionally
+# because the generated code always looks at this variable.
+m4_define([_AC_SYS_YEAR2038_ENABLE],
+[m4_divert_text([DEFAULTS],
+ m4_provide_if([AC_SYS_YEAR2038],
+ [enable_year2038=yes],
+ [enable_year2038=no]))]dnl
+[AC_ARG_ENABLE([year2038],
+ m4_provide_if([AC_SYS_YEAR2038],
+ [AS_HELP_STRING([--disable-year2038],
+ [do not support timestamps after 2038])],
+ [AS_HELP_STRING([--enable-year2038],
+ [support timestamps after 2038])]))])
+
+# _AC_SYS_YEAR2038_OPT_IN
+# -----------------------
+# If the --enable-year2038 option is given to configure, attempt to
+# detect and activate support for large time_t on 32-bit systems.
+# This macro is automatically invoked by AC_SYS_LARGEFILE when large
+# *file* support is detected. It does not AC_REQUIRE AC_SYS_LARGEFILE
+# to avoid a dependency loop, and is therefore unsafe to expose as a
+# documented macro.
+AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN],
+[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
+ AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE])
+ AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
+])])
+
+# AC_SYS_YEAR2038
+# ---------------
+# Attempt to detect and activate support for large time_t.
+# On systems where time_t is not always 64 bits, this probe can be
+# skipped by passing the --disable-year2038 option to configure.
+AC_DEFUN([AC_SYS_YEAR2038],
+[AC_REQUIRE([AC_SYS_LARGEFILE])]dnl
+[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
+ AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE])
+ AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
+])])
+
+# _AC_SYS_LARGEFILE_TEST_CODE
+# ---------------------------
+# C code used to probe for large file support.
+m4_define([_AC_SYS_LARGEFILE_TEST_CODE],
+[@%:@include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
+ int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1]];[]dnl
+])
+
+# _AC_SYS_LARGEFILE_OPTIONS
+# -------------------------
+# List of known ways to enable support for large files. If you change
+# this list you probably also need to change the AS_CASE at the end of
+# _AC_SYS_LARGEFILE_PROBE.
+m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize(
+ ["none needed"] dnl Most current systems
+ ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec
+ ["-D_LARGE_FILES=1"] dnl AIX (which versions?)
+ ["-n32"] dnl Irix 6.2 w/ SGI compiler
+))
+
+# _AC_SYS_LARGEFILE_PROBE
+# -----------------------
+# Subroutine of AC_SYS_LARGEFILE. Probe for large file support and set
+# the cache variable ac_cv_sys_largefile_opts to one of the values in
+# the _AC_SYS_LARGEFILE_OPTIONS list, or to "support not detected" if
+# none of the options in that list worked. Then, set compilation
+# options and #defines as necessary to enable large file support.
+#
+# If large file support is not detected, the behavior depends on which of
+# the top-level AC_SYS_LARGEFILE macros was used (see below).
+#
+# If you change this macro you may also need to change
+# _AC_SYS_LARGEFILE_OPTIONS.
+AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
+[AC_CACHE_CHECK([for $CC option to enable large file support],
+ [ac_cv_sys_largefile_opts],
+ [ac_save_CC="$CC"
+ ac_opt_found=no
+ for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do
+ AS_IF([test x"$ac_opt" != x"none needed"],
+ [CC="$ac_save_CC $ac_opt"])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])],
+ [ac_cv_sys_largefile_opts="$ac_opt"
+ ac_opt_found=yes])
+ test $ac_opt_found = no || break
+ done
+ CC="$ac_save_CC"
+ test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"])
+
+ac_have_largefile=yes
+AS_CASE([$ac_cv_sys_largefile_opts],
+ ["none needed"], [],
+ ["support not detected"],
+ [ac_have_largefile=no],
+
+ ["-D_FILE_OFFSET_BITS=64"],
+ [AC_DEFINE([_FILE_OFFSET_BITS], [64],
+ [Number of bits in a file offset, on hosts where this is settable.])],
+
+ ["-D_LARGE_FILES=1"],
+ [AC_DEFINE([_LARGE_FILES], [1],
+ [Define to 1 on platforms where this makes off_t a 64-bit type.])],
+
+ ["-n32"],
+ [CC="$CC -n32"],
+
+ [AC_MSG_ERROR(
+ [internal error: bad value for \$ac_cv_sys_largefile_opts])])
+
+_AC_SYS_YEAR2038_OPT_IN
+])
+
+# _AC_SYS_LARGEFILE_ENABLE
+# ------------------------
+# Subroutine of AC_SYS_LARGEFILE. Note that this
+# is expanded very late and therefore there cannot be any code in the
+# AC_ARG_ENABLE. The default value for enable_largefile is emitted
+# unconditionally because the generated shell code always looks at
+# this variable.
+m4_define([_AC_SYS_LARGEFILE_ENABLE],
+[m4_divert_text([DEFAULTS],
+ enable_largefile=yes)]dnl
+[AC_ARG_ENABLE([largefile],
+ [AS_HELP_STRING([--disable-largefile], [omit support for large files])])])
+
+# AC_SYS_LARGEFILE
+# ----------------
+# By default, many hosts won't let programs access large files;
+# one must use special compiler options to get large-file access to work.
+# For more details about this brain damage please see:
+# http://www.unix.org/version2/whatsnew/lfs20mar.html
+# Additionally, on Linux file systems with 64-bit inodes a file that happens
+# to have a 64-bit inode number cannot be accessed by 32-bit applications on
+# Linux x86/x86_64. This can occur with file systems such as XFS and NFS.
+# This macro allows configuration to continue if the system doesn't support
+# large files.
+AC_DEFUN([AC_SYS_LARGEFILE],
+[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl
+ AS_IF([test "$enable_largefile" != no], [_AC_SYS_LARGEFILE_PROBE])
+ AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE])
+])])
+])# m4_ifndef AC_SYS_YEAR2038
+
+# Enable large files on systems where this is implemented by Gnulib, not by the
+# system headers.
+# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
+# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
+AC_DEFUN([gl_LARGEFILE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ dnl Native Windows.
+ dnl mingw64 defines off_t to a 64-bit type already, if
+ dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
+ AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+ ]],
+ [[]])],
+ [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
+ ])
+ if test $gl_cv_type_off_t_64 = no; then
+ WINDOWS_64_BIT_OFF_T=1
+ else
+ WINDOWS_64_BIT_OFF_T=0
+ fi
+ dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat'
+ dnl to 'struct _stat32i64' or 'struct _stat64' (depending on
+ dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member.
+ AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ struct stat buf;
+ int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
+ ]],
+ [[]])],
+ [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no])
+ ])
+ if test $gl_cv_member_st_size_64 = no; then
+ WINDOWS_64_BIT_ST_SIZE=1
+ else
+ WINDOWS_64_BIT_ST_SIZE=0
+ fi
+ ;;
+ *)
+ dnl Nothing to do on gnulib's side.
+ dnl A 64-bit off_t is
+ dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
+ dnl OSF/1, Cygwin,
+ dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
+ dnl glibc, HP-UX, Solaris,
+ dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
+ dnl - impossible to achieve on Minix 3.1.8.
+ WINDOWS_64_BIT_OFF_T=0
+ WINDOWS_64_BIT_ST_SIZE=0
+ ;;
+ esac
+])
diff --git a/gl/m4/libtool.m4 b/gl/m4/libtool.m4
new file mode 100644
index 0000000..534d1cc
--- /dev/null
+++ b/gl/m4/libtool.m4
@@ -0,0 +1,7983 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
new file mode 100644
index 0000000..5088fa1
--- /dev/null
+++ b/gl/m4/limits-h.m4
@@ -0,0 +1,41 @@
+dnl Check whether limits.h has needed features.
+
+dnl Copyright 2016-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_DEFUN_ONCE([gl_LIMITS_H],
+[
+ gl_CHECK_NEXT_HEADERS([limits.h])
+
+ AC_CACHE_CHECK([whether limits.h has WORD_BIT, BOOL_WIDTH etc.],
+ [gl_cv_header_limits_width],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <limits.h>
+ long long llm = LLONG_MAX;
+ int wb = WORD_BIT;
+ int ullw = ULLONG_WIDTH;
+ int bw = BOOL_WIDTH;
+ ]])],
+ [gl_cv_header_limits_width=yes],
+ [gl_cv_header_limits_width=no])])
+ if test "$gl_cv_header_limits_width" = yes; then
+ GL_GENERATE_LIMITS_H=false
+ else
+ GL_GENERATE_LIMITS_H=true
+ fi
+])
+
+dnl Unconditionally enables the replacement of <limits.h>.
+AC_DEFUN([gl_REPLACE_LIMITS_H],
+[
+ AC_REQUIRE([gl_LIMITS_H])
+ GL_GENERATE_LIMITS_H=true
+])
diff --git a/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4
new file mode 100644
index 0000000..15b6b2a
--- /dev/null
+++ b/gl/m4/localcharset.m4
@@ -0,0 +1,11 @@
+# localcharset.m4 serial 8
+dnl Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_LOCALCHARSET],
+[
+ dnl Prerequisites of lib/localcharset.c.
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+])
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
new file mode 100644
index 0000000..8c41fad
--- /dev/null
+++ b/gl/m4/locale-fr.m4
@@ -0,0 +1,253 @@
+# locale-fr.m4 serial 20
+dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Determine the name of a french locale with traditional encoding.
+AC_DEFUN([gt_LOCALE_FR],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in the abbreviation of the second month, the second
+ character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+ one byte long. This excludes the UTF-8 encoding. */
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
+ /* Check whether the decimal separator is a comma.
+ On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+ are nl_langinfo(RADIXCHAR) are both ".". */
+ if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+ return 0;
+#endif
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the native Windows locale name.
+ if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=French_France.1252
+ else
+ # None found.
+ gt_cv_locale_fr=none
+ fi
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.ISO-8859-1
+ else
+ # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
+ if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.ISO8859-1
+ else
+ # Test for the HP-UX locale name.
+ if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr_FR.iso88591
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr=fr
+ else
+ # None found.
+ gt_cv_locale_fr=none
+ fi
+ fi
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_FR=$gt_cv_locale_fr
+ AC_SUBST([LOCALE_FR])
+])
+
+dnl Determine the name of a french locale with UTF-8 encoding.
+AC_DEFUN([gt_LOCALE_FR_UTF8],
+[
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if !(defined __BEOS__ || defined __HAIKU__)
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail. */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in the abbreviation of the second month, the second
+ character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+ two bytes long, with UTF-8 encoding. */
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%b", &t) < 4
+ || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+ return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
+ /* Check whether the decimal separator is a comma.
+ On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+ are nl_langinfo(RADIXCHAR) are both ".". */
+ if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+ return 0;
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=French_France.65001
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+ AC_SUBST([LOCALE_FR_UTF8])
+])
diff --git a/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4
new file mode 100644
index 0000000..2590173
--- /dev/null
+++ b/gl/m4/locale-ja.m4
@@ -0,0 +1,143 @@
+# locale-ja.m4 serial 15
+dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Determine the name of a japanese locale with EUC-JP encoding.
+AC_DEFUN([gt_LOCALE_JA],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
+ on Cygwin 1.5.x. */
+ if (MB_CUR_MAX == 1)
+ return 1;
+ /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+ This excludes the UTF-8 encoding (except on MirBSD). */
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
+ return 0;
+#endif
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Note that on native Windows, the Japanese locale is
+ # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
+ # cannot use it here.
+ gt_cv_locale_ja=none
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the AIX locale name.
+ if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.EUC-JP
+ else
+ # Test for the HP-UX, OSF/1, NetBSD locale name.
+ if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.eucJP
+ else
+ # Test for the IRIX, FreeBSD locale name.
+ if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja_JP.EUC
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_ja=ja
+ else
+ # Special test for NetBSD 1.6.
+ if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
+ gt_cv_locale_ja=ja_JP.eucJP
+ else
+ # None found.
+ gt_cv_locale_ja=none
+ fi
+ fi
+ fi
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_JA=$gt_cv_locale_ja
+ AC_SUBST([LOCALE_JA])
+])
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
new file mode 100644
index 0000000..b9f9eef
--- /dev/null
+++ b/gl/m4/locale-zh.m4
@@ -0,0 +1,137 @@
+# locale-zh.m4 serial 15
+dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Determine the name of a chinese locale with GB18030 encoding.
+AC_DEFUN([gt_LOCALE_ZH_CN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AM_LANGINFO_CODESET])
+ AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
+ /* Check whether the given locale name is recognized by the system. */
+# if defined _WIN32 && !defined __CYGWIN__
+ /* On native Windows, setlocale(category, "") looks at the system settings,
+ not at the environment variables. Also, when an encoding suffix such
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+ category of the locale to "C". */
+ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+ || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ return 1;
+# else
+ if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
+ /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+ On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+ some unit tests fail.
+ On MirBSD 10, when an unsupported locale is specified, setlocale()
+ succeeds but then nl_langinfo(CODESET) is "UTF-8". */
+# if HAVE_LANGINFO_CODESET
+ {
+ const char *cs = nl_langinfo (CODESET);
+ if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+ || strcmp (cs, "UTF-8") == 0)
+ return 1;
+ }
+# endif
+# ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+ /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+ This excludes the UTF-8 encoding (except on MirBSD). */
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
+ /* Check whether a typical GB18030 multibyte sequence is recognized as a
+ single wide character. This excludes the GB2312 and GBK encodings. */
+ if (mblen ("\203\062\332\066", 5) != 4)
+ return 1;
+ return 0;
+#endif
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=Chinese_China.54936
+ else
+ # None found.
+ gt_cv_locale_zh_CN=none
+ fi
+ ;;
+ solaris2.8)
+ # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+ # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+ # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+ gt_cv_locale_zh_CN=none
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the locale name without encoding suffix.
+ if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=zh_CN
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_zh_CN=zh_CN.GB18030
+ else
+ # None found.
+ gt_cv_locale_zh_CN=none
+ fi
+ fi
+ ;;
+ esac
+ else
+ # If there was a link error, due to mblen(), the system is so old that
+ # it certainly doesn't have a chinese locale.
+ gt_cv_locale_zh_CN=none
+ fi
+ rm -fr conftest*
+ ])
+ LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+ AC_SUBST([LOCALE_ZH_CN])
+])
diff --git a/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4
new file mode 100644
index 0000000..a33a0a4
--- /dev/null
+++ b/gl/m4/locale_h.m4
@@ -0,0 +1,174 @@
+# locale_h.m4 serial 28
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_LOCALE_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+
+ dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_*
+ dnl members of 'struct lconv'.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
+ AC_REQUIRE([gl_STDDEF_H])
+
+ AC_REQUIRE([gl_LOCALE_T])
+
+ dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv'
+ dnl only if _LCONV_C99 is defined.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ solaris*)
+ AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.])
+ ;;
+ esac
+
+ AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001],
+ [gl_cv_header_locale_h_posix2001],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ int x = LC_MESSAGES;
+ int y = sizeof (((struct lconv *) 0)->decimal_point);]],
+ [[]])],
+ [gl_cv_header_locale_h_posix2001=yes],
+ [gl_cv_header_locale_h_posix2001=no])])
+
+ dnl Check whether 'struct lconv' is complete.
+ dnl Bionic libc's 'struct lconv' is just a dummy.
+ dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
+ dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members.
+ AC_CACHE_CHECK([whether struct lconv is properly defined],
+ [gl_cv_sys_struct_lconv_ok],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ struct lconv l;
+ int x = sizeof (l.decimal_point);
+ int y = sizeof (l.int_p_cs_precedes);]],
+ [[]])],
+ [gl_cv_sys_struct_lconv_ok=yes],
+ [gl_cv_sys_struct_lconv_ok=no])
+ ])
+ if test $gl_cv_sys_struct_lconv_ok = no; then
+ dnl On native Windows with MSVC, merely define these member names as macros.
+ dnl This avoids trouble in C++ mode.
+ case "$host_os" in
+ mingw*)
+ AC_EGREP_CPP([Special], [
+#ifdef _MSC_VER
+ Special
+#endif
+ ],
+ [],
+ [REPLACE_STRUCT_LCONV=1])
+ ;;
+ *) REPLACE_STRUCT_LCONV=1 ;;
+ esac
+ fi
+
+ dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_NEXT_HEADERS([locale.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <locale.h>
+/* Some systems provide declarations in a non-standard header. */
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+ ]],
+ [setlocale newlocale duplocale freelocale])
+])
+
+dnl Checks to determine whether the system has the locale_t type,
+dnl and how to obtain it.
+AC_DEFUN([gl_LOCALE_T],
+[
+ dnl Persuade glibc and Solaris <locale.h> to define locale_t.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
+ dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
+ dnl itself, we assume that <xlocale.h> will do so.
+ AC_CACHE_CHECK([whether locale.h defines locale_t],
+ [gl_cv_header_locale_has_locale_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ locale_t x;]],
+ [[]])],
+ [gl_cv_header_locale_has_locale_t=yes],
+ [gl_cv_header_locale_has_locale_t=no])
+ ])
+
+ dnl Check for <xlocale.h>.
+ AC_CHECK_HEADERS_ONCE([xlocale.h])
+ if test $ac_cv_header_xlocale_h = yes; then
+ HAVE_XLOCALE_H=1
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ else
+ gl_cv_header_locale_h_needs_xlocale_h=yes
+ fi
+ HAVE_LOCALE_T=1
+ else
+ HAVE_XLOCALE_H=0
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ HAVE_LOCALE_T=1
+ else
+ HAVE_LOCALE_T=0
+ fi
+ fi
+ AC_SUBST([HAVE_XLOCALE_H])
+])
+
+# gl_LOCALE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_LOCALE_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_LOCALE_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE])
+ HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
+ HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE])
+ REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
+ REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
+ REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE])
+ REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
+ REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE])
+ REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
+ LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS])
+])
diff --git a/gl/m4/localeconv.m4 b/gl/m4/localeconv.m4
new file mode 100644
index 0000000..ae225fe
--- /dev/null
+++ b/gl/m4/localeconv.m4
@@ -0,0 +1,22 @@
+# localeconv.m4 serial 1
+dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_LOCALECONV],
+[
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+ AC_REQUIRE([gl_LOCALE_H])
+
+ if test $REPLACE_STRUCT_LCONV = 1; then
+ REPLACE_LOCALECONV=1
+ fi
+])
+
+# Prerequisites of lib/localeconv.c.
+AC_DEFUN([gl_PREREQ_LOCALECONV],
+[
+ AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
+ [[#include <locale.h>]])
+])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
new file mode 100644
index 0000000..88cf557
--- /dev/null
+++ b/gl/m4/lock.m4
@@ -0,0 +1,47 @@
+# lock.m4 serial 14
+dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_LOCK],
+[
+ AC_REQUIRE([gl_THREADLIB])
+ if test "$gl_threads_api" = posix; then
+ # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
+ # pthread_rwlock_* functions.
+ has_rwlock=false
+ AC_CHECK_TYPE([pthread_rwlock_t],
+ [has_rwlock=true
+ AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
+ [Define if the POSIX multithreading library has read/write locks.])],
+ [],
+ [#include <pthread.h>])
+ if $has_rwlock; then
+ gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+ fi
+ # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <pthread.h>]],
+ [[
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
+ ]])],
+ [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
+ [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
+ fi
+ gl_PREREQ_LOCK
+])
+
+# Prerequisites of lib/glthread/lock.c.
+AC_DEFUN([gl_PREREQ_LOCK], [:])
diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4
new file mode 100644
index 0000000..fd4f1f2
--- /dev/null
+++ b/gl/m4/lseek.m4
@@ -0,0 +1,78 @@
+# lseek.m4 serial 12
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_LSEEK],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
+ [case "$host_os" in
+ mingw*)
+ dnl Native Windows.
+ dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or
+ dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT)
+ dnl for a pipe depends on the environment: In a Cygwin 1.5
+ dnl environment it succeeds (wrong); in a Cygwin 1.7 environment
+ dnl it fails with a wrong errno value.
+ gl_cv_func_lseek_pipe=no
+ ;;
+ *)
+ if test $cross_compiling = no; then
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h> /* for off_t */
+#include <stdio.h> /* for SEEK_CUR */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+]GL_MDA_DEFINES],
+[[
+ /* Exit with success only if stdin is seekable. */
+ return lseek (0, (off_t)0, SEEK_CUR) < 0;
+]])],
+ [if test -s conftest$ac_exeext \
+ && ./conftest$ac_exeext < conftest.$ac_ext \
+ && test 1 = "`echo hi \
+ | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+ gl_cv_func_lseek_pipe=yes
+ else
+ gl_cv_func_lseek_pipe=no
+ fi
+ ],
+ [gl_cv_func_lseek_pipe=no])
+ else
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+#if defined __BEOS__
+/* BeOS mistakenly return 0 when trying to seek on pipes. */
+ Choke me.
+#endif]])],
+ [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
+ fi
+ ;;
+ esac
+ ])
+ if test "$gl_cv_func_lseek_pipe" = no; then
+ REPLACE_LSEEK=1
+ AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
+ [Define to 1 if lseek does not detect pipes.])
+ fi
+
+ AC_REQUIRE([gl_SYS_TYPES_H])
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_LSEEK=1
+ fi
+
+ dnl macOS SEEK_DATA is incompatible with other platforms.
+ case $host_os in
+ darwin*)
+ REPLACE_LSEEK=1;;
+ esac
+])
diff --git a/gl/m4/ltoptions.m4 b/gl/m4/ltoptions.m4
new file mode 100644
index 0000000..5d9acd8
--- /dev/null
+++ b/gl/m4/ltoptions.m4
@@ -0,0 +1,384 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/gl/m4/ltsugar.m4 b/gl/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/gl/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/gl/m4/ltversion.m4 b/gl/m4/ltversion.m4
new file mode 100644
index 0000000..07a8602
--- /dev/null
+++ b/gl/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/gl/m4/lt~obsolete.m4 b/gl/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/gl/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
new file mode 100644
index 0000000..5540292
--- /dev/null
+++ b/gl/m4/malloc.m4
@@ -0,0 +1,175 @@
+# malloc.m4 serial 28
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# This is adapted with modifications from upstream Autoconf here:
+# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n949
+AC_DEFUN([_AC_FUNC_MALLOC_IF],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CACHE_CHECK([whether malloc (0) returns nonnull],
+ [ac_cv_func_malloc_0_nonnull],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ ]],
+ [[void *p = malloc (0);
+ int result = !p;
+ free (p);
+ return result;]])
+ ],
+ [ac_cv_func_malloc_0_nonnull=yes],
+ [ac_cv_func_malloc_0_nonnull=no],
+ [case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+ | gnu* | *-musl* | midnightbsd* \
+ | hpux* | solaris* | cygwin* | mingw* | msys* )
+ ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ AS_CASE([$ac_cv_func_malloc_0_nonnull], [*yes], [$1], [$2])
+])# _AC_FUNC_MALLOC_IF
+
+# gl_FUNC_MALLOC_GNU
+# ------------------
+# Replace malloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_MALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX"
+ if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then
+ _AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC_FOR_MALLOC_GNU=1])
+ fi
+])
+
+# gl_FUNC_MALLOC_PTRDIFF
+# ----------------------
+# Test whether malloc (N) reliably fails when N exceeds PTRDIFF_MAX,
+# and replace malloc otherwise.
+AC_DEFUN([gl_FUNC_MALLOC_PTRDIFF],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
+ test "$gl_cv_malloc_ptrdiff" = yes || REPLACE_MALLOC_FOR_MALLOC_POSIX=1
+])
+
+# Test whether malloc, realloc, calloc refuse to create objects
+# larger than what can be expressed in ptrdiff_t.
+# Set gl_cv_func_malloc_gnu to yes or no accordingly.
+AC_DEFUN([gl_CHECK_MALLOC_PTRDIFF],
+[
+ AC_CACHE_CHECK([whether malloc is ptrdiff_t safe],
+ [gl_cv_malloc_ptrdiff],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdint.h>
+ ]],
+ [[/* 64-bit ptrdiff_t is so wide that no practical platform
+ can exceed it. */
+ #define WIDE_PTRDIFF (PTRDIFF_MAX >> 31 >> 31 != 0)
+
+ /* On rare machines where size_t fits in ptrdiff_t there
+ is no problem. */
+ #define NARROW_SIZE (SIZE_MAX <= PTRDIFF_MAX)
+
+ /* glibc 2.30 and later malloc refuses to exceed ptrdiff_t
+ bounds even on 32-bit platforms. We don't know which
+ non-glibc systems are safe. */
+ #define KNOWN_SAFE (2 < __GLIBC__ + (30 <= __GLIBC_MINOR__))
+
+ #if WIDE_PTRDIFF || NARROW_SIZE || KNOWN_SAFE
+ return 0;
+ #else
+ #error "malloc might not be ptrdiff_t safe"
+ syntax error
+ #endif
+ ]])],
+ [gl_cv_malloc_ptrdiff=yes],
+ [gl_cv_malloc_ptrdiff=no])
+ ])
+])
+
+# gl_FUNC_MALLOC_POSIX
+# --------------------
+# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t overflow), and replace
+# malloc if it is not.
+AC_DEFUN([gl_FUNC_MALLOC_POSIX],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_PTRDIFF])
+ AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
+ if test "$gl_cv_func_malloc_posix" = yes; then
+ AC_DEFINE([HAVE_MALLOC_POSIX], [1],
+ [Define if malloc, realloc, and calloc set errno on allocation failure.])
+ else
+ REPLACE_MALLOC_FOR_MALLOC_POSIX=1
+ fi
+])
+
+# Test whether malloc, realloc, calloc set errno to ENOMEM on failure.
+# Set gl_cv_func_malloc_posix to yes or no accordingly.
+AC_DEFUN([gl_CHECK_MALLOC_POSIX],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether malloc, realloc, calloc set errno on failure],
+ [gl_cv_func_malloc_posix],
+ [
+ dnl It is too dangerous to try to allocate a large amount of memory:
+ dnl some systems go to their knees when you do that. So assume that
+ dnl all Unix implementations of the function set errno on failure,
+ dnl except on those platforms where we have seen 'test-malloc-gnu',
+ dnl 'test-realloc-gnu', 'test-calloc-gnu' fail.
+ case "$host_os" in
+ mingw*)
+ gl_cv_func_malloc_posix=no ;;
+ irix* | solaris*)
+ dnl On IRIX 6.5, the three functions return NULL with errno unset
+ dnl when the argument is larger than PTRDIFF_MAX.
+ dnl On Solaris 11.3, the three functions return NULL with errno set
+ dnl to EAGAIN, not ENOMEM, when the argument is larger than
+ dnl PTRDIFF_MAX.
+ dnl Here is a test program:
+m4_divert_push([KILL])
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define ptrdiff_t long
+#ifndef PTRDIFF_MAX
+# define PTRDIFF_MAX ((ptrdiff_t) ((1UL << (8 * sizeof (ptrdiff_t) - 1)) - 1))
+#endif
+
+int main ()
+{
+ void *p;
+
+ fprintf (stderr, "PTRDIFF_MAX = %lu\n", (unsigned long) PTRDIFF_MAX);
+
+ errno = 0;
+ p = malloc ((unsigned long) PTRDIFF_MAX + 1);
+ fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+ errno = 0;
+ p = calloc (PTRDIFF_MAX / 2 + 1, 2);
+ fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+ errno = 0;
+ p = realloc (NULL, (unsigned long) PTRDIFF_MAX + 1);
+ fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+ return 0;
+}
+m4_divert_pop([KILL])
+ gl_cv_func_malloc_posix=no ;;
+ *)
+ gl_cv_func_malloc_posix=yes ;;
+ esac
+ ])
+])
diff --git a/gl/m4/malloca.m4 b/gl/m4/malloca.m4
new file mode 100644
index 0000000..1d777eb
--- /dev/null
+++ b/gl/m4/malloca.m4
@@ -0,0 +1,14 @@
+# malloca.m4 serial 2
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_MALLOCA],
+[
+ dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables
+ dnl @ALLOCA@ and @LTALLOCA@.
+ dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
+ AC_REQUIRE([gl_EEMALLOC])
+])
diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4
new file mode 100644
index 0000000..d2e90ff
--- /dev/null
+++ b/gl/m4/math_h.m4
@@ -0,0 +1,391 @@
+# math_h.m4 serial 125
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_MATH_H],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([math.h])
+
+ AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
+ [[/* Solaris 10 has a broken definition of NAN. Other platforms
+ fail to provide NAN, or provide it only in C99 mode; this
+ test only needs to fail when NAN is provided but wrong. */
+ float f = 1.0f;
+#ifdef NAN
+ f = NAN;
+#endif
+ return f == 0;]])],
+ [gl_cv_header_math_nan_works=yes],
+ [gl_cv_header_math_nan_works=no])])
+ if test $gl_cv_header_math_nan_works = no; then
+ REPLACE_NAN=1
+ fi
+ AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
+ [[/* Solaris 10 has a broken definition of HUGE_VAL. */
+ double d = HUGE_VAL;
+ return d == 0;]])],
+ [gl_cv_header_math_huge_val_works=yes],
+ [gl_cv_header_math_huge_val_works=no])])
+ if test $gl_cv_header_math_huge_val_works = no; then
+ REPLACE_HUGE_VAL=1
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
+ [acosf acosl asinf asinl atanf atanl
+ cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
+ expf expl exp2 exp2f exp2l expm1 expm1f expm1l
+ fabsf fabsl floorf floorl fma fmaf fmal
+ fmod fmodf fmodl frexpf frexpl hypotf hypotl
+ ilogb ilogbf ilogbl
+ ldexpf ldexpl
+ log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
+ logb logbf logbl
+ modf modff modfl powf
+ remainder remainderf remainderl
+ rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
+ tanf tanl tanhf trunc truncf truncl])
+])
+
+# gl_MATH_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_MATH_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_MATH_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_MATH_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
+ HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
+ HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
+ HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
+ HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
+ HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
+ HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
+ HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
+ HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
+ HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
+ HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
+ HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
+ HAVE_COSF=1; AC_SUBST([HAVE_COSF])
+ HAVE_COSL=1; AC_SUBST([HAVE_COSL])
+ HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
+ HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
+ HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
+ HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
+ HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
+ HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
+ HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
+ HAVE_FMA=1; AC_SUBST([HAVE_FMA])
+ HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
+ HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
+ HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
+ HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
+ HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
+ HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
+ HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
+ HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
+ HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
+ HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
+ HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
+ HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
+ HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
+ HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
+ HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
+ HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
+ HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
+ HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
+ HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
+ HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
+ HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
+ HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
+ HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
+ HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
+ HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
+ HAVE_POWF=1; AC_SUBST([HAVE_POWF])
+ HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
+ HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
+ HAVE_RINT=1; AC_SUBST([HAVE_RINT])
+ HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
+ HAVE_SINF=1; AC_SUBST([HAVE_SINF])
+ HAVE_SINL=1; AC_SUBST([HAVE_SINL])
+ HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
+ HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
+ HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
+ HAVE_TANF=1; AC_SUBST([HAVE_TANF])
+ HAVE_TANL=1; AC_SUBST([HAVE_TANL])
+ HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
+ HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
+ HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
+ HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
+ HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
+ HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
+ HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
+ HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
+ HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
+ HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
+ HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
+ HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
+ HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
+ HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
+ HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
+ HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
+ HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
+ HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
+ HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
+ HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
+ HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
+ HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
+ HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
+ HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
+ HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
+ HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
+ HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
+ HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
+ HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
+ HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
+ HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
+ HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
+ HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
+ HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
+ HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
+ HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
+ HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
+ REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
+ REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
+ REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
+ REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
+ REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
+ REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
+ REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
+ REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
+ REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
+ REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
+ REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
+ REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
+ REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL])
+ REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
+ REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
+ REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L])
+ REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
+ REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
+ REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
+ REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
+ REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
+ REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
+ REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
+ REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
+ REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
+ REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
+ REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
+ REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
+ REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
+ REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
+ REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
+ REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
+ REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
+ REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
+ REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
+ REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
+ REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
+ REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL])
+ REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
+ REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
+ REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
+ REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
+ REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
+ REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
+ REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
+ REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
+ REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
+ REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
+ REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
+ REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
+ REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
+ REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
+ REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
+ REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
+ REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
+ REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
+ REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
+ REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
+ REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
+ REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
+ REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
+ REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
+ REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
+ REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
+ REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL])
+ REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
+ REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
+ REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
+ REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
+ REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
+ REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
+ REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
+ REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
+ REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
+ REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
+ REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
+ REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
+ REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
+ REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
+])
+
+# gl_LONG_DOUBLE_VS_DOUBLE
+# determines whether 'long double' and 'double' have the same representation.
+# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
+# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
+# The currently known platforms where this is the case are:
+# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
+AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
+[
+ AC_CACHE_CHECK([whether long double and double are the same],
+ [gl_cv_long_double_equals_double],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <float.h>]],
+ [[typedef int check[sizeof (long double) == sizeof (double)
+ && LDBL_MANT_DIG == DBL_MANT_DIG
+ && LDBL_MAX_EXP == DBL_MAX_EXP
+ && LDBL_MIN_EXP == DBL_MIN_EXP
+ ? 1 : -1];
+ ]])],
+ [gl_cv_long_double_equals_double=yes],
+ [gl_cv_long_double_equals_double=no])
+ ])
+ if test $gl_cv_long_double_equals_double = yes; then
+ AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
+ [Define to 1 if 'long double' and 'double' have the same representation.])
+ HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
+ else
+ HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
+ fi
+ AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
+])
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
new file mode 100644
index 0000000..bb39304
--- /dev/null
+++ b/gl/m4/mbrtowc.m4
@@ -0,0 +1,790 @@
+# mbrtowc.m4 serial 38 -*- coding: utf-8 -*-
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MBRTOWC],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ gl_MBSTATE_T_BROKEN
+
+ AC_CHECK_FUNCS_ONCE([mbrtowc])
+ if test $ac_cv_func_mbrtowc = no; then
+ HAVE_MBRTOWC=0
+ AC_CHECK_DECLS([mbrtowc],,, [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_mbrtowc = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_MBRTOWC=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBRTOWC=1
+ else
+ gl_MBRTOWC_NULL_ARG1
+ gl_MBRTOWC_NULL_ARG2
+ gl_MBRTOWC_RETVAL
+ gl_MBRTOWC_NUL_RETVAL
+ gl_MBRTOWC_STORES_INCOMPLETE
+ gl_MBRTOWC_EMPTY_INPUT
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_null_arg1" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1],
+ [Define if the mbrtowc function has the NULL pwc argument bug.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_null_arg2" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1],
+ [Define if the mbrtowc function has the NULL string argument bug.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_retval" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
+ [Define if the mbrtowc function returns a wrong return value.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_nul_retval" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
+ [Define if the mbrtowc function does not return 0 for a NUL character.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_stores_incomplete" in
+ *no) ;;
+ *) AC_DEFINE([MBRTOWC_STORES_INCOMPLETE_BUG], [1],
+ [Define if the mbrtowc function stores a wide character when reporting incomplete input.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_empty_input" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1],
+ [Define if the mbrtowc function does not return (size_t) -2
+ for empty input.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *) AC_DEFINE([MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ], [1],
+ [Define if the mbrtowc function may signal encoding errors in the C locale.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
+ fi
+ fi
+ if test $REPLACE_MBSTATE_T = 1; then
+ case "$host_os" in
+ mingw*) LIB_MBRTOWC= ;;
+ *)
+ gl_WEAK_SYMBOLS
+ case "$gl_cv_have_weak" in
+ *yes) LIB_MBRTOWC= ;;
+ *) LIB_MBRTOWC="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_MBRTOWC=
+ fi
+ dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_MBRTOWC])
+])
+
+dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
+dnl redefines the semantics of the given mbstate_t type.
+dnl Result is REPLACE_MBSTATE_T.
+dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to
+dnl avoid inconsistencies.
+
+AC_DEFUN([gl_MBSTATE_T_BROKEN],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ AC_CHECK_FUNCS_ONCE([mbsinit])
+ AC_CHECK_FUNCS_ONCE([mbrtowc])
+ dnl On native Windows, we know exactly how mbsinit() behaves and don't need
+ dnl to override it, even if - like on MSVC - mbsinit() is only defined as
+ dnl an inline function, not as a global function.
+ if case "$host_os" in
+ mingw*) true ;;
+ *) test $ac_cv_func_mbsinit = yes ;;
+ esac \
+ && test $ac_cv_func_mbrtowc = yes; then
+ gl_MBRTOWC_INCOMPLETE_STATE
+ gl_MBRTOWC_SANITYCHECK
+ REPLACE_MBSTATE_T=0
+ case "$gl_cv_func_mbrtowc_incomplete_state" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ case "$gl_cv_func_mbrtowc_sanitycheck" in
+ *yes) ;;
+ *) REPLACE_MBSTATE_T=1 ;;
+ esac
+ else
+ REPLACE_MBSTATE_T=1
+ fi
+])
+
+dnl Test whether mbrtowc puts the state into non-initial state when parsing an
+dnl incomplete multibyte character.
+dnl Result is gl_cv_func_mbrtowc_incomplete_state.
+
+AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
+ [gl_cv_func_mbrtowc_incomplete_state],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX and OSF/1.
+ aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_JA != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_incomplete_state=yes],
+ [gl_cv_func_mbrtowc_incomplete_state=no],
+ [:])
+ else
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_incomplete_state=yes],
+ [gl_cv_func_mbrtowc_incomplete_state=no],
+ [:])
+ fi
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc works not worse than mbtowc.
+dnl Result is gl_cv_func_mbrtowc_sanitycheck.
+
+AC_DEFUN([gl_MBRTOWC_SANITYCHECK],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc],
+ [gl_cv_func_mbrtowc_sanitycheck],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris 8.
+ solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8:
+ mbrtowc returns 2, and sets wc to 0x00F0.
+ mbtowc returns 4 (correct) and sets wc to 0x5EDC. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 6, &state) != 4
+ && mbtowc (&wc, input + 3, 6) == 4)
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_sanitycheck=yes],
+ [gl_cv_func_mbrtowc_sanitycheck=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc supports a NULL pwc argument correctly.
+dnl Result is gl_cv_func_mbrtowc_null_arg1.
+
+AC_DEFUN([gl_MBRTOWC_NULL_ARG1],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument],
+ [gl_cv_func_mbrtowc_null_arg1],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ char input[] = "\303\237er";
+ mbstate_t state;
+ wchar_t wc;
+ size_t ret;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ ret = mbrtowc (&wc, input, 5, &state);
+ if (ret != 2)
+ result |= 1;
+ if (!mbsinit (&state))
+ result |= 2;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ ret = mbrtowc (NULL, input, 5, &state);
+ if (ret != 2) /* Solaris 7 fails here: ret is -1. */
+ result |= 4;
+ if (!mbsinit (&state))
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_mbrtowc_null_arg1=yes],
+ [gl_cv_func_mbrtowc_null_arg1=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc supports a NULL string argument correctly.
+dnl Result is gl_cv_func_mbrtowc_null_arg2.
+
+AC_DEFUN([gl_MBRTOWC_NULL_ARG2],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
+ [gl_cv_func_mbrtowc_null_arg2],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on OSF/1.
+ osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ mbstate_t state;
+ wchar_t wc;
+ int ret;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ wc = (wchar_t) 0xBADFACE;
+ mbrtowc (&wc, NULL, 5, &state);
+ /* Check that wc was not modified. */
+ if (wc != (wchar_t) 0xBADFACE)
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_null_arg2=yes],
+ [gl_cv_func_mbrtowc_null_arg2=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc, when parsing the end of a multibyte character,
+dnl correctly returns the number of bytes that were needed to complete the
+dnl character (not the total number of bytes of the multibyte character).
+dnl Result is gl_cv_func_mbrtowc_retval.
+
+AC_DEFUN([gl_MBRTOWC_RETVAL],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether mbrtowc has a correct return value],
+ [gl_cv_func_mbrtowc_retval],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on HP-UX, Solaris, native Windows.
+ hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_retval="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
+ || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ int found_some_locale = 0;
+ /* This fails on Solaris. */
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ {
+ input[1] = '\0';
+ if (mbrtowc (&wc, input + 2, 5, &state) != 1)
+ result |= 1;
+ }
+ found_some_locale = 1;
+ }
+ /* This fails on HP-UX 11.11. */
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ {
+ input[1] = '\0';
+ if (mbrtowc (&wc, input + 2, 5, &state) != 2)
+ result |= 2;
+ }
+ found_some_locale = 1;
+ }
+ /* This fails on native Windows. */
+ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+ {
+ char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 4;
+ }
+ found_some_locale = 1;
+ }
+ if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+ {
+ char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 8;
+ }
+ found_some_locale = 1;
+ }
+ if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+ {
+ char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+ {
+ input[3] = '\0';
+ if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+ result |= 16;
+ }
+ found_some_locale = 1;
+ }
+ return (found_some_locale ? result : 77);
+}]])],
+ [gl_cv_func_mbrtowc_retval=yes],
+ [if test $? != 77; then
+ gl_cv_func_mbrtowc_retval=no
+ fi
+ ],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0.
+dnl Result is gl_cv_func_mbrtowc_nul_retval.
+
+AC_DEFUN([gl_MBRTOWC_NUL_RETVAL],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character],
+ [gl_cv_func_mbrtowc_nul_retval],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris 8 and 9.
+ solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ /* This fails on Solaris 8 and 9. */
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "", 1, &state) != 0)
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_nul_retval=yes],
+ [gl_cv_func_mbrtowc_nul_retval=no],
+ [:])
+ fi
+ ])
+])
+
+dnl Test whether mbrtowc stores a wide character when reporting incomplete
+dnl input.
+
+AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc stores incomplete characters],
+ [gl_cv_func_mbrtowc_stores_incomplete],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
+ esac
+changequote([,])dnl
+ case "$host_os" in
+ mingw*)
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "French_France.65001") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 1;
+ }
+ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 2;
+ }
+ if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 4;
+ }
+ if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_mbrtowc_stores_incomplete=no],
+ [gl_cv_func_mbrtowc_stores_incomplete=yes],
+ [:])
+ ;;
+ *)
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ return 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_stores_incomplete=no],
+ [gl_cv_func_mbrtowc_stores_incomplete=yes],
+ [:])
+ fi
+ ;;
+ esac
+ ])
+])
+
+dnl Test whether mbrtowc returns the correct value on empty input.
+
+AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc works on empty input],
+ [gl_cv_func_mbrtowc_empty_input],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX and glibc systems.
+ aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ esac
+changequote([,])dnl
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <wchar.h>
+ static wchar_t wc;
+ static mbstate_t mbs;
+ int
+ main (void)
+ {
+ return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
+ }]])],
+ [gl_cv_func_mbrtowc_empty_input=yes],
+ [gl_cv_func_mbrtowc_empty_input=no],
+ [:])
+ ])
+])
+
+dnl Test whether mbrtowc reports encoding errors in the C locale.
+dnl Although POSIX was never intended to allow this, the GNU C Library
+dnl and other implementations do it. See:
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
+
+AC_DEFUN([gl_MBRTOWC_C_LOCALE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether the C locale is free of encoding errors],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+ gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
+
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <limits.h>
+ #include <locale.h>
+ #include <wchar.h>
+ ]], [[
+ int i;
+ char *locale = setlocale (LC_ALL, "C");
+ if (! locale)
+ return 2;
+ for (i = CHAR_MIN; i <= CHAR_MAX; i++)
+ {
+ char c = i;
+ wchar_t wc;
+ mbstate_t mbs = { 0, };
+ size_t ss = mbrtowc (&wc, &c, 1, &mbs);
+ if (1 < ss)
+ return 3;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+ esac
+ ])
+ ])
+])
+
+# Prerequisites of lib/mbrtowc.c and lib/lc-charset-dispatch.c.
+AC_DEFUN([gl_PREREQ_MBRTOWC], [
+ AC_REQUIRE([AC_C_INLINE])
+ :
+])
+
+# Prerequisites of lib/mbtowc-lock.c.
+AC_DEFUN([gl_PREREQ_MBTOWC_LOCK],
+[
+ gl_VISIBILITY
+])
+
+
+dnl From Paul Eggert
+
+dnl This is an override of an autoconf macro.
+
+AC_DEFUN([AC_FUNC_MBRTOWC],
+[
+ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
+ AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
+ [gl_cv_func_mbrtowc],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>]],
+ [[wchar_t wc;
+ char const s[] = "";
+ size_t n = 1;
+ mbstate_t state;
+ return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
+ [gl_cv_func_mbrtowc=yes],
+ [gl_cv_func_mbrtowc=no])])
+ if test $gl_cv_func_mbrtowc = yes; then
+ AC_DEFINE([HAVE_MBRTOWC], [1],
+ [Define to 1 if mbrtowc and mbstate_t are properly declared.])
+ fi
+])
diff --git a/gl/m4/mbsinit.m4 b/gl/m4/mbsinit.m4
new file mode 100644
index 0000000..c388a8b
--- /dev/null
+++ b/gl/m4/mbsinit.m4
@@ -0,0 +1,44 @@
+# mbsinit.m4 serial 9
+dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MBSINIT],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ gl_MBSTATE_T_BROKEN
+
+ AC_CHECK_FUNCS_ONCE([mbsinit])
+ if test $ac_cv_func_mbsinit = no; then
+ HAVE_MBSINIT=0
+ AC_CHECK_DECLS([mbsinit],,, [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_mbsinit = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_MBSINIT=1
+ fi
+ else
+ if test $REPLACE_MBSTATE_T = 1; then
+ REPLACE_MBSINIT=1
+ else
+ dnl On mingw, mbsinit() always returns 1, which is inappropriate for
+ dnl states produced by mbrtowc() for an incomplete multibyte character
+ dnl in multibyte locales.
+ case "$host_os" in
+ mingw*) REPLACE_MBSINIT=1 ;;
+ esac
+ fi
+ fi
+])
+
+# Prerequisites of lib/mbsinit.c.
+AC_DEFUN([gl_PREREQ_MBSINIT], [
+ :
+])
diff --git a/gl/m4/mbstate_t.m4 b/gl/m4/mbstate_t.m4
new file mode 100644
index 0000000..dcd66b9
--- /dev/null
+++ b/gl/m4/mbstate_t.m4
@@ -0,0 +1,34 @@
+# mbstate_t.m4 serial 14
+dnl Copyright (C) 2000-2002, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# From Paul Eggert.
+
+# BeOS 5 has <wchar.h> but does not define mbstate_t,
+# so you can't declare an object of that type.
+# Check for this incompatibility with Standard C.
+
+# AC_TYPE_MBSTATE_T
+# -----------------
+AC_DEFUN([AC_TYPE_MBSTATE_T],
+[
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11
+
+ AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT[
+ #include <wchar.h>]],
+ [[mbstate_t x; return sizeof x;]])],
+ [ac_cv_type_mbstate_t=yes],
+ [ac_cv_type_mbstate_t=no])])
+ if test $ac_cv_type_mbstate_t = yes; then
+ AC_DEFINE([HAVE_MBSTATE_T], [1],
+ [Define to 1 if <wchar.h> declares mbstate_t.])
+ else
+ AC_DEFINE([mbstate_t], [int],
+ [Define to a type if <wchar.h> does not define.])
+ fi
+])
diff --git a/gl/m4/mbtowc.m4 b/gl/m4/mbtowc.m4
new file mode 100644
index 0000000..7823be0
--- /dev/null
+++ b/gl/m4/mbtowc.m4
@@ -0,0 +1,24 @@
+# mbtowc.m4 serial 3
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MBTOWC],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+ AC_CHECK_FUNCS([mbtowc])
+ if test $ac_cv_func_mbtowc = no; then
+ HAVE_MBTOWC=0
+ else
+ if false; then
+ REPLACE_MBTOWC=1
+ fi
+ fi
+])
+
+# Prerequisites of lib/mbtowc.c.
+AC_DEFUN([gl_PREREQ_MBTOWC], [
+ :
+])
diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4
new file mode 100644
index 0000000..4f1aed0
--- /dev/null
+++ b/gl/m4/memchr.m4
@@ -0,0 +1,106 @@
+# memchr.m4 serial 18
+dnl Copyright (C) 2002-2004, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Check for prerequisites for memory fence checks.
+ gl_FUNC_MMAP_ANON
+ AC_CHECK_HEADERS_ONCE([sys/mman.h])
+ AC_CHECK_FUNCS_ONCE([mprotect])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ # Detect platform-specific bugs in some versions of glibc:
+ # memchr should not dereference anything with length 0
+ # https://bugzilla.redhat.com/show_bug.cgi?id=499689
+ # memchr should not dereference overestimated length after a match
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
+ # memchr should cast the second argument to 'unsigned char'.
+ # This bug exists in Android 4.3.
+ # Assume that memchr works on platforms that lack mprotect.
+ AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h>
+#if HAVE_SYS_MMAN_H
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+# ifndef MAP_FILE
+# define MAP_FILE 0
+# endif
+#endif
+]], [[
+ int result = 0;
+ char *fence = NULL;
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# if HAVE_MAP_ANONYMOUS
+ const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
+ const int fd = -1;
+# else /* !HAVE_MAP_ANONYMOUS */
+ const int flags = MAP_FILE | MAP_PRIVATE;
+ int fd = open ("/dev/zero", O_RDONLY, 0666);
+ if (fd >= 0)
+# endif
+ {
+ int pagesize = getpagesize ();
+ char *two_pages =
+ (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
+ flags, fd, 0);
+ if (two_pages != (char *)(-1)
+ && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
+ fence = two_pages + pagesize;
+ }
+#endif
+ if (fence)
+ {
+ /* Test against bugs on glibc systems. */
+ if (memchr (fence, 0, 0))
+ result |= 1;
+ strcpy (fence - 9, "12345678");
+ if (memchr (fence - 9, 0, 79) != fence - 1)
+ result |= 2;
+ if (memchr (fence - 1, 0, 3) != fence - 1)
+ result |= 4;
+ /* Test against bug on AIX 7.2. */
+ if (memchr (fence - 4, '6', 16) != fence - 4)
+ result |= 8;
+ }
+ /* Test against bug on Android 4.3. */
+ {
+ char input[3];
+ input[0] = 'a';
+ input[1] = 'b';
+ input[2] = 'c';
+ if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
+ result |= 16;
+ }
+ return result;
+]])],
+ [gl_cv_func_memchr_works=yes],
+ [gl_cv_func_memchr_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_memchr_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_memchr_works" in
+ *yes) ;;
+ *) REPLACE_MEMCHR=1 ;;
+ esac
+])
+
+# Prerequisites of lib/memchr.c.
+AC_DEFUN([gl_PREREQ_MEMCHR], [
+ AC_CHECK_HEADERS([bp-sym.h])
+])
diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4
new file mode 100644
index 0000000..fd09846
--- /dev/null
+++ b/gl/m4/minmax.m4
@@ -0,0 +1,44 @@
+# minmax.m4 serial 4
+dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_PREREQ([2.53])
+
+AC_DEFUN([gl_MINMAX],
+[
+ AC_REQUIRE([gl_PREREQ_MINMAX])
+])
+
+# Prerequisites of lib/minmax.h.
+AC_DEFUN([gl_PREREQ_MINMAX],
+[
+ gl_MINMAX_IN_HEADER([limits.h])
+ gl_MINMAX_IN_HEADER([sys/param.h])
+])
+
+dnl gl_MINMAX_IN_HEADER(HEADER)
+dnl The parameter has to be a literal header name; it cannot be macro,
+dnl nor a shell variable. (Because autoheader collects only AC_DEFINE
+dnl invocations with a literal macro name.)
+AC_DEFUN([gl_MINMAX_IN_HEADER],
+[
+ m4_pushdef([header], AS_TR_SH([$1]))
+ m4_pushdef([HEADER], AS_TR_CPP([$1]))
+ AC_CACHE_CHECK([whether <$1> defines MIN and MAX],
+ [gl_cv_minmax_in_]header,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <$1>
+ int x = MIN (42, 17);]],
+ [[]])],
+ [gl_cv_minmax_in_]header[=yes],
+ [gl_cv_minmax_in_]header[=no])])
+ if test $gl_cv_minmax_in_[]header = yes; then
+ AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1,
+ [Define to 1 if <$1> defines the MIN and MAX macros.])
+ fi
+ m4_popdef([HEADER])
+ m4_popdef([header])
+])
diff --git a/gl/m4/mktime.m4 b/gl/m4/mktime.m4
new file mode 100644
index 0000000..e9d31f3
--- /dev/null
+++ b/gl/m4/mktime.m4
@@ -0,0 +1,319 @@
+# serial 37
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+
+AC_DEFUN([gl_TIME_T_IS_SIGNED],
+[
+ AC_CACHE_CHECK([whether time_t is signed],
+ [gl_cv_time_t_is_signed],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <time.h>
+ char time_t_signed[(time_t) -1 < 0 ? 1 : -1];]])],
+ [gl_cv_time_t_is_signed=yes],
+ [gl_cv_time_t_is_signed=no])])
+ if test $gl_cv_time_t_is_signed = yes; then
+ AC_DEFINE([TIME_T_IS_SIGNED], [1], [Define to 1 if time_t is signed.])
+ fi
+])
+
+dnl Test whether mktime works. Set gl_cv_func_working_mktime.
+AC_DEFUN([gl_FUNC_MKTIME_WORKS],
+[
+ AC_REQUIRE([gl_TIME_T_IS_SIGNED])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
+ dnl in Autoconf and because it invokes AC_LIBOBJ.
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_DECLS_ONCE([alarm])
+ AC_REQUIRE([gl_MULTIARCH])
+ AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime],
+ [if test $APPLE_UNIVERSAL_BUILD = 1; then
+ # A universal build on Apple Mac OS X platforms.
+ # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+ # But we need a configuration result that is valid in both modes.
+ gl_cv_func_working_mktime="guessing no"
+ else
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+[[/* Test program from Paul Eggert and Tony Leneis. */
+#include <limits.h>
+#include <stdlib.h>
+#include <time.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_DECL_ALARM
+# include <signal.h>
+#endif
+
+]GL_MDA_DEFINES[
+
+#ifndef TIME_T_IS_SIGNED
+# define TIME_T_IS_SIGNED 0
+#endif
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable. */
+static char *tz_strings[] = {
+ (char *) 0, "TZ=GMT0", "TZ=JST-9",
+ "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+static int
+spring_forward_gap ()
+{
+ /* glibc (up to about 1998-10-07) failed this test. */
+ struct tm tm;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0)
+ return -1;
+
+ tm.tm_year = 98;
+ tm.tm_mon = 3;
+ tm.tm_mday = 5;
+ tm.tm_hour = 2;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ return mktime (&tm) != (time_t) -1;
+}
+
+static int
+mktime_test1 (time_t now)
+{
+ struct tm *lt;
+ return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (time_t now)
+{
+ return (mktime_test1 (now)
+ && mktime_test1 ((time_t) (time_t_max - now))
+ && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+ /* Based on code from Ariel Faigon. */
+ struct tm tm;
+ tm.tm_year = 96;
+ tm.tm_mon = 3;
+ tm.tm_mday = 0;
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+ return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (int j)
+{
+ struct tm tm;
+ time_t now;
+ tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+ now = mktime (&tm);
+ if (now != (time_t) -1)
+ {
+ struct tm *lt = localtime (&now);
+ if (! (lt
+ && lt->tm_year == tm.tm_year
+ && lt->tm_mon == tm.tm_mon
+ && lt->tm_mday == tm.tm_mday
+ && lt->tm_hour == tm.tm_hour
+ && lt->tm_min == tm.tm_min
+ && lt->tm_sec == tm.tm_sec
+ && lt->tm_yday == tm.tm_yday
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+ return 0;
+ }
+ return 1;
+}
+
+static int
+year_2050_test ()
+{
+ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+ ignoring leap seconds. */
+ unsigned long int answer = 2527315200UL;
+
+ struct tm tm;
+ time_t t;
+ tm.tm_year = 2050 - 1900;
+ tm.tm_mon = 2 - 1;
+ tm.tm_mday = 1;
+ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ if (putenv ("TZ=PST8PDT,M4.1.0,M10.5.0") != 0)
+ return -1;
+
+ t = mktime (&tm);
+
+ /* Check that the result is either a failure, or close enough
+ to the correct answer that we can assume the discrepancy is
+ due to leap seconds. */
+ return (t == (time_t) -1
+ || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
+
+static int
+indiana_test ()
+{
+ if (putenv ("TZ=America/Indiana/Indianapolis") != 0)
+ return -1;
+ struct tm tm;
+ tm.tm_year = 1986 - 1900; tm.tm_mon = 4 - 1; tm.tm_mday = 28;
+ tm.tm_hour = 16; tm.tm_min = 24; tm.tm_sec = 50; tm.tm_isdst = 0;
+ time_t std = mktime (&tm);
+ if (! (std == 515107490 || std == 515107503))
+ return 1;
+
+ /* This platform supports TZDB, either without or with leap seconds.
+ Return true if GNU Bug#48085 is absent. */
+ tm.tm_isdst = 1;
+ time_t dst = mktime (&tm);
+ return std - dst == 60 * 60;
+}
+
+int
+main ()
+{
+ int result = 0;
+ time_t t, delta;
+ int i, j;
+ int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1;
+
+#if HAVE_DECL_ALARM
+ /* This test makes some buggy mktime implementations loop.
+ Give up after 60 seconds; a mktime slower than that
+ isn't worth using anyway. */
+ signal (SIGALRM, SIG_DFL);
+ alarm (60);
+#endif
+
+ time_t_max = (! TIME_T_IS_SIGNED
+ ? (time_t) -1
+ : ((((time_t) 1 << (sizeof (time_t) * CHAR_BIT - 2)) - 1)
+ * 2 + 1));
+ time_t_min = (! TIME_T_IS_SIGNED
+ ? (time_t) 0
+ : time_t_signed_magnitude
+ ? ~ (time_t) 0
+ : ~ time_t_max);
+
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+ if (tz_strings[i])
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta && (result & 1) == 0; t += delta)
+ if (! mktime_test (t))
+ result |= 1;
+ if ((result & 2) == 0
+ && ! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ result |= 2;
+
+ for (j = 1; (result & 4) == 0; j <<= 1)
+ {
+ if (! bigtime_test (j))
+ result |= 4;
+ if (INT_MAX / 2 < j)
+ break;
+ }
+ if ((result & 8) == 0 && ! bigtime_test (INT_MAX))
+ result |= 8;
+ }
+ if (! irix_6_4_bug ())
+ result |= 16;
+ if (! spring_forward_gap ())
+ result |= 32;
+ if (! year_2050_test () || ! indiana_test ())
+ result |= 64;
+ return result;
+}]])],
+ [gl_cv_func_working_mktime=yes],
+ [gl_cv_func_working_mktime=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_mktime="guessing no" ;;
+ *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ fi
+ ])
+])
+
+dnl Main macro of module 'mktime'.
+AC_DEFUN([gl_FUNC_MKTIME],
+[
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
+
+ REPLACE_MKTIME=0
+ if test "$gl_cv_func_working_mktime" != yes; then
+ REPLACE_MKTIME=1
+ AC_DEFINE([NEED_MKTIME_WORKING], [1],
+ [Define if the compilation of mktime.c should define 'mktime'
+ with the algorithmic workarounds.])
+ fi
+ case "$host_os" in
+ mingw*)
+ REPLACE_MKTIME=1
+ AC_DEFINE([NEED_MKTIME_WINDOWS], [1],
+ [Define if the compilation of mktime.c should define 'mktime'
+ with the native Windows TZ workaround.])
+ ;;
+ esac
+])
+
+dnl Main macro of module 'mktime-internal'.
+AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
+
+ WANT_MKTIME_INTERNAL=0
+ dnl BeOS has __mktime_internal in libc, but other platforms don't.
+ AC_CHECK_FUNC([__mktime_internal],
+ [AC_DEFINE([mktime_internal], [__mktime_internal],
+ [Define to the real name of the mktime_internal function.])
+ ],
+ [dnl mktime works but it doesn't export __mktime_internal,
+ dnl so we need to substitute our own mktime implementation.
+ WANT_MKTIME_INTERNAL=1
+ AC_DEFINE([NEED_MKTIME_INTERNAL], [1],
+ [Define if the compilation of mktime.c should define 'mktime_internal'.])
+ ])
+])
+
+# Prerequisites of lib/mktime.c.
+AC_DEFUN([gl_PREREQ_MKTIME], [:])
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
new file mode 100644
index 0000000..d07d26e
--- /dev/null
+++ b/gl/m4/mmap-anon.m4
@@ -0,0 +1,55 @@
+# mmap-anon.m4 serial 12
+dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Detect how mmap can be used to create anonymous (not file-backed) memory
+# mappings.
+# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
+# and MAP_ANON exist and have the same value.
+# - On HP-UX, only MAP_ANONYMOUS exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists.
+# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
+# used.
+
+AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON],
+[
+ dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
+ # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
+ # irrelevant for anonymous mappings.
+ AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no])
+
+ # Try to allow MAP_ANONYMOUS.
+ gl_have_mmap_anonymous=no
+ if test $gl_have_mmap = yes; then
+ AC_MSG_CHECKING([for MAP_ANONYMOUS])
+ AC_EGREP_CPP([I cannot identify this map], [
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+ I cannot identify this map
+#endif
+],
+ [gl_have_mmap_anonymous=yes])
+ if test $gl_have_mmap_anonymous != yes; then
+ AC_EGREP_CPP([I cannot identify this map], [
+#include <sys/mman.h>
+#ifdef MAP_ANON
+ I cannot identify this map
+#endif
+],
+ [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
+ [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.])
+ gl_have_mmap_anonymous=yes])
+ fi
+ AC_MSG_RESULT([$gl_have_mmap_anonymous])
+ if test $gl_have_mmap_anonymous = yes; then
+ AC_DEFINE([HAVE_MAP_ANONYMOUS], [1],
+ [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
+ config.h and <sys/mman.h>.])
+ fi
+ fi
+])
diff --git a/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4
new file mode 100644
index 0000000..82197c0
--- /dev/null
+++ b/gl/m4/mode_t.m4
@@ -0,0 +1,26 @@
+# mode_t.m4 serial 2
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# For using mode_t, it's sufficient to use AC_TYPE_MODE_T and
+# include <sys/types.h>.
+
+# Define PROMOTED_MODE_T to the type that is the result of "default argument
+# promotion" (ISO C 6.5.2.2.(6)) of the type mode_t.
+AC_DEFUN([gl_PROMOTED_TYPE_MODE_T],
+[
+ AC_REQUIRE([AC_TYPE_MODE_T])
+ AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [
+ dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int',
+ dnl and to itself otherwise. This assumption is not guaranteed by the ISO C
+ dnl standard, but we don't know of any real-world counterexamples.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
+ [[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])],
+ [gl_cv_promoted_mode_t='int'],
+ [gl_cv_promoted_mode_t='mode_t'])
+ ])
+ AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t],
+ [Define to the type that is the result of default argument promotions of type mode_t.])
+])
diff --git a/gl/m4/mountlist.m4 b/gl/m4/mountlist.m4
new file mode 100644
index 0000000..a9b4edb
--- /dev/null
+++ b/gl/m4/mountlist.m4
@@ -0,0 +1,338 @@
+# serial 15
+dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+
+AC_PREREQ([2.60])
+
+AC_DEFUN([gl_MOUNTLIST],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS([listmntent])
+ AC_CHECK_HEADERS_ONCE([sys/param.h sys/statvfs.h])
+
+ # We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses
+ # NGROUPS (as the array dimension for a struct member) without a definition.
+ AC_CHECK_HEADERS([sys/ucred.h], [], [], [#include <grp.h>])
+
+ AC_CHECK_HEADERS([sys/mount.h], [], [],
+ [AC_INCLUDES_DEFAULT
+ [#if HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+ ]])
+
+ AC_CHECK_HEADERS([mntent.h sys/fs_types.h])
+ getfsstat_includes="\
+$ac_includes_default
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
+#endif
+#if HAVE_SYS_UCRED_H
+# include <grp.h> /* needed for definition of NGROUPS */
+# include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
+#endif
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_FS_TYPES_H
+# include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
+#endif
+"
+ AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
+
+ # Determine how to get the list of mounted file systems.
+ ac_list_mounted_fs=
+
+ # If the getmntent function is available but not in the standard library,
+ # make sure LIBS contains the appropriate -l option.
+ AC_FUNC_GETMNTENT
+
+ if test -z "$ac_list_mounted_fs"; then
+ # AIX.
+ AC_CACHE_CHECK([for mntctl function and struct vmount],
+ [fu_cv_sys_mounted_vmount],
+ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <fshelp.h>]])],
+ [fu_cv_sys_mounted_vmount=yes],
+ [fu_cv_sys_mounted_vmount=no])])
+ if test $fu_cv_sys_mounted_vmount = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_VMOUNT], [1],
+ [Define if there is a function named mntctl that can be used to read
+ the list of mounted file systems, and there is a system header file
+ that declares 'struct vmount'. (AIX)])
+ fi
+ fi
+
+ if test $ac_cv_func_getmntent = yes; then
+
+ # This system has the getmntent function.
+ # Determine whether it's the one-argument variant or the two-argument one.
+
+ if test -z "$ac_list_mounted_fs"; then
+ # glibc, HP-UX, IRIX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS.
+ AC_CACHE_CHECK([for one-argument getmntent function],
+ [fu_cv_sys_mounted_getmntent1],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+/* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
+#include <stdio.h>
+
+#include <mntent.h>
+#if defined __ANDROID__ /* Android */
+# undef MOUNTED
+# define MOUNTED "/proc/mounts"
+#elif !defined MOUNTED
+# if defined _PATH_MOUNTED /* GNU libc */
+# define MOUNTED _PATH_MOUNTED
+# endif
+# if defined MNT_MNTTAB /* HP-UX. */
+# define MOUNTED MNT_MNTTAB
+# endif
+#endif
+]],
+ [[struct mntent *mnt = 0; char *table = MOUNTED;
+ if (sizeof mnt && sizeof table) return 0;
+ ]])],
+ [fu_cv_sys_mounted_getmntent1=yes],
+ [fu_cv_sys_mounted_getmntent1=no])
+ ])
+ if test $fu_cv_sys_mounted_getmntent1 = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_GETMNTENT1], [1],
+ [Define if there is a function named getmntent for reading the list
+ of mounted file systems, and that function takes a single argument.
+ (4.3BSD, SunOS, HP-UX, Irix)])
+ AC_CHECK_FUNCS([setmntent endmntent hasmntopt])
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Solaris >= 8.
+ AC_CACHE_CHECK([for getextmntent function],
+ [fu_cv_sys_mounted_getextmntent],
+ [AC_EGREP_HEADER([getextmntent], [sys/mnttab.h],
+ [fu_cv_sys_mounted_getextmntent=yes],
+ [fu_cv_sys_mounted_getextmntent=no])])
+ if test $fu_cv_sys_mounted_getextmntent = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_GETEXTMNTENT], [1],
+ [Define if there is a function named getextmntent for reading the list
+ of mounted file systems. (Solaris)])
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Solaris < 8, also (obsolete) SVR4.
+ # Solaris >= 8 has the two-argument getmntent but is already handled above.
+ AC_CACHE_CHECK([for two-argument getmntent function],
+ [fu_cv_sys_mounted_getmntent2],
+ [AC_EGREP_HEADER([getmntent], [sys/mnttab.h],
+ [fu_cv_sys_mounted_getmntent2=yes],
+ [fu_cv_sys_mounted_getmntent2=no])
+ ])
+ if test $fu_cv_sys_mounted_getmntent2 = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_GETMNTENT2], [1],
+ [Define if there is a function named getmntent for reading the list of
+ mounted file systems, and that function takes two arguments. (SVR4)])
+ AC_CHECK_FUNCS([hasmntopt])
+ fi
+ fi
+
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # OSF/1, also (obsolete) Apple Darwin 1.3.
+ # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
+
+ AC_CACHE_CHECK([for getfsstat function],
+ [fu_cv_sys_mounted_getfsstat],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
+# define FS_TYPE(Ent) ((Ent).f_fstypename)
+#else
+# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
+#endif
+$getfsstat_includes
+ ]],
+ [[struct statfs *stats;
+ int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
+ char *t = FS_TYPE (*stats);
+ ]])],
+ [fu_cv_sys_mounted_getfsstat=yes],
+ [fu_cv_sys_mounted_getfsstat=no])
+ ])
+ if test $fu_cv_sys_mounted_getfsstat = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_GETFSSTAT], [1],
+ [Define if there is a function named getfsstat for reading the
+ list of mounted file systems. (DEC Alpha running OSF/1)])
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # (obsolete) SVR3
+ AC_CACHE_CHECK([for FIXME existence of three headers],
+ [fu_cv_sys_mounted_fread_fstyp],
+ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+#include <sys/statfs.h>
+#include <sys/fstyp.h>
+#include <mnttab.h>
+]])],
+ [fu_cv_sys_mounted_fread_fstyp=yes],
+ [fu_cv_sys_mounted_fread_fstyp=no])
+ ])
+ if test $fu_cv_sys_mounted_fread_fstyp = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_FREAD_FSTYP], [1],
+ [Define if (like SVR2) there is no specific function for reading the
+ list of mounted file systems, and your system has these header files:
+ <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, also (obsolete) 4.4BSD.
+ # OSF/1 also has getmntinfo but is already handled above.
+ # We cannot use AC_CHECK_FUNCS([getmntinfo]) here, because at the linker
+ # level the function is sometimes called getmntinfo64 or getmntinfo$INODE64
+ # on Mac OS X, __getmntinfo13 on NetBSD and Minix, _F64_getmntinfo on OSF/1.
+ AC_CACHE_CHECK([for getmntinfo function],
+ [fu_cv_sys_mounted_getmntinfo],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+#include <stdlib.h>
+ ]],
+ [[int count = getmntinfo (NULL, MNT_WAIT);
+ ]])],
+ [fu_cv_sys_mounted_getmntinfo=yes],
+ [fu_cv_sys_mounted_getmntinfo=no])
+ ])
+ if test $fu_cv_sys_mounted_getmntinfo = yes; then
+ AC_CACHE_CHECK([whether getmntinfo returns statvfs structures],
+ [fu_cv_sys_mounted_getmntinfo2],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int getmntinfo (struct statfs **, int);
+ ]], [[]])],
+ [fu_cv_sys_mounted_getmntinfo2=no],
+ [fu_cv_sys_mounted_getmntinfo2=yes])
+ ])
+ if test $fu_cv_sys_mounted_getmntinfo2 = no; then
+ # Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD.
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_GETMNTINFO], [1],
+ [Define if there is a function named getmntinfo for reading the
+ list of mounted file systems and it returns an array of
+ 'struct statfs'. (4.4BSD, Darwin)])
+ else
+ # NetBSD, Minix.
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_GETMNTINFO2], [1],
+ [Define if there is a function named getmntinfo for reading the
+ list of mounted file systems and it returns an array of
+ 'struct statvfs'. (NetBSD 3.0)])
+ fi
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Haiku, also (obsolete) BeOS.
+ AC_CHECK_FUNCS([next_dev fs_stat_dev])
+ AC_CHECK_HEADERS([fs_info.h])
+ AC_CACHE_CHECK([for BEOS mounted file system support functions],
+ [fu_cv_sys_mounted_fs_stat_dev],
+ [if test $ac_cv_header_fs_info_h = yes \
+ && test $ac_cv_func_next_dev = yes \
+ && test $ac_cv_func_fs_stat_dev = yes; then
+ fu_cv_sys_mounted_fs_stat_dev=yes
+ else
+ fu_cv_sys_mounted_fs_stat_dev=no
+ fi
+ ])
+ if test $fu_cv_sys_mounted_fs_stat_dev = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_FS_STAT_DEV], [1],
+ [Define if there are functions named next_dev and fs_stat_dev for
+ reading the list of mounted file systems. (BeOS)])
+ fi
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ # Interix / BSD alike statvfs
+ # the code is really interix specific, so make sure, we're on it.
+ case "$host" in
+ *-interix*)
+ AC_CHECK_FUNCS([statvfs])
+ if test $ac_cv_func_statvfs = yes; then
+ ac_list_mounted_fs=found
+ AC_DEFINE([MOUNTED_INTERIX_STATVFS], [1],
+ [Define if we are on interix, and ought to use statvfs plus
+ some special knowledge on where mounted file systems can be
+ found. (Interix)])
+ fi
+ ;;
+ esac
+ fi
+
+ if test -z "$ac_list_mounted_fs"; then
+ AC_MSG_ERROR([could not determine how to read list of mounted file systems])
+ # FIXME -- no need to abort building the whole package
+ # Can't build mountlist.c or anything that needs its functions
+ fi
+
+ if test $ac_list_mounted_fs = found; then
+ gl_cv_list_mounted_fs=yes
+ else
+ gl_cv_list_mounted_fs=no
+ fi
+])
+
+# Prerequisites of lib/mountlist.c not done by gl_MOUNTLIST.
+AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA],
+[
+ dnl Note gl_MOUNTLIST checks for mntent.h, not sys/mntent.h.
+ AC_CHECK_HEADERS([sys/mntent.h])
+ AC_HEADER_MAJOR()dnl for use of makedev ()
+ gl_FSTYPENAME
+])
+
+# Replace Autoconf's AC_FUNC_GETMNTENT to omit checks that are unnecessary
+# nowadays.
+AC_DEFUN([AC_FUNC_GETMNTENT],
+[
+ # getmntent is in the standard C library on most systems, but in -lgen on
+ # Unixware.
+ AC_SEARCH_LIBS([getmntent], [gen])
+ AC_CHECK_FUNCS([getmntent])
+])
diff --git a/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4
new file mode 100644
index 0000000..8d9d21b
--- /dev/null
+++ b/gl/m4/msvc-inval.m4
@@ -0,0 +1,19 @@
+# msvc-inval.m4 serial 1
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_MSVC_INVAL],
+[
+ AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler])
+ if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
+ AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1],
+ [Define to 1 on MSVC platforms that have the "invalid parameter handler"
+ concept.])
+ else
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+ fi
+ AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER])
+])
diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4
new file mode 100644
index 0000000..0263e49
--- /dev/null
+++ b/gl/m4/msvc-nothrow.m4
@@ -0,0 +1,10 @@
+# msvc-nothrow.m4 serial 1
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_MSVC_NOTHROW],
+[
+ AC_REQUIRE([gl_MSVC_INVAL])
+])
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
new file mode 100644
index 0000000..3ba5b0f
--- /dev/null
+++ b/gl/m4/multiarch.m4
@@ -0,0 +1,65 @@
+# multiarch.m4 serial 9
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Determine whether the compiler is or may be producing universal binaries.
+#
+# On Mac OS X 10.5 and later systems, the user can create libraries and
+# executables that work on multiple system types--known as "fat" or
+# "universal" binaries--by specifying multiple '-arch' options to the
+# compiler but only a single '-arch' option to the preprocessor. Like
+# this:
+#
+# ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+# CPP="gcc -E" CXXCPP="g++ -E"
+#
+# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
+
+AC_DEFUN_ONCE([gl_MULTIARCH],
+[
+ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
+ AC_CACHE_CHECK([whether the compiler produces multi-arch binaries],
+ [gl_cv_c_multiarch],
+ [gl_cv_c_multiarch=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+ ]])],
+ [
+ dnl Check for potential -arch flags. It is not universal unless
+ dnl there are at least two -arch flags with different values.
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64 | arm | arm64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+ ])
+ ])
+ if test $gl_cv_c_multiarch = yes; then
+ APPLE_UNIVERSAL_BUILD=1
+ else
+ APPLE_UNIVERSAL_BUILD=0
+ fi
+ AC_SUBST([APPLE_UNIVERSAL_BUILD])
+])
diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4
new file mode 100644
index 0000000..e6aa892
--- /dev/null
+++ b/gl/m4/netdb_h.m4
@@ -0,0 +1,59 @@
+# netdb_h.m4 serial 15
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_NETDB_H],
+[
+ AC_REQUIRE([gl_NETDB_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([netdb.h])
+ if test $ac_cv_header_netdb_h = yes; then
+ HAVE_NETDB_H=1
+ else
+ HAVE_NETDB_H=0
+ fi
+ AC_SUBST([HAVE_NETDB_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <netdb.h>]],
+ [getaddrinfo freeaddrinfo gai_strerror getnameinfo])
+])
+
+# gl_NETDB_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_NETDB_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_NETDB_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_NETDB_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETADDRINFO])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_NETDB_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_NETDB_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_NETDB_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_STRUCT_ADDRINFO=1; AC_SUBST([HAVE_STRUCT_ADDRINFO])
+ HAVE_DECL_FREEADDRINFO=1; AC_SUBST([HAVE_DECL_FREEADDRINFO])
+ HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR])
+ HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO])
+ HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO])
+ REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR])
+ REPLACE_GETADDRINFO=0; AC_SUBST([REPLACE_GETADDRINFO])
+])
diff --git a/gl/m4/netinet_in_h.m4 b/gl/m4/netinet_in_h.m4
new file mode 100644
index 0000000..7115419
--- /dev/null
+++ b/gl/m4/netinet_in_h.m4
@@ -0,0 +1,29 @@
+# netinet_in_h.m4 serial 6
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_HEADER_NETINET_IN],
+[
+ AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
+ [gl_cv_header_netinet_in_h_selfcontained],
+ [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
+ [gl_cv_header_netinet_in_h_selfcontained=yes],
+ [gl_cv_header_netinet_in_h_selfcontained=no])
+ ])
+ if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
+ GL_GENERATE_NETINET_IN_H=false
+ else
+ GL_GENERATE_NETINET_IN_H=true
+ AC_CHECK_HEADERS([netinet/in.h])
+ gl_CHECK_NEXT_HEADERS([netinet/in.h])
+ if test $ac_cv_header_netinet_in_h = yes; then
+ HAVE_NETINET_IN_H=1
+ else
+ HAVE_NETINET_IN_H=0
+ fi
+ AC_SUBST([HAVE_NETINET_IN_H])
+ fi
+])
diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
new file mode 100644
index 0000000..51e783c
--- /dev/null
+++ b/gl/m4/nl_langinfo.m4
@@ -0,0 +1,77 @@
+# nl_langinfo.m4 serial 8
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_NL_LANGINFO],
+[
+ AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+ AC_REQUIRE([gl_LANGINFO_H])
+ AC_CHECK_FUNCS_ONCE([nl_langinfo])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ if test $ac_cv_func_nl_langinfo = yes; then
+ # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
+ AC_CACHE_CHECK([whether YESEXPR works],
+ [gl_cv_func_nl_langinfo_yesexpr_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+]], [[return !*nl_langinfo(YESEXPR);
+]])],
+ [gl_cv_func_nl_langinfo_yesexpr_works=yes],
+ [gl_cv_func_nl_langinfo_yesexpr_works=no],
+ [
+ case "$host_os" in
+ # Guess no on irix systems.
+ irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
+ # Guess yes elsewhere.
+ *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
+ esac
+ ])
+ ])
+ case $gl_cv_func_nl_langinfo_yesexpr_works in
+ *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
+ *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
+ [$FUNC_NL_LANGINFO_YESEXPR_WORKS],
+ [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
+ # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
+ case "$host_os" in
+ solaris*) NL_LANGINFO_MTSAFE=0 ;;
+ *) NL_LANGINFO_MTSAFE=1 ;;
+ esac
+ AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
+ [Define to 1 if nl_langinfo is multithread-safe.])
+ if test $HAVE_LANGINFO_CODESET = 1 \
+ && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
+ && test $HAVE_LANGINFO_ALTMON = 1 \
+ && test $HAVE_LANGINFO_ERA = 1 \
+ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
+ && test $NL_LANGINFO_MTSAFE = 1; then
+ :
+ else
+ REPLACE_NL_LANGINFO=1
+ AC_DEFINE([REPLACE_NL_LANGINFO], [1],
+ [Define if nl_langinfo exists but is overridden by gnulib.])
+ fi
+ else
+ HAVE_NL_LANGINFO=0
+ fi
+ if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
+ LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
+ else
+ LIB_NL_LANGINFO=
+ fi
+ dnl LIB_NL_LANGINFO is expected to be empty everywhere.
+ AC_SUBST([LIB_NL_LANGINFO])
+])
+
+# Prerequisites of lib/nl_langinfo-lock.c.
+AC_DEFUN([gl_PREREQ_NL_LANGINFO_LOCK],
+[
+ gl_VISIBILITY
+])
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
new file mode 100644
index 0000000..6a76638
--- /dev/null
+++ b/gl/m4/nocrash.m4
@@ -0,0 +1,131 @@
+# nocrash.m4 serial 5
+dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
+
+AC_PREREQ([2.13])
+
+dnl Expands to some code for use in .c programs that will cause the configure
+dnl test to exit instead of crashing. This is useful to avoid triggering
+dnl action from a background debugger and to avoid core dumps.
+dnl Usage: ...
+dnl ]GL_NOCRASH[
+dnl ...
+dnl int main() { nocrash_init(); ... }
+AC_DEFUN([GL_NOCRASH],[[
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on Mac OS X. */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens. */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+ EXC_BAD_ACCESS. */
+static void *
+mach_exception_thread (void *arg)
+{
+ /* Buffer for a message to be received. */
+ struct {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+ } msg;
+ mach_msg_return_t retval;
+ /* Wait for a message on the exception port. */
+ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+ our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ if (retval != MACH_MSG_SUCCESS)
+ abort ();
+ exit (1);
+}
+static void
+nocrash_init (void)
+{
+ mach_port_t self = mach_task_self ();
+ /* Allocate a port on which the thread shall listen for exceptions. */
+ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+ == KERN_SUCCESS) {
+ /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
+ if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+ MACH_MSG_TYPE_MAKE_SEND)
+ == KERN_SUCCESS) {
+ /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
+ for us. */
+ exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+ /* Create the thread listening on the exception port. */
+ pthread_attr_t attr;
+ pthread_t thread;
+ if (pthread_attr_init (&attr) == 0
+ && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+ && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+ pthread_attr_destroy (&attr);
+ /* Replace the exception port info for these exceptions with our own.
+ Note that we replace the exception port for the entire task, not only
+ for a particular thread. This has the effect that when our exception
+ port gets the message, the thread specific exception port has already
+ been asked, and we don't need to bother about it.
+ See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
+ task_set_exception_ports (self, mask, our_exception_port,
+ EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+ }
+ }
+ }
+}
+#elif defined _WIN32 && ! defined __CYGWIN__
+/* Avoid a crash on native Windows. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+ switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+ {
+ case EXCEPTION_ACCESS_VIOLATION:
+ case EXCEPTION_IN_PAGE_ERROR:
+ case EXCEPTION_STACK_OVERFLOW:
+ case EXCEPTION_GUARD_PAGE:
+ case EXCEPTION_PRIV_INSTRUCTION:
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ exit (1);
+ }
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+ SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems. */
+#include <signal.h>
+#include <unistd.h>
+/* A POSIX signal handler. */
+static void
+exception_handler (int sig)
+{
+ _exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+ signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+ signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
+]])
diff --git a/gl/m4/off_t.m4 b/gl/m4/off_t.m4
new file mode 100644
index 0000000..880f347
--- /dev/null
+++ b/gl/m4/off_t.m4
@@ -0,0 +1,18 @@
+# off_t.m4 serial 1
+dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check whether to override the 'off_t' type.
+dnl Set WINDOWS_64_BIT_OFF_T.
+
+AC_DEFUN([gl_TYPE_OFF_T],
+[
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([gl_LARGEFILE])
+ ], [
+ WINDOWS_64_BIT_OFF_T=0
+ ])
+ AC_SUBST([WINDOWS_64_BIT_OFF_T])
+])
diff --git a/gl/m4/open-cloexec.m4 b/gl/m4/open-cloexec.m4
new file mode 100644
index 0000000..fd572fc
--- /dev/null
+++ b/gl/m4/open-cloexec.m4
@@ -0,0 +1,21 @@
+# Test whether O_CLOEXEC is defined.
+
+dnl Copyright 2017-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PREPROC_O_CLOEXEC],
+[
+ AC_CACHE_CHECK([for O_CLOEXEC],
+ [gl_cv_macro_O_CLOEXEC],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <fcntl.h>
+ #ifndef O_CLOEXEC
+ choke me;
+ #endif
+ ]],
+ [[return O_CLOEXEC;]])],
+ [gl_cv_macro_O_CLOEXEC=yes],
+ [gl_cv_macro_O_CLOEXEC=no])])
+])
diff --git a/gl/m4/open-slash.m4 b/gl/m4/open-slash.m4
new file mode 100644
index 0000000..1f731f8
--- /dev/null
+++ b/gl/m4/open-slash.m4
@@ -0,0 +1,60 @@
+# open-slash.m4 serial 2
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Tests whether open() and creat() recognize a trailing slash.
+dnl Sets gl_cv_func_open_slash.
+AC_DEFUN([gl_OPEN_TRAILING_SLASH_BUG],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl open("foo/") should not create a file when the file name has a
+ dnl trailing slash. FreeBSD only has the problem on symlinks.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ AC_CACHE_CHECK([whether open recognizes a trailing slash],
+ [gl_cv_func_open_slash],
+ [# Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ touch conftest.tmp
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+]GL_MDA_DEFINES[
+int main ()
+{
+ int result = 0;
+#if HAVE_LSTAT
+ if (open ("conftest.lnk/", O_RDONLY) != -1)
+ result |= 1;
+#endif
+ if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+ result |= 2;
+ return result;
+}]])],
+ [gl_cv_func_open_slash=yes],
+ [gl_cv_func_open_slash=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+ gl_cv_func_open_slash="guessing no" ;;
+ *)
+ gl_cv_func_open_slash="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ rm -f conftest.sl conftest.tmp conftest.lnk
+ ])
+ case "$gl_cv_func_open_slash" in
+ *no)
+ AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
+ [Define to 1 if open() fails to recognize a trailing slash.])
+ ;;
+ esac
+])
diff --git a/gl/m4/open.m4 b/gl/m4/open.m4
new file mode 100644
index 0000000..94fa2bb
--- /dev/null
+++ b/gl/m4/open.m4
@@ -0,0 +1,56 @@
+# open.m4 serial 15
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_OPEN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
+ case "$host_os" in
+ mingw* | pw*)
+ REPLACE_OPEN=1
+ ;;
+ *)
+ dnl open("foo/") should not create a file when the file name has a
+ dnl trailing slash. FreeBSD only has the problem on symlinks.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ if test "$gl_cv_macro_O_CLOEXEC" != yes; then
+ REPLACE_OPEN=1
+ fi
+ gl_OPEN_TRAILING_SLASH_BUG
+ case "$gl_cv_func_open_slash" in
+ *no)
+ REPLACE_OPEN=1
+ ;;
+ esac
+ ;;
+ esac
+ dnl Replace open() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ if test $REPLACE_OPEN = 0; then
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_OPEN=1
+ fi
+ fi
+ ])
+ dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ if test $REPLACE_OPEN = 0; then
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_open_O_NONBLOCK != yes; then
+ REPLACE_OPEN=1
+ fi
+ fi
+ ])
+])
+
+# Prerequisites of lib/open.c.
+AC_DEFUN([gl_PREREQ_OPEN],
+[
+ AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
+ :
+])
diff --git a/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4
new file mode 100644
index 0000000..6d47d2c
--- /dev/null
+++ b/gl/m4/pathmax.m4
@@ -0,0 +1,42 @@
+# pathmax.m4 serial 11
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PATHMAX],
+[
+ dnl Prerequisites of lib/pathmax.h.
+ AC_CHECK_HEADERS_ONCE([sys/param.h])
+])
+
+# Expands to a piece of C program that defines PATH_MAX in the same way as
+# "pathmax.h" will do.
+AC_DEFUN([gl_PATHMAX_SNIPPET], [[
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+]])
+
+# Prerequisites of gl_PATHMAX_SNIPPET.
+AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
+[
+ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
+])
diff --git a/gl/m4/pid_t.m4 b/gl/m4/pid_t.m4
new file mode 100644
index 0000000..0fd7d0a
--- /dev/null
+++ b/gl/m4/pid_t.m4
@@ -0,0 +1,38 @@
+# pid_t.m4 serial 4
+dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# The following implementation works around a problem in autoconf <= 2.69.
+m4_version_prereq([2.70], [], [
+
+dnl Define pid_t if the headers don't define it.
+AC_DEFUN([AC_TYPE_PID_T],
+[
+ AC_CHECK_TYPE([pid_t],
+ [],
+ [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t'
+ dnl (= 'long long' = '__int64'), because that is the return type
+ dnl of the _spawnv* functions
+ dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnvp-wspawnvp>
+ dnl and the argument type of the _cwait function
+ dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/cwait>.
+ dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it
+ dnl to 'int'.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #if defined _WIN64 && !defined __CYGWIN__
+ LLP64
+ #endif
+ ]])
+ ],
+ [gl_pid_type='int'],
+ [gl_pid_type='__int64'])
+ AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type],
+ [Define as a signed integer type capable of holding a process identifier.])
+ ],
+ [AC_INCLUDES_DEFAULT])
+])
+
+])# m4_version_prereq 2.70
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
new file mode 100644
index 0000000..4e65abc
--- /dev/null
+++ b/gl/m4/printf.m4
@@ -0,0 +1,1728 @@
+# printf.m4 serial 73
+dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test whether the *printf family of functions supports the 'j', 'z', 't',
+dnl 'L' size specifiers. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_sizes_c99.
+
+AC_DEFUN([gl_PRINTF_SIZES_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
+ [gl_cv_func_printf_sizes_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
+#endif
+static char buf[100];
+int main ()
+{
+ int result = 0;
+#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
+ buf[0] = '\0';
+ if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
+ || strcmp (buf, "12345671 33") != 0)
+ result |= 1;
+#else
+ result |= 1;
+#endif
+ buf[0] = '\0';
+ if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
+ || strcmp (buf, "12345672 33") != 0)
+ result |= 2;
+ buf[0] = '\0';
+ if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
+ || strcmp (buf, "12345673 33") != 0)
+ result |= 4;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
+ || strcmp (buf, "1.5 33") != 0)
+ result |= 8;
+ return result;
+}]])],
+ [gl_cv_func_printf_sizes_c99=yes],
+ [gl_cv_func_printf_sizes_c99=no],
+ [
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
+ darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_printf_sizes_c99="guessing no";;
+ openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_printf_sizes_c99="guessing no";;
+ netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_sizes_c99="guessing yes"],
+ [gl_cv_func_printf_sizes_c99="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports 'long double'
+dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_long_double.
+
+AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports 'long double' arguments],
+ [gl_cv_func_printf_long_double],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[10000];
+int main ()
+{
+ int result = 0;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
+ || strcmp (buf, "1.750000 33") != 0)
+ result |= 1;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
+ || strcmp (buf, "1.750000e+00 33") != 0)
+ result |= 2;
+ buf[0] = '\0';
+ if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
+ || strcmp (buf, "1.75 33") != 0)
+ result |= 4;
+ return result;
+}]])],
+ [gl_cv_func_printf_long_double=yes],
+ [gl_cv_func_printf_long_double=no],
+ [case "$host_os" in
+ # Guess no on BeOS.
+ beos*) gl_cv_func_printf_long_double="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_long_double="guessing yes"],
+ [gl_cv_func_printf_long_double="guessing no"])
+ ;;
+ *) gl_cv_func_printf_long_double="guessing yes";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports infinite and NaN
+dnl 'double' arguments and negative zero arguments in the %f, %e, %g
+dnl directives. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_infinite.
+
+AC_DEFUN([gl_PRINTF_INFINITE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
+ [gl_cv_func_printf_infinite],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static int
+strisnan (const char *string, size_t start_index, size_t end_index)
+{
+ if (start_index < end_index)
+ {
+ if (string[start_index] == '-')
+ start_index++;
+ if (start_index + 3 <= end_index
+ && memcmp (string + start_index, "nan", 3) == 0)
+ {
+ start_index += 3;
+ if (start_index == end_index
+ || (string[start_index] == '(' && string[end_index - 1] == ')'))
+ return 1;
+ }
+ }
+ return 0;
+}
+static int
+have_minus_zero ()
+{
+ static double plus_zero = 0.0;
+ double minus_zero = - plus_zero;
+ return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
+}
+static char buf[10000];
+static double zero = 0.0;
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%f", 1.0 / zero) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%f", -1.0 / zero) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%f", zero / zero) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%e", 1.0 / zero) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 4;
+ if (sprintf (buf, "%e", -1.0 / zero) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 4;
+ if (sprintf (buf, "%e", zero / zero) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 8;
+ if (sprintf (buf, "%g", 1.0 / zero) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 16;
+ if (sprintf (buf, "%g", -1.0 / zero) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 16;
+ if (sprintf (buf, "%g", zero / zero) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 32;
+ /* This test fails on HP-UX 10.20. */
+ if (have_minus_zero ())
+ if (sprintf (buf, "%g", - zero) < 0
+ || strcmp (buf, "-0") != 0)
+ result |= 64;
+ return result;
+}]])],
+ [gl_cv_func_printf_infinite=yes],
+ [gl_cv_func_printf_infinite=no],
+ [
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on FreeBSD >= 6.
+ freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
+ darwin*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
+ hpux*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_printf_infinite="guessing no";;
+ netbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
+ openbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_infinite="guessing no";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_infinite="guessing yes"],
+ [gl_cv_func_printf_infinite="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports infinite and NaN
+dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_infinite_long_double.
+
+AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_BIGENDIAN])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl The user can set or unset the variable gl_printf_safe to indicate
+ dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
+ if test -n "$gl_printf_safe"; then
+ AC_DEFINE([CHECK_PRINTF_SAFE], [1],
+ [Define if you wish *printf() functions that have a safe handling of
+ non-IEEE-754 'long double' values.])
+ fi
+ case "$gl_cv_func_printf_long_double" in
+ *yes)
+ AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
+ [gl_cv_func_printf_infinite_long_double],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+]GL_NOCRASH[
+#include <float.h>
+#include <stdio.h>
+#include <string.h>
+static int
+strisnan (const char *string, size_t start_index, size_t end_index)
+{
+ if (start_index < end_index)
+ {
+ if (string[start_index] == '-')
+ start_index++;
+ if (start_index + 3 <= end_index
+ && memcmp (string + start_index, "nan", 3) == 0)
+ {
+ start_index += 3;
+ if (start_index == end_index
+ || (string[start_index] == '(' && string[end_index - 1] == ')'))
+ return 1;
+ }
+ }
+ return 0;
+}
+static char buf[10000];
+static long double zeroL = 0.0L;
+int main ()
+{
+ int result = 0;
+ nocrash_init();
+ if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 1;
+ if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Le", zeroL / zeroL) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 1;
+ if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
+ || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
+ || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+ result |= 1;
+ if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 1;
+#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+/* Representation of an 80-bit 'long double' as an initializer for a sequence
+ of 'unsigned int' words. */
+# ifdef WORDS_BIGENDIAN
+# define LDBL80_WORDS(exponent,manthi,mantlo) \
+ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
+ ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
+ (unsigned int) (mantlo) << 16 \
+ }
+# else
+# define LDBL80_WORDS(exponent,manthi,mantlo) \
+ { mantlo, manthi, exponent }
+# endif
+ { /* Quiet NaN. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Le", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Lg", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ }
+ {
+ /* Signalling NaN. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Le", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ if (sprintf (buf, "%Lg", x.value) < 0
+ || !strisnan (buf, 0, strlen (buf)))
+ result |= 2;
+ }
+ { /* Pseudo-NaN. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 4;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 4;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 4;
+ }
+ { /* Pseudo-Infinity. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 8;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 8;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 8;
+ }
+ { /* Pseudo-Zero. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 16;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 16;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 16;
+ }
+ { /* Unnormalized number. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 32;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 32;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 32;
+ }
+ { /* Pseudo-Denormal. */
+ static union { unsigned int word[4]; long double value; } x =
+ { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
+ if (sprintf (buf, "%Lf", x.value) <= 0)
+ result |= 64;
+ if (sprintf (buf, "%Le", x.value) <= 0)
+ result |= 64;
+ if (sprintf (buf, "%Lg", x.value) <= 0)
+ result |= 64;
+ }
+#endif
+ return result;
+}]])],
+ [gl_cv_func_printf_infinite_long_double=yes],
+ [gl_cv_func_printf_infinite_long_double=no],
+ [case "$host_cpu" in
+ # Guess no on ia64, x86_64, i386.
+ ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
+ *)
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on FreeBSD >= 6.
+ freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ openbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_infinite_long_double="guessing yes"],
+ [gl_cv_func_printf_infinite_long_double="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";;
+ esac
+ ;;
+ esac
+ ])
+ ])
+ ;;
+ *)
+ gl_cv_func_printf_infinite_long_double="irrelevant"
+ ;;
+ esac
+])
+
+dnl Test whether the *printf family of functions supports the 'a' and 'A'
+dnl conversion specifier for hexadecimal output of floating-point numbers.
+dnl (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_directive_a.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
+ [gl_cv_func_printf_directive_a],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
+ || (strcmp (buf, "0x1.922p+1 33") != 0
+ && strcmp (buf, "0x3.244p+0 33") != 0
+ && strcmp (buf, "0x6.488p-1 33") != 0
+ && strcmp (buf, "0xc.91p-2 33") != 0))
+ result |= 1;
+ if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
+ || (strcmp (buf, "-0X1.922P+1 33") != 0
+ && strcmp (buf, "-0X3.244P+0 33") != 0
+ && strcmp (buf, "-0X6.488P-1 33") != 0
+ && strcmp (buf, "-0XC.91P-2 33") != 0))
+ result |= 2;
+ /* This catches a FreeBSD 13.0 bug: it doesn't round. */
+ if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
+ || (strcmp (buf, "0x1.83p+0 33") != 0
+ && strcmp (buf, "0x3.05p-1 33") != 0
+ && strcmp (buf, "0x6.0ap-2 33") != 0
+ && strcmp (buf, "0xc.14p-3 33") != 0))
+ result |= 4;
+ /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */
+ if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
+ || (strcmp (buf, "0x2p+0 33") != 0
+ && strcmp (buf, "0x3p-1 33") != 0
+ && strcmp (buf, "0x6p-2 33") != 0
+ && strcmp (buf, "0xcp-3 33") != 0))
+ result |= 4;
+ /* This catches a FreeBSD 6.1 bug. See
+ <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
+ if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
+ || buf[0] == '0')
+ result |= 8;
+ /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
+ if (sprintf (buf, "%.1a", 1.999) < 0
+ || (strcmp (buf, "0x1.0p+1") != 0
+ && strcmp (buf, "0x2.0p+0") != 0
+ && strcmp (buf, "0x4.0p-1") != 0
+ && strcmp (buf, "0x8.0p-2") != 0))
+ result |= 16;
+ /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
+ glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
+ if (sprintf (buf, "%.1La", 1.999L) < 0
+ || (strcmp (buf, "0x1.0p+1") != 0
+ && strcmp (buf, "0x2.0p+0") != 0
+ && strcmp (buf, "0x4.0p-1") != 0
+ && strcmp (buf, "0x8.0p-2") != 0))
+ result |= 32;
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_a=yes],
+ [gl_cv_func_printf_directive_a=no],
+ [
+ case "$host_os" in
+ # Guess yes on glibc >= 2.5 systems.
+ *-gnu* | gnu*)
+ AC_EGREP_CPP([BZ2908], [
+ #include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
+ BZ2908
+ #endif
+ #endif
+ ],
+ [gl_cv_func_printf_directive_a="guessing yes"],
+ [gl_cv_func_printf_directive_a="guessing no"])
+ ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_directive_a="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_a="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_a="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the %F format
+dnl directive. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_directive_f.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'F' directive],
+ [gl_cv_func_printf_directive_f],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
+ || strcmp (buf, "1234567.000000 33") != 0)
+ result |= 1;
+ if (sprintf (buf, "%F", 1.0 / zero) < 0
+ || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
+ result |= 2;
+ /* This catches a Cygwin 1.5.x bug. */
+ if (sprintf (buf, "%.F", 1234.0) < 0
+ || strcmp (buf, "1234") != 0)
+ result |= 4;
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_f=yes],
+ [gl_cv_func_printf_directive_f=no],
+ [
+ case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on FreeBSD >= 6.
+ freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
+ midnightbsd*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
+ darwin*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
+ openbsd*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";;
+ solaris*) gl_cv_func_printf_directive_f="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_f="guessing no";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_directive_f="guessing yes"],
+ [gl_cv_func_printf_directive_f="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_f="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the %n format
+dnl directive. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_printf_directive_n.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'n' directive],
+ [gl_cv_func_printf_directive_n],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _MSC_VER
+#include <inttypes.h>
+/* See page about "Parameter Validation" on msdn.microsoft.com.
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler> */
+static void cdecl
+invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file, unsigned int line,
+ uintptr_t dummy)
+{
+ exit (1);
+}
+#endif
+static char fmtstring[10];
+static char buf[100];
+int main ()
+{
+ int count = -1;
+#ifdef _MSC_VER
+ _set_invalid_parameter_handler (invalid_parameter_handler);
+#endif
+ /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
+ support %n in format strings in read-only memory but not in writable
+ memory. */
+ strcpy (fmtstring, "%d %n");
+ if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
+ || strcmp (buf, "123 ") != 0
+ || count != 4)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_directive_n=yes],
+ [gl_cv_func_printf_directive_n=no],
+ [case "$host_os" in
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_printf_directive_n="guessing yes"],
+ [gl_cv_func_printf_directive_n="guessing no"])
+ ;;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_n="guessing no";;
+ *) gl_cv_func_printf_directive_n="guessing yes";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the %ls format
+dnl directive and in particular, when a precision is specified, whether
+dnl the functions stop converting the wide string argument when the number
+dnl of bytes that have been produced by this conversion equals or exceeds
+dnl the precision.
+dnl Result is gl_cv_func_printf_directive_ls.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'ls' directive],
+ [gl_cv_func_printf_directive_ls],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <wchar.h>
+#include <string.h>
+int main ()
+{
+ int result = 0;
+ char buf[100];
+ /* Test whether %ls works at all.
+ This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
+ Cygwin 1.5. */
+ {
+ static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
+ buf[0] = '\0';
+ if (sprintf (buf, "%ls", wstring) < 0
+ || strcmp (buf, "abc") != 0)
+ result |= 1;
+ }
+ /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
+ assertion failure inside libc), but not on OpenBSD 4.0. */
+ {
+ static const wchar_t wstring[] = { 'a', 0 };
+ buf[0] = '\0';
+ if (sprintf (buf, "%ls", wstring) < 0
+ || strcmp (buf, "a") != 0)
+ result |= 2;
+ }
+ /* Test whether precisions in %ls are supported as specified in ISO C 99
+ section 7.19.6.1:
+ "If a precision is specified, no more than that many bytes are written
+ (including shift sequences, if any), and the array shall contain a
+ null wide character if, to equal the multibyte character sequence
+ length given by the precision, the function would need to access a
+ wide character one past the end of the array."
+ This test fails on Solaris 10. */
+ {
+ static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
+ buf[0] = '\0';
+ if (sprintf (buf, "%.2ls", wstring) < 0
+ || strcmp (buf, "ab") != 0)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_ls=yes],
+ [gl_cv_func_printf_directive_ls=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";;
+ openbsd*) gl_cv_func_printf_directive_ls="guessing yes";;
+ irix*) gl_cv_func_printf_directive_ls="guessing no";;
+ solaris*) gl_cv_func_printf_directive_ls="guessing no";;
+ cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
+ beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_printf_directive_ls="guessing yes";;
+ *) gl_cv_func_printf_directive_ls="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports POSIX/XSI format
+dnl strings with positions. (POSIX:2001)
+dnl Result is gl_cv_func_printf_positions.
+
+AC_DEFUN([gl_PRINTF_POSITIONS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
+ [gl_cv_func_printf_positions],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+ dollar expansion (possibly an autoconf bug). */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+ sprintf (buf, format, 33, 55);
+ return (strcmp (buf, "55 33") != 0);
+}]])],
+ [gl_cv_func_printf_positions=yes],
+ [gl_cv_func_printf_positions=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+ gl_cv_func_printf_positions="guessing no";;
+ beos*) gl_cv_func_printf_positions="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_positions="guessing yes";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+ *) gl_cv_func_printf_positions="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports POSIX/XSI format
+dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
+dnl Result is gl_cv_func_printf_flag_grouping.
+
+AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the grouping flag],
+ [gl_cv_func_printf_flag_grouping],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+ if (sprintf (buf, "%'d %d", 1234567, 99) < 0
+ || buf[strlen (buf) - 1] != '9')
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_flag_grouping=yes],
+ [gl_cv_func_printf_flag_grouping=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
+ netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
+ *) gl_cv_func_printf_flag_grouping="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the - flag correctly.
+dnl (ISO C99.) See
+dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html>
+dnl Result is gl_cv_func_printf_flag_leftadjust.
+
+AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
+ [gl_cv_func_printf_flag_leftadjust],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+ /* Check that a '-' flag is not annihilated by a negative width. */
+ if (sprintf (buf, "a%-*sc", -3, "b") < 0
+ || strcmp (buf, "ab c") != 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_flag_leftadjust=yes],
+ [gl_cv_func_printf_flag_leftadjust=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on HP-UX 11.
+ hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess no on HP-UX 10 and older.
+ hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess yes otherwise.
+ *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports padding of non-finite
+dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
+dnl <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html>
+dnl Result is gl_cv_func_printf_flag_zero.
+
+AC_DEFUN([gl_PRINTF_FLAG_ZERO],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the zero flag correctly],
+ [gl_cv_func_printf_flag_zero],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
+{
+ if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
+ || (strcmp (buf, " inf") != 0
+ && strcmp (buf, " infinity") != 0))
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_printf_flag_zero=yes],
+ [gl_cv_func_printf_flag_zero=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_flag_zero="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports large precisions.
+dnl On mingw, precisions larger than 512 are treated like 512, in integer,
+dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
+dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
+dnl precisions larger than 510 in floating-point output yield wrong results.
+dnl On AIX 7.1, precisions larger than 998 in floating-point output yield
+dnl wrong results. On BeOS, precisions larger than 1044 crash the program.
+dnl Result is gl_cv_func_printf_precision.
+
+AC_DEFUN([gl_PRINTF_PRECISION],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports large precisions],
+ [gl_cv_func_printf_precision],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[5000];
+int main ()
+{
+ int result = 0;
+#ifdef __BEOS__
+ /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
+ return 1;
+#endif
+ if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
+ result |= 1;
+ if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
+ result |= 2;
+ if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+ || buf[0] != '1')
+ result |= 4;
+ if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
+ || buf[0] != '1')
+ result |= 4;
+ return result;
+}]])],
+ [gl_cv_func_printf_precision=yes],
+ [gl_cv_func_printf_precision=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no only on Solaris, native Windows, and BeOS systems.
+ solaris*) gl_cv_func_printf_precision="guessing no" ;;
+ mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
+ beos*) gl_cv_func_printf_precision="guessing no" ;;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_precision="guessing yes" ;;
+ *) gl_cv_func_printf_precision="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions recovers gracefully in case
+dnl of an out-of-memory condition, or whether it crashes the entire program.
+dnl Result is gl_cv_func_printf_enomem.
+
+AC_DEFUN([gl_PRINTF_ENOMEM],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_MULTIARCH])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
+ [gl_cv_func_printf_enomem],
+ [
+ gl_cv_func_printf_enomem="guessing no"
+ if test "$cross_compiling" = no; then
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+]GL_NOCRASH[
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <errno.h>
+int main()
+{
+ struct rlimit limit;
+ int ret;
+ nocrash_init ();
+ /* Some printf implementations allocate temporary space with malloc. */
+ /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
+#ifdef RLIMIT_DATA
+ if (getrlimit (RLIMIT_DATA, &limit) < 0)
+ return 77;
+ if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+ limit.rlim_max = 5000000;
+ limit.rlim_cur = limit.rlim_max;
+ if (setrlimit (RLIMIT_DATA, &limit) < 0)
+ return 77;
+#endif
+ /* On Linux systems, malloc() is limited by RLIMIT_AS. */
+#ifdef RLIMIT_AS
+ if (getrlimit (RLIMIT_AS, &limit) < 0)
+ return 77;
+ if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+ limit.rlim_max = 5000000;
+ limit.rlim_cur = limit.rlim_max;
+ if (setrlimit (RLIMIT_AS, &limit) < 0)
+ return 77;
+#endif
+ /* Some printf implementations allocate temporary space on the stack. */
+#ifdef RLIMIT_STACK
+ if (getrlimit (RLIMIT_STACK, &limit) < 0)
+ return 77;
+ if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+ limit.rlim_max = 5000000;
+ limit.rlim_cur = limit.rlim_max;
+ if (setrlimit (RLIMIT_STACK, &limit) < 0)
+ return 77;
+#endif
+ ret = printf ("%.5000000f", 1.0);
+ return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
+}
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ (./conftest 2>&AS_MESSAGE_LOG_FD
+ result=$?
+ _AS_ECHO_LOG([\$? = $result])
+ if test $result != 0 && test $result != 77; then result=1; fi
+ exit $result
+ ) >/dev/null 2>/dev/null
+ case $? in
+ 0) gl_cv_func_printf_enomem="yes" ;;
+ 77) gl_cv_func_printf_enomem="guessing no" ;;
+ *) gl_cv_func_printf_enomem="no" ;;
+ esac
+ else
+ gl_cv_func_printf_enomem="guessing no"
+ fi
+ rm -fr conftest*
+ else
+ dnl A universal build on Apple Mac OS X platforms.
+ dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
+ dnl But we need a configuration result that is valid in both modes.
+ gl_cv_func_printf_enomem="guessing no"
+ fi
+ fi
+ if test "$gl_cv_func_printf_enomem" = "guessing no"; then
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on Solaris.
+ solaris*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on AIX.
+ aix*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on HP-UX/hppa.
+ hpux*) case "$host_cpu" in
+ hppa*) gl_cv_func_printf_enomem="guessing yes";;
+ *) gl_cv_func_printf_enomem="guessing no";;
+ esac
+ ;;
+ # Guess yes on IRIX.
+ irix*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on OSF/1.
+ osf*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on Haiku.
+ haiku*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_enomem="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_enomem="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ fi
+ ])
+])
+
+dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
+dnl Result is ac_cv_func_snprintf.
+
+AC_DEFUN([gl_SNPRINTF_PRESENCE],
+[
+ AC_CHECK_FUNCS_ONCE([snprintf])
+])
+
+dnl Test whether the string produced by the snprintf function is always NUL
+dnl terminated. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_snprintf_truncation_c99.
+
+AC_DEFUN_ONCE([gl_SNPRINTF_TRUNCATION_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
+ [gl_cv_func_snprintf_truncation_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+ strcpy (buf, "ABCDEF");
+ my_snprintf (buf, 3, "%d %d", 4567, 89);
+ if (memcmp (buf, "45\0DEF", 6) != 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_snprintf_truncation_c99=yes],
+ [gl_cv_func_snprintf_truncation_c99=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on HP-UX >= 11.
+ hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on OSF/1 >= 5.
+ osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_truncation_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl Test whether the return value of the snprintf function is the number
+dnl of bytes (excluding the terminating NUL) that would have been produced
+dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
+dnl For example, this test program fails on IRIX 6.5:
+dnl ---------------------------------------------------------------------
+dnl #include <stdio.h>
+dnl int main()
+dnl {
+dnl static char buf[8];
+dnl int retval = snprintf (buf, 3, "%d", 12345);
+dnl return retval >= 0 && retval < 3;
+dnl }
+dnl ---------------------------------------------------------------------
+dnl Result is gl_cv_func_snprintf_retval_c99.
+
+AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
+ [gl_cv_func_snprintf_retval_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+ strcpy (buf, "ABCDEF");
+ if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+ return 1;
+ if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+ return 2;
+ if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+ return 3;
+ return 0;
+}]])],
+ [gl_cv_func_snprintf_retval_c99=yes],
+ [gl_cv_func_snprintf_retval_c99=no],
+ [case "$host_os" in
+changequote(,)dnl
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on OpenBSD >= 3.9.
+ openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.10.
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
+ aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_retval_c99="guessing no";;
+ netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_snprintf_retval_c99="guessing yes"],
+ [gl_cv_func_snprintf_retval_c99="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the snprintf function supports the %n format directive
+dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_snprintf_directive_n.
+
+AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
+ [gl_cv_func_snprintf_directive_n],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+static char fmtstring[10];
+static char buf[100];
+int main ()
+{
+ int count = -1;
+ /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
+ support %n in format strings in read-only memory but not in writable
+ memory. */
+ strcpy (fmtstring, "%d %n");
+ my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
+ if (count != 6)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_snprintf_directive_n=yes],
+ [gl_cv_func_snprintf_directive_n=no],
+ [
+ case "$host_os" in
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_snprintf_directive_n="guessing yes"],
+ [gl_cv_func_snprintf_directive_n="guessing no"])
+ ;;
+changequote(,)dnl
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ midnightbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
+ darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_snprintf_directive_n="guessing no";;
+ solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on OSF/1 >= 5.
+ osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
+ osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_snprintf_directive_n="guessing no";;
+ netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_snprintf_directive_n="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
+changequote([,])dnl
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the snprintf function, when passed a size = 1, writes any
+dnl output without bounds in this case, behaving like sprintf. This is the
+dnl case on Linux libc5.
+dnl Result is gl_cv_func_snprintf_size1.
+
+AC_DEFUN([gl_SNPRINTF_SIZE1],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
+ AC_CACHE_CHECK([whether snprintf respects a size of 1],
+ [gl_cv_func_snprintf_size1],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
+int main()
+{
+ static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+ my_snprintf (buf, 1, "%d", 12345);
+ return buf[1] != 'E';
+}]])],
+ [gl_cv_func_snprintf_size1=yes],
+ [gl_cv_func_snprintf_size1=no],
+ [case "$host_os" in
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ *) gl_cv_func_snprintf_size1="guessing yes" ;;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the vsnprintf function, when passed a zero size, produces no
+dnl output. (ISO C99, POSIX:2001)
+dnl For example, snprintf nevertheless writes a NUL byte in this case
+dnl on OSF/1 5.1:
+dnl ---------------------------------------------------------------------
+dnl #include <stdio.h>
+dnl int main()
+dnl {
+dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+dnl snprintf (buf, 0, "%d", 12345);
+dnl return buf[0] != 'D';
+dnl }
+dnl ---------------------------------------------------------------------
+dnl And vsnprintf writes any output without bounds in this case, behaving like
+dnl vsprintf, on HP-UX 11 and OSF/1 5.1:
+dnl ---------------------------------------------------------------------
+dnl #include <stdarg.h>
+dnl #include <stdio.h>
+dnl static int my_snprintf (char *buf, int size, const char *format, ...)
+dnl {
+dnl va_list args;
+dnl int ret;
+dnl va_start (args, format);
+dnl ret = vsnprintf (buf, size, format, args);
+dnl va_end (args);
+dnl return ret;
+dnl }
+dnl int main()
+dnl {
+dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+dnl my_snprintf (buf, 0, "%d", 12345);
+dnl return buf[0] != 'D';
+dnl }
+dnl ---------------------------------------------------------------------
+dnl Result is gl_cv_func_vsnprintf_zerosize_c99.
+
+AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
+ [gl_cv_func_vsnprintf_zerosize_c99],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdarg.h>
+#include <stdio.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+int main()
+{
+ static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+ my_snprintf (buf, 0, "%d", 12345);
+ return buf[0] != 'D';
+}]])],
+ [gl_cv_func_vsnprintf_zerosize_c99=yes],
+ [gl_cv_func_vsnprintf_zerosize_c99=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on FreeBSD >= 5.
+ freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Mac OS X >= 10.3.
+ darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Cygwin.
+ cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Solaris >= 2.6.
+ solaris2.[0-5] | solaris2.[0-5].*)
+ gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on AIX >= 4.
+ aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on IRIX >= 6.5.
+ irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on NetBSD >= 3.
+ netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+ gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on native Windows.
+ mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
+dnl The results of these tests on various platforms are:
+dnl
+dnl 1 = gl_PRINTF_SIZES_C99
+dnl 2 = gl_PRINTF_LONG_DOUBLE
+dnl 3 = gl_PRINTF_INFINITE
+dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
+dnl 5 = gl_PRINTF_DIRECTIVE_A
+dnl 6 = gl_PRINTF_DIRECTIVE_F
+dnl 7 = gl_PRINTF_DIRECTIVE_N
+dnl 8 = gl_PRINTF_DIRECTIVE_LS
+dnl 9 = gl_PRINTF_POSITIONS
+dnl 10 = gl_PRINTF_FLAG_GROUPING
+dnl 11 = gl_PRINTF_FLAG_LEFTADJUST
+dnl 12 = gl_PRINTF_FLAG_ZERO
+dnl 13 = gl_PRINTF_PRECISION
+dnl 14 = gl_PRINTF_ENOMEM
+dnl 15 = gl_SNPRINTF_PRESENCE
+dnl 16 = gl_SNPRINTF_TRUNCATION_C99
+dnl 17 = gl_SNPRINTF_RETVAL_C99
+dnl 18 = gl_SNPRINTF_DIRECTIVE_N
+dnl 19 = gl_SNPRINTF_SIZE1
+dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99
+dnl
+dnl 1 = checking whether printf supports size specifiers as in C99...
+dnl 2 = checking whether printf supports 'long double' arguments...
+dnl 3 = checking whether printf supports infinite 'double' arguments...
+dnl 4 = checking whether printf supports infinite 'long double' arguments...
+dnl 5 = checking whether printf supports the 'a' and 'A' directives...
+dnl 6 = checking whether printf supports the 'F' directive...
+dnl 7 = checking whether printf supports the 'n' directive...
+dnl 8 = checking whether printf supports the 'ls' directive...
+dnl 9 = checking whether printf supports POSIX/XSI format strings with positions...
+dnl 10 = checking whether printf supports the grouping flag...
+dnl 11 = checking whether printf supports the left-adjust flag correctly...
+dnl 12 = checking whether printf supports the zero flag correctly...
+dnl 13 = checking whether printf supports large precisions...
+dnl 14 = checking whether printf survives out-of-memory conditions...
+dnl 15 = checking for snprintf...
+dnl 16 = checking whether snprintf truncates the result as in C99...
+dnl 17 = checking whether snprintf returns a byte count as in C99...
+dnl 18 = checking whether snprintf fully supports the 'n' directive...
+dnl 19 = checking whether snprintf respects a size of 1...
+dnl 20 = checking whether vsnprintf respects a zero size as in C99...
+dnl
+dnl . = yes, # = no.
+dnl
+dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
+dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
+dnl FreeBSD 13.0 . . . . # . . . . . . . . # . . . . . .
+dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
+dnl Mac OS X 10.13.5 . . . # # . # . . . . . . . . . . # . .
+dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
+dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
+dnl OpenBSD 6.0, 6.7 . . . . # . . . . . . . . # . . . . . .
+dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
+dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
+dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
+dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
+dnl Solaris 11.4 . . # # # . . # . . . # . . . . . . . .
+dnl Solaris 11.3 . . . . # . . # . . . . . . . . . . . .
+dnl Solaris 11.0 . . # # # . . # . . . # . . . . . . . .
+dnl Solaris 10 . . # # # . . # . . . # # . . . . . . .
+dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . .
+dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
+dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . .
+dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . .
+dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . .
+dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
+dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
+dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
+dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . .
+dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . #
+dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # #
+dnl NetBSD 9.0 . . . . # . . . . . . . . . . . . . . .
+dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . .
+dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
+dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
+dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
+dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
+dnl Android 4.3 . . # # # # # # . # . # . # . . . # . .
+dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . .
+dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . .
+dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . .
+dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . .
diff --git a/gl/m4/pthread_rwlock_rdlock.m4 b/gl/m4/pthread_rwlock_rdlock.m4
new file mode 100644
index 0000000..ae6a885
--- /dev/null
+++ b/gl/m4/pthread_rwlock_rdlock.m4
@@ -0,0 +1,185 @@
+# pthread_rwlock_rdlock.m4 serial 4
+dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Inspired by
+dnl https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c
+dnl by Intel Corporation.
+
+dnl Test whether in a situation where
+dnl - an rwlock is taken by a reader and has a writer waiting,
+dnl - an additional reader requests the lock,
+dnl - the waiting writer and the requesting reader threads have the same
+dnl priority,
+dnl the requesting reader thread gets blocked, so that at some point the
+dnl waiting writer can acquire the lock.
+dnl Without such a guarantee, when there a N readers and each of the readers
+dnl spends more than 1/Nth of the time with the lock held, there is a high
+dnl probability that the waiting writer will not get the lock in a given finite
+dnl time, a phenomenon called "writer starvation".
+dnl Without such a guarantee, applications have a hard time avoiding writer
+dnl starvation.
+dnl
+dnl POSIX:2017 makes this requirement only for implementations that support TPS
+dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO
+dnl and SCHED_RR, see
+dnl https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
+dnl but this test verifies the guarantee regardless of TPS and regardless of
+dnl scheduling policy.
+dnl Glibc does not provide this guarantee (and never will on Linux), see
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
+dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
+AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
+ [gl_cv_pthread_rwlock_rdlock_prefer_writer],
+ [save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <errno.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define SUCCEED() exit (0)
+#define FAILURE() exit (1)
+#define UNEXPECTED(n) (exit (10 + (n)))
+
+/* The main thread creates the waiting writer and the requesting reader threads
+ in the default way; this guarantees that they have the same priority.
+ We can reuse the main thread as first reader thread. */
+
+static pthread_rwlock_t lock;
+static pthread_t reader1;
+static pthread_t writer;
+static pthread_t reader2;
+static pthread_t timer;
+/* Used to pass control from writer to reader2 and from reader2 to timer,
+ as in a relay race.
+ Passing control from one running thread to another running thread
+ is most likely faster than to create the second thread. */
+static pthread_mutex_t baton;
+
+static void *
+timer_func (void *ignored)
+{
+ /* Step 13 (can be before or after step 12):
+ The timer thread takes the baton, then waits a moment to make sure
+ it can tell whether the second reader thread is blocked at step 12. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (13);
+ usleep (100000);
+ /* By the time we get here, it's clear that the second reader thread is
+ blocked at step 12. This is the desired behaviour. */
+ SUCCEED ();
+}
+
+static void *
+reader2_func (void *ignored)
+{
+ int err;
+
+ /* Step 8 (can be before or after step 7):
+ The second reader thread takes the baton, then waits a moment to make sure
+ the writer thread has reached step 7. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (8);
+ usleep (100000);
+ /* Step 9: The second reader thread requests the lock. */
+ err = pthread_rwlock_tryrdlock (&lock);
+ if (err == 0)
+ FAILURE ();
+ else if (err != EBUSY)
+ UNEXPECTED (9);
+ /* Step 10: Launch a timer, to test whether the next call blocks. */
+ if (pthread_create (&timer, NULL, timer_func, NULL))
+ UNEXPECTED (10);
+ /* Step 11: Release the baton. */
+ if (pthread_mutex_unlock (&baton))
+ UNEXPECTED (11);
+ /* Step 12: The second reader thread requests the lock. */
+ err = pthread_rwlock_rdlock (&lock);
+ if (err == 0)
+ FAILURE ();
+ else
+ UNEXPECTED (12);
+}
+
+static void *
+writer_func (void *ignored)
+{
+ /* Step 4: Take the baton, so that the second reader thread does not go ahead
+ too early. */
+ if (pthread_mutex_lock (&baton))
+ UNEXPECTED (4);
+ /* Step 5: Create the second reader thread. */
+ if (pthread_create (&reader2, NULL, reader2_func, NULL))
+ UNEXPECTED (5);
+ /* Step 6: Release the baton. */
+ if (pthread_mutex_unlock (&baton))
+ UNEXPECTED (6);
+ /* Step 7: The writer thread requests the lock. */
+ if (pthread_rwlock_wrlock (&lock))
+ UNEXPECTED (7);
+ return NULL;
+}
+
+int
+main ()
+{
+ reader1 = pthread_self ();
+
+ /* Step 1: The main thread initializes the lock and the baton. */
+ if (pthread_rwlock_init (&lock, NULL))
+ UNEXPECTED (1);
+ if (pthread_mutex_init (&baton, NULL))
+ UNEXPECTED (1);
+ /* Step 2: The main thread acquires the lock as a reader. */
+ if (pthread_rwlock_rdlock (&lock))
+ UNEXPECTED (2);
+ /* Step 3: Create the writer thread. */
+ if (pthread_create (&writer, NULL, writer_func, NULL))
+ UNEXPECTED (3);
+ /* Job done. Go to sleep. */
+ for (;;)
+ {
+ sleep (1);
+ }
+}
+]])],
+ [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
+ [gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
+ [case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on musl systems.
+ *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on bionic systems.
+ *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess yes on native Windows with the mingw-w64 winpthreads library.
+ # Guess no on native Windows with the gnulib windows-rwlock module.
+ mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
+ else
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
+ fi
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ LIBS="$save_LIBS"
+ ])
+ case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
+ *yes)
+ AC_DEFINE([HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], [1],
+ [Define if the 'pthread_rwlock_rdlock' function prefers a writer to a reader.])
+ ;;
+ esac
+])
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
new file mode 100644
index 0000000..d22138f
--- /dev/null
+++ b/gl/m4/realloc.m4
@@ -0,0 +1,63 @@
+# realloc.m4 serial 26
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# This is adapted with modifications from upstream Autoconf here:
+# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n1455
+AC_DEFUN([_AC_FUNC_REALLOC_IF],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CACHE_CHECK([whether realloc (0, 0) returns nonnull],
+ [ac_cv_func_realloc_0_nonnull],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ ]],
+ [[void *p = realloc (0, 0);
+ int result = !p;
+ free (p);
+ return result;]])
+ ],
+ [ac_cv_func_realloc_0_nonnull=yes],
+ [ac_cv_func_realloc_0_nonnull=no],
+ [case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+ | gnu* | *-musl* | midnightbsd* \
+ | hpux* | solaris* | cygwin* | mingw* | msys* )
+ ac_cv_func_realloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ AS_CASE([$ac_cv_func_realloc_0_nonnull], [*yes], [$1], [$2])
+])# AC_FUNC_REALLOC
+
+# gl_FUNC_REALLOC_GNU
+# -------------------
+# Replace realloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_REALLOC_GNU],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_REALLOC_POSIX])
+ if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then
+ _AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1])
+ fi
+])# gl_FUNC_REALLOC_GNU
+
+# gl_FUNC_REALLOC_POSIX
+# ---------------------
+# Test whether 'realloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t overflow),
+# and replace realloc if it is not.
+AC_DEFUN([gl_FUNC_REALLOC_POSIX],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+ if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then
+ REPLACE_REALLOC_FOR_REALLOC_POSIX=1
+ fi
+])
diff --git a/gl/m4/reallocarray.m4 b/gl/m4/reallocarray.m4
new file mode 100644
index 0000000..1607b7a
--- /dev/null
+++ b/gl/m4/reallocarray.m4
@@ -0,0 +1,23 @@
+# reallocarray.m4 serial 3
+dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_REALLOCARRAY],
+[
+ dnl Persuade glibc <stdlib.h> to declare reallocarray.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
+ AC_CHECK_FUNCS([reallocarray])
+ if test "$ac_cv_func_reallocarray" = no; then
+ HAVE_REALLOCARRAY=0
+ elif test "$gl_cv_malloc_ptrdiff" = no; then
+ REPLACE_REALLOCARRAY=1
+ fi
+])
+
+# Prerequisites of lib/reallocarray.c.
+AC_DEFUN([gl_PREREQ_REALLOCARRAY], [:])
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
new file mode 100644
index 0000000..c89a143
--- /dev/null
+++ b/gl/m4/regex.m4
@@ -0,0 +1,396 @@
+# serial 73
+
+# Copyright (C) 1996-2001, 2003-2023 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl Initially derived from code in GNU grep.
+dnl Mostly written by Jim Meyering.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([gl_REGEX],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_ARG_WITH([included-regex],
+ [AS_HELP_STRING([--without-included-regex],
+ [don't compile regex; this is the default on systems
+ with recent-enough versions of the GNU C Library
+ (use with caution on other systems).])])
+
+ case $with_included_regex in #(
+ yes|no) ac_use_included_regex=$with_included_regex
+ ;;
+ '')
+ # If the system regex support is good enough that it passes the
+ # following run test, then default to *not* using the included regex.c.
+ # If cross compiling, assume the test would fail and use the included
+ # regex.c.
+ AC_CHECK_DECLS_ONCE([alarm])
+ AC_CHECK_HEADERS_ONCE([malloc.h])
+ AC_CACHE_CHECK([for working re_compile_pattern],
+ [gl_cv_func_re_compile_pattern_working],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <regex.h>
+
+ #include <locale.h>
+ #include <limits.h>
+ #include <string.h>
+
+ #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
+ # include <signal.h>
+ # include <unistd.h>
+ #endif
+
+ #if HAVE_MALLOC_H
+ # include <malloc.h>
+ #endif
+
+ #ifdef M_CHECK_ACTION
+ /* Exit with distinguishable exit code. */
+ static void sigabrt_no_core (int sig) { raise (SIGTERM); }
+ #endif
+ ]],
+ [[int result = 0;
+ static struct re_pattern_buffer regex;
+ unsigned char folded_chars[UCHAR_MAX + 1];
+ int i;
+ const char *s;
+ struct re_registers regs;
+
+ /* Some builds of glibc go into an infinite loop on this
+ test. Use alarm to force death, and mallopt to avoid
+ malloc recursion in diagnosing the corrupted heap. */
+#if HAVE_DECL_ALARM
+ signal (SIGALRM, SIG_DFL);
+ alarm (2);
+#endif
+#ifdef M_CHECK_ACTION
+ signal (SIGABRT, sigabrt_no_core);
+ mallopt (M_CHECK_ACTION, 2);
+#endif
+
+ if (setlocale (LC_ALL, "en_US.UTF-8"))
+ {
+ {
+ /* https://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+ This test needs valgrind to catch the bug on Debian
+ GNU/Linux 3.1 x86, but it might catch the bug better
+ on other platforms and it shouldn't hurt to try the
+ test here. */
+ static char const pat[] = "insert into";
+ static char const data[] =
+ "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
+ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
+ | RE_ICASE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else
+ {
+ if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ regfree (&regex);
+ }
+ }
+
+ {
+ /* This test is from glibc bug 15078.
+ The test case is from Andreas Schwab in
+ <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+ */
+ static char const pat[] = "[^x]x";
+ static char const data[] =
+ /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
+ "\xe1\x80\x80"
+ "\xe1\x80\xbb"
+ "\xe1\x80\xbd"
+ "\xe1\x80\x94"
+ "\xe1\x80\xba"
+ "\xe1\x80\xaf"
+ "\xe1\x80\x95"
+ "\xe1\x80\xba"
+ "x";
+ re_set_syntax (0);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else
+ {
+ i = re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, 0);
+ if (i != 0 && i != 21)
+ result |= 1;
+ regfree (&regex);
+ }
+ }
+
+ if (! setlocale (LC_ALL, "C"))
+ return 1;
+ }
+
+ /* This test is from glibc bug 3957, reported by Andrew Mackey. */
+ re_set_syntax (RE_SYNTAX_EGREP | RE_HAT_LISTS_NOT_NEWLINE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("a[^x]b", 6, &regex);
+ if (s)
+ result |= 2;
+ else
+ {
+ /* This should fail, but succeeds for glibc-2.5. */
+ if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+ regfree (&regex);
+ }
+
+ /* This regular expression is from Spencer ere test number 75
+ in grep-2.3. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ for (i = 0; i <= UCHAR_MAX; i++)
+ folded_chars[i] = i;
+ regex.translate = folded_chars;
+ s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
+ /* This should fail with _Invalid character class name_ error. */
+ if (!s)
+ {
+ result |= 4;
+ regfree (&regex);
+ }
+
+ /* Ensure that [b-a] is diagnosed as invalid, when
+ using RE_NO_EMPTY_RANGES. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("a[b-a]", 6, &regex);
+ if (s == 0)
+ {
+ result |= 8;
+ regfree (&regex);
+ }
+
+ /* This should succeed, but does not for glibc-2.1.3. */
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("{1", 2, &regex);
+ if (s)
+ result |= 8;
+ else
+ regfree (&regex);
+
+ /* The following example is derived from a problem report
+ against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("[an\371]*n", 7, &regex);
+ if (s)
+ result |= 8;
+ else
+ {
+ /* This should match, but does not for glibc-2.2.1. */
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 8;
+ else
+ {
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ /* The version of regex.c in older versions of gnulib
+ ignored RE_ICASE. Detect that problem too. */
+ re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ result |= 16;
+ else
+ {
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ result |= 16;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+
+ /* Catch a bug reported by Vin Shelton in
+ https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
+ */
+ re_set_syntax (RE_SYNTAX_POSIX_BASIC
+ & ~RE_CONTEXT_INVALID_DUP
+ & ~RE_NO_EMPTY_RANGES);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("[[:alnum:]_-]\\\\+\$", 16, &regex);
+ if (s)
+ result |= 32;
+ else
+ regfree (&regex);
+
+ /* REG_STARTEND was added to glibc on 2004-01-15.
+ Reject older versions. */
+ if (! REG_STARTEND)
+ result |= 64;
+
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\\\1|0", 10, &regex);
+ if (!s)
+ {
+ memset (&regs, 0, sizeof regs);
+ i = re_search (&regex, "x", 1, 0, 1, &regs);
+ if (i != -1)
+ result |= 64;
+ if (0 <= i)
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
+ else
+ {
+ if (strcmp (s, "Invalid back reference"))
+ result |= 64;
+ }
+
+ /* glibc bug 11053. */
+ re_set_syntax (RE_SYNTAX_POSIX_BASIC);
+ memset (&regex, 0, sizeof regex);
+ static char const pat_sub2[] = "\\\\(a*\\\\)*a*\\\\1";
+ s = re_compile_pattern (pat_sub2, sizeof pat_sub2 - 1, &regex);
+ if (s)
+ result |= 64;
+ else
+ {
+ memset (&regs, 0, sizeof regs);
+ static char const data[] = "a";
+ int datalen = sizeof data - 1;
+ i = re_search (&regex, data, datalen, 0, datalen, &regs);
+ if (i != 0)
+ result |= 64;
+ else if (regs.num_regs < 2)
+ result |= 64;
+ else if (! (regs.start[0] == 0 && regs.end[0] == 1))
+ result |= 64;
+ else if (! (regs.start[1] == 0 && regs.end[1] == 0))
+ result |= 64;
+ regfree (&regex);
+ free (regs.start);
+ free (regs.end);
+ }
+
+#if 0
+ /* It would be nice to reject hosts whose regoff_t values are too
+ narrow (including glibc on hosts with 64-bit ptrdiff_t and
+ 32-bit int), but we should wait until glibc implements this
+ feature. Otherwise, support for equivalence classes and
+ multibyte collation symbols would always be broken except
+ when compiling --without-included-regex. */
+ if (sizeof (regoff_t) < sizeof (ptrdiff_t)
+ || sizeof (regoff_t) < sizeof (ssize_t))
+ result |= 64;
+#endif
+
+ return result;
+ ]])],
+ [gl_cv_func_re_compile_pattern_working=yes],
+ [gl_cv_func_re_compile_pattern_working=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_re_compile_pattern_working" in #(
+ *yes) ac_use_included_regex=no;; #(
+ *no) ac_use_included_regex=yes;;
+ esac
+ ;;
+ *) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex])
+ ;;
+ esac
+
+ if test $ac_use_included_regex = yes; then
+ AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1],
+ [Define if you want <regex.h> to include <limits.h>, so that it
+ consistently overrides <limits.h>'s RE_DUP_MAX.])
+ AC_DEFINE([_REGEX_LARGE_OFFSETS], [1],
+ [Define if you want regoff_t to be at least as wide POSIX requires.])
+ AC_DEFINE([re_syntax_options], [rpl_re_syntax_options],
+ [Define to rpl_re_syntax_options if the replacement should be used.])
+ AC_DEFINE([re_set_syntax], [rpl_re_set_syntax],
+ [Define to rpl_re_set_syntax if the replacement should be used.])
+ AC_DEFINE([re_compile_pattern], [rpl_re_compile_pattern],
+ [Define to rpl_re_compile_pattern if the replacement should be used.])
+ AC_DEFINE([re_compile_fastmap], [rpl_re_compile_fastmap],
+ [Define to rpl_re_compile_fastmap if the replacement should be used.])
+ AC_DEFINE([re_search], [rpl_re_search],
+ [Define to rpl_re_search if the replacement should be used.])
+ AC_DEFINE([re_search_2], [rpl_re_search_2],
+ [Define to rpl_re_search_2 if the replacement should be used.])
+ AC_DEFINE([re_match], [rpl_re_match],
+ [Define to rpl_re_match if the replacement should be used.])
+ AC_DEFINE([re_match_2], [rpl_re_match_2],
+ [Define to rpl_re_match_2 if the replacement should be used.])
+ AC_DEFINE([re_set_registers], [rpl_re_set_registers],
+ [Define to rpl_re_set_registers if the replacement should be used.])
+ AC_DEFINE([re_comp], [rpl_re_comp],
+ [Define to rpl_re_comp if the replacement should be used.])
+ AC_DEFINE([re_exec], [rpl_re_exec],
+ [Define to rpl_re_exec if the replacement should be used.])
+ AC_DEFINE([regcomp], [rpl_regcomp],
+ [Define to rpl_regcomp if the replacement should be used.])
+ AC_DEFINE([regexec], [rpl_regexec],
+ [Define to rpl_regexec if the replacement should be used.])
+ AC_DEFINE([regerror], [rpl_regerror],
+ [Define to rpl_regerror if the replacement should be used.])
+ AC_DEFINE([regfree], [rpl_regfree],
+ [Define to rpl_regfree if the replacement should be used.])
+ fi
+])
+
+# Prerequisites of lib/regex.c and lib/regex_internal.c.
+AC_DEFUN([gl_PREREQ_REGEX],
+[
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([AC_C_RESTRICT])
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ AC_REQUIRE([gl_EEMALLOC])
+ AC_CHECK_HEADERS([libintl.h])
+ AC_CHECK_FUNCS_ONCE([isblank iswctype])
+ AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
+])
diff --git a/gl/m4/servent.m4 b/gl/m4/servent.m4
new file mode 100644
index 0000000..0f35b8b
--- /dev/null
+++ b/gl/m4/servent.m4
@@ -0,0 +1,51 @@
+# servent.m4 serial 4
+dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SERVENT],
+[
+ dnl Where are getservent(), setservent(), endservent(), getservbyname(),
+ dnl getservbyport() defined?
+ dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(),
+ dnl getprotobynumber() defined?
+ dnl - On Solaris < 11.4, they are in libsocket. Ignore libxnet.
+ dnl - On Haiku, they are in libnetwork.
+ dnl - On BeOS, they are in libnet.
+ dnl - On native Windows, they are in ws2_32.dll.
+ dnl - Otherwise they are in libc.
+ AC_REQUIRE([gl_SYS_SOCKET_H])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
+ SERVENT_LIB=
+ gl_saved_libs="$LIBS"
+ AC_SEARCH_LIBS([getservbyname], [socket network net],
+ [if test "$ac_cv_search_getservbyname" != "none required"; then
+ SERVENT_LIB="$ac_cv_search_getservbyname"
+ fi])
+ LIBS="$gl_saved_libs"
+ if test -z "$SERVENT_LIB"; then
+ AC_CHECK_FUNCS([getservbyname], , [
+ AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32],
+ [gl_cv_w32_getservbyname],
+ [gl_cv_w32_getservbyname=no
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <stddef.h>
+ ]],
+ [[getservbyname(NULL,NULL);]])],
+ [gl_cv_w32_getservbyname=yes])
+ LIBS="$gl_save_LIBS"
+ ])
+ if test "$gl_cv_w32_getservbyname" = "yes"; then
+ SERVENT_LIB="-lws2_32"
+ fi
+ ])
+ fi
+ AC_SUBST([SERVENT_LIB])
+])
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
new file mode 100644
index 0000000..16f9eb5
--- /dev/null
+++ b/gl/m4/setenv.m4
@@ -0,0 +1,166 @@
+# setenv.m4 serial 30
+dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SETENV],
+[
+ AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ if test $ac_cv_func_setenv = no; then
+ HAVE_SETENV=0
+ else
+ AC_CACHE_CHECK([whether setenv validates arguments],
+ [gl_cv_func_setenv_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+ ]], [[
+ int result = 0;
+ {
+ if (setenv ("", "", 0) != -1)
+ result |= 1;
+ else if (errno != EINVAL)
+ result |= 2;
+ }
+ {
+ if (setenv ("a", "=", 1) != 0)
+ result |= 4;
+ else if (strcmp (getenv ("a"), "=") != 0)
+ result |= 8;
+ }
+ return result;
+ ]])],
+ [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
+ esac
+ ])])
+ case "$gl_cv_func_setenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_SETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Like gl_FUNC_SETENV, except prepare for separate compilation
+# (no REPLACE_SETENV, no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([setenv])
+ if test $ac_cv_have_decl_setenv = no; then
+ HAVE_DECL_SETENV=0
+ fi
+ AC_CHECK_FUNCS_ONCE([setenv])
+ gl_PREREQ_SETENV
+])
+
+AC_DEFUN([gl_FUNC_UNSETENV],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_DECLS_ONCE([unsetenv])
+ if test $ac_cv_have_decl_unsetenv = no; then
+ HAVE_DECL_UNSETENV=0
+ fi
+ AC_CHECK_FUNCS([unsetenv])
+ if test $ac_cv_func_unsetenv = no; then
+ HAVE_UNSETENV=0
+ else
+ HAVE_UNSETENV=1
+ dnl Some BSDs return void, failing to do error checking.
+ AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
+#include <stdlib.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int unsetenv (const char *name);
+ ]],
+ [[]])],
+ [gt_cv_func_unsetenv_ret='int'],
+ [gt_cv_func_unsetenv_ret='void'])])
+ if test $gt_cv_func_unsetenv_ret = 'void'; then
+ AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
+ instead of int.])
+ REPLACE_UNSETENV=1
+ fi
+
+ dnl Solaris 10 unsetenv does not remove all copies of a name.
+ dnl Haiku alpha 2 unsetenv gets confused by assignment to environ.
+ dnl OpenBSD 4.7 unsetenv("") does not fail.
+ AC_CACHE_CHECK([whether unsetenv obeys POSIX],
+ [gl_cv_func_unsetenv_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+ ]GL_MDA_DEFINES],
+ [[
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
+ if (putenv ((char *) "a=1")) return 1;
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 3;
+ if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
+ ]])],
+ [gl_cv_func_unsetenv_works=yes],
+ [gl_cv_func_unsetenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
+ fi
+])
+
+# Prerequisites of lib/setenv.c.
+AC_DEFUN([gl_PREREQ_SETENV],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_HEADERS([search.h])
+ AC_CHECK_FUNCS([tsearch])
+])
+
+# Prerequisites of lib/unsetenv.c.
+AC_DEFUN([gl_PREREQ_UNSETENV],
+[
+ AC_REQUIRE([gl_ENVIRON])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+])
diff --git a/gl/m4/setlocale_null.m4 b/gl/m4/setlocale_null.m4
new file mode 100644
index 0000000..032119d
--- /dev/null
+++ b/gl/m4/setlocale_null.m4
@@ -0,0 +1,98 @@
+# setlocale_null.m4 serial 5
+dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe],
+ [gl_cv_func_setlocale_null_all_mtsafe],
+ [case "$host_os" in
+ # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+ *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+ gl_cv_func_setlocale_null_all_mtsafe=no ;;
+ # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
+ *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
+ gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ dnl On platforms without multithreading, there is no issue.
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_all_mtsafe" in
+ *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ALL_MTSAFE], [$SETLOCALE_NULL_ALL_MTSAFE],
+ [Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe.])
+
+ dnl This is about a single category (not LC_ALL).
+ AC_CACHE_CHECK([whether setlocale (category, NULL) is multithread-safe],
+ [gl_cv_func_setlocale_null_one_mtsafe],
+ [case "$host_os" in
+ # Guess no on OpenBSD, AIX.
+ openbsd* | aix*)
+ gl_cv_func_setlocale_null_one_mtsafe=no ;;
+ # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
+ *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+ gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ dnl On platforms without multithreading, there is no issue.
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_one_mtsafe" in
+ *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ONE_MTSAFE], [$SETLOCALE_NULL_ONE_MTSAFE],
+ [Define to 1 if setlocale (category, NULL) is multithread-safe.])
+
+ dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c.
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ case "$host_os" in
+ mingw*) LIB_SETLOCALE_NULL= ;;
+ *)
+ gl_WEAK_SYMBOLS
+ case "$gl_cv_have_weak" in
+ *yes) LIB_SETLOCALE_NULL= ;;
+ *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_SETLOCALE_NULL=
+ fi
+ dnl LIB_SETLOCALE_NULL is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_SETLOCALE_NULL])
+])
+
+# Prerequisites of lib/setlocale-lock.c.
+AC_DEFUN([gl_PREREQ_SETLOCALE_LOCK],
+[
+ gl_VISIBILITY
+])
diff --git a/gl/m4/sha256.m4 b/gl/m4/sha256.m4
new file mode 100644
index 0000000..4d1d1dd
--- /dev/null
+++ b/gl/m4/sha256.m4
@@ -0,0 +1,14 @@
+# sha256.m4 serial 8
+dnl Copyright (C) 2005, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SHA256],
+[
+ dnl Prerequisites of lib/sha256.c.
+ AC_REQUIRE([gl_BIGENDIAN])
+
+ dnl Determine HAVE_OPENSSL_SHA256 and LIB_CRYPTO
+ gl_CRYPTO_CHECK([SHA256])
+])
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
new file mode 100644
index 0000000..0763366
--- /dev/null
+++ b/gl/m4/size_max.m4
@@ -0,0 +1,75 @@
+# size_max.m4 serial 12
+dnl Copyright (C) 2003, 2005-2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.61])
+
+AC_DEFUN([gl_SIZE_MAX],
+[
+ AC_CHECK_HEADERS([stdint.h])
+ dnl First test whether the system already has SIZE_MAX.
+ AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
+ gl_cv_size_max=no
+ AC_EGREP_CPP([Found it], [
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+], [gl_cv_size_max=yes])
+ if test $gl_cv_size_max != yes; then
+ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
+ dnl than the type 'unsigned long'. Try hard to find a definition that can
+ dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
+ AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
+ [#include <stddef.h>
+#include <limits.h>], [size_t_bits_minus_1=])
+ AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
+ [#include <stddef.h>], [fits_in_uint=])
+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+ if test $fits_in_uint = 1; then
+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+ ]],
+ [[]])],
+ [fits_in_uint=0])
+ fi
+ dnl We cannot use 'expr' to simplify this expression, because 'expr'
+ dnl works only with 'long' integers in the host environment, while we
+ dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
+ if test $fits_in_uint = 1; then
+ gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ else
+ gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ fi
+ else
+ dnl Shouldn't happen, but who knows...
+ gl_cv_size_max='((size_t)~(size_t)0)'
+ fi
+ fi
+ ])
+ if test "$gl_cv_size_max" != yes; then
+ AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
+ [Define as the maximum value of type 'size_t', if the system doesn't define it.])
+ fi
+ dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
+ dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
+ dnl #define by AC_DEFINE_UNQUOTED.
+ AH_VERBATIM([SIZE_MAX],
+[/* Define as the maximum value of type 'size_t', if the system doesn't define
+ it. */
+#ifndef SIZE_MAX
+# undef SIZE_MAX
+#endif])
+])
diff --git a/gl/m4/snprintf.m4 b/gl/m4/snprintf.m4
new file mode 100644
index 0000000..4b5fbdb
--- /dev/null
+++ b/gl/m4/snprintf.m4
@@ -0,0 +1,62 @@
+# snprintf.m4 serial 7
+dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Libintl 0.17 will replace snprintf only if it does not support %1$s,
+dnl but defers to any gnulib snprintf replacements. Therefore, gnulib
+dnl must guarantee that the decision for replacing snprintf is a superset
+dnl of the reasons checked by libintl.
+AC_DEFUN([gl_FUNC_SNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_cv_func_snprintf_usable=no
+ AC_CHECK_FUNCS([snprintf])
+ if test $ac_cv_func_snprintf = yes; then
+ gl_SNPRINTF_SIZE1
+ case "$gl_cv_func_snprintf_size1" in
+ *yes)
+ gl_SNPRINTF_RETVAL_C99
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ gl_PRINTF_POSITIONS
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ gl_cv_func_snprintf_usable=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ if test $gl_cv_func_snprintf_usable = no; then
+ gl_REPLACE_SNPRINTF
+ fi
+ AC_CHECK_DECLS_ONCE([snprintf])
+ if test $ac_cv_have_decl_snprintf = no; then
+ HAVE_DECL_SNPRINTF=0
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_SNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_LIBOBJ([snprintf])
+ if test $ac_cv_func_snprintf = yes; then
+ REPLACE_SNPRINTF=1
+ else
+ AC_CHECK_DECLS_ONCE([snprintf])
+ if test $ac_cv_have_decl_snprintf = yes; then
+ dnl If the function is declared but does not appear to exist, it may be
+ dnl defined as an inline function. In order to avoid a conflict, we have
+ dnl to define rpl_snprintf, not snprintf.
+ REPLACE_SNPRINTF=1
+ fi
+ fi
+ gl_PREREQ_SNPRINTF
+])
+
+# Prerequisites of lib/snprintf.c.
+AC_DEFUN([gl_PREREQ_SNPRINTF], [:])
diff --git a/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4
new file mode 100644
index 0000000..a556af1
--- /dev/null
+++ b/gl/m4/socketlib.m4
@@ -0,0 +1,96 @@
+# socketlib.m4 serial 3
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl gl_SOCKETLIB
+dnl Determines the library to use for socket functions.
+dnl Sets and AC_SUBSTs LIBSOCKET.
+
+AC_DEFUN([gl_SOCKETLIB],
+[
+ gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
+ LIBSOCKET=
+ if test $HAVE_WINSOCK2_H = 1; then
+ dnl Native Windows API (not Cygwin).
+ dnl If the function WSAStartup exists (declared in <winsock2.h> and
+ dnl defined through -lws2_32), we need to call it.
+ AC_CACHE_CHECK([for WSAStartup],
+ [gl_cv_func_wsastartup], [
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif]], [[
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ int err = WSAStartup(wVersionRequested, &wsaData);
+ WSACleanup ();
+ ]])
+ ],
+ [gl_cv_func_wsastartup=yes],
+ [gl_cv_func_wsastartup=no])
+ LIBS="$gl_save_LIBS"
+ ])
+ if test "$gl_cv_func_wsastartup" = "yes"; then
+ AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
+ LIBSOCKET='-lws2_32'
+ fi
+ else
+ dnl Unix API.
+ dnl Solaris has most socket functions in libsocket.
+ dnl Haiku has most socket functions in libnetwork.
+ dnl BeOS has most socket functions in libnet.
+ dnl On HP-UX, do NOT link with libxnet, because in 64-bit mode this would
+ dnl break code (e.g. in libraries) that invokes accept(), getpeername(),
+ dnl getsockname(), getsockopt(), or recvfrom() with a 32-bit addrlen. See
+ dnl "man xopen_networking" for details.
+ AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
+ gl_cv_lib_socket=
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [],
+ [gl_save_LIBS="$LIBS"
+ LIBS="$gl_save_LIBS -lsocket"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [gl_cv_lib_socket="-lsocket"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnetwork"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [gl_cv_lib_socket="-lnetwork"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnet"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+ [gl_cv_lib_socket="-lnet"])
+ fi
+ fi
+ LIBS="$gl_save_LIBS"
+ ])
+ if test -z "$gl_cv_lib_socket"; then
+ gl_cv_lib_socket="none needed"
+ fi
+ ])
+ if test "$gl_cv_lib_socket" != "none needed"; then
+ LIBSOCKET="$gl_cv_lib_socket"
+ fi
+ fi
+ AC_SUBST([LIBSOCKET])
+])
diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4
new file mode 100644
index 0000000..ed9cb87
--- /dev/null
+++ b/gl/m4/sockets.m4
@@ -0,0 +1,17 @@
+# sockets.m4 serial 7
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SOCKETS],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gl_SOCKETLIB])
+ gl_PREREQ_SOCKETS
+])
+
+# Prerequisites of lib/sockets.c.
+AC_DEFUN([gl_PREREQ_SOCKETS], [
+ :
+])
diff --git a/gl/m4/socklen.m4 b/gl/m4/socklen.m4
new file mode 100644
index 0000000..1c63a85
--- /dev/null
+++ b/gl/m4/socklen.m4
@@ -0,0 +1,76 @@
+# socklen.m4 serial 11
+dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Albert Chin, Windows fixes from Simon Josefsson.
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc.:
+dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS.
+dnl So we have to test to find something that will work.
+
+AC_DEFUN([gl_TYPE_SOCKLEN_T],
+ [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
+ AC_CHECK_TYPE([socklen_t], ,
+ [AC_CACHE_CHECK([for socklen_t equivalent],
+ [gl_cv_socklen_t_equiv],
+ [# Systems have either "struct sockaddr *" or
+ # "void *" as the second argument to getpeername
+ gl_cv_socklen_t_equiv=
+ for arg2 in "struct sockaddr" void; do
+ for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <sys/socket.h>
+
+ int getpeername (int, $arg2 *, $t *);]],
+ [[$t len;
+ getpeername (0, 0, &len);]])],
+ [gl_cv_socklen_t_equiv="$t"])
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ test "$gl_cv_socklen_t_equiv" != "" && break
+ done
+ if test "$gl_cv_socklen_t_equiv" = ""; then
+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+ fi
+ ])
+ AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
+ [type to use in place of socklen_t if not defined])],
+ [gl_SOCKET_HEADERS])])
+
+dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
+dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users
+dnl of this module should use the same include pattern as gl_SOCKET_HEADERS.
+dnl When you change this macro, keep also in sync:
+dnl - gl_CHECK_SOCKET_HEADERS,
+dnl - the Include section of modules/socklen.
+AC_DEFUN([gl_SOCKET_HEADERS],
+[
+/* <sys/types.h> is not needed according to POSIX, but the
+ <sys/socket.h> in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+])
+
+dnl Tests for the existence of the header for socket facilities.
+dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H.
+dnl This macro must match gl_SOCKET_HEADERS.
+AC_DEFUN([gl_CHECK_SOCKET_HEADERS],
+ [AC_CHECK_HEADERS_ONCE([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h = no; then
+ dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+ dnl the check for those headers unconditional; yet cygwin reports
+ dnl that the headers are present but cannot be compiled (since on
+ dnl cygwin, all socket information should come from sys/socket.h).
+ AC_CHECK_HEADERS([ws2tcpip.h])
+ fi
+ ])
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
new file mode 100644
index 0000000..6c6dc2f
--- /dev/null
+++ b/gl/m4/sockpfaf.m4
@@ -0,0 +1,84 @@
+# sockpfaf.m4 serial 10
+dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
+dnl and some common address families (AF_INET, AF_INET6, ...).
+dnl This test assumes that a system supports an address family if and only if
+dnl it supports the corresponding protocol family.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SOCKET_FAMILIES],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H])
+ AC_CHECK_HEADERS_ONCE([netinet/in.h])
+
+ AC_CACHE_CHECK([for IPv4 sockets],
+ [gl_cv_socket_ipv4],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif]],
+[[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;]])],
+ gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
+ if test $gl_cv_socket_ipv4 = yes; then
+ AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.])
+ fi
+
+ AC_CACHE_CHECK([for IPv6 sockets],
+ [gl_cv_socket_ipv6],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif]],
+[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;]])],
+ gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
+ if test $gl_cv_socket_ipv6 = yes; then
+ AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
+ fi
+])
+
+AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H])
+ AC_CHECK_HEADERS_ONCE([sys/un.h])
+
+ AC_CACHE_CHECK([for UNIX domain sockets],
+ [gl_cv_socket_unix],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif]],
+[[int x = AF_UNIX; struct sockaddr_un y;
+ if (&x && &y) return 0;]])],
+ gl_cv_socket_unix=yes, gl_cv_socket_unix=no)])
+ if test $gl_cv_socket_unix = yes; then
+ AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.])
+ fi
+])
diff --git a/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4
new file mode 100644
index 0000000..1c12c33
--- /dev/null
+++ b/gl/m4/ssize_t.m4
@@ -0,0 +1,23 @@
+# ssize_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether ssize_t is defined.
+
+AC_DEFUN([gt_TYPE_SSIZE_T],
+[
+ AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>]],
+ [[int x = sizeof (ssize_t *) + sizeof (ssize_t);
+ return !x;]])],
+ [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
+ if test $gt_cv_ssize_t = no; then
+ AC_DEFINE([ssize_t], [int],
+ [Define as a signed type of the same size as size_t.])
+ fi
+])
diff --git a/gl/m4/stat-time.m4 b/gl/m4/stat-time.m4
new file mode 100644
index 0000000..40993d5
--- /dev/null
+++ b/gl/m4/stat-time.m4
@@ -0,0 +1,83 @@
+# Checks for stat-related time functions.
+
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2023 Free Software
+# Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# st_atim.tv_nsec - Linux, Solaris, Cygwin
+# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
+# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
+# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
+
+# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
+# st_birthtim - Cygwin 1.7.0+
+
+AC_DEFUN([gl_STAT_TIME],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+
+ AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
+ [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+ #include <time.h>
+ struct timespec ts;
+ struct stat st;
+ ]],
+ [[
+ st.st_atim = ts;
+ ]])],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
+ [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
+ if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+ AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
+ [Define to 1 if the type of the st_atim member of a struct stat is
+ struct timespec.])
+ fi],
+ [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
+
+# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.)
+# and NTFS (Cygwin).
+# There was a time when this field was named st_createtime (21 June
+# 2002 to 16 July 2002) But that window is very small and applied only
+# to development code, so systems still using that configuration are
+# not supported. See revisions 1.10 and 1.11 of FreeBSD's
+# src/sys/ufs/ufs/dinode.h.
+#
+AC_DEFUN([gl_STAT_BIRTHTIME],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [],
+ [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+])
diff --git a/gl/m4/stat.m4 b/gl/m4/stat.m4
new file mode 100644
index 0000000..4d241e2
--- /dev/null
+++ b/gl/m4/stat.m4
@@ -0,0 +1,85 @@
+# serial 18
+
+# Copyright (C) 2009-2023 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STAT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([lstat])
+ case "$host_os" in
+ mingw*)
+ dnl On this platform, the original stat() returns st_atime, st_mtime,
+ dnl st_ctime values that are affected by the time zone.
+ REPLACE_STAT=1
+ ;;
+ *)
+ dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
+ dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
+ dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
+ AC_CACHE_CHECK([whether stat handles trailing slashes on files],
+ [gl_cv_func_stat_file_slash],
+ [touch conftest.tmp
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/stat.h>
+]], [[int result = 0;
+ struct stat st;
+ if (!stat ("conftest.tmp/", &st))
+ result |= 1;
+#if HAVE_LSTAT
+ if (!stat ("conftest.lnk/", &st))
+ result |= 2;
+#endif
+ return result;
+ ]])],
+ [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.tmp conftest.lnk])
+ case $gl_cv_func_stat_file_slash in
+ *no)
+ REPLACE_STAT=1
+ AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
+ help when passed a file name with a trailing slash]);;
+ esac
+ case $host_os in
+ dnl Solaris stat can return a negative tv_nsec.
+ solaris*)
+ REPLACE_FSTAT=1 ;;
+ esac
+ ;;
+ esac
+])
+
+# Prerequisites of lib/stat.c and lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_STAT], [
+ AC_REQUIRE([gl_SYS_STAT_H])
+ AC_REQUIRE([gl_PREREQ_STAT_W32])
+ :
+])
+
+# Prerequisites of lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_STAT_W32], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_CHECK_HEADERS([sdkddkver.h])
+ ;;
+ esac
+])
diff --git a/gl/m4/std-gnu11.m4 b/gl/m4/std-gnu11.m4
new file mode 100644
index 0000000..4179470
--- /dev/null
+++ b/gl/m4/std-gnu11.m4
@@ -0,0 +1,829 @@
+# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
+
+# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
+# commit 017d5ddd82854911f0119691d91ea8a1438824d6
+# dated Sun Apr 3 13:57:17 2016 -0700
+# This implementation will be obsolete once we can assume Autoconf 2.70
+# or later is installed everywhere a Gnulib program might be developed.
+
+m4_version_prereq([2.70], [], [
+
+
+# Copyright (C) 2001-2023 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# Written by David MacKenzie, with help from
+# Akim Demaille, Paul Eggert,
+# François Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
+# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+
+
+# AC_PROG_CC([COMPILER ...])
+# --------------------------
+# COMPILER ... is a space separated list of C compilers to search for.
+# This just gives the user an opportunity to specify an alternative
+# search list for the C compiler.
+AC_DEFUN_ONCE([AC_PROG_CC],
+[AC_LANG_PUSH(C)dnl
+AC_ARG_VAR([CC], [C compiler command])dnl
+AC_ARG_VAR([CFLAGS], [C compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+_AC_ARG_VAR_LIBS()dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+m4_ifval([$1],
+ [AC_CHECK_TOOLS(CC, [$1])],
+[AC_CHECK_TOOL(CC, gcc)
+if test -z "$CC"; then
+ dnl Here we want:
+ dnl AC_CHECK_TOOL(CC, cc)
+ dnl but without the check for a tool without the prefix.
+ dnl Until the check is removed from there, copy the code:
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc])
+ fi
+fi
+if test -z "$CC"; then
+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+fi
+if test -z "$CC"; then
+ AC_CHECK_TOOLS(CC, cl.exe)
+fi
+if test -z "$CC"; then
+ AC_CHECK_TOOL(CC, clang)
+fi
+])
+
+test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH])
+
+# Provide some information about the compiler.
+_AS_ECHO_LOG([checking for _AC_LANG compiler version])
+set X $ac_compile
+ac_compiler=$[2]
+for ac_option in --version -v -V -qversion -version; do
+ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
+done
+
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+_AC_LANG_COMPILER_GNU
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+_AC_PROG_CC_G
+dnl
+dnl Set ac_prog_cc_stdc to the supported C version.
+dnl Also set the documented variable ac_cv_prog_cc_stdc;
+dnl its name was chosen when it was cached, but it is no longer cached.
+_AC_PROG_CC_C11([ac_prog_cc_stdc=c11
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11],
+ [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99],
+ [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
+ [ac_prog_cc_stdc=no
+ ac_cv_prog_cc_stdc=no])])])
+dnl
+AC_LANG_POP(C)dnl
+])# AC_PROG_CC
+
+
+
+# AC_PROG_CXX([LIST-OF-COMPILERS])
+# --------------------------------
+# LIST-OF-COMPILERS is a space separated list of C++ compilers to search
+# for (if not specified, a default list is used). This just gives the
+# user an opportunity to specify an alternative search list for the C++
+# compiler.
+# aCC HP-UX C++ compiler much better than `CC', so test before.
+# FCC Fujitsu C++ compiler
+# KCC KAI C++ compiler
+# RCC Rational C++
+# xlC_r AIX C Set++ (with support for reentrant code)
+# xlC AIX C Set++
+AC_DEFUN([AC_PROG_CXX],
+[AC_LANG_PUSH(C++)dnl
+AC_ARG_VAR([CXX], [C++ compiler command])dnl
+AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+_AC_ARG_VAR_LIBS()dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+_AC_ARG_VAR_PRECIOUS([CCC])dnl
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ AC_CHECK_TOOLS(CXX,
+ [m4_default([$1],
+ [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])],
+ g++)
+ fi
+fi
+# Provide some information about the compiler.
+_AS_ECHO_LOG([checking for _AC_LANG compiler version])
+set X $ac_compile
+ac_compiler=$[2]
+for ac_option in --version -v -V -qversion; do
+ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
+done
+
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+_AC_LANG_COMPILER_GNU
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+_AC_PROG_CXX_G
+_AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
+ ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11],
+ [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98],
+ [ac_prog_cxx_stdcxx=no
+ ac_cv_prog_cxx_stdcxx=no])])
+AC_LANG_POP(C++)dnl
+])# AC_PROG_CXX
+
+
+# _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST,
+# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE)
+# --------------------------------------------------------------
+# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99')
+# by trying to compile a program of TEST-PROLOGUE and TEST-BODY. If this fails,
+# try again with each compiler option in the space-separated OPTION-LIST; if one
+# helps, append it to CC. If eventually successful, run ACTION-IF-AVAILABLE,
+# else ACTION-IF-UNAVAILABLE.
+AC_DEFUN([_AC_C_STD_TRY],
+[AC_MSG_CHECKING([for $CC option to enable ]m4_translit($1, [c], [C])[ features])
+AC_CACHE_VAL(ac_cv_prog_cc_$1,
+[ac_cv_prog_cc_$1=no
+ac_save_CC=$CC
+AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
+for ac_arg in '' $4
+do
+ CC="$ac_save_CC $ac_arg"
+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg])
+ test "x$ac_cv_prog_cc_$1" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+])# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_$1" in
+ x)
+ AC_MSG_RESULT([none needed]) ;;
+ xno)
+ AC_MSG_RESULT([unsupported]) ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1"
+ CC=$CC$ac_prog_cc_stdc_options
+ AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;;
+esac
+AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6])
+])# _AC_C_STD_TRY
+
+# _AC_C_C99_TEST_HEADER
+# ---------------------
+# A C header suitable for testing for C99.
+AC_DEFUN([_AC_C_C99_TEST_HEADER],
+[[#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}]])# _AC_C_C99_TEST_HEADER
+
+# _AC_C_C99_TEST_BODY
+# -------------------
+# A C body suitable for testing for C99, assuming the corresponding header.
+AC_DEFUN([_AC_C_C99_TEST_BODY],
+[[
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+]])
+
+# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# ----------------------------------------------------------------
+# If the C compiler is not in ISO C99 mode by default, try to add an
+# option to output variable CC to make it so. This macro tries
+# various options that select ISO C99 on some system or another. It
+# considers the compiler to be in ISO C99 mode if it handles _Bool,
+# // comments, flexible array members, inline, long long int, mixed
+# code and declarations, named initialization of structs, restrict,
+# va_copy, varargs macros, variable declarations in for loops and
+# variable length arrays.
+AC_DEFUN([_AC_PROG_CC_C99],
+[_AC_C_STD_TRY([c99],
+[_AC_C_C99_TEST_HEADER],
+[_AC_C_C99_TEST_BODY],
+dnl Try
+dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999)
+dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test)
+dnl IBM XL C -qlanglvl=extc99
+dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99)
+dnl HP cc -AC99
+dnl Intel ICC -std=c99, -c99 (deprecated)
+dnl IRIX -c99
+dnl Solaris -D_STDC_C99=
+dnl cc's -xc99 option uses linker magic to define the external
+dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99
+dnl behavior for C library functions. This is not wanted here,
+dnl because it means that a single module compiled with -xc99
+dnl alters C runtime behavior for the entire program, not for
+dnl just the module. Instead, define the (private) symbol
+dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>.
+dnl The resulting compiler passes the test case here, and that's
+dnl good enough. For more, please see the thread starting at:
+dnl https://lists.gnu.org/r/autoconf/2010-12/msg00059.html
+dnl Tru64 -c99
+dnl with extended modes being tried first.
+[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl
+])# _AC_PROG_CC_C99
+
+
+# _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# ----------------------------------------------------------------
+# If the C compiler is not in ISO C11 mode by default, try to add an
+# option to output variable CC to make it so. This macro tries
+# various options that select ISO C11 on some system or another. It
+# considers the compiler to be in ISO C11 mode if it handles _Alignas,
+# _Alignof, _Noreturn, _Static_assert, UTF-8 string literals,
+# duplicate typedefs, and anonymous structures and unions.
+AC_DEFUN([_AC_PROG_CC_C11],
+[_AC_C_STD_TRY([c11],
+[_AC_C_C99_TEST_HEADER[
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+]],
+[_AC_C_C99_TEST_BODY[
+ v1.i = 2;
+ v1.w.k = 5;
+ _Static_assert ((offsetof (struct anonymous, i)
+ == offsetof (struct anonymous, w.k)),
+ "Anonymous union alignment botch");
+]],
+dnl Try
+dnl GCC -std=gnu11 (unused restrictive mode: -std=c11)
+dnl with extended modes being tried first.
+dnl
+dnl Do not try -qlanglvl=extc1x, because IBM XL C V12.1 (the latest version as
+dnl of September 2012) does not pass the C11 test. For now, try extc1x when
+dnl compiling the C99 test instead, since it enables _Static_assert and
+dnl _Noreturn, which is a win. If -qlanglvl=extc11 or -qlanglvl=extc1x passes
+dnl the C11 test in some future version of IBM XL C, we'll add it here,
+dnl preferably extc11.
+[[-std=gnu11]], [$1], [$2])[]dnl
+])# _AC_PROG_CC_C11
+
+
+# AC_PROG_CC_C89
+# --------------
+# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC,
+# as that'd be incompatible with how Automake redefines AC_PROG_CC. See
+# <https://lists.gnu.org/r/autoconf/2012-10/msg00048.html>.
+AU_DEFUN([AC_PROG_CC_C89],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [$0 is obsolete; use AC_PROG_CC]
+)
+
+# AC_PROG_CC_C99
+# --------------
+AU_DEFUN([AC_PROG_CC_C99],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [$0 is obsolete; use AC_PROG_CC]
+)
+
+# AC_PROG_CC_STDC
+# ---------------
+AU_DEFUN([AC_PROG_CC_STDC],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [$0 is obsolete; use AC_PROG_CC]
+)
+
+
+# AC_C_PROTOTYPES
+# ---------------
+# Check if the C compiler supports prototypes, included if it needs
+# options.
+AC_DEFUN([AC_C_PROTOTYPES],
+[AC_REQUIRE([AC_PROG_CC])dnl
+if test "$ac_prog_cc_stdc" != no; then
+ AC_DEFINE(PROTOTYPES, 1,
+ [Define to 1 if the C compiler supports function prototypes.])
+ AC_DEFINE(__PROTOTYPES, 1,
+ [Define like PROTOTYPES; this can be used by system headers.])
+fi
+])# AC_C_PROTOTYPES
+
+
+# _AC_CXX_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST,
+# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE)
+# ----------------------------------------------------------------
+# Check whether the C++ compiler accepts features of STANDARD (e.g
+# `cxx98', `cxx11') by trying to compile a program of TEST-PROLOGUE
+# and TEST-BODY. If this fails, try again with each compiler option
+# in the space-separated OPTION-LIST; if one helps, append it to CXX.
+# If eventually successful, run ACTION-IF-AVAILABLE, else
+# ACTION-IF-UNAVAILABLE.
+AC_DEFUN([_AC_CXX_STD_TRY],
+[AC_MSG_CHECKING([for $CXX option to enable ]m4_translit(m4_translit($1, [x], [+]), [a-z], [A-Z])[ features])
+AC_LANG_PUSH(C++)dnl
+AC_CACHE_VAL(ac_cv_prog_cxx_$1,
+[ac_cv_prog_cxx_$1=no
+ac_save_CXX=$CXX
+AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
+for ac_arg in '' $4
+do
+ CXX="$ac_save_CXX $ac_arg"
+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg])
+ test "x$ac_cv_prog_cxx_$1" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX
+])# AC_CACHE_VAL
+ac_prog_cxx_stdcxx_options=
+case "x$ac_cv_prog_cxx_$1" in
+ x)
+ AC_MSG_RESULT([none needed]) ;;
+ xno)
+ AC_MSG_RESULT([unsupported]) ;;
+ *)
+ ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1"
+ CXX=$CXX$ac_prog_cxx_stdcxx_options
+ AC_MSG_RESULT([$ac_cv_prog_cxx_$1]) ;;
+esac
+AC_LANG_POP(C++)dnl
+AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$5], [$6])
+])# _AC_CXX_STD_TRY
+
+# _AC_CXX_CXX98_TEST_HEADER
+# -------------------------
+# A C++ header suitable for testing for CXX98.
+AC_DEFUN([_AC_CXX_CXX98_TEST_HEADER],
+[[
+#include <algorithm>
+#include <cstdlib>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <list>
+#include <map>
+#include <set>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <utility>
+#include <vector>
+
+namespace test {
+ typedef std::vector<std::string> string_vec;
+ typedef std::pair<int,bool> map_value;
+ typedef std::map<std::string,map_value> map_type;
+ typedef std::set<int> set_type;
+
+ template<typename T>
+ class printer {
+ public:
+ printer(std::ostringstream& os): os(os) {}
+ void operator() (T elem) { os << elem << std::endl; }
+ private:
+ std::ostringstream& os;
+ };
+}
+]])# _AC_CXX_CXX98_TEST_HEADER
+
+# _AC_CXX_CXX98_TEST_BODY
+# -----------------------
+# A C++ body suitable for testing for CXX98, assuming the corresponding header.
+AC_DEFUN([_AC_CXX_CXX98_TEST_BODY],
+[[
+
+try {
+ // Basic string.
+ std::string teststr("ASCII text");
+ teststr += " string";
+
+ // Simple vector.
+ test::string_vec testvec;
+ testvec.push_back(teststr);
+ testvec.push_back("foo");
+ testvec.push_back("bar");
+ if (testvec.size() != 3) {
+ throw std::runtime_error("vector size is not 1");
+ }
+
+ // Dump vector into stringstream and obtain string.
+ std::ostringstream os;
+ for (test::string_vec::const_iterator i = testvec.begin();
+ i != testvec.end(); ++i) {
+ if (i + 1 != testvec.end()) {
+ os << teststr << '\n';
+ }
+ }
+ // Check algorithms work.
+ std::for_each(testvec.begin(), testvec.end(), test::printer<std::string>(os));
+ std::string os_out = os.str();
+
+ // Test pair and map.
+ test::map_type testmap;
+ testmap.insert(std::make_pair(std::string("key"),
+ std::make_pair(53,false)));
+
+ // Test set.
+ int values[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ test::set_type testset(values, values + sizeof(values)/sizeof(values[0]));
+ std::list<int> testlist(testset.begin(), testset.end());
+ std::copy(testset.begin(), testset.end(), std::back_inserter(testlist));
+} catch (const std::exception& e) {
+ std::cerr << "Caught exception: " << e.what() << std::endl;
+
+ // Test fstream
+ std::ofstream of("test.txt");
+ of << "Test ASCII text\n" << std::flush;
+ of << "N= " << std::hex << std::setw(8) << std::left << 534 << std::endl;
+ of.close();
+}
+std::exit(0);
+]])
+
+# _AC_CXX_CXX11_TEST_HEADER
+# -------------------------
+# A C++ header suitable for testing for CXX11.
+AC_DEFUN([_AC_CXX_CXX11_TEST_HEADER],
+[[
+#include <deque>
+#include <functional>
+#include <memory>
+#include <tuple>
+#include <array>
+#include <regex>
+#include <iostream>
+
+namespace cxx11test
+{
+ typedef std::shared_ptr<std::string> sptr;
+ typedef std::weak_ptr<std::string> wptr;
+
+ typedef std::tuple<std::string,int,double> tp;
+ typedef std::array<int, 20> int_array;
+
+ constexpr int get_val() { return 20; }
+
+ struct testinit
+ {
+ int i;
+ double d;
+ };
+
+ class delegate {
+ public:
+ delegate(int n) : n(n) {}
+ delegate(): delegate(2354) {}
+
+ virtual int getval() { return this->n; };
+ protected:
+ int n;
+ };
+
+ class overridden : public delegate {
+ public:
+ overridden(int n): delegate(n) {}
+ virtual int getval() override final { return this->n * 2; }
+ };
+
+ class nocopy {
+ public:
+ nocopy(int i): i(i) {}
+ nocopy() = default;
+ nocopy(const nocopy&) = delete;
+ nocopy & operator=(const nocopy&) = delete;
+ private:
+ int i;
+ };
+}
+]])# _AC_CXX_CXX11_TEST_HEADER
+
+# _AC_CXX_CXX11_TEST_BODY
+# -----------------------
+# A C++ body suitable for testing for CXX11, assuming the corresponding header.
+AC_DEFUN([_AC_CXX_CXX11_TEST_BODY],
+[[
+{
+ // Test auto and decltype
+ std::deque<int> d;
+ d.push_front(43);
+ d.push_front(484);
+ d.push_front(3);
+ d.push_front(844);
+ int total = 0;
+ for (auto i = d.begin(); i != d.end(); ++i) { total += *i; }
+
+ auto a1 = 6538;
+ auto a2 = 48573953.4;
+ auto a3 = "String literal";
+
+ decltype(a2) a4 = 34895.034;
+}
+{
+ // Test constexpr
+ short sa[cxx11test::get_val()] = { 0 };
+}
+{
+ // Test initializer lists
+ cxx11test::testinit il = { 4323, 435234.23544 };
+}
+{
+ // Test range-based for and lambda
+ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ for (int &x : array) { x += 23; }
+ std::for_each(array.begin(), array.end(), [](int v1){ std::cout << v1; });
+}
+{
+ using cxx11test::sptr;
+ using cxx11test::wptr;
+
+ sptr sp(new std::string("ASCII string"));
+ wptr wp(sp);
+ sptr sp2(wp);
+}
+{
+ cxx11test::tp tuple("test", 54, 45.53434);
+ double d = std::get<2>(tuple);
+ std::string s;
+ int i;
+ std::tie(s,i,d) = tuple;
+}
+{
+ static std::regex filename_regex("^_?([a-z0-9_.]+-)+[a-z0-9]+$");
+ std::string testmatch("Test if this string matches");
+ bool match = std::regex_search(testmatch, filename_regex);
+}
+{
+ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ cxx11test::int_array::size_type size = array.size();
+}
+{
+ // Test constructor delegation
+ cxx11test::delegate d1;
+ cxx11test::delegate d2();
+ cxx11test::delegate d3(45);
+}
+{
+ // Test override and final
+ cxx11test::overridden o1(55464);
+}
+{
+ // Test nullptr
+ char *c = nullptr;
+}
+{
+ // Test template brackets
+ std::vector<std::pair<int,char*>> v1;
+}
+{
+ // Unicode literals
+ char const *utf8 = u8"UTF-8 string \u2500";
+ char16_t const *utf16 = u"UTF-8 string \u2500";
+ char32_t const *utf32 = U"UTF-32 string \u2500";
+}
+]])
+
+# _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# -------------------------------------------------------------------
+
+# If the C++ compiler is not in ISO C++98 mode by default, try to add
+# an option to output variable CXX to make it so. This macro tries
+# various options that select ISO C++98 on some system or another. It
+# considers the compiler to be in ISO C++98 mode if it handles basic
+# features of the std namespace including: string, containers (list,
+# map, set, vector), streams (fstreams, iostreams, stringstreams,
+# iomanip), pair, exceptions and algorithms.
+
+
+AC_DEFUN([_AC_PROG_CXX_CXX98],
+[_AC_CXX_STD_TRY([cxx98],
+[_AC_CXX_CXX98_TEST_HEADER],
+[_AC_CXX_CXX98_TEST_BODY],
+dnl Try
+dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98)
+dnl IBM XL C -qlanglvl=extended
+dnl HP aC++ -AA
+dnl Intel ICC -std=gnu++98
+dnl Solaris N/A (default)
+dnl Tru64 N/A (default, but -std gnu could be used)
+dnl with extended modes being tried first.
+[[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl
+])# _AC_PROG_CXX_CXX98
+
+# _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# -------------------------------------------------------------------
+# If the C++ compiler is not in ISO CXX11 mode by default, try to add
+# an option to output variable CXX to make it so. This macro tries
+# various options that select ISO C++11 on some system or another. It
+# considers the compiler to be in ISO C++11 mode if it handles all the
+# tests from the C++98 checks, plus the following: Language features
+# (auto, constexpr, decltype, default/deleted constructors, delegate
+# constructors, final, initializer lists, lambda functions, nullptr,
+# override, range-based for loops, template brackets without spaces,
+# unicode literals) and library features (array, memory (shared_ptr,
+# weak_ptr), regex and tuple types).
+AC_DEFUN([_AC_PROG_CXX_CXX11],
+[_AC_CXX_STD_TRY([cxx11],
+[_AC_CXX_CXX11_TEST_HEADER
+_AC_CXX_CXX98_TEST_HEADER],
+[_AC_CXX_CXX11_TEST_BODY
+_AC_CXX_CXX98_TEST_BODY],
+dnl Try
+dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants]
+dnl IBM XL C -qlanglvl=extended0x
+dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11)
+dnl HP aC++ -AA
+dnl Intel ICC -std=c++11 -std=c++0x
+dnl Solaris N/A (no support)
+dnl Tru64 N/A (no support)
+dnl with extended modes being tried first.
+[[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl
+])# _AC_PROG_CXX_CXX11
+
+
+])# m4_version_prereq
diff --git a/gl/m4/stdalign.m4 b/gl/m4/stdalign.m4
new file mode 100644
index 0000000..dc29717
--- /dev/null
+++ b/gl/m4/stdalign.m4
@@ -0,0 +1,138 @@
+# Check for alignas and alignof that conform to C23.
+
+dnl Copyright 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Prepare for substituting <stdalign.h> if it is not supported.
+
+AC_DEFUN([gl_STDALIGN_H],
+[
+ AC_CACHE_CHECK([for alignas and alignof],
+ [gl_cv_header_working_stdalign_h],
+ [gl_save_CFLAGS=$CFLAGS
+ for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do
+ AS_CASE([$gl_working],
+ [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdint.h>
+ #ifdef INCLUDE_STDALIGN_H
+ #include <stdalign.h>
+ #endif
+ #include <stddef.h>
+
+ /* Test that alignof yields a result consistent with offsetof.
+ This catches GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+ #ifdef __cplusplus
+ template <class t> struct alignof_helper { char a; t b; };
+ # define ao(type) offsetof (alignof_helper<type>, b)
+ #else
+ # define ao(type) offsetof (struct { char a; type b; }, b)
+ #endif
+ char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
+ char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
+ char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
+
+ /* Test alignas only on platforms where gnulib can help. */
+ #if \
+ ((defined __cplusplus && 201103 <= __cplusplus) \
+ || (__TINYC__ && defined __attribute__) \
+ || (defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
+ || 1300 <= _MSC_VER)
+ struct alignas_test { char c; char alignas (8) alignas_8; };
+ char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
+ ? 1 : -1];
+ #endif
+ ]])],
+ [gl_cv_header_working_stdalign_h=$gl_working],
+ [gl_cv_header_working_stdalign_h=no])
+
+ CFLAGS=$gl_save_CFLAGS
+ test "$gl_cv_header_working_stdalign_h" != no && break
+ done])
+
+ GL_GENERATE_STDALIGN_H=false
+ AS_CASE([$gl_cv_header_working_stdalign_h],
+ [no],
+ [GL_GENERATE_STDALIGN_H=true],
+ [yes*keyword*],
+ [AC_DEFINE([HAVE_C_ALIGNASOF], [1],
+ [Define to 1 if the alignas and alignof keywords work.])])
+
+ AC_CHECK_HEADERS_ONCE([stdalign.h])
+
+ dnl The "zz" puts this toward config.h's end, to avoid potential
+ dnl collisions with other definitions.
+ AH_VERBATIM([zzalignas],
+[#if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof
+# if HAVE_STDALIGN_H
+# include <stdalign.h>
+# else
+ /* Substitute. Keep consistent with gnulib/lib/stdalign.in.h. */
+# ifndef _GL_STDALIGN_H
+# define _GL_STDALIGN_H
+# undef _Alignas
+# undef _Alignof
+# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# ifdef __cplusplus
+# if (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignof(type) alignof (type)
+# else
+ template <class __t> struct __alignof_helper { char __a; __t __b; };
+# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# else
+# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
+# define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+# else
+# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# endif
+# endif
+# if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))
+# define alignof _Alignof
+# endif
+# define __alignof_is_defined 1
+# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignas(a) alignas (a)
+# elif (!defined __attribute__ \
+ && ((defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__ && !defined __ibmxl__) \
+ || (4 <= __clang_major__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
+# define _Alignas(a) __attribute__ ((__aligned__ (a)))
+# elif 1300 <= _MSC_VER
+# define _Alignas(a) __declspec (align (a))
+# endif
+# endif
+# if ((defined _Alignas \
+ && !(defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# define alignas _Alignas
+# endif
+# if (defined alignas \
+ || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)))
+# define __alignas_is_defined 1
+# endif
+# if _GL_STDALIGN_NEEDS_STDDEF
+# include <stddef.h>
+# endif
+# endif /* _GL_STDALIGN_H */
+# endif
+#endif])
+])
diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4
new file mode 100644
index 0000000..a2322eb
--- /dev/null
+++ b/gl/m4/stddef_h.m4
@@ -0,0 +1,104 @@
+# stddef_h.m4 serial 13
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl A placeholder for <stddef.h>, for platforms that have issues.
+
+AC_DEFUN_ONCE([gl_STDDEF_H],
+[
+ AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+
+ dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ GL_GENERATE_STDDEF_H=false
+
+ dnl Test whether the type max_align_t exists and whether its alignment
+ dnl "is as great as is supported by the implementation in all contexts".
+ AC_CACHE_CHECK([for good max_align_t],
+ [gl_cv_type_max_align_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* On FreeBSD 12.0/x86, max_align_t defined by <stddef.h> has
+ the correct alignment with the default (wrong) definition of
+ _Alignof, but a wrong alignment as soon as we activate an
+ ISO C compliant _Alignof definition. */
+ #if ((defined __GNUC__ && 4 <= __GNUC__) || defined __clang__) && !defined __cplusplus
+ #define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+ #endif
+ #include <stddef.h>
+ unsigned int s = sizeof (max_align_t);
+ #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+ int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+ #endif
+ typedef struct { char a; max_align_t b; } max_helper;
+ typedef struct { char a; long b; } long_helper;
+ typedef struct { char a; double b; } double_helper;
+ typedef struct { char a; long double b; } long_double_helper;
+ int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
+ ]])],
+ [gl_cv_type_max_align_t=yes],
+ [gl_cv_type_max_align_t=no])
+ ])
+ if test $gl_cv_type_max_align_t = no; then
+ HAVE_MAX_ALIGN_T=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ if test $gt_cv_c_wchar_t = no; then
+ HAVE_WCHAR_T=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
+ [gl_cv_decl_null_works],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
+ int test[2 * (sizeof NULL == sizeof (void *)) -1];
+]])],
+ [gl_cv_decl_null_works=yes],
+ [gl_cv_decl_null_works=no])])
+ if test $gl_cv_decl_null_works = no; then
+ REPLACE_NULL=1
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ if $GL_GENERATE_STDDEF_H; then
+ gl_NEXT_HEADERS([stddef.h])
+ fi
+])
+
+# gl_STDDEF_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STDDEF_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS], [
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STDDEF_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
+ HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T])
+ HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
+])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
new file mode 100644
index 0000000..d6961b0
--- /dev/null
+++ b/gl/m4/stdint.m4
@@ -0,0 +1,531 @@
+# stdint.m4 serial 61
+dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert and Bruno Haible.
+dnl Test whether <stdint.h> is supported or must be substituted.
+
+AC_PREREQ([2.61])
+
+AC_DEFUN_ONCE([gl_STDINT_H],
+[
+ AC_PREREQ([2.59])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_REQUIRE([gl_LIMITS_H])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+
+ dnl For backward compatibility. Some packages may still be testing these
+ dnl macros.
+ AC_DEFINE([HAVE_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'long long int'.])
+ AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'unsigned long long int'.])
+
+ dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+ AC_SUBST([HAVE_WCHAR_H])
+
+ dnl Check for <inttypes.h>.
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
+ if test $ac_cv_header_inttypes_h = yes; then
+ HAVE_INTTYPES_H=1
+ else
+ HAVE_INTTYPES_H=0
+ fi
+ AC_SUBST([HAVE_INTTYPES_H])
+
+ dnl Check for <sys/types.h>.
+ AC_CHECK_HEADERS_ONCE([sys/types.h])
+ if test $ac_cv_header_sys_types_h = yes; then
+ HAVE_SYS_TYPES_H=1
+ else
+ HAVE_SYS_TYPES_H=0
+ fi
+ AC_SUBST([HAVE_SYS_TYPES_H])
+
+ gl_CHECK_NEXT_HEADERS([stdint.h])
+ if test $ac_cv_header_stdint_h = yes; then
+ HAVE_STDINT_H=1
+ else
+ HAVE_STDINT_H=0
+ fi
+ AC_SUBST([HAVE_STDINT_H])
+
+ dnl Now see whether we need a substitute <stdint.h>.
+ if test $ac_cv_header_stdint_h = yes; then
+ AC_CACHE_CHECK([whether stdint.h conforms to C99],
+ [gl_cv_header_working_stdint_h],
+ [gl_cv_header_working_stdint_h=no
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
+]
+gl_STDINT_INCLUDES
+[
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
+
+/* Check that SIZE_MAX has the correct type, if possible. */
+#if 201112 <= __STDC_VERSION__
+int k = _Generic (SIZE_MAX, size_t: 0);
+#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+extern size_t k;
+extern __typeof__ (SIZE_MAX) k;
+#endif
+
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+ ((t) ((t) 0 < (t) -1 \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+struct s {
+ int check_PTRDIFF:
+ PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
+ && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+ ? 1 : -1;
+ /* Detect bug in FreeBSD 6.0/ia64 and FreeBSD 13.0/arm64. */
+ int check_SIG_ATOMIC:
+ SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+ && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+ ? 1 : -1;
+ int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+ int check_WCHAR:
+ WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+ && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+ ? 1 : -1;
+ /* Detect bug in mingw. */
+ int check_WINT:
+ WINT_MIN == TYPE_MINIMUM (wint_t)
+ && WINT_MAX == TYPE_MAXIMUM (wint_t)
+ ? 1 : -1;
+
+ /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
+ int check_UINT8_C:
+ (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+ int check_UINT16_C:
+ (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+
+ /* Detect bugs in OpenBSD 3.9 stdint.h. */
+#ifdef UINT8_MAX
+ int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+ int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+ int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+ int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+ int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+ int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+ int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+ int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+ int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+ int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+ int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+ int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+ int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+ int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+ int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
+ ]])],
+ [dnl Determine whether the various *_MIN, *_MAX macros are usable
+ dnl in preprocessor expression. We could do it by compiling a test
+ dnl program for each of these macros. It is faster to run a program
+ dnl that inspects the macro expansion.
+ dnl This detects a bug on HP-UX 11.23/ia64.
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+]
+gl_STDINT_INCLUDES
+[
+#include <stdio.h>
+#include <string.h>
+#define MVAL(macro) MVAL1(macro)
+#define MVAL1(expression) #expression
+static const char *macro_values[] =
+ {
+#ifdef INT8_MAX
+ MVAL (INT8_MAX),
+#endif
+#ifdef INT16_MAX
+ MVAL (INT16_MAX),
+#endif
+#ifdef INT32_MAX
+ MVAL (INT32_MAX),
+#endif
+#ifdef INT64_MAX
+ MVAL (INT64_MAX),
+#endif
+#ifdef UINT8_MAX
+ MVAL (UINT8_MAX),
+#endif
+#ifdef UINT16_MAX
+ MVAL (UINT16_MAX),
+#endif
+#ifdef UINT32_MAX
+ MVAL (UINT32_MAX),
+#endif
+#ifdef UINT64_MAX
+ MVAL (UINT64_MAX),
+#endif
+ NULL
+ };
+]], [[
+ const char **mv;
+ for (mv = macro_values; *mv != NULL; mv++)
+ {
+ const char *value = *mv;
+ /* Test whether it looks like a cast expression. */
+ if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
+ || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
+ || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
+ || strncmp (value, "((int)"/*)*/, 6) == 0
+ || strncmp (value, "((signed short)"/*)*/, 15) == 0
+ || strncmp (value, "((signed char)"/*)*/, 14) == 0)
+ return mv - macro_values + 1;
+ }
+ return 0;
+]])],
+ [gl_cv_header_working_stdint_h=yes],
+ [],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
+ # In general, assume it works.
+ *) gl_cv_header_working_stdint_h="guessing yes" ;;
+ esac
+ ])
+ ])
+ ])
+ fi
+
+ HAVE_C99_STDINT_H=0
+ HAVE_SYS_BITYPES_H=0
+ HAVE_SYS_INTTYPES_H=0
+ GL_GENERATE_STDINT_H=true
+ case "$gl_cv_header_working_stdint_h" in
+ *yes)
+ HAVE_C99_STDINT_H=1
+ dnl Now see whether the system <stdint.h> works without
+ dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
+ dnl If not, there would be problems when stdint.h is included from C++.
+ AC_CACHE_CHECK([whether stdint.h works without ISO C predefines],
+ [gl_cv_header_stdint_without_STDC_macros],
+ [gl_cv_header_stdint_without_STDC_macros=no
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+]
+gl_STDINT_INCLUDES
+[
+intmax_t im = INTMAX_MAX;
+int32_t i32 = INT32_C (0x7fffffff);
+ ]])],
+ [gl_cv_header_stdint_without_STDC_macros=yes])
+ ])
+
+ if test $gl_cv_header_stdint_without_STDC_macros = no; then
+ AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
+ [Define to 1 if the system <stdint.h> predates C++11.])
+ AC_DEFINE([__STDC_LIMIT_MACROS], [1],
+ [Define to 1 if the system <stdint.h> predates C++11.])
+ fi
+ AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
+ [gl_cv_header_stdint_width],
+ [gl_cv_header_stdint_width=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <stdint.h>
+ ]gl_STDINT_INCLUDES[
+ int iw = UINTMAX_WIDTH;
+ ]])],
+ [gl_cv_header_stdint_width=yes])])
+ if test "$gl_cv_header_stdint_width" = yes; then
+ GL_GENERATE_STDINT_H=false
+ fi
+ ;;
+ *)
+ dnl Check for <sys/inttypes.h>, and for
+ dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
+ AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
+ if test $ac_cv_header_sys_inttypes_h = yes; then
+ HAVE_SYS_INTTYPES_H=1
+ fi
+ if test $ac_cv_header_sys_bitypes_h = yes; then
+ HAVE_SYS_BITYPES_H=1
+ fi
+ gl_STDINT_TYPE_PROPERTIES
+ ;;
+ esac
+
+ dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
+ gl_REPLACE_LIMITS_H
+
+ AC_SUBST([HAVE_C99_STDINT_H])
+ AC_SUBST([HAVE_SYS_BITYPES_H])
+ AC_SUBST([HAVE_SYS_INTTYPES_H])
+])
+
+dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
+dnl Determine the size of each of the given types in bits.
+AC_DEFUN([gl_STDINT_BITSIZEOF],
+[
+ dnl Use a shell loop, to avoid bloating configure, and
+ dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+ dnl config.h.in,
+ dnl - extra AC_SUBST calls, so that the right substitutions are made.
+ m4_foreach_w([gltype], [$1],
+ [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [Define to the number of bits in type ']gltype['.])])
+ for gltype in $1 ; do
+ AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
+ [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT],
+ [$2
+#include <limits.h>], [result=unknown])
+ eval gl_cv_bitsizeof_${gltype}=\$result
+ ])
+ eval result=\$gl_cv_bitsizeof_${gltype}
+ if test $result = unknown; then
+ dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
+ dnl do a syntax check even on unused #if conditions and give an error
+ dnl on valid C code like this:
+ dnl #if 0
+ dnl # if > 32
+ dnl # endif
+ dnl #endif
+ result=0
+ fi
+ GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
+ eval BITSIZEOF_${GLTYPE}=\$result
+ done
+ m4_foreach_w([gltype], [$1],
+ [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+])
+
+dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
+dnl Determine the signedness of each of the given types.
+dnl Define HAVE_SIGNED_TYPE if type is signed.
+AC_DEFUN([gl_CHECK_TYPES_SIGNED],
+[
+ dnl Use a shell loop, to avoid bloating configure, and
+ dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+ dnl config.h.in,
+ dnl - extra AC_SUBST calls, so that the right substitutions are made.
+ m4_foreach_w([gltype], [$1],
+ [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [Define to 1 if ']gltype[' is a signed integer type.])])
+ for gltype in $1 ; do
+ AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([$2[
+ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])],
+ result=yes, result=no)
+ eval gl_cv_type_${gltype}_signed=\$result
+ ])
+ eval result=\$gl_cv_type_${gltype}_signed
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ if test "$result" = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1])
+ eval HAVE_SIGNED_${GLTYPE}=1
+ else
+ eval HAVE_SIGNED_${GLTYPE}=0
+ fi
+ done
+ m4_foreach_w([gltype], [$1],
+ [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+])
+
+dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
+dnl Determine the suffix to use for integer constants of the given types.
+dnl Define t_SUFFIX for each such type.
+AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
+[
+ dnl Use a shell loop, to avoid bloating configure, and
+ dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
+ dnl config.h.in,
+ dnl - extra AC_SUBST calls, so that the right substitutions are made.
+ m4_foreach_w([gltype], [$1],
+ [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
+ [Define to l, ll, u, ul, ull, etc., as suitable for
+ constants of type ']gltype['.])])
+ for gltype in $1 ; do
+ AC_CACHE_CHECK([for $gltype integer literal suffix],
+ [gl_cv_type_${gltype}_suffix],
+ [eval gl_cv_type_${gltype}_suffix=no
+ eval result=\$gl_cv_type_${gltype}_signed
+ if test "$result" = yes; then
+ glsufu=
+ else
+ glsufu=u
+ fi
+ for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+ case $glsuf in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ i64) gltype1='__int64';;
+ u) gltype1='unsigned int';;
+ ul) gltype1='unsigned long int';;
+ ull) gltype1='unsigned long long int';;
+ ui64)gltype1='unsigned __int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([$2[
+ extern $gltype foo;
+ extern $gltype1 foo;]])],
+ [eval gl_cv_type_${gltype}_suffix=\$glsuf])
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" != no && break
+ done])
+ GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+ eval result=\$gl_cv_type_${gltype}_suffix
+ test "$result" = no && result=
+ eval ${GLTYPE}_SUFFIX=\$result
+ AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
+ done
+ m4_foreach_w([gltype], [$1],
+ [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
+])
+
+dnl gl_STDINT_INCLUDES
+AC_DEFUN([gl_STDINT_INCLUDES],
+[[
+ #include <stddef.h>
+ #include <signal.h>
+ #if HAVE_WCHAR_H
+ # include <wchar.h>
+ #endif
+]])
+
+dnl gl_STDINT_TYPE_PROPERTIES
+dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
+dnl of interest to stdint.in.h.
+AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
+[
+ AC_REQUIRE([gl_MULTIARCH])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
+ [gl_STDINT_INCLUDES])
+ gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
+ [gl_STDINT_INCLUDES])
+ gl_cv_type_ptrdiff_t_signed=yes
+ gl_cv_type_size_t_signed=no
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
+ [gl_STDINT_INCLUDES])
+ fi
+ gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
+ [gl_STDINT_INCLUDES])
+
+ dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99
+ dnl requirement that wint_t is "unchanged by default argument promotions".
+ dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
+ dnl Set the variable BITSIZEOF_WINT_T accordingly.
+ if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+ BITSIZEOF_WINT_T=32
+ fi
+])
diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
new file mode 100644
index 0000000..70349f6
--- /dev/null
+++ b/gl/m4/stdint_h.m4
@@ -0,0 +1,27 @@
+# stdint_h.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ #include <stdint.h>]],
+ [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+ [gl_cv_header_stdint_h=yes],
+ [gl_cv_header_stdint_h=no])])
+ if test $gl_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
+ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
new file mode 100644
index 0000000..94271e1
--- /dev/null
+++ b/gl/m4/stdio_h.m4
@@ -0,0 +1,225 @@
+# stdio_h.m4 serial 59
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_STDIO_H],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AH_VERBATIM([MINGW_ANSI_STDIO],
+[/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+])
+ AC_DEFINE([__USE_MINGW_ANSI_STDIO])
+ gl_NEXT_HEADERS([stdio.h])
+
+ dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
+ dnl inttypes.h behave like gnu instead of system; we must give our
+ dnl printf wrapper the right attribute to match.
+ AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros],
+ [gl_cv_func_printf_attribute_flavor],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #define __STDC_FORMAT_MACROS 1
+ #include <stdio.h>
+ #include <inttypes.h>
+ /* For non-mingw systems, compilation will trivially succeed.
+ For mingw, compilation will succeed for older mingw (system
+ printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
+ #if (defined _WIN32 && ! defined __CYGWIN__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
+ #endif
+ ]])], [gl_cv_func_printf_attribute_flavor=system],
+ [gl_cv_func_printf_attribute_flavor=gnu])])
+ if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
+ AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1],
+ [Define to 1 if printf and friends should be labeled with
+ attribute "__gnu_printf__" instead of "__printf__"])
+ fi
+
+ dnl This ifdef is an optimization, to avoid performing a configure check whose
+ dnl result is not used. But it does not make the test of
+ dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_READ_FUNCS=1
+ fi
+ ])
+
+ dnl This ifdef is an optimization, to avoid performing a configure check whose
+ dnl result is not used. But it does not make the test of
+ dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
+ m4_ifdef([gl_SIGNAL_SIGPIPE], [
+ gl_SIGNAL_SIGPIPE
+ if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ fi
+ ])
+ dnl This ifdef is an optimization, to avoid performing a configure check whose
+ dnl result is not used. But it does not make the test of
+ dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ fi
+ ])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by both C89 and C11.
+ gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
+ ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
+ renameat snprintf tmpfile vdprintf vsnprintf])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([fcloseall])
+ if test $ac_cv_have_decl_fcloseall = no; then
+ HAVE_DECL_FCLOSEALL=0
+ fi
+])
+
+# gl_STDIO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STDIO_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPURGE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREOPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEKO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLINE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PCLOSE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PERROR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTCHAR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMOVE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FILENO], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETW], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTW], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TEMPNAM], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STDIO_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_FCLOSEALL=1; AC_SUBST([HAVE_DECL_FCLOSEALL])
+ HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
+ HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
+ HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
+ HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
+ HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
+ HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
+ HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
+ HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
+ HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
+ HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
+ HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
+ HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE])
+ HAVE_POPEN=1; AC_SUBST([HAVE_POPEN])
+ HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT])
+ HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
+ HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
+ REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
+ REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
+ REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN])
+ REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
+ REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
+ REPLACE_FOPEN_FOR_FOPEN_GNU=0; AC_SUBST([REPLACE_FOPEN_FOR_FOPEN_GNU])
+ REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
+ REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE])
+ REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
+ REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
+ REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
+ REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
+ REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
+ REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM])
+ REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
+ REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
+ REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
+ REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN])
+ REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
+ REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE])
+ REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME])
+ REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT])
+ REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
+ REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
+ REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS])
+ REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
+ REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE])
+ REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
+ REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF])
+ REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
+ REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
+ REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
+ REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
+])
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
new file mode 100644
index 0000000..e96be22
--- /dev/null
+++ b/gl/m4/stdlib_h.m4
@@ -0,0 +1,200 @@
+# stdlib_h.m4 serial 66
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_STDLIB_H],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ gl_NEXT_HEADERS([stdlib.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+# include <sys/time.h>
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+ ]], [_Exit aligned_alloc atoll canonicalize_file_name free
+ getloadavg getsubopt grantpt
+ initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
+ posix_memalign posix_openpt ptsname ptsname_r qsort_r
+ random random_r reallocarray realpath rpmatch secure_getenv setenv
+ setstate setstate_r srandom srandom_r
+ strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([ecvt])
+ if test $ac_cv_have_decl_ecvt = no; then
+ HAVE_DECL_ECVT=0
+ fi
+ AC_CHECK_DECLS_ONCE([fcvt])
+ if test $ac_cv_have_decl_fcvt = no; then
+ HAVE_DECL_FCVT=0
+ fi
+ AC_CHECK_DECLS_ONCE([gcvt])
+ if test $ac_cv_have_decl_gcvt = no; then
+ HAVE_DECL_GCVT=0
+ fi
+])
+
+# gl_STDLIB_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB__EXIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALIGNED_ALLOC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATOLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMPS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMPS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_MEMALIGN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_OPENPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALPATH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOULL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYSTEM_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLOCKPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNSETENV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOMB])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ECVT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCVT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GCVT], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKTEMP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTENV], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STDLIB_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE__EXIT=1; AC_SUBST([HAVE__EXIT])
+ HAVE_ALIGNED_ALLOC=1; AC_SUBST([HAVE_ALIGNED_ALLOC])
+ HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
+ HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
+ HAVE_DECL_ECVT=1; AC_SUBST([HAVE_DECL_ECVT])
+ HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT])
+ HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT])
+ HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
+ HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
+ HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
+ HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE])
+ HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE])
+ HAVE_MBTOWC=1; AC_SUBST([HAVE_MBTOWC])
+ HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
+ HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
+ HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
+ HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
+ HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
+ HAVE_POSIX_MEMALIGN=1; AC_SUBST([HAVE_POSIX_MEMALIGN])
+ HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
+ HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
+ HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R])
+ HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R])
+ HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM])
+ HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
+ HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
+ HAVE_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY])
+ HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
+ HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
+ HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
+ HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
+ HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
+ HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
+ HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
+ HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
+ HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL])
+ HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD])
+ HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
+ HAVE_STRTOUL=1; AC_SUBST([HAVE_STRTOUL])
+ HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
+ HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
+ HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
+ HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
+ HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
+ REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
+ REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU])
+ REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX])
+ REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+ REPLACE_FREE=0; AC_SUBST([REPLACE_FREE])
+ REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE])
+ REPLACE_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU])
+ REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX])
+ REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
+ REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
+ REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
+ REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
+ REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
+ REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
+ REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
+ REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM])
+ REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
+ REPLACE_REALLOC_FOR_REALLOC_GNU=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU])
+ REPLACE_REALLOC_FOR_REALLOC_POSIX=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_POSIX])
+ REPLACE_REALLOCARRAY=0; AC_SUBST([REPLACE_REALLOCARRAY])
+ REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
+ REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
+ REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE])
+ REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
+ REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL])
+ REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD])
+ REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL])
+ REPLACE_STRTOUL=0; AC_SUBST([REPLACE_STRTOUL])
+ REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL])
+ REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
+ REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
+])
diff --git a/gl/m4/strcase.m4 b/gl/m4/strcase.m4
new file mode 100644
index 0000000..3cf740d
--- /dev/null
+++ b/gl/m4/strcase.m4
@@ -0,0 +1,45 @@
+# strcase.m4 serial 12
+dnl Copyright (C) 2002, 2005-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_STRCASE],
+[
+ gl_FUNC_STRCASECMP
+ gl_FUNC_STRNCASECMP
+])
+
+AC_DEFUN([gl_FUNC_STRCASECMP],
+[
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+ AC_CHECK_FUNCS([strcasecmp])
+ if test $ac_cv_func_strcasecmp = no; then
+ HAVE_STRCASECMP=0
+ fi
+])
+
+AC_DEFUN([gl_FUNC_STRNCASECMP],
+[
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+ AC_CHECK_FUNCS([strncasecmp])
+ if test $ac_cv_func_strncasecmp = yes; then
+ HAVE_STRNCASECMP=1
+ else
+ HAVE_STRNCASECMP=0
+ fi
+ AC_CHECK_DECLS([strncasecmp])
+ if test $ac_cv_have_decl_strncasecmp = no; then
+ HAVE_DECL_STRNCASECMP=0
+ fi
+])
+
+# Prerequisites of lib/strcasecmp.c.
+AC_DEFUN([gl_PREREQ_STRCASECMP], [
+ :
+])
+
+# Prerequisites of lib/strncasecmp.c.
+AC_DEFUN([gl_PREREQ_STRNCASECMP], [
+ :
+])
diff --git a/gl/m4/strcasestr.m4 b/gl/m4/strcasestr.m4
new file mode 100644
index 0000000..971e0b2
--- /dev/null
+++ b/gl/m4/strcasestr.m4
@@ -0,0 +1,155 @@
+# strcasestr.m4 serial 28
+dnl Copyright (C) 2005, 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check that strcasestr is present and works.
+AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+
+ dnl Persuade glibc <string.h> to declare strcasestr().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_FUNC_MEMCHR])
+ AC_CHECK_FUNCS([strcasestr])
+ if test $ac_cv_func_strcasestr = no; then
+ HAVE_STRCASESTR=0
+ else
+ if test $REPLACE_MEMCHR = 1; then
+ REPLACE_STRCASESTR=1
+ else
+ dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092
+ dnl and https://sourceware.org/bugzilla/show_bug.cgi?id=23637.
+ AC_CACHE_CHECK([whether strcasestr works],
+ [gl_cv_func_strcasestr_works_always],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <string.h> /* for __GNU_LIBRARY__, strcasestr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+ Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+]],
+ [[return !!strcasestr (HAYSTACK, NEEDLE);
+ ]])],
+ [gl_cv_func_strcasestr_works_always=yes],
+ [gl_cv_func_strcasestr_works_always=no],
+ [dnl glibc 2.12 and cygwin 1.7.7 have a known bug. uClibc is not
+ dnl affected, since it uses different source code for strcasestr
+ dnl than glibc.
+ dnl Assume that it works on all other platforms, even if it is not
+ dnl linear.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <string.h> /* for __GNU_LIBRARY__ */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
+ Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+ ],
+ [gl_cv_func_strcasestr_works_always="guessing yes"],
+ [gl_cv_func_strcasestr_works_always="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_strcasestr_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_STRCASESTR=1
+ ;;
+ esac
+ fi
+ fi
+]) # gl_FUNC_STRCASESTR_SIMPLE
+
+dnl Additionally, check that strcasestr is efficient.
+AC_DEFUN([gl_FUNC_STRCASESTR],
+[
+ AC_REQUIRE([gl_FUNC_STRCASESTR_SIMPLE])
+ if test $HAVE_STRCASESTR = 1 && test $REPLACE_STRCASESTR = 0; then
+ AC_CACHE_CHECK([whether strcasestr works in linear time],
+ [gl_cv_func_strcasestr_linear],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <signal.h> /* for signal */
+#include <string.h> /* for strcasestr */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for alarm */
+static void quit (int sig) { _exit (sig + 128); }
+]], [[
+ int result = 0;
+ size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 2);
+ char *needle = (char *) malloc (m + 2);
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also lack strcasestr. */
+ signal (SIGALRM, quit);
+ alarm (5);
+ /* Check for quadratic performance. */
+ if (haystack && needle)
+ {
+ memset (haystack, 'A', 2 * m);
+ haystack[2 * m] = 'B';
+ haystack[2 * m + 1] = 0;
+ memset (needle, 'A', m);
+ needle[m] = 'B';
+ needle[m + 1] = 0;
+ if (!strcasestr (haystack, needle))
+ result |= 1;
+ }
+ /* Free allocated memory, in case some sanitizer is watching. */
+ free (haystack);
+ free (needle);
+ return result;
+ ]])],
+ [gl_cv_func_strcasestr_linear=yes], [gl_cv_func_strcasestr_linear=no],
+ [dnl Only glibc > 2.12 and cygwin > 1.7.7 are known to have a
+ dnl strcasestr that works in linear time.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ && !defined __UCLIBC__
+ Lucky user
+ #endif
+#endif
+#ifdef __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#endif
+ ],
+ [gl_cv_func_strcasestr_linear="guessing yes"],
+ [gl_cv_func_strcasestr_linear="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_strcasestr_linear" in
+ *yes) ;;
+ *)
+ REPLACE_STRCASESTR=1
+ ;;
+ esac
+ fi
+]) # gl_FUNC_STRCASESTR
+
+# Prerequisites of lib/strcasestr.c.
+AC_DEFUN([gl_PREREQ_STRCASESTR], [
+ :
+])
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
new file mode 100644
index 0000000..8879eb0
--- /dev/null
+++ b/gl/m4/strerror.m4
@@ -0,0 +1,102 @@
+# strerror.m4 serial 23
+dnl Copyright (C) 2002, 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRERROR],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+ AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+ ])
+ if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then
+ AC_CACHE_CHECK([for working strerror function],
+ [gl_cv_func_working_strerror],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ ]],
+ [[if (!*strerror (-2)) return 1;]])],
+ [gl_cv_func_working_strerror=yes],
+ [gl_cv_func_working_strerror=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_working_strerror" in
+ *yes) ;;
+ *)
+ dnl The system's strerror() fails to return a string for out-of-range
+ dnl integers. Replace it.
+ REPLACE_STRERROR=1
+ ;;
+ esac
+ m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+ dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
+ dnl buffer, we must replace strerror.
+ case "$gl_cv_func_strerror_r_works" in
+ *no) REPLACE_STRERROR=1 ;;
+ esac
+ ])
+ else
+ dnl The system's strerror() cannot know about the new errno values we add
+ dnl to <errno.h>, or any fix for strerror(0). Replace it.
+ REPLACE_STRERROR=1
+ fi
+])
+
+dnl Detect if strerror(0) passes (that is, does not set errno, and does not
+dnl return a string that matches strerror(-1)).
+AC_DEFUN([gl_FUNC_STRERROR_0],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ REPLACE_STRERROR_0=0
+ AC_CACHE_CHECK([whether strerror(0) succeeds],
+ [gl_cv_func_strerror_0_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ #include <errno.h>
+ ]],
+ [[int result = 0;
+ char *str;
+ errno = 0;
+ str = strerror (0);
+ if (!*str) result |= 1;
+ if (errno) result |= 2;
+ if (strstr (str, "nknown") || strstr (str, "ndefined"))
+ result |= 4;
+ return result;]])],
+ [gl_cv_func_strerror_0_works=yes],
+ [gl_cv_func_strerror_0_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_strerror_0_works" in
+ *yes) ;;
+ *)
+ REPLACE_STRERROR_0=1
+ AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
+ does not return a message implying success.])
+ ;;
+ esac
+])
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
new file mode 100644
index 0000000..5da3cc2
--- /dev/null
+++ b/gl/m4/string_h.m4
@@ -0,0 +1,148 @@
+# Configure a GNU-like replacement for <string.h>.
+
+# Copyright (C) 2007-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 35
+
+# Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_STRING_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ gl_NEXT_HEADERS([string.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <string.h>
+ ]],
+ [explicit_bzero ffsl ffsll memmem mempcpy memrchr memset_explicit
+ rawmemchr stpcpy stpncpy strchrnul
+ strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+ strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# gl_STRING_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STRING_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPLICIT_BZERO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMMEM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMRCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMSET_EXPLICIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAWMEMCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCHRNUL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRDUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNDUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPBRK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASESTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPBRK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGABBREV_NP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGDESCR_NP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSIGNAL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRVERSCMP])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MEMCCPY], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_STRDUP], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS])
+ dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized.
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STRING_H_DEFAULTS],
+[
+ HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO])
+ HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
+ HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
+ HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
+ HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
+ HAVE_MEMSET_EXPLICIT=1; AC_SUBST([HAVE_MEMSET_EXPLICIT])
+ HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
+ HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
+ HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
+ HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY])
+ HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL])
+ HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP])
+ HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP])
+ HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN])
+ HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK])
+ HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP])
+ HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
+ HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
+ HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R])
+ HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP])
+ HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP])
+ HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP])
+ HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
+ HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
+ REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL])
+ REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
+ REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
+ REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
+ REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
+ REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
+ REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
+ REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
+ REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
+ REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
+ REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
+ REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
+ REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
+ REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
+ REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP])
+ REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
+ UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
+])
diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4
new file mode 100644
index 0000000..4c41221
--- /dev/null
+++ b/gl/m4/strings_h.m4
@@ -0,0 +1,62 @@
+# Configure a replacement for <strings.h>.
+# serial 9
+
+# Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_STRINGS_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+
+ gl_CHECK_NEXT_HEADERS([strings.h])
+ if test $ac_cv_header_strings_h = yes; then
+ HAVE_STRINGS_H=1
+ else
+ HAVE_STRINGS_H=0
+ fi
+ AC_SUBST([HAVE_STRINGS_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+ /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
+ <strings.h>. */
+ #include <sys/types.h>
+ #include <strings.h>
+ ]], [ffs strcasecmp strncasecmp])
+])
+
+# gl_STRINGS_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_STRINGS_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STRINGS_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFS])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_STRINGS_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STRINGS_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FFS=1; AC_SUBST([HAVE_FFS])
+ HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP])
+ HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP])
+])
diff --git a/gl/m4/strsep.m4 b/gl/m4/strsep.m4
new file mode 100644
index 0000000..e0da09a
--- /dev/null
+++ b/gl/m4/strsep.m4
@@ -0,0 +1,23 @@
+# strsep.m4 serial 11
+dnl Copyright (C) 2002-2004, 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRSEP],
+[
+ dnl Persuade glibc <string.h> to declare strsep().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl The strsep() declaration in lib/string.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([strsep])
+ if test $ac_cv_func_strsep = no; then
+ HAVE_STRSEP=0
+ fi
+])
+
+# Prerequisites of lib/strsep.c.
+AC_DEFUN([gl_PREREQ_STRSEP], [:])
diff --git a/gl/m4/strstr.m4 b/gl/m4/strstr.m4
new file mode 100644
index 0000000..7de203a
--- /dev/null
+++ b/gl/m4/strstr.m4
@@ -0,0 +1,149 @@
+# strstr.m4 serial 24
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check that strstr works.
+AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
+[
+ AC_REQUIRE([gl_STRING_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MEMCHR])
+ if test $REPLACE_MEMCHR = 1; then
+ REPLACE_STRSTR=1
+ else
+ dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092
+ dnl and https://sourceware.org/bugzilla/show_bug.cgi?id=23637.
+ AC_CACHE_CHECK([whether strstr works],
+ [gl_cv_func_strstr_works_always],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <string.h> /* for __GNU_LIBRARY__, strstr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+ Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+]],
+ [[return !!strstr (HAYSTACK, NEEDLE);
+ ]])],
+ [gl_cv_func_strstr_works_always=yes],
+ [gl_cv_func_strstr_works_always=no],
+ [dnl glibc 2.12 and cygwin 1.7.7 have a known bug. uClibc is not
+ dnl affected, since it uses different source code for strstr than
+ dnl glibc.
+ dnl Assume that it works on all other platforms, even if it is not
+ dnl linear.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <string.h> /* for __GNU_LIBRARY__ */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ || defined __UCLIBC__
+ Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+ ],
+ [gl_cv_func_strstr_works_always="guessing yes"],
+ [gl_cv_func_strstr_works_always="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_strstr_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_STRSTR=1
+ ;;
+ esac
+ fi
+]) # gl_FUNC_STRSTR_SIMPLE
+
+dnl Additionally, check that strstr is efficient.
+AC_DEFUN([gl_FUNC_STRSTR],
+[
+ AC_REQUIRE([gl_FUNC_STRSTR_SIMPLE])
+ if test $REPLACE_STRSTR = 0; then
+ AC_CACHE_CHECK([whether strstr works in linear time],
+ [gl_cv_func_strstr_linear],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#ifdef __MVS__
+/* z/OS does not deliver signals while strstr() is running (thanks to
+ restrictions on its LE runtime), which prevents us from limiting the
+ running time of this test. */
+# error "This test does not work properly on z/OS"
+#endif
+#include <signal.h> /* for signal */
+#include <string.h> /* for strstr */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for alarm */
+static void quit (int sig) { _exit (sig + 128); }
+]], [[
+ int result = 0;
+ size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 2);
+ char *needle = (char *) malloc (m + 2);
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also have quadratic strstr. */
+ signal (SIGALRM, quit);
+ alarm (5);
+ /* Check for quadratic performance. */
+ if (haystack && needle)
+ {
+ memset (haystack, 'A', 2 * m);
+ haystack[2 * m] = 'B';
+ haystack[2 * m + 1] = 0;
+ memset (needle, 'A', m);
+ needle[m] = 'B';
+ needle[m + 1] = 0;
+ if (!strstr (haystack, needle))
+ result |= 1;
+ }
+ /* Free allocated memory, in case some sanitizer is watching. */
+ free (haystack);
+ free (needle);
+ return result;
+ ]])],
+ [gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no],
+ [dnl Only glibc > 2.12 on processors without SSE 4.2 instructions and
+ dnl cygwin > 1.7.7 are known to have a bug-free strstr that works in
+ dnl linear time.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ && !(defined __i386__ || defined __x86_64__) \
+ && !defined __UCLIBC__
+ Lucky user
+ #endif
+#endif
+#ifdef __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+ Lucky user
+ #endif
+#endif
+ ],
+ [gl_cv_func_strstr_linear="guessing yes"],
+ [gl_cv_func_strstr_linear="$gl_cross_guess_normal"])
+ ])
+ ])
+ case "$gl_cv_func_strstr_linear" in
+ *yes) ;;
+ *)
+ REPLACE_STRSTR=1
+ ;;
+ esac
+ fi
+]) # gl_FUNC_STRSTR
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
new file mode 100644
index 0000000..98a1041
--- /dev/null
+++ b/gl/m4/sys_socket_h.m4
@@ -0,0 +1,206 @@
+# sys_socket_h.m4 serial 29
+dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson.
+
+AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+ dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+ dnl unless _POSIX_PII_SOCKET is defined.
+ case "$host_os" in
+ osf*)
+ AC_DEFINE([_POSIX_PII_SOCKET], [1],
+ [Define to 1 in order to get the POSIX compatible declarations
+ of socket functions.])
+ ;;
+ esac
+
+ GL_GENERATE_SYS_SOCKET_H=false
+ AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+ [gl_cv_header_sys_socket_h_selfcontained],
+ [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
+ [gl_cv_header_sys_socket_h_selfcontained=yes],
+ [gl_cv_header_sys_socket_h_selfcontained=no])
+ ])
+ if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+ dnl If the shutdown function exists, <sys/socket.h> should define
+ dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+ AC_CHECK_FUNCS([shutdown])
+ if test $ac_cv_func_shutdown = yes; then
+ AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+ [gl_cv_header_sys_socket_h_shut],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+ [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+ [gl_cv_header_sys_socket_h_shut=yes],
+ [gl_cv_header_sys_socket_h_shut=no])
+ ])
+ if test $gl_cv_header_sys_socket_h_shut = no; then
+ GL_GENERATE_SYS_SOCKET_H=true
+ fi
+ fi
+ fi
+ # We need to check for ws2tcpip.h now.
+ gl_PREREQ_SYS_H_SOCKET
+ AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+ if test $ac_cv_type_struct_sockaddr_storage = no; then
+ HAVE_STRUCT_SOCKADDR_STORAGE=0
+ fi
+ if test $ac_cv_type_sa_family_t = no; then
+ HAVE_SA_FAMILY_T=0
+ fi
+ if test $ac_cv_type_struct_sockaddr_storage != no; then
+ AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+ [],
+ [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+ [#include <sys/types.h>
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #ifdef HAVE_WS2TCPIP_H
+ #include <ws2tcpip.h>
+ #endif
+ ])
+ fi
+ if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+ GL_GENERATE_SYS_SOCKET_H=true
+ fi
+ gl_PREREQ_SYS_H_WINSOCK2
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers. */
+#include <sys/types.h>
+#include <sys/socket.h>
+ ]], [socket connect accept bind getpeername getsockname getsockopt
+ listen recv send recvfrom sendto setsockopt shutdown accept4])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+[
+ dnl Check prerequisites of the <sys/socket.h> replacement.
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ gl_CHECK_NEXT_HEADERS([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_SYS_SOCKET_H=1
+ else
+ HAVE_SYS_SOCKET_H=0
+ fi
+ AC_SUBST([HAVE_SYS_SOCKET_H])
+ gl_PREREQ_SYS_H_WS2TCPIP
+])
+
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <sys/select.h> replacement.
+# Sets and substitutes HAVE_WINSOCK2_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
+[
+ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+ m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+ AC_CHECK_HEADERS_ONCE([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h != yes; then
+ dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+ dnl the check for those headers unconditional; yet cygwin reports
+ dnl that the headers are present but cannot be compiled (since on
+ dnl cygwin, all socket information should come from sys/socket.h).
+ AC_CHECK_HEADERS([winsock2.h])
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+ AC_SUBST([HAVE_WINSOCK2_H])
+])
+
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <arpa/inet.h> replacement.
+# Sets and substitutes HAVE_WS2TCPIP_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
+[
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_WS2TCPIP_H=0
+ else
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+ AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
+# gl_SYS_SOCKET_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_SOCKET_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_SOCKET_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SOCKET])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CONNECT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BIND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPEERNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LISTEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SEND])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECVFROM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SENDTO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETSOCKOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SHUTDOWN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT4])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
+[
+ HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+ AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
+ HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T])
+ HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4])
+])
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
new file mode 100644
index 0000000..ca57398
--- /dev/null
+++ b/gl/m4/sys_stat_h.m4
@@ -0,0 +1,129 @@
+# sys_stat_h.m4 serial 42 -*- Autoconf -*-
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Eric Blake.
+dnl Provide a GNU-like <sys/stat.h>.
+
+AC_DEFUN_ONCE([gl_SYS_STAT_H],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
+ dnl Check for broken stat macros.
+ AC_REQUIRE([AC_HEADER_STAT])
+
+ gl_CHECK_NEXT_HEADERS([sys/stat.h])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Whether to enable precise timestamps in 'struct stat'.
+ m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [
+ AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC])
+ ], [
+ WINDOWS_STAT_TIMESPEC=0
+ ])
+ AC_SUBST([WINDOWS_STAT_TIMESPEC])
+
+ dnl Whether to ensure that struct stat.st_size is 64-bit wide.
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([gl_LARGEFILE])
+ ], [
+ WINDOWS_64_BIT_ST_SIZE=0
+ ])
+ AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
+
+ dnl Define types that are supposed to be defined in <sys/types.h> or
+ dnl <sys/stat.h>.
+ AC_CHECK_TYPE([nlink_t], [],
+ [AC_DEFINE([nlink_t], [int],
+ [Define to the type of st_nlink in struct stat, or a supertype.])],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
+ ]], [chmod fchmodat fstat fstatat futimens getumask lchmod lstat
+ mkdirat mkfifo mkfifoat mknod mknodat stat utimensat])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# gl_SYS_STAT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_STAT_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_STAT_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHMOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHMODAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTATAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FUTIMENS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUMASK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHMOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSTAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIRAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFO])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFOAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNOD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNODAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIMENSAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_STRUCT_STAT])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHMOD], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKDIR], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UMASK], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT])
+ HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT])
+ HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS])
+ HAVE_GETUMASK=1; AC_SUBST([HAVE_GETUMASK])
+ HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD])
+ HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT])
+ HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT])
+ HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO])
+ HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT])
+ HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
+ HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
+ HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
+ REPLACE_CHMOD=0; AC_SUBST([REPLACE_CHMOD])
+ REPLACE_FCHMODAT=0; AC_SUBST([REPLACE_FCHMODAT])
+ REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
+ REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
+ REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
+ REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
+ REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
+ REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO])
+ REPLACE_MKFIFOAT=0; AC_SUBST([REPLACE_MKFIFOAT])
+ REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD])
+ REPLACE_MKNODAT=0; AC_SUBST([REPLACE_MKNODAT])
+ REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
+ REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT])
+])
diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4
new file mode 100644
index 0000000..627671f
--- /dev/null
+++ b/gl/m4/sys_types_h.m4
@@ -0,0 +1,70 @@
+# sys_types_h.m4 serial 13
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_TYPES_H],
+[
+ AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+
+ dnl Use sane struct stat types in OpenVMS 8.2 and later.
+ AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.])
+
+ gl_NEXT_HEADERS([sys/types.h])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Whether to override the 'off_t' type.
+ AC_REQUIRE([gl_TYPE_OFF_T])
+
+ dnl Whether to override the 'dev_t' and 'ino_t' types.
+ m4_ifdef([gl_WINDOWS_STAT_INODES], [
+ AC_REQUIRE([gl_WINDOWS_STAT_INODES])
+ ], [
+ WINDOWS_STAT_INODES=0
+ ])
+ AC_SUBST([WINDOWS_STAT_INODES])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_TYPES_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS], [
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
+[
+])
+
+# This works around a buggy version in autoconf <= 2.69.
+# See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
+# The 2.70 version isn't quoted properly, so override it too.
+
+m4_version_prereq([2.70.1], [], [
+
+m4_undefine([AC_HEADER_MAJOR])
+AC_DEFUN([AC_HEADER_MAJOR],
+[AC_CHECK_HEADERS_ONCE([sys/types.h])
+AC_CHECK_HEADER([sys/mkdev.h],
+ [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+ [Define to 1 if `major', `minor', and `makedev' are
+ declared in <mkdev.h>.])])
+if test $ac_cv_header_sys_mkdev_h = no; then
+ AC_CHECK_HEADER([sys/sysmacros.h],
+ [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+ [Define to 1 if `major', `minor', and `makedev'
+ are declared in <sysmacros.h>.])])
+fi
+])# AC_HEADER_MAJOR
+
+])
diff --git a/gl/m4/sys_uio_h.m4 b/gl/m4/sys_uio_h.m4
new file mode 100644
index 0000000..93a65d2
--- /dev/null
+++ b/gl/m4/sys_uio_h.m4
@@ -0,0 +1,46 @@
+# sys_uio_h.m4 serial 3
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_UIO_H],
+[
+ AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS])
+ dnl <sys/uio.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/uio.h])
+ if test $ac_cv_header_sys_uio_h = yes; then
+ HAVE_SYS_UIO_H=1
+ else
+ HAVE_SYS_UIO_H=0
+ fi
+ AC_SUBST([HAVE_SYS_UIO_H])
+])
+
+# gl_SYS_UIO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_SYS_UIO_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_UIO_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS], [
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_UIO_H_DEFAULTS],
+[
+])
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
new file mode 100644
index 0000000..b536b04
--- /dev/null
+++ b/gl/m4/threadlib.m4
@@ -0,0 +1,666 @@
+# threadlib.m4 serial 32a
+dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.60])
+
+dnl The general structure of the multithreading modules in gnulib is that we
+dnl have three set of modules:
+dnl
+dnl * POSIX API:
+dnl pthread, which combines
+dnl pthread-h
+dnl pthread-thread
+dnl pthread-once
+dnl pthread-mutex
+dnl pthread-rwlock
+dnl pthread-cond
+dnl pthread-tss
+dnl pthread-spin
+dnl sched_yield
+dnl
+dnl * ISO C API:
+dnl threads, which combines
+dnl threads-h
+dnl thrd
+dnl mtx
+dnl cnd
+dnl tss
+dnl
+dnl * Gnulib API, with an implementation that can be chosen at configure
+dnl time through the option --enable-threads=...
+dnl thread
+dnl lock
+dnl cond
+dnl tls
+dnl yield
+dnl
+dnl They are independent, except for the fact that
+dnl - the implementation of the ISO C API may use the POSIX (or some other
+dnl platform dependent) API,
+dnl - the implementation of the Gnulib API may use the POSIX or ISO C or
+dnl some other platform dependent API, depending on the --enable-threads
+dnl option.
+dnl
+dnl This file contains macros for all of these APIs!
+
+dnl ============================================================================
+dnl Macros for all thread APIs
+
+AC_DEFUN([gl_ANYTHREADLIB_EARLY],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_anythreadlib_early_done"; then
+ case "$host_os" in
+ osf*)
+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+ # groks <pthread.h>. cc also understands the flag -pthread, but
+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
+ # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ # Some systems optimize for single-threaded programs by default, and
+ # need special flags to disable these optimizations. For example, the
+ # definition of 'errno' in <errno.h>.
+ case "$host_os" in
+ aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+ solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+ esac
+ gl_anythreadlib_early_done=done
+ fi
+])
+
+dnl Checks whether the compiler and linker support weak declarations of symbols.
+
+AC_DEFUN([gl_WEAK_SYMBOLS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether imported symbols can be declared weak],
+ [gl_cv_have_weak],
+ [case "$host_os" in
+ cygwin*)
+ dnl On Cygwin 3.2.0 with gcc 10.2, the test below would succeed, but
+ dnl programs that use pthread_in_use() with weak symbol references
+ dnl crash miserably at runtime.
+ gl_cv_have_weak="guessing no"
+ ;;
+ *)
+ gl_cv_have_weak=no
+ dnl First, test whether the compiler accepts it syntactically.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern void xyzzy ();
+#pragma weak xyzzy]],
+ [[xyzzy();]])],
+ [gl_cv_have_weak=maybe])
+ if test $gl_cv_have_weak = maybe; then
+ dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+ dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}]])],
+ [gl_cv_have_weak=yes],
+ [gl_cv_have_weak=no],
+ [dnl When cross-compiling, assume that only ELF platforms support
+ dnl weak symbols.
+ AC_EGREP_CPP([Extensible Linking Format],
+ [#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_have_weak="guessing yes"],
+ [gl_cv_have_weak="guessing no"])
+ ])
+ fi
+ ;;
+ esac
+ dnl But when linking statically, weak symbols don't work.
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ dnl Test for a bug in FreeBSD 11: A link error occurs when using a weak
+ dnl symbol and linking against a shared library that has a dependency on
+ dnl the shared library that defines the symbol.
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&AS_MESSAGE_LOG_FD 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+ ])
+ case "$gl_cv_have_weak" in
+ *yes)
+ AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
+ [Define to 1 if the compiler and linker support weak declarations of symbols.])
+ ;;
+ esac
+])
+
+dnl ============================================================================
+dnl Macros for the POSIX API
+
+dnl gl_PTHREADLIB
+dnl -------------
+dnl Tests for the libraries needs for using the POSIX threads API.
+dnl Sets the variable LIBPTHREAD to the linker options for use in a Makefile.
+dnl Sets the variable LIBPMULTITHREAD, for programs that really need
+dnl multithread functionality. The difference between LIBPTHREAD and
+dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
+dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
+dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl sched_yield() function.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_PTHREAD_API if (at least parts of) the POSIX
+dnl threads API is available.
+
+dnl The guts of gl_PTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_PTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ if test -z "$gl_pthreadlib_body_done"; then
+ gl_pthread_api=no
+ LIBPTHREAD=
+ LIBPMULTITHREAD=
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+ AC_CHECK_HEADER([pthread.h],
+ [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ #
+ # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+ # needs -pthread for some reason. See:
+ # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+ save_LIBS=$LIBS
+ for gl_pthread in '' '-pthread'; do
+ LIBS="$LIBS $gl_pthread"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ pthread_mutex_t m;
+ pthread_mutexattr_t ma;
+ ]],
+ [[pthread_mutex_lock (&m);
+ pthread_mutexattr_init (&ma);]])],
+ [gl_pthread_api=yes
+ LIBPTHREAD=$gl_pthread
+ LIBPMULTITHREAD=$gl_pthread])
+ LIBS=$save_LIBS
+ test $gl_pthread_api = yes && break
+ done
+ echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: LIBPTHREAD=$LIBPTHREAD" >&AS_MESSAGE_LOG_FD
+
+ gl_pthread_in_glibc=no
+ # On Linux with glibc >= 2.34, libc contains the fully functional
+ # pthread functions.
+ case "$host_os" in
+ linux*)
+ AC_EGREP_CPP([Lucky user],
+ [#include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+ #endif
+ ],
+ [gl_pthread_in_glibc=yes],
+ [])
+ ;;
+ esac
+ echo "$as_me:__oline__: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&AS_MESSAGE_LOG_FD
+
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+ # The program links fine without libpthread. But it may actually
+ # need to link with libpthread in order to create multiple threads.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [if test $gl_pthread_in_glibc = yes; then
+ LIBPMULTITHREAD=
+ else
+ LIBPMULTITHREAD=-lpthread
+ # On Solaris and HP-UX, most pthread functions exist also in libc.
+ # Therefore pthread_in_use() needs to actually try to create a
+ # thread: pthread_create from libc will fail, whereas
+ # pthread_create will actually create a thread.
+ # On Solaris 10 or newer, this test is no longer needed, because
+ # libc contains the fully functional pthread functions.
+ case "$host_os" in
+changequote(,)dnl
+ solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+changequote([,])dnl
+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+ [Define if the pthread_in_use() detection is hard.])
+ esac
+ fi
+ ])
+ elif test $gl_pthread_api != yes; then
+ # Some library is needed. Try libpthread and libc_r.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lpthread
+ LIBPMULTITHREAD=-lpthread])
+ if test $gl_pthread_api != yes; then
+ # For FreeBSD 4.
+ AC_CHECK_LIB([c_r], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lc_r
+ LIBPMULTITHREAD=-lc_r])
+ fi
+ fi
+ echo "$as_me:__oline__: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&AS_MESSAGE_LOG_FD
+ fi
+ AC_MSG_CHECKING([whether POSIX threads API is available])
+ AC_MSG_RESULT([$gl_pthread_api])
+ AC_SUBST([LIBPTHREAD])
+ AC_SUBST([LIBPMULTITHREAD])
+ if test $gl_pthread_api = yes; then
+ AC_DEFINE([HAVE_PTHREAD_API], [1],
+ [Define if you have the <pthread.h> header and the POSIX threads API.])
+ fi
+
+ dnl On some systems, sched_yield is in librt, rather than in libpthread.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sched.h>]],
+ [[sched_yield ();]])],
+ [LIB_SCHED_YIELD=
+ ],
+ [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
+ AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+ [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
+ AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+ ])
+ AC_SUBST([LIB_SCHED_YIELD])
+
+ gl_pthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_PTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_PTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the ISO C API
+
+dnl gl_STDTHREADLIB
+dnl ---------------
+dnl Tests for the libraries needs for using the ISO C threads API.
+dnl Sets the variable LIBSTDTHREAD to the linker options for use in a Makefile.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_THREADS_H if (at least parts of) the ISO C threads
+dnl API is available.
+
+dnl The guts of gl_STDTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_STDTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_stdthreadlib_body_done"; then
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ case "$host_os" in
+ mingw*)
+ LIBSTDTHREAD=
+ ;;
+ *)
+ gl_PTHREADLIB_BODY
+ if test $ac_cv_header_threads_h = yes; then
+ dnl glibc >= 2.29 has thrd_create in libpthread.
+ dnl FreeBSD >= 10 has thrd_create in libstdthreads; this library depends
+ dnl on libpthread (for the symbol 'pthread_mutexattr_gettype').
+ dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in
+ dnl libc.
+ AC_CHECK_FUNCS([thrd_create])
+ if test $ac_cv_func_thrd_create = yes; then
+ LIBSTDTHREAD=
+ else
+ AC_CHECK_LIB([stdthreads], [thrd_create], [
+ LIBSTDTHREAD='-lstdthreads -lpthread'
+ ], [
+ dnl Guess that thrd_create is in libpthread.
+ LIBSTDTHREAD="$LIBPMULTITHREAD"
+ ])
+ fi
+ else
+ dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
+ LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+ fi
+ ;;
+ esac
+ AC_SUBST([LIBSTDTHREAD])
+
+ AC_MSG_CHECKING([whether ISO C threads API is available])
+ AC_MSG_RESULT([$ac_cv_header_threads_h])
+ gl_stdthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_STDTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_STDTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the Gnulib API
+
+dnl gl_THREADLIB
+dnl ------------
+dnl Tests for a multithreading library to be used.
+dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
+dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
+dnl default is 'no', otherwise it is system dependent. In both cases, the user
+dnl can change the choice through the options --enable-threads=choice or
+dnl --disable-threads.
+dnl Defines at most one of the macros USE_ISOC_THREADS, USE_POSIX_THREADS,
+dnl USE_ISOC_AND_POSIX_THREADS, USE_WINDOWS_THREADS.
+dnl The choice --enable-threads=isoc+posix is available only on platforms that
+dnl have both the ISO C and the POSIX threads APIs. It has the effect of using
+dnl the ISO C API for most things and the POSIX API only for creating and
+dnl controlling threads (because there is no equivalent to pthread_atfork in
+dnl the ISO C API).
+dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
+dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
+dnl libtool).
+dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
+dnl programs that really need multithread functionality. The difference
+dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
+dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Since support for GNU pth was removed, $LTLIBTHREAD and $LIBTHREAD have the
+dnl same value, and similarly $LTLIBMULTITHREAD and $LIBMULTITHREAD have the
+dnl same value. Only system libraries are needed.
+
+AC_DEFUN([gl_THREADLIB_EARLY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+])
+
+dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_EARLY_BODY],
+[
+ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
+ dnl influences the result of the autoconf tests that test for *_unlocked
+ dnl declarations, on AIX 5 at least. Therefore it must come early.
+ AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
+ AC_BEFORE([$0], [gl_ARGP])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ dnl Check for multithreading.
+ m4_ifdef([gl_THREADLIB_DEFAULT_NO],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
+ m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=])
+ AC_ARG_ENABLE([threads],
+AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AS_HELP_STRING([--disable-threads], [build without multithread safety])]),
+ [gl_use_threads=$enableval],
+ [if test -n "$gl_use_threads_default"; then
+ gl_use_threads="$gl_use_threads_default"
+ else
+changequote(,)dnl
+ case "$host_os" in
+ dnl Disable multithreading by default on OSF/1, because it interferes
+ dnl with fork()/exec(): When msgexec is linked with -lpthread, its
+ dnl child process gets an endless segmentation fault inside execvp().
+ osf*) gl_use_threads=no ;;
+ dnl Disable multithreading by default on Cygwin 1.5.x, because it has
+ dnl bugs that lead to endless loops or crashes. See
+ dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
+ cygwin*)
+ case `uname -r` in
+ 1.[0-5].*) gl_use_threads=no ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ dnl Obey gl_AVOID_WINPTHREAD on mingw.
+ mingw*)
+ case "$gl_use_winpthreads_default" in
+ yes) gl_use_threads=posix ;;
+ no) gl_use_threads=windows ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ *) gl_use_threads=yes ;;
+ esac
+changequote([,])dnl
+ fi
+ ])
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = isoc \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+ # For using <threads.h> or <pthread.h>:
+ gl_ANYTHREADLIB_EARLY
+ fi
+])
+
+dnl The guts of gl_THREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_BODY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+ gl_threads_api=none
+ LIBTHREAD=
+ LTLIBTHREAD=
+ LIBMULTITHREAD=
+ LTLIBMULTITHREAD=
+ if test "$gl_use_threads" != no; then
+ dnl Check whether the compiler and linker support weak declarations.
+ gl_WEAK_SYMBOLS
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+ dnl If we use weak symbols to implement pthread_in_use / pth_in_use /
+ dnl thread_in_use, we also need to test whether the ISO C 11 thrd_create
+ dnl facility is in use.
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ :
+ fi
+ if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ gl_have_isoc_threads="$ac_cv_header_threads_h"
+ fi
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+ gl_PTHREADLIB_BODY
+ LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+ LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+ if test $gl_pthread_api = yes; then
+ if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+ gl_threads_api='isoc+posix'
+ AC_DEFINE([USE_ISOC_AND_POSIX_THREADS], [1],
+ [Define if the combination of the ISO C and POSIX multithreading APIs can be used.])
+ LIBTHREAD= LTLIBTHREAD=
+ else
+ gl_threads_api=posix
+ AC_DEFINE([USE_POSIX_THREADS], [1],
+ [Define if the POSIX multithreading library can be used.])
+ if test -z "$LIBMULTITHREAD" && test -z "$LTLIBMULTITHREAD"; then
+ AC_DEFINE([USE_POSIX_THREADS_FROM_LIBC], [1],
+ [Define if references to the POSIX multithreading library are satisfied by libc.])
+ else
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+ AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
+ [Define if references to the POSIX multithreading library should be made weak.])
+ LIBTHREAD= LTLIBTHREAD=
+ else
+ case "$host_os" in
+ freebsd* | dragonfly* | midnightbsd*)
+ if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
+ dnl If weak symbols can't tell whether pthread_create(), pthread_key_create()
+ dnl etc. will succeed, we need a runtime test.
+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+ [Define if the pthread_in_use() detection is hard.])
+ fi
+ ;;
+ esac
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+ gl_STDTHREADLIB_BODY
+ LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+ LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+ gl_threads_api=isoc
+ AC_DEFINE([USE_ISOC_THREADS], [1],
+ [Define if the ISO C multithreading library can be used.])
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ case "$gl_use_threads" in
+ yes | windows | win32) # The 'win32' is for backward compatibility.
+ if { case "$host_os" in
+ mingw*) true;;
+ *) false;;
+ esac
+ }; then
+ gl_threads_api=windows
+ AC_DEFINE([USE_WINDOWS_THREADS], [1],
+ [Define if the native Windows multithreading API can be used.])
+ fi
+ ;;
+ esac
+ fi
+ fi
+ AC_MSG_CHECKING([for multithread API to use])
+ AC_MSG_RESULT([$gl_threads_api])
+ AC_SUBST([LIBTHREAD])
+ AC_SUBST([LTLIBTHREAD])
+ AC_SUBST([LIBMULTITHREAD])
+ AC_SUBST([LTLIBMULTITHREAD])
+])
+
+AC_DEFUN([gl_THREADLIB],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([gl_THREADLIB_BODY])
+])
+
+
+dnl gl_DISABLE_THREADS
+dnl ------------------
+dnl Sets the gl_THREADLIB default so that threads are not used by default.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_DISABLE_THREADS], [
+ m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
+])
+
+
+dnl gl_AVOID_WINPTHREAD
+dnl -------------------
+dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the
+dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_AVOID_WINPTHREAD], [
+ m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no])
+])
+
+
+dnl ============================================================================
+
+
+dnl Survey of platforms:
+dnl
+dnl Platform Available Compiler Supports test-lock
+dnl flavours option weak result
+dnl --------------- --------- --------- -------- ---------
+dnl Linux 2.4/glibc posix -lpthread Y OK
+dnl
+dnl Linux/glibc 2.34 posix Y OK
+dnl
+dnl GNU Hurd/glibc posix -lpthread Y OK
+dnl
+dnl Ubuntu 14.04 posix -pthread Y OK
+dnl
+dnl FreeBSD 5.3 posix -lc_r Y
+dnl posix -lkse ? Y
+dnl posix -lpthread ? Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 5.2 posix -lc_r Y
+dnl posix -lkse Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
+dnl
+dnl NetBSD 1.6 --
+dnl
+dnl OpenBSD 3.4 posix -lpthread Y OK
+dnl
+dnl Mac OS X 10.[123] posix -lpthread Y OK
+dnl
+dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl
+dnl HP-UX 11 posix -lpthread N (cc) OK
+dnl Y (gcc)
+dnl
+dnl IRIX 6.5 posix -lpthread Y 0.5
+dnl
+dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
+dnl
+dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
+dnl -lpthread (gcc) Y
+dnl
+dnl Cygwin posix -lpthread Y OK
+dnl
+dnl Mingw windows N OK
+dnl
+dnl BeOS 5 --
+dnl
+dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
+dnl turned off:
+dnl OK if all three tests terminate OK,
+dnl 0.5 if the first test terminates OK but the second one loops endlessly,
+dnl 0.0 if the first test already loops endlessly.
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
new file mode 100644
index 0000000..f6bf3a4
--- /dev/null
+++ b/gl/m4/time_h.m4
@@ -0,0 +1,183 @@
+# Configure a more-standard replacement for <time.h>.
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
+
+# serial 20
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert and Jim Meyering.
+
+AC_DEFUN_ONCE([gl_TIME_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+
+ gl_NEXT_HEADERS([time.h])
+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#include <time.h>
+ ]], [asctime_r ctime_r])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CACHE_CHECK([for TIME_UTC in <time.h>],
+ [gl_cv_time_h_has_TIME_UTC],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>
+ ]],
+ [[static int x = TIME_UTC; x++;]])],
+ [gl_cv_time_h_has_TIME_UTC=yes],
+ [gl_cv_time_h_has_TIME_UTC=no])])
+ if test $gl_cv_time_h_has_TIME_UTC = yes; then
+ TIME_H_DEFINES_TIME_UTC=1
+ else
+ TIME_H_DEFINES_TIME_UTC=0
+ fi
+ AC_SUBST([TIME_H_DEFINES_TIME_UTC])
+])
+
+dnl Check whether 'struct timespec' is declared
+dnl in time.h, sys/time.h, pthread.h, or unistd.h.
+
+AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
+[
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_CACHE_CHECK([for struct timespec in <time.h>],
+ [gl_cv_sys_struct_timespec_in_time_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_time_h=yes],
+ [gl_cv_sys_struct_timespec_in_time_h=no])])
+
+ TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
+ UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
+ if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
+ TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ AC_CACHE_CHECK([for struct timespec in <sys/time.h>],
+ [gl_cv_sys_struct_timespec_in_sys_time_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/time.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_sys_time_h=yes],
+ [gl_cv_sys_struct_timespec_in_sys_time_h=no])])
+ if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ AC_CACHE_CHECK([for struct timespec in <pthread.h>],
+ [gl_cv_sys_struct_timespec_in_pthread_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_pthread_h=yes],
+ [gl_cv_sys_struct_timespec_in_pthread_h=no])])
+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ AC_CACHE_CHECK([for struct timespec in <unistd.h>],
+ [gl_cv_sys_struct_timespec_in_unistd_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_unistd_h=yes],
+ [gl_cv_sys_struct_timespec_in_unistd_h=no])])
+ if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
+ UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
+ AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
+ AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
+ AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC])
+])
+
+# gl_TIME_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_TIME_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_TIME_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_RZ])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZSET])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TZSET], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_TIME_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R])
+ HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP])
+ HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME])
+ HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
+ HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET])
+ HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES])
+ dnl Even GNU libc does not have timezone_t yet.
+ HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
+ dnl If another module says to replace or to not replace, do that.
+ dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
+ dnl this lets maintainers check for portability.
+ REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME])
+ REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
+ REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
+ REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
+ REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
+ REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
+ REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
+
+ dnl Hack so that the time module doesn't depend on the sys_time module.
+ dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
+ : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY])
+ dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
+ dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
+ dnl is no longer a big deal.
+ REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
+ REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
+])
diff --git a/gl/m4/time_r.m4 b/gl/m4/time_r.m4
new file mode 100644
index 0000000..adce438
--- /dev/null
+++ b/gl/m4/time_r.m4
@@ -0,0 +1,99 @@
+dnl Reentrant time functions: localtime_r, gmtime_r.
+
+dnl Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_TIME_R],
+[
+ dnl Persuade glibc and Solaris <time.h> to declare localtime_r.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
+ dnl not defined.
+ AC_CHECK_DECLS([localtime_r], [], [],
+ [[/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+ ]])
+ if test $ac_cv_have_decl_localtime_r = no; then
+ HAVE_DECL_LOCALTIME_R=0
+ fi
+
+ AC_CHECK_FUNCS_ONCE([localtime_r])
+ if test $ac_cv_func_localtime_r = yes; then
+ HAVE_LOCALTIME_R=1
+ AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature],
+ [gl_cv_time_r_posix],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+ ]],
+ [[/* We don't need to append 'restrict's to the argument types,
+ even though the POSIX signature has the 'restrict's,
+ since C99 says they can't affect type compatibility. */
+ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
+ if (ptr) return 0;
+ /* Check the return type is a pointer.
+ On HP-UX 10 it is 'int'. */
+ *localtime_r (0, 0);]])
+ ],
+ [gl_cv_time_r_posix=yes],
+ [gl_cv_time_r_posix=no])
+ ])
+ if test $gl_cv_time_r_posix = yes; then
+ REPLACE_LOCALTIME_R=0
+ else
+ REPLACE_LOCALTIME_R=1
+ fi
+ else
+ HAVE_LOCALTIME_R=0
+ dnl On mingw, localtime_r() is defined as an inline function; use through a
+ dnl direct function call works but the use as a function pointer leads to a
+ dnl link error.
+ AC_CACHE_CHECK([whether localtime_r exists as an inline function],
+ [gl_cv_func_localtime_r_inline],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+ ]],
+ [[time_t a;
+ struct tm r;
+ localtime_r (&a, &r);
+ ]])
+ ],
+ [gl_cv_func_localtime_r_inline=yes],
+ [gl_cv_func_localtime_r_inline=no])
+ ])
+ if test $gl_cv_func_localtime_r_inline = yes; then
+ REPLACE_LOCALTIME_R=1
+ fi
+ fi
+])
+
+# Prerequisites of lib/time_r.c.
+AC_DEFUN([gl_PREREQ_TIME_R], [
+ :
+])
diff --git a/gl/m4/timegm.m4 b/gl/m4/timegm.m4
new file mode 100644
index 0000000..6079f1a
--- /dev/null
+++ b/gl/m4/timegm.m4
@@ -0,0 +1,26 @@
+# timegm.m4 serial 13
+dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_TIMEGM],
+[
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
+ REPLACE_TIMEGM=0
+ AC_CHECK_FUNCS_ONCE([timegm])
+ if test $ac_cv_func_timegm = yes; then
+ if test "$gl_cv_func_working_mktime" != yes; then
+ # Assume that timegm is buggy if mktime is.
+ REPLACE_TIMEGM=1
+ fi
+ else
+ HAVE_TIMEGM=0
+ fi
+])
+
+# Prerequisites of lib/timegm.c.
+AC_DEFUN([gl_PREREQ_TIMEGM], [
+ :
+])
diff --git a/gl/m4/ungetc.m4 b/gl/m4/ungetc.m4
new file mode 100644
index 0000000..8977a34
--- /dev/null
+++ b/gl/m4/ungetc.m4
@@ -0,0 +1,73 @@
+# ungetc.m4 serial 10
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ AC_CACHE_CHECK([whether ungetc works on arbitrary bytes],
+ [gl_cv_func_ungetc_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+ ]], [[FILE *f;
+ if (!(f = fopen ("conftest.tmp", "w+")))
+ return 1;
+ if (fputs ("abc", f) < 0)
+ { fclose (f); return 2; }
+ rewind (f);
+ if (fgetc (f) != 'a')
+ { fclose (f); return 3; }
+ if (fgetc (f) != 'b')
+ { fclose (f); return 4; }
+ if (ungetc ('d', f) != 'd')
+ { fclose (f); return 5; }
+ if (ftell (f) != 1)
+ { fclose (f); return 6; }
+ if (fgetc (f) != 'd')
+ { fclose (f); return 7; }
+ if (ftell (f) != 2)
+ { fclose (f); return 8; }
+ if (fseek (f, 0, SEEK_CUR) != 0)
+ { fclose (f); return 9; }
+ if (ftell (f) != 2)
+ { fclose (f); return 10; }
+ if (fgetc (f) != 'c')
+ { fclose (f); return 11; }
+ fclose (f);
+ remove ("conftest.tmp");
+ ]])],
+ [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on bionic systems.
+ *-android*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ gl_ftello_broken_after_ungetc=no
+ case "$gl_cv_func_ungetc_works" in
+ *yes) ;;
+ *)
+ dnl On macOS >= 10.15, where the above program fails with exit code 6,
+ dnl we fix it through an ftello override.
+ case "$host_os" in
+ darwin*) gl_ftello_broken_after_ungetc=yes ;;
+ *)
+ AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
+ [Define to 1 if ungetc is broken when used on arbitrary bytes.])
+ ;;
+ esac
+ ;;
+ esac
+])
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
new file mode 100644
index 0000000..f438402
--- /dev/null
+++ b/gl/m4/unistd_h.m4
@@ -0,0 +1,270 @@
+# unistd_h.m4 serial 90
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Simon Josefsson, Bruno Haible.
+
+AC_DEFUN_ONCE([gl_UNISTD_H],
+[
+ dnl Ensure to expand the default settings once only, before all statements
+ dnl that occur in other macros.
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ gl_CHECK_NEXT_HEADERS([unistd.h])
+ if test $ac_cv_header_unistd_h = yes; then
+ HAVE_UNISTD_H=1
+ else
+ HAVE_UNISTD_H=0
+ fi
+ AC_SUBST([HAVE_UNISTD_H])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Determine WINDOWS_64_BIT_OFF_T.
+ AC_REQUIRE([gl_TYPE_OFF_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+/* Some systems declare various items in the wrong headers. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# if defined _WIN32 && ! defined __CYGWIN__
+# include <io.h>
+# endif
+#endif
+ ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
+ execl execle execlp execv execve execvp execvpe
+ faccessat fchdir
+ fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
+ getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
+ getusershell setusershell endusershell
+ group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
+ readlink readlinkat rmdir sethostname sleep symlink symlinkat
+ truncate ttyname_r unlink unlinkat usleep])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([execvpe])
+ if test $ac_cv_have_decl_execvpe = no; then
+ HAVE_DECL_EXECVPE=0
+ fi
+])
+
+# gl_UNISTD_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_UNISTD_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_UNISTD_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCESS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHOWN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPY_FILE_RANGE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP3])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ENVIRON])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EUIDACCESS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECV])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FACCESSAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHOWNAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDATASYNC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSYNC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTRUNCATE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCWD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDOMAINNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDTABLESIZE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETENTROPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETGROUPS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETHOSTNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETOPT_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAGESIZE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS_GNU])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUSERSHELL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GROUP_MEMBER])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISATTY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHOWN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSEEK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE2])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PREAD])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PWRITE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READ])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RMDIR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETHOSTNAME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SLEEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCATE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TTYNAME_R])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_NONBLOCKING])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINKAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_USLEEP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WRITE])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ACCESS], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHDIR], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CLOSE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP2], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECL], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECV], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVP], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVPE], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETCWD], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETPID], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ISATTY], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_LSEEK], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_READ], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_RMDIR], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_SWAB], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UNLINK], [1])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WRITE], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_UNISTD_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
+ HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE])
+ HAVE_DUP3=1; AC_SUBST([HAVE_DUP3])
+ HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS])
+ HAVE_EXECVPE=1; AC_SUBST([HAVE_EXECVPE])
+ HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT])
+ HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR])
+ HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT])
+ HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC])
+ HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
+ HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
+ HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
+ HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY])
+ HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS])
+ HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
+ HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
+ HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
+ HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS])
+ HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
+ HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
+ HAVE_LINK=1; AC_SUBST([HAVE_LINK])
+ HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
+ HAVE_PIPE=1; AC_SUBST([HAVE_PIPE])
+ HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
+ HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
+ HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
+ HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
+ HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
+ HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME])
+ HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
+ HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
+ HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
+ HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
+ HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
+ HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
+ HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE])
+ HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
+ HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC])
+ HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
+ HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN])
+ HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
+ HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
+ HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
+ HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
+ HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE])
+ HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
+ HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
+ HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
+ REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS])
+ REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
+ REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE])
+ REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE])
+ REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
+ REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
+ REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL])
+ REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE])
+ REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP])
+ REPLACE_EXECV=0; AC_SUBST([REPLACE_EXECV])
+ REPLACE_EXECVE=0; AC_SUBST([REPLACE_EXECVE])
+ REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP])
+ REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE])
+ REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT])
+ REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
+ REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
+ REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
+ REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
+ REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
+ REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
+ REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
+ REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
+ REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS])
+ REPLACE_GETPASS_FOR_GETPASS_GNU=0; AC_SUBST([REPLACE_GETPASS_FOR_GETPASS_GNU])
+ REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
+ REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
+ REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
+ REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
+ REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
+ REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
+ REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
+ REPLACE_READ=0; AC_SUBST([REPLACE_READ])
+ REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
+ REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT])
+ REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
+ REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
+ REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
+ REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT])
+ REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE])
+ REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
+ REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
+ REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
+ REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
+ REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
+ UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H])
+ UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
+ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+ AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
+])
diff --git a/gl/m4/unlocked-io.m4 b/gl/m4/unlocked-io.m4
new file mode 100644
index 0000000..407c0ba
--- /dev/null
+++ b/gl/m4/unlocked-io.m4
@@ -0,0 +1,36 @@
+# unlocked-io.m4 serial 16
+
+# Copyright (C) 1998-2006, 2009-2023 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Jim Meyering.
+dnl
+dnl See if the glibc *_unlocked I/O macros or functions are available.
+dnl Use only those *_unlocked macros or functions that are declared
+dnl (because some of them were declared in Solaris 2.5.1 but were removed
+dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
+dnl on Solaris 2.6).
+
+AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO],
+[
+ dnl Persuade glibc and Solaris <stdio.h> to declare
+ dnl fgets_unlocked(), fputs_unlocked() etc.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([clearerr_unlocked])
+ AC_CHECK_DECLS_ONCE([feof_unlocked])
+ AC_CHECK_DECLS_ONCE([ferror_unlocked])
+ AC_CHECK_DECLS_ONCE([fflush_unlocked])
+ AC_CHECK_DECLS_ONCE([fgets_unlocked])
+ AC_CHECK_DECLS_ONCE([fputc_unlocked])
+ AC_CHECK_DECLS_ONCE([fputs_unlocked])
+ AC_CHECK_DECLS_ONCE([fread_unlocked])
+ AC_CHECK_DECLS_ONCE([fwrite_unlocked])
+ AC_CHECK_DECLS_ONCE([getc_unlocked])
+ AC_CHECK_DECLS_ONCE([getchar_unlocked])
+ AC_CHECK_DECLS_ONCE([putc_unlocked])
+ AC_CHECK_DECLS_ONCE([putchar_unlocked])
+])
diff --git a/gl/m4/vararrays.m4 b/gl/m4/vararrays.m4
new file mode 100644
index 0000000..fd6230c
--- /dev/null
+++ b/gl/m4/vararrays.m4
@@ -0,0 +1,72 @@
+# Check for variable-length arrays.
+
+# serial 6
+
+# From Paul Eggert
+
+# Copyright (C) 2001, 2009-2023 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+m4_version_prereq([2.70], [], [
+
+# AC_C_VARARRAYS
+# --------------
+# Check whether the C compiler supports variable-length arrays.
+AC_DEFUN([AC_C_VARARRAYS],
+[
+ AC_CACHE_CHECK([for variable-length arrays],
+ ac_cv_c_vararrays,
+ [AC_EGREP_CPP([defined],
+ [#ifdef __STDC_NO_VLA__
+ defined
+ #endif
+ ],
+ [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Test for VLA support. This test is partly inspired
+ from examples in the C standard. Use at least two VLA
+ functions to detect the GCC 3.4.3 bug described in:
+ https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
+ */
+ #ifdef __STDC_NO_VLA__
+ syntax error;
+ #else
+ extern int n;
+ int B[100];
+ int fvla (int m, int C[m][m]);
+
+ int
+ simple (int count, int all[static count])
+ {
+ return all[count - 1];
+ }
+
+ int
+ fvla (int m, int C[m][m])
+ {
+ typedef int VLA[m][m];
+ VLA x;
+ int D[m];
+ static int (*q)[m] = &B;
+ int (*s)[n] = q;
+ return C && &x[0][0] == &D[0] && &D[0] == s[0];
+ }
+ #endif
+ ]])],
+ [ac_cv_c_vararrays=yes],
+ [ac_cv_c_vararrays=no])])])
+ if test "$ac_cv_c_vararrays" = yes; then
+ dnl This is for compatibility with Autoconf 2.61-2.69.
+ AC_DEFINE([HAVE_C_VARARRAYS], 1,
+ [Define to 1 if C supports variable-length arrays.])
+ elif test "$ac_cv_c_vararrays" = no; then
+ AC_DEFINE([__STDC_NO_VLA__], 1,
+ [Define to 1 if C does not support variable-length arrays, and
+ if the compiler does not already define this.])
+ fi
+])
+
+])
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
new file mode 100644
index 0000000..6361c84
--- /dev/null
+++ b/gl/m4/vasnprintf.m4
@@ -0,0 +1,298 @@
+# vasnprintf.m4 serial 38
+dnl Copyright (C) 2002-2004, 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_VASNPRINTF],
+[
+ AC_CHECK_FUNCS_ONCE([vasnprintf])
+ if test $ac_cv_func_vasnprintf = no; then
+ gl_REPLACE_VASNPRINTF
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_VASNPRINTF],
+[
+ AC_CHECK_FUNCS_ONCE([vasnprintf])
+ AC_LIBOBJ([vasnprintf])
+ AC_LIBOBJ([printf-args])
+ AC_LIBOBJ([printf-parse])
+ AC_LIBOBJ([asnprintf])
+ if test $ac_cv_func_vasnprintf = yes; then
+ AC_DEFINE([REPLACE_VASNPRINTF], [1],
+ [Define if vasnprintf exists but is overridden by gnulib.])
+ fi
+ gl_PREREQ_PRINTF_ARGS
+ gl_PREREQ_PRINTF_PARSE
+ gl_PREREQ_VASNPRINTF
+ gl_PREREQ_ASNPRINTF
+])
+
+# Prerequisites of lib/printf-args.h, lib/printf-args.c.
+AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
+[
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+])
+
+# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
+AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
+[
+ AC_REQUIRE([gl_FEATURES_H])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_REQUIRE([AC_TYPE_SIZE_T])
+ AC_CHECK_TYPE([ptrdiff_t], ,
+ [AC_DEFINE([ptrdiff_t], [long],
+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
+ ])
+ AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
+])
+
+# Prerequisites of lib/vasnprintf.c.
+AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
+ dnl Use the _snprintf function only if it is declared (because on NetBSD it
+ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+ AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
+ dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
+ dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
+ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
+ dnl We can avoid a lot of code by assuming that snprintf's return value
+ dnl conforms to ISO C99. So check that.
+ AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1],
+ [Define if the return value of the snprintf function is the number of
+ of bytes (excluding the terminating NUL) that would have been produced
+ if the buffer had been large enough.])
+ ;;
+ esac
+ dnl Additionally, the use of %n can be eliminated by assuming that snprintf
+ dnl always produces NUL-terminated strings (no truncation).
+ AC_REQUIRE([gl_SNPRINTF_TRUNCATION_C99])
+ case "$gl_cv_func_snprintf_truncation_c99" in
+ *yes)
+ AC_DEFINE([HAVE_SNPRINTF_TRUNCATION_C99], [1],
+ [Define if the string produced by the snprintf function is always NUL
+ terminated.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
+# arguments.
+AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
+ case "$gl_cv_func_printf_long_double" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'long double' arguments.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double'
+# arguments.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_INFINITE])
+ case "$gl_cv_func_printf_infinite" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ infinite 'double' arguments.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double'
+# arguments.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
+[
+ AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
+ dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if
+ dnl NEED_PRINTF_LONG_DOUBLE is already set.
+ AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE])
+ case "$gl_cv_func_printf_long_double" in
+ *yes)
+ case "$gl_cv_func_printf_infinite_long_double" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ infinite 'long double' arguments.])
+ ;;
+ esac
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
+ case "$gl_cv_func_printf_directive_a" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'a' and 'A' directives.])
+ AC_CHECK_FUNCS([nl_langinfo])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
+ case "$gl_cv_func_printf_directive_f" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'F' directive.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
+ case "$gl_cv_func_printf_directive_ls" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'ls' directive.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
+ case "$gl_cv_func_printf_flag_grouping" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ ' flag.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
+ case "$gl_cv_func_printf_flag_leftadjust" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ '-' flag.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
+ case "$gl_cv_func_printf_flag_zero" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1],
+ [Define if the vasnprintf implementation needs special code for the
+ 0 flag.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
+[
+ AC_REQUIRE([gl_PRINTF_PRECISION])
+ case "$gl_cv_func_printf_precision" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1],
+ [Define if the vasnprintf implementation needs special code for
+ supporting large precisions without arbitrary bounds.])
+ AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'double' arguments.])
+ AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'long double' arguments.])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory
+# conditions.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
+[
+ AC_REQUIRE([gl_PRINTF_ENOMEM])
+ case "$gl_cv_func_printf_enomem" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_ENOMEM], [1],
+ [Define if the vasnprintf implementation needs special code for
+ surviving out-of-memory conditions.])
+ AC_DEFINE([NEED_PRINTF_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'double' arguments.])
+ AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1],
+ [Define if the vasnprintf implementation needs special code for
+ 'long double' arguments.])
+ ;;
+ esac
+])
+
+# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
+[
+ AC_REQUIRE([gl_PREREQ_VASNPRINTF])
+ gl_PREREQ_VASNPRINTF_LONG_DOUBLE
+ gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
+ gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_A
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_F
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
+ gl_PREREQ_VASNPRINTF_FLAG_GROUPING
+ gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
+ gl_PREREQ_VASNPRINTF_FLAG_ZERO
+ gl_PREREQ_VASNPRINTF_PRECISION
+ gl_PREREQ_VASNPRINTF_ENOMEM
+])
+
+# Prerequisites of lib/asnprintf.c.
+AC_DEFUN([gl_PREREQ_ASNPRINTF],
+[
+])
diff --git a/gl/m4/vasprintf.m4 b/gl/m4/vasprintf.m4
new file mode 100644
index 0000000..6e6156a
--- /dev/null
+++ b/gl/m4/vasprintf.m4
@@ -0,0 +1,46 @@
+# vasprintf.m4 serial 6
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2023 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_VASPRINTF],
+[
+ AC_CHECK_FUNCS([vasprintf])
+ if test $ac_cv_func_vasprintf = no; then
+ gl_REPLACE_VASPRINTF
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_VASPRINTF],
+[
+ AC_LIBOBJ([vasprintf])
+ AC_LIBOBJ([asprintf])
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ if test $ac_cv_func_vasprintf = yes; then
+ REPLACE_VASPRINTF=1
+ else
+ HAVE_VASPRINTF=0
+ fi
+ gl_PREREQ_VASPRINTF_H
+ gl_PREREQ_VASPRINTF
+ gl_PREREQ_ASPRINTF
+])
+
+# Prerequisites of the vasprintf portion of lib/stdio.h.
+AC_DEFUN([gl_PREREQ_VASPRINTF_H],
+[
+ dnl Persuade glibc <stdio.h> to declare asprintf() and vasprintf().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
+
+# Prerequisites of lib/vasprintf.c.
+AC_DEFUN([gl_PREREQ_VASPRINTF],
+[
+])
+
+# Prerequisites of lib/asprintf.c.
+AC_DEFUN([gl_PREREQ_ASPRINTF],
+[
+])
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
new file mode 100644
index 0000000..f0468e8
--- /dev/null
+++ b/gl/m4/visibility.m4
@@ -0,0 +1,82 @@
+# visibility.m4 serial 8
+dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl Mac OS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ dnl First, check whether -Werror can be added to the command line, or
+ dnl whether it leads to an error because of some other option that the
+ dnl user has put into $CC $CFLAGS $CPPFLAGS.
+ AC_CACHE_CHECK([whether the -Werror option is usable],
+ [gl_cv_cc_vis_werror],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+ dnl Now check whether visibility declarations are supported.
+ AC_CACHE_CHECK([for simple visibility declarations],
+ [gl_cv_cc_visibility],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void);
+ int hiddenvar;
+ int exportedvar;
+ int hiddenfunc (void) { return 51; }
+ int exportedfunc (void) { return 1225736919; }
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
+ [gl_cv_cc_visibility=yes],
+ [gl_cv_cc_visibility=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+ AC_SUBST([CFLAG_VISIBILITY])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4
new file mode 100644
index 0000000..7fbb11c
--- /dev/null
+++ b/gl/m4/vsnprintf.m4
@@ -0,0 +1,62 @@
+# vsnprintf.m4 serial 7
+dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Libintl 0.17 will replace vsnprintf only if it does not support %1$s,
+dnl but defers to any gnulib vsnprintf replacements. Therefore, gnulib
+dnl must guarantee that the decision for replacing vsnprintf is a superset
+dnl of the reasons checked by libintl.
+AC_DEFUN([gl_FUNC_VSNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_cv_func_vsnprintf_usable=no
+ AC_CHECK_FUNCS([vsnprintf])
+ if test $ac_cv_func_vsnprintf = yes; then
+ gl_SNPRINTF_SIZE1
+ case "$gl_cv_func_snprintf_size1" in
+ *yes)
+ gl_SNPRINTF_RETVAL_C99
+ case "$gl_cv_func_snprintf_retval_c99" in
+ *yes)
+ gl_PRINTF_POSITIONS
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ gl_cv_func_vsnprintf_usable=yes
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ if test $gl_cv_func_vsnprintf_usable = no; then
+ gl_REPLACE_VSNPRINTF
+ fi
+ AC_CHECK_DECLS_ONCE([vsnprintf])
+ if test $ac_cv_have_decl_vsnprintf = no; then
+ HAVE_DECL_VSNPRINTF=0
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_VSNPRINTF],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_LIBOBJ([vsnprintf])
+ if test $ac_cv_func_vsnprintf = yes; then
+ REPLACE_VSNPRINTF=1
+ else
+ AC_CHECK_DECLS_ONCE([vsnprintf])
+ if test $ac_cv_have_decl_vsnprintf = yes; then
+ dnl If the function is declared but does not appear to exist, it may be
+ dnl defined as an inline function. In order to avoid a conflict, we have
+ dnl to define rpl_vsnprintf, not vsnprintf.
+ REPLACE_VSNPRINTF=1
+ fi
+ fi
+ gl_PREREQ_VSNPRINTF
+])
+
+# Prerequisites of lib/vsnprintf.c.
+AC_DEFUN([gl_PREREQ_VSNPRINTF], [:])
diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4
new file mode 100644
index 0000000..10649c5
--- /dev/null
+++ b/gl/m4/warn-on-use.m4
@@ -0,0 +1,62 @@
+# warn-on-use.m4 serial 10
+dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
+# ---------------------------------------
+# If the module 'posixcheck' is in use:
+#
+# For each whitespace-separated element in the list of NAMES, define
+# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
+# even after being undefined as a macro.
+#
+# See warn-on-use.h for some hints on how to poison function names, as
+# well as ideas on poisoning global variables and macros. NAMES may
+# include global variables, but remember that only functions work with
+# _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single
+# header, but if the replacement header pulls in other headers because
+# some systems declare functions in the wrong header, then INCLUDES
+# should do likewise.
+#
+# It is generally safe to assume declarations for functions declared
+# in the intersection of C89 and C11 (such as printf) without
+# needing gl_WARN_ON_USE_PREPARE.
+AC_DEFUN([gl_WARN_ON_USE_PREPARE],
+[
+ m4_ifdef([gl_POSIXCHECK],
+ [m4_foreach_w([gl_decl], [$2],
+ [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+ [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+ undefining macros.])])dnl
+ for gl_func in m4_flatten([$2]); do
+ AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+ dnl As a workaround to implicit built-in function declarations in
+ dnl clang (e.g. strndup), reference ac_compile_for_check_decl instead
+ dnl of ac_compile. If, for whatever reason, the override of AC_PROG_CC
+ dnl in zzgnulib.m4 is inactive, use the original ac_compile.
+ ac_save_ac_compile="$ac_compile"
+ if test -n "$ac_compile_for_check_decl"; then
+ ac_compile="$ac_compile_for_check_decl"
+ fi
+ AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+ [gl_Symbol],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
+[[#undef $gl_func
+ (void) $gl_func;]])],
+ [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
+ ac_compile="$ac_save_ac_compile"
+ AS_VAR_IF([gl_Symbol], [yes],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+ dnl Shortcut for an AC_CHECK_DECL invocation that may come later:
+ dnl If the raw declaration exists with the given includes, then
+ dnl AC_CHECK_DECL with its many includes would see it as well.
+ dnl So, set a cache variable to allow skipping any later
+ dnl AC_CHECK_DECL invocation for $gl_func.
+ eval "ac_cv_have_decl_$gl_func=yes"
+ ])
+ AS_VAR_POPDEF([gl_Symbol])dnl
+ done
+ ])
+])
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
new file mode 100644
index 0000000..8ec6619
--- /dev/null
+++ b/gl/m4/wchar_h.m4
@@ -0,0 +1,257 @@
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
+
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Eric Blake.
+
+# wchar_h.m4 serial 55
+
+AC_DEFUN_ONCE([gl_WCHAR_H],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+ dnl Prepare for creating substitute <wchar.h>.
+ dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
+ dnl character support).
+ dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([wchar.h])
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+ AC_SUBST([HAVE_WCHAR_H])
+
+ AC_REQUIRE([gl_FEATURES_H])
+
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+ AC_SUBST([HAVE_WINT_T])
+
+ AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+ #include <wchar.h>
+ ]],
+ [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+ wcsrtombs wcsnrtombs wcwidth
+ wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset
+ wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
+ wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
+ wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime
+ ])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS([wcsdup], [], [], [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_wcsdup = no; then
+ HAVE_DECL_WCSDUP=0
+ fi
+])
+
+dnl Check whether <wchar.h> is usable at all.
+AC_DEFUN([gl_WCHAR_H_INLINE_OK],
+[
+ dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
+ dnl 'gnu_inline'. See <https://sourceware.org/bugzilla/show_bug.cgi?id=4022>
+ dnl and <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
+ dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
+ dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
+ [gl_cv_header_wchar_h_correct_inline],
+ [gl_cv_header_wchar_h_correct_inline=yes
+ case "$host_os" in
+ *-gnu* | gnu*)
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ extern int zero (void);
+ int main () { return zero(); }
+ ]])])
+ dnl Do not rename the object file from conftest.$ac_objext to
+ dnl conftest1.$ac_objext, as this will cause the link to fail on
+ dnl z/OS when using the XPLINK object format (due to duplicate
+ dnl CSECT names). Instead, temporarily redefine $ac_compile so
+ dnl that the object file has the latter name from the start.
+ save_ac_compile="$ac_compile"
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+ if echo '#include "conftest.c"' >conftest1.c \
+ && AC_TRY_EVAL([ac_compile]); then
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ int zero (void) { return 0; }
+ ]])])
+ dnl See note above about renaming object files.
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+ if echo '#include "conftest.c"' >conftest2.c \
+ && AC_TRY_EVAL([ac_compile]); then
+ if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
+ :
+ else
+ gl_cv_header_wchar_h_correct_inline=no
+ fi
+ fi
+ fi
+ ac_compile="$save_ac_compile"
+ rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
+ ;;
+ esac
+ ])
+ if test $gl_cv_header_wchar_h_correct_inline = no; then
+ AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
+C99 mode. You have four options:
+ - Add the flag -fgnu89-inline to CC and reconfigure, or
+ - Fix your include files, using parts of
+ <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+ - Use a gcc version older than 4.3, or
+ - Don't use the flags -std=c99 or -std=gnu99.
+Configuration aborted.])
+ fi
+])
+
+# gl_WCHAR_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_WCHAR_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOWC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSINIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOWC])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNRTOWCS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCRTOMB])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRTOMBS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNRTOMBS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCWIDTH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMMOVE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMSET])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNLEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPNCPY])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCAT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCASECMP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCOLL])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSXFRM])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSDUP])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSPN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSPBRK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSTR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME])
+ dnl Support Microsoft deprecated alias function names by default.
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS])
+ dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized.
+ gl_STDLIB_H_REQUIRE_DEFAULTS
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_WCHAR_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC])
+ HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT])
+ HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC])
+ HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN])
+ HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS])
+ HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS])
+ HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB])
+ HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS])
+ HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS])
+ HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR])
+ HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP])
+ HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY])
+ HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE])
+ HAVE_WMEMPCPY=1; AC_SUBST([HAVE_WMEMPCPY])
+ HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET])
+ HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN])
+ HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN])
+ HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY])
+ HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY])
+ HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY])
+ HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY])
+ HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT])
+ HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT])
+ HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP])
+ HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP])
+ HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP])
+ HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP])
+ HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL])
+ HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM])
+ HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP])
+ HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR])
+ HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR])
+ HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN])
+ HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN])
+ HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK])
+ HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR])
+ HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK])
+ HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH])
+ HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME])
+ HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
+ HAVE_DECL_WCSDUP=1; AC_SUBST([HAVE_DECL_WCSDUP])
+ HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
+ REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
+ REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
+ REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB])
+ REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT])
+ REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
+ REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
+ REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
+ REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
+ REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
+ REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
+ REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
+ REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
+ REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH])
+ REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME])
+ REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK])
+])
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
new file mode 100644
index 0000000..50bde08
--- /dev/null
+++ b/gl/m4/wchar_t.m4
@@ -0,0 +1,24 @@
+# wchar_t.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2002-2003, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <stddef.h> has the 'wchar_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WCHAR_T],
+[
+ AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ wchar_t foo = (wchar_t)'\0';]],
+ [[]])],
+ [gt_cv_c_wchar_t=yes],
+ [gt_cv_c_wchar_t=no])])
+ if test $gt_cv_c_wchar_t = yes; then
+ AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
+ fi
+])
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
new file mode 100644
index 0000000..d51b36e
--- /dev/null
+++ b/gl/m4/wcrtomb.m4
@@ -0,0 +1,146 @@
+# wcrtomb.m4 serial 17
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCRTOMB],
+[
+ AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+
+ AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ gl_MBSTATE_T_BROKEN
+
+ AC_CHECK_FUNCS_ONCE([wcrtomb])
+ if test $ac_cv_func_wcrtomb = no; then
+ HAVE_WCRTOMB=0
+ AC_CHECK_DECLS([wcrtomb],,, [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_wcrtomb = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_WCRTOMB=1
+ fi
+ else
+ dnl We don't actually need to override wcrtomb when redefining the semantics
+ dnl of the mbstate_t type. Tested on 32-bit AIX.
+ dnl if test $REPLACE_MBSTATE_T = 1; then
+ dnl REPLACE_WCRTOMB=1
+ dnl fi
+ if test $REPLACE_WCRTOMB = 0; then
+ dnl On Android 4.3, wcrtomb produces wrong characters in the C locale.
+ dnl On AIX 4.3, OSF/1 5.1 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL)
+ dnl sometimes returns 0 instead of 1.
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gt_LOCALE_FR])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([gt_LOCALE_ZH_CN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether wcrtomb works in the C locale],
+ [gl_cv_func_wcrtomb_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <string.h>
+#include <stdlib.h>
+#include <wchar.h>
+int main ()
+{
+ mbstate_t state;
+ char out[64];
+ int count;
+ memset (&state, 0, sizeof (state));
+ out[0] = 'x';
+ count = wcrtomb (out, L'a', &state);
+ return !(count == 1 && out[0] == 'a');
+}]])],
+ [gl_cv_func_wcrtomb_works=yes],
+ [gl_cv_func_wcrtomb_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_wcrtomb_works="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_wcrtomb_works" in
+ *yes) ;;
+ *) AC_DEFINE([WCRTOMB_C_LOCALE_BUG], [1],
+ [Define if the wcrtomb function does not work in the C locale.])
+ REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ if test $REPLACE_WCRTOMB = 0; then
+ AC_CACHE_CHECK([whether wcrtomb return value is correct],
+ [gl_cv_func_wcrtomb_retval],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on AIX 4, OSF/1, Solaris, native Windows.
+ aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+#include <stdlib.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 1;
+ }
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 2;
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ if (mbtowc (&wc, "\303\274", 2) == 2)
+ if (wcrtomb (NULL, wc, NULL) != 1)
+ result |= 2;
+ }
+ }
+ if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 4;
+ }
+ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ {
+ if (wcrtomb (NULL, 0, NULL) != 1)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_wcrtomb_retval=yes],
+ [gl_cv_func_wcrtomb_retval=no],
+ [:])
+ fi
+ ])
+ case "$gl_cv_func_wcrtomb_retval" in
+ *yes) ;;
+ *) AC_DEFINE([WCRTOMB_RETVAL_BUG], [1],
+ [Define if the wcrtomb function has an incorrect return value.])
+ REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ fi
+])
+
+# Prerequisites of lib/wcrtomb.c.
+AC_DEFUN([gl_PREREQ_WCRTOMB], [
+ :
+])
diff --git a/gl/m4/wctype_h.m4 b/gl/m4/wctype_h.m4
new file mode 100644
index 0000000..6856a73
--- /dev/null
+++ b/gl/m4/wctype_h.m4
@@ -0,0 +1,200 @@
+# wctype_h.m4 serial 30
+
+dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
+
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN_ONCE([gl_WCTYPE_H],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([iswcntrl])
+ if test $ac_cv_func_iswcntrl = yes; then
+ HAVE_ISWCNTRL=1
+ else
+ HAVE_ISWCNTRL=0
+ fi
+ AC_SUBST([HAVE_ISWCNTRL])
+
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+ AC_SUBST([HAVE_WINT_T])
+
+ AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
+ gl_CHECK_NEXT_HEADERS([wctype.h])
+ if test $ac_cv_header_wctype_h = yes; then
+ if test $ac_cv_func_iswcntrl = yes; then
+ dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
+ dnl The other functions are likely broken in the same way.
+ AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <wchar.h>
+ #include <wctype.h>
+ int main () { return iswprint ('x') == 0; }
+ ]])],
+ [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
+ [dnl Guess no on Linux libc5, yes otherwise.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+ #if __GNU_LIBRARY__ == 1
+ Linux libc5 i18n is broken.
+ #endif]], [[]])],
+ [gl_cv_func_iswcntrl_works="guessing yes"],
+ [gl_cv_func_iswcntrl_works="guessing no"])
+ ])
+ ])
+ fi
+ HAVE_WCTYPE_H=1
+ else
+ HAVE_WCTYPE_H=0
+ fi
+ AC_SUBST([HAVE_WCTYPE_H])
+
+ if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+ REPLACE_ISWCNTRL=1
+ else
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
+ fi
+ AC_SUBST([REPLACE_ISWCNTRL])
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ dnl Redefine all of iswcntrl, ..., iswxdigit in <wctype.h>.
+ :
+ fi
+
+ if test $REPLACE_ISWCNTRL = 1; then
+ REPLACE_TOWLOWER=1
+ else
+ AC_CHECK_FUNCS([towlower])
+ if test $ac_cv_func_towlower = yes; then
+ REPLACE_TOWLOWER=0
+ else
+ AC_CHECK_DECLS([towlower],,,
+ [[#include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ ]])
+ if test $ac_cv_have_decl_towlower = yes; then
+ dnl On Minix 3.1.8, the system's <wctype.h> declares towlower() and
+ dnl towupper() although it does not have the functions. Avoid a
+ dnl collision with gnulib's replacement.
+ REPLACE_TOWLOWER=1
+ else
+ REPLACE_TOWLOWER=0
+ fi
+ fi
+ fi
+ AC_SUBST([REPLACE_TOWLOWER])
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+ dnl Redefine towlower, towupper in <wctype.h>.
+ :
+ fi
+
+ dnl We assume that the wctype() and iswctype() functions exist if and only
+ dnl if the type wctype_t is defined in <wchar.h> or in <wctype.h> if that
+ dnl exists.
+ dnl HP-UX 11.00 declares all these in <wchar.h> and lacks <wctype.h>.
+ AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ wctype_t a;
+ ]],
+ [[]])],
+ [gl_cv_type_wctype_t=yes],
+ [gl_cv_type_wctype_t=no])
+ ])
+ if test $gl_cv_type_wctype_t = no; then
+ HAVE_WCTYPE_T=0
+ fi
+
+ dnl We assume that the wctrans() and towctrans() functions exist if and only
+ dnl if the type wctrans_t is defined in <wctype.h>.
+ AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ #include <wctype.h>
+ wctrans_t a;
+ ]],
+ [[]])],
+ [gl_cv_type_wctrans_t=yes],
+ [gl_cv_type_wctrans_t=no])
+ ])
+ if test $gl_cv_type_wctrans_t = no; then
+ HAVE_WCTRANS_T=0
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <wchar.h>
+#endif
+#include <wctype.h>
+ ]],
+ [wctype iswctype wctrans towctrans
+ ])
+])
+
+# gl_WCTYPE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
+[
+ dnl Ensure to expand the default settings once only.
+ gl_WCTYPE_H_REQUIRE_DEFAULTS
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_WCTYPE_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTRANS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOWCTRANS])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
+[
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK])
+ HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])
+ HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T])
+ REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK])
+ REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT])
+ REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT])
+])
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
new file mode 100644
index 0000000..dfd743b
--- /dev/null
+++ b/gl/m4/wint_t.m4
@@ -0,0 +1,57 @@
+# wint_t.m4 serial 11
+dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's
+dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WINT_T],
+[
+ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ wint_t foo = (wchar_t)'\0';]],
+ [[]])],
+ [gt_cv_c_wint_t=yes],
+ [gt_cv_c_wint_t=no])])
+ if test $gt_cv_c_wint_t = yes; then
+ AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
+
+ dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
+ dnl override 'wint_t'.
+ AC_CACHE_CHECK([whether wint_t is large enough],
+ [gl_cv_type_wint_t_large_enough],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
+ int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+ ]])],
+ [gl_cv_type_wint_t_large_enough=yes],
+ [gl_cv_type_wint_t_large_enough=no])])
+ if test $gl_cv_type_wint_t_large_enough = no; then
+ GNULIBHEADERS_OVERRIDE_WINT_T=1
+ else
+ GNULIBHEADERS_OVERRIDE_WINT_T=0
+ fi
+ else
+ GNULIBHEADERS_OVERRIDE_WINT_T=0
+ fi
+ AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T])
+])
+
+dnl Prerequisites of the 'wint_t' override.
+AC_DEFUN([gl_TYPE_WINT_T_PREREQ],
+[
+ AC_CHECK_HEADERS_ONCE([crtdefs.h])
+ if test $ac_cv_header_crtdefs_h = yes; then
+ HAVE_CRTDEFS_H=1
+ else
+ HAVE_CRTDEFS_H=0
+ fi
+ AC_SUBST([HAVE_CRTDEFS_H])
+])
diff --git a/gl/m4/xalloc.m4 b/gl/m4/xalloc.m4
new file mode 100644
index 0000000..fc56f59
--- /dev/null
+++ b/gl/m4/xalloc.m4
@@ -0,0 +1,7 @@
+# xalloc.m4 serial 18
+dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_XALLOC], [:])
diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4
new file mode 100644
index 0000000..649db9c
--- /dev/null
+++ b/gl/m4/xsize.m4
@@ -0,0 +1,12 @@
+# xsize.m4 serial 5
+dnl Copyright (C) 2003-2004, 2008-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_XSIZE],
+[
+ dnl Prerequisites of lib/xsize.h.
+ AC_REQUIRE([gl_SIZE_MAX])
+ AC_CHECK_HEADERS([stdint.h])
+])
diff --git a/gl/m4/zzgnulib.m4 b/gl/m4/zzgnulib.m4
new file mode 100644
index 0000000..362102b
--- /dev/null
+++ b/gl/m4/zzgnulib.m4
@@ -0,0 +1,23 @@
+# zzgnulib.m4 serial 1
+dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This file must be named something that sorts after all other
+dnl package- or gnulib-provided .m4 files - at least for those packages
+dnl that redefine AC_PROG_CC.
+
+dnl Redefine AC_PROG_CC so that it ends with invocations of gl_COMPILER_CLANG
+dnl and gl_COMPILER_PREPARE_CHECK_DECL.
+m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[
+gl_COMPILER_CLANG
+gl_COMPILER_PREPARE_CHECK_DECL
+])
+
+# gl_ZZGNULIB
+# -----------
+# Witness macro that this file has been included. Needed to force
+# Automake to include this file after all other gnulib .m4 files.
+AC_DEFUN([gl_ZZGNULIB])
diff --git a/gl/malloc.c b/gl/malloc.c
new file mode 100644
index 0000000..3ade35c
--- /dev/null
+++ b/gl/malloc.c
@@ -0,0 +1,51 @@
+/* malloc() function that is glibc compatible.
+
+ Copyright (C) 1997-1998, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Allocate an N-byte block of memory from the heap, even if N is 0. */
+
+void *
+rpl_malloc (size_t n)
+{
+ if (n == 0)
+ n = 1;
+
+ if (xalloc_oversized (n, 1))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ void *result = malloc (n);
+
+#if !HAVE_MALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/gl/malloc/dynarray-skeleton.c b/gl/malloc/dynarray-skeleton.c
new file mode 100644
index 0000000..580c278
--- /dev/null
+++ b/gl/malloc/dynarray-skeleton.c
@@ -0,0 +1,528 @@
+/* Type-safe arrays which grow dynamically.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* Pre-processor macros which act as parameters:
+
+ DYNARRAY_STRUCT
+ The struct tag of dynamic array to be defined.
+ DYNARRAY_ELEMENT
+ The type name of the element type. Elements are copied
+ as if by memcpy, and can change address as the dynamic
+ array grows.
+ DYNARRAY_PREFIX
+ The prefix of the functions which are defined.
+
+ The following parameters are optional:
+
+ DYNARRAY_ELEMENT_FREE
+ DYNARRAY_ELEMENT_FREE (E) is evaluated to deallocate the
+ contents of elements. E is of type DYNARRAY_ELEMENT *.
+ DYNARRAY_ELEMENT_INIT
+ DYNARRAY_ELEMENT_INIT (E) is evaluated to initialize a new
+ element. E is of type DYNARRAY_ELEMENT *.
+ If DYNARRAY_ELEMENT_FREE but not DYNARRAY_ELEMENT_INIT is
+ defined, new elements are automatically zero-initialized.
+ Otherwise, new elements have undefined contents.
+ DYNARRAY_INITIAL_SIZE
+ The size of the statically allocated array (default:
+ at least 2, more elements if they fit into 128 bytes).
+ Must be a preprocessor constant. If DYNARRAY_INITIAL_SIZE is 0,
+ there is no statically allocated array at, and all non-empty
+ arrays are heap-allocated.
+ DYNARRAY_FINAL_TYPE
+ The name of the type which holds the final array. If not
+ defined, is PREFIX##finalize not provided. DYNARRAY_FINAL_TYPE
+ must be a struct type, with members of type DYNARRAY_ELEMENT and
+ size_t at the start (in this order).
+
+ These macros are undefined after this header file has been
+ included.
+
+ The following types are provided (their members are private to the
+ dynarray implementation):
+
+ struct DYNARRAY_STRUCT
+
+ The following functions are provided:
+
+ void DYNARRAY_PREFIX##init (struct DYNARRAY_STRUCT *);
+ void DYNARRAY_PREFIX##free (struct DYNARRAY_STRUCT *);
+ bool DYNARRAY_PREFIX##has_failed (const struct DYNARRAY_STRUCT *);
+ void DYNARRAY_PREFIX##mark_failed (struct DYNARRAY_STRUCT *);
+ size_t DYNARRAY_PREFIX##size (const struct DYNARRAY_STRUCT *);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##begin (const struct DYNARRAY_STRUCT *);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##end (const struct DYNARRAY_STRUCT *);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##at (struct DYNARRAY_STRUCT *, size_t);
+ void DYNARRAY_PREFIX##add (struct DYNARRAY_STRUCT *, DYNARRAY_ELEMENT);
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##emplace (struct DYNARRAY_STRUCT *);
+ bool DYNARRAY_PREFIX##resize (struct DYNARRAY_STRUCT *, size_t);
+ void DYNARRAY_PREFIX##remove_last (struct DYNARRAY_STRUCT *);
+ void DYNARRAY_PREFIX##clear (struct DYNARRAY_STRUCT *);
+
+ The following functions are provided are provided if the
+ prerequisites are met:
+
+ bool DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *,
+ DYNARRAY_FINAL_TYPE *);
+ (if DYNARRAY_FINAL_TYPE is defined)
+ DYNARRAY_ELEMENT *DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *,
+ size_t *);
+ (if DYNARRAY_FINAL_TYPE is not defined)
+*/
+
+#include <malloc/dynarray.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef DYNARRAY_STRUCT
+# error "DYNARRAY_STRUCT must be defined"
+#endif
+
+#ifndef DYNARRAY_ELEMENT
+# error "DYNARRAY_ELEMENT must be defined"
+#endif
+
+#ifndef DYNARRAY_PREFIX
+# error "DYNARRAY_PREFIX must be defined"
+#endif
+
+#ifdef DYNARRAY_INITIAL_SIZE
+# if DYNARRAY_INITIAL_SIZE < 0
+# error "DYNARRAY_INITIAL_SIZE must be non-negative"
+# endif
+# if DYNARRAY_INITIAL_SIZE > 0
+# define DYNARRAY_HAVE_SCRATCH 1
+# else
+# define DYNARRAY_HAVE_SCRATCH 0
+# endif
+#else
+/* Provide a reasonable default which limits the size of
+ DYNARRAY_STRUCT. */
+# define DYNARRAY_INITIAL_SIZE \
+ (sizeof (DYNARRAY_ELEMENT) > 64 ? 2 : 128 / sizeof (DYNARRAY_ELEMENT))
+# define DYNARRAY_HAVE_SCRATCH 1
+#endif
+
+/* Public type definitions. */
+
+/* All fields of this struct are private to the implementation. */
+struct DYNARRAY_STRUCT
+{
+ union
+ {
+ struct dynarray_header dynarray_abstract;
+ struct
+ {
+ /* These fields must match struct dynarray_header. */
+ size_t used;
+ size_t allocated;
+ DYNARRAY_ELEMENT *array;
+ } dynarray_header;
+ } u;
+
+#if DYNARRAY_HAVE_SCRATCH
+ /* Initial inline allocation. */
+ DYNARRAY_ELEMENT scratch[DYNARRAY_INITIAL_SIZE];
+#endif
+};
+
+/* Internal use only: Helper macros. */
+
+/* Ensure macro-expansion of DYNARRAY_PREFIX. */
+#define DYNARRAY_CONCAT0(prefix, name) prefix##name
+#define DYNARRAY_CONCAT1(prefix, name) DYNARRAY_CONCAT0(prefix, name)
+#define DYNARRAY_NAME(name) DYNARRAY_CONCAT1(DYNARRAY_PREFIX, name)
+
+/* Use DYNARRAY_FREE instead of DYNARRAY_NAME (free),
+ so that Gnulib does not change 'free' to 'rpl_free'. */
+#define DYNARRAY_FREE DYNARRAY_CONCAT1 (DYNARRAY_NAME (f), ree)
+
+/* Address of the scratch buffer if any. */
+#if DYNARRAY_HAVE_SCRATCH
+# define DYNARRAY_SCRATCH(list) (list)->scratch
+#else
+# define DYNARRAY_SCRATCH(list) NULL
+#endif
+
+/* Internal use only: Helper functions. */
+
+/* Internal function. Call DYNARRAY_ELEMENT_FREE with the array
+ elements. Name mangling needed due to the DYNARRAY_ELEMENT_FREE
+ macro expansion. */
+static inline void
+DYNARRAY_NAME (free__elements__) (DYNARRAY_ELEMENT *__dynarray_array,
+ size_t __dynarray_used)
+{
+#ifdef DYNARRAY_ELEMENT_FREE
+ for (size_t __dynarray_i = 0; __dynarray_i < __dynarray_used; ++__dynarray_i)
+ DYNARRAY_ELEMENT_FREE (&__dynarray_array[__dynarray_i]);
+#endif /* DYNARRAY_ELEMENT_FREE */
+}
+
+/* Internal function. Free the non-scratch array allocation. */
+static inline void
+DYNARRAY_NAME (free__array__) (struct DYNARRAY_STRUCT *list)
+{
+#if DYNARRAY_HAVE_SCRATCH
+ if (list->u.dynarray_header.array != list->scratch)
+ free (list->u.dynarray_header.array);
+#else
+ free (list->u.dynarray_header.array);
+#endif
+}
+
+/* Public functions. */
+
+/* Initialize a dynamic array object. This must be called before any
+ use of the object. */
+__attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list)
+{
+ list->u.dynarray_header.used = 0;
+ list->u.dynarray_header.allocated = DYNARRAY_INITIAL_SIZE;
+ list->u.dynarray_header.array = DYNARRAY_SCRATCH (list);
+}
+
+/* Deallocate the dynamic array and its elements. */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_FREE (struct DYNARRAY_STRUCT *list)
+{
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array, list->u.dynarray_header.used);
+ DYNARRAY_NAME (free__array__) (list);
+ DYNARRAY_NAME (init) (list);
+}
+
+/* Return true if the dynamic array is in an error state. */
+__attribute_nonnull__ ((1))
+static inline bool
+DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.allocated == __dynarray_error_marker ();
+}
+
+/* Mark the dynamic array as failed. All elements are deallocated as
+ a side effect. */
+__attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list)
+{
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array, list->u.dynarray_header.used);
+ DYNARRAY_NAME (free__array__) (list);
+ list->u.dynarray_header.array = DYNARRAY_SCRATCH (list);
+ list->u.dynarray_header.used = 0;
+ list->u.dynarray_header.allocated = __dynarray_error_marker ();
+}
+
+/* Return the number of elements which have been added to the dynamic
+ array. */
+__attribute_nonnull__ ((1))
+static inline size_t
+DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.used;
+}
+
+/* Return a pointer to the array element at INDEX. Terminate the
+ process if INDEX is out of bounds. */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t index)
+{
+ if (__glibc_unlikely (index >= DYNARRAY_NAME (size) (list)))
+ __libc_dynarray_at_failure (DYNARRAY_NAME (size) (list), index);
+ return list->u.dynarray_header.array + index;
+}
+
+/* Return a pointer to the first array element, if any. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.array;
+}
+
+/* Return a pointer one element past the last array element. For a
+ zero-length array, the pointer can be NULL even though the dynamic
+ array has not entered the failure state. */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (end) (struct DYNARRAY_STRUCT *list)
+{
+ return list->u.dynarray_header.array + list->u.dynarray_header.used;
+}
+
+/* Internal function. Slow path for the add function below. */
+static void
+DYNARRAY_NAME (add__) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
+{
+ if (__glibc_unlikely
+ (!__libc_dynarray_emplace_enlarge (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT))))
+ {
+ DYNARRAY_NAME (mark_failed) (list);
+ return;
+ }
+
+ /* Copy the new element and increase the array length. */
+ list->u.dynarray_header.array[list->u.dynarray_header.used++] = item;
+}
+
+/* Add ITEM at the end of the array, enlarging it by one element.
+ Mark *LIST as failed if the dynamic array allocation size cannot be
+ increased. */
+__attribute_nonnull__ ((1))
+static inline void
+DYNARRAY_NAME (add) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
+{
+ /* Do nothing in case of previous error. */
+ if (DYNARRAY_NAME (has_failed) (list))
+ return;
+
+ /* Enlarge the array if necessary. */
+ if (__glibc_unlikely (list->u.dynarray_header.used
+ == list->u.dynarray_header.allocated))
+ {
+ DYNARRAY_NAME (add__) (list, item);
+ return;
+ }
+
+ /* Copy the new element and increase the array length. */
+ list->u.dynarray_header.array[list->u.dynarray_header.used++] = item;
+}
+
+/* Internal function. Building block for the emplace functions below.
+ Assumes space for one more element in *LIST. */
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace__tail__) (struct DYNARRAY_STRUCT *list)
+{
+ DYNARRAY_ELEMENT *result
+ = &list->u.dynarray_header.array[list->u.dynarray_header.used];
+ ++list->u.dynarray_header.used;
+#if defined (DYNARRAY_ELEMENT_INIT)
+ DYNARRAY_ELEMENT_INIT (result);
+#elif defined (DYNARRAY_ELEMENT_FREE)
+ memset (result, 0, sizeof (*result));
+#endif
+ return result;
+}
+
+/* Internal function. Slow path for the emplace function below. */
+static DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace__) (struct DYNARRAY_STRUCT *list)
+{
+ if (__glibc_unlikely
+ (!__libc_dynarray_emplace_enlarge (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT))))
+ {
+ DYNARRAY_NAME (mark_failed) (list);
+ return NULL;
+ }
+ return DYNARRAY_NAME (emplace__tail__) (list);
+}
+
+/* Allocate a place for a new element in *LIST and return a pointer to
+ it. The pointer can be NULL if the dynamic array cannot be
+ enlarged due to a memory allocation failure. */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
+static
+/* Avoid inlining with the larger initialization code. */
+#if !(defined (DYNARRAY_ELEMENT_INIT) || defined (DYNARRAY_ELEMENT_FREE))
+inline
+#endif
+DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace) (struct DYNARRAY_STRUCT *list)
+{
+ /* Do nothing in case of previous error. */
+ if (DYNARRAY_NAME (has_failed) (list))
+ return NULL;
+
+ /* Enlarge the array if necessary. */
+ if (__glibc_unlikely (list->u.dynarray_header.used
+ == list->u.dynarray_header.allocated))
+ return (DYNARRAY_NAME (emplace__) (list));
+ return DYNARRAY_NAME (emplace__tail__) (list);
+}
+
+/* Change the size of *LIST to SIZE. If SIZE is larger than the
+ existing size, new elements are added (which can be initialized).
+ Otherwise, the list is truncated, and elements are freed. Return
+ false on memory allocation failure (and mark *LIST as failed). */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static bool
+DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list, size_t size)
+{
+ if (size > list->u.dynarray_header.used)
+ {
+ bool ok;
+#if defined (DYNARRAY_ELEMENT_INIT)
+ /* The new elements have to be initialized. */
+ size_t old_size = list->u.dynarray_header.used;
+ ok = __libc_dynarray_resize (&list->u.dynarray_abstract,
+ size, DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT));
+ if (ok)
+ for (size_t i = old_size; i < size; ++i)
+ {
+ DYNARRAY_ELEMENT_INIT (&list->u.dynarray_header.array[i]);
+ }
+#elif defined (DYNARRAY_ELEMENT_FREE)
+ /* Zero initialization is needed so that the elements can be
+ safely freed. */
+ ok = __libc_dynarray_resize_clear
+ (&list->u.dynarray_abstract, size,
+ DYNARRAY_SCRATCH (list), sizeof (DYNARRAY_ELEMENT));
+#else
+ ok = __libc_dynarray_resize (&list->u.dynarray_abstract,
+ size, DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT));
+#endif
+ if (__glibc_unlikely (!ok))
+ DYNARRAY_NAME (mark_failed) (list);
+ return ok;
+ }
+ else
+ {
+ /* The list has shrunk in size. Free the removed elements. */
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array + size,
+ list->u.dynarray_header.used - size);
+ list->u.dynarray_header.used = size;
+ return true;
+ }
+}
+
+/* Remove the last element of LIST if it is present. */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list)
+{
+ /* used > 0 implies that the array is the non-failed state. */
+ if (list->u.dynarray_header.used > 0)
+ {
+ size_t new_length = list->u.dynarray_header.used - 1;
+#ifdef DYNARRAY_ELEMENT_FREE
+ DYNARRAY_ELEMENT_FREE (&list->u.dynarray_header.array[new_length]);
+#endif
+ list->u.dynarray_header.used = new_length;
+ }
+}
+
+/* Remove all elements from the list. The elements are freed, but the
+ list itself is not. */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list)
+{
+ /* free__elements__ does nothing if the list is in the failed
+ state. */
+ DYNARRAY_NAME (free__elements__)
+ (list->u.dynarray_header.array, list->u.dynarray_header.used);
+ list->u.dynarray_header.used = 0;
+}
+
+#ifdef DYNARRAY_FINAL_TYPE
+/* Transfer the dynamic array to a permanent location at *RESULT.
+ Returns true on success on false on allocation failure. In either
+ case, *LIST is re-initialized and can be reused. A NULL pointer is
+ stored in *RESULT if LIST refers to an empty list. On success, the
+ pointer in *RESULT is heap-allocated and must be deallocated using
+ free. */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1, 2))
+static bool
+DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list,
+ DYNARRAY_FINAL_TYPE *result)
+{
+ struct dynarray_finalize_result res;
+ if (__libc_dynarray_finalize (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT), &res))
+ {
+ /* On success, the result owns all the data. */
+ DYNARRAY_NAME (init) (list);
+ *result = (DYNARRAY_FINAL_TYPE) { res.array, res.length };
+ return true;
+ }
+ else
+ {
+ /* On error, we need to free all data. */
+ DYNARRAY_FREE (list);
+ errno = ENOMEM;
+ return false;
+ }
+}
+#else /* !DYNARRAY_FINAL_TYPE */
+/* Transfer the dynamic array to a heap-allocated array and return a
+ pointer to it. The pointer is NULL if memory allocation fails, or
+ if the array is empty, so this function should be used only for
+ arrays which are known not be empty (usually because they always
+ have a sentinel at the end). If LENGTHP is not NULL, the array
+ length is written to *LENGTHP. *LIST is re-initialized and can be
+ reused. */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
+static DYNARRAY_ELEMENT *
+DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, size_t *lengthp)
+{
+ struct dynarray_finalize_result res;
+ if (__libc_dynarray_finalize (&list->u.dynarray_abstract,
+ DYNARRAY_SCRATCH (list),
+ sizeof (DYNARRAY_ELEMENT), &res))
+ {
+ /* On success, the result owns all the data. */
+ DYNARRAY_NAME (init) (list);
+ if (lengthp != NULL)
+ *lengthp = res.length;
+ return res.array;
+ }
+ else
+ {
+ /* On error, we need to free all data. */
+ DYNARRAY_FREE (list);
+ errno = ENOMEM;
+ return NULL;
+ }
+}
+#endif /* !DYNARRAY_FINAL_TYPE */
+
+/* Undo macro definitions. */
+
+#undef DYNARRAY_CONCAT0
+#undef DYNARRAY_CONCAT1
+#undef DYNARRAY_NAME
+#undef DYNARRAY_SCRATCH
+#undef DYNARRAY_HAVE_SCRATCH
+
+#undef DYNARRAY_STRUCT
+#undef DYNARRAY_ELEMENT
+#undef DYNARRAY_PREFIX
+#undef DYNARRAY_ELEMENT_FREE
+#undef DYNARRAY_ELEMENT_INIT
+#undef DYNARRAY_INITIAL_SIZE
+#undef DYNARRAY_FINAL_TYPE
diff --git a/gl/malloc/dynarray.h b/gl/malloc/dynarray.h
new file mode 100644
index 0000000..a9a3b08
--- /dev/null
+++ b/gl/malloc/dynarray.h
@@ -0,0 +1,177 @@
+/* Type-safe arrays which grow dynamically. Shared definitions.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* To use the dynarray facility, you need to include
+ <malloc/dynarray-skeleton.c> and define the parameter macros
+ documented in that file.
+
+ A minimal example which provides a growing list of integers can be
+ defined like this:
+
+ struct int_array
+ {
+ // Pointer to result array followed by its length,
+ // as required by DYNARRAY_FINAL_TYPE.
+ int *array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_int
+ #define DYNARRAY_ELEMENT int
+ #define DYNARRAY_PREFIX dynarray_int_
+ #define DYNARRAY_FINAL_TYPE struct int_array
+ #include <malloc/dynarray-skeleton.c>
+
+ To create a three-element array with elements 1, 2, 3, use this
+ code:
+
+ struct dynarray_int dyn;
+ dynarray_int_init (&dyn);
+ for (int i = 1; i <= 3; ++i)
+ {
+ int *place = dynarray_int_emplace (&dyn);
+ assert (place != NULL);
+ *place = i;
+ }
+ struct int_array result;
+ bool ok = dynarray_int_finalize (&dyn, &result);
+ assert (ok);
+ assert (result.length == 3);
+ assert (result.array[0] == 1);
+ assert (result.array[1] == 2);
+ assert (result.array[2] == 3);
+ free (result.array);
+
+ If the elements contain resources which must be freed, define
+ DYNARRAY_ELEMENT_FREE appropriately, like this:
+
+ struct str_array
+ {
+ char **array;
+ size_t length;
+ };
+
+ #define DYNARRAY_STRUCT dynarray_str
+ #define DYNARRAY_ELEMENT char *
+ #define DYNARRAY_ELEMENT_FREE(ptr) free (*ptr)
+ #define DYNARRAY_PREFIX dynarray_str_
+ #define DYNARRAY_FINAL_TYPE struct str_array
+ #include <malloc/dynarray-skeleton.c>
+
+ Compared to scratch buffers, dynamic arrays have the following
+ features:
+
+ - They have an element type, and are not just an untyped buffer of
+ bytes.
+
+ - When growing, previously stored elements are preserved. (It is
+ expected that scratch_buffer_grow_preserve and
+ scratch_buffer_set_array_size eventually go away because all
+ current users are moved to dynamic arrays.)
+
+ - Scratch buffers have a more aggressive growth policy because
+ growing them typically means a retry of an operation (across an
+ NSS service module boundary), which is expensive.
+
+ - For the same reason, scratch buffers have a much larger initial
+ stack allocation. */
+
+#ifndef _DYNARRAY_H
+#define _DYNARRAY_H
+
+#include <stddef.h>
+#include <string.h>
+
+struct dynarray_header
+{
+ size_t used;
+ size_t allocated;
+ void *array;
+};
+
+/* Marker used in the allocated member to indicate that an error was
+ encountered. */
+static inline size_t
+__dynarray_error_marker (void)
+{
+ return -1;
+}
+
+/* Internal function. See the has_failed function in
+ dynarray-skeleton.c. */
+static inline bool
+__dynarray_error (struct dynarray_header *list)
+{
+ return list->allocated == __dynarray_error_marker ();
+}
+
+/* Internal function. Enlarge the dynamically allocated area of the
+ array to make room for one more element. SCRATCH is a pointer to
+ the scratch area (which is not heap-allocated and must not be
+ freed). ELEMENT_SIZE is the size, in bytes, of one element.
+ Return false on failure, true on success. */
+bool __libc_dynarray_emplace_enlarge (struct dynarray_header *,
+ void *scratch, size_t element_size);
+
+/* Internal function. Enlarge the dynamically allocated area of the
+ array to make room for at least SIZE elements (which must be larger
+ than the existing used part of the dynamic array). SCRATCH is a
+ pointer to the scratch area (which is not heap-allocated and must
+ not be freed). ELEMENT_SIZE is the size, in bytes, of one element.
+ Return false on failure, true on success. */
+bool __libc_dynarray_resize (struct dynarray_header *, size_t size,
+ void *scratch, size_t element_size);
+
+/* Internal function. Like __libc_dynarray_resize, but clear the new
+ part of the dynamic array. */
+bool __libc_dynarray_resize_clear (struct dynarray_header *, size_t size,
+ void *scratch, size_t element_size);
+
+/* Internal type. */
+struct dynarray_finalize_result
+{
+ void *array;
+ size_t length;
+};
+
+/* Internal function. Copy the dynamically-allocated area to an
+ explicitly-sized heap allocation. SCRATCH is a pointer to the
+ embedded scratch space. ELEMENT_SIZE is the size, in bytes, of the
+ element type. On success, true is returned, and pointer and length
+ are written to *RESULT. On failure, false is returned. The caller
+ has to take care of some of the memory management; this function is
+ expected to be called from dynarray-skeleton.c. */
+bool __libc_dynarray_finalize (struct dynarray_header *list, void *scratch,
+ size_t element_size,
+ struct dynarray_finalize_result *result);
+
+
+/* Internal function. Terminate the process after an index error.
+ SIZE is the number of elements of the dynamic array. INDEX is the
+ lookup index which triggered the failure. */
+_Noreturn void __libc_dynarray_at_failure (size_t size, size_t index);
+
+#ifndef _ISOMAC
+libc_hidden_proto (__libc_dynarray_emplace_enlarge)
+libc_hidden_proto (__libc_dynarray_resize)
+libc_hidden_proto (__libc_dynarray_resize_clear)
+libc_hidden_proto (__libc_dynarray_finalize)
+libc_hidden_proto (__libc_dynarray_at_failure)
+#endif
+
+#endif /* _DYNARRAY_H */
diff --git a/gl/malloc/dynarray_at_failure.c b/gl/malloc/dynarray_at_failure.c
new file mode 100644
index 0000000..ebc9310
--- /dev/null
+++ b/gl/malloc/dynarray_at_failure.c
@@ -0,0 +1,40 @@
+/* Report an dynamic array index out of bounds condition.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+# include <stdlib.h>
+#endif
+
+#include <dynarray.h>
+#include <stdio.h>
+
+void
+__libc_dynarray_at_failure (size_t size, size_t index)
+{
+#ifdef _LIBC
+ char buf[200];
+ __snprintf (buf, sizeof (buf), "Fatal glibc error: "
+ "array index %zu not less than array length %zu\n",
+ index, size);
+ __libc_fatal (buf);
+#else
+ abort ();
+#endif
+}
+libc_hidden_def (__libc_dynarray_at_failure)
diff --git a/gl/malloc/dynarray_emplace_enlarge.c b/gl/malloc/dynarray_emplace_enlarge.c
new file mode 100644
index 0000000..7da5393
--- /dev/null
+++ b/gl/malloc/dynarray_emplace_enlarge.c
@@ -0,0 +1,77 @@
+/* Increase the size of a dynamic array in preparation of an emplace operation.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <errno.h>
+#include <intprops.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_emplace_enlarge (struct dynarray_header *list,
+ void *scratch, size_t element_size)
+{
+ size_t new_allocated;
+ if (list->allocated == 0)
+ {
+ /* No scratch buffer provided. Choose a reasonable default
+ size. */
+ if (element_size < 4)
+ new_allocated = 16;
+ else if (element_size < 8)
+ new_allocated = 8;
+ else
+ new_allocated = 4;
+ }
+ else
+ /* Increase the allocated size, using an exponential growth
+ policy. */
+ {
+ new_allocated = list->allocated + list->allocated / 2 + 1;
+ if (new_allocated <= list->allocated)
+ {
+ /* Overflow. */
+ __set_errno (ENOMEM);
+ return false;
+ }
+ }
+
+ size_t new_size;
+ if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size))
+ return false;
+ void *new_array;
+ if (list->array == scratch)
+ {
+ /* The previous array was not heap-allocated. */
+ new_array = malloc (new_size);
+ if (new_array != NULL && list->array != NULL)
+ memcpy (new_array, list->array, list->used * element_size);
+ }
+ else
+ new_array = realloc (list->array, new_size);
+ if (new_array == NULL)
+ return false;
+ list->array = new_array;
+ list->allocated = new_allocated;
+ return true;
+}
+libc_hidden_def (__libc_dynarray_emplace_enlarge)
diff --git a/gl/malloc/dynarray_finalize.c b/gl/malloc/dynarray_finalize.c
new file mode 100644
index 0000000..673595a
--- /dev/null
+++ b/gl/malloc/dynarray_finalize.c
@@ -0,0 +1,66 @@
+/* Copy the dynamically-allocated area to an explicitly-sized heap allocation.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_finalize (struct dynarray_header *list,
+ void *scratch, size_t element_size,
+ struct dynarray_finalize_result *result)
+{
+ if (__dynarray_error (list))
+ /* The caller will reported the deferred error. */
+ return false;
+
+ size_t used = list->used;
+
+ /* Empty list. */
+ if (used == 0)
+ {
+ /* An empty list could still be backed by a heap-allocated
+ array. Free it if necessary. */
+ if (list->array != scratch)
+ free (list->array);
+ *result = (struct dynarray_finalize_result) { NULL, 0 };
+ return true;
+ }
+
+ size_t allocation_size = used * element_size;
+ void *heap_array = malloc (allocation_size);
+ if (heap_array != NULL)
+ {
+ /* The new array takes ownership of the strings. */
+ if (list->array != NULL)
+ memcpy (heap_array, list->array, allocation_size);
+ if (list->array != scratch)
+ free (list->array);
+ *result = (struct dynarray_finalize_result)
+ { .array = heap_array, .length = used };
+ return true;
+ }
+ else
+ /* The caller will perform the freeing operation. */
+ return false;
+}
+libc_hidden_def (__libc_dynarray_finalize)
diff --git a/gl/malloc/dynarray_resize.c b/gl/malloc/dynarray_resize.c
new file mode 100644
index 0000000..7ecd4de
--- /dev/null
+++ b/gl/malloc/dynarray_resize.c
@@ -0,0 +1,68 @@
+/* Increase the size of a dynamic array.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <errno.h>
+#include <intprops.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_resize (struct dynarray_header *list, size_t size,
+ void *scratch, size_t element_size)
+{
+ /* The existing allocation provides sufficient room. */
+ if (size <= list->allocated)
+ {
+ list->used = size;
+ return true;
+ }
+
+ /* Otherwise, use size as the new allocation size. The caller is
+ expected to provide the final size of the array, so there is no
+ over-allocation here. */
+
+ size_t new_size_bytes;
+ if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes))
+ {
+ /* Overflow. */
+ __set_errno (ENOMEM);
+ return false;
+ }
+ void *new_array;
+ if (list->array == scratch)
+ {
+ /* The previous array was not heap-allocated. */
+ new_array = malloc (new_size_bytes);
+ if (new_array != NULL && list->array != NULL)
+ memcpy (new_array, list->array, list->used * element_size);
+ }
+ else
+ new_array = realloc (list->array, new_size_bytes);
+ if (new_array == NULL)
+ return false;
+ list->array = new_array;
+ list->allocated = size;
+ list->used = size;
+ return true;
+}
+libc_hidden_def (__libc_dynarray_resize)
diff --git a/gl/malloc/dynarray_resize_clear.c b/gl/malloc/dynarray_resize_clear.c
new file mode 100644
index 0000000..bb23c52
--- /dev/null
+++ b/gl/malloc/dynarray_resize_clear.c
@@ -0,0 +1,39 @@
+/* Increase the size of a dynamic array and clear the new part.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <string.h>
+
+bool
+__libc_dynarray_resize_clear (struct dynarray_header *list, size_t size,
+ void *scratch, size_t element_size)
+{
+ size_t old_size = list->used;
+ if (!__libc_dynarray_resize (list, size, scratch, element_size))
+ return false;
+ /* __libc_dynarray_resize already checked for overflow. */
+ char *array = list->array;
+ memset (array + (old_size * element_size), 0,
+ (size - old_size) * element_size);
+ return true;
+}
+libc_hidden_def (__libc_dynarray_resize_clear)
diff --git a/gl/malloca.c b/gl/malloca.c
new file mode 100644
index 0000000..f055b1e
--- /dev/null
+++ b/gl/malloca.c
@@ -0,0 +1,112 @@
+/* Safe automatic memory allocation.
+ Copyright (C) 2003, 2006-2007, 2009-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#define _GL_USE_STDLIB_ALLOC 1
+#include <config.h>
+
+/* Specification. */
+#include "malloca.h"
+
+#include <stdckdint.h>
+
+#include "idx.h"
+
+/* The speed critical point in this file is freea() applied to an alloca()
+ result: it must be fast, to match the speed of alloca(). The speed of
+ mmalloca() and freea() in the other case are not critical, because they
+ are only invoked for big memory sizes.
+ Here we use a bit in the address as an indicator, an idea by Ondřej Bílka.
+ malloca() can return three types of pointers:
+ - Pointers ≡ 0 mod 2*sa_alignment_max come from stack allocation.
+ - Pointers ≡ sa_alignment_max mod 2*sa_alignment_max come from heap
+ allocation.
+ - NULL comes from a failed heap allocation. */
+
+/* Type for holding very small pointer differences. */
+typedef unsigned char small_t;
+/* Verify that it is wide enough. */
+static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
+
+void *
+mmalloca (size_t n)
+{
+#if HAVE_ALLOCA
+ /* Allocate one more word, used to determine the address to pass to freea(),
+ and room for the alignment ≡ sa_alignment_max mod 2*sa_alignment_max. */
+ uintptr_t alignment2_mask = 2 * sa_alignment_max - 1;
+ int plus = sizeof (small_t) + alignment2_mask;
+ idx_t nplus;
+ if (!ckd_add (&nplus, n, plus) && !xalloc_oversized (nplus, 1))
+ {
+ char *mem = (char *) malloc (nplus);
+
+ if (mem != NULL)
+ {
+ uintptr_t umem = (uintptr_t)mem, umemplus;
+ /* The ckd_add avoids signed integer overflow on
+ theoretical platforms where UINTPTR_MAX <= INT_MAX. */
+ ckd_add (&umemplus, umem, sizeof (small_t) + sa_alignment_max - 1);
+ idx_t offset = ((umemplus & ~alignment2_mask)
+ + sa_alignment_max - umem);
+ void *vp = mem + offset;
+ small_t *p = vp;
+ /* Here p >= mem + sizeof (small_t),
+ and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
+ hence p + n <= mem + nplus.
+ So, the memory range [p, p+n) lies in the allocated memory range
+ [mem, mem + nplus). */
+ p[-1] = offset;
+ /* p ≡ sa_alignment_max mod 2*sa_alignment_max. */
+ return p;
+ }
+ }
+ /* Out of memory. */
+ return NULL;
+#else
+# if !MALLOC_0_IS_NONNULL
+ if (n == 0)
+ n = 1;
+# endif
+ return malloc (n);
+#endif
+}
+
+#if HAVE_ALLOCA
+void
+freea (void *p)
+{
+ /* Check argument. */
+ if ((uintptr_t) p & (sa_alignment_max - 1))
+ {
+ /* p was not the result of a malloca() call. Invalid argument. */
+ abort ();
+ }
+ /* Determine whether p was a non-NULL pointer returned by mmalloca(). */
+ if ((uintptr_t) p & sa_alignment_max)
+ {
+ void *mem = (char *) p - ((small_t *) p)[-1];
+ free (mem);
+ }
+}
+#endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
diff --git a/gl/malloca.h b/gl/malloca.h
new file mode 100644
index 0000000..325c727
--- /dev/null
+++ b/gl/malloca.h
@@ -0,0 +1,126 @@
+/* Safe automatic memory allocation.
+ Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _MALLOCA_H
+#define _MALLOCA_H
+
+#include <alloca.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#include "xalloc-oversized.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
+ alloca(N); otherwise it returns NULL. It either returns N bytes of
+ memory allocated on the stack, that lasts until the function returns,
+ or NULL.
+ Use of safe_alloca should be avoided:
+ - inside arguments of function calls - undefined behaviour,
+ - in inline functions - the allocation may actually last until the
+ calling function returns.
+*/
+#if HAVE_ALLOCA
+/* The OS usually guarantees only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ allocate anything larger than 4096 bytes. Also care for the possibility
+ of a few compiler-allocated temporary stack slots.
+ This must be a macro, not a function. */
+# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL)
+#else
+# define safe_alloca(N) ((void) (N), NULL)
+#endif
+
+/* Free a block of memory allocated through malloca(). */
+#if HAVE_ALLOCA
+extern void freea (void *p);
+#else
+# define freea free
+#endif
+
+/* malloca(N) is a safe variant of alloca(N). It allocates N bytes of
+ memory allocated on the stack, that must be freed using freea() before
+ the function returns. Upon failure, it returns NULL. */
+#if HAVE_ALLOCA
+# define malloca(N) \
+ ((N) < 4032 - (2 * sa_alignment_max - 1) \
+ ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
+ + (2 * sa_alignment_max - 1)) \
+ & ~(uintptr_t)(2 * sa_alignment_max - 1)) \
+ : mmalloca (N))
+#else
+# define malloca(N) \
+ mmalloca (N)
+#endif
+extern void *mmalloca (size_t n)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (freea, 1)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1));
+
+/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S).
+ It allocates an array of N objects, each with S bytes of memory,
+ on the stack. N and S should be nonnegative and free of side effects.
+ The array must be freed using freea() before the function returns. */
+#define nmalloca(n, s) \
+ (xalloc_oversized (n, s) ? NULL : malloca ((n) * (size_t) (s)))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* ------------------- Auxiliary, non-public definitions ------------------- */
+
+/* Determine the alignment of a type at compile time. */
+#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+# define sa_alignof __alignof__
+#elif defined __cplusplus
+ template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
+# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
+#elif defined __hpux
+ /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
+ values. */
+# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
+#elif defined _AIX
+ /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
+ values. */
+# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
+#else
+# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
+#endif
+
+enum
+{
+/* The desired alignment of memory allocations is the maximum alignment
+ among all elementary types. */
+ sa_alignment_long = sa_alignof (long),
+ sa_alignment_double = sa_alignof (double),
+ sa_alignment_longlong = sa_alignof (long long),
+ sa_alignment_longdouble = sa_alignof (long double),
+ sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
+ | (sa_alignment_longlong - 1)
+ | (sa_alignment_longdouble - 1)
+ ) + 1
+};
+
+#endif /* _MALLOCA_H */
diff --git a/gl/math.c b/gl/math.c
new file mode 100644
index 0000000..67cabbc
--- /dev/null
+++ b/gl/math.c
@@ -0,0 +1,22 @@
+/* Inline functions for <math.h>.
+
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define _GL_MATH_INLINE _GL_EXTERN_INLINE
+#include "math.h"
+typedef int dummy;
diff --git a/gl/math.in.h b/gl/math.in.h
new file mode 100644
index 0000000..f3d58af
--- /dev/null
+++ b/gl/math.in.h
@@ -0,0 +1,2727 @@
+/* A GNU-like <math.h>.
+
+ Copyright (C) 2002-2003, 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_MATH_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_INCLUDING_MATH_H
+/* Special invocation convention:
+ - On FreeBSD 12.2 we have a sequence of nested includes
+ <math.h> -> <stdlib.h> -> <sys/wait.h> -> <sys/types.h> -> <sys/select.h>
+ -> <signal.h> -> <pthread.h> -> <stdlib.h> -> <math.h>
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+
+#else
+/* Normal invocation convention. */
+
+/* The include_next requires a split double-inclusion guard. */
+#define _GL_INCLUDING_MATH_H
+#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+#undef _GL_INCLUDING_MATH_H
+
+#ifndef _@GUARD_PREFIX@_MATH_H
+#define _@GUARD_PREFIX@_MATH_H
+
+/* On OpenVMS, NAN, INFINITY, and HUGEVAL macros are defined in <fp.h>. */
+#if defined __VMS && ! defined NAN
+# include <fp.h>
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_MATH_INLINE
+# define _GL_MATH_INLINE _GL_INLINE
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __const__ was added in gcc 2.95. */
+#ifndef _GL_ATTRIBUTE_CONST
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) || defined __clang__
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+# else
+# define _GL_ATTRIBUTE_CONST /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#ifdef __cplusplus
+/* Helper macros to define type-generic function FUNC as overloaded functions,
+ rather than as macros like in C. POSIX declares these with an argument of
+ real-floating (that is, one of float, double, or long double). */
+# define _GL_MATH_CXX_REAL_FLOATING_DECL_1(func) \
+static inline int \
+_gl_cxx_ ## func ## f (float f) \
+{ \
+ return func (f); \
+} \
+static inline int \
+_gl_cxx_ ## func ## d (double d) \
+{ \
+ return func (d); \
+} \
+static inline int \
+_gl_cxx_ ## func ## l (long double l) \
+{ \
+ return func (l); \
+}
+# define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func,rpl_func,rettype) \
+_GL_BEGIN_NAMESPACE \
+inline rettype \
+rpl_func (float f) \
+{ \
+ return _gl_cxx_ ## func ## f (f); \
+} \
+inline rettype \
+rpl_func (double d) \
+{ \
+ return _gl_cxx_ ## func ## d (d); \
+} \
+inline rettype \
+rpl_func (long double l) \
+{ \
+ return _gl_cxx_ ## func ## l (l); \
+} \
+_GL_END_NAMESPACE
+#endif
+
+/* Helper macros to define a portability warning for the
+ classification macro FUNC called with VALUE. POSIX declares the
+ classification macros with an argument of real-floating (that is,
+ one of float, double, or long double). */
+#define _GL_WARN_REAL_FLOATING_DECL(func) \
+_GL_MATH_INLINE int \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - " \
+ "use gnulib module " #func " for portability") \
+rpl_ ## func ## f (float f) \
+{ \
+ return func (f); \
+} \
+_GL_MATH_INLINE int \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - " \
+ "use gnulib module " #func " for portability") \
+rpl_ ## func ## d (double d) \
+{ \
+ return func (d); \
+} \
+_GL_MATH_INLINE int \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - " \
+ "use gnulib module " #func " for portability") \
+rpl_ ## func ## l (long double l) \
+{ \
+ return func (l); \
+}
+#define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
+ (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value) \
+ : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value) \
+ : rpl_ ## func ## l (value))
+
+
+#if @REPLACE_ITOLD@
+/* Pull in a function that fixes the 'int' to 'long double' conversion
+ of glibc 2.7. */
+_GL_EXTERN_C void _Qp_itoq (long double *, int);
+static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
+#endif
+
+
+/* POSIX allows platforms that don't support NAN. But all major
+ machines in the past 15 years have supported something close to
+ IEEE NaN, so we define this unconditionally. We also must define
+ it on platforms like Solaris 10, where NAN is present but defined
+ as a function pointer rather than a floating point constant. */
+#if !defined NAN || @REPLACE_NAN@
+# if !GNULIB_defined_NAN
+# undef NAN
+ /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler
+ choke on the expression 0.0 / 0.0. */
+# if defined __DECC || defined _MSC_VER
+_GL_MATH_INLINE float
+_NaN ()
+{
+ static float zero = 0.0f;
+ return zero / zero;
+}
+# define NAN (_NaN())
+# else
+# define NAN (0.0f / 0.0f)
+# endif
+# define GNULIB_defined_NAN 1
+# endif
+#endif
+
+/* Solaris 10 defines HUGE_VAL, but as a function pointer rather
+ than a floating point constant. */
+#if @REPLACE_HUGE_VAL@
+# undef HUGE_VALF
+# define HUGE_VALF (1.0f / 0.0f)
+# undef HUGE_VAL
+# define HUGE_VAL (1.0 / 0.0)
+# undef HUGE_VALL
+# define HUGE_VALL (1.0L / 0.0L)
+#endif
+
+/* HUGE_VALF is a 'float' Infinity. */
+#ifndef HUGE_VALF
+# if defined _MSC_VER
+/* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f. */
+# define HUGE_VALF (1e25f * 1e25f)
+# else
+# define HUGE_VALF (1.0f / 0.0f)
+# endif
+#endif
+
+/* HUGE_VAL is a 'double' Infinity. */
+#ifndef HUGE_VAL
+# if defined _MSC_VER
+/* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. */
+# define HUGE_VAL (1e250 * 1e250)
+# else
+# define HUGE_VAL (1.0 / 0.0)
+# endif
+#endif
+
+/* HUGE_VALL is a 'long double' Infinity. */
+#ifndef HUGE_VALL
+# if defined _MSC_VER
+/* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L. */
+# define HUGE_VALL (1e250L * 1e250L)
+# else
+# define HUGE_VALL (1.0L / 0.0L)
+# endif
+#endif
+
+
+#if defined FP_ILOGB0 && defined FP_ILOGBNAN
+ /* Ensure FP_ILOGB0 and FP_ILOGBNAN are correct. */
+# if defined __HAIKU__
+ /* Haiku: match what ilogb() does */
+# undef FP_ILOGB0
+# undef FP_ILOGBNAN
+# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
+# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# endif
+#else
+ /* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined. */
+# if defined __NetBSD__ || defined __sgi
+ /* NetBSD, IRIX 6.5: match what ilogb() does */
+# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
+# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# elif defined _AIX
+ /* AIX 5.1: match what ilogb() does in AIX >= 5.2 */
+# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
+# define FP_ILOGBNAN 2147483647 /* INT_MAX */
+# elif defined __sun
+ /* Solaris 9: match what ilogb() does */
+# define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
+# define FP_ILOGBNAN 2147483647 /* INT_MAX */
+# else
+ /* Gnulib defined values. */
+# define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
+# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# endif
+#endif
+
+
+#if @GNULIB_ACOSF@
+# if @REPLACE_ACOSF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef acosf
+# define acosf rpl_acosf
+# endif
+_GL_FUNCDECL_RPL (acosf, float, (float x));
+_GL_CXXALIAS_RPL (acosf, float, (float x));
+# else
+# if !@HAVE_ACOSF@
+# undef acosf
+_GL_FUNCDECL_SYS (acosf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (acosf, float, (float x));
+# endif
+_GL_CXXALIASWARN (acosf);
+#elif defined GNULIB_POSIXCHECK
+# undef acosf
+# if HAVE_RAW_DECL_ACOSF
+_GL_WARN_ON_USE (acosf, "acosf is unportable - "
+ "use gnulib module acosf for portability");
+# endif
+#endif
+
+#if @GNULIB_ACOSL@
+# if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
+# undef acosl
+_GL_FUNCDECL_SYS (acosl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (acosl, long double, (long double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (acosl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef acosl
+# if HAVE_RAW_DECL_ACOSL
+_GL_WARN_ON_USE (acosl, "acosl is unportable - "
+ "use gnulib module acosl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ASINF@
+# if @REPLACE_ASINF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef asinf
+# define asinf rpl_asinf
+# endif
+_GL_FUNCDECL_RPL (asinf, float, (float x));
+_GL_CXXALIAS_RPL (asinf, float, (float x));
+# else
+# if !@HAVE_ASINF@
+# undef asinf
+_GL_FUNCDECL_SYS (asinf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (asinf, float, (float x));
+# endif
+_GL_CXXALIASWARN (asinf);
+#elif defined GNULIB_POSIXCHECK
+# undef asinf
+# if HAVE_RAW_DECL_ASINF
+_GL_WARN_ON_USE (asinf, "asinf is unportable - "
+ "use gnulib module asinf for portability");
+# endif
+#endif
+
+#if @GNULIB_ASINL@
+# if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
+# undef asinl
+_GL_FUNCDECL_SYS (asinl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (asinl, long double, (long double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (asinl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef asinl
+# if HAVE_RAW_DECL_ASINL
+_GL_WARN_ON_USE (asinl, "asinl is unportable - "
+ "use gnulib module asinl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ATANF@
+# if @REPLACE_ATANF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef atanf
+# define atanf rpl_atanf
+# endif
+_GL_FUNCDECL_RPL (atanf, float, (float x));
+_GL_CXXALIAS_RPL (atanf, float, (float x));
+# else
+# if !@HAVE_ATANF@
+# undef atanf
+_GL_FUNCDECL_SYS (atanf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (atanf, float, (float x));
+# endif
+_GL_CXXALIASWARN (atanf);
+#elif defined GNULIB_POSIXCHECK
+# undef atanf
+# if HAVE_RAW_DECL_ATANF
+_GL_WARN_ON_USE (atanf, "atanf is unportable - "
+ "use gnulib module atanf for portability");
+# endif
+#endif
+
+#if @GNULIB_ATANL@
+# if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
+# undef atanl
+_GL_FUNCDECL_SYS (atanl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (atanl, long double, (long double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (atanl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef atanl
+# if HAVE_RAW_DECL_ATANL
+_GL_WARN_ON_USE (atanl, "atanl is unportable - "
+ "use gnulib module atanl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ATAN2F@
+# if @REPLACE_ATAN2F@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef atan2f
+# define atan2f rpl_atan2f
+# endif
+_GL_FUNCDECL_RPL (atan2f, float, (float y, float x));
+_GL_CXXALIAS_RPL (atan2f, float, (float y, float x));
+# else
+# if !@HAVE_ATAN2F@
+# undef atan2f
+_GL_FUNCDECL_SYS (atan2f, float, (float y, float x));
+# endif
+_GL_CXXALIAS_SYS (atan2f, float, (float y, float x));
+# endif
+_GL_CXXALIASWARN (atan2f);
+#elif defined GNULIB_POSIXCHECK
+# undef atan2f
+# if HAVE_RAW_DECL_ATAN2F
+_GL_WARN_ON_USE (atan2f, "atan2f is unportable - "
+ "use gnulib module atan2f for portability");
+# endif
+#endif
+
+
+#if @GNULIB_CBRTF@
+# if @REPLACE_CBRTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef cbrtf
+# define cbrtf rpl_cbrtf
+# endif
+_GL_FUNCDECL_RPL (cbrtf, float, (float x));
+_GL_CXXALIAS_RPL (cbrtf, float, (float x));
+# else
+# if !@HAVE_DECL_CBRTF@
+_GL_FUNCDECL_SYS (cbrtf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (cbrtf, float, (float x));
+# endif
+_GL_CXXALIASWARN (cbrtf);
+#elif defined GNULIB_POSIXCHECK
+# undef cbrtf
+# if HAVE_RAW_DECL_CBRTF
+_GL_WARN_ON_USE (cbrtf, "cbrtf is unportable - "
+ "use gnulib module cbrtf for portability");
+# endif
+#endif
+
+#if @GNULIB_CBRT@
+# if !@HAVE_CBRT@
+_GL_FUNCDECL_SYS (cbrt, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (cbrt, double, (double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (cbrt, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef cbrt
+# if HAVE_RAW_DECL_CBRT
+_GL_WARN_ON_USE (cbrt, "cbrt is unportable - "
+ "use gnulib module cbrt for portability");
+# endif
+#endif
+
+#if @GNULIB_CBRTL@
+# if @REPLACE_CBRTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef cbrtl
+# define cbrtl rpl_cbrtl
+# endif
+_GL_FUNCDECL_RPL (cbrtl, long double, (long double x));
+_GL_CXXALIAS_RPL (cbrtl, long double, (long double x));
+# else
+# if !@HAVE_DECL_CBRTL@
+_GL_FUNCDECL_SYS (cbrtl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (cbrtl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (cbrtl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef cbrtl
+# if HAVE_RAW_DECL_CBRTL
+_GL_WARN_ON_USE (cbrtl, "cbrtl is unportable - "
+ "use gnulib module cbrtl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_CEILF@
+# if @REPLACE_CEILF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ceilf
+# define ceilf rpl_ceilf
+# endif
+_GL_FUNCDECL_RPL (ceilf, float, (float x));
+_GL_CXXALIAS_RPL (ceilf, float, (float x));
+# else
+# if !@HAVE_DECL_CEILF@
+# undef ceilf
+_GL_FUNCDECL_SYS (ceilf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (ceilf, float, (float x));
+# endif
+_GL_CXXALIASWARN (ceilf);
+#elif defined GNULIB_POSIXCHECK
+# undef ceilf
+# if HAVE_RAW_DECL_CEILF
+_GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
+ "use gnulib module ceilf for portability");
+# endif
+#endif
+
+#if @GNULIB_CEIL@
+# if @REPLACE_CEIL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ceil
+# define ceil rpl_ceil
+# endif
+_GL_FUNCDECL_RPL (ceil, double, (double x));
+_GL_CXXALIAS_RPL (ceil, double, (double x));
+# else
+_GL_CXXALIAS_SYS (ceil, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (ceil, double, (double x));
+# endif
+#endif
+
+#if @GNULIB_CEILL@
+# if @REPLACE_CEILL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ceill
+# define ceill rpl_ceill
+# endif
+_GL_FUNCDECL_RPL (ceill, long double, (long double x));
+_GL_CXXALIAS_RPL (ceill, long double, (long double x));
+# else
+# if !@HAVE_DECL_CEILL@
+# undef ceill
+_GL_FUNCDECL_SYS (ceill, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (ceill, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ceill);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef ceill
+# if HAVE_RAW_DECL_CEILL
+_GL_WARN_ON_USE (ceill, "ceill is unportable - "
+ "use gnulib module ceill for portability");
+# endif
+#endif
+
+
+#if @GNULIB_COPYSIGNF@
+# if !@HAVE_DECL_COPYSIGNF@
+# undef copysignf
+_GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
+# endif
+_GL_CXXALIAS_SYS (copysignf, float, (float x, float y));
+_GL_CXXALIASWARN (copysignf);
+#elif defined GNULIB_POSIXCHECK
+# undef copysignf
+# if HAVE_RAW_DECL_COPYSIGNF
+_GL_WARN_ON_USE (copysignf, "copysignf is unportable - "
+ "use gnulib module copysignf for portability");
+# endif
+#endif
+
+#if @GNULIB_COPYSIGN@
+# if !@HAVE_COPYSIGN@
+_GL_FUNCDECL_SYS (copysign, double, (double x, double y));
+# endif
+_GL_CXXALIAS_SYS (copysign, double, (double x, double y));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (copysign, double, (double x, double y));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef copysign
+# if HAVE_RAW_DECL_COPYSIGN
+_GL_WARN_ON_USE (copysign, "copysign is unportable - "
+ "use gnulib module copysign for portability");
+# endif
+#endif
+
+#if @GNULIB_COPYSIGNL@
+# if !@HAVE_COPYSIGNL@
+_GL_FUNCDECL_SYS (copysignl, long double, (long double x, long double y));
+# endif
+_GL_CXXALIAS_SYS (copysignl, long double, (long double x, long double y));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (copysignl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef copysignl
+# if HAVE_RAW_DECL_COPYSIGNL
+_GL_WARN_ON_USE (copysign, "copysignl is unportable - "
+ "use gnulib module copysignl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_COSF@
+# if @REPLACE_COSF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef cosf
+# define cosf rpl_cosf
+# endif
+_GL_FUNCDECL_RPL (cosf, float, (float x));
+_GL_CXXALIAS_RPL (cosf, float, (float x));
+# else
+# if !@HAVE_COSF@
+# undef cosf
+_GL_FUNCDECL_SYS (cosf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (cosf, float, (float x));
+# endif
+_GL_CXXALIASWARN (cosf);
+#elif defined GNULIB_POSIXCHECK
+# undef cosf
+# if HAVE_RAW_DECL_COSF
+_GL_WARN_ON_USE (cosf, "cosf is unportable - "
+ "use gnulib module cosf for portability");
+# endif
+#endif
+
+#if @GNULIB_COSL@
+# if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
+# undef cosl
+_GL_FUNCDECL_SYS (cosl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (cosl, long double, (long double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (cosl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef cosl
+# if HAVE_RAW_DECL_COSL
+_GL_WARN_ON_USE (cosl, "cosl is unportable - "
+ "use gnulib module cosl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_COSHF@
+# if @REPLACE_COSHF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef coshf
+# define coshf rpl_coshf
+# endif
+_GL_FUNCDECL_RPL (coshf, float, (float x));
+_GL_CXXALIAS_RPL (coshf, float, (float x));
+# else
+# if !@HAVE_COSHF@
+# undef coshf
+_GL_FUNCDECL_SYS (coshf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (coshf, float, (float x));
+# endif
+_GL_CXXALIASWARN (coshf);
+#elif defined GNULIB_POSIXCHECK
+# undef coshf
+# if HAVE_RAW_DECL_COSHF
+_GL_WARN_ON_USE (coshf, "coshf is unportable - "
+ "use gnulib module coshf for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXPF@
+# if @REPLACE_EXPF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef expf
+# define expf rpl_expf
+# endif
+_GL_FUNCDECL_RPL (expf, float, (float x));
+_GL_CXXALIAS_RPL (expf, float, (float x));
+# else
+# if !@HAVE_EXPF@
+# undef expf
+_GL_FUNCDECL_SYS (expf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (expf, float, (float x));
+# endif
+_GL_CXXALIASWARN (expf);
+#elif defined GNULIB_POSIXCHECK
+# undef expf
+# if HAVE_RAW_DECL_EXPF
+_GL_WARN_ON_USE (expf, "expf is unportable - "
+ "use gnulib module expf for portability");
+# endif
+#endif
+
+#if @GNULIB_EXPL@
+# if @REPLACE_EXPL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef expl
+# define expl rpl_expl
+# endif
+_GL_FUNCDECL_RPL (expl, long double, (long double x));
+_GL_CXXALIAS_RPL (expl, long double, (long double x));
+# else
+# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
+# undef expl
+_GL_FUNCDECL_SYS (expl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (expl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (expl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef expl
+# if HAVE_RAW_DECL_EXPL
+_GL_WARN_ON_USE (expl, "expl is unportable - "
+ "use gnulib module expl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXP2F@
+# if !@HAVE_DECL_EXP2F@
+_GL_FUNCDECL_SYS (exp2f, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (exp2f, float, (float x));
+_GL_CXXALIASWARN (exp2f);
+#elif defined GNULIB_POSIXCHECK
+# undef exp2f
+# if HAVE_RAW_DECL_EXP2F
+_GL_WARN_ON_USE (exp2f, "exp2f is unportable - "
+ "use gnulib module exp2f for portability");
+# endif
+#endif
+
+#if @GNULIB_EXP2@
+# if @REPLACE_EXP2@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef exp2
+# define exp2 rpl_exp2
+# endif
+_GL_FUNCDECL_RPL (exp2, double, (double x));
+_GL_CXXALIAS_RPL (exp2, double, (double x));
+# else
+# if !@HAVE_DECL_EXP2@
+_GL_FUNCDECL_SYS (exp2, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (exp2, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (exp2, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef exp2
+# if HAVE_RAW_DECL_EXP2
+_GL_WARN_ON_USE (exp2, "exp2 is unportable - "
+ "use gnulib module exp2 for portability");
+# endif
+#endif
+
+#if @GNULIB_EXP2L@
+# if @REPLACE_EXP2L@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef exp2l
+# define exp2l rpl_exp2l
+# endif
+_GL_FUNCDECL_RPL (exp2l, long double, (long double x));
+_GL_CXXALIAS_RPL (exp2l, long double, (long double x));
+# else
+# if !@HAVE_DECL_EXP2L@
+# undef exp2l
+_GL_FUNCDECL_SYS (exp2l, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (exp2l, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (exp2l);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef exp2l
+# if HAVE_RAW_DECL_EXP2L
+_GL_WARN_ON_USE (exp2l, "exp2l is unportable - "
+ "use gnulib module exp2l for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXPM1F@
+# if @REPLACE_EXPM1F@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef expm1f
+# define expm1f rpl_expm1f
+# endif
+_GL_FUNCDECL_RPL (expm1f, float, (float x));
+_GL_CXXALIAS_RPL (expm1f, float, (float x));
+# else
+# if !@HAVE_EXPM1F@
+_GL_FUNCDECL_SYS (expm1f, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (expm1f, float, (float x));
+# endif
+_GL_CXXALIASWARN (expm1f);
+#elif defined GNULIB_POSIXCHECK
+# undef expm1f
+# if HAVE_RAW_DECL_EXPM1F
+_GL_WARN_ON_USE (expm1f, "expm1f is unportable - "
+ "use gnulib module expm1f for portability");
+# endif
+#endif
+
+#if @GNULIB_EXPM1@
+# if @REPLACE_EXPM1@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef expm1
+# define expm1 rpl_expm1
+# endif
+_GL_FUNCDECL_RPL (expm1, double, (double x));
+_GL_CXXALIAS_RPL (expm1, double, (double x));
+# else
+# if !@HAVE_EXPM1@
+_GL_FUNCDECL_SYS (expm1, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (expm1, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (expm1, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef expm1
+# if HAVE_RAW_DECL_EXPM1
+_GL_WARN_ON_USE (expm1, "expm1 is unportable - "
+ "use gnulib module expm1 for portability");
+# endif
+#endif
+
+#if @GNULIB_EXPM1L@
+# if @REPLACE_EXPM1L@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef expm1l
+# define expm1l rpl_expm1l
+# endif
+_GL_FUNCDECL_RPL (expm1l, long double, (long double x));
+_GL_CXXALIAS_RPL (expm1l, long double, (long double x));
+# else
+# if !@HAVE_DECL_EXPM1L@
+# undef expm1l
+# if !(defined __cplusplus && defined _AIX)
+_GL_FUNCDECL_SYS (expm1l, long double, (long double x));
+# endif
+# endif
+_GL_CXXALIAS_SYS (expm1l, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (expm1l);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef expm1l
+# if HAVE_RAW_DECL_EXPM1L
+_GL_WARN_ON_USE (expm1l, "expm1l is unportable - "
+ "use gnulib module expm1l for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FABSF@
+# if !@HAVE_FABSF@
+# undef fabsf
+_GL_FUNCDECL_SYS (fabsf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (fabsf, float, (float x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fabsf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fabsf
+# if HAVE_RAW_DECL_FABSF
+_GL_WARN_ON_USE (fabsf, "fabsf is unportable - "
+ "use gnulib module fabsf for portability");
+# endif
+#endif
+
+#if @GNULIB_FABSL@
+# if @REPLACE_FABSL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fabsl
+# define fabsl rpl_fabsl
+# endif
+_GL_FUNCDECL_RPL (fabsl, long double, (long double x));
+_GL_CXXALIAS_RPL (fabsl, long double, (long double x));
+# else
+# if !@HAVE_FABSL@
+# undef fabsl
+_GL_FUNCDECL_SYS (fabsl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (fabsl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fabsl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fabsl
+# if HAVE_RAW_DECL_FABSL
+_GL_WARN_ON_USE (fabsl, "fabsl is unportable - "
+ "use gnulib module fabsl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FLOORF@
+# if @REPLACE_FLOORF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef floorf
+# define floorf rpl_floorf
+# endif
+_GL_FUNCDECL_RPL (floorf, float, (float x));
+_GL_CXXALIAS_RPL (floorf, float, (float x));
+# else
+# if !@HAVE_DECL_FLOORF@
+# undef floorf
+_GL_FUNCDECL_SYS (floorf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (floorf, float, (float x));
+# endif
+_GL_CXXALIASWARN (floorf);
+#elif defined GNULIB_POSIXCHECK
+# undef floorf
+# if HAVE_RAW_DECL_FLOORF
+_GL_WARN_ON_USE (floorf, "floorf is unportable - "
+ "use gnulib module floorf for portability");
+# endif
+#endif
+
+#if @GNULIB_FLOOR@
+# if @REPLACE_FLOOR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef floor
+# define floor rpl_floor
+# endif
+_GL_FUNCDECL_RPL (floor, double, (double x));
+_GL_CXXALIAS_RPL (floor, double, (double x));
+# else
+_GL_CXXALIAS_SYS (floor, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (floor, double, (double x));
+# endif
+#endif
+
+#if @GNULIB_FLOORL@
+# if @REPLACE_FLOORL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef floorl
+# define floorl rpl_floorl
+# endif
+_GL_FUNCDECL_RPL (floorl, long double, (long double x));
+_GL_CXXALIAS_RPL (floorl, long double, (long double x));
+# else
+# if !@HAVE_DECL_FLOORL@
+# undef floorl
+_GL_FUNCDECL_SYS (floorl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (floorl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (floorl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef floorl
+# if HAVE_RAW_DECL_FLOORL
+_GL_WARN_ON_USE (floorl, "floorl is unportable - "
+ "use gnulib module floorl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FMAF@
+# if @REPLACE_FMAF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fmaf
+# define fmaf rpl_fmaf
+# endif
+_GL_FUNCDECL_RPL (fmaf, float, (float x, float y, float z));
+_GL_CXXALIAS_RPL (fmaf, float, (float x, float y, float z));
+# else
+# if !@HAVE_FMAF@
+# undef fmaf
+_GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
+# endif
+_GL_CXXALIAS_SYS (fmaf, float, (float x, float y, float z));
+# endif
+_GL_CXXALIASWARN (fmaf);
+#elif defined GNULIB_POSIXCHECK
+# undef fmaf
+# if HAVE_RAW_DECL_FMAF
+_GL_WARN_ON_USE (fmaf, "fmaf is unportable - "
+ "use gnulib module fmaf for portability");
+# endif
+#endif
+
+#if @GNULIB_FMA@
+# if @REPLACE_FMA@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fma
+# define fma rpl_fma
+# endif
+_GL_FUNCDECL_RPL (fma, double, (double x, double y, double z));
+_GL_CXXALIAS_RPL (fma, double, (double x, double y, double z));
+# else
+# if !@HAVE_FMA@
+# undef fma
+_GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
+# endif
+_GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (fma, double, (double x, double y, double z));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fma
+# if HAVE_RAW_DECL_FMA
+_GL_WARN_ON_USE (fma, "fma is unportable - "
+ "use gnulib module fma for portability");
+# endif
+#endif
+
+#if @GNULIB_FMAL@
+# if @REPLACE_FMAL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fmal
+# define fmal rpl_fmal
+# endif
+_GL_FUNCDECL_RPL (fmal, long double,
+ (long double x, long double y, long double z));
+_GL_CXXALIAS_RPL (fmal, long double,
+ (long double x, long double y, long double z));
+# else
+# if !@HAVE_FMAL@
+# undef fmal
+# if !(defined __cplusplus && defined _AIX)
+_GL_FUNCDECL_SYS (fmal, long double,
+ (long double x, long double y, long double z));
+# endif
+# endif
+_GL_CXXALIAS_SYS (fmal, long double,
+ (long double x, long double y, long double z));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fmal);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fmal
+# if HAVE_RAW_DECL_FMAL
+_GL_WARN_ON_USE (fmal, "fmal is unportable - "
+ "use gnulib module fmal for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FMODF@
+# if @REPLACE_FMODF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fmodf
+# define fmodf rpl_fmodf
+# endif
+_GL_FUNCDECL_RPL (fmodf, float, (float x, float y));
+_GL_CXXALIAS_RPL (fmodf, float, (float x, float y));
+# else
+# if !@HAVE_FMODF@
+# undef fmodf
+_GL_FUNCDECL_SYS (fmodf, float, (float x, float y));
+# endif
+_GL_CXXALIAS_SYS (fmodf, float, (float x, float y));
+# endif
+_GL_CXXALIASWARN (fmodf);
+#elif defined GNULIB_POSIXCHECK
+# undef fmodf
+# if HAVE_RAW_DECL_FMODF
+_GL_WARN_ON_USE (fmodf, "fmodf is unportable - "
+ "use gnulib module fmodf for portability");
+# endif
+#endif
+
+#if @GNULIB_FMOD@
+# if @REPLACE_FMOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fmod
+# define fmod rpl_fmod
+# endif
+_GL_FUNCDECL_RPL (fmod, double, (double x, double y));
+_GL_CXXALIAS_RPL (fmod, double, (double x, double y));
+# else
+_GL_CXXALIAS_SYS (fmod, double, (double x, double y));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (fmod, double, (double x, double y));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fmod
+# if HAVE_RAW_DECL_FMOD
+_GL_WARN_ON_USE (fmod, "fmod has portability problems - "
+ "use gnulib module fmod for portability");
+# endif
+#endif
+
+#if @GNULIB_FMODL@
+# if @REPLACE_FMODL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fmodl
+# define fmodl rpl_fmodl
+# endif
+_GL_FUNCDECL_RPL (fmodl, long double, (long double x, long double y));
+_GL_CXXALIAS_RPL (fmodl, long double, (long double x, long double y));
+# else
+# if !@HAVE_FMODL@
+# undef fmodl
+_GL_FUNCDECL_SYS (fmodl, long double, (long double x, long double y));
+# endif
+_GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fmodl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fmodl
+# if HAVE_RAW_DECL_FMODL
+_GL_WARN_ON_USE (fmodl, "fmodl is unportable - "
+ "use gnulib module fmodl for portability");
+# endif
+#endif
+
+
+/* Write x as
+ x = mantissa * 2^exp
+ where
+ If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
+ If x is zero: mantissa = x, exp = 0.
+ If x is infinite or NaN: mantissa = x, exp unspecified.
+ Store exp in *EXPPTR and return mantissa. */
+#if @GNULIB_FREXPF@
+# if @REPLACE_FREXPF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef frexpf
+# define frexpf rpl_frexpf
+# endif
+_GL_FUNCDECL_RPL (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (frexpf, float, (float x, int *expptr));
+# else
+# if !@HAVE_FREXPF@
+# undef frexpf
+_GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (frexpf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef frexpf
+# if HAVE_RAW_DECL_FREXPF
+_GL_WARN_ON_USE (frexpf, "frexpf is unportable - "
+ "use gnulib module frexpf for portability");
+# endif
+#endif
+
+/* Write x as
+ x = mantissa * 2^exp
+ where
+ If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
+ If x is zero: mantissa = x, exp = 0.
+ If x is infinite or NaN: mantissa = x, exp unspecified.
+ Store exp in *EXPPTR and return mantissa. */
+#if @GNULIB_FREXP@
+# if @REPLACE_FREXP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef frexp
+# define frexp rpl_frexp
+# endif
+_GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
+# else
+_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (frexp, double, (double x, int *expptr));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef frexp
+/* Assume frexp is always declared. */
+_GL_WARN_ON_USE (frexp, "frexp is unportable - "
+ "use gnulib module frexp for portability");
+#endif
+
+/* Write x as
+ x = mantissa * 2^exp
+ where
+ If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
+ If x is zero: mantissa = x, exp = 0.
+ If x is infinite or NaN: mantissa = x, exp unspecified.
+ Store exp in *EXPPTR and return mantissa. */
+#if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef frexpl
+# define frexpl rpl_frexpl
+# endif
+_GL_FUNCDECL_RPL (frexpl, long double,
+ (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (frexpl, long double, (long double x, int *expptr));
+#else
+# if !@HAVE_DECL_FREXPL@
+_GL_FUNCDECL_SYS (frexpl, long double,
+ (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
+# endif
+# if @GNULIB_FREXPL@
+_GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
+# endif
+#endif
+#if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (frexpl);
+# endif
+#endif
+#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
+# undef frexpl
+# if HAVE_RAW_DECL_FREXPL
+_GL_WARN_ON_USE (frexpl, "frexpl is unportable - "
+ "use gnulib module frexpl for portability");
+# endif
+#endif
+
+
+/* Return sqrt(x^2+y^2). */
+#if @GNULIB_HYPOTF@
+# if @REPLACE_HYPOTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef hypotf
+# define hypotf rpl_hypotf
+# endif
+_GL_FUNCDECL_RPL (hypotf, float, (float x, float y));
+_GL_CXXALIAS_RPL (hypotf, float, (float x, float y));
+# else
+# if !@HAVE_HYPOTF@
+_GL_FUNCDECL_SYS (hypotf, float, (float x, float y));
+# endif
+_GL_CXXALIAS_SYS (hypotf, float, (float x, float y));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (hypotf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef hypotf
+# if HAVE_RAW_DECL_HYPOTF
+_GL_WARN_ON_USE (hypotf, "hypotf is unportable - "
+ "use gnulib module hypotf for portability");
+# endif
+#endif
+
+/* Return sqrt(x^2+y^2). */
+#if @GNULIB_HYPOT@
+# if @REPLACE_HYPOT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef hypot
+# define hypot rpl_hypot
+# endif
+_GL_FUNCDECL_RPL (hypot, double, (double x, double y));
+_GL_CXXALIAS_RPL (hypot, double, (double x, double y));
+# else
+_GL_CXXALIAS_SYS (hypot, double, (double x, double y));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (hypot, double, (double x, double y));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef hypot
+# if HAVE_RAW_DECL_HYPOT
+_GL_WARN_ON_USE (hypotf, "hypot has portability problems - "
+ "use gnulib module hypot for portability");
+# endif
+#endif
+
+/* Return sqrt(x^2+y^2). */
+#if @GNULIB_HYPOTL@
+# if @REPLACE_HYPOTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef hypotl
+# define hypotl rpl_hypotl
+# endif
+_GL_FUNCDECL_RPL (hypotl, long double, (long double x, long double y));
+_GL_CXXALIAS_RPL (hypotl, long double, (long double x, long double y));
+# else
+# if !@HAVE_HYPOTL@
+_GL_FUNCDECL_SYS (hypotl, long double, (long double x, long double y));
+# endif
+_GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (hypotl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef hypotl
+# if HAVE_RAW_DECL_HYPOTL
+_GL_WARN_ON_USE (hypotl, "hypotl is unportable - "
+ "use gnulib module hypotl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ILOGBF@
+# if @REPLACE_ILOGBF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ilogbf
+# define ilogbf rpl_ilogbf
+# endif
+_GL_FUNCDECL_RPL (ilogbf, int, (float x));
+_GL_CXXALIAS_RPL (ilogbf, int, (float x));
+# else
+# if !@HAVE_ILOGBF@
+_GL_FUNCDECL_SYS (ilogbf, int, (float x));
+# endif
+_GL_CXXALIAS_SYS (ilogbf, int, (float x));
+# endif
+_GL_CXXALIASWARN (ilogbf);
+#elif defined GNULIB_POSIXCHECK
+# undef ilogbf
+# if HAVE_RAW_DECL_ILOGBF
+_GL_WARN_ON_USE (ilogbf, "ilogbf is unportable - "
+ "use gnulib module ilogbf for portability");
+# endif
+#endif
+
+#if @GNULIB_ILOGB@
+# if @REPLACE_ILOGB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ilogb
+# define ilogb rpl_ilogb
+# endif
+_GL_FUNCDECL_RPL (ilogb, int, (double x));
+_GL_CXXALIAS_RPL (ilogb, int, (double x));
+# else
+# if !@HAVE_ILOGB@
+_GL_FUNCDECL_SYS (ilogb, int, (double x));
+# endif
+_GL_CXXALIAS_SYS (ilogb, int, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (ilogb, int, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef ilogb
+# if HAVE_RAW_DECL_ILOGB
+_GL_WARN_ON_USE (ilogb, "ilogb is unportable - "
+ "use gnulib module ilogb for portability");
+# endif
+#endif
+
+#if @GNULIB_ILOGBL@
+# if @REPLACE_ILOGBL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ilogbl
+# define ilogbl rpl_ilogbl
+# endif
+_GL_FUNCDECL_RPL (ilogbl, int, (long double x));
+_GL_CXXALIAS_RPL (ilogbl, int, (long double x));
+# else
+# if !@HAVE_ILOGBL@
+# undef ilogbl
+_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
+# endif
+_GL_CXXALIAS_SYS (ilogbl, int, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ilogbl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef ilogbl
+# if HAVE_RAW_DECL_ILOGBL
+_GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
+ "use gnulib module ilogbl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_J0@
+/* On native Windows, map 'j0' to '_j0', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::j0 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef j0
+# define j0 _j0
+# endif
+_GL_CXXALIAS_MDA (j0, double, (double x));
+# else
+_GL_CXXALIAS_SYS (j0, double, (double x));
+# endif
+_GL_CXXALIASWARN (j0);
+#endif
+
+#if @GNULIB_MDA_J1@
+/* On native Windows, map 'j1' to '_j1', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::j1 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef j1
+# define j1 _j1
+# endif
+_GL_CXXALIAS_MDA (j1, double, (double x));
+# else
+_GL_CXXALIAS_SYS (j1, double, (double x));
+# endif
+_GL_CXXALIASWARN (j1);
+#endif
+
+#if @GNULIB_MDA_JN@
+/* On native Windows, map 'jn' to '_jn', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::jn always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef jn
+# define jn _jn
+# endif
+_GL_CXXALIAS_MDA (jn, double, (int n, double x));
+# else
+_GL_CXXALIAS_SYS (jn, double, (int n, double x));
+# endif
+_GL_CXXALIASWARN (jn);
+#endif
+
+
+/* Return x * 2^exp. */
+#if @GNULIB_LDEXPF@
+# if !@HAVE_LDEXPF@
+# undef ldexpf
+_GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp));
+# endif
+_GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ldexpf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef ldexpf
+# if HAVE_RAW_DECL_LDEXPF
+_GL_WARN_ON_USE (ldexpf, "ldexpf is unportable - "
+ "use gnulib module ldexpf for portability");
+# endif
+#endif
+
+/* Return x * 2^exp. */
+#if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ldexpl
+# define ldexpl rpl_ldexpl
+# endif
+_GL_FUNCDECL_RPL (ldexpl, long double, (long double x, int exp));
+_GL_CXXALIAS_RPL (ldexpl, long double, (long double x, int exp));
+#else
+# if !@HAVE_DECL_LDEXPL@
+_GL_FUNCDECL_SYS (ldexpl, long double, (long double x, int exp));
+# endif
+# if @GNULIB_LDEXPL@
+_GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
+# endif
+#endif
+#if @GNULIB_LDEXPL@
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ldexpl);
+# endif
+#endif
+#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
+# undef ldexpl
+# if HAVE_RAW_DECL_LDEXPL
+_GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - "
+ "use gnulib module ldexpl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LOGF@
+# if @REPLACE_LOGF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef logf
+# define logf rpl_logf
+# endif
+_GL_FUNCDECL_RPL (logf, float, (float x));
+_GL_CXXALIAS_RPL (logf, float, (float x));
+# else
+# if !@HAVE_LOGF@
+# undef logf
+_GL_FUNCDECL_SYS (logf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (logf, float, (float x));
+# endif
+_GL_CXXALIASWARN (logf);
+#elif defined GNULIB_POSIXCHECK
+# undef logf
+# if HAVE_RAW_DECL_LOGF
+_GL_WARN_ON_USE (logf, "logf is unportable - "
+ "use gnulib module logf for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG@
+# if @REPLACE_LOG@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log
+# define log rpl_log
+# endif
+_GL_FUNCDECL_RPL (log, double, (double x));
+_GL_CXXALIAS_RPL (log, double, (double x));
+# else
+_GL_CXXALIAS_SYS (log, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef log
+# if HAVE_RAW_DECL_LOG
+_GL_WARN_ON_USE (log, "log has portability problems - "
+ "use gnulib module log for portability");
+# endif
+#endif
+
+#if @GNULIB_LOGL@
+# if @REPLACE_LOGL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef logl
+# define logl rpl_logl
+# endif
+_GL_FUNCDECL_RPL (logl, long double, (long double x));
+_GL_CXXALIAS_RPL (logl, long double, (long double x));
+# else
+# if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
+# undef logl
+_GL_FUNCDECL_SYS (logl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (logl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (logl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef logl
+# if HAVE_RAW_DECL_LOGL
+_GL_WARN_ON_USE (logl, "logl is unportable - "
+ "use gnulib module logl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LOG10F@
+# if @REPLACE_LOG10F@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log10f
+# define log10f rpl_log10f
+# endif
+_GL_FUNCDECL_RPL (log10f, float, (float x));
+_GL_CXXALIAS_RPL (log10f, float, (float x));
+# else
+# if !@HAVE_LOG10F@
+# undef log10f
+_GL_FUNCDECL_SYS (log10f, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (log10f, float, (float x));
+# endif
+_GL_CXXALIASWARN (log10f);
+#elif defined GNULIB_POSIXCHECK
+# undef log10f
+# if HAVE_RAW_DECL_LOG10F
+_GL_WARN_ON_USE (log10f, "log10f is unportable - "
+ "use gnulib module log10f for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG10@
+# if @REPLACE_LOG10@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log10
+# define log10 rpl_log10
+# endif
+_GL_FUNCDECL_RPL (log10, double, (double x));
+_GL_CXXALIAS_RPL (log10, double, (double x));
+# else
+_GL_CXXALIAS_SYS (log10, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log10, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef log10
+# if HAVE_RAW_DECL_LOG10
+_GL_WARN_ON_USE (log10, "log10 has portability problems - "
+ "use gnulib module log10 for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG10L@
+# if @REPLACE_LOG10L@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log10l
+# define log10l rpl_log10l
+# endif
+_GL_FUNCDECL_RPL (log10l, long double, (long double x));
+_GL_CXXALIAS_RPL (log10l, long double, (long double x));
+# else
+# if !@HAVE_LOG10L@ || !@HAVE_DECL_LOG10L@
+# undef log10l
+_GL_FUNCDECL_SYS (log10l, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (log10l, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (log10l);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef log10l
+# if HAVE_RAW_DECL_LOG10L
+_GL_WARN_ON_USE (log10l, "log10l is unportable - "
+ "use gnulib module log10l for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LOG1PF@
+# if @REPLACE_LOG1PF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log1pf
+# define log1pf rpl_log1pf
+# endif
+_GL_FUNCDECL_RPL (log1pf, float, (float x));
+_GL_CXXALIAS_RPL (log1pf, float, (float x));
+# else
+# if !@HAVE_LOG1PF@
+_GL_FUNCDECL_SYS (log1pf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (log1pf, float, (float x));
+# endif
+_GL_CXXALIASWARN (log1pf);
+#elif defined GNULIB_POSIXCHECK
+# undef log1pf
+# if HAVE_RAW_DECL_LOG1PF
+_GL_WARN_ON_USE (log1pf, "log1pf is unportable - "
+ "use gnulib module log1pf for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG1P@
+# if @REPLACE_LOG1P@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log1p
+# define log1p rpl_log1p
+# endif
+_GL_FUNCDECL_RPL (log1p, double, (double x));
+_GL_CXXALIAS_RPL (log1p, double, (double x));
+# else
+# if !@HAVE_LOG1P@
+_GL_FUNCDECL_SYS (log1p, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (log1p, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log1p, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef log1p
+# if HAVE_RAW_DECL_LOG1P
+_GL_WARN_ON_USE (log1p, "log1p has portability problems - "
+ "use gnulib module log1p for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG1PL@
+# if @REPLACE_LOG1PL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log1pl
+# define log1pl rpl_log1pl
+# endif
+_GL_FUNCDECL_RPL (log1pl, long double, (long double x));
+_GL_CXXALIAS_RPL (log1pl, long double, (long double x));
+# else
+# if !@HAVE_LOG1PL@
+_GL_FUNCDECL_SYS (log1pl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (log1pl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (log1pl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef log1pl
+# if HAVE_RAW_DECL_LOG1PL
+_GL_WARN_ON_USE (log1pl, "log1pl has portability problems - "
+ "use gnulib module log1pl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LOG2F@
+# if @REPLACE_LOG2F@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log2f
+# define log2f rpl_log2f
+# endif
+_GL_FUNCDECL_RPL (log2f, float, (float x));
+_GL_CXXALIAS_RPL (log2f, float, (float x));
+# else
+# if !@HAVE_DECL_LOG2F@
+# undef log2f
+_GL_FUNCDECL_SYS (log2f, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (log2f, float, (float x));
+# endif
+_GL_CXXALIASWARN (log2f);
+#elif defined GNULIB_POSIXCHECK
+# undef log2f
+# if HAVE_RAW_DECL_LOG2F
+_GL_WARN_ON_USE (log2f, "log2f is unportable - "
+ "use gnulib module log2f for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG2@
+# if @REPLACE_LOG2@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log2
+# define log2 rpl_log2
+# endif
+_GL_FUNCDECL_RPL (log2, double, (double x));
+_GL_CXXALIAS_RPL (log2, double, (double x));
+# else
+# if !@HAVE_DECL_LOG2@
+# undef log2
+_GL_FUNCDECL_SYS (log2, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (log2, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log2, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef log2
+# if HAVE_RAW_DECL_LOG2
+_GL_WARN_ON_USE (log2, "log2 is unportable - "
+ "use gnulib module log2 for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG2L@
+# if @REPLACE_LOG2L@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef log2l
+# define log2l rpl_log2l
+# endif
+_GL_FUNCDECL_RPL (log2l, long double, (long double x));
+_GL_CXXALIAS_RPL (log2l, long double, (long double x));
+# else
+# if !@HAVE_DECL_LOG2L@
+_GL_FUNCDECL_SYS (log2l, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (log2l, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (log2l);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef log2l
+# if HAVE_RAW_DECL_LOG2L
+_GL_WARN_ON_USE (log2l, "log2l is unportable - "
+ "use gnulib module log2l for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LOGBF@
+# if @REPLACE_LOGBF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef logbf
+# define logbf rpl_logbf
+# endif
+_GL_FUNCDECL_RPL (logbf, float, (float x));
+_GL_CXXALIAS_RPL (logbf, float, (float x));
+# else
+# if !@HAVE_LOGBF@
+_GL_FUNCDECL_SYS (logbf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (logbf, float, (float x));
+# endif
+_GL_CXXALIASWARN (logbf);
+#elif defined GNULIB_POSIXCHECK
+# undef logbf
+# if HAVE_RAW_DECL_LOGBF
+_GL_WARN_ON_USE (logbf, "logbf is unportable - "
+ "use gnulib module logbf for portability");
+# endif
+#endif
+
+#if @GNULIB_LOGB@
+# if @REPLACE_LOGB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef logb
+# define logb rpl_logb
+# endif
+_GL_FUNCDECL_RPL (logb, double, (double x));
+_GL_CXXALIAS_RPL (logb, double, (double x));
+# else
+# if !@HAVE_DECL_LOGB@
+_GL_FUNCDECL_SYS (logb, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (logb, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (logb, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef logb
+# if HAVE_RAW_DECL_LOGB
+_GL_WARN_ON_USE (logb, "logb is unportable - "
+ "use gnulib module logb for portability");
+# endif
+#endif
+
+#if @GNULIB_LOGBL@
+# if @REPLACE_LOGBL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef logbl
+# define logbl rpl_logbl
+# endif
+_GL_FUNCDECL_RPL (logbl, long double, (long double x));
+_GL_CXXALIAS_RPL (logbl, long double, (long double x));
+# else
+# if !@HAVE_LOGBL@
+_GL_FUNCDECL_SYS (logbl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (logbl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (logbl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef logbl
+# if HAVE_RAW_DECL_LOGBL
+_GL_WARN_ON_USE (logbl, "logbl is unportable - "
+ "use gnulib module logbl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MODFF@
+# if @REPLACE_MODFF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef modff
+# define modff rpl_modff
+# endif
+_GL_FUNCDECL_RPL (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (modff, float, (float x, float *iptr));
+# else
+# if !@HAVE_MODFF@
+# undef modff
+_GL_FUNCDECL_SYS (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (modff, float, (float x, float *iptr));
+# endif
+_GL_CXXALIASWARN (modff);
+#elif defined GNULIB_POSIXCHECK
+# undef modff
+# if HAVE_RAW_DECL_MODFF
+_GL_WARN_ON_USE (modff, "modff is unportable - "
+ "use gnulib module modff for portability");
+# endif
+#endif
+
+#if @GNULIB_MODF@
+# if @REPLACE_MODF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef modf
+# define modf rpl_modf
+# endif
+_GL_FUNCDECL_RPL (modf, double, (double x, double *iptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (modf, double, (double x, double *iptr));
+# else
+_GL_CXXALIAS_SYS (modf, double, (double x, double *iptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (modf, double, (double x, double *iptr));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef modf
+# if HAVE_RAW_DECL_MODF
+_GL_WARN_ON_USE (modf, "modf has portability problems - "
+ "use gnulib module modf for portability");
+# endif
+#endif
+
+#if @GNULIB_MODFL@
+# if @REPLACE_MODFL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef modfl
+# define modfl rpl_modfl
+# endif
+_GL_FUNCDECL_RPL (modfl, long double, (long double x, long double *iptr)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (modfl, long double, (long double x, long double *iptr));
+# else
+# if !@HAVE_MODFL@
+# undef modfl
+_GL_FUNCDECL_SYS (modfl, long double, (long double x, long double *iptr)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (modfl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef modfl
+# if HAVE_RAW_DECL_MODFL
+_GL_WARN_ON_USE (modfl, "modfl is unportable - "
+ "use gnulib module modfl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_POWF@
+# if !@HAVE_POWF@
+# undef powf
+_GL_FUNCDECL_SYS (powf, float, (float x, float y));
+# endif
+_GL_CXXALIAS_SYS (powf, float, (float x, float y));
+_GL_CXXALIASWARN (powf);
+#elif defined GNULIB_POSIXCHECK
+# undef powf
+# if HAVE_RAW_DECL_POWF
+_GL_WARN_ON_USE (powf, "powf is unportable - "
+ "use gnulib module powf for portability");
+# endif
+#endif
+
+
+#if @GNULIB_REMAINDERF@
+# if @REPLACE_REMAINDERF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef remainderf
+# define remainderf rpl_remainderf
+# endif
+_GL_FUNCDECL_RPL (remainderf, float, (float x, float y));
+_GL_CXXALIAS_RPL (remainderf, float, (float x, float y));
+# else
+# if !@HAVE_REMAINDERF@
+_GL_FUNCDECL_SYS (remainderf, float, (float x, float y));
+# endif
+_GL_CXXALIAS_SYS (remainderf, float, (float x, float y));
+# endif
+_GL_CXXALIASWARN (remainderf);
+#elif defined GNULIB_POSIXCHECK
+# undef remainderf
+# if HAVE_RAW_DECL_REMAINDERF
+_GL_WARN_ON_USE (remainderf, "remainderf is unportable - "
+ "use gnulib module remainderf for portability");
+# endif
+#endif
+
+#if @GNULIB_REMAINDER@
+# if @REPLACE_REMAINDER@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef remainder
+# define remainder rpl_remainder
+# endif
+_GL_FUNCDECL_RPL (remainder, double, (double x, double y));
+_GL_CXXALIAS_RPL (remainder, double, (double x, double y));
+# else
+# if !@HAVE_REMAINDER@ || !@HAVE_DECL_REMAINDER@
+_GL_FUNCDECL_SYS (remainder, double, (double x, double y));
+# endif
+_GL_CXXALIAS_SYS (remainder, double, (double x, double y));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (remainder, double, (double x, double y));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef remainder
+# if HAVE_RAW_DECL_REMAINDER
+_GL_WARN_ON_USE (remainder, "remainder is unportable - "
+ "use gnulib module remainder for portability");
+# endif
+#endif
+
+#if @GNULIB_REMAINDERL@
+# if @REPLACE_REMAINDERL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef remainderl
+# define remainderl rpl_remainderl
+# endif
+_GL_FUNCDECL_RPL (remainderl, long double, (long double x, long double y));
+_GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y));
+# else
+# if !@HAVE_DECL_REMAINDERL@
+# undef remainderl
+# if !(defined __cplusplus && defined _AIX)
+_GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y));
+# endif
+# endif
+_GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (remainderl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef remainderl
+# if HAVE_RAW_DECL_REMAINDERL
+_GL_WARN_ON_USE (remainderl, "remainderl is unportable - "
+ "use gnulib module remainderl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RINTF@
+# if !@HAVE_DECL_RINTF@
+_GL_FUNCDECL_SYS (rintf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (rintf, float, (float x));
+_GL_CXXALIASWARN (rintf);
+#elif defined GNULIB_POSIXCHECK
+# undef rintf
+# if HAVE_RAW_DECL_RINTF
+_GL_WARN_ON_USE (rintf, "rintf is unportable - "
+ "use gnulib module rintf for portability");
+# endif
+#endif
+
+#if @GNULIB_RINT@
+# if !@HAVE_RINT@
+_GL_FUNCDECL_SYS (rint, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (rint, double, (double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (rint, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rint
+# if HAVE_RAW_DECL_RINT
+_GL_WARN_ON_USE (rint, "rint is unportable - "
+ "use gnulib module rint for portability");
+# endif
+#endif
+
+#if @GNULIB_RINTL@
+# if @REPLACE_RINTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rintl
+# define rintl rpl_rintl
+# endif
+_GL_FUNCDECL_RPL (rintl, long double, (long double x));
+_GL_CXXALIAS_RPL (rintl, long double, (long double x));
+# else
+# if !@HAVE_RINTL@
+_GL_FUNCDECL_SYS (rintl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (rintl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (rintl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rintl
+# if HAVE_RAW_DECL_RINTL
+_GL_WARN_ON_USE (rintl, "rintl is unportable - "
+ "use gnulib module rintl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ROUNDF@
+# if @REPLACE_ROUNDF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef roundf
+# define roundf rpl_roundf
+# endif
+_GL_FUNCDECL_RPL (roundf, float, (float x));
+_GL_CXXALIAS_RPL (roundf, float, (float x));
+# else
+# if !@HAVE_DECL_ROUNDF@
+_GL_FUNCDECL_SYS (roundf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (roundf, float, (float x));
+# endif
+_GL_CXXALIASWARN (roundf);
+#elif defined GNULIB_POSIXCHECK
+# undef roundf
+# if HAVE_RAW_DECL_ROUNDF
+_GL_WARN_ON_USE (roundf, "roundf is unportable - "
+ "use gnulib module roundf for portability");
+# endif
+#endif
+
+#if @GNULIB_ROUND@
+# if @REPLACE_ROUND@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef round
+# define round rpl_round
+# endif
+_GL_FUNCDECL_RPL (round, double, (double x));
+_GL_CXXALIAS_RPL (round, double, (double x));
+# else
+# if !@HAVE_DECL_ROUND@
+_GL_FUNCDECL_SYS (round, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (round, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (round, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef round
+# if HAVE_RAW_DECL_ROUND
+_GL_WARN_ON_USE (round, "round is unportable - "
+ "use gnulib module round for portability");
+# endif
+#endif
+
+#if @GNULIB_ROUNDL@
+# if @REPLACE_ROUNDL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef roundl
+# define roundl rpl_roundl
+# endif
+_GL_FUNCDECL_RPL (roundl, long double, (long double x));
+_GL_CXXALIAS_RPL (roundl, long double, (long double x));
+# else
+# if !@HAVE_DECL_ROUNDL@
+# undef roundl
+# if !(defined __cplusplus && defined _AIX)
+_GL_FUNCDECL_SYS (roundl, long double, (long double x));
+# endif
+# endif
+_GL_CXXALIAS_SYS (roundl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (roundl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef roundl
+# if HAVE_RAW_DECL_ROUNDL
+_GL_WARN_ON_USE (roundl, "roundl is unportable - "
+ "use gnulib module roundl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SINF@
+# if @REPLACE_SINF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sinf
+# define sinf rpl_sinf
+# endif
+_GL_FUNCDECL_RPL (sinf, float, (float x));
+_GL_CXXALIAS_RPL (sinf, float, (float x));
+# else
+# if !@HAVE_SINF@
+# undef sinf
+_GL_FUNCDECL_SYS (sinf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (sinf, float, (float x));
+# endif
+_GL_CXXALIASWARN (sinf);
+#elif defined GNULIB_POSIXCHECK
+# undef sinf
+# if HAVE_RAW_DECL_SINF
+_GL_WARN_ON_USE (sinf, "sinf is unportable - "
+ "use gnulib module sinf for portability");
+# endif
+#endif
+
+#if @GNULIB_SINL@
+# if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
+# undef sinl
+_GL_FUNCDECL_SYS (sinl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (sinl, long double, (long double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (sinl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sinl
+# if HAVE_RAW_DECL_SINL
+_GL_WARN_ON_USE (sinl, "sinl is unportable - "
+ "use gnulib module sinl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SINHF@
+# if @REPLACE_SINHF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sinhf
+# define sinhf rpl_sinhf
+# endif
+_GL_FUNCDECL_RPL (sinhf, float, (float x));
+_GL_CXXALIAS_RPL (sinhf, float, (float x));
+# else
+# if !@HAVE_SINHF@
+# undef sinhf
+_GL_FUNCDECL_SYS (sinhf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (sinhf, float, (float x));
+# endif
+_GL_CXXALIASWARN (sinhf);
+#elif defined GNULIB_POSIXCHECK
+# undef sinhf
+# if HAVE_RAW_DECL_SINHF
+_GL_WARN_ON_USE (sinhf, "sinhf is unportable - "
+ "use gnulib module sinhf for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SQRTF@
+# if @REPLACE_SQRTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sqrtf
+# define sqrtf rpl_sqrtf
+# endif
+_GL_FUNCDECL_RPL (sqrtf, float, (float x));
+_GL_CXXALIAS_RPL (sqrtf, float, (float x));
+# else
+# if !@HAVE_SQRTF@
+# undef sqrtf
+_GL_FUNCDECL_SYS (sqrtf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (sqrtf, float, (float x));
+# endif
+_GL_CXXALIASWARN (sqrtf);
+#elif defined GNULIB_POSIXCHECK
+# undef sqrtf
+# if HAVE_RAW_DECL_SQRTF
+_GL_WARN_ON_USE (sqrtf, "sqrtf is unportable - "
+ "use gnulib module sqrtf for portability");
+# endif
+#endif
+
+#if @GNULIB_SQRTL@
+# if @REPLACE_SQRTL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sqrtl
+# define sqrtl rpl_sqrtl
+# endif
+_GL_FUNCDECL_RPL (sqrtl, long double, (long double x));
+_GL_CXXALIAS_RPL (sqrtl, long double, (long double x));
+# else
+# if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
+# undef sqrtl
+_GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (sqrtl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sqrtl
+# if HAVE_RAW_DECL_SQRTL
+_GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
+ "use gnulib module sqrtl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TANF@
+# if @REPLACE_TANF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tanf
+# define tanf rpl_tanf
+# endif
+_GL_FUNCDECL_RPL (tanf, float, (float x));
+_GL_CXXALIAS_RPL (tanf, float, (float x));
+# else
+# if !@HAVE_TANF@
+# undef tanf
+_GL_FUNCDECL_SYS (tanf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (tanf, float, (float x));
+# endif
+_GL_CXXALIASWARN (tanf);
+#elif defined GNULIB_POSIXCHECK
+# undef tanf
+# if HAVE_RAW_DECL_TANF
+_GL_WARN_ON_USE (tanf, "tanf is unportable - "
+ "use gnulib module tanf for portability");
+# endif
+#endif
+
+#if @GNULIB_TANL@
+# if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
+# undef tanl
+_GL_FUNCDECL_SYS (tanl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (tanl, long double, (long double x));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (tanl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef tanl
+# if HAVE_RAW_DECL_TANL
+_GL_WARN_ON_USE (tanl, "tanl is unportable - "
+ "use gnulib module tanl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TANHF@
+# if @REPLACE_TANHF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tanhf
+# define tanhf rpl_tanhf
+# endif
+_GL_FUNCDECL_RPL (tanhf, float, (float x));
+_GL_CXXALIAS_RPL (tanhf, float, (float x));
+# else
+# if !@HAVE_TANHF@
+# undef tanhf
+_GL_FUNCDECL_SYS (tanhf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (tanhf, float, (float x));
+# endif
+_GL_CXXALIASWARN (tanhf);
+#elif defined GNULIB_POSIXCHECK
+# undef tanhf
+# if HAVE_RAW_DECL_TANHF
+_GL_WARN_ON_USE (tanhf, "tanhf is unportable - "
+ "use gnulib module tanhf for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TRUNCF@
+# if @REPLACE_TRUNCF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef truncf
+# define truncf rpl_truncf
+# endif
+_GL_FUNCDECL_RPL (truncf, float, (float x));
+_GL_CXXALIAS_RPL (truncf, float, (float x));
+# else
+# if !@HAVE_DECL_TRUNCF@
+_GL_FUNCDECL_SYS (truncf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (truncf, float, (float x));
+# endif
+_GL_CXXALIASWARN (truncf);
+#elif defined GNULIB_POSIXCHECK
+# undef truncf
+# if HAVE_RAW_DECL_TRUNCF
+_GL_WARN_ON_USE (truncf, "truncf is unportable - "
+ "use gnulib module truncf for portability");
+# endif
+#endif
+
+#if @GNULIB_TRUNC@
+# if @REPLACE_TRUNC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef trunc
+# define trunc rpl_trunc
+# endif
+_GL_FUNCDECL_RPL (trunc, double, (double x));
+_GL_CXXALIAS_RPL (trunc, double, (double x));
+# else
+# if !@HAVE_DECL_TRUNC@
+_GL_FUNCDECL_SYS (trunc, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (trunc, double, (double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (trunc, double, (double x));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef trunc
+# if HAVE_RAW_DECL_TRUNC
+_GL_WARN_ON_USE (trunc, "trunc is unportable - "
+ "use gnulib module trunc for portability");
+# endif
+#endif
+
+#if @GNULIB_TRUNCL@
+# if @REPLACE_TRUNCL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef truncl
+# define truncl rpl_truncl
+# endif
+_GL_FUNCDECL_RPL (truncl, long double, (long double x));
+_GL_CXXALIAS_RPL (truncl, long double, (long double x));
+# else
+# if !@HAVE_DECL_TRUNCL@
+_GL_FUNCDECL_SYS (truncl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (truncl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (truncl);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef truncl
+# if HAVE_RAW_DECL_TRUNCL
+_GL_WARN_ON_USE (truncl, "truncl is unportable - "
+ "use gnulib module truncl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_Y0@
+/* On native Windows, map 'y0' to '_y0', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::y0 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef y0
+# define y0 _y0
+# endif
+_GL_CXXALIAS_MDA (y0, double, (double x));
+# else
+_GL_CXXALIAS_SYS (y0, double, (double x));
+# endif
+_GL_CXXALIASWARN (y0);
+#endif
+
+#if @GNULIB_MDA_Y1@
+/* On native Windows, map 'y1' to '_y1', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::y1 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef y1
+# define y1 _y1
+# endif
+_GL_CXXALIAS_MDA (y1, double, (double x));
+# else
+_GL_CXXALIAS_SYS (y1, double, (double x));
+# endif
+_GL_CXXALIASWARN (y1);
+#endif
+
+#if @GNULIB_MDA_YN@
+/* On native Windows, map 'yn' to '_yn', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::yn always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef yn
+# define yn _yn
+# endif
+_GL_CXXALIAS_MDA (yn, double, (int n, double x));
+# else
+_GL_CXXALIAS_SYS (yn, double, (int n, double x));
+# endif
+_GL_CXXALIASWARN (yn);
+#endif
+
+
+/* Definitions of function-like macros come here, after the function
+ declarations. */
+
+
+#if @GNULIB_ISFINITE@
+# if @REPLACE_ISFINITE@
+_GL_EXTERN_C int gl_isfinitef (float x);
+_GL_EXTERN_C int gl_isfinited (double x);
+_GL_EXTERN_C int gl_isfinitel (long double x);
+# undef isfinite
+# define isfinite(x) \
+ (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
+ sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
+ gl_isfinitef (x))
+# endif
+# ifdef __cplusplus
+# if defined isfinite || defined GNULIB_NAMESPACE
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
+# undef isfinite
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__)))
+ /* This platform's <cmath> possibly defines isfinite through a set of inline
+ functions. */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool)
+# define isfinite rpl_isfinite
+# define GNULIB_NAMESPACE_LACKS_ISFINITE 1
+# else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, isfinite, bool)
+# endif
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# if defined isfinite
+_GL_WARN_REAL_FLOATING_DECL (isfinite);
+# undef isfinite
+# define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
+# endif
+#endif
+
+
+#if @GNULIB_ISINF@
+# if @REPLACE_ISINF@
+_GL_EXTERN_C int gl_isinff (float x);
+_GL_EXTERN_C int gl_isinfd (double x);
+_GL_EXTERN_C int gl_isinfl (long double x);
+# undef isinf
+# define isinf(x) \
+ (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
+ sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
+ gl_isinff (x))
+# endif
+# ifdef __cplusplus
+# if defined isinf || defined GNULIB_NAMESPACE
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
+# undef isinf
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
+ /* This platform's <cmath> possibly defines isinf through a set of inline
+ functions. */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, rpl_isinf, bool)
+# define isinf rpl_isinf
+# define GNULIB_NAMESPACE_LACKS_ISINF 1
+# else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, isinf, bool)
+# endif
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# if defined isinf
+_GL_WARN_REAL_FLOATING_DECL (isinf);
+# undef isinf
+# define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
+# endif
+#endif
+
+
+#if @GNULIB_ISNANF@
+/* Test for NaN for 'float' numbers. */
+# if @HAVE_ISNANF@
+/* The original <math.h> included above provides a declaration of isnan macro
+ or (older) isnanf function. */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+ /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+ GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */
+# undef isnanf
+# define isnanf(x) __builtin_isnan ((float)(x))
+# elif defined isnan
+# undef isnanf
+# define isnanf(x) isnan ((float)(x))
+# endif
+# else
+/* Test whether X is a NaN. */
+# undef isnanf
+# define isnanf rpl_isnanf
+_GL_EXTERN_C int isnanf (float x);
+# endif
+#endif
+
+#if @GNULIB_ISNAND@
+/* Test for NaN for 'double' numbers.
+ This function is a gnulib extension, unlike isnan() which applied only
+ to 'double' numbers earlier but now is a type-generic macro. */
+# if @HAVE_ISNAND@
+/* The original <math.h> included above provides a declaration of isnan
+ macro. */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+ /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */
+# undef isnand
+# define isnand(x) __builtin_isnan ((double)(x))
+# else
+# undef isnand
+# define isnand(x) isnan ((double)(x))
+# endif
+# else
+/* Test whether X is a NaN. */
+# undef isnand
+# define isnand rpl_isnand
+_GL_EXTERN_C int isnand (double x);
+# endif
+#endif
+
+#if @GNULIB_ISNANL@
+/* Test for NaN for 'long double' numbers. */
+# if @HAVE_ISNANL@
+/* The original <math.h> included above provides a declaration of isnan
+ macro or (older) isnanl function. */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+ /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+ GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */
+# undef isnanl
+# define isnanl(x) __builtin_isnan ((long double)(x))
+# elif defined isnan
+# undef isnanl
+# define isnanl(x) isnan ((long double)(x))
+# endif
+# else
+/* Test whether X is a NaN. */
+# undef isnanl
+# define isnanl rpl_isnanl
+_GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
+# endif
+#endif
+
+/* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */
+#if @GNULIB_ISNAN@
+# if @REPLACE_ISNAN@
+/* We can't just use the isnanf macro (e.g.) as exposed by
+ isnanf.h (e.g.) here, because those may end up being macros
+ that recursively expand back to isnan. So use the gnulib
+ replacements for them directly. */
+# if @HAVE_ISNANF@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# define gl_isnan_f(x) __builtin_isnan ((float)(x))
+# else
+_GL_EXTERN_C int rpl_isnanf (float x);
+# define gl_isnan_f(x) rpl_isnanf (x)
+# endif
+# if @HAVE_ISNAND@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# define gl_isnan_d(x) __builtin_isnan ((double)(x))
+# else
+_GL_EXTERN_C int rpl_isnand (double x);
+# define gl_isnan_d(x) rpl_isnand (x)
+# endif
+# if @HAVE_ISNANL@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# define gl_isnan_l(x) __builtin_isnan ((long double)(x))
+# else
+_GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
+# define gl_isnan_l(x) rpl_isnanl (x)
+# endif
+# undef isnan
+# define isnan(x) \
+ (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
+ sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
+ gl_isnan_f (x))
+# elif (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# undef isnan
+# define isnan(x) \
+ (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \
+ sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
+ __builtin_isnan ((float)(x)))
+# endif
+# ifdef __cplusplus
+# if defined isnan || defined GNULIB_NAMESPACE
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
+# undef isnan
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__ && __clang_major__ < 12) || (defined __FreeBSD__ && (__clang_major__ < 7 || __clang_major__ >= 11)) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
+ /* This platform's <cmath> possibly defines isnan through a set of inline
+ functions. */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
+# define isnan rpl_isnan
+# define GNULIB_NAMESPACE_LACKS_ISNAN 1
+# else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, isnan, bool)
+# endif
+# endif
+# else
+/* Ensure isnan is a macro. */
+# ifndef isnan
+# define isnan isnan
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# if defined isnan
+_GL_WARN_REAL_FLOATING_DECL (isnan);
+# undef isnan
+# define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
+# endif
+#endif
+
+
+#if @GNULIB_SIGNBIT@
+# if (@REPLACE_SIGNBIT_USING_BUILTINS@ \
+ && (!defined __cplusplus || __cplusplus < 201103))
+# undef signbit
+ /* GCC >= 4.0 and clang provide three built-ins for signbit. */
+# define signbit(x) \
+ (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
+ sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
+ __builtin_signbitf (x))
+# endif
+# if @REPLACE_SIGNBIT@ && !GNULIB_defined_signbit
+# undef signbit
+_GL_EXTERN_C int gl_signbitf (float arg);
+_GL_EXTERN_C int gl_signbitd (double arg);
+_GL_EXTERN_C int gl_signbitl (long double arg);
+# if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__
+# define _GL_NUM_UINT_WORDS(type) \
+ ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
+# define gl_signbitf_OPTIMIZED_MACRO
+# define gl_signbitf(arg) \
+ ({ union { float _value; \
+ unsigned int _word[_GL_NUM_UINT_WORDS (float)]; \
+ } _m; \
+ _m._value = (arg); \
+ (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \
+ })
+# endif
+# if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
+# define gl_signbitd_OPTIMIZED_MACRO
+# define gl_signbitd(arg) \
+ ({ union { double _value; \
+ unsigned int _word[_GL_NUM_UINT_WORDS (double)]; \
+ } _m; \
+ _m._value = (arg); \
+ (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \
+ })
+# endif
+# if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
+# define gl_signbitl_OPTIMIZED_MACRO
+# define gl_signbitl(arg) \
+ ({ union { long double _value; \
+ unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
+ } _m; \
+ _m._value = (arg); \
+ (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \
+ })
+# endif
+# endif
+# define signbit(x) \
+ (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
+ sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
+ gl_signbitf (x))
+# define GNULIB_defined_signbit 1
+# endif
+# ifdef __cplusplus
+# if defined signbit || defined GNULIB_NAMESPACE
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
+# undef signbit
+# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__)))
+ /* This platform's <cmath> possibly defines signbit through a set of inline
+ functions. */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool)
+# define signbit rpl_signbit
+# define GNULIB_NAMESPACE_LACKS_SIGNBIT 1
+# else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, signbit, bool)
+# endif
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# if defined signbit
+_GL_WARN_REAL_FLOATING_DECL (signbit);
+# undef signbit
+# define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
+# endif
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_MATH_H */
+#endif /* _GL_INCLUDING_MATH_H */
+#endif /* _@GUARD_PREFIX@_MATH_H */
diff --git a/gl/mbrtowc-impl-utf8.h b/gl/mbrtowc-impl-utf8.h
new file mode 100644
index 0000000..4fdd65d
--- /dev/null
+++ b/gl/mbrtowc-impl-utf8.h
@@ -0,0 +1,138 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+/* This file contains the part of the body of the mbrtowc and mbrtoc32 functions
+ that handles the special case of the UTF-8 encoding. */
+
+ /* Cf. unistr/u8-mbtouc.c. */
+ unsigned char c = (unsigned char) p[0];
+
+ if (c < 0x80)
+ {
+ if (pwc != NULL)
+ *pwc = c;
+ res = (c == 0 ? 0 : 1);
+ goto success;
+ }
+ if (c >= 0xc2)
+ {
+ if (c < 0xe0)
+ {
+ if (m == 1)
+ goto incomplete;
+ else /* m >= 2 */
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if ((c2 ^ 0x80) < 0x40)
+ {
+ if (pwc != NULL)
+ *pwc = ((unsigned int) (c & 0x1f) << 6)
+ | (unsigned int) (c2 ^ 0x80);
+ res = 2;
+ goto success;
+ }
+ }
+ }
+ else if (c < 0xf0)
+ {
+ if (m == 1)
+ goto incomplete;
+ else
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if ((c2 ^ 0x80) < 0x40
+ && (c >= 0xe1 || c2 >= 0xa0)
+ && (c != 0xed || c2 < 0xa0))
+ {
+ if (m == 2)
+ goto incomplete;
+ else /* m >= 3 */
+ {
+ unsigned char c3 = (unsigned char) p[2];
+
+ if ((c3 ^ 0x80) < 0x40)
+ {
+ unsigned int wc =
+ (((unsigned int) (c & 0x0f) << 12)
+ | ((unsigned int) (c2 ^ 0x80) << 6)
+ | (unsigned int) (c3 ^ 0x80));
+
+ if (FITS_IN_CHAR_TYPE (wc))
+ {
+ if (pwc != NULL)
+ *pwc = wc;
+ res = 3;
+ goto success;
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (c <= 0xf4)
+ {
+ if (m == 1)
+ goto incomplete;
+ else
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if ((c2 ^ 0x80) < 0x40
+ && (c >= 0xf1 || c2 >= 0x90)
+ && (c < 0xf4 || (/* c == 0xf4 && */ c2 < 0x90)))
+ {
+ if (m == 2)
+ goto incomplete;
+ else
+ {
+ unsigned char c3 = (unsigned char) p[2];
+
+ if ((c3 ^ 0x80) < 0x40)
+ {
+ if (m == 3)
+ goto incomplete;
+ else /* m >= 4 */
+ {
+ unsigned char c4 = (unsigned char) p[3];
+
+ if ((c4 ^ 0x80) < 0x40)
+ {
+ unsigned int wc =
+ (((unsigned int) (c & 0x07) << 18)
+ | ((unsigned int) (c2 ^ 0x80) << 12)
+ | ((unsigned int) (c3 ^ 0x80) << 6)
+ | (unsigned int) (c4 ^ 0x80));
+
+ if (FITS_IN_CHAR_TYPE (wc))
+ {
+ if (pwc != NULL)
+ *pwc = wc;
+ res = 4;
+ goto success;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ goto invalid;
diff --git a/gl/mbrtowc-impl.h b/gl/mbrtowc-impl.h
new file mode 100644
index 0000000..e9c04ed
--- /dev/null
+++ b/gl/mbrtowc-impl.h
@@ -0,0 +1,262 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
+
+/* This file contains the body of the mbrtowc and mbrtoc32 functions,
+ when GNULIB_defined_mbstate_t is defined. */
+
+ char *pstate = (char *)ps;
+
+ if (s == NULL)
+ {
+ pwc = NULL;
+ s = "";
+ n = 1;
+ }
+
+ if (n == 0)
+ return (size_t)(-2);
+
+ /* Here n > 0. */
+
+ if (pstate == NULL)
+ pstate = internal_state;
+
+ {
+ size_t nstate = pstate[0];
+ char buf[4];
+ const char *p;
+ size_t m;
+ enc_t enc;
+ int res;
+
+ switch (nstate)
+ {
+ case 0:
+ p = s;
+ m = n;
+ break;
+ case 3:
+ buf[2] = pstate[3];
+ FALLTHROUGH;
+ case 2:
+ buf[1] = pstate[2];
+ FALLTHROUGH;
+ case 1:
+ buf[0] = pstate[1];
+ p = buf;
+ m = nstate;
+ buf[m++] = s[0];
+ if (n >= 2 && m < 4)
+ {
+ buf[m++] = s[1];
+ if (n >= 3 && m < 4)
+ buf[m++] = s[2];
+ }
+ break;
+ default:
+ errno = EINVAL;
+ return (size_t)(-1);
+ }
+
+ /* Here m > 0. */
+
+ enc = locale_encoding_classification ();
+
+ if (enc == enc_utf8) /* UTF-8 */
+ {
+ /* Achieve
+ - multi-thread safety and
+ - the ability to produce wide character values > WCHAR_MAX
+ by not calling mbtowc() at all. */
+#include "mbrtowc-impl-utf8.h"
+ }
+ else
+ {
+ /* The hidden internal state of mbtowc would make this function not
+ multi-thread safe. Achieve multi-thread safety through a lock. */
+ wchar_t wc;
+ res = mbtowc_with_lock (&wc, p, m);
+
+ if (res >= 0)
+ {
+ if ((wc == 0) != (res == 0))
+ abort ();
+ if (pwc != NULL)
+ *pwc = wc;
+ goto success;
+ }
+
+ /* mbtowc does not distinguish between invalid and incomplete multibyte
+ sequences. But mbrtowc needs to make this distinction.
+ There are two possible approaches:
+ - Use iconv() and its return value.
+ - Use built-in knowledge about the possible encodings.
+ Given the low quality of implementation of iconv() on the systems
+ that lack mbrtowc(), we use the second approach.
+ The possible encodings are:
+ - 8-bit encodings,
+ - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
+ - UTF-8 (already handled above).
+ Use specialized code for each. */
+ if (m >= 4 || m >= MB_CUR_MAX)
+ goto invalid;
+ /* Here MB_CUR_MAX > 1 and 0 < m < 4. */
+ switch (enc)
+ {
+ /* As a reference for this code, you can use the GNU libiconv
+ implementation. Look for uses of the RET_TOOFEW macro. */
+
+ case enc_eucjp: /* EUC-JP */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
+ goto incomplete;
+ }
+ if (m == 2)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c == 0x8f)
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if (c2 >= 0xa1 && c2 < 0xff)
+ goto incomplete;
+ }
+ }
+ goto invalid;
+ }
+
+ case enc_94: /* EUC-KR, GB2312, BIG5 */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c >= 0xa1 && c < 0xff)
+ goto incomplete;
+ }
+ goto invalid;
+ }
+
+ case enc_euctw: /* EUC-TW */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
+ goto incomplete;
+ }
+ else /* m == 2 || m == 3 */
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c == 0x8e)
+ goto incomplete;
+ }
+ goto invalid;
+ }
+
+ case enc_gb18030: /* GB18030 */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
+ goto incomplete;
+ }
+ else /* m == 2 || m == 3 */
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if (c >= 0x90 && c <= 0xe3)
+ {
+ unsigned char c2 = (unsigned char) p[1];
+
+ if (c2 >= 0x30 && c2 <= 0x39)
+ {
+ if (m == 2)
+ goto incomplete;
+ else /* m == 3 */
+ {
+ unsigned char c3 = (unsigned char) p[2];
+
+ if (c3 >= 0x81 && c3 <= 0xfe)
+ goto incomplete;
+ }
+ }
+ }
+ }
+ goto invalid;
+ }
+
+ case enc_sjis: /* SJIS */
+ {
+ if (m == 1)
+ {
+ unsigned char c = (unsigned char) p[0];
+
+ if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
+ || (c >= 0xf0 && c <= 0xf9))
+ goto incomplete;
+ }
+ goto invalid;
+ }
+
+ default:
+ /* An unknown multibyte encoding. */
+ goto incomplete;
+ }
+ }
+
+ success:
+ /* res >= 0 is the corrected return value of
+ mbtowc_with_lock (&wc, p, m). */
+ if (nstate >= (res > 0 ? res : 1))
+ abort ();
+ res -= nstate;
+ pstate[0] = 0;
+ return res;
+
+ incomplete:
+ {
+ size_t k = nstate;
+ /* Here 0 <= k < m < 4. */
+ pstate[++k] = s[0];
+ if (k < m)
+ {
+ pstate[++k] = s[1];
+ if (k < m)
+ pstate[++k] = s[2];
+ }
+ if (k != m)
+ abort ();
+ }
+ pstate[0] = m;
+ return (size_t)(-2);
+
+ invalid:
+ errno = EILSEQ;
+ /* The conversion state is undefined, says POSIX. */
+ return (size_t)(-1);
+ }
diff --git a/gl/mbrtowc.c b/gl/mbrtowc.c
new file mode 100644
index 0000000..c1a689a
--- /dev/null
+++ b/gl/mbrtowc.c
@@ -0,0 +1,157 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 1999-2002, 2005-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#if GNULIB_defined_mbstate_t
+/* Implement mbrtowc() on top of mbtowc() for the non-UTF-8 locales
+ and directly for the UTF-8 locales. */
+
+# include <errno.h>
+# include <stdint.h>
+# include <stdlib.h>
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+# if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+
+# endif
+
+# include "attribute.h"
+# include "lc-charset-dispatch.h"
+# include "mbtowc-lock.h"
+
+static_assert (sizeof (mbstate_t) >= 4);
+static char internal_state[4];
+
+size_t
+mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
+{
+# define FITS_IN_CHAR_TYPE(wc) ((wc) <= WCHAR_MAX)
+# include "mbrtowc-impl.h"
+}
+
+#else
+/* Override the system's mbrtowc() function. */
+
+# if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
+# include "hard-locale.h"
+# include <locale.h>
+# endif
+
+# undef mbrtowc
+
+size_t
+rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
+{
+ size_t ret;
+ wchar_t wc;
+
+# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG
+ if (s == NULL)
+ {
+ pwc = NULL;
+ s = "";
+ n = 1;
+ }
+# endif
+
+# if MBRTOWC_EMPTY_INPUT_BUG
+ if (n == 0)
+ return (size_t) -2;
+# endif
+
+ if (! pwc)
+ pwc = &wc;
+
+# if MBRTOWC_RETVAL_BUG
+ {
+ static mbstate_t internal_state;
+
+ /* Override mbrtowc's internal state. We cannot call mbsinit() on the
+ hidden internal state, but we can call it on our variable. */
+ if (ps == NULL)
+ ps = &internal_state;
+
+ if (!mbsinit (ps))
+ {
+ /* Parse the rest of the multibyte character byte for byte. */
+ size_t count = 0;
+ for (; n > 0; s++, n--)
+ {
+ ret = mbrtowc (&wc, s, 1, ps);
+
+ if (ret == (size_t)(-1))
+ return (size_t)(-1);
+ count++;
+ if (ret != (size_t)(-2))
+ {
+ /* The multibyte character has been completed. */
+ *pwc = wc;
+ return (wc == 0 ? 0 : count);
+ }
+ }
+ return (size_t)(-2);
+ }
+ }
+# endif
+
+# if MBRTOWC_STORES_INCOMPLETE_BUG
+ ret = mbrtowc (&wc, s, n, ps);
+ if (ret < (size_t) -2 && pwc != NULL)
+ *pwc = wc;
+# else
+ ret = mbrtowc (pwc, s, n, ps);
+# endif
+
+# if MBRTOWC_NUL_RETVAL_BUG
+ if (ret < (size_t) -2 && !*pwc)
+ return 0;
+# endif
+
+# if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
+ if ((size_t) -2 <= ret && n != 0 && ! hard_locale (LC_CTYPE))
+ {
+ unsigned char uc = *s;
+ *pwc = uc;
+ return 1;
+ }
+# endif
+
+ return ret;
+}
+
+#endif
diff --git a/gl/mbsinit.c b/gl/mbsinit.c
new file mode 100644
index 0000000..6e60079
--- /dev/null
+++ b/gl/mbsinit.c
@@ -0,0 +1,69 @@
+/* Test for initial conversion state.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+
+#if GNULIB_defined_mbstate_t
+
+/* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs()
+ and wcrtomb(), wcsrtombs().
+ We assume that
+ - sizeof (mbstate_t) >= 4,
+ - only stateless encodings are supported (such as UTF-8 and EUC-JP, but
+ not ISO-2022 variants),
+ - for each encoding, the number of bytes for a wide character is <= 4.
+ (This maximum is attained for UTF-8, GB18030, EUC-TW.)
+ We define the meaning of mbstate_t as follows:
+ - In mb -> wc direction, mbstate_t's first byte contains the number of
+ buffered bytes (in the range 0..3), followed by up to 3 buffered bytes.
+ See mbrtowc.c.
+ - In wc -> mb direction, mbstate_t contains no information. In other
+ words, it is always in the initial state. */
+
+static_assert (sizeof (mbstate_t) >= 4);
+
+int
+mbsinit (const mbstate_t *ps)
+{
+ const char *pstate = (const char *)ps;
+
+ return pstate == NULL || pstate[0] == 0;
+}
+
+#else
+
+int
+mbsinit (const mbstate_t *ps)
+{
+# if defined _WIN32 && !defined __CYGWIN__
+ /* Native Windows. */
+ /* MSVC defines 'mbstate_t' as an 8-byte struct; the first 4 bytes matter.
+ On mingw, 'mbstate_t' is sometimes defined as 'int', sometimes defined as
+ an 8-byte struct, of which the first 4 bytes matter. */
+ return ps == NULL || *(const unsigned int *)ps == 0;
+# else
+ /* Minix, HP-UX 11.00, Solaris 2.6, Interix, ... */
+ /* Maybe this definition works, maybe not... */
+ return ps == NULL || *(const char *)ps == 0;
+# endif
+}
+
+#endif
diff --git a/gl/mbtowc-impl.h b/gl/mbtowc-impl.h
new file mode 100644
index 0000000..39b977b
--- /dev/null
+++ b/gl/mbtowc-impl.h
@@ -0,0 +1,44 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* We don't need a static internal state, because the encoding is not state
+ dependent, and when mbrtowc returns (size_t)(-2). we throw the result
+ away. */
+
+int
+mbtowc (wchar_t *pwc, const char *s, size_t n)
+{
+ if (s == NULL)
+ return 0;
+ else
+ {
+ mbstate_t state;
+ wchar_t wc;
+ size_t result;
+
+ memset (&state, 0, sizeof (mbstate_t));
+ result = mbrtowc (&wc, s, n, &state);
+ if (result == (size_t)-1 || result == (size_t)-2)
+ {
+ errno = EILSEQ;
+ return -1;
+ }
+ if (pwc != NULL)
+ *pwc = wc;
+ return (wc == 0 ? 0 : result);
+ }
+}
diff --git a/gl/mbtowc-lock.c b/gl/mbtowc-lock.c
new file mode 100644
index 0000000..6ca6e10
--- /dev/null
+++ b/gl/mbtowc-lock.c
@@ -0,0 +1,150 @@
+/* Return the internal lock used by mbrtowc and mbrtoc32.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020. */
+
+#include <config.h>
+
+/* When it is known that the gl_get_mbtowc_lock function is defined
+ by a dependency library, it should not be defined here. */
+#if OMIT_MBTOWC_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by mbrtowc and mbrtoc32.
+ It is a separate compilation unit, so that only one copy of it is
+ present when linking statically. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_mbtowc_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+ when compiled into a shared library. */
+# ifndef DLL_EXPORTED
+# if HAVE_VISIBILITY
+ /* Override the effect of the compiler option '-fvisibility=hidden'. */
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# elif defined _WIN32 || defined __CYGWIN__
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+ because the latter is not guaranteed to be a stable ABI in the future. */
+
+/* Make sure the function gets exported from DLLs. */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+CRITICAL_SECTION *
+gl_get_mbtowc_lock (void)
+{
+ if (!guard.done)
+ {
+ if (InterlockedIncrement (&guard.started) == 0)
+ {
+ /* This thread is the first one to need the lock. Initialize it. */
+ InitializeCriticalSection (&lock);
+ guard.done = 1;
+ }
+ else
+ {
+ /* Don't let guard.started grow and wrap around. */
+ InterlockedDecrement (&guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!guard.done)
+ Sleep (0);
+ }
+ }
+ return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+pthread_mutex_t *
+gl_get_mbtowc_lock (void)
+{
+ return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+# include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+ if (mtx_init (&mutex, mtx_plain) != thrd_success)
+ abort ();
+ init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED mtx_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+mtx_t *
+gl_get_mbtowc_lock (void)
+{
+ if (init_needed)
+ call_once (&init_once, atomic_init);
+ return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in mbrtowc.c and mbrtoc32.c does not
+ cause a link failure when no DLLs are involved. */
+# if defined _WIN64 || defined _LP64
+# define IMP(x) __imp_##x
+# else
+# define IMP(x) _imp__##x
+# endif
+void * IMP(gl_get_mbtowc_lock) = &gl_get_mbtowc_lock;
+# endif
+
+#endif
diff --git a/gl/mbtowc-lock.h b/gl/mbtowc-lock.h
new file mode 100644
index 0000000..2dc22ac
--- /dev/null
+++ b/gl/mbtowc-lock.h
@@ -0,0 +1,125 @@
+/* Use the internal lock used by mbrtowc and mbrtoc32.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020. */
+
+/* Use a lock, so that no two threads can invoke mbtowc at the same time. */
+
+static inline int
+mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m)
+{
+ /* Put the hidden internal state of mbtowc into its initial state.
+ This is needed at least with glibc, uClibc, and MSVC CRT.
+ See <https://sourceware.org/bugzilla/show_bug.cgi?id=9674>. */
+ mbtowc (NULL, NULL, 0);
+
+ return mbtowc (pwc, p, m);
+}
+
+/* Prohibit renaming this symbol. */
+#undef gl_get_mbtowc_lock
+
+#if GNULIB_MBRTOWC_SINGLE_THREAD
+
+/* All uses of this function are in a single thread. No locking needed. */
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ CRITICAL_SECTION *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ EnterCriticalSection (lock);
+ ret = mbtowc_unlocked (pwc, p, m);
+ LeaveCriticalSection (lock);
+
+ return ret;
+}
+
+#elif HAVE_PTHREAD_API /* AIX, IRIX, Cygwin */
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+ __declspec(dllimport)
+# endif
+ pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* IRIX */
+
+ /* Avoid the need to link with '-lpthread'. */
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+
+ /* Determine whether libpthread is in use. */
+# pragma weak pthread_mutexattr_gettype
+ /* See the comments in lock.h. */
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+# define pthread_in_use() 1
+# endif
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ if (pthread_in_use())
+ {
+ pthread_mutex_t *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ if (pthread_mutex_lock (lock))
+ abort ();
+ ret = mbtowc_unlocked (pwc, p, m);
+ if (pthread_mutex_unlock (lock))
+ abort ();
+
+ return ret;
+ }
+ else
+ return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ mtx_t *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ if (mtx_lock (lock) != thrd_success)
+ abort ();
+ ret = mbtowc_unlocked (pwc, p, m);
+ if (mtx_unlock (lock) != thrd_success)
+ abort ();
+
+ return ret;
+}
+
+#endif
diff --git a/gl/mbtowc.c b/gl/mbtowc.c
new file mode 100644
index 0000000..8d9b06d
--- /dev/null
+++ b/gl/mbtowc.c
@@ -0,0 +1,26 @@
+/* Convert multibyte character to wide character.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+#include <string.h>
+#include <wchar.h>
+
+#include "mbtowc-impl.h"
diff --git a/gl/memchr.c b/gl/memchr.c
new file mode 100644
index 0000000..8e95579
--- /dev/null
+++ b/gl/memchr.c
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2023
+ Free Software Foundation, Inc.
+
+ Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
+ with help from Dan Sahlin (dan@sics.se) and
+ commentary by Jim Blandy (jimb@ai.mit.edu);
+ adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
+ and implemented by Roland McGrath (roland@ai.mit.edu).
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#include <stddef.h>
+
+#if defined _LIBC
+# include <memcopy.h>
+#else
+# define reg_char char
+#endif
+
+#include <limits.h>
+
+#if HAVE_BP_SYM_H || defined _LIBC
+# include <bp-sym.h>
+#else
+# define BP_SYM(sym) sym
+#endif
+
+#undef __memchr
+#ifdef _LIBC
+# undef memchr
+#endif
+
+#ifndef weak_alias
+# define __memchr memchr
+#endif
+
+/* Search no more than N bytes of S for C. */
+void *
+__memchr (void const *s, int c_in, size_t n)
+{
+ /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+ long instead of a 64-bit uintmax_t tends to give better
+ performance. On 64-bit hardware, unsigned long is generally 64
+ bits already. Change this typedef to experiment with
+ performance. */
+ typedef unsigned long int longword;
+
+ const unsigned char *char_ptr;
+ const longword *longword_ptr;
+ longword repeated_one;
+ longword repeated_c;
+ unsigned reg_char c;
+
+ c = (unsigned char) c_in;
+
+ /* Handle the first few bytes by reading one byte at a time.
+ Do this until CHAR_PTR is aligned on a longword boundary. */
+ for (char_ptr = (const unsigned char *) s;
+ n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+ --n, ++char_ptr)
+ if (*char_ptr == c)
+ return (void *) char_ptr;
+
+ longword_ptr = (const longword *) char_ptr;
+
+ /* All these elucidatory comments refer to 4-byte longwords,
+ but the theory applies equally well to any size longwords. */
+
+ /* Compute auxiliary longword values:
+ repeated_one is a value which has a 1 in every byte.
+ repeated_c has c in every byte. */
+ repeated_one = 0x01010101;
+ repeated_c = c | (c << 8);
+ repeated_c |= repeated_c << 16;
+ if (0xffffffffU < (longword) -1)
+ {
+ repeated_one |= repeated_one << 31 << 1;
+ repeated_c |= repeated_c << 31 << 1;
+ if (8 < sizeof (longword))
+ {
+ size_t i;
+
+ for (i = 64; i < sizeof (longword) * 8; i *= 2)
+ {
+ repeated_one |= repeated_one << i;
+ repeated_c |= repeated_c << i;
+ }
+ }
+ }
+
+ /* Instead of the traditional loop which tests each byte, we will test a
+ longword at a time. The tricky part is testing if *any of the four*
+ bytes in the longword in question are equal to c. We first use an xor
+ with repeated_c. This reduces the task to testing whether *any of the
+ four* bytes in longword1 is zero.
+
+ We compute tmp =
+ ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+ That is, we perform the following operations:
+ 1. Subtract repeated_one.
+ 2. & ~longword1.
+ 3. & a mask consisting of 0x80 in every byte.
+ Consider what happens in each byte:
+ - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+ and step 3 transforms it into 0x80. A carry can also be propagated
+ to more significant bytes.
+ - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+ position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
+ the byte ends in a single bit of value 0 and k bits of value 1.
+ After step 2, the result is just k bits of value 1: 2^k - 1. After
+ step 3, the result is 0. And no carry is produced.
+ So, if longword1 has only non-zero bytes, tmp is zero.
+ Whereas if longword1 has a zero byte, call j the position of the least
+ significant zero byte. Then the result has a zero at positions 0, ...,
+ j-1 and a 0x80 at position j. We cannot predict the result at the more
+ significant bytes (positions j+1..3), but it does not matter since we
+ already have a non-zero bit at position 8*j+7.
+
+ So, the test whether any byte in longword1 is zero is equivalent to
+ testing whether tmp is nonzero. */
+
+ while (n >= sizeof (longword))
+ {
+ longword longword1 = *longword_ptr ^ repeated_c;
+
+ if ((((longword1 - repeated_one) & ~longword1)
+ & (repeated_one << 7)) != 0)
+ break;
+ longword_ptr++;
+ n -= sizeof (longword);
+ }
+
+ char_ptr = (const unsigned char *) longword_ptr;
+
+ /* At this point, we know that either n < sizeof (longword), or one of the
+ sizeof (longword) bytes starting at char_ptr is == c. On little-endian
+ machines, we could determine the first such byte without any further
+ memory accesses, just by looking at the tmp result from the last loop
+ iteration. But this does not work on big-endian machines. Choose code
+ that works in both cases. */
+
+ for (; n > 0; --n, ++char_ptr)
+ {
+ if (*char_ptr == c)
+ return (void *) char_ptr;
+ }
+
+ return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memchr, BP_SYM (memchr))
+#endif
diff --git a/gl/memchr.valgrind b/gl/memchr.valgrind
new file mode 100644
index 0000000..97690f2
--- /dev/null
+++ b/gl/memchr.valgrind
@@ -0,0 +1,30 @@
+# Suppress a valgrind message about use of uninitialized memory in memchr().
+
+# Copyright (C) 2009-2023 Free Software Foundation, Inc.
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# POSIX states that when the character is found, memchr must not read extra
+# bytes in an overestimated length (for example, where memchr is used to
+# implement strnlen). However, we use a safe word read to provide a speedup.
+{
+ memchr-value4
+ Memcheck:Value4
+ fun:rpl_memchr
+}
+{
+ memchr-value8
+ Memcheck:Value8
+ fun:rpl_memchr
+}
diff --git a/gl/minmax.h b/gl/minmax.h
new file mode 100644
index 0000000..1fbfc66
--- /dev/null
+++ b/gl/minmax.h
@@ -0,0 +1,60 @@
+/* MIN, MAX macros.
+ Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _MINMAX_H
+#define _MINMAX_H
+
+/* Note: MIN, MAX are also defined in <sys/param.h> on some systems
+ (glibc, IRIX, HP-UX, OSF/1). Therefore you might get warnings about
+ MIN, MAX macro redefinitions on some systems; the workaround is to
+ #include this file as the last one among the #include list. */
+
+/* Before we define the following symbols we get the <limits.h> file
+ since otherwise we get redefinitions on some systems if <limits.h> is
+ included after this file. Likewise for <sys/param.h>.
+ If more than one of these system headers define MIN and MAX, pick just
+ one of the headers (because the definitions most likely are the same). */
+#if HAVE_MINMAX_IN_LIMITS_H
+# include <limits.h>
+#elif HAVE_MINMAX_IN_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+/* Note: MIN and MAX should be used with two arguments of the
+ same type. They might not return the minimum and maximum of their two
+ arguments, if the arguments have different types or have unusual
+ floating-point values. For example, on a typical host with 32-bit 'int',
+ 64-bit 'long long', and 64-bit IEEE 754 'double' types:
+
+ MAX (-1, 2147483648) returns 4294967295.
+ MAX (9007199254740992.0, 9007199254740993) returns 9007199254740992.0.
+ MAX (NaN, 0.0) returns 0.0.
+ MAX (+0.0, -0.0) returns -0.0.
+
+ and in each case the answer is in some sense bogus. */
+
+/* MAX(a,b) returns the maximum of A and B. */
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
+/* MIN(a,b) returns the minimum of A and B. */
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#endif /* _MINMAX_H */
diff --git a/gl/mktime-internal.h b/gl/mktime-internal.h
new file mode 100644
index 0000000..709c36b
--- /dev/null
+++ b/gl/mktime-internal.h
@@ -0,0 +1,79 @@
+/* Internals of mktime and related functions
+ Copyright 2016-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Paul Eggert <eggert@cs.ucla.edu>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <time.h>
+#endif
+
+/* mktime_offset_t is a signed type wide enough to hold a UTC offset
+ in seconds, and used as part of the type of the offset-guess
+ argument to mktime_internal. In Glibc, it is always long int.
+ When in Gnulib, use time_t on platforms where time_t
+ is signed, to be compatible with platforms like BeOS that export
+ this implementation detail of mktime. On platforms where time_t is
+ unsigned, GNU and POSIX code can assume 'int' is at least 32 bits
+ which is wide enough for a UTC offset. */
+#ifdef _LIBC
+typedef long int mktime_offset_t;
+#elif defined TIME_T_IS_SIGNED
+typedef time_t mktime_offset_t;
+#else
+typedef int mktime_offset_t;
+#endif
+
+/* The source code uses identifiers like __time64_t for glibc
+ timestamps that can contain 64-bit values even when time_t is only
+ 32 bits. These are just macros for the ordinary identifiers unless
+ compiling within glibc when time_t is 32 bits. */
+#if ! (defined _LIBC && __TIMESIZE != 64)
+# undef __time64_t
+# define __time64_t time_t
+# define __gmtime64_r __gmtime_r
+# define __localtime64_r __localtime_r
+# define __mktime64 mktime
+# define __timegm64 timegm
+#endif
+
+#ifndef _LIBC
+
+/* Although glibc source code uses leading underscores, Gnulib wants
+ ordinary names.
+
+ Portable standalone applications should supply a <time.h> that
+ declares a POSIX-compliant localtime_r, for the benefit of older
+ implementations that lack localtime_r or have a nonstandard one.
+ Similarly for gmtime_r. See the gnulib time_r module for one way
+ to implement this. */
+
+# undef __gmtime_r
+# undef __localtime_r
+# define __gmtime_r gmtime_r
+# define __localtime_r localtime_r
+
+# define __mktime_internal mktime_internal
+
+#endif
+
+/* Subroutine of mktime. Return the time_t representation of TP and
+ normalize TP, given that a struct tm * maps to a time_t as performed
+ by FUNC. Record next guess for localtime-gmtime offset in *OFFSET. */
+extern __time64_t __mktime_internal (struct tm *tp,
+ struct tm *(*func) (__time64_t const *,
+ struct tm *),
+ mktime_offset_t *offset) attribute_hidden;
diff --git a/gl/mktime.c b/gl/mktime.c
new file mode 100644
index 0000000..94a4320
--- /dev/null
+++ b/gl/mktime.c
@@ -0,0 +1,578 @@
+/* Convert a 'struct tm' to a time_t value.
+ Copyright (C) 1993-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Paul Eggert <eggert@twinsun.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* The following macros influence what gets defined when this file is compiled:
+
+ Macro/expression Which gnulib module This compilation unit
+ should define
+
+ _LIBC (glibc proper) mktime
+
+ NEED_MKTIME_WORKING mktime rpl_mktime
+ || NEED_MKTIME_WINDOWS
+
+ NEED_MKTIME_INTERNAL mktime-internal mktime_internal
+ */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+/* Assume that leap seconds are possible, unless told otherwise.
+ If the host has a 'zic' command with a '-L leapsecondfilename' option,
+ then it supports leap seconds; otherwise it probably doesn't. */
+#ifndef LEAP_SECONDS_POSSIBLE
+# define LEAP_SECONDS_POSSIBLE 1
+#endif
+
+#include <time.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <intprops.h>
+#include <verify.h>
+
+#ifndef NEED_MKTIME_INTERNAL
+# define NEED_MKTIME_INTERNAL 0
+#endif
+#ifndef NEED_MKTIME_WINDOWS
+# define NEED_MKTIME_WINDOWS 0
+#endif
+#ifndef NEED_MKTIME_WORKING
+# define NEED_MKTIME_WORKING 0
+#endif
+
+#include "mktime-internal.h"
+
+#if !defined _LIBC && (NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS)
+static void
+my_tzset (void)
+{
+# if NEED_MKTIME_WINDOWS
+ /* Rectify the value of the environment variable TZ.
+ There are four possible kinds of such values:
+ - Traditional US time zone names, e.g. "PST8PDT". Syntax: see
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset>
+ - Time zone names based on geography, that contain one or more
+ slashes, e.g. "Europe/Moscow".
+ - Time zone names based on geography, without slashes, e.g.
+ "Singapore".
+ - Time zone names that contain explicit DST rules. Syntax: see
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03>
+ The Microsoft CRT understands only the first kind. It produces incorrect
+ results if the value of TZ is of the other kinds.
+ But in a Cygwin environment, /etc/profile.d/tzset.sh sets TZ to a value
+ of the second kind for most geographies, or of the first kind in a few
+ other geographies. If it is of the second kind, neutralize it. For the
+ Microsoft CRT, an absent or empty TZ means the time zone that the user
+ has set in the Windows Control Panel.
+ If the value of TZ is of the third or fourth kind -- Cygwin programs
+ understand these syntaxes as well --, it does not matter whether we
+ neutralize it or not, since these values occur only when a Cygwin user
+ has set TZ explicitly; this case is 1. rare and 2. under the user's
+ responsibility. */
+ const char *tz = getenv ("TZ");
+ if (tz != NULL && strchr (tz, '/') != NULL)
+ _putenv ("TZ=");
+# else
+ tzset ();
+# endif
+}
+# undef __tzset
+# define __tzset() my_tzset ()
+#endif
+
+#if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL
+
+/* A signed type that can represent an integer number of years
+ multiplied by four times the number of seconds in a year. It is
+ needed when converting a tm_year value times the number of seconds
+ in a year. The factor of four comes because these products need
+ to be subtracted from each other, and sometimes with an offset
+ added to them, and then with another timestamp added, without
+ worrying about overflow.
+
+ Much of the code uses long_int to represent __time64_t values, to
+ lessen the hassle of dealing with platforms where __time64_t is
+ unsigned, and because long_int should suffice to represent all
+ __time64_t values that mktime can generate even on platforms where
+ __time64_t is wider than the int components of struct tm. */
+
+#if INT_MAX <= LONG_MAX / 4 / 366 / 24 / 60 / 60
+typedef long int long_int;
+#else
+typedef long long int long_int;
+#endif
+verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 4 / 366 / 24 / 60 / 60);
+
+/* Shift A right by B bits portably, by dividing A by 2**B and
+ truncating towards minus infinity. B should be in the range 0 <= B
+ <= LONG_INT_BITS - 2, where LONG_INT_BITS is the number of useful
+ bits in a long_int. LONG_INT_BITS is at least 32.
+
+ ISO C99 says that A >> B is implementation-defined if A < 0. Some
+ implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift
+ right in the usual way when A < 0, so SHR falls back on division if
+ ordinary A >> B doesn't seem to be the usual signed shift. */
+
+static long_int
+shr (long_int a, int b)
+{
+ long_int one = 1;
+ return (-one >> 1 == -1
+ ? a >> b
+ : (a + (a < 0)) / (one << b) - (a < 0));
+}
+
+/* Bounds for the intersection of __time64_t and long_int. */
+
+static long_int const mktime_min
+ = ((TYPE_SIGNED (__time64_t)
+ && TYPE_MINIMUM (__time64_t) < TYPE_MINIMUM (long_int))
+ ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (__time64_t));
+static long_int const mktime_max
+ = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (__time64_t)
+ ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (__time64_t));
+
+#define EPOCH_YEAR 1970
+#define TM_YEAR_BASE 1900
+verify (TM_YEAR_BASE % 100 == 0);
+
+/* Is YEAR + TM_YEAR_BASE a leap year? */
+static bool
+leapyear (long_int year)
+{
+ /* Don't add YEAR to TM_YEAR_BASE, as that might overflow.
+ Also, work even if YEAR is negative. */
+ return
+ ((year & 3) == 0
+ && (year % 100 != 0
+ || ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3)));
+}
+
+/* How many days come before each month (0-12). */
+#ifndef _LIBC
+static
+#endif
+const unsigned short int __mon_yday[2][13] =
+ {
+ /* Normal years. */
+ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
+ /* Leap years. */
+ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
+ };
+
+
+/* Do the values A and B differ according to the rules for tm_isdst?
+ A and B differ if one is zero and the other positive. */
+static bool
+isdst_differ (int a, int b)
+{
+ return (!a != !b) && (0 <= a) && (0 <= b);
+}
+
+/* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
+ (YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks
+ were not adjusted between the timestamps.
+
+ The YEAR values uses the same numbering as TP->tm_year. Values
+ need not be in the usual range. However, YEAR1 - YEAR0 must not
+ overflow even when multiplied by three times the number of seconds
+ in a year, and likewise for YDAY1 - YDAY0 and three times the
+ number of seconds in a day. */
+
+static long_int
+ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
+ int year0, int yday0, int hour0, int min0, int sec0)
+{
+ verify (-1 / 2 == 0);
+
+ /* Compute intervening leap days correctly even if year is negative.
+ Take care to avoid integer overflow here. */
+ int a4 = shr (year1, 2) + shr (TM_YEAR_BASE, 2) - ! (year1 & 3);
+ int b4 = shr (year0, 2) + shr (TM_YEAR_BASE, 2) - ! (year0 & 3);
+ int a100 = (a4 + (a4 < 0)) / 25 - (a4 < 0);
+ int b100 = (b4 + (b4 < 0)) / 25 - (b4 < 0);
+ int a400 = shr (a100, 2);
+ int b400 = shr (b100, 2);
+ int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
+
+ /* Compute the desired time without overflowing. */
+ long_int years = year1 - year0;
+ long_int days = 365 * years + yday1 - yday0 + intervening_leap_days;
+ long_int hours = 24 * days + hour1 - hour0;
+ long_int minutes = 60 * hours + min1 - min0;
+ long_int seconds = 60 * minutes + sec1 - sec0;
+ return seconds;
+}
+
+/* Return the average of A and B, even if A + B would overflow.
+ Round toward positive infinity. */
+static long_int
+long_int_avg (long_int a, long_int b)
+{
+ return shr (a, 1) + shr (b, 1) + ((a | b) & 1);
+}
+
+/* Return a long_int value corresponding to (YEAR-YDAY HOUR:MIN:SEC)
+ minus *TP seconds, assuming no clock adjustments occurred between
+ the two timestamps.
+
+ YEAR and YDAY must not be so large that multiplying them by three times the
+ number of seconds in a year (or day, respectively) would overflow long_int.
+ *TP should be in the usual range. */
+static long_int
+tm_diff (long_int year, long_int yday, int hour, int min, int sec,
+ struct tm const *tp)
+{
+ return ydhms_diff (year, yday, hour, min, sec,
+ tp->tm_year, tp->tm_yday,
+ tp->tm_hour, tp->tm_min, tp->tm_sec);
+}
+
+/* Use CONVERT to convert T to a struct tm value in *TM. T must be in
+ range for __time64_t. Return TM if successful, NULL (setting errno) on
+ failure. */
+static struct tm *
+convert_time (struct tm *(*convert) (const __time64_t *, struct tm *),
+ long_int t, struct tm *tm)
+{
+ __time64_t x = t;
+ return convert (&x, tm);
+}
+
+/* Use CONVERT to convert *T to a broken down time in *TP.
+ If *T is out of range for conversion, adjust it so that
+ it is the nearest in-range value and then convert that.
+ A value is in range if it fits in both __time64_t and long_int.
+ Return TP on success, NULL (setting errno) on failure. */
+static struct tm *
+ranged_convert (struct tm *(*convert) (const __time64_t *, struct tm *),
+ long_int *t, struct tm *tp)
+{
+ long_int t1 = (*t < mktime_min ? mktime_min
+ : *t <= mktime_max ? *t : mktime_max);
+ struct tm *r = convert_time (convert, t1, tp);
+ if (r)
+ {
+ *t = t1;
+ return r;
+ }
+ if (errno != EOVERFLOW)
+ return NULL;
+
+ long_int bad = t1;
+ long_int ok = 0;
+ struct tm oktm; oktm.tm_sec = -1;
+
+ /* BAD is a known out-of-range value, and OK is a known in-range one.
+ Use binary search to narrow the range between BAD and OK until
+ they differ by 1. */
+ while (true)
+ {
+ long_int mid = long_int_avg (ok, bad);
+ if (mid == ok || mid == bad)
+ break;
+ if (convert_time (convert, mid, tp))
+ ok = mid, oktm = *tp;
+ else if (errno != EOVERFLOW)
+ return NULL;
+ else
+ bad = mid;
+ }
+
+ if (oktm.tm_sec < 0)
+ return NULL;
+ *t = ok;
+ *tp = oktm;
+ return tp;
+}
+
+
+/* Convert *TP to a __time64_t value, inverting
+ the monotonic and mostly-unit-linear conversion function CONVERT.
+ Use *OFFSET to keep track of a guess at the offset of the result,
+ compared to what the result would be for UTC without leap seconds.
+ If *OFFSET's guess is correct, only one CONVERT call is needed.
+ If successful, set *TP to the canonicalized struct tm;
+ otherwise leave *TP alone, return ((time_t) -1) and set errno.
+ This function is external because it is used also by timegm.c. */
+__time64_t
+__mktime_internal (struct tm *tp,
+ struct tm *(*convert) (const __time64_t *, struct tm *),
+ mktime_offset_t *offset)
+{
+ struct tm tm;
+
+ /* The maximum number of probes (calls to CONVERT) should be enough
+ to handle any combinations of time zone rule changes, solar time,
+ leap seconds, and oscillations around a spring-forward gap.
+ POSIX.1 prohibits leap seconds, but some hosts have them anyway. */
+ int remaining_probes = 6;
+
+ /* Time requested. Copy it in case CONVERT modifies *TP; this can
+ occur if TP is localtime's returned value and CONVERT is localtime. */
+ int sec = tp->tm_sec;
+ int min = tp->tm_min;
+ int hour = tp->tm_hour;
+ int mday = tp->tm_mday;
+ int mon = tp->tm_mon;
+ int year_requested = tp->tm_year;
+ int isdst = tp->tm_isdst;
+
+ /* 1 if the previous probe was DST. */
+ int dst2 = 0;
+
+ /* Ensure that mon is in range, and set year accordingly. */
+ int mon_remainder = mon % 12;
+ int negative_mon_remainder = mon_remainder < 0;
+ int mon_years = mon / 12 - negative_mon_remainder;
+ long_int lyear_requested = year_requested;
+ long_int year = lyear_requested + mon_years;
+
+ /* The other values need not be in range:
+ the remaining code handles overflows correctly. */
+
+ /* Calculate day of year from year, month, and day of month.
+ The result need not be in range. */
+ int mon_yday = ((__mon_yday[leapyear (year)]
+ [mon_remainder + 12 * negative_mon_remainder])
+ - 1);
+ long_int lmday = mday;
+ long_int yday = mon_yday + lmday;
+
+ mktime_offset_t off = *offset;
+ int negative_offset_guess;
+
+ int sec_requested = sec;
+
+ if (LEAP_SECONDS_POSSIBLE)
+ {
+ /* Handle out-of-range seconds specially,
+ since ydhms_diff assumes every minute has 60 seconds. */
+ if (sec < 0)
+ sec = 0;
+ if (59 < sec)
+ sec = 59;
+ }
+
+ /* Invert CONVERT by probing. First assume the same offset as last
+ time. */
+
+ INT_SUBTRACT_WRAPV (0, off, &negative_offset_guess);
+ long_int t0 = ydhms_diff (year, yday, hour, min, sec,
+ EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0,
+ negative_offset_guess);
+ long_int t = t0, t1 = t0, t2 = t0;
+
+ /* Repeatedly use the error to improve the guess. */
+
+ while (true)
+ {
+ if (! ranged_convert (convert, &t, &tm))
+ return -1;
+ long_int dt = tm_diff (year, yday, hour, min, sec, &tm);
+ if (dt == 0)
+ break;
+
+ if (t == t1 && t != t2
+ && (tm.tm_isdst < 0
+ || (isdst < 0
+ ? dst2 <= (tm.tm_isdst != 0)
+ : (isdst != 0) != (tm.tm_isdst != 0))))
+ /* We can't possibly find a match, as we are oscillating
+ between two values. The requested time probably falls
+ within a spring-forward gap of size DT. Follow the common
+ practice in this case, which is to return a time that is DT
+ away from the requested time, preferring a time whose
+ tm_isdst differs from the requested value. (If no tm_isdst
+ was requested and only one of the two values has a nonzero
+ tm_isdst, prefer that value.) In practice, this is more
+ useful than returning -1. */
+ goto offset_found;
+
+ remaining_probes--;
+ if (remaining_probes == 0)
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+
+ t1 = t2, t2 = t, t += dt, dst2 = tm.tm_isdst != 0;
+ }
+
+ /* We have a match. Check whether tm.tm_isdst has the requested
+ value, if any. */
+ if (isdst_differ (isdst, tm.tm_isdst))
+ {
+ /* tm.tm_isdst has the wrong value. Look for a neighboring
+ time with the right value, and use its UTC offset.
+
+ Heuristic: probe the adjacent timestamps in both directions,
+ looking for the desired isdst. If none is found within a
+ reasonable duration bound, assume a one-hour DST difference.
+ This should work for all real time zone histories in the tz
+ database. */
+
+ /* +1 if we wanted standard time but got DST, -1 if the reverse. */
+ int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
+
+ /* Distance between probes when looking for a DST boundary. In
+ tzdata2003a, the shortest period of DST is 601200 seconds
+ (e.g., America/Recife starting 2000-10-08 01:00), and the
+ shortest period of non-DST surrounded by DST is 694800
+ seconds (Africa/Tunis starting 1943-04-17 01:00). Use the
+ minimum of these two values, so we don't miss these short
+ periods when probing. */
+ int stride = 601200;
+
+ /* In TZDB 2021e, the longest period of DST (or of non-DST), in
+ which the DST (or adjacent DST) difference is not one hour,
+ is 457243209 seconds: e.g., America/Cambridge_Bay with leap
+ seconds, starting 1965-10-31 00:00 in a switch from
+ double-daylight time (-05) to standard time (-07), and
+ continuing to 1980-04-27 02:00 in a switch from standard time
+ (-07) to daylight time (-06). */
+ int duration_max = 457243209;
+
+ /* Search in both directions, so the maximum distance is half
+ the duration; add the stride to avoid off-by-1 problems. */
+ int delta_bound = duration_max / 2 + stride;
+
+ int delta, direction;
+
+ for (delta = stride; delta < delta_bound; delta += stride)
+ for (direction = -1; direction <= 1; direction += 2)
+ {
+ long_int ot;
+ if (! INT_ADD_WRAPV (t, delta * direction, &ot))
+ {
+ struct tm otm;
+ if (! ranged_convert (convert, &ot, &otm))
+ return -1;
+ if (! isdst_differ (isdst, otm.tm_isdst))
+ {
+ /* We found the desired tm_isdst.
+ Extrapolate back to the desired time. */
+ long_int gt = ot + tm_diff (year, yday, hour, min, sec,
+ &otm);
+ if (mktime_min <= gt && gt <= mktime_max)
+ {
+ if (convert_time (convert, gt, &tm))
+ {
+ t = gt;
+ goto offset_found;
+ }
+ if (errno != EOVERFLOW)
+ return -1;
+ }
+ }
+ }
+ }
+
+ /* No unusual DST offset was found nearby. Assume one-hour DST. */
+ t += 60 * 60 * dst_difference;
+ if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
+ goto offset_found;
+
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+
+ offset_found:
+ /* Set *OFFSET to the low-order bits of T - T0 - NEGATIVE_OFFSET_GUESS.
+ This is just a heuristic to speed up the next mktime call, and
+ correctness is unaffected if integer overflow occurs here. */
+ INT_SUBTRACT_WRAPV (t, t0, offset);
+ INT_SUBTRACT_WRAPV (*offset, negative_offset_guess, offset);
+
+ if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec)
+ {
+ /* Adjust time to reflect the tm_sec requested, not the normalized value.
+ Also, repair any damage from a false match due to a leap second. */
+ long_int sec_adjustment = sec == 0 && tm.tm_sec == 60;
+ sec_adjustment -= sec;
+ sec_adjustment += sec_requested;
+ if (INT_ADD_WRAPV (t, sec_adjustment, &t)
+ || ! (mktime_min <= t && t <= mktime_max))
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+ if (! convert_time (convert, t, &tm))
+ return -1;
+ }
+
+ *tp = tm;
+ return t;
+}
+
+#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL */
+
+#if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS
+
+/* Convert *TP to a __time64_t value. */
+__time64_t
+__mktime64 (struct tm *tp)
+{
+ /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
+ time zone names contained in the external variable 'tzname' shall
+ be set as if the tzset() function had been called. */
+ __tzset ();
+
+# if defined _LIBC || NEED_MKTIME_WORKING
+ static mktime_offset_t localtime_offset;
+ return __mktime_internal (tp, __localtime64_r, &localtime_offset);
+# else
+# undef mktime
+ return mktime (tp);
+# endif
+}
+#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */
+
+#if defined _LIBC && __TIMESIZE != 64
+
+libc_hidden_def (__mktime64)
+
+time_t
+mktime (struct tm *tp)
+{
+ struct tm tm = *tp;
+ __time64_t t = __mktime64 (&tm);
+ if (in_time_t_range (t))
+ {
+ *tp = tm;
+ return t;
+ }
+ else
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+}
+
+#endif
+
+weak_alias (mktime, timelocal)
+libc_hidden_def (mktime)
+libc_hidden_weak (timelocal)
diff --git a/gl/mountlist.c b/gl/mountlist.c
new file mode 100644
index 0000000..6d38481
--- /dev/null
+++ b/gl/mountlist.c
@@ -0,0 +1,1120 @@
+/* mountlist.c -- return a list of mounted file systems
+
+ Copyright (C) 1991-1992, 1997-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "mountlist.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+
+#include "xalloc.h"
+
+#include <errno.h>
+
+#include <fcntl.h>
+
+#include <unistd.h>
+
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#if MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
+#if defined MOUNTED_GETFSSTAT /* OSF/1, also (obsolete) Apple Darwin 1.3 */
+# if HAVE_SYS_UCRED_H
+# include <grp.h> /* needed on OSF V4.0 for definition of NGROUPS,
+ NGROUPS is used as an array dimension in ucred.h */
+# include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
+# endif
+# if HAVE_SYS_MOUNT_H
+# include <sys/mount.h>
+# endif
+# if HAVE_SYS_FS_TYPES_H
+# include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
+# endif
+# if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
+# define FS_TYPE(Ent) ((Ent).f_fstypename)
+# else
+# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
+# endif
+#endif /* MOUNTED_GETFSSTAT */
+
+#ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, IRIX, Cygwin, Android,
+ also (obsolete) 4.3BSD, SunOS */
+# include <mntent.h>
+# include <sys/types.h>
+# if defined __ANDROID__ /* Android */
+ /* Bionic versions from between 2014-01-09 and 2015-01-08 define MOUNTED to
+ an incorrect value; older Bionic versions don't define it at all. */
+# undef MOUNTED
+# define MOUNTED "/proc/mounts"
+# elif !defined MOUNTED
+# if defined _PATH_MOUNTED /* GNU libc */
+# define MOUNTED _PATH_MOUNTED
+# endif
+# if defined MNT_MNTTAB /* HP-UX. */
+# define MOUNTED MNT_MNTTAB
+# endif
+# endif
+#endif
+
+#ifdef MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
+# include <sys/mount.h>
+#endif
+
+#ifdef MOUNTED_GETMNTINFO2 /* NetBSD, Minix */
+# include <sys/statvfs.h>
+#endif
+
+#ifdef MOUNTED_FS_STAT_DEV /* Haiku, also (obsolete) BeOS */
+# include <fs_info.h>
+# include <dirent.h>
+#endif
+
+#ifdef MOUNTED_FREAD_FSTYP /* (obsolete) SVR3 */
+# include <mnttab.h>
+# include <sys/fstyp.h>
+# include <sys/statfs.h>
+#endif
+
+#ifdef MOUNTED_GETEXTMNTENT /* Solaris >= 8 */
+# include <sys/mnttab.h>
+#endif
+
+#ifdef MOUNTED_GETMNTENT2 /* Solaris < 8, also (obsolete) SVR4 */
+# include <sys/mnttab.h>
+#endif
+
+#ifdef MOUNTED_VMOUNT /* AIX */
+# include <fshelp.h>
+# include <sys/vfs.h>
+#endif
+
+#ifdef MOUNTED_INTERIX_STATVFS /* Interix */
+# include <sys/statvfs.h>
+# include <dirent.h>
+#endif
+
+#if HAVE_SYS_MNTENT_H
+/* This is to get MNTOPT_IGNORE on e.g. SVR4. */
+# include <sys/mntent.h>
+#endif
+
+#ifdef MOUNTED_GETMNTENT1
+# if !HAVE_SETMNTENT /* Android <= 4.4 */
+# define setmntent(fp,mode) fopen (fp, mode "e")
+# endif
+# if !HAVE_ENDMNTENT /* Android <= 4.4 */
+# define endmntent(fp) fclose (fp)
+# endif
+#endif
+
+#ifndef HAVE_HASMNTOPT
+# define hasmntopt(mnt, opt) ((char *) 0)
+#endif
+
+#undef MNT_IGNORE
+#ifdef MNTOPT_IGNORE
+# if defined __sun && defined __SVR4
+/* Solaris defines hasmntopt(struct mnttab *, char *)
+ while it is otherwise hasmntopt(struct mnttab *, const char *). */
+# define MNT_IGNORE(M) hasmntopt (M, (char *) MNTOPT_IGNORE)
+# else
+# define MNT_IGNORE(M) hasmntopt (M, MNTOPT_IGNORE)
+# endif
+#else
+# define MNT_IGNORE(M) 0
+#endif
+
+/* Each of the FILE streams in this file is only used in a single thread. */
+#include "unlocked-io.h"
+
+/* The results of opendir() in this file are not used with dirfd and fchdir,
+ therefore save some unnecessary work in fchdir.c. */
+#ifdef GNULIB_defined_opendir
+# undef opendir
+#endif
+#ifdef GNULIB_defined_closedir
+# undef closedir
+#endif
+
+#define ME_DUMMY_0(Fs_name, Fs_type) \
+ (strcmp (Fs_type, "autofs") == 0 \
+ || strcmp (Fs_type, "proc") == 0 \
+ || strcmp (Fs_type, "subfs") == 0 \
+ /* for Linux 2.6/3.x */ \
+ || strcmp (Fs_type, "debugfs") == 0 \
+ || strcmp (Fs_type, "devpts") == 0 \
+ || strcmp (Fs_type, "fusectl") == 0 \
+ || strcmp (Fs_type, "fuse.portal") == 0 \
+ || strcmp (Fs_type, "mqueue") == 0 \
+ || strcmp (Fs_type, "rpc_pipefs") == 0 \
+ || strcmp (Fs_type, "sysfs") == 0 \
+ /* FreeBSD, Linux 2.4 */ \
+ || strcmp (Fs_type, "devfs") == 0 \
+ /* for NetBSD 3.0 */ \
+ || strcmp (Fs_type, "kernfs") == 0 \
+ /* for Irix 6.5 */ \
+ || strcmp (Fs_type, "ignore") == 0)
+
+/* Historically, we have marked as "dummy" any file system of type "none",
+ but now that programs like du need to know about bind-mounted directories,
+ we grant an exception to any with "bind" in its list of mount options.
+ I.e., those are *not* dummy entries. */
+#ifdef MOUNTED_GETMNTENT1
+# define ME_DUMMY(Fs_name, Fs_type, Bind) \
+ (ME_DUMMY_0 (Fs_name, Fs_type) \
+ || (strcmp (Fs_type, "none") == 0 && !Bind))
+#else
+# define ME_DUMMY(Fs_name, Fs_type) \
+ (ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0)
+#endif
+
+#ifdef __CYGWIN__
+# include <windows.h>
+/* Don't assume that UNICODE is not defined. */
+# undef GetDriveType
+# define GetDriveType GetDriveTypeA
+# define ME_REMOTE me_remote
+/* All cygwin mount points include ':' or start with '//'; so it
+ requires a native Windows call to determine remote disks. */
+static bool
+me_remote (char const *fs_name, _GL_UNUSED char const *fs_type)
+{
+ if (fs_name[0] && fs_name[1] == ':')
+ {
+ char drive[4];
+ sprintf (drive, "%c:\\", fs_name[0]);
+ switch (GetDriveType (drive))
+ {
+ case DRIVE_REMOVABLE:
+ case DRIVE_FIXED:
+ case DRIVE_CDROM:
+ case DRIVE_RAMDISK:
+ return false;
+ }
+ }
+ return true;
+}
+#endif
+
+#ifndef ME_REMOTE
+/* A file system is "remote" if its Fs_name contains a ':'
+ or if (it is of type (smbfs or cifs) and its Fs_name starts with '//')
+ or if it is of any other of the listed types
+ or Fs_name is equal to "-hosts" (used by autofs to mount remote fs).
+ "VM" file systems like prl_fs or vboxsf are not considered remote here. */
+# define ME_REMOTE(Fs_name, Fs_type) \
+ (strchr (Fs_name, ':') != NULL \
+ || ((Fs_name)[0] == '/' \
+ && (Fs_name)[1] == '/' \
+ && (strcmp (Fs_type, "smbfs") == 0 \
+ || strcmp (Fs_type, "smb3") == 0 \
+ || strcmp (Fs_type, "cifs") == 0)) \
+ || strcmp (Fs_type, "acfs") == 0 \
+ || strcmp (Fs_type, "afs") == 0 \
+ || strcmp (Fs_type, "coda") == 0 \
+ || strcmp (Fs_type, "auristorfs") == 0 \
+ || strcmp (Fs_type, "fhgfs") == 0 \
+ || strcmp (Fs_type, "gpfs") == 0 \
+ || strcmp (Fs_type, "ibrix") == 0 \
+ || strcmp (Fs_type, "ocfs2") == 0 \
+ || strcmp (Fs_type, "vxfs") == 0 \
+ || strcmp ("-hosts", Fs_name) == 0)
+#endif
+
+#if MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
+
+# if ! HAVE_STRUCT_STATFS_F_FSTYPENAME
+static char *
+fstype_to_string (short int t)
+{
+ switch (t)
+ {
+# ifdef MOUNT_PC
+ case MOUNT_PC:
+ return "pc";
+# endif
+# ifdef MOUNT_MFS
+ case MOUNT_MFS:
+ return "mfs";
+# endif
+# ifdef MOUNT_LO
+ case MOUNT_LO:
+ return "lo";
+# endif
+# ifdef MOUNT_TFS
+ case MOUNT_TFS:
+ return "tfs";
+# endif
+# ifdef MOUNT_TMP
+ case MOUNT_TMP:
+ return "tmp";
+# endif
+# ifdef MOUNT_UFS
+ case MOUNT_UFS:
+ return "ufs" ;
+# endif
+# ifdef MOUNT_NFS
+ case MOUNT_NFS:
+ return "nfs" ;
+# endif
+# ifdef MOUNT_MSDOS
+ case MOUNT_MSDOS:
+ return "msdos" ;
+# endif
+# ifdef MOUNT_LFS
+ case MOUNT_LFS:
+ return "lfs" ;
+# endif
+# ifdef MOUNT_LOFS
+ case MOUNT_LOFS:
+ return "lofs" ;
+# endif
+# ifdef MOUNT_FDESC
+ case MOUNT_FDESC:
+ return "fdesc" ;
+# endif
+# ifdef MOUNT_PORTAL
+ case MOUNT_PORTAL:
+ return "portal" ;
+# endif
+# ifdef MOUNT_NULL
+ case MOUNT_NULL:
+ return "null" ;
+# endif
+# ifdef MOUNT_UMAP
+ case MOUNT_UMAP:
+ return "umap" ;
+# endif
+# ifdef MOUNT_KERNFS
+ case MOUNT_KERNFS:
+ return "kernfs" ;
+# endif
+# ifdef MOUNT_PROCFS
+ case MOUNT_PROCFS:
+ return "procfs" ;
+# endif
+# ifdef MOUNT_AFS
+ case MOUNT_AFS:
+ return "afs" ;
+# endif
+# ifdef MOUNT_CD9660
+ case MOUNT_CD9660:
+ return "cd9660" ;
+# endif
+# ifdef MOUNT_UNION
+ case MOUNT_UNION:
+ return "union" ;
+# endif
+# ifdef MOUNT_DEVFS
+ case MOUNT_DEVFS:
+ return "devfs" ;
+# endif
+# ifdef MOUNT_EXT2FS
+ case MOUNT_EXT2FS:
+ return "ext2fs" ;
+# endif
+ default:
+ return "?";
+ }
+}
+# endif
+
+static char *
+fsp_to_string (const struct statfs *fsp)
+{
+# if HAVE_STRUCT_STATFS_F_FSTYPENAME
+ return (char *) (fsp->f_fstypename);
+# else
+ return fstype_to_string (fsp->f_type);
+# endif
+}
+
+#endif /* MOUNTED_GETMNTINFO */
+
+#ifdef MOUNTED_VMOUNT /* AIX */
+static char *
+fstype_to_string (int t)
+{
+ struct vfs_ent *e;
+
+ e = getvfsbytype (t);
+ if (!e || !e->vfsent_name)
+ return "none";
+ else
+ return e->vfsent_name;
+}
+#endif /* MOUNTED_VMOUNT */
+
+
+#if defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2
+
+/* Return the device number from MOUNT_OPTIONS, if possible.
+ Otherwise return (dev_t) -1. */
+static dev_t
+dev_from_mount_options (char const *mount_options)
+{
+ /* GNU/Linux allows file system implementations to define their own
+ meaning for "dev=" mount options, so don't trust the meaning
+ here. */
+# ifndef __linux__
+
+ static char const dev_pattern[] = ",dev=";
+ char const *devopt = strstr (mount_options, dev_pattern);
+
+ if (devopt)
+ {
+ char const *optval = devopt + sizeof dev_pattern - 1;
+ char *optvalend;
+ unsigned long int dev;
+ errno = 0;
+ dev = strtoul (optval, &optvalend, 16);
+ if (optval != optvalend
+ && (*optvalend == '\0' || *optvalend == ',')
+ && ! (dev == ULONG_MAX && errno == ERANGE)
+ && dev == (dev_t) dev)
+ return dev;
+ }
+
+# endif
+ (void) mount_options;
+ return -1;
+}
+
+#endif
+
+#if defined MOUNTED_GETMNTENT1 && (defined __linux__ || defined __ANDROID__) /* GNU/Linux, Android */
+
+/* Unescape the paths in mount tables.
+ STR is updated in place. */
+
+static void
+unescape_tab (char *str)
+{
+ size_t i, j = 0;
+ size_t len = strlen (str) + 1;
+ for (i = 0; i < len; i++)
+ {
+ if (str[i] == '\\' && (i + 4 < len)
+ && str[i + 1] >= '0' && str[i + 1] <= '3'
+ && str[i + 2] >= '0' && str[i + 2] <= '7'
+ && str[i + 3] >= '0' && str[i + 3] <= '7')
+ {
+ str[j++] = (str[i + 1] - '0') * 64 +
+ (str[i + 2] - '0') * 8 +
+ (str[i + 3] - '0');
+ i += 3;
+ }
+ else
+ str[j++] = str[i];
+ }
+}
+
+/* Find the next space in STR, terminate the string there in place,
+ and return that position. Otherwise return NULL. */
+
+static char *
+terminate_at_blank (char *str)
+{
+ char *s = strchr (str, ' ');
+ if (s)
+ *s = '\0';
+ return s;
+}
+#endif
+
+/* Return a list of the currently mounted file systems, or NULL on error.
+ Add each entry to the tail of the list so that they stay in order.
+ If NEED_FS_TYPE is true, ensure that the file system type fields in
+ the returned list are valid. Otherwise, they might not be. */
+
+struct mount_entry *
+read_file_system_list (bool need_fs_type)
+{
+ struct mount_entry *mount_list;
+ struct mount_entry *me;
+ struct mount_entry **mtail = &mount_list;
+ (void) need_fs_type;
+
+#ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, IRIX, Cygwin, Android,
+ also (obsolete) 4.3BSD, SunOS */
+ {
+ FILE *fp;
+
+# if defined __linux__ || defined __ANDROID__
+ /* Try parsing mountinfo first, as that make device IDs available.
+ Note we could use libmount routines to simplify this parsing a little
+ (and that code is in previous versions of this function), however
+ libmount depends on libselinux which pulls in many dependencies. */
+ char const *mountinfo = "/proc/self/mountinfo";
+ fp = fopen (mountinfo, "re");
+ if (fp != NULL)
+ {
+ char *line = NULL;
+ size_t buf_size = 0;
+
+ while (getline (&line, &buf_size, fp) != -1)
+ {
+ unsigned int devmaj, devmin;
+ int rc, mntroot_s;
+
+ rc = sscanf(line, "%*u " /* id - discarded */
+ "%*u " /* parent - discarded */
+ "%u:%u " /* dev major:minor */
+ "%n", /* mountroot (start) */
+ &devmaj, &devmin,
+ &mntroot_s);
+
+ if (rc != 2 && rc != 3) /* 3 if %n included in count. */
+ continue;
+
+ /* find end of MNTROOT. */
+ char *mntroot = line + mntroot_s;
+ char *blank = terminate_at_blank (mntroot);
+ if (! blank)
+ continue;
+
+ /* find end of TARGET. */
+ char *target = blank + 1;
+ blank = terminate_at_blank (target);
+ if (! blank)
+ continue;
+
+ /* skip optional fields, terminated by " - " */
+ char *dash = strstr (blank + 1, " - ");
+ if (! dash)
+ continue;
+
+ /* advance past the " - " separator. */
+ char *fstype = dash + 3;
+ blank = terminate_at_blank (fstype);
+ if (! blank)
+ continue;
+
+ /* find end of SOURCE. */
+ char *source = blank + 1;
+ if (! terminate_at_blank (source))
+ continue;
+
+ /* manipulate the sub-strings in place. */
+ unescape_tab (source);
+ unescape_tab (target);
+ unescape_tab (mntroot);
+ unescape_tab (fstype);
+
+ me = xmalloc (sizeof *me);
+
+ me->me_devname = xstrdup (source);
+ me->me_mountdir = xstrdup (target);
+ me->me_mntroot = xstrdup (mntroot);
+ me->me_type = xstrdup (fstype);
+ me->me_type_malloced = 1;
+ me->me_dev = makedev (devmaj, devmin);
+ /* we pass "false" for the "Bind" option as that's only
+ significant when the Fs_type is "none" which will not be
+ the case when parsing "/proc/self/mountinfo", and only
+ applies for static /etc/mtab files. */
+ me->me_dummy = ME_DUMMY (me->me_devname, me->me_type, false);
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+
+ free (line);
+
+ if (ferror (fp))
+ {
+ int saved_errno = errno;
+ fclose (fp);
+ errno = saved_errno;
+ goto free_then_fail;
+ }
+
+ if (fclose (fp) == EOF)
+ goto free_then_fail;
+ }
+ else /* fallback to /proc/self/mounts (/etc/mtab). */
+# endif /* __linux __ || __ANDROID__ */
+ {
+ struct mntent *mnt;
+ char const *table = MOUNTED;
+
+ fp = setmntent (table, "r");
+ if (fp == NULL)
+ return NULL;
+
+ while ((mnt = getmntent (fp)))
+ {
+ bool bind = hasmntopt (mnt, "bind");
+
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (mnt->mnt_fsname);
+ me->me_mountdir = xstrdup (mnt->mnt_dir);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (mnt->mnt_type);
+ me->me_type_malloced = 1;
+ me->me_dummy = ME_DUMMY (me->me_devname, me->me_type, bind);
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+ me->me_dev = dev_from_mount_options (mnt->mnt_opts);
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+
+ if (endmntent (fp) == 0)
+ goto free_then_fail;
+ }
+ }
+#endif /* MOUNTED_GETMNTENT1. */
+
+#ifdef MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
+ {
+ struct statfs *fsp;
+ int entries;
+
+ entries = getmntinfo (&fsp, MNT_NOWAIT);
+ if (entries < 0)
+ return NULL;
+ for (; entries-- > 0; fsp++)
+ {
+ char *fs_type = fsp_to_string (fsp);
+
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (fsp->f_mntfromname);
+ me->me_mountdir = xstrdup (fsp->f_mntonname);
+ me->me_mntroot = NULL;
+ me->me_type = fs_type;
+ me->me_type_malloced = 0;
+ me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+ me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+ }
+#endif /* MOUNTED_GETMNTINFO */
+
+#ifdef MOUNTED_GETMNTINFO2 /* NetBSD, Minix */
+ {
+ struct statvfs *fsp;
+ int entries;
+
+ entries = getmntinfo (&fsp, MNT_NOWAIT);
+ if (entries < 0)
+ return NULL;
+ for (; entries-- > 0; fsp++)
+ {
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (fsp->f_mntfromname);
+ me->me_mountdir = xstrdup (fsp->f_mntonname);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (fsp->f_fstypename);
+ me->me_type_malloced = 1;
+ me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+ me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+ }
+#endif /* MOUNTED_GETMNTINFO2 */
+
+#if defined MOUNTED_FS_STAT_DEV /* Haiku, also (obsolete) BeOS */
+ {
+ /* The next_dev() and fs_stat_dev() system calls give the list of
+ all file systems, including the information returned by statvfs()
+ (fs type, total blocks, free blocks etc.), but without the mount
+ point. But on BeOS all file systems except / are mounted in the
+ rootfs, directly under /.
+ The directory name of the mount point is often, but not always,
+ identical to the volume name of the device.
+ We therefore get the list of subdirectories of /, and the list
+ of all file systems, and match the two lists. */
+
+ DIR *dirp;
+ struct rootdir_entry
+ {
+ char *name;
+ dev_t dev;
+ ino_t ino;
+ struct rootdir_entry *next;
+ };
+ struct rootdir_entry *rootdir_list;
+ struct rootdir_entry **rootdir_tail;
+ int32 pos;
+ dev_t dev;
+ fs_info fi;
+
+ /* All volumes are mounted in the rootfs, directly under /. */
+ rootdir_list = NULL;
+ rootdir_tail = &rootdir_list;
+ dirp = opendir ("/");
+ if (dirp)
+ {
+ struct dirent *d;
+
+ while ((d = readdir (dirp)) != NULL)
+ {
+ char *name;
+ struct stat statbuf;
+
+ if (strcmp (d->d_name, "..") == 0)
+ continue;
+
+ if (strcmp (d->d_name, ".") == 0)
+ name = xstrdup ("/");
+ else
+ {
+ name = xmalloc (1 + strlen (d->d_name) + 1);
+ name[0] = '/';
+ strcpy (name + 1, d->d_name);
+ }
+
+ if (lstat (name, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode))
+ {
+ struct rootdir_entry *re = xmalloc (sizeof *re);
+ re->name = name;
+ re->dev = statbuf.st_dev;
+ re->ino = statbuf.st_ino;
+
+ /* Add to the linked list. */
+ *rootdir_tail = re;
+ rootdir_tail = &re->next;
+ }
+ else
+ free (name);
+ }
+ closedir (dirp);
+ }
+ *rootdir_tail = NULL;
+
+ for (pos = 0; (dev = next_dev (&pos)) >= 0; )
+ if (fs_stat_dev (dev, &fi) >= 0)
+ {
+ /* Note: fi.dev == dev. */
+ struct rootdir_entry *re;
+
+ for (re = rootdir_list; re; re = re->next)
+ if (re->dev == fi.dev && re->ino == fi.root)
+ break;
+
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (fi.device_name[0] != '\0'
+ ? fi.device_name : fi.fsh_name);
+ me->me_mountdir = xstrdup (re != NULL ? re->name : fi.fsh_name);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (fi.fsh_name);
+ me->me_type_malloced = 1;
+ me->me_dev = fi.dev;
+ me->me_dummy = 0;
+ me->me_remote = (fi.flags & B_FS_IS_SHARED) != 0;
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+ *mtail = NULL;
+
+ while (rootdir_list != NULL)
+ {
+ struct rootdir_entry *re = rootdir_list;
+ rootdir_list = re->next;
+ free (re->name);
+ free (re);
+ }
+ }
+#endif /* MOUNTED_FS_STAT_DEV */
+
+#if defined MOUNTED_GETFSSTAT /* OSF/1, also (obsolete) Apple Darwin 1.3 */
+ {
+ int numsys, counter;
+ size_t bufsize;
+ struct statfs *stats;
+
+ numsys = getfsstat (NULL, 0L, MNT_NOWAIT);
+ if (numsys < 0)
+ return NULL;
+ if (SIZE_MAX / sizeof *stats <= numsys)
+ xalloc_die ();
+
+ bufsize = (1 + numsys) * sizeof *stats;
+ stats = xmalloc (bufsize);
+ numsys = getfsstat (stats, bufsize, MNT_NOWAIT);
+
+ if (numsys < 0)
+ {
+ free (stats);
+ return NULL;
+ }
+
+ for (counter = 0; counter < numsys; counter++)
+ {
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (stats[counter].f_mntfromname);
+ me->me_mountdir = xstrdup (stats[counter].f_mntonname);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (FS_TYPE (stats[counter]));
+ me->me_type_malloced = 1;
+ me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+ me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+
+ free (stats);
+ }
+#endif /* MOUNTED_GETFSSTAT */
+
+#if defined MOUNTED_FREAD_FSTYP /* (obsolete) SVR3 */
+ {
+ struct mnttab mnt;
+ char *table = "/etc/mnttab";
+ FILE *fp;
+
+ fp = fopen (table, "re");
+ if (fp == NULL)
+ return NULL;
+
+ while (fread (&mnt, sizeof mnt, 1, fp) > 0)
+ {
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (mnt.mt_dev);
+ me->me_mountdir = xstrdup (mnt.mt_filsys);
+ me->me_mntroot = NULL;
+ me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
+ me->me_type = "";
+ me->me_type_malloced = 0;
+ if (need_fs_type)
+ {
+ struct statfs fsd;
+ char typebuf[FSTYPSZ];
+
+ if (statfs (me->me_mountdir, &fsd, sizeof fsd, 0) != -1
+ && sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1)
+ {
+ me->me_type = xstrdup (typebuf);
+ me->me_type_malloced = 1;
+ }
+ }
+ me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+
+ if (ferror (fp))
+ {
+ /* The last fread() call must have failed. */
+ int saved_errno = errno;
+ fclose (fp);
+ errno = saved_errno;
+ goto free_then_fail;
+ }
+
+ if (fclose (fp) == EOF)
+ goto free_then_fail;
+ }
+#endif /* MOUNTED_FREAD_FSTYP. */
+
+#ifdef MOUNTED_GETEXTMNTENT /* Solaris >= 8 */
+ {
+ struct extmnttab mnt;
+ const char *table = MNTTAB;
+ FILE *fp;
+ int ret;
+
+ /* No locking is needed, because the contents of /etc/mnttab is generated
+ by the kernel. */
+
+ errno = 0;
+ fp = fopen (table, "re");
+ if (fp == NULL)
+ ret = errno;
+ else
+ {
+ while ((ret = getextmntent (fp, &mnt, 1)) == 0)
+ {
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (mnt.mnt_special);
+ me->me_mountdir = xstrdup (mnt.mnt_mountp);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (mnt.mnt_fstype);
+ me->me_type_malloced = 1;
+ me->me_dummy = MNT_IGNORE (&mnt) != 0;
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+ me->me_dev = makedev (mnt.mnt_major, mnt.mnt_minor);
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+
+ ret = fclose (fp) == EOF ? errno : 0 < ret ? 0 : -1;
+ /* Here ret = -1 means success, ret >= 0 means failure. */
+ }
+
+ if (0 <= ret)
+ {
+ errno = ret;
+ goto free_then_fail;
+ }
+ }
+#endif /* MOUNTED_GETEXTMNTENT */
+
+#ifdef MOUNTED_GETMNTENT2 /* Solaris < 8, also (obsolete) SVR4 */
+ {
+ struct mnttab mnt;
+ const char *table = MNTTAB;
+ FILE *fp;
+ int ret;
+ int lockfd = -1;
+
+# if defined F_RDLCK && defined F_SETLKW
+ /* MNTTAB_LOCK is a macro name of our own invention; it's not present in
+ e.g. Solaris 2.6. If the SVR4 folks ever define a macro
+ for this file name, we should use their macro name instead.
+ (Why not just lock MNTTAB directly? We don't know.) */
+# ifndef MNTTAB_LOCK
+# define MNTTAB_LOCK "/etc/.mnttab.lock"
+# endif
+ lockfd = open (MNTTAB_LOCK, O_RDONLY | O_CLOEXEC);
+ if (0 <= lockfd)
+ {
+ struct flock flock;
+ flock.l_type = F_RDLCK;
+ flock.l_whence = SEEK_SET;
+ flock.l_start = 0;
+ flock.l_len = 0;
+ while (fcntl (lockfd, F_SETLKW, &flock) == -1)
+ if (errno != EINTR)
+ {
+ int saved_errno = errno;
+ close (lockfd);
+ errno = saved_errno;
+ return NULL;
+ }
+ }
+ else if (errno != ENOENT)
+ return NULL;
+# endif
+
+ errno = 0;
+ fp = fopen (table, "re");
+ if (fp == NULL)
+ ret = errno;
+ else
+ {
+ while ((ret = getmntent (fp, &mnt)) == 0)
+ {
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (mnt.mnt_special);
+ me->me_mountdir = xstrdup (mnt.mnt_mountp);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (mnt.mnt_fstype);
+ me->me_type_malloced = 1;
+ me->me_dummy = MNT_IGNORE (&mnt) != 0;
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+ me->me_dev = dev_from_mount_options (mnt.mnt_mntopts);
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+
+ ret = fclose (fp) == EOF ? errno : 0 < ret ? 0 : -1;
+ /* Here ret = -1 means success, ret >= 0 means failure. */
+ }
+
+ if (0 <= lockfd && close (lockfd) != 0)
+ ret = errno;
+
+ if (0 <= ret)
+ {
+ errno = ret;
+ goto free_then_fail;
+ }
+ }
+#endif /* MOUNTED_GETMNTENT2. */
+
+#ifdef MOUNTED_VMOUNT /* AIX */
+ {
+ int bufsize;
+ void *entries;
+ char *thisent;
+ struct vmount *vmp;
+ int n_entries;
+ int i;
+
+ /* Ask how many bytes to allocate for the mounted file system info. */
+ entries = &bufsize;
+ if (mntctl (MCTL_QUERY, sizeof bufsize, entries) != 0)
+ return NULL;
+ entries = xmalloc (bufsize);
+
+ /* Get the list of mounted file systems. */
+ n_entries = mntctl (MCTL_QUERY, bufsize, entries);
+ if (n_entries < 0)
+ {
+ free (entries);
+ return NULL;
+ }
+
+ for (i = 0, thisent = entries;
+ i < n_entries;
+ i++, thisent += vmp->vmt_length)
+ {
+ char *options, *ignore;
+
+ vmp = (struct vmount *) thisent;
+ me = xmalloc (sizeof *me);
+ if (vmp->vmt_flags & MNT_REMOTE)
+ {
+ char *host, *dir;
+
+ me->me_remote = 1;
+ /* Prepend the remote dirname. */
+ host = thisent + vmp->vmt_data[VMT_HOSTNAME].vmt_off;
+ dir = thisent + vmp->vmt_data[VMT_OBJECT].vmt_off;
+ me->me_devname = xmalloc (strlen (host) + strlen (dir) + 2);
+ strcpy (me->me_devname, host);
+ strcat (me->me_devname, ":");
+ strcat (me->me_devname, dir);
+ }
+ else
+ {
+ me->me_remote = 0;
+ me->me_devname = xstrdup (thisent +
+ vmp->vmt_data[VMT_OBJECT].vmt_off);
+ }
+ me->me_mountdir = xstrdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (fstype_to_string (vmp->vmt_gfstype));
+ me->me_type_malloced = 1;
+ options = thisent + vmp->vmt_data[VMT_ARGS].vmt_off;
+ ignore = strstr (options, "ignore");
+ me->me_dummy = (ignore
+ && (ignore == options || ignore[-1] == ',')
+ && (ignore[sizeof "ignore" - 1] == ','
+ || ignore[sizeof "ignore" - 1] == '\0'));
+ me->me_dev = (dev_t) -1; /* vmt_fsid might be the info we want. */
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+ free (entries);
+ }
+#endif /* MOUNTED_VMOUNT. */
+
+#ifdef MOUNTED_INTERIX_STATVFS /* Interix */
+ {
+ DIR *dirp = opendir ("/dev/fs");
+ char node[9 + NAME_MAX];
+
+ if (!dirp)
+ goto free_then_fail;
+
+ while (1)
+ {
+ struct statvfs dev;
+ struct dirent entry;
+ struct dirent *result;
+
+ /* FIXME: readdir_r is planned to be withdrawn from POSIX and
+ marked obsolescent in glibc. Use readdir instead. */
+ if (readdir_r (dirp, &entry, &result) || result == NULL)
+ break;
+
+ strcpy (node, "/dev/fs/");
+ strcat (node, entry.d_name);
+
+ if (statvfs (node, &dev) == 0)
+ {
+ me = xmalloc (sizeof *me);
+ me->me_devname = xstrdup (dev.f_mntfromname);
+ me->me_mountdir = xstrdup (dev.f_mntonname);
+ me->me_mntroot = NULL;
+ me->me_type = xstrdup (dev.f_fstypename);
+ me->me_type_malloced = 1;
+ me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
+ me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
+ me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
+
+ /* Add to the linked list. */
+ *mtail = me;
+ mtail = &me->me_next;
+ }
+ }
+ closedir (dirp);
+ }
+#endif /* MOUNTED_INTERIX_STATVFS */
+
+ *mtail = NULL;
+ return mount_list;
+
+
+ free_then_fail: _GL_UNUSED_LABEL;
+ {
+ int saved_errno = errno;
+ *mtail = NULL;
+
+ while (mount_list)
+ {
+ me = mount_list->me_next;
+ free_mount_entry (mount_list);
+ mount_list = me;
+ }
+
+ errno = saved_errno;
+ return NULL;
+ }
+}
+
+/* Free a mount entry as returned from read_file_system_list (). */
+
+void
+free_mount_entry (struct mount_entry *me)
+{
+ free (me->me_devname);
+ free (me->me_mountdir);
+ free (me->me_mntroot);
+ if (me->me_type_malloced)
+ free (me->me_type);
+ free (me);
+}
diff --git a/gl/mountlist.h b/gl/mountlist.h
new file mode 100644
index 0000000..aed7f88
--- /dev/null
+++ b/gl/mountlist.h
@@ -0,0 +1,43 @@
+/* mountlist.h -- declarations for list of mounted file systems
+
+ Copyright (C) 1991-1992, 1998, 2000-2005, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef MOUNTLIST_H_
+# define MOUNTLIST_H_
+
+# include <sys/types.h>
+
+/* A mount table entry. */
+struct mount_entry
+{
+ char *me_devname; /* Device node name, including "/dev/". */
+ char *me_mountdir; /* Mount point directory name. */
+ char *me_mntroot; /* Directory on filesystem of device used */
+ /* as root for the (bind) mount. */
+ char *me_type; /* "nfs", "4.2", etc. */
+ dev_t me_dev; /* Device number of me_mountdir. */
+ unsigned int me_dummy : 1; /* Nonzero for dummy file systems. */
+ unsigned int me_remote : 1; /* Nonzero for remote file systems. */
+ unsigned int me_type_malloced : 1; /* Nonzero if me_type was malloced. */
+ struct mount_entry *me_next;
+};
+
+struct mount_entry *read_file_system_list (bool need_fs_type)
+ _GL_ATTRIBUTE_MALLOC;
+void free_mount_entry (struct mount_entry *entry);
+
+#endif
diff --git a/gl/msvc-inval.c b/gl/msvc-inval.c
new file mode 100644
index 0000000..c5149a8
--- /dev/null
+++ b/gl/msvc-inval.c
@@ -0,0 +1,129 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "msvc-inval.h"
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+
+/* Get _invalid_parameter_handler type and _set_invalid_parameter_handler
+ declaration. */
+# include <stdlib.h>
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file,
+ unsigned int line,
+ uintptr_t dummy)
+{
+}
+
+# else
+
+/* Get declarations of the native Windows API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# if defined _MSC_VER
+
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file,
+ unsigned int line,
+ uintptr_t dummy)
+{
+ RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+# else
+
+/* An index to thread-local storage. */
+static DWORD tls_index;
+static int tls_initialized /* = 0 */;
+
+/* Used as a fallback only. */
+static struct gl_msvc_inval_per_thread not_per_thread;
+
+struct gl_msvc_inval_per_thread *
+gl_msvc_inval_current (void)
+{
+ if (!tls_initialized)
+ {
+ tls_index = TlsAlloc ();
+ tls_initialized = 1;
+ }
+ if (tls_index == TLS_OUT_OF_INDEXES)
+ /* TlsAlloc had failed. */
+ return &not_per_thread;
+ else
+ {
+ struct gl_msvc_inval_per_thread *pointer =
+ (struct gl_msvc_inval_per_thread *) TlsGetValue (tls_index);
+ if (pointer == NULL)
+ {
+ /* First call. Allocate a new 'struct gl_msvc_inval_per_thread'. */
+ pointer =
+ (struct gl_msvc_inval_per_thread *)
+ malloc (sizeof (struct gl_msvc_inval_per_thread));
+ if (pointer == NULL)
+ /* Could not allocate memory. Use the global storage. */
+ pointer = &not_per_thread;
+ TlsSetValue (tls_index, pointer);
+ }
+ return pointer;
+ }
+}
+
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file,
+ unsigned int line,
+ uintptr_t dummy)
+{
+ struct gl_msvc_inval_per_thread *current = gl_msvc_inval_current ();
+ if (current->restart_valid)
+ longjmp (current->restart, 1);
+ else
+ /* An invalid parameter notification from outside the gnulib code.
+ Give the caller a chance to intervene. */
+ RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+# endif
+
+# endif
+
+static int gl_msvc_inval_initialized /* = 0 */;
+
+void
+gl_msvc_inval_ensure_handler (void)
+{
+ if (gl_msvc_inval_initialized == 0)
+ {
+ _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler);
+ gl_msvc_inval_initialized = 1;
+ }
+}
+
+#endif
diff --git a/gl/msvc-inval.h b/gl/msvc-inval.h
new file mode 100644
index 0000000..ed00461
--- /dev/null
+++ b/gl/msvc-inval.h
@@ -0,0 +1,222 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _MSVC_INVAL_H
+#define _MSVC_INVAL_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+ functions like fprintf(), dup2(), or close() crash when the caller passes
+ an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF)
+ instead.
+ This file defines macros that turn such an invalid parameter notification
+ into a non-local exit. An error code can then be produced at the target
+ of this exit. You can thus write code like
+
+ TRY_MSVC_INVAL
+ {
+ <Code that can trigger an invalid parameter notification
+ but does not do 'return', 'break', 'continue', nor 'goto'.>
+ }
+ CATCH_MSVC_INVAL
+ {
+ <Code that handles an invalid parameter notification
+ but does not do 'return', 'break', 'continue', nor 'goto'.>
+ }
+ DONE_MSVC_INVAL;
+
+ This entire block expands to a single statement.
+
+ The handling of invalid parameters can be done in three ways:
+
+ * The default way, which is reasonable for programs (not libraries):
+ AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [DEFAULT_HANDLING])
+
+ * The way for libraries that make "hairy" calls (like close(-1), or
+ fclose(fp) where fileno(fp) is closed, or simply getdtablesize()):
+ AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [HAIRY_LIBRARY_HANDLING])
+
+ * The way for libraries that make no "hairy" calls:
+ AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING])
+ */
+
+#define DEFAULT_HANDLING 0
+#define HAIRY_LIBRARY_HANDLING 1
+#define SANE_LIBRARY_HANDLING 2
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+ && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+/* A native Windows platform with the "invalid parameter handler" concept,
+ and either DEFAULT_HANDLING or HAIRY_LIBRARY_HANDLING. */
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+/* Default handling. */
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* Ensure that the invalid parameter handler in installed that just returns.
+ Because we assume no other part of the program installs a different
+ invalid parameter handler, this solution is multithread-safe. */
+extern void gl_msvc_inval_ensure_handler (void);
+
+# ifdef __cplusplus
+}
+# endif
+
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ gl_msvc_inval_ensure_handler (); \
+ if (1)
+# define CATCH_MSVC_INVAL \
+ else
+# define DONE_MSVC_INVAL \
+ } \
+ while (0)
+
+# else
+/* Handling for hairy libraries. */
+
+# include <excpt.h>
+
+/* Gnulib can define its own status codes, as described in the page
+ "Raising Software Exceptions" on microsoft.com
+ <https://docs.microsoft.com/en-us/cpp/cpp/raising-software-exceptions>.
+ Our status codes are composed of
+ - 0xE0000000, mandatory for all user-defined status codes,
+ - 0x474E550, a API identifier ("GNU"),
+ - 0, 1, 2, ..., used to distinguish different status codes from the
+ same API. */
+# define STATUS_GNULIB_INVALID_PARAMETER (0xE0000000 + 0x474E550 + 0)
+
+# if defined _MSC_VER
+/* A compiler that supports __try/__except, as described in the page
+ "try-except statement" on microsoft.com
+ <https://docs.microsoft.com/en-us/cpp/cpp/try-except-statement>.
+ With __try/__except, we can use the multithread-safe exception handling. */
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* Ensure that the invalid parameter handler in installed that raises a
+ software exception with code STATUS_GNULIB_INVALID_PARAMETER.
+ Because we assume no other part of the program installs a different
+ invalid parameter handler, this solution is multithread-safe. */
+extern void gl_msvc_inval_ensure_handler (void);
+
+# ifdef __cplusplus
+}
+# endif
+
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ gl_msvc_inval_ensure_handler (); \
+ __try
+# define CATCH_MSVC_INVAL \
+ __except (GetExceptionCode () == STATUS_GNULIB_INVALID_PARAMETER \
+ ? EXCEPTION_EXECUTE_HANDLER \
+ : EXCEPTION_CONTINUE_SEARCH)
+# define DONE_MSVC_INVAL \
+ } \
+ while (0)
+
+# else
+/* Any compiler.
+ We can only use setjmp/longjmp. */
+
+# include <setjmp.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+struct gl_msvc_inval_per_thread
+{
+ /* The restart that will resume execution at the code between
+ CATCH_MSVC_INVAL and DONE_MSVC_INVAL. It is enabled only between
+ TRY_MSVC_INVAL and CATCH_MSVC_INVAL. */
+ jmp_buf restart;
+
+ /* Tells whether the contents of restart is valid. */
+ int restart_valid;
+};
+
+/* Ensure that the invalid parameter handler in installed that passes
+ control to the gl_msvc_inval_restart if it is valid, or raises a
+ software exception with code STATUS_GNULIB_INVALID_PARAMETER otherwise.
+ Because we assume no other part of the program installs a different
+ invalid parameter handler, this solution is multithread-safe. */
+extern void gl_msvc_inval_ensure_handler (void);
+
+/* Return a pointer to the per-thread data for the current thread. */
+extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void);
+
+# ifdef __cplusplus
+}
+# endif
+
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ struct gl_msvc_inval_per_thread *msvc_inval_current; \
+ gl_msvc_inval_ensure_handler (); \
+ msvc_inval_current = gl_msvc_inval_current (); \
+ /* First, initialize gl_msvc_inval_restart. */ \
+ if (setjmp (msvc_inval_current->restart) == 0) \
+ { \
+ /* Then, mark it as valid. */ \
+ msvc_inval_current->restart_valid = 1;
+# define CATCH_MSVC_INVAL \
+ /* Execution completed. \
+ Mark gl_msvc_inval_restart as invalid. */ \
+ msvc_inval_current->restart_valid = 0; \
+ } \
+ else \
+ { \
+ /* Execution triggered an invalid parameter notification. \
+ Mark gl_msvc_inval_restart as invalid. */ \
+ msvc_inval_current->restart_valid = 0;
+# define DONE_MSVC_INVAL \
+ } \
+ } \
+ while (0)
+
+# endif
+
+# endif
+
+#else
+/* A platform that does not need to the invalid parameter handler,
+ or when SANE_LIBRARY_HANDLING is desired. */
+
+/* The braces here avoid GCC warnings like
+ "warning: suggest explicit braces to avoid ambiguous 'else'". */
+# define TRY_MSVC_INVAL \
+ do \
+ { \
+ if (1)
+# define CATCH_MSVC_INVAL \
+ else
+# define DONE_MSVC_INVAL \
+ } \
+ while (0)
+
+#endif
+
+#endif /* _MSVC_INVAL_H */
diff --git a/gl/msvc-nothrow.c b/gl/msvc-nothrow.c
new file mode 100644
index 0000000..f729fe6
--- /dev/null
+++ b/gl/msvc-nothrow.c
@@ -0,0 +1,51 @@
+/* Wrappers that don't throw invalid parameter notifications
+ with MSVC runtime libraries.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "msvc-nothrow.h"
+
+/* Get declarations of the native Windows API functions. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#undef _get_osfhandle
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+intptr_t
+_gl_nothrow_get_osfhandle (int fd)
+{
+ intptr_t result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _get_osfhandle (fd);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = (intptr_t) INVALID_HANDLE_VALUE;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+#endif
diff --git a/gl/msvc-nothrow.h b/gl/msvc-nothrow.h
new file mode 100644
index 0000000..82d3f6a
--- /dev/null
+++ b/gl/msvc-nothrow.h
@@ -0,0 +1,43 @@
+/* Wrappers that don't throw invalid parameter notifications
+ with MSVC runtime libraries.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _MSVC_NOTHROW_H
+#define _MSVC_NOTHROW_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+ functions like fprintf(), dup2(), or close() crash when the caller passes
+ an invalid argument. But POSIX wants error codes (such as EINVAL or EBADF)
+ instead.
+ This file defines wrappers that turn such an invalid parameter notification
+ into an error code. */
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Get original declaration of _get_osfhandle. */
+# include <io.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
+/* Override _get_osfhandle. */
+extern intptr_t _gl_nothrow_get_osfhandle (int fd);
+# define _get_osfhandle _gl_nothrow_get_osfhandle
+
+# endif
+
+#endif
+
+#endif /* _MSVC_NOTHROW_H */
diff --git a/gl/netdb.in.h b/gl/netdb.in.h
new file mode 100644
index 0000000..9549cd7
--- /dev/null
+++ b/gl/netdb.in.h
@@ -0,0 +1,295 @@
+/* Provide a netdb.h header file for systems lacking it (read: MinGW).
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* This file is supposed to be used on platforms that lack <netdb.h>.
+ It is intended to provide definitions and prototypes needed by an
+ application. */
+
+#ifndef _@GUARD_PREFIX@_NETDB_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_NETDB_H@
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_NETDB_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_NETDB_H
+#define _@GUARD_PREFIX@_NETDB_H
+
+/* Get <netdb.h> definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and
+ 'struct hostent' on MinGW. */
+#include <sys/socket.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Declarations for a platform that lacks <netdb.h>, or where it is
+ incomplete. */
+
+#if @GNULIB_GETADDRINFO@
+
+# if !@HAVE_STRUCT_ADDRINFO@
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if !GNULIB_defined_struct_addrinfo
+/* Structure to contain information about address of a service provider. */
+struct addrinfo
+{
+ int ai_flags; /* Input flags. */
+ int ai_family; /* Protocol family for socket. */
+ int ai_socktype; /* Socket type. */
+ int ai_protocol; /* Protocol for socket. */
+ socklen_t ai_addrlen; /* Length of socket address. */
+ struct sockaddr *ai_addr; /* Socket address for socket. */
+ char *ai_canonname; /* Canonical name for service location. */
+ struct addrinfo *ai_next; /* Pointer to next in list. */
+};
+# define GNULIB_defined_struct_addrinfo 1
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+# endif
+
+/* Possible values for 'ai_flags' field in 'addrinfo' structure. */
+# ifndef AI_PASSIVE
+# define AI_PASSIVE 0x0001 /* Socket address is intended for 'bind'. */
+# endif
+# ifndef AI_CANONNAME
+# define AI_CANONNAME 0x0002 /* Request for canonical name. */
+# endif
+# ifndef AI_NUMERICSERV
+# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
+# endif
+
+# if 0
+# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
+# endif
+
+/* These symbolic constants are required to be present by POSIX, but
+ our getaddrinfo replacement doesn't use them (yet). Setting them
+ to 0 on systems that doesn't have them avoids causing problems for
+ system getaddrinfo implementations that would be confused by
+ unknown values. */
+# ifndef AI_V4MAPPED
+# define AI_V4MAPPED 0 /* 0x0008: IPv4 mapped addresses are acceptable. */
+# endif
+# ifndef AI_ALL
+# define AI_ALL 0 /* 0x0010: Return IPv4 mapped and IPv6 addresses. */
+# endif
+# ifndef AI_ADDRCONFIG
+# define AI_ADDRCONFIG 0 /* 0x0020: Use configuration of this host to choose
+ returned address type. */
+# endif
+
+/* Error values for 'getaddrinfo' function. */
+# ifndef EAI_BADFLAGS
+# define EAI_BADFLAGS -1 /* Invalid value for 'ai_flags' field. */
+# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
+# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
+# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
+# define EAI_NODATA -5 /* No address associated with NAME. */
+# define EAI_FAMILY -6 /* 'ai_family' not supported. */
+# define EAI_SOCKTYPE -7 /* 'ai_socktype' not supported. */
+# define EAI_SERVICE -8 /* SERVICE not supported for 'ai_socktype'. */
+# define EAI_MEMORY -10 /* Memory allocation failure. */
+# endif
+
+/* Since EAI_NODATA is deprecated by RFC3493, some systems (at least
+ FreeBSD, which does define EAI_BADFLAGS) have removed the definition
+ in favor of EAI_NONAME. */
+# if !defined EAI_NODATA && defined EAI_NONAME
+# define EAI_NODATA EAI_NONAME
+# endif
+
+# ifndef EAI_OVERFLOW
+/* Not defined on mingw32 and Haiku. */
+# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
+# endif
+# ifndef EAI_ADDRFAMILY
+/* Not defined on mingw32. */
+# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
+# endif
+# ifndef EAI_SYSTEM
+/* Not defined on mingw32. */
+# define EAI_SYSTEM -11 /* System error returned in 'errno'. */
+# endif
+
+# if 0
+/* The commented out definitions below are not yet implemented in the
+ GNULIB getaddrinfo() replacement, so are not yet needed.
+
+ If they are restored, be sure to protect the definitions with #ifndef. */
+# ifndef EAI_INPROGRESS
+# define EAI_INPROGRESS -100 /* Processing request in progress. */
+# define EAI_CANCELED -101 /* Request canceled. */
+# define EAI_NOTCANCELED -102 /* Request not canceled. */
+# define EAI_ALLDONE -103 /* All requests done. */
+# define EAI_INTR -104 /* Interrupted by a signal. */
+# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
+# endif
+# endif
+
+/* Translate name of a service location and/or a service name to set of
+ socket addresses.
+ For more details, see the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html>. */
+# if @REPLACE_GETADDRINFO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getaddrinfo
+# define getaddrinfo rpl_getaddrinfo
+# endif
+_GL_FUNCDECL_RPL (getaddrinfo, int,
+ (const char *restrict nodename,
+ const char *restrict servname,
+ const struct addrinfo *restrict hints,
+ struct addrinfo **restrict res)
+ _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (getaddrinfo, int,
+ (const char *restrict nodename,
+ const char *restrict servname,
+ const struct addrinfo *restrict hints,
+ struct addrinfo **restrict res));
+# else
+# if !@HAVE_DECL_GETADDRINFO@
+_GL_FUNCDECL_SYS (getaddrinfo, int,
+ (const char *restrict nodename,
+ const char *restrict servname,
+ const struct addrinfo *restrict hints,
+ struct addrinfo **restrict res)
+ _GL_ARG_NONNULL ((4)));
+# endif
+_GL_CXXALIAS_SYS (getaddrinfo, int,
+ (const char *restrict nodename,
+ const char *restrict servname,
+ const struct addrinfo *restrict hints,
+ struct addrinfo **restrict res));
+# endif
+_GL_CXXALIASWARN (getaddrinfo);
+
+/* Free 'addrinfo' structure AI including associated storage.
+ For more details, see the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html>. */
+# if @REPLACE_GETADDRINFO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef freeaddrinfo
+# define freeaddrinfo rpl_freeaddrinfo
+# endif
+_GL_FUNCDECL_RPL (freeaddrinfo, void, (struct addrinfo *ai)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (freeaddrinfo, void, (struct addrinfo *ai));
+# else
+# if !@HAVE_DECL_FREEADDRINFO@
+_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai));
+# endif
+_GL_CXXALIASWARN (freeaddrinfo);
+
+# if @REPLACE_GAI_STRERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gai_strerror
+# define gai_strerror rpl_gai_strerror
+# endif
+_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode));
+_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode));
+# else
+# if !@HAVE_DECL_GAI_STRERROR@
+/* Convert error return from getaddrinfo() to a string.
+ For more details, see the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gai_strerror.html>. */
+_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode));
+# endif
+_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (gai_strerror);
+# endif
+
+# if !@HAVE_DECL_GETNAMEINFO@
+/* Convert socket address to printable node and service names.
+ For more details, see the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getnameinfo.html>. */
+_GL_FUNCDECL_SYS (getnameinfo, int,
+ (const struct sockaddr *restrict sa, socklen_t salen,
+ char *restrict node, socklen_t nodelen,
+ char *restrict service, socklen_t servicelen,
+ int flags)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on glibc systems, the seventh parameter is
+ unsigned int flags. */
+_GL_CXXALIAS_SYS_CAST (getnameinfo, int,
+ (const struct sockaddr *restrict sa, socklen_t salen,
+ char *restrict node, socklen_t nodelen,
+ char *restrict service, socklen_t servicelen,
+ int flags));
+_GL_CXXALIASWARN (getnameinfo);
+
+/* Possible flags for getnameinfo. */
+# ifndef NI_NUMERICHOST
+# define NI_NUMERICHOST 1
+# endif
+# ifndef NI_NUMERICSERV
+# define NI_NUMERICSERV 2
+# endif
+
+#elif defined GNULIB_POSIXCHECK
+
+# undef getaddrinfo
+# if HAVE_RAW_DECL_GETADDRINFO
+_GL_WARN_ON_USE (getaddrinfo, "getaddrinfo is unportable - "
+ "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef freeaddrinfo
+# if HAVE_RAW_DECL_FREEADDRINFO
+_GL_WARN_ON_USE (freeaddrinfo, "freeaddrinfo is unportable - "
+ "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef gai_strerror
+# if HAVE_RAW_DECL_GAI_STRERROR
+_GL_WARN_ON_USE (gai_strerror, "gai_strerror is unportable - "
+ "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef getnameinfo
+# if HAVE_RAW_DECL_GETNAMEINFO
+_GL_WARN_ON_USE (getnameinfo, "getnameinfo is unportable - "
+ "use gnulib module getaddrinfo for portability");
+# endif
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_NETDB_H */
+#endif /* _@GUARD_PREFIX@_NETDB_H */
diff --git a/gl/netinet_in.in.h b/gl/netinet_in.in.h
new file mode 100644
index 0000000..f88923a
--- /dev/null
+++ b/gl/netinet_in.in.h
@@ -0,0 +1,47 @@
+/* Substitute for <netinet/in.h>.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_NETINET_IN_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_NETINET_IN_H@
+
+/* On many platforms, <netinet/in.h> assumes prior inclusion of
+ <sys/types.h>. */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_NETINET_IN_H
+#define _@GUARD_PREFIX@_NETINET_IN_H
+
+#if !@HAVE_NETINET_IN_H@
+
+/* A platform that lacks <netinet/in.h>. */
+
+# include <sys/socket.h>
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_NETINET_IN_H */
+#endif /* _@GUARD_PREFIX@_NETINET_IN_H */
diff --git a/gl/nl_langinfo-lock.c b/gl/nl_langinfo-lock.c
new file mode 100644
index 0000000..e5cdcd3
--- /dev/null
+++ b/gl/nl_langinfo-lock.c
@@ -0,0 +1,150 @@
+/* Return the internal lock used by nl_langinfo.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020. */
+
+#include <config.h>
+
+/* When it is known that the gl_get_nl_langinfo_lock function is defined
+ by a dependency library, it should not be defined here. */
+#if OMIT_NL_LANGINFO_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by nl_langinfo.
+ It is a separate compilation unit, so that only one copy of it is
+ present when linking statically. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_nl_langinfo_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+ when compiled into a shared library. */
+# ifndef DLL_EXPORTED
+# if HAVE_VISIBILITY
+ /* Override the effect of the compiler option '-fvisibility=hidden'. */
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# elif defined _WIN32 || defined __CYGWIN__
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+ because the latter is not guaranteed to be a stable ABI in the future. */
+
+/* Make sure the function gets exported from DLLs. */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by nl_langinfo. */
+CRITICAL_SECTION *
+gl_get_nl_langinfo_lock (void)
+{
+ if (!guard.done)
+ {
+ if (InterlockedIncrement (&guard.started) == 0)
+ {
+ /* This thread is the first one to need the lock. Initialize it. */
+ InitializeCriticalSection (&lock);
+ guard.done = 1;
+ }
+ else
+ {
+ /* Don't let guard.started grow and wrap around. */
+ InterlockedDecrement (&guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!guard.done)
+ Sleep (0);
+ }
+ }
+ return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED pthread_mutex_t *gl_get_nl_langinfo_lock (void);
+
+/* Returns the internal lock used by nl_langinfo. */
+pthread_mutex_t *
+gl_get_nl_langinfo_lock (void)
+{
+ return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+# include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+ if (mtx_init (&mutex, mtx_plain) != thrd_success)
+ abort ();
+ init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED mtx_t *gl_get_nl_langinfo_lock (void);
+
+/* Returns the internal lock used by nl_langinfo. */
+mtx_t *
+gl_get_nl_langinfo_lock (void)
+{
+ if (init_needed)
+ call_once (&init_once, atomic_init);
+ return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in nl_langinfo.c does not cause
+ a link failure when no DLLs are involved. */
+# if defined _WIN64 || defined _LP64
+# define IMP(x) __imp_##x
+# else
+# define IMP(x) _imp__##x
+# endif
+void * IMP(gl_get_nl_langinfo_lock) = &gl_get_nl_langinfo_lock;
+# endif
+
+#endif
diff --git a/gl/nl_langinfo.c b/gl/nl_langinfo.c
new file mode 100644
index 0000000..131166f
--- /dev/null
+++ b/gl/nl_langinfo.c
@@ -0,0 +1,572 @@
+/* nl_langinfo() replacement: query locale dependent information.
+
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <langinfo.h>
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+# include <stdio.h>
+#endif
+
+#if REPLACE_NL_LANGINFO && !NL_LANGINFO_MTSAFE
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+# if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+
+# endif
+#endif
+
+/* nl_langinfo() must be multithread-safe. To achieve this without using
+ thread-local storage:
+ 1. We use a specific static buffer for each possible argument.
+ So that different threads can call nl_langinfo with different arguments,
+ without interfering.
+ 2. We use a simple strcpy or memcpy to fill this static buffer. Filling it
+ through, for example, strcpy + strcat would not be guaranteed to leave
+ the buffer's contents intact if another thread is currently accessing
+ it. If necessary, the contents is first assembled in a stack-allocated
+ buffer. */
+
+#if !REPLACE_NL_LANGINFO || GNULIB_defined_CODESET
+/* Return the codeset of the current locale, if this is easily deducible.
+ Otherwise, return "". */
+static char *
+ctype_codeset (void)
+{
+ static char result[2 + 10 + 1];
+ char buf[2 + 10 + 1];
+ char locale[SETLOCALE_NULL_MAX];
+ char *codeset;
+ size_t codesetlen;
+
+ if (setlocale_null_r (LC_CTYPE, locale, sizeof (locale)))
+ locale[0] = '\0';
+
+ codeset = buf;
+ codeset[0] = '\0';
+
+ if (locale[0])
+ {
+ /* If the locale name contains an encoding after the dot, return it. */
+ char *dot = strchr (locale, '.');
+
+ if (dot)
+ {
+ /* Look for the possible @... trailer and remove it, if any. */
+ char *codeset_start = dot + 1;
+ char const *modifier = strchr (codeset_start, '@');
+
+ if (! modifier)
+ codeset = codeset_start;
+ else
+ {
+ codesetlen = modifier - codeset_start;
+ if (codesetlen < sizeof buf)
+ {
+ codeset = memcpy (buf, codeset_start, codesetlen);
+ codeset[codesetlen] = '\0';
+ }
+ }
+ }
+ }
+
+# if defined _WIN32 && ! defined __CYGWIN__
+ /* If setlocale is successful, it returns the number of the
+ codepage, as a string. Otherwise, fall back on Windows API
+ GetACP, which returns the locale's codepage as a number (although
+ this doesn't change according to what the 'setlocale' call specified).
+ Either way, prepend "CP" to make it a valid codeset name. */
+ codesetlen = strlen (codeset);
+ if (0 < codesetlen && codesetlen < sizeof buf - 2)
+ memmove (buf + 2, codeset, codesetlen + 1);
+ else
+ sprintf (buf + 2, "%u", GetACP ());
+ /* For a locale name such as "French_France.65001", in Windows 10,
+ setlocale now returns "French_France.utf8" instead. */
+ if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+ return (char *) "UTF-8";
+ else
+ {
+ memcpy (buf, "CP", 2);
+ strcpy (result, buf);
+ return result;
+ }
+# else
+ strcpy (result, codeset);
+ return result;
+#endif
+}
+#endif
+
+
+#if REPLACE_NL_LANGINFO
+
+/* Override nl_langinfo with support for added nl_item values. */
+
+# undef nl_langinfo
+
+/* Without locking, on Solaris 11.3, test-nl_langinfo-mt fails, with message
+ "thread5 disturbed by threadN!", even when threadN invokes only
+ nl_langinfo (CODESET);
+ nl_langinfo (CRNCYSTR);
+ Similarly on Solaris 10. */
+
+# if !NL_LANGINFO_MTSAFE /* Solaris */
+
+# define ITEMS (MAXSTRMSG + 1)
+# define MAX_RESULT_LEN 80
+
+static char *
+nl_langinfo_unlocked (nl_item item)
+{
+ static char result[ITEMS][MAX_RESULT_LEN];
+
+ /* The result of nl_langinfo is in storage that can be overwritten by
+ other calls to nl_langinfo. */
+ char *tmp = nl_langinfo (item);
+ if (item >= 0 && item < ITEMS && tmp != NULL)
+ {
+ size_t tmp_len = strlen (tmp);
+ if (tmp_len < MAX_RESULT_LEN)
+ strcpy (result[item], tmp);
+ else
+ {
+ /* Produce a truncated result. Oh well... */
+ result[item][MAX_RESULT_LEN - 1] = '\0';
+ memcpy (result[item], tmp, MAX_RESULT_LEN - 1);
+ }
+ return result[item];
+ }
+ else
+ return tmp;
+}
+
+/* Use a lock, so that no two threads can invoke nl_langinfo_unlocked
+ at the same time. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_nl_langinfo_lock
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+ CRITICAL_SECTION *lock = gl_get_nl_langinfo_lock ();
+ char *ret;
+
+ EnterCriticalSection (lock);
+ ret = nl_langinfo_unlocked (item);
+ LeaveCriticalSection (lock);
+
+ return ret;
+}
+
+# elif HAVE_PTHREAD_API
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+ __declspec(dllimport)
+# endif
+ pthread_mutex_t *gl_get_nl_langinfo_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* musl libc, FreeBSD, NetBSD, OpenBSD, Haiku */
+
+ /* Avoid the need to link with '-lpthread'. */
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+
+ /* Determine whether libpthread is in use. */
+# pragma weak pthread_mutexattr_gettype
+ /* See the comments in lock.h. */
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+# define pthread_in_use() 1
+# endif
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+ if (pthread_in_use())
+ {
+ pthread_mutex_t *lock = gl_get_nl_langinfo_lock ();
+ char *ret;
+
+ if (pthread_mutex_lock (lock))
+ abort ();
+ ret = nl_langinfo_unlocked (item);
+ if (pthread_mutex_unlock (lock))
+ abort ();
+
+ return ret;
+ }
+ else
+ return nl_langinfo_unlocked (item);
+}
+
+# elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_nl_langinfo_lock (void);
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+ mtx_t *lock = gl_get_nl_langinfo_lock ();
+ char *ret;
+
+ if (mtx_lock (lock) != thrd_success)
+ abort ();
+ ret = nl_langinfo_unlocked (item);
+ if (mtx_unlock (lock) != thrd_success)
+ abort ();
+
+ return ret;
+}
+
+# endif
+
+# else
+
+/* On other platforms, no lock is needed. */
+# define nl_langinfo_with_lock nl_langinfo
+
+# endif
+
+char *
+rpl_nl_langinfo (nl_item item)
+{
+ switch (item)
+ {
+# if GNULIB_defined_CODESET
+ case CODESET:
+ return ctype_codeset ();
+# endif
+# if GNULIB_defined_T_FMT_AMPM
+ case T_FMT_AMPM:
+ return (char *) "%I:%M:%S %p";
+# endif
+# if GNULIB_defined_ALTMON
+ case ALTMON_1:
+ case ALTMON_2:
+ case ALTMON_3:
+ case ALTMON_4:
+ case ALTMON_5:
+ case ALTMON_6:
+ case ALTMON_7:
+ case ALTMON_8:
+ case ALTMON_9:
+ case ALTMON_10:
+ case ALTMON_11:
+ case ALTMON_12:
+ /* We don't ship the appropriate localizations with gnulib. Therefore,
+ treat ALTMON_i like MON_i. */
+ item = item - ALTMON_1 + MON_1;
+ break;
+# endif
+# if GNULIB_defined_ERA
+ case ERA:
+ /* The format is not standardized. In glibc it is a sequence of strings
+ of the form "direction:offset:start_date:end_date:era_name:era_format"
+ with an empty string at the end. */
+ return (char *) "";
+ case ERA_D_FMT:
+ /* The %Ex conversion in strftime behaves like %x if the locale does not
+ have an alternative time format. */
+ item = D_FMT;
+ break;
+ case ERA_D_T_FMT:
+ /* The %Ec conversion in strftime behaves like %c if the locale does not
+ have an alternative time format. */
+ item = D_T_FMT;
+ break;
+ case ERA_T_FMT:
+ /* The %EX conversion in strftime behaves like %X if the locale does not
+ have an alternative time format. */
+ item = T_FMT;
+ break;
+ case ALT_DIGITS:
+ /* The format is not standardized. In glibc it is a sequence of 10
+ strings, appended in memory. */
+ return (char *) "\0\0\0\0\0\0\0\0\0\0";
+# endif
+# if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS
+ case YESEXPR:
+ return (char *) "^[yY]";
+ case NOEXPR:
+ return (char *) "^[nN]";
+# endif
+ default:
+ break;
+ }
+ return nl_langinfo_with_lock (item);
+}
+
+#else
+
+/* Provide nl_langinfo from scratch, either for native MS-Windows, or
+ for old Unix platforms without locales, such as Linux libc5 or
+ BeOS. */
+
+# include <time.h>
+
+char *
+nl_langinfo (nl_item item)
+{
+ char buf[100];
+ struct tm tmm = { 0 };
+
+ switch (item)
+ {
+ /* nl_langinfo items of the LC_CTYPE category */
+ case CODESET:
+ {
+ char *codeset = ctype_codeset ();
+ if (*codeset)
+ return codeset;
+ }
+# ifdef __BEOS__
+ return (char *) "UTF-8";
+# else
+ return (char *) "ISO-8859-1";
+# endif
+ /* nl_langinfo items of the LC_NUMERIC category */
+ case RADIXCHAR:
+ return localeconv () ->decimal_point;
+ case THOUSEP:
+ return localeconv () ->thousands_sep;
+# ifdef GROUPING
+ case GROUPING:
+ return localeconv () ->grouping;
+# endif
+ /* nl_langinfo items of the LC_TIME category.
+ TODO: Really use the locale. */
+ case D_T_FMT:
+ case ERA_D_T_FMT:
+ return (char *) "%a %b %e %H:%M:%S %Y";
+ case D_FMT:
+ case ERA_D_FMT:
+ return (char *) "%m/%d/%y";
+ case T_FMT:
+ case ERA_T_FMT:
+ return (char *) "%H:%M:%S";
+ case T_FMT_AMPM:
+ return (char *) "%I:%M:%S %p";
+ case AM_STR:
+ {
+ static char result[80];
+ if (!strftime (buf, sizeof result, "%p", &tmm))
+ return (char *) "AM";
+ strcpy (result, buf);
+ return result;
+ }
+ case PM_STR:
+ {
+ static char result[80];
+ tmm.tm_hour = 12;
+ if (!strftime (buf, sizeof result, "%p", &tmm))
+ return (char *) "PM";
+ strcpy (result, buf);
+ return result;
+ }
+ case DAY_1:
+ case DAY_2:
+ case DAY_3:
+ case DAY_4:
+ case DAY_5:
+ case DAY_6:
+ case DAY_7:
+ {
+ static char result[7][50];
+ static char const days[][sizeof "Wednesday"] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
+ "Friday", "Saturday"
+ };
+ tmm.tm_wday = item - DAY_1;
+ if (!strftime (buf, sizeof result[0], "%A", &tmm))
+ return (char *) days[item - DAY_1];
+ strcpy (result[item - DAY_1], buf);
+ return result[item - DAY_1];
+ }
+ case ABDAY_1:
+ case ABDAY_2:
+ case ABDAY_3:
+ case ABDAY_4:
+ case ABDAY_5:
+ case ABDAY_6:
+ case ABDAY_7:
+ {
+ static char result[7][30];
+ static char const abdays[][sizeof "Sun"] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+ tmm.tm_wday = item - ABDAY_1;
+ if (!strftime (buf, sizeof result[0], "%a", &tmm))
+ return (char *) abdays[item - ABDAY_1];
+ strcpy (result[item - ABDAY_1], buf);
+ return result[item - ABDAY_1];
+ }
+ {
+ static char const months[][sizeof "September"] = {
+ "January", "February", "March", "April", "May", "June", "July",
+ "September", "October", "November", "December"
+ };
+ case MON_1:
+ case MON_2:
+ case MON_3:
+ case MON_4:
+ case MON_5:
+ case MON_6:
+ case MON_7:
+ case MON_8:
+ case MON_9:
+ case MON_10:
+ case MON_11:
+ case MON_12:
+ {
+ static char result[12][50];
+ tmm.tm_mon = item - MON_1;
+ if (!strftime (buf, sizeof result[0], "%B", &tmm))
+ return (char *) months[item - MON_1];
+ strcpy (result[item - MON_1], buf);
+ return result[item - MON_1];
+ }
+ case ALTMON_1:
+ case ALTMON_2:
+ case ALTMON_3:
+ case ALTMON_4:
+ case ALTMON_5:
+ case ALTMON_6:
+ case ALTMON_7:
+ case ALTMON_8:
+ case ALTMON_9:
+ case ALTMON_10:
+ case ALTMON_11:
+ case ALTMON_12:
+ {
+ static char result[12][50];
+ tmm.tm_mon = item - ALTMON_1;
+ /* The platforms without nl_langinfo() don't support strftime with
+ %OB. We don't even need to try. */
+ #if 0
+ if (!strftime (buf, sizeof result[0], "%OB", &tmm))
+ #endif
+ if (!strftime (buf, sizeof result[0], "%B", &tmm))
+ return (char *) months[item - ALTMON_1];
+ strcpy (result[item - ALTMON_1], buf);
+ return result[item - ALTMON_1];
+ }
+ }
+ case ABMON_1:
+ case ABMON_2:
+ case ABMON_3:
+ case ABMON_4:
+ case ABMON_5:
+ case ABMON_6:
+ case ABMON_7:
+ case ABMON_8:
+ case ABMON_9:
+ case ABMON_10:
+ case ABMON_11:
+ case ABMON_12:
+ {
+ static char result[12][30];
+ static char const abmonths[][sizeof "Jan"] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
+ "Sep", "Oct", "Nov", "Dec"
+ };
+ tmm.tm_mon = item - ABMON_1;
+ if (!strftime (buf, sizeof result[0], "%b", &tmm))
+ return (char *) abmonths[item - ABMON_1];
+ strcpy (result[item - ABMON_1], buf);
+ return result[item - ABMON_1];
+ }
+ case ERA:
+ return (char *) "";
+ case ALT_DIGITS:
+ return (char *) "\0\0\0\0\0\0\0\0\0\0";
+ /* nl_langinfo items of the LC_MONETARY category. */
+ case CRNCYSTR:
+ return localeconv () ->currency_symbol;
+# ifdef INT_CURR_SYMBOL
+ case INT_CURR_SYMBOL:
+ return localeconv () ->int_curr_symbol;
+ case MON_DECIMAL_POINT:
+ return localeconv () ->mon_decimal_point;
+ case MON_THOUSANDS_SEP:
+ return localeconv () ->mon_thousands_sep;
+ case MON_GROUPING:
+ return localeconv () ->mon_grouping;
+ case POSITIVE_SIGN:
+ return localeconv () ->positive_sign;
+ case NEGATIVE_SIGN:
+ return localeconv () ->negative_sign;
+ case FRAC_DIGITS:
+ return & localeconv () ->frac_digits;
+ case INT_FRAC_DIGITS:
+ return & localeconv () ->int_frac_digits;
+ case P_CS_PRECEDES:
+ return & localeconv () ->p_cs_precedes;
+ case N_CS_PRECEDES:
+ return & localeconv () ->n_cs_precedes;
+ case P_SEP_BY_SPACE:
+ return & localeconv () ->p_sep_by_space;
+ case N_SEP_BY_SPACE:
+ return & localeconv () ->n_sep_by_space;
+ case P_SIGN_POSN:
+ return & localeconv () ->p_sign_posn;
+ case N_SIGN_POSN:
+ return & localeconv () ->n_sign_posn;
+# endif
+ /* nl_langinfo items of the LC_MESSAGES category
+ TODO: Really use the locale. */
+ case YESEXPR:
+ return (char *) "^[yY]";
+ case NOEXPR:
+ return (char *) "^[nN]";
+ default:
+ return (char *) "";
+ }
+}
+
+#endif
diff --git a/gl/open.c b/gl/open.c
new file mode 100644
index 0000000..7ec8fdc
--- /dev/null
+++ b/gl/open.c
@@ -0,0 +1,209 @@
+/* Open a descriptor to a file.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+ the system's <fcntl.h> here, so that orig_open doesn't recurse to
+ rpl_open. */
+#define __need_system_fcntl_h
+#include <config.h>
+
+/* Get the original definition of open. It might be defined as a macro. */
+#include <fcntl.h>
+#include <sys/types.h>
+#undef __need_system_fcntl_h
+
+static int
+orig_open (const char *filename, int flags, mode_t mode)
+{
+#if defined _WIN32 && !defined __CYGWIN__
+ return _open (filename, flags, mode);
+#else
+ return open (filename, flags, mode);
+#endif
+}
+
+/* Specification. */
+/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
+ this include because of the preliminary #include <fcntl.h> above. */
+#include "fcntl.h"
+
+#include "cloexec.h"
+
+#include <errno.h>
+#include <stdarg.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#ifndef REPLACE_OPEN_DIRECTORY
+# define REPLACE_OPEN_DIRECTORY 0
+#endif
+
+int
+open (const char *filename, int flags, ...)
+{
+ /* 0 = unknown, 1 = yes, -1 = no. */
+#if GNULIB_defined_O_CLOEXEC
+ int have_cloexec = -1;
+#else
+ static int have_cloexec;
+#endif
+
+ mode_t mode;
+ int fd;
+
+ mode = 0;
+ if (flags & O_CREAT)
+ {
+ va_list arg;
+ va_start (arg, flags);
+
+ /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+ creates crashing code when 'mode_t' is smaller than 'int'. */
+ mode = va_arg (arg, PROMOTED_MODE_T);
+
+ va_end (arg);
+ }
+
+#if GNULIB_defined_O_NONBLOCK
+ /* The only known platform that lacks O_NONBLOCK is mingw, but it
+ also lacks named pipes and Unix sockets, which are the only two
+ file types that require non-blocking handling in open().
+ Therefore, it is safe to ignore O_NONBLOCK here. It is handy
+ that mingw also lacks openat(), so that is also covered here. */
+ flags &= ~O_NONBLOCK;
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
+ if (strcmp (filename, "/dev/null") == 0)
+ filename = "NUL";
+#endif
+
+#if OPEN_TRAILING_SLASH_BUG
+ /* Fail if one of O_CREAT, O_WRONLY, O_RDWR is specified and the filename
+ ends in a slash, as POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+ "A pathname that contains at least one non-<slash> character and that
+ ends with one or more trailing <slash> characters shall not be resolved
+ successfully unless the last pathname component before the trailing
+ <slash> characters names an existing directory"
+ If the named file already exists as a directory, then
+ - if O_CREAT is specified, open() must fail because of the semantics
+ of O_CREAT,
+ - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html>
+ says that it fails with errno = EISDIR in this case.
+ If the named file does not exist or does not name a directory, then
+ - if O_CREAT is specified, open() must fail since open() cannot create
+ directories,
+ - if O_WRONLY or O_RDWR is specified, open() must fail because the
+ file does not contain a '.' directory. */
+ if ((flags & O_CREAT)
+ || (flags & O_ACCMODE) == O_RDWR
+ || (flags & O_ACCMODE) == O_WRONLY)
+ {
+ size_t len = strlen (filename);
+ if (len > 0 && filename[len - 1] == '/')
+ {
+ errno = EISDIR;
+ return -1;
+ }
+ }
+#endif
+
+ fd = orig_open (filename,
+ flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
+
+ if (flags & O_CLOEXEC)
+ {
+ if (! have_cloexec)
+ {
+ if (0 <= fd)
+ have_cloexec = 1;
+ else if (errno == EINVAL)
+ {
+ fd = orig_open (filename, flags & ~O_CLOEXEC, mode);
+ have_cloexec = -1;
+ }
+ }
+ if (have_cloexec < 0 && 0 <= fd)
+ set_cloexec_flag (fd, true);
+ }
+
+
+#if REPLACE_FCHDIR
+ /* Implementing fchdir and fdopendir requires the ability to open a
+ directory file descriptor. If open doesn't support that (as on
+ mingw), we use a dummy file that behaves the same as directories
+ on Linux (ie. always reports EOF on attempts to read()), and
+ override fstat() in fchdir.c to hide the fact that we have a
+ dummy. */
+ if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES
+ && ((flags & O_ACCMODE) == O_RDONLY
+ || (O_SEARCH != O_RDONLY && (flags & O_ACCMODE) == O_SEARCH)))
+ {
+ struct stat statbuf;
+ if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
+ {
+ /* Maximum recursion depth of 1. */
+ fd = open ("/dev/null", flags, mode);
+ if (0 <= fd)
+ fd = _gl_register_fd (fd, filename);
+ }
+ else
+ errno = EACCES;
+ }
+#endif
+
+#if OPEN_TRAILING_SLASH_BUG
+ /* If the filename ends in a slash and fd does not refer to a directory,
+ then fail.
+ Rationale: POSIX says such a filename must name a directory
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+ "A pathname that contains at least one non-<slash> character and that
+ ends with one or more trailing <slash> characters shall not be resolved
+ successfully unless the last pathname component before the trailing
+ <slash> characters names an existing directory"
+ If the named file without the slash is not a directory, open() must fail
+ with ENOTDIR. */
+ if (fd >= 0)
+ {
+ /* We know len is positive, since open did not fail with ENOENT. */
+ size_t len = strlen (filename);
+ if (filename[len - 1] == '/')
+ {
+ struct stat statbuf;
+
+ if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
+ {
+ close (fd);
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+ }
+#endif
+
+#if REPLACE_FCHDIR
+ if (!REPLACE_OPEN_DIRECTORY && 0 <= fd)
+ fd = _gl_register_fd (fd, filename);
+#endif
+
+ return fd;
+}
diff --git a/gl/pathmax.h b/gl/pathmax.h
new file mode 100644
index 0000000..0dd8f3b
--- /dev/null
+++ b/gl/pathmax.h
@@ -0,0 +1,83 @@
+/* Define PATH_MAX somehow. Requires sys/types.h.
+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _PATHMAX_H
+# define _PATHMAX_H
+
+/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
+ including the terminating NUL byte.
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
+ PATH_MAX is not defined on systems which have no limit on filename length,
+ such as GNU/Hurd.
+
+ This file does *not* define PATH_MAX always. Programs that use this file
+ can handle the GNU/Hurd case in several ways:
+ - Either with a package-wide handling, or with a per-file handling,
+ - Either through a
+ #ifdef PATH_MAX
+ or through a fallback like
+ #ifndef PATH_MAX
+ # define PATH_MAX 8192
+ #endif
+ or through a fallback like
+ #ifndef PATH_MAX
+ # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
+ #endif
+ */
+
+# include <unistd.h>
+
+# include <limits.h>
+
+# ifndef _POSIX_PATH_MAX
+# define _POSIX_PATH_MAX 256
+# endif
+
+/* Don't include sys/param.h if it already has been. */
+# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+# endif
+
+# if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# endif
+
+# ifdef __hpux
+/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
+ *not* including the terminating NUL byte, and is set to 1023.
+ Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
+ not defined at all any more. */
+# undef PATH_MAX
+# define PATH_MAX 1024
+# endif
+
+# if defined _WIN32 && ! defined __CYGWIN__
+/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
+ section "Maximum Path Length Limitation",
+ <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation>
+ explains that the maximum size of a filename, including the terminating
+ NUL byte, is 260 = 3 + 256 + 1.
+ This is the same value as
+ - FILENAME_MAX in <stdio.h>,
+ - _MAX_PATH in <stdlib.h>,
+ - MAX_PATH in <windef.h>.
+ Undefine the original value, because mingw's <limits.h> gets it wrong. */
+# undef PATH_MAX
+# define PATH_MAX 260
+# endif
+
+#endif /* _PATHMAX_H */
diff --git a/gl/printf-args.c b/gl/printf-args.c
new file mode 100644
index 0000000..5e14f65
--- /dev/null
+++ b/gl/printf-args.c
@@ -0,0 +1,183 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* This file can be parametrized with the following macros:
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ PRINTF_FETCHARGS Name of the function to be defined.
+ STATIC Set to 'static' to declare the function static. */
+
+#ifndef PRINTF_FETCHARGS
+# include <config.h>
+#endif
+
+/* Specification. */
+#ifndef PRINTF_FETCHARGS
+# include "printf-args.h"
+#endif
+
+#ifdef STATIC
+STATIC
+#endif
+int
+PRINTF_FETCHARGS (va_list args, arguments *a)
+{
+ size_t i;
+ argument *ap;
+
+ for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
+ switch (ap->type)
+ {
+ case TYPE_SCHAR:
+ ap->a.a_schar = va_arg (args, /*signed char*/ int);
+ break;
+ case TYPE_UCHAR:
+ ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
+ break;
+ case TYPE_SHORT:
+ ap->a.a_short = va_arg (args, /*short*/ int);
+ break;
+ case TYPE_USHORT:
+ ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
+ break;
+ case TYPE_INT:
+ ap->a.a_int = va_arg (args, int);
+ break;
+ case TYPE_UINT:
+ ap->a.a_uint = va_arg (args, unsigned int);
+ break;
+ case TYPE_LONGINT:
+ ap->a.a_longint = va_arg (args, long int);
+ break;
+ case TYPE_ULONGINT:
+ ap->a.a_ulongint = va_arg (args, unsigned long int);
+ break;
+ case TYPE_LONGLONGINT:
+ ap->a.a_longlongint = va_arg (args, long long int);
+ break;
+ case TYPE_ULONGLONGINT:
+ ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+ break;
+ case TYPE_DOUBLE:
+ ap->a.a_double = va_arg (args, double);
+ break;
+ case TYPE_LONGDOUBLE:
+ ap->a.a_longdouble = va_arg (args, long double);
+ break;
+ case TYPE_CHAR:
+ ap->a.a_char = va_arg (args, int);
+ break;
+#if HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+ /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
+ default argument promotions", this is not the case in mingw32,
+ where wint_t is 'unsigned short'. */
+ ap->a.a_wide_char =
+ (sizeof (wint_t) < sizeof (int)
+ ? (wint_t) va_arg (args, int)
+ : va_arg (args, wint_t));
+ break;
+#endif
+ case TYPE_STRING:
+ ap->a.a_string = va_arg (args, const char *);
+ /* A null pointer is an invalid argument for "%s", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_string == NULL)
+ ap->a.a_string = "(NULL)";
+ break;
+#if HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ ap->a.a_wide_string = va_arg (args, const wchar_t *);
+ /* A null pointer is an invalid argument for "%ls", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_wide_string == NULL)
+ {
+ static const wchar_t wide_null_string[] =
+ {
+ (wchar_t)'(',
+ (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
+ (wchar_t)')',
+ (wchar_t)0
+ };
+ ap->a.a_wide_string = wide_null_string;
+ }
+ break;
+#endif
+ case TYPE_POINTER:
+ ap->a.a_pointer = va_arg (args, void *);
+ break;
+ case TYPE_COUNT_SCHAR_POINTER:
+ ap->a.a_count_schar_pointer = va_arg (args, signed char *);
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ ap->a.a_count_short_pointer = va_arg (args, short *);
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ ap->a.a_count_int_pointer = va_arg (args, int *);
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ ap->a.a_count_longint_pointer = va_arg (args, long int *);
+ break;
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+ break;
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ case TYPE_U8_STRING:
+ ap->a.a_u8_string = va_arg (args, const uint8_t *);
+ /* A null pointer is an invalid argument for "%U", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u8_string == NULL)
+ {
+ static const uint8_t u8_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u8_string = u8_null_string;
+ }
+ break;
+ case TYPE_U16_STRING:
+ ap->a.a_u16_string = va_arg (args, const uint16_t *);
+ /* A null pointer is an invalid argument for "%lU", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u16_string == NULL)
+ {
+ static const uint16_t u16_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u16_string = u16_null_string;
+ }
+ break;
+ case TYPE_U32_STRING:
+ ap->a.a_u32_string = va_arg (args, const uint32_t *);
+ /* A null pointer is an invalid argument for "%llU", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u32_string == NULL)
+ {
+ static const uint32_t u32_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u32_string = u32_null_string;
+ }
+ break;
+#endif
+ default:
+ /* Unknown type. */
+ return -1;
+ }
+ return 0;
+}
diff --git a/gl/printf-args.h b/gl/printf-args.h
new file mode 100644
index 0000000..f303cb1
--- /dev/null
+++ b/gl/printf-args.h
@@ -0,0 +1,150 @@
+/* Decomposed printf argument list.
+ Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _PRINTF_ARGS_H
+#define _PRINTF_ARGS_H
+
+/* This file can be parametrized with the following macros:
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ PRINTF_FETCHARGS Name of the function to be declared.
+ STATIC Set to 'static' to declare the function static. */
+
+/* Default parameters. */
+#ifndef PRINTF_FETCHARGS
+# define PRINTF_FETCHARGS printf_fetchargs
+#endif
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get wchar_t. */
+#if HAVE_WCHAR_T
+# include <stddef.h>
+#endif
+
+/* Get wint_t. */
+#if HAVE_WINT_T
+# include <wchar.h>
+#endif
+
+/* Get va_list. */
+#include <stdarg.h>
+
+
+/* Argument types */
+typedef enum
+{
+ TYPE_NONE,
+ TYPE_SCHAR,
+ TYPE_UCHAR,
+ TYPE_SHORT,
+ TYPE_USHORT,
+ TYPE_INT,
+ TYPE_UINT,
+ TYPE_LONGINT,
+ TYPE_ULONGINT,
+ TYPE_LONGLONGINT,
+ TYPE_ULONGLONGINT,
+ TYPE_DOUBLE,
+ TYPE_LONGDOUBLE,
+ TYPE_CHAR,
+#if HAVE_WINT_T
+ TYPE_WIDE_CHAR,
+#endif
+ TYPE_STRING,
+#if HAVE_WCHAR_T
+ TYPE_WIDE_STRING,
+#endif
+ TYPE_POINTER,
+ TYPE_COUNT_SCHAR_POINTER,
+ TYPE_COUNT_SHORT_POINTER,
+ TYPE_COUNT_INT_POINTER,
+ TYPE_COUNT_LONGINT_POINTER,
+ TYPE_COUNT_LONGLONGINT_POINTER
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+, TYPE_U8_STRING
+, TYPE_U16_STRING
+, TYPE_U32_STRING
+#endif
+} arg_type;
+
+/* Polymorphic argument */
+typedef struct
+{
+ arg_type type;
+ union
+ {
+ signed char a_schar;
+ unsigned char a_uchar;
+ short a_short;
+ unsigned short a_ushort;
+ int a_int;
+ unsigned int a_uint;
+ long int a_longint;
+ unsigned long int a_ulongint;
+ long long int a_longlongint;
+ unsigned long long int a_ulonglongint;
+ float a_float;
+ double a_double;
+ long double a_longdouble;
+ int a_char;
+#if HAVE_WINT_T
+ wint_t a_wide_char;
+#endif
+ const char* a_string;
+#if HAVE_WCHAR_T
+ const wchar_t* a_wide_string;
+#endif
+ void* a_pointer;
+ signed char * a_count_schar_pointer;
+ short * a_count_short_pointer;
+ int * a_count_int_pointer;
+ long int * a_count_longint_pointer;
+ long long int * a_count_longlongint_pointer;
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ const uint8_t * a_u8_string;
+ const uint16_t * a_u16_string;
+ const uint32_t * a_u32_string;
+#endif
+ }
+ a;
+}
+argument;
+
+/* Number of directly allocated arguments (no malloc() needed). */
+#define N_DIRECT_ALLOC_ARGUMENTS 7
+
+typedef struct
+{
+ size_t count;
+ argument *arg;
+ argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
+}
+arguments;
+
+
+/* Fetch the arguments, putting them into a. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int PRINTF_FETCHARGS (va_list args, arguments *a);
+
+#endif /* _PRINTF_ARGS_H */
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
new file mode 100644
index 0000000..3040749
--- /dev/null
+++ b/gl/printf-parse.c
@@ -0,0 +1,623 @@
+/* Formatted output to strings.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* This file can be parametrized with the following macros:
+ CHAR_T The element type of the format string.
+ CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
+ in the format string are ASCII.
+ DIRECTIVE Structure denoting a format directive.
+ Depends on CHAR_T.
+ DIRECTIVES Structure denoting the set of format directives of a
+ format string. Depends on CHAR_T.
+ PRINTF_PARSE Function that parses a format string.
+ Depends on CHAR_T.
+ STATIC Set to 'static' to declare the function static.
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
+
+#ifndef PRINTF_PARSE
+# include <config.h>
+#endif
+
+/* Specification. */
+#ifndef PRINTF_PARSE
+# include "printf-parse.h"
+#endif
+
+/* Default parameters. */
+#ifndef PRINTF_PARSE
+# define PRINTF_PARSE printf_parse
+# define CHAR_T char
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+#endif
+
+/* Get size_t, NULL. */
+#include <stddef.h>
+
+/* Get intmax_t. */
+#include <stdint.h>
+
+/* malloc(), realloc(), free(). */
+#include <stdlib.h>
+
+/* memcpy(). */
+#include <string.h>
+
+/* errno. */
+#include <errno.h>
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+#if CHAR_T_ONLY_ASCII
+/* c_isascii(). */
+# include "c-ctype.h"
+#endif
+
+#ifdef STATIC
+STATIC
+#endif
+int
+PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
+{
+ const CHAR_T *cp = format; /* pointer into format */
+ size_t arg_posn = 0; /* number of regular arguments consumed */
+ size_t d_allocated; /* allocated elements of d->dir */
+ size_t a_allocated; /* allocated elements of a->arg */
+ size_t max_width_length = 0;
+ size_t max_precision_length = 0;
+
+ d->count = 0;
+ d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
+ d->dir = d->direct_alloc_dir;
+
+ a->count = 0;
+ a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
+ a->arg = a->direct_alloc_arg;
+
+#define REGISTER_ARG(_index_,_type_) \
+ { \
+ size_t n = (_index_); \
+ if (n >= a_allocated) \
+ { \
+ size_t memory_size; \
+ argument *memory; \
+ \
+ a_allocated = xtimes (a_allocated, 2); \
+ if (a_allocated <= n) \
+ a_allocated = xsum (n, 1); \
+ memory_size = xtimes (a_allocated, sizeof (argument)); \
+ if (size_overflow_p (memory_size)) \
+ /* Overflow, would lead to out of memory. */ \
+ goto out_of_memory; \
+ memory = (argument *) (a->arg != a->direct_alloc_arg \
+ ? realloc (a->arg, memory_size) \
+ : malloc (memory_size)); \
+ if (memory == NULL) \
+ /* Out of memory. */ \
+ goto out_of_memory; \
+ if (a->arg == a->direct_alloc_arg) \
+ memcpy (memory, a->arg, a->count * sizeof (argument)); \
+ a->arg = memory; \
+ } \
+ while (a->count <= n) \
+ a->arg[a->count++].type = TYPE_NONE; \
+ if (a->arg[n].type == TYPE_NONE) \
+ a->arg[n].type = (_type_); \
+ else if (a->arg[n].type != (_type_)) \
+ /* Ambiguous type for positional argument. */ \
+ goto error; \
+ }
+
+ while (*cp != '\0')
+ {
+ CHAR_T c = *cp++;
+ if (c == '%')
+ {
+ size_t arg_index = ARG_NONE;
+ DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
+
+ /* Initialize the next directive. */
+ dp->dir_start = cp - 1;
+ dp->flags = 0;
+ dp->width_start = NULL;
+ dp->width_end = NULL;
+ dp->width_arg_index = ARG_NONE;
+ dp->precision_start = NULL;
+ dp->precision_end = NULL;
+ dp->precision_arg_index = ARG_NONE;
+ dp->arg_index = ARG_NONE;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+
+ /* Read the flags. */
+ for (;;)
+ {
+ if (*cp == '\'')
+ {
+ dp->flags |= FLAG_GROUP;
+ cp++;
+ }
+ else if (*cp == '-')
+ {
+ dp->flags |= FLAG_LEFT;
+ cp++;
+ }
+ else if (*cp == '+')
+ {
+ dp->flags |= FLAG_SHOWSIGN;
+ cp++;
+ }
+ else if (*cp == ' ')
+ {
+ dp->flags |= FLAG_SPACE;
+ cp++;
+ }
+ else if (*cp == '#')
+ {
+ dp->flags |= FLAG_ALT;
+ cp++;
+ }
+ else if (*cp == '0')
+ {
+ dp->flags |= FLAG_ZERO;
+ cp++;
+ }
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+ else if (*cp == 'I')
+ {
+ dp->flags |= FLAG_LOCALIZED;
+ cp++;
+ }
+#endif
+ else
+ break;
+ }
+
+ /* Parse the field width. */
+ if (*cp == '*')
+ {
+ dp->width_start = cp;
+ cp++;
+ dp->width_end = cp;
+ if (max_width_length < 1)
+ max_width_length = 1;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ dp->width_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->width_arg_index == ARG_NONE)
+ {
+ dp->width_arg_index = arg_posn++;
+ if (dp->width_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->width_arg_index, TYPE_INT);
+ }
+ else if (*cp >= '0' && *cp <= '9')
+ {
+ size_t width_length;
+
+ dp->width_start = cp;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->width_end = cp;
+ width_length = dp->width_end - dp->width_start;
+ if (max_width_length < width_length)
+ max_width_length = width_length;
+ }
+
+ /* Parse the precision. */
+ if (*cp == '.')
+ {
+ cp++;
+ if (*cp == '*')
+ {
+ dp->precision_start = cp - 1;
+ cp++;
+ dp->precision_end = cp;
+ if (max_precision_length < 2)
+ max_precision_length = 2;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory
+ later. */
+ goto error;
+ dp->precision_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->precision_arg_index == ARG_NONE)
+ {
+ dp->precision_arg_index = arg_posn++;
+ if (dp->precision_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
+ }
+ else
+ {
+ size_t precision_length;
+
+ dp->precision_start = cp - 1;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->precision_end = cp;
+ precision_length = dp->precision_end - dp->precision_start;
+ if (max_precision_length < precision_length)
+ max_precision_length = precision_length;
+ }
+ }
+
+ {
+ arg_type type;
+
+ /* Parse argument type/size specifiers. */
+ {
+ int flags = 0;
+
+ for (;;)
+ {
+ if (*cp == 'h')
+ {
+ flags |= (1 << (flags & 1));
+ cp++;
+ }
+ else if (*cp == 'L')
+ {
+ flags |= 4;
+ cp++;
+ }
+ else if (*cp == 'l')
+ {
+ flags += 8;
+ cp++;
+ }
+ else if (*cp == 'j')
+ {
+ if (sizeof (intmax_t) > sizeof (long))
+ {
+ /* intmax_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (intmax_t) > sizeof (int))
+ {
+ /* intmax_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 'z' || *cp == 'Z')
+ {
+ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+ because the warning facility in gcc-2.95.2 understands
+ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
+ if (sizeof (size_t) > sizeof (long))
+ {
+ /* size_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (size_t) > sizeof (int))
+ {
+ /* size_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 't')
+ {
+ if (sizeof (ptrdiff_t) > sizeof (long))
+ {
+ /* ptrdiff_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (ptrdiff_t) > sizeof (int))
+ {
+ /* ptrdiff_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#if defined __APPLE__ && defined __MACH__
+ /* On Mac OS X 10.3, PRIdMAX is defined as "qd".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'q')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* int64_t = long long */
+ flags += 16;
+ }
+ else
+ {
+ /* int64_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+ /* On native Windows, PRIdMAX is defined as "I64d".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* __int64 = long long */
+ flags += 16;
+ }
+ else
+ {
+ /* __int64 = long */
+ flags += 8;
+ }
+ cp += 3;
+ }
+#endif
+ else
+ break;
+ }
+
+ /* Read the conversion character. */
+ c = *cp++;
+ switch (c)
+ {
+ case 'd': case 'i':
+ /* If 'long long' is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGLONGINT;
+ else
+ /* If 'long long' is the same as 'long', we parse "lld" into
+ TYPE_LONGINT. */
+ if (flags >= 8)
+ type = TYPE_LONGINT;
+ else if (flags & 2)
+ type = TYPE_SCHAR;
+ else if (flags & 1)
+ type = TYPE_SHORT;
+ else
+ type = TYPE_INT;
+ break;
+ case 'o': case 'u': case 'x': case 'X':
+ /* If 'unsigned long long' is larger than 'unsigned long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_ULONGLONGINT;
+ else
+ /* If 'unsigned long long' is the same as 'unsigned long', we
+ parse "llu" into TYPE_ULONGINT. */
+ if (flags >= 8)
+ type = TYPE_ULONGINT;
+ else if (flags & 2)
+ type = TYPE_UCHAR;
+ else if (flags & 1)
+ type = TYPE_USHORT;
+ else
+ type = TYPE_UINT;
+ break;
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGDOUBLE;
+ else
+ type = TYPE_DOUBLE;
+ break;
+ case 'c':
+ if (flags >= 8)
+#if HAVE_WINT_T
+ type = TYPE_WIDE_CHAR;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_CHAR;
+ break;
+#if HAVE_WINT_T
+ case 'C':
+ type = TYPE_WIDE_CHAR;
+ c = 'c';
+ break;
+#endif
+ case 's':
+ if (flags >= 8)
+#if HAVE_WCHAR_T
+ type = TYPE_WIDE_STRING;
+#else
+ goto error;
+#endif
+ else
+ type = TYPE_STRING;
+ break;
+#if HAVE_WCHAR_T
+ case 'S':
+ type = TYPE_WIDE_STRING;
+ c = 's';
+ break;
+#endif
+ case 'p':
+ type = TYPE_POINTER;
+ break;
+ case 'n':
+ /* If 'long long' is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_COUNT_LONGLONGINT_POINTER;
+ else
+ /* If 'long long' is the same as 'long', we parse "lln" into
+ TYPE_COUNT_LONGINT_POINTER. */
+ if (flags >= 8)
+ type = TYPE_COUNT_LONGINT_POINTER;
+ else if (flags & 2)
+ type = TYPE_COUNT_SCHAR_POINTER;
+ else if (flags & 1)
+ type = TYPE_COUNT_SHORT_POINTER;
+ else
+ type = TYPE_COUNT_INT_POINTER;
+ break;
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ case 'U':
+ if (flags >= 16)
+ type = TYPE_U32_STRING;
+ else if (flags >= 8)
+ type = TYPE_U16_STRING;
+ else
+ type = TYPE_U8_STRING;
+ break;
+#endif
+ case '%':
+ type = TYPE_NONE;
+ break;
+ default:
+ /* Unknown conversion character. */
+ goto error;
+ }
+ }
+
+ if (type != TYPE_NONE)
+ {
+ dp->arg_index = arg_index;
+ if (dp->arg_index == ARG_NONE)
+ {
+ dp->arg_index = arg_posn++;
+ if (dp->arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->arg_index, type);
+ }
+ dp->conversion = c;
+ dp->dir_end = cp;
+ }
+
+ d->count++;
+ if (d->count >= d_allocated)
+ {
+ size_t memory_size;
+ DIRECTIVE *memory;
+
+ d_allocated = xtimes (d_allocated, 2);
+ memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
+ if (size_overflow_p (memory_size))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+ ? realloc (d->dir, memory_size)
+ : malloc (memory_size));
+ if (memory == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ if (d->dir == d->direct_alloc_dir)
+ memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
+ d->dir = memory;
+ }
+ }
+#if CHAR_T_ONLY_ASCII
+ else if (!c_isascii (c))
+ {
+ /* Non-ASCII character. Not supported. */
+ goto error;
+ }
+#endif
+ }
+ d->dir[d->count].dir_start = cp;
+
+ d->max_width_length = max_width_length;
+ d->max_precision_length = max_precision_length;
+ return 0;
+
+error:
+ if (a->arg != a->direct_alloc_arg)
+ free (a->arg);
+ if (d->dir != d->direct_alloc_dir)
+ free (d->dir);
+ errno = EINVAL;
+ return -1;
+
+out_of_memory:
+ if (a->arg != a->direct_alloc_arg)
+ free (a->arg);
+ if (d->dir != d->direct_alloc_dir)
+ free (d->dir);
+ errno = ENOMEM;
+ return -1;
+}
+
+#undef PRINTF_PARSE
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef CHAR_T_ONLY_ASCII
+#undef CHAR_T
diff --git a/gl/printf-parse.h b/gl/printf-parse.h
new file mode 100644
index 0000000..1f86e32
--- /dev/null
+++ b/gl/printf-parse.h
@@ -0,0 +1,193 @@
+/* Parse printf format string.
+ Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _PRINTF_PARSE_H
+#define _PRINTF_PARSE_H
+
+/* This file can be parametrized with the following macros:
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ STATIC Set to 'static' to declare the function static. */
+
+#if HAVE_FEATURES_H
+# include <features.h> /* for __GLIBC__, __UCLIBC__ */
+#endif
+
+#include "printf-args.h"
+
+
+/* Flags */
+#define FLAG_GROUP 1 /* ' flag */
+#define FLAG_LEFT 2 /* - flag */
+#define FLAG_SHOWSIGN 4 /* + flag */
+#define FLAG_SPACE 8 /* space flag */
+#define FLAG_ALT 16 /* # flag */
+#define FLAG_ZERO 32
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */
+#endif
+
+/* arg_index value indicating that no argument is consumed. */
+#define ARG_NONE (~(size_t)0)
+
+/* xxx_directive: A parsed directive.
+ xxx_directives: A parsed format string. */
+
+/* Number of directly allocated directives (no malloc() needed). */
+#define N_DIRECT_ALLOC_DIRECTIVES 7
+
+/* A parsed directive. */
+typedef struct
+{
+ const char* dir_start;
+ const char* dir_end;
+ int flags;
+ const char* width_start;
+ const char* width_end;
+ size_t width_arg_index;
+ const char* precision_start;
+ const char* precision_end;
+ size_t precision_arg_index;
+ char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+char_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ char_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+char_directives;
+
+#if ENABLE_UNISTDIO
+
+/* A parsed directive. */
+typedef struct
+{
+ const uint8_t* dir_start;
+ const uint8_t* dir_end;
+ int flags;
+ const uint8_t* width_start;
+ const uint8_t* width_end;
+ size_t width_arg_index;
+ const uint8_t* precision_start;
+ const uint8_t* precision_end;
+ size_t precision_arg_index;
+ uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+u8_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ u8_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+u8_directives;
+
+/* A parsed directive. */
+typedef struct
+{
+ const uint16_t* dir_start;
+ const uint16_t* dir_end;
+ int flags;
+ const uint16_t* width_start;
+ const uint16_t* width_end;
+ size_t width_arg_index;
+ const uint16_t* precision_start;
+ const uint16_t* precision_end;
+ size_t precision_arg_index;
+ uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+u16_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ u16_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+u16_directives;
+
+/* A parsed directive. */
+typedef struct
+{
+ const uint32_t* dir_start;
+ const uint32_t* dir_end;
+ int flags;
+ const uint32_t* width_start;
+ const uint32_t* width_end;
+ size_t width_arg_index;
+ const uint32_t* precision_start;
+ const uint32_t* precision_end;
+ size_t precision_arg_index;
+ uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
+ size_t arg_index;
+}
+u32_directive;
+
+/* A parsed format string. */
+typedef struct
+{
+ size_t count;
+ u32_directive *dir;
+ size_t max_width_length;
+ size_t max_precision_length;
+ u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
+}
+u32_directives;
+
+#endif
+
+
+/* Parses the format string. Fills in the number N of directives, and fills
+ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
+ to the end of the format string. Also fills in the arg_type fields of the
+ arguments and the needed count of arguments. */
+#if ENABLE_UNISTDIO
+extern int
+ ulc_printf_parse (const char *format, char_directives *d, arguments *a);
+extern int
+ u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
+extern int
+ u16_printf_parse (const uint16_t *format, u16_directives *d,
+ arguments *a);
+extern int
+ u32_printf_parse (const uint32_t *format, u32_directives *d,
+ arguments *a);
+#else
+# ifdef STATIC
+STATIC
+# else
+extern
+# endif
+int printf_parse (const char *format, char_directives *d, arguments *a);
+#endif
+
+#endif /* _PRINTF_PARSE_H */
diff --git a/gl/realloc.c b/gl/realloc.c
new file mode 100644
index 0000000..1063eb0
--- /dev/null
+++ b/gl/realloc.c
@@ -0,0 +1,63 @@
+/* realloc() function that is glibc compatible.
+
+ Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Call the system's realloc below. This file does not define
+ _GL_USE_STDLIB_ALLOC because it needs Gnulib's malloc if present. */
+#undef realloc
+
+/* Change the size of an allocated block of memory P to N bytes,
+ with error checking. If P is NULL, use malloc. Otherwise if N is zero,
+ free P and return NULL. */
+
+void *
+rpl_realloc (void *p, size_t n)
+{
+ if (p == NULL)
+ return malloc (n);
+
+ if (n == 0)
+ {
+ free (p);
+ return NULL;
+ }
+
+ if (xalloc_oversized (n, 1))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ void *result = realloc (p, n);
+
+#if !HAVE_MALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/gl/reallocarray.c b/gl/reallocarray.c
new file mode 100644
index 0000000..8c99250
--- /dev/null
+++ b/gl/reallocarray.c
@@ -0,0 +1,38 @@
+/* reallocarray function that is glibc compatible.
+
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* written by Darshit Shah */
+
+#include <config.h>
+
+#include <stdckdint.h>
+#include <stdlib.h>
+#include <errno.h>
+
+void *
+reallocarray (void *ptr, size_t nmemb, size_t size)
+{
+ size_t nbytes;
+ if (ckd_mul (&nbytes, nmemb, size))
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ /* Rely on the semantics of GNU realloc. */
+ return realloc (ptr, nbytes);
+}
diff --git a/gl/regcomp.c b/gl/regcomp.c
new file mode 100644
index 0000000..8947839
--- /dev/null
+++ b/gl/regcomp.c
@@ -0,0 +1,3788 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifdef _LIBC
+# include <locale/weight.h>
+#endif
+
+static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
+ size_t length, reg_syntax_t syntax);
+static void re_compile_fastmap_iter (regex_t *bufp,
+ const re_dfastate_t *init_state,
+ char *fastmap);
+static reg_errcode_t init_dfa (re_dfa_t *dfa, size_t pat_len);
+static void free_charset (re_charset_t *cset);
+static void free_workarea_compile (regex_t *preg);
+static reg_errcode_t create_initial_state (re_dfa_t *dfa);
+static void optimize_utf8 (re_dfa_t *dfa);
+static reg_errcode_t analyze (regex_t *preg);
+static reg_errcode_t preorder (bin_tree_t *root,
+ reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra);
+static reg_errcode_t postorder (bin_tree_t *root,
+ reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra);
+static reg_errcode_t optimize_subexps (void *extra, bin_tree_t *node);
+static reg_errcode_t lower_subexps (void *extra, bin_tree_t *node);
+static bin_tree_t *lower_subexp (reg_errcode_t *err, regex_t *preg,
+ bin_tree_t *node);
+static reg_errcode_t calc_first (void *extra, bin_tree_t *node);
+static reg_errcode_t calc_next (void *extra, bin_tree_t *node);
+static reg_errcode_t link_nfa_nodes (void *extra, bin_tree_t *node);
+static Idx duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint);
+static Idx search_duplicated_node (const re_dfa_t *dfa, Idx org_node,
+ unsigned int constraint);
+static reg_errcode_t calc_eclosure (re_dfa_t *dfa);
+static reg_errcode_t calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa,
+ Idx node, bool root);
+static reg_errcode_t calc_inveclosure (re_dfa_t *dfa);
+static Idx fetch_number (re_string_t *input, re_token_t *token,
+ reg_syntax_t syntax);
+static int peek_token (re_token_t *token, re_string_t *input,
+ reg_syntax_t syntax);
+static bin_tree_t *parse (re_string_t *regexp, regex_t *preg,
+ reg_syntax_t syntax, reg_errcode_t *err);
+static bin_tree_t *parse_reg_exp (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_branch (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_expression (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_sub_exp (re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ Idx nest, reg_errcode_t *err);
+static bin_tree_t *parse_dup_op (bin_tree_t *dup_elem, re_string_t *regexp,
+ re_dfa_t *dfa, re_token_t *token,
+ reg_syntax_t syntax, reg_errcode_t *err);
+static bin_tree_t *parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa,
+ re_token_t *token, reg_syntax_t syntax,
+ reg_errcode_t *err);
+static reg_errcode_t parse_bracket_element (bracket_elem_t *elem,
+ re_string_t *regexp,
+ re_token_t *token, int token_len,
+ re_dfa_t *dfa,
+ reg_syntax_t syntax,
+ bool accept_hyphen);
+static reg_errcode_t parse_bracket_symbol (bracket_elem_t *elem,
+ re_string_t *regexp,
+ re_token_t *token);
+static reg_errcode_t build_equiv_class (bitset_t sbcset,
+ re_charset_t *mbcset,
+ Idx *equiv_class_alloc,
+ const unsigned char *name);
+static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans,
+ bitset_t sbcset,
+ re_charset_t *mbcset,
+ Idx *char_class_alloc,
+ const char *class_name,
+ reg_syntax_t syntax);
+static bin_tree_t *build_charclass_op (re_dfa_t *dfa,
+ RE_TRANSLATE_TYPE trans,
+ const char *class_name,
+ const char *extra,
+ bool non_match, reg_errcode_t *err);
+static bin_tree_t *create_tree (re_dfa_t *dfa,
+ bin_tree_t *left, bin_tree_t *right,
+ re_token_type_t type);
+static bin_tree_t *create_token_tree (re_dfa_t *dfa,
+ bin_tree_t *left, bin_tree_t *right,
+ const re_token_t *token);
+static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa);
+static void free_token (re_token_t *node);
+static reg_errcode_t free_tree (void *extra, bin_tree_t *node);
+static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node);
+
+/* This table gives an error message for each of the error codes listed
+ in regex.h. Obviously the order here has to be same as there.
+ POSIX doesn't require that we do anything for REG_NOERROR,
+ but why not be nice? */
+
+static const char __re_error_msgid[] =
+ {
+#define REG_NOERROR_IDX 0
+ gettext_noop ("Success") /* REG_NOERROR */
+ "\0"
+#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
+ gettext_noop ("No match") /* REG_NOMATCH */
+ "\0"
+#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
+ gettext_noop ("Invalid regular expression") /* REG_BADPAT */
+ "\0"
+#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
+ gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
+ "\0"
+#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
+ gettext_noop ("Invalid character class name") /* REG_ECTYPE */
+ "\0"
+#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
+ gettext_noop ("Trailing backslash") /* REG_EESCAPE */
+ "\0"
+#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
+ gettext_noop ("Invalid back reference") /* REG_ESUBREG */
+ "\0"
+#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
+ gettext_noop ("Unmatched [, [^, [:, [., or [=") /* REG_EBRACK */
+ "\0"
+#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [, [^, [:, [., or [=")
+ gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
+ "\0"
+#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
+ gettext_noop ("Unmatched \\{") /* REG_EBRACE */
+ "\0"
+#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
+ gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
+ "\0"
+#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
+ gettext_noop ("Invalid range end") /* REG_ERANGE */
+ "\0"
+#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
+ gettext_noop ("Memory exhausted") /* REG_ESPACE */
+ "\0"
+#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
+ gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
+ "\0"
+#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
+ gettext_noop ("Premature end of regular expression") /* REG_EEND */
+ "\0"
+#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
+ gettext_noop ("Regular expression too big") /* REG_ESIZE */
+ "\0"
+#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
+ gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
+ };
+
+static const size_t __re_error_msgid_idx[] =
+ {
+ REG_NOERROR_IDX,
+ REG_NOMATCH_IDX,
+ REG_BADPAT_IDX,
+ REG_ECOLLATE_IDX,
+ REG_ECTYPE_IDX,
+ REG_EESCAPE_IDX,
+ REG_ESUBREG_IDX,
+ REG_EBRACK_IDX,
+ REG_EPAREN_IDX,
+ REG_EBRACE_IDX,
+ REG_BADBR_IDX,
+ REG_ERANGE_IDX,
+ REG_ESPACE_IDX,
+ REG_BADRPT_IDX,
+ REG_EEND_IDX,
+ REG_ESIZE_IDX,
+ REG_ERPAREN_IDX
+ };
+
+/* Entry points for GNU code. */
+
+/* re_compile_pattern is the GNU regular expression compiler: it
+ compiles PATTERN (of length LENGTH) and puts the result in BUFP.
+ Returns 0 if the pattern was valid, otherwise an error string.
+
+ Assumes the 'allocated' (and perhaps 'buffer') and 'translate' fields
+ are set in BUFP on entry. */
+
+const char *
+re_compile_pattern (const char *pattern, size_t length,
+ struct re_pattern_buffer *bufp)
+{
+ reg_errcode_t ret;
+
+ /* And GNU code determines whether or not to get register information
+ by passing null for the REGS argument to re_match, etc., not by
+ setting no_sub, unless RE_NO_SUB is set. */
+ bufp->no_sub = !!(re_syntax_options & RE_NO_SUB);
+
+ /* Match anchors at newline. */
+ bufp->newline_anchor = 1;
+
+ ret = re_compile_internal (bufp, pattern, length, re_syntax_options);
+
+ if (!ret)
+ return NULL;
+ return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
+}
+weak_alias (__re_compile_pattern, re_compile_pattern)
+
+/* Set by 're_set_syntax' to the current regexp syntax to recognize. Can
+ also be assigned to arbitrarily: each pattern buffer stores its own
+ syntax, so it can be changed between regex compilations. */
+/* This has no initializer because initialized variables in Emacs
+ become read-only after dumping. */
+reg_syntax_t re_syntax_options;
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit mask comprised of the various bits
+ defined in regex.h. We return the old syntax. */
+
+reg_syntax_t
+re_set_syntax (reg_syntax_t syntax)
+{
+ reg_syntax_t ret = re_syntax_options;
+
+ re_syntax_options = syntax;
+ return ret;
+}
+weak_alias (__re_set_syntax, re_set_syntax)
+
+int
+re_compile_fastmap (struct re_pattern_buffer *bufp)
+{
+ re_dfa_t *dfa = bufp->buffer;
+ char *fastmap = bufp->fastmap;
+
+ memset (fastmap, '\0', sizeof (char) * SBC_MAX);
+ re_compile_fastmap_iter (bufp, dfa->init_state, fastmap);
+ if (dfa->init_state != dfa->init_state_word)
+ re_compile_fastmap_iter (bufp, dfa->init_state_word, fastmap);
+ if (dfa->init_state != dfa->init_state_nl)
+ re_compile_fastmap_iter (bufp, dfa->init_state_nl, fastmap);
+ if (dfa->init_state != dfa->init_state_begbuf)
+ re_compile_fastmap_iter (bufp, dfa->init_state_begbuf, fastmap);
+ bufp->fastmap_accurate = 1;
+ return 0;
+}
+weak_alias (__re_compile_fastmap, re_compile_fastmap)
+
+static __always_inline void
+re_set_fastmap (char *fastmap, bool icase, int ch)
+{
+ fastmap[ch] = 1;
+ if (icase)
+ fastmap[tolower (ch)] = 1;
+}
+
+/* Helper function for re_compile_fastmap.
+ Compile fastmap for the initial_state INIT_STATE. */
+
+static void
+re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ char *fastmap)
+{
+ re_dfa_t *dfa = bufp->buffer;
+ Idx node_cnt;
+ bool icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE));
+ for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt)
+ {
+ Idx node = init_state->nodes.elems[node_cnt];
+ re_token_type_t type = dfa->nodes[node].type;
+
+ if (type == CHARACTER)
+ {
+ re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c);
+ if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
+ {
+ unsigned char buf[MB_LEN_MAX];
+ unsigned char *p;
+ wchar_t wc;
+ mbstate_t state;
+
+ p = buf;
+ *p++ = dfa->nodes[node].opr.c;
+ while (++node < dfa->nodes_len
+ && dfa->nodes[node].type == CHARACTER
+ && dfa->nodes[node].mb_partial)
+ *p++ = dfa->nodes[node].opr.c;
+ memset (&state, '\0', sizeof (state));
+ if (__mbrtowc (&wc, (const char *) buf, p - buf,
+ &state) == p - buf
+ && (__wcrtomb ((char *) buf, __towlower (wc), &state)
+ != (size_t) -1))
+ re_set_fastmap (fastmap, false, buf[0]);
+ }
+ }
+ else if (type == SIMPLE_BRACKET)
+ {
+ int i, ch;
+ for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
+ {
+ int j;
+ bitset_word_t w = dfa->nodes[node].opr.sbcset[i];
+ for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+ if (w & ((bitset_word_t) 1 << j))
+ re_set_fastmap (fastmap, icase, ch);
+ }
+ }
+ else if (type == COMPLEX_BRACKET)
+ {
+ re_charset_t *cset = dfa->nodes[node].opr.mbcset;
+ Idx i;
+
+#ifdef _LIBC
+ /* See if we have to try all bytes which start multiple collation
+ elements.
+ e.g. In da_DK, we want to catch 'a' since "aa" is a valid
+ collation element, and don't catch 'b' since 'b' is
+ the only collation element which starts from 'b' (and
+ it is caught by SIMPLE_BRACKET). */
+ if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
+ && (cset->ncoll_syms || cset->nranges))
+ {
+ const int32_t *table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ for (i = 0; i < SBC_MAX; ++i)
+ if (table[i] < 0)
+ re_set_fastmap (fastmap, icase, i);
+ }
+#endif /* _LIBC */
+
+ /* See if we have to start the match at all multibyte characters,
+ i.e. where we would not find an invalid sequence. This only
+ applies to multibyte character sets; for single byte character
+ sets, the SIMPLE_BRACKET again suffices. */
+ if (dfa->mb_cur_max > 1
+ && (cset->nchar_classes || cset->non_match || cset->nranges
+#ifdef _LIBC
+ || cset->nequiv_classes
+#endif /* _LIBC */
+ ))
+ {
+ unsigned char c = 0;
+ do
+ {
+ mbstate_t mbs;
+ memset (&mbs, 0, sizeof (mbs));
+ if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2)
+ re_set_fastmap (fastmap, false, (int) c);
+ }
+ while (++c != 0);
+ }
+
+ else
+ {
+ /* ... Else catch all bytes which can start the mbchars. */
+ for (i = 0; i < cset->nmbchars; ++i)
+ {
+ char buf[256];
+ mbstate_t state;
+ memset (&state, '\0', sizeof (state));
+ if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
+ re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
+ if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
+ {
+ if (__wcrtomb (buf, __towlower (cset->mbchars[i]), &state)
+ != (size_t) -1)
+ re_set_fastmap (fastmap, false, *(unsigned char *) buf);
+ }
+ }
+ }
+ }
+ else if (type == OP_PERIOD || type == OP_UTF8_PERIOD || type == END_OF_RE)
+ {
+ memset (fastmap, '\1', sizeof (char) * SBC_MAX);
+ if (type == END_OF_RE)
+ bufp->can_be_null = 1;
+ return;
+ }
+ }
+}
+
+/* Entry point for POSIX code. */
+/* regcomp takes a regular expression as a string and compiles it.
+
+ PREG is a regex_t *. We do not expect any fields to be initialized,
+ since POSIX says we shouldn't. Thus, we set
+
+ 'buffer' to the compiled pattern;
+ 'used' to the length of the compiled pattern;
+ 'syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+ REG_EXTENDED bit in CFLAGS is set; otherwise, to
+ RE_SYNTAX_POSIX_BASIC;
+ 'newline_anchor' to REG_NEWLINE being set in CFLAGS;
+ 'fastmap' to an allocated space for the fastmap;
+ 'fastmap_accurate' to zero;
+ 're_nsub' to the number of subexpressions in PATTERN.
+
+ PATTERN is the address of the pattern string.
+
+ CFLAGS is a series of bits which affect compilation.
+
+ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
+ use POSIX basic syntax.
+
+ If REG_NEWLINE is set, then . and [^...] don't match newline.
+ Also, regexec will try a match beginning after every newline.
+
+ If REG_ICASE is set, then we considers upper- and lowercase
+ versions of letters to be equivalent when matching.
+
+ If REG_NOSUB is set, then when PREG is passed to regexec, that
+ routine will report only success or failure, and nothing about the
+ registers.
+
+ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
+ the return codes and their meanings.) */
+
+int
+regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
+{
+ reg_errcode_t ret;
+ reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
+ : RE_SYNTAX_POSIX_BASIC);
+
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ preg->used = 0;
+
+ /* Try to allocate space for the fastmap. */
+ preg->fastmap = re_malloc (char, SBC_MAX);
+ if (__glibc_unlikely (preg->fastmap == NULL))
+ return REG_ESPACE;
+
+ syntax |= (cflags & REG_ICASE) ? RE_ICASE : 0;
+
+ /* If REG_NEWLINE is set, newlines are treated differently. */
+ if (cflags & REG_NEWLINE)
+ { /* REG_NEWLINE implies neither . nor [^...] match newline. */
+ syntax &= ~RE_DOT_NEWLINE;
+ syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+ /* It also changes the matching behavior. */
+ preg->newline_anchor = 1;
+ }
+ else
+ preg->newline_anchor = 0;
+ preg->no_sub = !!(cflags & REG_NOSUB);
+ preg->translate = NULL;
+
+ ret = re_compile_internal (preg, pattern, strlen (pattern), syntax);
+
+ /* POSIX doesn't distinguish between an unmatched open-group and an
+ unmatched close-group: both are REG_EPAREN. */
+ if (ret == REG_ERPAREN)
+ ret = REG_EPAREN;
+
+ /* We have already checked preg->fastmap != NULL. */
+ if (__glibc_likely (ret == REG_NOERROR))
+ /* Compute the fastmap now, since regexec cannot modify the pattern
+ buffer. This function never fails in this implementation. */
+ (void) re_compile_fastmap (preg);
+ else
+ {
+ /* Some error occurred while compiling the expression. */
+ re_free (preg->fastmap);
+ preg->fastmap = NULL;
+ }
+
+ return (int) ret;
+}
+libc_hidden_def (__regcomp)
+weak_alias (__regcomp, regcomp)
+
+/* Returns a message corresponding to an error code, ERRCODE, returned
+ from either regcomp or regexec. We don't use PREG here. */
+
+size_t
+regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf,
+ size_t errbuf_size)
+{
+ const char *msg;
+ size_t msg_size;
+ int nerrcodes = sizeof __re_error_msgid_idx / sizeof __re_error_msgid_idx[0];
+
+ if (__glibc_unlikely (errcode < 0 || errcode >= nerrcodes))
+ /* Only error codes returned by the rest of the code should be passed
+ to this routine. If we are given anything else, or if other regex
+ code generates an invalid error code, then the program has a bug.
+ Dump core so we can fix it. */
+ abort ();
+
+ msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
+
+ msg_size = strlen (msg) + 1; /* Includes the null. */
+
+ if (__glibc_likely (errbuf_size != 0))
+ {
+ size_t cpy_size = msg_size;
+ if (__glibc_unlikely (msg_size > errbuf_size))
+ {
+ cpy_size = errbuf_size - 1;
+ errbuf[cpy_size] = '\0';
+ }
+ memcpy (errbuf, msg, cpy_size);
+ }
+
+ return msg_size;
+}
+weak_alias (__regerror, regerror)
+
+
+/* This static array is used for the map to single-byte characters when
+ UTF-8 is used. Otherwise we would allocate memory just to initialize
+ it the same all the time. UTF-8 is the preferred encoding so this is
+ a worthwhile optimization. */
+static const bitset_t utf8_sb_map =
+{
+ /* Set the first 128 bits. */
+#if (defined __GNUC__ || __clang_major__ >= 4) && !defined __STRICT_ANSI__
+ [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX
+#else
+# if 4 * BITSET_WORD_BITS < ASCII_CHARS
+# error "bitset_word_t is narrower than 32 bits"
+# elif 3 * BITSET_WORD_BITS < ASCII_CHARS
+ BITSET_WORD_MAX, BITSET_WORD_MAX, BITSET_WORD_MAX,
+# elif 2 * BITSET_WORD_BITS < ASCII_CHARS
+ BITSET_WORD_MAX, BITSET_WORD_MAX,
+# elif 1 * BITSET_WORD_BITS < ASCII_CHARS
+ BITSET_WORD_MAX,
+# endif
+ (BITSET_WORD_MAX
+ >> (SBC_MAX % BITSET_WORD_BITS == 0
+ ? 0
+ : BITSET_WORD_BITS - SBC_MAX % BITSET_WORD_BITS))
+#endif
+};
+
+
+static void
+free_dfa_content (re_dfa_t *dfa)
+{
+ Idx i, j;
+
+ if (dfa->nodes)
+ for (i = 0; i < dfa->nodes_len; ++i)
+ free_token (dfa->nodes + i);
+ re_free (dfa->nexts);
+ for (i = 0; i < dfa->nodes_len; ++i)
+ {
+ if (dfa->eclosures != NULL)
+ re_node_set_free (dfa->eclosures + i);
+ if (dfa->inveclosures != NULL)
+ re_node_set_free (dfa->inveclosures + i);
+ if (dfa->edests != NULL)
+ re_node_set_free (dfa->edests + i);
+ }
+ re_free (dfa->edests);
+ re_free (dfa->eclosures);
+ re_free (dfa->inveclosures);
+ re_free (dfa->nodes);
+
+ if (dfa->state_table)
+ for (i = 0; i <= dfa->state_hash_mask; ++i)
+ {
+ struct re_state_table_entry *entry = dfa->state_table + i;
+ for (j = 0; j < entry->num; ++j)
+ {
+ re_dfastate_t *state = entry->array[j];
+ free_state (state);
+ }
+ re_free (entry->array);
+ }
+ re_free (dfa->state_table);
+ if (dfa->sb_char != utf8_sb_map)
+ re_free (dfa->sb_char);
+ re_free (dfa->subexp_map);
+#ifdef DEBUG
+ re_free (dfa->re_str);
+#endif
+
+ re_free (dfa);
+}
+
+
+/* Free dynamically allocated space used by PREG. */
+
+void
+regfree (regex_t *preg)
+{
+ re_dfa_t *dfa = preg->buffer;
+ if (__glibc_likely (dfa != NULL))
+ {
+ lock_fini (dfa->lock);
+ free_dfa_content (dfa);
+ }
+ preg->buffer = NULL;
+ preg->allocated = 0;
+
+ re_free (preg->fastmap);
+ preg->fastmap = NULL;
+
+ re_free (preg->translate);
+ preg->translate = NULL;
+}
+libc_hidden_def (__regfree)
+weak_alias (__regfree, regfree)
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them unless specifically requested. */
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+
+/* BSD has one and only one pattern buffer. */
+static struct re_pattern_buffer re_comp_buf;
+
+char *
+# ifdef _LIBC
+/* Make these definitions weak in libc, so POSIX programs can redefine
+ these names if they don't use our functions, and still use
+ regcomp/regexec above without link errors. */
+weak_function
+# endif
+re_comp (const char *s)
+{
+ reg_errcode_t ret;
+ char *fastmap;
+
+ if (!s)
+ {
+ if (!re_comp_buf.buffer)
+ return gettext ("No previous regular expression");
+ return 0;
+ }
+
+ if (re_comp_buf.buffer)
+ {
+ fastmap = re_comp_buf.fastmap;
+ re_comp_buf.fastmap = NULL;
+ __regfree (&re_comp_buf);
+ memset (&re_comp_buf, '\0', sizeof (re_comp_buf));
+ re_comp_buf.fastmap = fastmap;
+ }
+
+ if (re_comp_buf.fastmap == NULL)
+ {
+ re_comp_buf.fastmap = re_malloc (char, SBC_MAX);
+ if (re_comp_buf.fastmap == NULL)
+ return (char *) gettext (__re_error_msgid
+ + __re_error_msgid_idx[(int) REG_ESPACE]);
+ }
+
+ /* Since 're_exec' always passes NULL for the 'regs' argument, we
+ don't need to initialize the pattern buffer fields which affect it. */
+
+ /* Match anchors at newlines. */
+ re_comp_buf.newline_anchor = 1;
+
+ ret = re_compile_internal (&re_comp_buf, s, strlen (s), re_syntax_options);
+
+ if (!ret)
+ return NULL;
+
+ /* Yes, we're discarding 'const' here if !HAVE_LIBINTL. */
+ return (char *) gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
+}
+
+#ifdef _LIBC
+libc_freeres_fn (free_mem)
+{
+ __regfree (&re_comp_buf);
+}
+#endif
+
+#endif /* _REGEX_RE_COMP */
+
+/* Internal entry point.
+ Compile the regular expression PATTERN, whose length is LENGTH.
+ SYNTAX indicate regular expression's syntax. */
+
+static reg_errcode_t
+re_compile_internal (regex_t *preg, const char * pattern, size_t length,
+ reg_syntax_t syntax)
+{
+ reg_errcode_t err = REG_NOERROR;
+ re_dfa_t *dfa;
+ re_string_t regexp;
+
+ /* Initialize the pattern buffer. */
+ preg->fastmap_accurate = 0;
+ preg->syntax = syntax;
+ preg->not_bol = preg->not_eol = 0;
+ preg->used = 0;
+ preg->re_nsub = 0;
+ preg->can_be_null = 0;
+ preg->regs_allocated = REGS_UNALLOCATED;
+
+ /* Initialize the dfa. */
+ dfa = preg->buffer;
+ if (__glibc_unlikely (preg->allocated < sizeof (re_dfa_t)))
+ {
+ /* If zero allocated, but buffer is non-null, try to realloc
+ enough space. This loses if buffer's address is bogus, but
+ that is the user's responsibility. If ->buffer is NULL this
+ is a simple allocation. */
+ dfa = re_realloc (preg->buffer, re_dfa_t, 1);
+ if (dfa == NULL)
+ return REG_ESPACE;
+ preg->allocated = sizeof (re_dfa_t);
+ preg->buffer = dfa;
+ }
+ preg->used = sizeof (re_dfa_t);
+
+ err = init_dfa (dfa, length);
+ if (__glibc_unlikely (err == REG_NOERROR && lock_init (dfa->lock) != 0))
+ err = REG_ESPACE;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ free_dfa_content (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ return err;
+ }
+#ifdef DEBUG
+ /* Note: length+1 will not overflow since it is checked in init_dfa. */
+ dfa->re_str = re_malloc (char, length + 1);
+ strncpy (dfa->re_str, pattern, length + 1);
+#endif
+
+ err = re_string_construct (&regexp, pattern, length, preg->translate,
+ (syntax & RE_ICASE) != 0, dfa);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_compile_internal_free_return:
+ free_workarea_compile (preg);
+ re_string_destruct (&regexp);
+ lock_fini (dfa->lock);
+ free_dfa_content (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ return err;
+ }
+
+ /* Parse the regular expression, and build a structure tree. */
+ preg->re_nsub = 0;
+ dfa->str_tree = parse (&regexp, preg, syntax, &err);
+ if (__glibc_unlikely (dfa->str_tree == NULL))
+ goto re_compile_internal_free_return;
+
+ /* Analyze the tree and create the nfa. */
+ err = analyze (preg);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto re_compile_internal_free_return;
+
+ /* If possible, do searching in single byte encoding to speed things up. */
+ if (dfa->is_utf8 && !(syntax & RE_ICASE) && preg->translate == NULL)
+ optimize_utf8 (dfa);
+
+ /* Then create the initial state of the dfa. */
+ err = create_initial_state (dfa);
+
+ /* Release work areas. */
+ free_workarea_compile (preg);
+ re_string_destruct (&regexp);
+
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ lock_fini (dfa->lock);
+ free_dfa_content (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ }
+
+ return err;
+}
+
+/* Initialize DFA. We use the length of the regular expression PAT_LEN
+ as the initial length of some arrays. */
+
+static reg_errcode_t
+init_dfa (re_dfa_t *dfa, size_t pat_len)
+{
+ __re_size_t table_size;
+#ifndef _LIBC
+ const char *codeset_name;
+#endif
+ size_t max_i18n_object_size = MAX (sizeof (wchar_t), sizeof (wctype_t));
+ size_t max_object_size =
+ MAX (sizeof (struct re_state_table_entry),
+ MAX (sizeof (re_token_t),
+ MAX (sizeof (re_node_set),
+ MAX (sizeof (regmatch_t),
+ max_i18n_object_size))));
+
+ memset (dfa, '\0', sizeof (re_dfa_t));
+
+ /* Force allocation of str_tree_storage the first time. */
+ dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE;
+
+ /* Avoid overflows. The extra "/ 2" is for the table_size doubling
+ calculation below, and for similar doubling calculations
+ elsewhere. And it's <= rather than <, because some of the
+ doubling calculations add 1 afterwards. */
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2
+ <= pat_len))
+ return REG_ESPACE;
+
+ dfa->nodes_alloc = pat_len + 1;
+ dfa->nodes = re_malloc (re_token_t, dfa->nodes_alloc);
+
+ /* table_size = 2 ^ ceil(log pat_len) */
+ for (table_size = 1; ; table_size <<= 1)
+ if (table_size > pat_len)
+ break;
+
+ dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
+ dfa->state_hash_mask = table_size - 1;
+
+ dfa->mb_cur_max = MB_CUR_MAX;
+#ifdef _LIBC
+ if (dfa->mb_cur_max == 6
+ && strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0)
+ dfa->is_utf8 = 1;
+ dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII)
+ != 0);
+#else
+ codeset_name = nl_langinfo (CODESET);
+ if ((codeset_name[0] == 'U' || codeset_name[0] == 'u')
+ && (codeset_name[1] == 'T' || codeset_name[1] == 't')
+ && (codeset_name[2] == 'F' || codeset_name[2] == 'f')
+ && strcmp (codeset_name + 3 + (codeset_name[3] == '-'), "8") == 0)
+ dfa->is_utf8 = 1;
+
+ /* We check exhaustively in the loop below if this charset is a
+ superset of ASCII. */
+ dfa->map_notascii = 0;
+#endif
+
+ if (dfa->mb_cur_max > 1)
+ {
+ if (dfa->is_utf8)
+ dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map;
+ else
+ {
+ int i, j, ch;
+
+ dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
+ if (__glibc_unlikely (dfa->sb_char == NULL))
+ return REG_ESPACE;
+
+ /* Set the bits corresponding to single byte chars. */
+ for (i = 0, ch = 0; i < BITSET_WORDS; ++i)
+ for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+ {
+ wint_t wch = __btowc (ch);
+ if (wch != WEOF)
+ dfa->sb_char[i] |= (bitset_word_t) 1 << j;
+#ifndef _LIBC
+ if (isascii (ch) && wch != ch)
+ dfa->map_notascii = 1;
+#endif
+ }
+ }
+ }
+
+ if (__glibc_unlikely (dfa->nodes == NULL || dfa->state_table == NULL))
+ return REG_ESPACE;
+ return REG_NOERROR;
+}
+
+/* Initialize WORD_CHAR table, which indicate which character is
+ "word". In this case "word" means that it is the word construction
+ character used by some operators like "\<", "\>", etc. */
+
+static void
+init_word_char (re_dfa_t *dfa)
+{
+ int i = 0;
+ int j;
+ int ch = 0;
+ dfa->word_ops_used = 1;
+ if (__glibc_likely (dfa->map_notascii == 0))
+ {
+ bitset_word_t bits0 = 0x00000000;
+ bitset_word_t bits1 = 0x03ff0000;
+ bitset_word_t bits2 = 0x87fffffe;
+ bitset_word_t bits3 = 0x07fffffe;
+ if (BITSET_WORD_BITS == 64)
+ {
+ /* Pacify gcc -Woverflow on 32-bit platformns. */
+ dfa->word_char[0] = bits1 << 31 << 1 | bits0;
+ dfa->word_char[1] = bits3 << 31 << 1 | bits2;
+ i = 2;
+ }
+ else if (BITSET_WORD_BITS == 32)
+ {
+ dfa->word_char[0] = bits0;
+ dfa->word_char[1] = bits1;
+ dfa->word_char[2] = bits2;
+ dfa->word_char[3] = bits3;
+ i = 4;
+ }
+ else
+ goto general_case;
+ ch = 128;
+
+ if (__glibc_likely (dfa->is_utf8))
+ {
+ memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8);
+ return;
+ }
+ }
+
+ general_case:
+ for (; i < BITSET_WORDS; ++i)
+ for (j = 0; j < BITSET_WORD_BITS; ++j, ++ch)
+ if (isalnum (ch) || ch == '_')
+ dfa->word_char[i] |= (bitset_word_t) 1 << j;
+}
+
+/* Free the work area which are only used while compiling. */
+
+static void
+free_workarea_compile (regex_t *preg)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_storage_t *storage, *next;
+ for (storage = dfa->str_tree_storage; storage; storage = next)
+ {
+ next = storage->next;
+ re_free (storage);
+ }
+ dfa->str_tree_storage = NULL;
+ dfa->str_tree_storage_idx = BIN_TREE_STORAGE_SIZE;
+ dfa->str_tree = NULL;
+ re_free (dfa->org_indices);
+ dfa->org_indices = NULL;
+}
+
+/* Create initial states for all contexts. */
+
+static reg_errcode_t
+create_initial_state (re_dfa_t *dfa)
+{
+ Idx first, i;
+ reg_errcode_t err;
+ re_node_set init_nodes;
+
+ /* Initial states have the epsilon closure of the node which is
+ the first node of the regular expression. */
+ first = dfa->str_tree->first->node_idx;
+ dfa->init_node = first;
+ err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* The back-references which are in initial states can epsilon transit,
+ since in this case all of the subexpressions can be null.
+ Then we add epsilon closures of the nodes which are the next nodes of
+ the back-references. */
+ if (dfa->nbackref > 0)
+ for (i = 0; i < init_nodes.nelem; ++i)
+ {
+ Idx node_idx = init_nodes.elems[i];
+ re_token_type_t type = dfa->nodes[node_idx].type;
+
+ Idx clexp_idx;
+ if (type != OP_BACK_REF)
+ continue;
+ for (clexp_idx = 0; clexp_idx < init_nodes.nelem; ++clexp_idx)
+ {
+ re_token_t *clexp_node;
+ clexp_node = dfa->nodes + init_nodes.elems[clexp_idx];
+ if (clexp_node->type == OP_CLOSE_SUBEXP
+ && clexp_node->opr.idx == dfa->nodes[node_idx].opr.idx)
+ break;
+ }
+ if (clexp_idx == init_nodes.nelem)
+ continue;
+
+ if (type == OP_BACK_REF)
+ {
+ Idx dest_idx = dfa->edests[node_idx].elems[0];
+ if (!re_node_set_contains (&init_nodes, dest_idx))
+ {
+ reg_errcode_t merge_err
+ = re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx);
+ if (merge_err != REG_NOERROR)
+ return merge_err;
+ i = 0;
+ }
+ }
+ }
+
+ /* It must be the first time to invoke acquire_state. */
+ dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0);
+ /* We don't check ERR here, since the initial state must not be NULL. */
+ if (__glibc_unlikely (dfa->init_state == NULL))
+ return err;
+ if (dfa->init_state->has_constraint)
+ {
+ dfa->init_state_word = re_acquire_state_context (&err, dfa, &init_nodes,
+ CONTEXT_WORD);
+ dfa->init_state_nl = re_acquire_state_context (&err, dfa, &init_nodes,
+ CONTEXT_NEWLINE);
+ dfa->init_state_begbuf = re_acquire_state_context (&err, dfa,
+ &init_nodes,
+ CONTEXT_NEWLINE
+ | CONTEXT_BEGBUF);
+ if (__glibc_unlikely (dfa->init_state_word == NULL
+ || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL))
+ return err;
+ }
+ else
+ dfa->init_state_word = dfa->init_state_nl
+ = dfa->init_state_begbuf = dfa->init_state;
+
+ re_node_set_free (&init_nodes);
+ return REG_NOERROR;
+}
+
+/* If it is possible to do searching in single byte encoding instead of UTF-8
+ to speed things up, set dfa->mb_cur_max to 1, clear is_utf8 and change
+ DFA nodes where needed. */
+
+static void
+optimize_utf8 (re_dfa_t *dfa)
+{
+ Idx node;
+ int i;
+ bool mb_chars = false;
+ bool has_period = false;
+
+ for (node = 0; node < dfa->nodes_len; ++node)
+ switch (dfa->nodes[node].type)
+ {
+ case CHARACTER:
+ if (dfa->nodes[node].opr.c >= ASCII_CHARS)
+ mb_chars = true;
+ break;
+ case ANCHOR:
+ switch (dfa->nodes[node].opr.ctx_type)
+ {
+ case LINE_FIRST:
+ case LINE_LAST:
+ case BUF_FIRST:
+ case BUF_LAST:
+ break;
+ default:
+ /* Word anchors etc. cannot be handled. It's okay to test
+ opr.ctx_type since constraints (for all DFA nodes) are
+ created by ORing one or more opr.ctx_type values. */
+ return;
+ }
+ break;
+ case OP_PERIOD:
+ has_period = true;
+ break;
+ case OP_BACK_REF:
+ case OP_ALT:
+ case END_OF_RE:
+ case OP_DUP_ASTERISK:
+ case OP_OPEN_SUBEXP:
+ case OP_CLOSE_SUBEXP:
+ break;
+ case COMPLEX_BRACKET:
+ return;
+ case SIMPLE_BRACKET:
+ /* Just double check. */
+ {
+ int rshift = (ASCII_CHARS % BITSET_WORD_BITS == 0
+ ? 0
+ : BITSET_WORD_BITS - ASCII_CHARS % BITSET_WORD_BITS);
+ for (i = ASCII_CHARS / BITSET_WORD_BITS; i < BITSET_WORDS; ++i)
+ {
+ if (dfa->nodes[node].opr.sbcset[i] >> rshift != 0)
+ return;
+ rshift = 0;
+ }
+ }
+ break;
+ default:
+ abort ();
+ }
+
+ if (mb_chars || has_period)
+ for (node = 0; node < dfa->nodes_len; ++node)
+ {
+ if (dfa->nodes[node].type == CHARACTER
+ && dfa->nodes[node].opr.c >= ASCII_CHARS)
+ dfa->nodes[node].mb_partial = 0;
+ else if (dfa->nodes[node].type == OP_PERIOD)
+ dfa->nodes[node].type = OP_UTF8_PERIOD;
+ }
+
+ /* The search can be in single byte locale. */
+ dfa->mb_cur_max = 1;
+ dfa->is_utf8 = 0;
+ dfa->has_mb_node = dfa->nbackref > 0 || has_period;
+}
+
+/* Analyze the structure tree, and calculate "first", "next", "edest",
+ "eclosure", and "inveclosure". */
+
+static reg_errcode_t
+analyze (regex_t *preg)
+{
+ re_dfa_t *dfa = preg->buffer;
+ reg_errcode_t ret;
+
+ /* Allocate arrays. */
+ dfa->nexts = re_malloc (Idx, dfa->nodes_alloc);
+ dfa->org_indices = re_malloc (Idx, dfa->nodes_alloc);
+ dfa->edests = re_malloc (re_node_set, dfa->nodes_alloc);
+ dfa->eclosures = re_malloc (re_node_set, dfa->nodes_alloc);
+ if (__glibc_unlikely (dfa->nexts == NULL || dfa->org_indices == NULL
+ || dfa->edests == NULL || dfa->eclosures == NULL))
+ return REG_ESPACE;
+
+ dfa->subexp_map = re_malloc (Idx, preg->re_nsub);
+ if (dfa->subexp_map != NULL)
+ {
+ Idx i;
+ for (i = 0; i < preg->re_nsub; i++)
+ dfa->subexp_map[i] = i;
+ preorder (dfa->str_tree, optimize_subexps, dfa);
+ for (i = 0; i < preg->re_nsub; i++)
+ if (dfa->subexp_map[i] != i)
+ break;
+ if (i == preg->re_nsub)
+ {
+ re_free (dfa->subexp_map);
+ dfa->subexp_map = NULL;
+ }
+ }
+
+ ret = postorder (dfa->str_tree, lower_subexps, preg);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ ret = postorder (dfa->str_tree, calc_first, dfa);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ preorder (dfa->str_tree, calc_next, dfa);
+ ret = preorder (dfa->str_tree, link_nfa_nodes, dfa);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ ret = calc_eclosure (dfa);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+
+ /* We only need this during the prune_impossible_nodes pass in regexec.c;
+ skip it if p_i_n will not run, as calc_inveclosure can be quadratic. */
+ if ((!preg->no_sub && preg->re_nsub > 0 && dfa->has_plural_match)
+ || dfa->nbackref)
+ {
+ dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len);
+ if (__glibc_unlikely (dfa->inveclosures == NULL))
+ return REG_ESPACE;
+ ret = calc_inveclosure (dfa);
+ }
+
+ return ret;
+}
+
+/* Our parse trees are very unbalanced, so we cannot use a stack to
+ implement parse tree visits. Instead, we use parent pointers and
+ some hairy code in these two functions. */
+static reg_errcode_t
+postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra)
+{
+ bin_tree_t *node, *prev;
+
+ for (node = root; ; )
+ {
+ /* Descend down the tree, preferably to the left (or to the right
+ if that's the only child). */
+ while (node->left || node->right)
+ if (node->left)
+ node = node->left;
+ else
+ node = node->right;
+
+ do
+ {
+ reg_errcode_t err = fn (extra, node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ if (node->parent == NULL)
+ return REG_NOERROR;
+ prev = node;
+ node = node->parent;
+ }
+ /* Go up while we have a node that is reached from the right. */
+ while (node->right == prev || node->right == NULL);
+ node = node->right;
+ }
+}
+
+static reg_errcode_t
+preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
+ void *extra)
+{
+ bin_tree_t *node;
+
+ for (node = root; ; )
+ {
+ reg_errcode_t err = fn (extra, node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* Go to the left node, or up and to the right. */
+ if (node->left)
+ node = node->left;
+ else
+ {
+ bin_tree_t *prev = NULL;
+ while (node->right == prev || node->right == NULL)
+ {
+ prev = node;
+ node = node->parent;
+ if (!node)
+ return REG_NOERROR;
+ }
+ node = node->right;
+ }
+ }
+}
+
+/* Optimization pass: if a SUBEXP is entirely contained, strip it and tell
+ re_search_internal to map the inner one's opr.idx to this one's. Adjust
+ backreferences as well. Requires a preorder visit. */
+static reg_errcode_t
+optimize_subexps (void *extra, bin_tree_t *node)
+{
+ re_dfa_t *dfa = (re_dfa_t *) extra;
+
+ if (node->token.type == OP_BACK_REF && dfa->subexp_map)
+ {
+ int idx = node->token.opr.idx;
+ node->token.opr.idx = dfa->subexp_map[idx];
+ dfa->used_bkref_map |= 1 << node->token.opr.idx;
+ }
+
+ else if (node->token.type == SUBEXP
+ && node->left && node->left->token.type == SUBEXP)
+ {
+ Idx other_idx = node->left->token.opr.idx;
+
+ node->left = node->left->left;
+ if (node->left)
+ node->left->parent = node;
+
+ dfa->subexp_map[other_idx] = dfa->subexp_map[node->token.opr.idx];
+ if (other_idx < BITSET_WORD_BITS)
+ dfa->used_bkref_map &= ~((bitset_word_t) 1 << other_idx);
+ }
+
+ return REG_NOERROR;
+}
+
+/* Lowering pass: Turn each SUBEXP node into the appropriate concatenation
+ of OP_OPEN_SUBEXP, the body of the SUBEXP (if any) and OP_CLOSE_SUBEXP. */
+static reg_errcode_t
+lower_subexps (void *extra, bin_tree_t *node)
+{
+ regex_t *preg = (regex_t *) extra;
+ reg_errcode_t err = REG_NOERROR;
+
+ if (node->left && node->left->token.type == SUBEXP)
+ {
+ node->left = lower_subexp (&err, preg, node->left);
+ if (node->left)
+ node->left->parent = node;
+ }
+ if (node->right && node->right->token.type == SUBEXP)
+ {
+ node->right = lower_subexp (&err, preg, node->right);
+ if (node->right)
+ node->right->parent = node;
+ }
+
+ return err;
+}
+
+static bin_tree_t *
+lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *body = node->left;
+ bin_tree_t *op, *cls, *tree1, *tree;
+
+ if (preg->no_sub
+ /* We do not optimize empty subexpressions, because otherwise we may
+ have bad CONCAT nodes with NULL children. This is obviously not
+ very common, so we do not lose much. An example that triggers
+ this case is the sed "script" /\(\)/x. */
+ && node->left != NULL
+ && (node->token.opr.idx >= BITSET_WORD_BITS
+ || !(dfa->used_bkref_map
+ & ((bitset_word_t) 1 << node->token.opr.idx))))
+ return node->left;
+
+ /* Convert the SUBEXP node to the concatenation of an
+ OP_OPEN_SUBEXP, the contents, and an OP_CLOSE_SUBEXP. */
+ op = create_tree (dfa, NULL, NULL, OP_OPEN_SUBEXP);
+ cls = create_tree (dfa, NULL, NULL, OP_CLOSE_SUBEXP);
+ tree1 = body ? create_tree (dfa, body, cls, CONCAT) : cls;
+ tree = create_tree (dfa, op, tree1, CONCAT);
+ if (__glibc_unlikely (tree == NULL || tree1 == NULL
+ || op == NULL || cls == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ op->token.opr.idx = cls->token.opr.idx = node->token.opr.idx;
+ op->token.opt_subexp = cls->token.opt_subexp = node->token.opt_subexp;
+ return tree;
+}
+
+/* Pass 1 in building the NFA: compute FIRST and create unlinked automaton
+ nodes. Requires a postorder visit. */
+static reg_errcode_t
+calc_first (void *extra, bin_tree_t *node)
+{
+ re_dfa_t *dfa = (re_dfa_t *) extra;
+ if (node->token.type == CONCAT)
+ {
+ node->first = node->left->first;
+ node->node_idx = node->left->node_idx;
+ }
+ else
+ {
+ node->first = node;
+ node->node_idx = re_dfa_add_node (dfa, node->token);
+ if (__glibc_unlikely (node->node_idx == -1))
+ return REG_ESPACE;
+ if (node->token.type == ANCHOR)
+ dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
+ }
+ return REG_NOERROR;
+}
+
+/* Pass 2: compute NEXT on the tree. Preorder visit. */
+static reg_errcode_t
+calc_next (void *extra, bin_tree_t *node)
+{
+ switch (node->token.type)
+ {
+ case OP_DUP_ASTERISK:
+ node->left->next = node;
+ break;
+ case CONCAT:
+ node->left->next = node->right->first;
+ node->right->next = node->next;
+ break;
+ default:
+ if (node->left)
+ node->left->next = node->next;
+ if (node->right)
+ node->right->next = node->next;
+ break;
+ }
+ return REG_NOERROR;
+}
+
+/* Pass 3: link all DFA nodes to their NEXT node (any order will do). */
+static reg_errcode_t
+link_nfa_nodes (void *extra, bin_tree_t *node)
+{
+ re_dfa_t *dfa = (re_dfa_t *) extra;
+ Idx idx = node->node_idx;
+ reg_errcode_t err = REG_NOERROR;
+
+ switch (node->token.type)
+ {
+ case CONCAT:
+ break;
+
+ case END_OF_RE:
+ DEBUG_ASSERT (node->next == NULL);
+ break;
+
+ case OP_DUP_ASTERISK:
+ case OP_ALT:
+ {
+ Idx left, right;
+ dfa->has_plural_match = 1;
+ if (node->left != NULL)
+ left = node->left->first->node_idx;
+ else
+ left = node->next->node_idx;
+ if (node->right != NULL)
+ right = node->right->first->node_idx;
+ else
+ right = node->next->node_idx;
+ DEBUG_ASSERT (left > -1);
+ DEBUG_ASSERT (right > -1);
+ err = re_node_set_init_2 (dfa->edests + idx, left, right);
+ }
+ break;
+
+ case ANCHOR:
+ case OP_OPEN_SUBEXP:
+ case OP_CLOSE_SUBEXP:
+ err = re_node_set_init_1 (dfa->edests + idx, node->next->node_idx);
+ break;
+
+ case OP_BACK_REF:
+ dfa->nexts[idx] = node->next->node_idx;
+ if (node->token.type == OP_BACK_REF)
+ err = re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]);
+ break;
+
+ default:
+ DEBUG_ASSERT (!IS_EPSILON_NODE (node->token.type));
+ dfa->nexts[idx] = node->next->node_idx;
+ break;
+ }
+
+ return err;
+}
+
+/* Duplicate the epsilon closure of the node ROOT_NODE.
+ Note that duplicated nodes have constraint INIT_CONSTRAINT in addition
+ to their own constraint. */
+
+static reg_errcode_t
+duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
+ Idx root_node, unsigned int init_constraint)
+{
+ Idx org_node, clone_node;
+ bool ok;
+ unsigned int constraint = init_constraint;
+ for (org_node = top_org_node, clone_node = top_clone_node;;)
+ {
+ Idx org_dest, clone_dest;
+ if (dfa->nodes[org_node].type == OP_BACK_REF)
+ {
+ /* If the back reference epsilon-transit, its destination must
+ also have the constraint. Then duplicate the epsilon closure
+ of the destination of the back reference, and store it in
+ edests of the back reference. */
+ org_dest = dfa->nexts[org_node];
+ re_node_set_empty (dfa->edests + clone_node);
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ dfa->nexts[clone_node] = dfa->nexts[org_node];
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ else if (dfa->edests[org_node].nelem == 0)
+ {
+ /* In case of the node can't epsilon-transit, don't duplicate the
+ destination and store the original destination as the
+ destination of the node. */
+ dfa->nexts[clone_node] = dfa->nexts[org_node];
+ break;
+ }
+ else if (dfa->edests[org_node].nelem == 1)
+ {
+ /* In case of the node can epsilon-transit, and it has only one
+ destination. */
+ org_dest = dfa->edests[org_node].elems[0];
+ re_node_set_empty (dfa->edests + clone_node);
+ /* If the node is root_node itself, it means the epsilon closure
+ has a loop. Then tie it to the destination of the root_node. */
+ if (org_node == root_node && clone_node != org_node)
+ {
+ ok = re_node_set_insert (dfa->edests + clone_node, org_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ break;
+ }
+ /* In case the node has another constraint, append it. */
+ constraint |= dfa->nodes[org_node].constraint;
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ else /* dfa->edests[org_node].nelem == 2 */
+ {
+ /* In case of the node can epsilon-transit, and it has two
+ destinations. In the bin_tree_t and DFA, that's '|' and '*'. */
+ org_dest = dfa->edests[org_node].elems[0];
+ re_node_set_empty (dfa->edests + clone_node);
+ /* Search for a duplicated node which satisfies the constraint. */
+ clone_dest = search_duplicated_node (dfa, org_dest, constraint);
+ if (clone_dest == -1)
+ {
+ /* There is no such duplicated node, create a new one. */
+ reg_errcode_t err;
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ err = duplicate_node_closure (dfa, org_dest, clone_dest,
+ root_node, constraint);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ else
+ {
+ /* There is a duplicated node which satisfies the constraint,
+ use it to avoid infinite loop. */
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+
+ org_dest = dfa->edests[org_node].elems[1];
+ clone_dest = duplicate_node (dfa, org_dest, constraint);
+ if (__glibc_unlikely (clone_dest == -1))
+ return REG_ESPACE;
+ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ org_node = org_dest;
+ clone_node = clone_dest;
+ }
+ return REG_NOERROR;
+}
+
+/* Search for a node which is duplicated from the node ORG_NODE, and
+ satisfies the constraint CONSTRAINT. */
+
+static Idx
+search_duplicated_node (const re_dfa_t *dfa, Idx org_node,
+ unsigned int constraint)
+{
+ Idx idx;
+ for (idx = dfa->nodes_len - 1; dfa->nodes[idx].duplicated && idx > 0; --idx)
+ {
+ if (org_node == dfa->org_indices[idx]
+ && constraint == dfa->nodes[idx].constraint)
+ return idx; /* Found. */
+ }
+ return -1; /* Not found. */
+}
+
+/* Duplicate the node whose index is ORG_IDX and set the constraint CONSTRAINT.
+ Return the index of the new node, or -1 if insufficient storage is
+ available. */
+
+static Idx
+duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint)
+{
+ Idx dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx]);
+ if (__glibc_likely (dup_idx != -1))
+ {
+ dfa->nodes[dup_idx].constraint = constraint;
+ dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint;
+ dfa->nodes[dup_idx].duplicated = 1;
+
+ /* Store the index of the original node. */
+ dfa->org_indices[dup_idx] = org_idx;
+ }
+ return dup_idx;
+}
+
+static reg_errcode_t
+calc_inveclosure (re_dfa_t *dfa)
+{
+ Idx src, idx;
+ bool ok;
+ for (idx = 0; idx < dfa->nodes_len; ++idx)
+ re_node_set_init_empty (dfa->inveclosures + idx);
+
+ for (src = 0; src < dfa->nodes_len; ++src)
+ {
+ Idx *elems = dfa->eclosures[src].elems;
+ for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx)
+ {
+ ok = re_node_set_insert_last (dfa->inveclosures + elems[idx], src);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ }
+
+ return REG_NOERROR;
+}
+
+/* Calculate "eclosure" for all the node in DFA. */
+
+static reg_errcode_t
+calc_eclosure (re_dfa_t *dfa)
+{
+ Idx node_idx;
+ bool incomplete;
+ DEBUG_ASSERT (dfa->nodes_len > 0);
+ incomplete = false;
+ /* For each nodes, calculate epsilon closure. */
+ for (node_idx = 0; ; ++node_idx)
+ {
+ reg_errcode_t err;
+ re_node_set eclosure_elem;
+ if (node_idx == dfa->nodes_len)
+ {
+ if (!incomplete)
+ break;
+ incomplete = false;
+ node_idx = 0;
+ }
+
+ DEBUG_ASSERT (dfa->eclosures[node_idx].nelem != -1);
+
+ /* If we have already calculated, skip it. */
+ if (dfa->eclosures[node_idx].nelem != 0)
+ continue;
+ /* Calculate epsilon closure of 'node_idx'. */
+ err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ if (dfa->eclosures[node_idx].nelem == 0)
+ {
+ incomplete = true;
+ re_node_set_free (&eclosure_elem);
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Calculate epsilon closure of NODE. */
+
+static reg_errcode_t
+calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
+{
+ reg_errcode_t err;
+ Idx i;
+ re_node_set eclosure;
+ bool incomplete = false;
+ err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* An epsilon closure includes itself. */
+ eclosure.elems[eclosure.nelem++] = node;
+
+ /* This indicates that we are calculating this node now.
+ We reference this value to avoid infinite loop. */
+ dfa->eclosures[node].nelem = -1;
+
+ /* If the current node has constraints, duplicate all nodes
+ since they must inherit the constraints. */
+ if (dfa->nodes[node].constraint
+ && dfa->edests[node].nelem
+ && !dfa->nodes[dfa->edests[node].elems[0]].duplicated)
+ {
+ err = duplicate_node_closure (dfa, node, node, node,
+ dfa->nodes[node].constraint);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ /* Expand each epsilon destination nodes. */
+ if (IS_EPSILON_NODE(dfa->nodes[node].type))
+ for (i = 0; i < dfa->edests[node].nelem; ++i)
+ {
+ re_node_set eclosure_elem;
+ Idx edest = dfa->edests[node].elems[i];
+ /* If calculating the epsilon closure of 'edest' is in progress,
+ return intermediate result. */
+ if (dfa->eclosures[edest].nelem == -1)
+ {
+ incomplete = true;
+ continue;
+ }
+ /* If we haven't calculated the epsilon closure of 'edest' yet,
+ calculate now. Otherwise use calculated epsilon closure. */
+ if (dfa->eclosures[edest].nelem == 0)
+ {
+ err = calc_eclosure_iter (&eclosure_elem, dfa, edest, false);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ else
+ eclosure_elem = dfa->eclosures[edest];
+ /* Merge the epsilon closure of 'edest'. */
+ err = re_node_set_merge (&eclosure, &eclosure_elem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ /* If the epsilon closure of 'edest' is incomplete,
+ the epsilon closure of this node is also incomplete. */
+ if (dfa->eclosures[edest].nelem == 0)
+ {
+ incomplete = true;
+ re_node_set_free (&eclosure_elem);
+ }
+ }
+
+ if (incomplete && !root)
+ dfa->eclosures[node].nelem = 0;
+ else
+ dfa->eclosures[node] = eclosure;
+ *new_set = eclosure;
+ return REG_NOERROR;
+}
+
+/* Functions for token which are used in the parser. */
+
+/* Fetch a token from INPUT.
+ We must not use this function inside bracket expressions. */
+
+static void
+fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax)
+{
+ re_string_skip_bytes (input, peek_token (result, input, syntax));
+}
+
+/* Peek a token from INPUT, and return the length of the token.
+ We must not use this function inside bracket expressions. */
+
+static int
+peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+{
+ unsigned char c;
+
+ if (re_string_eoi (input))
+ {
+ token->type = END_OF_RE;
+ return 0;
+ }
+
+ c = re_string_peek_byte (input, 0);
+ token->opr.c = c;
+
+ token->word_char = 0;
+ token->mb_partial = 0;
+ if (input->mb_cur_max > 1
+ && !re_string_first_byte (input, re_string_cur_idx (input)))
+ {
+ token->type = CHARACTER;
+ token->mb_partial = 1;
+ return 1;
+ }
+ if (c == '\\')
+ {
+ unsigned char c2;
+ if (re_string_cur_idx (input) + 1 >= re_string_length (input))
+ {
+ token->type = BACK_SLASH;
+ return 1;
+ }
+
+ c2 = re_string_peek_byte_case (input, 1);
+ token->opr.c = c2;
+ token->type = CHARACTER;
+ if (input->mb_cur_max > 1)
+ {
+ wint_t wc = re_string_wchar_at (input,
+ re_string_cur_idx (input) + 1);
+ token->word_char = IS_WIDE_WORD_CHAR (wc) != 0;
+ }
+ else
+ token->word_char = IS_WORD_CHAR (c2) != 0;
+
+ switch (c2)
+ {
+ case '|':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_NO_BK_VBAR))
+ token->type = OP_ALT;
+ break;
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ if (!(syntax & RE_NO_BK_REFS))
+ {
+ token->type = OP_BACK_REF;
+ token->opr.idx = c2 - '1';
+ }
+ break;
+ case '<':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = WORD_FIRST;
+ }
+ break;
+ case '>':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = WORD_LAST;
+ }
+ break;
+ case 'b':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = WORD_DELIM;
+ }
+ break;
+ case 'B':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = NOT_WORD_DELIM;
+ }
+ break;
+ case 'w':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_WORD;
+ break;
+ case 'W':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_NOTWORD;
+ break;
+ case 's':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_SPACE;
+ break;
+ case 'S':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_NOTSPACE;
+ break;
+ case '`':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = BUF_FIRST;
+ }
+ break;
+ case '\'':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.ctx_type = BUF_LAST;
+ }
+ break;
+ case '(':
+ if (!(syntax & RE_NO_BK_PARENS))
+ token->type = OP_OPEN_SUBEXP;
+ break;
+ case ')':
+ if (!(syntax & RE_NO_BK_PARENS))
+ token->type = OP_CLOSE_SUBEXP;
+ break;
+ case '+':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_PLUS;
+ break;
+ case '?':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_QUESTION;
+ break;
+ case '{':
+ if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES)))
+ token->type = OP_OPEN_DUP_NUM;
+ break;
+ case '}':
+ if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES)))
+ token->type = OP_CLOSE_DUP_NUM;
+ break;
+ default:
+ break;
+ }
+ return 2;
+ }
+
+ token->type = CHARACTER;
+ if (input->mb_cur_max > 1)
+ {
+ wint_t wc = re_string_wchar_at (input, re_string_cur_idx (input));
+ token->word_char = IS_WIDE_WORD_CHAR (wc) != 0;
+ }
+ else
+ token->word_char = IS_WORD_CHAR (token->opr.c);
+
+ switch (c)
+ {
+ case '\n':
+ if (syntax & RE_NEWLINE_ALT)
+ token->type = OP_ALT;
+ break;
+ case '|':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_NO_BK_VBAR))
+ token->type = OP_ALT;
+ break;
+ case '*':
+ token->type = OP_DUP_ASTERISK;
+ break;
+ case '+':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_PLUS;
+ break;
+ case '?':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_QUESTION;
+ break;
+ case '{':
+ if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ token->type = OP_OPEN_DUP_NUM;
+ break;
+ case '}':
+ if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ token->type = OP_CLOSE_DUP_NUM;
+ break;
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ token->type = OP_OPEN_SUBEXP;
+ break;
+ case ')':
+ if (syntax & RE_NO_BK_PARENS)
+ token->type = OP_CLOSE_SUBEXP;
+ break;
+ case '[':
+ token->type = OP_OPEN_BRACKET;
+ break;
+ case '.':
+ token->type = OP_PERIOD;
+ break;
+ case '^':
+ if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE))
+ && re_string_cur_idx (input) != 0)
+ {
+ char prev = re_string_peek_byte (input, -1);
+ if (!(syntax & RE_NEWLINE_ALT) || prev != '\n')
+ break;
+ }
+ token->type = ANCHOR;
+ token->opr.ctx_type = LINE_FIRST;
+ break;
+ case '$':
+ if (!(syntax & RE_CONTEXT_INDEP_ANCHORS)
+ && re_string_cur_idx (input) + 1 != re_string_length (input))
+ {
+ re_token_t next;
+ re_string_skip_bytes (input, 1);
+ peek_token (&next, input, syntax);
+ re_string_skip_bytes (input, -1);
+ if (next.type != OP_ALT && next.type != OP_CLOSE_SUBEXP)
+ break;
+ }
+ token->type = ANCHOR;
+ token->opr.ctx_type = LINE_LAST;
+ break;
+ default:
+ break;
+ }
+ return 1;
+}
+
+/* Peek a token from INPUT, and return the length of the token.
+ We must not use this function out of bracket expressions. */
+
+static int
+peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+{
+ unsigned char c;
+ if (re_string_eoi (input))
+ {
+ token->type = END_OF_RE;
+ return 0;
+ }
+ c = re_string_peek_byte (input, 0);
+ token->opr.c = c;
+
+ if (input->mb_cur_max > 1
+ && !re_string_first_byte (input, re_string_cur_idx (input)))
+ {
+ token->type = CHARACTER;
+ return 1;
+ }
+
+ if (c == '\\' && (syntax & RE_BACKSLASH_ESCAPE_IN_LISTS)
+ && re_string_cur_idx (input) + 1 < re_string_length (input))
+ {
+ /* In this case, '\' escape a character. */
+ unsigned char c2;
+ re_string_skip_bytes (input, 1);
+ c2 = re_string_peek_byte (input, 0);
+ token->opr.c = c2;
+ token->type = CHARACTER;
+ return 1;
+ }
+ if (c == '[') /* '[' is a special char in a bracket exps. */
+ {
+ unsigned char c2;
+ int token_len;
+ if (re_string_cur_idx (input) + 1 < re_string_length (input))
+ c2 = re_string_peek_byte (input, 1);
+ else
+ c2 = 0;
+ token->opr.c = c2;
+ token_len = 2;
+ switch (c2)
+ {
+ case '.':
+ token->type = OP_OPEN_COLL_ELEM;
+ break;
+
+ case '=':
+ token->type = OP_OPEN_EQUIV_CLASS;
+ break;
+
+ case ':':
+ if (syntax & RE_CHAR_CLASSES)
+ {
+ token->type = OP_OPEN_CHAR_CLASS;
+ break;
+ }
+ FALLTHROUGH;
+ default:
+ token->type = CHARACTER;
+ token->opr.c = c;
+ token_len = 1;
+ break;
+ }
+ return token_len;
+ }
+ switch (c)
+ {
+ case ']':
+ token->type = OP_CLOSE_BRACKET;
+ break;
+ case '^':
+ token->type = OP_NON_MATCH_LIST;
+ break;
+ case '-':
+ /* In V7 Unix grep and Unix awk and mawk, [...---...]
+ (3 adjacent minus signs) stands for a single minus sign.
+ Support that without breaking anything else. */
+ if (! (re_string_cur_idx (input) + 2 < re_string_length (input)
+ && re_string_peek_byte (input, 1) == '-'
+ && re_string_peek_byte (input, 2) == '-'))
+ {
+ token->type = OP_CHARSET_RANGE;
+ break;
+ }
+ re_string_skip_bytes (input, 2);
+ FALLTHROUGH;
+ default:
+ token->type = CHARACTER;
+ }
+ return 1;
+}
+
+/* Functions for parser. */
+
+/* Entry point of the parser.
+ Parse the regular expression REGEXP and return the structure tree.
+ If an error occurs, ERR is set by error code, and return NULL.
+ This function build the following tree, from regular expression <reg_exp>:
+ CAT
+ / \
+ / \
+ <reg_exp> EOR
+
+ CAT means concatenation.
+ EOR means end of regular expression. */
+
+static bin_tree_t *
+parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax,
+ reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree, *eor, *root;
+ re_token_t current_token;
+ dfa->syntax = syntax;
+ fetch_token (&current_token, regexp, syntax | RE_CARET_ANCHORS_HERE);
+ tree = parse_reg_exp (regexp, preg, &current_token, syntax, 0, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ eor = create_tree (dfa, NULL, NULL, END_OF_RE);
+ if (tree != NULL)
+ root = create_tree (dfa, tree, eor, CONCAT);
+ else
+ root = eor;
+ if (__glibc_unlikely (eor == NULL || root == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ return root;
+}
+
+/* This function build the following tree, from regular expression
+ <branch1>|<branch2>:
+ ALT
+ / \
+ / \
+ <branch1> <branch2>
+
+ ALT means alternative, which represents the operator '|'. */
+
+static bin_tree_t *
+parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree, *branch = NULL;
+ bitset_word_t initial_bkref_map = dfa->completed_bkref_map;
+ tree = parse_branch (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+
+ while (token->type == OP_ALT)
+ {
+ fetch_token (token, regexp, syntax | RE_CARET_ANCHORS_HERE);
+ if (token->type != OP_ALT && token->type != END_OF_RE
+ && (nest == 0 || token->type != OP_CLOSE_SUBEXP))
+ {
+ bitset_word_t accumulated_bkref_map = dfa->completed_bkref_map;
+ dfa->completed_bkref_map = initial_bkref_map;
+ branch = parse_branch (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && branch == NULL))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ return NULL;
+ }
+ dfa->completed_bkref_map |= accumulated_bkref_map;
+ }
+ else
+ branch = NULL;
+ tree = create_tree (dfa, tree, branch, OP_ALT);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ return tree;
+}
+
+/* This function build the following tree, from regular expression
+ <exp1><exp2>:
+ CAT
+ / \
+ / \
+ <exp1> <exp2>
+
+ CAT means concatenation. */
+
+static bin_tree_t *
+parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ bin_tree_t *tree, *expr;
+ re_dfa_t *dfa = preg->buffer;
+ tree = parse_expression (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+
+ while (token->type != OP_ALT && token->type != END_OF_RE
+ && (nest == 0 || token->type != OP_CLOSE_SUBEXP))
+ {
+ expr = parse_expression (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && expr == NULL))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ return NULL;
+ }
+ if (tree != NULL && expr != NULL)
+ {
+ bin_tree_t *newtree = create_tree (dfa, tree, expr, CONCAT);
+ if (newtree == NULL)
+ {
+ postorder (expr, free_tree, NULL);
+ postorder (tree, free_tree, NULL);
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ tree = newtree;
+ }
+ else if (tree == NULL)
+ tree = expr;
+ /* Otherwise expr == NULL, we don't need to create new tree. */
+ }
+ return tree;
+}
+
+/* This function build the following tree, from regular expression a*:
+ *
+ |
+ a
+*/
+
+static bin_tree_t *
+parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree;
+ switch (token->type)
+ {
+ case CHARACTER:
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ if (dfa->mb_cur_max > 1)
+ {
+ while (!re_string_eoi (regexp)
+ && !re_string_first_byte (regexp, re_string_cur_idx (regexp)))
+ {
+ bin_tree_t *mbc_remain;
+ fetch_token (token, regexp, syntax);
+ mbc_remain = create_token_tree (dfa, NULL, NULL, token);
+ tree = create_tree (dfa, tree, mbc_remain, CONCAT);
+ if (__glibc_unlikely (mbc_remain == NULL || tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ }
+ break;
+
+ case OP_OPEN_SUBEXP:
+ tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_OPEN_BRACKET:
+ tree = parse_bracket_exp (regexp, dfa, token, syntax, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_BACK_REF:
+ if (!__glibc_likely (dfa->completed_bkref_map & (1 << token->opr.idx)))
+ {
+ *err = REG_ESUBREG;
+ return NULL;
+ }
+ dfa->used_bkref_map |= 1 << token->opr.idx;
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ ++dfa->nbackref;
+ dfa->has_mb_node = 1;
+ break;
+
+ case OP_OPEN_DUP_NUM:
+ if (syntax & RE_CONTEXT_INVALID_DUP)
+ {
+ *err = REG_BADRPT;
+ return NULL;
+ }
+ FALLTHROUGH;
+ case OP_DUP_ASTERISK:
+ case OP_DUP_PLUS:
+ case OP_DUP_QUESTION:
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ {
+ *err = REG_BADRPT;
+ return NULL;
+ }
+ else if (syntax & RE_CONTEXT_INDEP_OPS)
+ {
+ fetch_token (token, regexp, syntax);
+ return parse_expression (regexp, preg, token, syntax, nest, err);
+ }
+ FALLTHROUGH;
+ case OP_CLOSE_SUBEXP:
+ if ((token->type == OP_CLOSE_SUBEXP)
+ && !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
+ {
+ *err = REG_ERPAREN;
+ return NULL;
+ }
+ FALLTHROUGH;
+ case OP_CLOSE_DUP_NUM:
+ /* We treat it as a normal character. */
+
+ /* Then we can these characters as normal characters. */
+ token->type = CHARACTER;
+ /* mb_partial and word_char bits should be initialized already
+ by peek_token. */
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ break;
+
+ case ANCHOR:
+ if ((token->opr.ctx_type
+ & (WORD_DELIM | NOT_WORD_DELIM | WORD_FIRST | WORD_LAST))
+ && dfa->word_ops_used == 0)
+ init_word_char (dfa);
+ if (token->opr.ctx_type == WORD_DELIM
+ || token->opr.ctx_type == NOT_WORD_DELIM)
+ {
+ bin_tree_t *tree_first, *tree_last;
+ if (token->opr.ctx_type == WORD_DELIM)
+ {
+ token->opr.ctx_type = WORD_FIRST;
+ tree_first = create_token_tree (dfa, NULL, NULL, token);
+ token->opr.ctx_type = WORD_LAST;
+ }
+ else
+ {
+ token->opr.ctx_type = INSIDE_WORD;
+ tree_first = create_token_tree (dfa, NULL, NULL, token);
+ token->opr.ctx_type = INSIDE_NOTWORD;
+ }
+ tree_last = create_token_tree (dfa, NULL, NULL, token);
+ tree = create_tree (dfa, tree_first, tree_last, OP_ALT);
+ if (__glibc_unlikely (tree_first == NULL || tree_last == NULL
+ || tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ else
+ {
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ /* We must return here, since ANCHORs can't be followed
+ by repetition operators.
+ eg. RE"^*" is invalid or "<ANCHOR(^)><CHAR(*)>",
+ it must not be "<ANCHOR(^)><REPEAT(*)>". */
+ fetch_token (token, regexp, syntax);
+ return tree;
+
+ case OP_PERIOD:
+ tree = create_token_tree (dfa, NULL, NULL, token);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ if (dfa->mb_cur_max > 1)
+ dfa->has_mb_node = 1;
+ break;
+
+ case OP_WORD:
+ case OP_NOTWORD:
+ tree = build_charclass_op (dfa, regexp->trans,
+ "alnum",
+ "_",
+ token->type == OP_NOTWORD, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_SPACE:
+ case OP_NOTSPACE:
+ tree = build_charclass_op (dfa, regexp->trans,
+ "space",
+ "",
+ token->type == OP_NOTSPACE, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
+ return NULL;
+ break;
+
+ case OP_ALT:
+ case END_OF_RE:
+ return NULL;
+
+ case BACK_SLASH:
+ *err = REG_EESCAPE;
+ return NULL;
+
+ default:
+ /* Must not happen? */
+ DEBUG_ASSERT (false);
+ return NULL;
+ }
+ fetch_token (token, regexp, syntax);
+
+ while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS
+ || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM)
+ {
+ bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token,
+ syntax, err);
+ if (__glibc_unlikely (*err != REG_NOERROR && dup_tree == NULL))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ return NULL;
+ }
+ tree = dup_tree;
+ /* In BRE consecutive duplications are not allowed. */
+ if ((syntax & RE_CONTEXT_INVALID_DUP)
+ && (token->type == OP_DUP_ASTERISK
+ || token->type == OP_OPEN_DUP_NUM))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ *err = REG_BADRPT;
+ return NULL;
+ }
+ }
+
+ return tree;
+}
+
+/* This function build the following tree, from regular expression
+ (<reg_exp>):
+ SUBEXP
+ |
+ <reg_exp>
+*/
+
+static bin_tree_t *
+parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ reg_syntax_t syntax, Idx nest, reg_errcode_t *err)
+{
+ re_dfa_t *dfa = preg->buffer;
+ bin_tree_t *tree;
+ size_t cur_nsub;
+ cur_nsub = preg->re_nsub++;
+
+ fetch_token (token, regexp, syntax | RE_CARET_ANCHORS_HERE);
+
+ /* The subexpression may be a null string. */
+ if (token->type == OP_CLOSE_SUBEXP)
+ tree = NULL;
+ else
+ {
+ tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
+ if (__glibc_unlikely (*err == REG_NOERROR
+ && token->type != OP_CLOSE_SUBEXP))
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ *err = REG_EPAREN;
+ }
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ }
+
+ if (cur_nsub <= '9' - '1')
+ dfa->completed_bkref_map |= 1 << cur_nsub;
+
+ tree = create_tree (dfa, tree, NULL, SUBEXP);
+ if (__glibc_unlikely (tree == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ tree->token.opr.idx = cur_nsub;
+ return tree;
+}
+
+/* This function parse repetition operators like "*", "+", "{1,3}" etc. */
+
+static bin_tree_t *
+parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
+ re_token_t *token, reg_syntax_t syntax, reg_errcode_t *err)
+{
+ bin_tree_t *tree = NULL, *old_tree = NULL;
+ Idx i, start, end, start_idx = re_string_cur_idx (regexp);
+ re_token_t start_token = *token;
+
+ if (token->type == OP_OPEN_DUP_NUM)
+ {
+ end = 0;
+ start = fetch_number (regexp, token, syntax);
+ if (start == -1)
+ {
+ if (token->type == CHARACTER && token->opr.c == ',')
+ start = 0; /* We treat "{,m}" as "{0,m}". */
+ else
+ {
+ *err = REG_BADBR; /* <re>{} is invalid. */
+ return NULL;
+ }
+ }
+ if (__glibc_likely (start != -2))
+ {
+ /* We treat "{n}" as "{n,n}". */
+ end = ((token->type == OP_CLOSE_DUP_NUM) ? start
+ : ((token->type == CHARACTER && token->opr.c == ',')
+ ? fetch_number (regexp, token, syntax) : -2));
+ }
+ if (__glibc_unlikely (start == -2 || end == -2))
+ {
+ /* Invalid sequence. */
+ if (__glibc_unlikely (!(syntax & RE_INVALID_INTERVAL_ORD)))
+ {
+ if (token->type == END_OF_RE)
+ *err = REG_EBRACE;
+ else
+ *err = REG_BADBR;
+
+ return NULL;
+ }
+
+ /* If the syntax bit is set, rollback. */
+ re_string_set_index (regexp, start_idx);
+ *token = start_token;
+ token->type = CHARACTER;
+ /* mb_partial and word_char bits should be already initialized by
+ peek_token. */
+ return elem;
+ }
+
+ if (__glibc_unlikely ((end != -1 && start > end)
+ || token->type != OP_CLOSE_DUP_NUM))
+ {
+ /* First number greater than second. */
+ *err = REG_BADBR;
+ return NULL;
+ }
+
+ if (__glibc_unlikely (RE_DUP_MAX < (end == -1 ? start : end)))
+ {
+ *err = REG_ESIZE;
+ return NULL;
+ }
+ }
+ else
+ {
+ start = (token->type == OP_DUP_PLUS) ? 1 : 0;
+ end = (token->type == OP_DUP_QUESTION) ? 1 : -1;
+ }
+
+ fetch_token (token, regexp, syntax);
+
+ if (__glibc_unlikely (elem == NULL))
+ return NULL;
+ if (__glibc_unlikely (start == 0 && end == 0))
+ {
+ postorder (elem, free_tree, NULL);
+ return NULL;
+ }
+
+ /* Extract "<re>{n,m}" to "<re><re>...<re><re>{0,<m-n>}". */
+ if (__glibc_unlikely (start > 0))
+ {
+ tree = elem;
+ for (i = 2; i <= start; ++i)
+ {
+ elem = duplicate_tree (elem, dfa);
+ tree = create_tree (dfa, tree, elem, CONCAT);
+ if (__glibc_unlikely (elem == NULL || tree == NULL))
+ goto parse_dup_op_espace;
+ }
+
+ if (start == end)
+ return tree;
+
+ /* Duplicate ELEM before it is marked optional. */
+ elem = duplicate_tree (elem, dfa);
+ if (__glibc_unlikely (elem == NULL))
+ goto parse_dup_op_espace;
+ old_tree = tree;
+ }
+ else
+ old_tree = NULL;
+
+ if (elem->token.type == SUBEXP)
+ {
+ uintptr_t subidx = elem->token.opr.idx;
+ postorder (elem, mark_opt_subexp, (void *) subidx);
+ }
+
+ tree = create_tree (dfa, elem, NULL,
+ (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
+ if (__glibc_unlikely (tree == NULL))
+ goto parse_dup_op_espace;
+
+ /* This loop is actually executed only when end != -1,
+ to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?... We have
+ already created the start+1-th copy. */
+ if (TYPE_SIGNED (Idx) || end != -1)
+ for (i = start + 2; i <= end; ++i)
+ {
+ elem = duplicate_tree (elem, dfa);
+ tree = create_tree (dfa, tree, elem, CONCAT);
+ if (__glibc_unlikely (elem == NULL || tree == NULL))
+ goto parse_dup_op_espace;
+
+ tree = create_tree (dfa, tree, NULL, OP_ALT);
+ if (__glibc_unlikely (tree == NULL))
+ goto parse_dup_op_espace;
+ }
+
+ if (old_tree)
+ tree = create_tree (dfa, old_tree, tree, CONCAT);
+
+ return tree;
+
+ parse_dup_op_espace:
+ *err = REG_ESPACE;
+ return NULL;
+}
+
+/* Size of the names for collating symbol/equivalence_class/character_class.
+ I'm not sure, but maybe enough. */
+#define BRACKET_NAME_BUF_SIZE 32
+
+#ifndef _LIBC
+
+/* Convert the byte B to the corresponding wide character. In a
+ unibyte locale, treat B as itself. In a multibyte locale, return
+ WEOF if B is an encoding error. */
+static wint_t
+parse_byte (unsigned char b, re_dfa_t const *dfa)
+{
+ return dfa->mb_cur_max > 1 ? __btowc (b) : b;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Build the range expression which starts from START_ELEM, and ends
+ at END_ELEM. The result are written to MBCSET and SBCSET.
+ RANGE_ALLOC is the allocated size of mbcset->range_starts, and
+ mbcset->range_ends, is a pointer argument since we may
+ update it. */
+
+static reg_errcode_t
+build_range_exp (bitset_t sbcset, re_charset_t *mbcset, Idx *range_alloc,
+ bracket_elem_t *start_elem, bracket_elem_t *end_elem,
+ re_dfa_t *dfa, reg_syntax_t syntax, uint_fast32_t nrules,
+ const unsigned char *collseqmb, const char *collseqwc,
+ int_fast32_t table_size, const void *symb_table,
+ const unsigned char *extra)
+{
+ /* Equivalence Classes and Character Classes can't be a range start/end. */
+ if (__glibc_unlikely (start_elem->type == EQUIV_CLASS
+ || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS
+ || end_elem->type == CHAR_CLASS))
+ return REG_ERANGE;
+
+ /* We can handle no multi character collating elements without libc
+ support. */
+ if (__glibc_unlikely ((start_elem->type == COLL_SYM
+ && strlen ((char *) start_elem->opr.name) > 1)
+ || (end_elem->type == COLL_SYM
+ && strlen ((char *) end_elem->opr.name) > 1)))
+ return REG_ECOLLATE;
+
+ unsigned int
+ start_ch = ((start_elem->type == SB_CHAR) ? start_elem->opr.ch
+ : ((start_elem->type == COLL_SYM) ? start_elem->opr.name[0]
+ : 0)),
+ end_ch = ((end_elem->type == SB_CHAR) ? end_elem->opr.ch
+ : ((end_elem->type == COLL_SYM) ? end_elem->opr.name[0]
+ : 0));
+ wint_t
+ start_wc = ((start_elem->type == SB_CHAR || start_elem->type == COLL_SYM)
+ ? parse_byte (start_ch, dfa) : start_elem->opr.wch),
+ end_wc = ((end_elem->type == SB_CHAR || end_elem->type == COLL_SYM)
+ ? parse_byte (end_ch, dfa) : end_elem->opr.wch);
+
+ if (start_wc == WEOF || end_wc == WEOF)
+ return REG_ECOLLATE;
+ else if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES)
+ && start_wc > end_wc))
+ return REG_ERANGE;
+
+ /* Got valid collation sequence values, add them as a new entry.
+ However, for !_LIBC we have no collation elements: if the
+ character set is single byte, the single byte character set
+ that we build below suffices. parse_bracket_exp passes
+ no MBCSET if dfa->mb_cur_max == 1. */
+ if (dfa->mb_cur_max > 1)
+ {
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*range_alloc == mbcset->nranges))
+ {
+ /* There is not enough space, need realloc. */
+ wchar_t *new_array_start, *new_array_end;
+ Idx new_nranges;
+
+ /* +1 in case of mbcset->nranges is 0. */
+ new_nranges = 2 * mbcset->nranges + 1;
+ /* Use realloc since mbcset->range_starts and mbcset->range_ends
+ are NULL if *range_alloc == 0. */
+ new_array_start = re_realloc (mbcset->range_starts, wchar_t,
+ new_nranges);
+ new_array_end = re_realloc (mbcset->range_ends, wchar_t,
+ new_nranges);
+
+ if (__glibc_unlikely (new_array_start == NULL
+ || new_array_end == NULL))
+ {
+ re_free (new_array_start);
+ re_free (new_array_end);
+ return REG_ESPACE;
+ }
+
+ mbcset->range_starts = new_array_start;
+ mbcset->range_ends = new_array_end;
+ *range_alloc = new_nranges;
+ }
+
+ mbcset->range_starts[mbcset->nranges] = start_wc;
+ mbcset->range_ends[mbcset->nranges++] = end_wc;
+ }
+
+ /* Build the table for single byte characters. */
+ for (wchar_t wc = 0; wc < SBC_MAX; ++wc)
+ {
+ if (start_wc <= wc && wc <= end_wc)
+ bitset_set (sbcset, wc);
+ }
+
+ return REG_NOERROR;
+}
+#endif /* not _LIBC */
+
+#ifndef _LIBC
+/* Helper function for parse_bracket_exp only used in case of NOT _LIBC.
+ Build the collating element which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
+ pointer argument since we may update it. */
+
+static reg_errcode_t
+build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *coll_sym_alloc, const unsigned char *name,
+ uint_fast32_t nrules, int_fast32_t table_size,
+ const void *symb_table, const unsigned char *extra)
+{
+ size_t name_len = strlen ((const char *) name);
+ if (__glibc_unlikely (name_len != 1))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+}
+#endif /* not _LIBC */
+
+#ifdef _LIBC
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Seek the collating symbol entry corresponding to NAME.
+ Return the index of the symbol in the SYMB_TABLE,
+ or -1 if not found. */
+
+static __always_inline int32_t
+seek_collating_symbol_entry (const unsigned char *name, size_t name_len,
+ const int32_t *symb_table,
+ int_fast32_t table_size,
+ const unsigned char *extra)
+{
+ int_fast32_t elem;
+
+ for (elem = 0; elem < table_size; elem++)
+ if (symb_table[2 * elem] != 0)
+ {
+ int32_t idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ if (/* Compare the length of the name. */
+ name_len == extra[idx]
+ /* Compare the name. */
+ && memcmp (name, &extra[idx + 1], name_len) == 0)
+ /* Yep, this is the entry. */
+ return elem;
+ }
+ return -1;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Look up the collation sequence value of BR_ELEM.
+ Return the value if succeeded, UINT_MAX otherwise. */
+
+static __always_inline unsigned int
+lookup_collation_sequence_value (bracket_elem_t *br_elem, uint32_t nrules,
+ const unsigned char *collseqmb,
+ const char *collseqwc,
+ int_fast32_t table_size,
+ const int32_t *symb_table,
+ const unsigned char *extra)
+{
+ if (br_elem->type == SB_CHAR)
+ {
+ /* if (MB_CUR_MAX == 1) */
+ if (nrules == 0)
+ return collseqmb[br_elem->opr.ch];
+ else
+ {
+ wint_t wc = __btowc (br_elem->opr.ch);
+ return __collseq_table_lookup (collseqwc, wc);
+ }
+ }
+ else if (br_elem->type == MB_CHAR)
+ {
+ if (nrules != 0)
+ return __collseq_table_lookup (collseqwc, br_elem->opr.wch);
+ }
+ else if (br_elem->type == COLL_SYM)
+ {
+ size_t sym_name_len = strlen ((char *) br_elem->opr.name);
+ if (nrules != 0)
+ {
+ int32_t elem, idx;
+ elem = seek_collating_symbol_entry (br_elem->opr.name,
+ sym_name_len,
+ symb_table, table_size,
+ extra);
+ if (elem != -1)
+ {
+ /* We found the entry. */
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ /* Skip the byte sequence of the collating element. */
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ /* Skip the multibyte collation sequence value. */
+ idx += sizeof (unsigned int);
+ /* Skip the wide char sequence of the collating element. */
+ idx += sizeof (unsigned int) *
+ (1 + *(unsigned int *) (extra + idx));
+ /* Return the collation sequence value. */
+ return *(unsigned int *) (extra + idx);
+ }
+ else if (sym_name_len == 1)
+ {
+ /* No valid character. Match it as a single byte
+ character. */
+ return collseqmb[br_elem->opr.name[0]];
+ }
+ }
+ else if (sym_name_len == 1)
+ return collseqmb[br_elem->opr.name[0]];
+ }
+ return UINT_MAX;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Build the range expression which starts from START_ELEM, and ends
+ at END_ELEM. The result are written to MBCSET and SBCSET.
+ RANGE_ALLOC is the allocated size of mbcset->range_starts, and
+ mbcset->range_ends, is a pointer argument since we may
+ update it. */
+
+static __always_inline reg_errcode_t
+build_range_exp (bitset_t sbcset, re_charset_t *mbcset, Idx *range_alloc,
+ bracket_elem_t *start_elem, bracket_elem_t *end_elem,
+ re_dfa_t *dfa, reg_syntax_t syntax, uint32_t nrules,
+ const unsigned char *collseqmb, const char *collseqwc,
+ int_fast32_t table_size, const int32_t *symb_table,
+ const unsigned char *extra)
+{
+ unsigned int ch;
+ uint32_t start_collseq;
+ uint32_t end_collseq;
+
+ /* Equivalence Classes and Character Classes can't be a range
+ start/end. */
+ if (__glibc_unlikely (start_elem->type == EQUIV_CLASS
+ || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS
+ || end_elem->type == CHAR_CLASS))
+ return REG_ERANGE;
+
+ /* FIXME: Implement rational ranges here, too. */
+ start_collseq = lookup_collation_sequence_value (start_elem, nrules, collseqmb, collseqwc,
+ table_size, symb_table, extra);
+ end_collseq = lookup_collation_sequence_value (end_elem, nrules, collseqmb, collseqwc,
+ table_size, symb_table, extra);
+ /* Check start/end collation sequence values. */
+ if (__glibc_unlikely (start_collseq == UINT_MAX
+ || end_collseq == UINT_MAX))
+ return REG_ECOLLATE;
+ if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES)
+ && start_collseq > end_collseq))
+ return REG_ERANGE;
+
+ /* Got valid collation sequence values, add them as a new entry.
+ However, if we have no collation elements, and the character set
+ is single byte, the single byte character set that we
+ build below suffices. */
+ if (nrules > 0 || dfa->mb_cur_max > 1)
+ {
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*range_alloc == mbcset->nranges))
+ {
+ /* There is not enough space, need realloc. */
+ uint32_t *new_array_start;
+ uint32_t *new_array_end;
+ int new_nranges;
+
+ /* +1 in case of mbcset->nranges is 0. */
+ new_nranges = 2 * mbcset->nranges + 1;
+ new_array_start = re_realloc (mbcset->range_starts, uint32_t,
+ new_nranges);
+ new_array_end = re_realloc (mbcset->range_ends, uint32_t,
+ new_nranges);
+
+ if (__glibc_unlikely (new_array_start == NULL
+ || new_array_end == NULL))
+ return REG_ESPACE;
+
+ mbcset->range_starts = new_array_start;
+ mbcset->range_ends = new_array_end;
+ *range_alloc = new_nranges;
+ }
+
+ mbcset->range_starts[mbcset->nranges] = start_collseq;
+ mbcset->range_ends[mbcset->nranges++] = end_collseq;
+ }
+
+ /* Build the table for single byte characters. */
+ for (ch = 0; ch < SBC_MAX; ch++)
+ {
+ uint32_t ch_collseq;
+ /* if (MB_CUR_MAX == 1) */
+ if (nrules == 0)
+ ch_collseq = collseqmb[ch];
+ else
+ ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch));
+ if (start_collseq <= ch_collseq && ch_collseq <= end_collseq)
+ bitset_set (sbcset, ch);
+ }
+ return REG_NOERROR;
+}
+
+/* Local function for parse_bracket_exp used in _LIBC environment.
+ Build the collating element which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
+ pointer argument since we may update it. */
+
+static __always_inline reg_errcode_t
+build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *coll_sym_alloc, const unsigned char *name,
+ uint_fast32_t nrules, int_fast32_t table_size,
+ const int32_t *symb_table, const unsigned char *extra)
+{
+ int32_t elem, idx;
+ size_t name_len = strlen ((const char *) name);
+ if (nrules != 0)
+ {
+ elem = seek_collating_symbol_entry (name, name_len, symb_table,
+ table_size, extra);
+ if (elem != -1)
+ {
+ /* We found the entry. */
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ }
+ else if (name_len == 1)
+ {
+ /* No valid character, treat it as a normal
+ character. */
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+ else
+ return REG_ECOLLATE;
+
+ /* Got valid collation sequence, add it as a new entry. */
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*coll_sym_alloc == mbcset->ncoll_syms))
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->ncoll_syms is 0. */
+ int new_coll_sym_alloc = 2 * mbcset->ncoll_syms + 1;
+ /* Use realloc since mbcset->coll_syms is NULL
+ if *alloc == 0. */
+ int32_t *new_coll_syms = re_realloc (mbcset->coll_syms, int32_t,
+ new_coll_sym_alloc);
+ if (__glibc_unlikely (new_coll_syms == NULL))
+ return REG_ESPACE;
+ mbcset->coll_syms = new_coll_syms;
+ *coll_sym_alloc = new_coll_sym_alloc;
+ }
+ mbcset->coll_syms[mbcset->ncoll_syms++] = idx;
+ return REG_NOERROR;
+ }
+ else
+ {
+ if (__glibc_unlikely (name_len != 1))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+ }
+}
+#endif /* _LIBC */
+
+/* This function parse bracket expression like "[abc]", "[a-c]",
+ "[[.a-a.]]" etc. */
+
+static bin_tree_t *
+parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ reg_syntax_t syntax, reg_errcode_t *err)
+{
+ const unsigned char *collseqmb = NULL;
+ const char *collseqwc = NULL;
+ uint_fast32_t nrules = 0;
+ int_fast32_t table_size = 0;
+ const void *symb_table = NULL;
+ const unsigned char *extra = NULL;
+
+ re_token_t br_token;
+ re_bitset_ptr_t sbcset;
+ re_charset_t *mbcset;
+ Idx coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0;
+ Idx equiv_class_alloc = 0, char_class_alloc = 0;
+ bool non_match = false;
+ bin_tree_t *work_tree;
+ int token_len;
+ bool first_round = true;
+#ifdef _LIBC
+ collseqmb = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules)
+ {
+ /*
+ if (MB_CUR_MAX > 1)
+ */
+ collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB);
+ symb_table = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_TABLEMB);
+ extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_EXTRAMB);
+ }
+#endif
+ sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+ if (__glibc_unlikely (sbcset == NULL || mbcset == NULL))
+ {
+ re_free (sbcset);
+ re_free (mbcset);
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_NON_MATCH_LIST)
+ {
+ mbcset->non_match = 1;
+ non_match = true;
+ if (syntax & RE_HAT_LISTS_NOT_NEWLINE)
+ bitset_set (sbcset, '\n');
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ }
+
+ /* We treat the first ']' as a normal character. */
+ if (token->type == OP_CLOSE_BRACKET)
+ token->type = CHARACTER;
+
+ while (1)
+ {
+ bracket_elem_t start_elem, end_elem;
+ unsigned char start_name_buf[BRACKET_NAME_BUF_SIZE];
+ unsigned char end_name_buf[BRACKET_NAME_BUF_SIZE];
+ reg_errcode_t ret;
+ int token_len2 = 0;
+ bool is_range_exp = false;
+ re_token_t token2;
+
+ start_elem.opr.name = start_name_buf;
+ start_elem.type = COLL_SYM;
+ ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa,
+ syntax, first_round);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ {
+ *err = ret;
+ goto parse_bracket_exp_free_return;
+ }
+ first_round = false;
+
+ /* Get information about the next token. We need it in any case. */
+ token_len = peek_token_bracket (token, regexp, syntax);
+
+ /* Do not check for ranges if we know they are not allowed. */
+ if (start_elem.type != CHAR_CLASS && start_elem.type != EQUIV_CLASS)
+ {
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_EBRACK;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_CHARSET_RANGE)
+ {
+ re_string_skip_bytes (regexp, token_len); /* Skip '-'. */
+ token_len2 = peek_token_bracket (&token2, regexp, syntax);
+ if (__glibc_unlikely (token2.type == END_OF_RE))
+ {
+ *err = REG_EBRACK;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token2.type == OP_CLOSE_BRACKET)
+ {
+ /* We treat the last '-' as a normal character. */
+ re_string_skip_bytes (regexp, -token_len);
+ token->type = CHARACTER;
+ }
+ else
+ is_range_exp = true;
+ }
+ }
+
+ if (is_range_exp == true)
+ {
+ end_elem.opr.name = end_name_buf;
+ end_elem.type = COLL_SYM;
+ ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2,
+ dfa, syntax, true);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ {
+ *err = ret;
+ goto parse_bracket_exp_free_return;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+
+ *err = build_range_exp (sbcset, mbcset, &range_alloc,
+ &start_elem, &end_elem,
+ dfa, syntax, nrules, collseqmb, collseqwc,
+ table_size, symb_table, extra);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ }
+ else
+ {
+ switch (start_elem.type)
+ {
+ case SB_CHAR:
+ bitset_set (sbcset, start_elem.opr.ch);
+ break;
+ case MB_CHAR:
+ /* Check whether the array has enough space. */
+ if (__glibc_unlikely (mbchar_alloc == mbcset->nmbchars))
+ {
+ wchar_t *new_mbchars;
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nmbchars is 0. */
+ mbchar_alloc = 2 * mbcset->nmbchars + 1;
+ /* Use realloc since array is NULL if *alloc == 0. */
+ new_mbchars = re_realloc (mbcset->mbchars, wchar_t,
+ mbchar_alloc);
+ if (__glibc_unlikely (new_mbchars == NULL))
+ goto parse_bracket_exp_espace;
+ mbcset->mbchars = new_mbchars;
+ }
+ mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch;
+ break;
+ case EQUIV_CLASS:
+ *err = build_equiv_class (sbcset,
+ mbcset, &equiv_class_alloc,
+ start_elem.opr.name);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ break;
+ case COLL_SYM:
+ *err = build_collating_symbol (sbcset,
+ mbcset, &coll_sym_alloc,
+ start_elem.opr.name,
+ nrules, table_size, symb_table, extra);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ break;
+ case CHAR_CLASS:
+ *err = build_charclass (regexp->trans, sbcset,
+ mbcset, &char_class_alloc,
+ (const char *) start_elem.opr.name,
+ syntax);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ goto parse_bracket_exp_free_return;
+ break;
+ default:
+ DEBUG_ASSERT (false);
+ break;
+ }
+ }
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ {
+ *err = REG_EBRACK;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_CLOSE_BRACKET)
+ break;
+ }
+
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+
+ /* If it is non-matching list. */
+ if (non_match)
+ bitset_not (sbcset);
+
+ /* Ensure only single byte characters are set. */
+ if (dfa->mb_cur_max > 1)
+ bitset_mask (sbcset, dfa->sb_char);
+
+ if (mbcset->nmbchars || mbcset->ncoll_syms || mbcset->nequiv_classes
+ || mbcset->nranges || (dfa->mb_cur_max > 1 && (mbcset->nchar_classes
+ || mbcset->non_match)))
+ {
+ bin_tree_t *mbc_tree;
+ int sbc_idx;
+ /* Build a tree for complex bracket. */
+ dfa->has_mb_node = 1;
+ br_token.type = COMPLEX_BRACKET;
+ br_token.opr.mbcset = mbcset;
+ mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (mbc_tree == NULL))
+ goto parse_bracket_exp_espace;
+ for (sbc_idx = 0; sbc_idx < BITSET_WORDS; ++sbc_idx)
+ if (sbcset[sbc_idx])
+ break;
+ /* If there are no bits set in sbcset, there is no point
+ of having both SIMPLE_BRACKET and COMPLEX_BRACKET. */
+ if (sbc_idx < BITSET_WORDS)
+ {
+ /* Build a tree for simple bracket. */
+ br_token.type = SIMPLE_BRACKET;
+ br_token.opr.sbcset = sbcset;
+ work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (work_tree == NULL))
+ goto parse_bracket_exp_espace;
+
+ /* Then join them by ALT node. */
+ work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
+ if (__glibc_unlikely (work_tree == NULL))
+ goto parse_bracket_exp_espace;
+ }
+ else
+ {
+ re_free (sbcset);
+ work_tree = mbc_tree;
+ }
+ }
+ else
+ {
+ free_charset (mbcset);
+ /* Build a tree for simple bracket. */
+ br_token.type = SIMPLE_BRACKET;
+ br_token.opr.sbcset = sbcset;
+ work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (work_tree == NULL))
+ goto parse_bracket_exp_espace;
+ }
+ return work_tree;
+
+ parse_bracket_exp_espace:
+ *err = REG_ESPACE;
+ parse_bracket_exp_free_return:
+ re_free (sbcset);
+ free_charset (mbcset);
+ return NULL;
+}
+
+/* Parse an element in the bracket expression. */
+
+static reg_errcode_t
+parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
+ re_token_t *token, int token_len, re_dfa_t *dfa,
+ reg_syntax_t syntax, bool accept_hyphen)
+{
+ int cur_char_size;
+ cur_char_size = re_string_char_size_at (regexp, re_string_cur_idx (regexp));
+ if (cur_char_size > 1)
+ {
+ elem->type = MB_CHAR;
+ elem->opr.wch = re_string_wchar_at (regexp, re_string_cur_idx (regexp));
+ re_string_skip_bytes (regexp, cur_char_size);
+ return REG_NOERROR;
+ }
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+ if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS
+ || token->type == OP_OPEN_EQUIV_CLASS)
+ return parse_bracket_symbol (elem, regexp, token);
+ if (__glibc_unlikely (token->type == OP_CHARSET_RANGE) && !accept_hyphen)
+ {
+ /* A '-' must only appear as anything but a range indicator before
+ the closing bracket. Everything else is an error. */
+ re_token_t token2;
+ (void) peek_token_bracket (&token2, regexp, syntax);
+ if (token2.type != OP_CLOSE_BRACKET)
+ /* The actual error value is not standardized since this whole
+ case is undefined. But ERANGE makes good sense. */
+ return REG_ERANGE;
+ }
+ elem->type = SB_CHAR;
+ elem->opr.ch = token->opr.c;
+ return REG_NOERROR;
+}
+
+/* Parse a bracket symbol in the bracket expression. Bracket symbols are
+ such as [:<character_class>:], [.<collating_element>.], and
+ [=<equivalent_class>=]. */
+
+static reg_errcode_t
+parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
+ re_token_t *token)
+{
+ unsigned char ch, delim = token->opr.c;
+ int i = 0;
+ if (re_string_eoi(regexp))
+ return REG_EBRACK;
+ for (;; ++i)
+ {
+ if (i >= BRACKET_NAME_BUF_SIZE)
+ return REG_EBRACK;
+ if (token->type == OP_OPEN_CHAR_CLASS)
+ ch = re_string_fetch_byte_case (regexp);
+ else
+ ch = re_string_fetch_byte (regexp);
+ if (re_string_eoi(regexp))
+ return REG_EBRACK;
+ if (ch == delim && re_string_peek_byte (regexp, 0) == ']')
+ break;
+ elem->opr.name[i] = ch;
+ }
+ re_string_skip_bytes (regexp, 1);
+ elem->opr.name[i] = '\0';
+ switch (token->type)
+ {
+ case OP_OPEN_COLL_ELEM:
+ elem->type = COLL_SYM;
+ break;
+ case OP_OPEN_EQUIV_CLASS:
+ elem->type = EQUIV_CLASS;
+ break;
+ case OP_OPEN_CHAR_CLASS:
+ elem->type = CHAR_CLASS;
+ break;
+ default:
+ break;
+ }
+ return REG_NOERROR;
+}
+
+ /* Helper function for parse_bracket_exp.
+ Build the equivalence class which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes,
+ is a pointer argument since we may update it. */
+
+static reg_errcode_t
+build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
+ Idx *equiv_class_alloc, const unsigned char *name)
+{
+#ifdef _LIBC
+ uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules != 0)
+ {
+ const int32_t *table, *indirect;
+ const unsigned char *weights, *extra, *cp;
+ unsigned char char_buf[2];
+ int32_t idx1, idx2;
+ unsigned int ch;
+ size_t len;
+ /* Calculate the index for equivalence class. */
+ cp = name;
+ table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_INDIRECTMB);
+ idx1 = findidx (table, indirect, extra, &cp, -1);
+ if (__glibc_unlikely (idx1 == 0 || *cp != '\0'))
+ /* This isn't a valid character. */
+ return REG_ECOLLATE;
+
+ /* Build single byte matching table for this equivalence class. */
+ len = weights[idx1 & 0xffffff];
+ for (ch = 0; ch < SBC_MAX; ++ch)
+ {
+ char_buf[0] = ch;
+ cp = char_buf;
+ idx2 = findidx (table, indirect, extra, &cp, 1);
+/*
+ idx2 = table[ch];
+*/
+ if (idx2 == 0)
+ /* This isn't a valid character. */
+ continue;
+ /* Compare only if the length matches and the collation rule
+ index is the same. */
+ if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24)
+ && memcmp (weights + (idx1 & 0xffffff) + 1,
+ weights + (idx2 & 0xffffff) + 1, len) == 0)
+ bitset_set (sbcset, ch);
+ }
+ /* Check whether the array has enough space. */
+ if (__glibc_unlikely (*equiv_class_alloc == mbcset->nequiv_classes))
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nequiv_classes is 0. */
+ Idx new_equiv_class_alloc = 2 * mbcset->nequiv_classes + 1;
+ /* Use realloc since the array is NULL if *alloc == 0. */
+ int32_t *new_equiv_classes = re_realloc (mbcset->equiv_classes,
+ int32_t,
+ new_equiv_class_alloc);
+ if (__glibc_unlikely (new_equiv_classes == NULL))
+ return REG_ESPACE;
+ mbcset->equiv_classes = new_equiv_classes;
+ *equiv_class_alloc = new_equiv_class_alloc;
+ }
+ mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1;
+ }
+ else
+#endif /* _LIBC */
+ {
+ if (__glibc_unlikely (strlen ((const char *) name) != 1))
+ return REG_ECOLLATE;
+ bitset_set (sbcset, *name);
+ }
+ return REG_NOERROR;
+}
+
+ /* Helper function for parse_bracket_exp.
+ Build the character class which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes,
+ is a pointer argument since we may update it. */
+
+static reg_errcode_t
+build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
+ re_charset_t *mbcset, Idx *char_class_alloc,
+ const char *class_name, reg_syntax_t syntax)
+{
+ int i;
+ const char *name = class_name;
+
+ /* In case of REG_ICASE "upper" and "lower" match the both of
+ upper and lower cases. */
+ if ((syntax & RE_ICASE)
+ && (strcmp (name, "upper") == 0 || strcmp (name, "lower") == 0))
+ name = "alpha";
+
+ /* Check the space of the arrays. */
+ if (__glibc_unlikely (*char_class_alloc == mbcset->nchar_classes))
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nchar_classes is 0. */
+ Idx new_char_class_alloc = 2 * mbcset->nchar_classes + 1;
+ /* Use realloc since array is NULL if *alloc == 0. */
+ wctype_t *new_char_classes = re_realloc (mbcset->char_classes, wctype_t,
+ new_char_class_alloc);
+ if (__glibc_unlikely (new_char_classes == NULL))
+ return REG_ESPACE;
+ mbcset->char_classes = new_char_classes;
+ *char_class_alloc = new_char_class_alloc;
+ }
+ mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name);
+
+#define BUILD_CHARCLASS_LOOP(ctype_func) \
+ do { \
+ if (__glibc_unlikely (trans != NULL)) \
+ { \
+ for (i = 0; i < SBC_MAX; ++i) \
+ if (ctype_func (i)) \
+ bitset_set (sbcset, trans[i]); \
+ } \
+ else \
+ { \
+ for (i = 0; i < SBC_MAX; ++i) \
+ if (ctype_func (i)) \
+ bitset_set (sbcset, i); \
+ } \
+ } while (0)
+
+ if (strcmp (name, "alnum") == 0)
+ BUILD_CHARCLASS_LOOP (isalnum);
+ else if (strcmp (name, "cntrl") == 0)
+ BUILD_CHARCLASS_LOOP (iscntrl);
+ else if (strcmp (name, "lower") == 0)
+ BUILD_CHARCLASS_LOOP (islower);
+ else if (strcmp (name, "space") == 0)
+ BUILD_CHARCLASS_LOOP (isspace);
+ else if (strcmp (name, "alpha") == 0)
+ BUILD_CHARCLASS_LOOP (isalpha);
+ else if (strcmp (name, "digit") == 0)
+ BUILD_CHARCLASS_LOOP (isdigit);
+ else if (strcmp (name, "print") == 0)
+ BUILD_CHARCLASS_LOOP (isprint);
+ else if (strcmp (name, "upper") == 0)
+ BUILD_CHARCLASS_LOOP (isupper);
+ else if (strcmp (name, "blank") == 0)
+ BUILD_CHARCLASS_LOOP (isblank);
+ else if (strcmp (name, "graph") == 0)
+ BUILD_CHARCLASS_LOOP (isgraph);
+ else if (strcmp (name, "punct") == 0)
+ BUILD_CHARCLASS_LOOP (ispunct);
+ else if (strcmp (name, "xdigit") == 0)
+ BUILD_CHARCLASS_LOOP (isxdigit);
+ else
+ return REG_ECTYPE;
+
+ return REG_NOERROR;
+}
+
+static bin_tree_t *
+build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
+ const char *class_name,
+ const char *extra, bool non_match,
+ reg_errcode_t *err)
+{
+ re_bitset_ptr_t sbcset;
+ re_charset_t *mbcset;
+ Idx alloc = 0;
+ reg_errcode_t ret;
+ bin_tree_t *tree;
+
+ sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
+ if (__glibc_unlikely (sbcset == NULL))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+ if (__glibc_unlikely (mbcset == NULL))
+ {
+ re_free (sbcset);
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ mbcset->non_match = non_match;
+
+ /* We don't care the syntax in this case. */
+ ret = build_charclass (trans, sbcset, mbcset, &alloc, class_name, 0);
+
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ {
+ re_free (sbcset);
+ free_charset (mbcset);
+ *err = ret;
+ return NULL;
+ }
+ /* \w match '_' also. */
+ for (; *extra; extra++)
+ bitset_set (sbcset, *extra);
+
+ /* If it is non-matching list. */
+ if (non_match)
+ bitset_not (sbcset);
+
+ /* Ensure only single byte characters are set. */
+ if (dfa->mb_cur_max > 1)
+ bitset_mask (sbcset, dfa->sb_char);
+
+ /* Build a tree for simple bracket. */
+ re_token_t br_token = { .type = SIMPLE_BRACKET, .opr.sbcset = sbcset };
+ tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (tree == NULL))
+ goto build_word_op_espace;
+
+ if (dfa->mb_cur_max > 1)
+ {
+ bin_tree_t *mbc_tree;
+ /* Build a tree for complex bracket. */
+ br_token.type = COMPLEX_BRACKET;
+ br_token.opr.mbcset = mbcset;
+ dfa->has_mb_node = 1;
+ mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token);
+ if (__glibc_unlikely (mbc_tree == NULL))
+ goto build_word_op_espace;
+ /* Then join them by ALT node. */
+ tree = create_tree (dfa, tree, mbc_tree, OP_ALT);
+ if (__glibc_likely (mbc_tree != NULL))
+ return tree;
+ }
+ else
+ {
+ free_charset (mbcset);
+ return tree;
+ }
+
+ build_word_op_espace:
+ re_free (sbcset);
+ free_charset (mbcset);
+ *err = REG_ESPACE;
+ return NULL;
+}
+
+/* This is intended for the expressions like "a{1,3}".
+ Fetch a number from 'input', and return the number.
+ Return -1 if the number field is empty like "{,1}".
+ Return RE_DUP_MAX + 1 if the number field is too large.
+ Return -2 if an error occurred. */
+
+static Idx
+fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax)
+{
+ Idx num = -1;
+ unsigned char c;
+ while (1)
+ {
+ fetch_token (token, input, syntax);
+ c = token->opr.c;
+ if (__glibc_unlikely (token->type == END_OF_RE))
+ return -2;
+ if (token->type == OP_CLOSE_DUP_NUM || c == ',')
+ break;
+ num = ((token->type != CHARACTER || c < '0' || '9' < c || num == -2)
+ ? -2
+ : num == -1
+ ? c - '0'
+ : MIN (RE_DUP_MAX + 1, num * 10 + c - '0'));
+ }
+ return num;
+}
+
+static void
+free_charset (re_charset_t *cset)
+{
+ re_free (cset->mbchars);
+#ifdef _LIBC
+ re_free (cset->coll_syms);
+ re_free (cset->equiv_classes);
+#endif
+ re_free (cset->range_starts);
+ re_free (cset->range_ends);
+ re_free (cset->char_classes);
+ re_free (cset);
+}
+
+/* Functions for binary tree operation. */
+
+/* Create a tree node. */
+
+static bin_tree_t *
+create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
+ re_token_type_t type)
+{
+ re_token_t t = { .type = type };
+ return create_token_tree (dfa, left, right, &t);
+}
+
+static bin_tree_t *
+create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
+ const re_token_t *token)
+{
+ bin_tree_t *tree;
+ if (__glibc_unlikely (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE))
+ {
+ bin_tree_storage_t *storage = re_malloc (bin_tree_storage_t, 1);
+
+ if (storage == NULL)
+ return NULL;
+ storage->next = dfa->str_tree_storage;
+ dfa->str_tree_storage = storage;
+ dfa->str_tree_storage_idx = 0;
+ }
+ tree = &dfa->str_tree_storage->data[dfa->str_tree_storage_idx++];
+
+ tree->parent = NULL;
+ tree->left = left;
+ tree->right = right;
+ tree->token = *token;
+ tree->token.duplicated = 0;
+ tree->token.opt_subexp = 0;
+ tree->first = NULL;
+ tree->next = NULL;
+ tree->node_idx = -1;
+
+ if (left != NULL)
+ left->parent = tree;
+ if (right != NULL)
+ right->parent = tree;
+ return tree;
+}
+
+/* Mark the tree SRC as an optional subexpression.
+ To be called from preorder or postorder. */
+
+static reg_errcode_t
+mark_opt_subexp (void *extra, bin_tree_t *node)
+{
+ Idx idx = (uintptr_t) extra;
+ if (node->token.type == SUBEXP && node->token.opr.idx == idx)
+ node->token.opt_subexp = 1;
+
+ return REG_NOERROR;
+}
+
+/* Free the allocated memory inside NODE. */
+
+static void
+free_token (re_token_t *node)
+{
+ if (node->type == COMPLEX_BRACKET && node->duplicated == 0)
+ free_charset (node->opr.mbcset);
+ else if (node->type == SIMPLE_BRACKET && node->duplicated == 0)
+ re_free (node->opr.sbcset);
+}
+
+/* Worker function for tree walking. Free the allocated memory inside NODE
+ and its children. */
+
+static reg_errcode_t
+free_tree (void *extra, bin_tree_t *node)
+{
+ free_token (&node->token);
+ return REG_NOERROR;
+}
+
+
+/* Duplicate the node SRC, and return new node. This is a preorder
+ visit similar to the one implemented by the generic visitor, but
+ we need more infrastructure to maintain two parallel trees --- so,
+ it's easier to duplicate. */
+
+static bin_tree_t *
+duplicate_tree (const bin_tree_t *root, re_dfa_t *dfa)
+{
+ const bin_tree_t *node;
+ bin_tree_t *dup_root;
+ bin_tree_t **p_new = &dup_root, *dup_node = root->parent;
+
+ for (node = root; ; )
+ {
+ /* Create a new tree and link it back to the current parent. */
+ *p_new = create_token_tree (dfa, NULL, NULL, &node->token);
+ if (*p_new == NULL)
+ return NULL;
+ (*p_new)->parent = dup_node;
+ (*p_new)->token.duplicated = 1;
+ dup_node = *p_new;
+
+ /* Go to the left node, or up and to the right. */
+ if (node->left)
+ {
+ node = node->left;
+ p_new = &dup_node->left;
+ }
+ else
+ {
+ const bin_tree_t *prev = NULL;
+ while (node->right == prev || node->right == NULL)
+ {
+ prev = node;
+ node = node->parent;
+ dup_node = dup_node->parent;
+ if (!node)
+ return dup_root;
+ }
+ node = node->right;
+ p_new = &dup_node->right;
+ }
+ }
+}
diff --git a/gl/regex.c b/gl/regex.c
new file mode 100644
index 0000000..3beb0de
--- /dev/null
+++ b/gl/regex.c
@@ -0,0 +1,84 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#define __STDC_WANT_IEC_60559_BFP_EXT__
+
+#ifndef _LIBC
+# include <libc-config.h>
+
+# if __GNUC_PREREQ (4, 6)
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+# pragma GCC diagnostic ignored "-Wvla"
+# endif
+# if __GNUC_PREREQ (4, 3)
+# pragma GCC diagnostic ignored "-Wold-style-definition"
+# pragma GCC diagnostic ignored "-Wtype-limits"
+# endif
+#endif
+
+/* Make sure no one compiles this code with a C++ compiler. */
+#if defined __cplusplus && defined _LIBC
+# error "This is C code, use a C compiler"
+#endif
+
+#ifdef _LIBC
+/* We have to keep the namespace clean. */
+# define regfree(preg) __regfree (preg)
+# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
+# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
+# define regerror(errcode, preg, errbuf, errbuf_size) \
+ __regerror(errcode, preg, errbuf, errbuf_size)
+# define re_set_registers(bu, re, nu, st, en) \
+ __re_set_registers (bu, re, nu, st, en)
+# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
+ __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+# define re_match(bufp, string, size, pos, regs) \
+ __re_match (bufp, string, size, pos, regs)
+# define re_search(bufp, string, size, startpos, range, regs) \
+ __re_search (bufp, string, size, startpos, range, regs)
+# define re_compile_pattern(pattern, length, bufp) \
+ __re_compile_pattern (pattern, length, bufp)
+# define re_set_syntax(syntax) __re_set_syntax (syntax)
+# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
+ __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
+# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
+
+# include "../locale/localeinfo.h"
+#endif
+
+/* On some systems, limits.h sets RE_DUP_MAX to a lower value than
+ GNU regex allows. Include it before <regex.h>, which correctly
+ #undefs RE_DUP_MAX and sets it to the right value. */
+#include <limits.h>
+
+#include <regex.h>
+#include "regex_internal.h"
+
+#include "regex_internal.c"
+#include "regcomp.c"
+#include "regexec.c"
+
+/* Binary backward compatibility. */
+#if _LIBC
+# include <shlib-compat.h>
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
+link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
+int re_max_failures = 2000;
+# endif
+#endif
diff --git a/gl/regex.h b/gl/regex.h
new file mode 100644
index 0000000..9ef0252
--- /dev/null
+++ b/gl/regex.h
@@ -0,0 +1,699 @@
+/* Definitions for data structures and routines for the regular
+ expression library.
+ Copyright (C) 1985, 1989-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _REGEX_H
+#define _REGEX_H 1
+
+#include <sys/types.h>
+
+/* Allow the use in C++ code. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Define __USE_GNU to declare GNU extensions that violate the
+ POSIX name space rules. */
+#ifdef _GNU_SOURCE
+# define __USE_GNU 1
+#endif
+
+#ifdef _REGEX_LARGE_OFFSETS
+
+/* Use types and values that are wide enough to represent signed and
+ unsigned byte offsets in memory. This currently works only when
+ the regex code is used outside of the GNU C library; it is not yet
+ supported within glibc itself, and glibc users should not define
+ _REGEX_LARGE_OFFSETS. */
+
+/* The type of object sizes. */
+typedef size_t __re_size_t;
+
+/* The type of object sizes, in places where the traditional code
+ uses unsigned long int. */
+typedef size_t __re_long_size_t;
+
+#else
+
+/* The traditional GNU regex implementation mishandles strings longer
+ than INT_MAX. */
+typedef unsigned int __re_size_t;
+typedef unsigned long int __re_long_size_t;
+
+#endif
+
+/* The following two types have to be signed and unsigned integer type
+ wide enough to hold a value of a pointer. For most ANSI compilers
+ ptrdiff_t and size_t should be likely OK. Still size of these two
+ types is 2 for Microsoft C. Ugh... */
+typedef long int s_reg_t;
+typedef unsigned long int active_reg_t;
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned long int reg_syntax_t;
+
+#ifdef __USE_GNU
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+# define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+# define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+# define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+# define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+# define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+# define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+# define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+# define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+# define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+# define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+# define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then '{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then '\{...\}' defines an interval. */
+# define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+# define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+# define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+# define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+# define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+# define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* If this bit is set, succeed as soon as we match the whole pattern,
+ without further backtracking. */
+# define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
+
+/* If this bit is set, do not process the GNU regex operators.
+ If not set, then the GNU regex operators are recognized. */
+# define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
+
+/* If this bit is set, turn on internal regex debugging.
+ If not set, and debugging was on, turn it off.
+ This only works if regex.c is compiled -DDEBUG.
+ We define this bit always, so that all that's needed to turn on
+ debugging is to recompile regex.c; the calling code can always have
+ this bit set, and it won't affect anything in the normal case. */
+# define RE_DEBUG (RE_NO_GNU_OPS << 1)
+
+/* If this bit is set, a syntactically invalid interval is treated as
+ a string of ordinary characters. For example, the ERE 'a{1' is
+ treated as 'a\{1'. */
+# define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+# define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
+
+/* This bit is used internally like RE_CONTEXT_INDEP_ANCHORS but only
+ for ^, because it is difficult to scan the regex backwards to find
+ whether ^ should be special. */
+# define RE_CARET_ANCHORS_HERE (RE_ICASE << 1)
+
+/* If this bit is set, then \{ cannot be first in a regex or
+ immediately after an alternation, open-group or \} operator. */
+# define RE_CONTEXT_INVALID_DUP (RE_CARET_ANCHORS_HERE << 1)
+
+/* If this bit is set, then no_sub will be set to 1 during
+ re_compile_pattern. */
+# define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
+#endif
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+#ifdef __USE_GNU
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+# define RE_SYNTAX_EMACS 0
+
+# define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CHAR_CLASSES \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+# define RE_SYNTAX_GNU_AWK \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INVALID_INTERVAL_ORD) \
+ & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \
+ | RE_CONTEXT_INVALID_OPS ))
+
+# define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INTERVALS | RE_NO_GNU_OPS \
+ | RE_INVALID_INTERVAL_ORD)
+
+# define RE_SYNTAX_GREP \
+ ((RE_SYNTAX_POSIX_BASIC | RE_NEWLINE_ALT) \
+ & ~(RE_CONTEXT_INVALID_DUP | RE_DOT_NOT_NULL))
+
+# define RE_SYNTAX_EGREP \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_INVALID_INTERVAL_ORD | RE_NEWLINE_ALT) \
+ & ~(RE_CONTEXT_INVALID_OPS | RE_DOT_NOT_NULL))
+
+/* POSIX grep -E behavior is no longer incompatible with GNU. */
+# define RE_SYNTAX_POSIX_EGREP \
+ RE_SYNTAX_EGREP
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+# define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+# define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+# define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+# define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
+ removed and RE_NO_BK_REFS is added. */
+# define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. POSIX-conforming
+ systems might define this in <limits.h>, but we want our
+ value, so remove any previous define. */
+# ifdef _REGEX_INCLUDE_LIMITS_H
+# include <limits.h>
+# endif
+# ifdef RE_DUP_MAX
+# undef RE_DUP_MAX
+# endif
+
+/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored
+ the counter as a 2-byte signed integer. This is no longer true, so
+ RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to
+ ((SIZE_MAX - 9) / 10) if _REGEX_LARGE_OFFSETS is defined.
+ However, there would be a huge performance problem if someone
+ actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains
+ its historical value. */
+# define RE_DUP_MAX (0x7fff)
+#endif
+
+
+/* POSIX 'cflags' bits (i.e., information for 'regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (1 << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (1 << 2)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (1 << 3)
+
+
+/* POSIX 'eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+/* Use PMATCH[0] to delimit the start and end of the search in the
+ buffer. */
+#define REG_STARTEND (1 << 2)
+
+
+/* If any error codes are removed, changed, or added, update the
+ '__re_error_msgid' table in regcomp.c. */
+
+typedef enum
+{
+ _REG_ENOSYS = -1, /* This will never happen for this implementation. */
+ _REG_NOERROR = 0, /* Success. */
+ _REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ _REG_BADPAT, /* Invalid pattern. */
+ _REG_ECOLLATE, /* Invalid collating element. */
+ _REG_ECTYPE, /* Invalid character class name. */
+ _REG_EESCAPE, /* Trailing backslash. */
+ _REG_ESUBREG, /* Invalid back reference. */
+ _REG_EBRACK, /* Unmatched left bracket. */
+ _REG_EPAREN, /* Parenthesis imbalance. */
+ _REG_EBRACE, /* Unmatched \{. */
+ _REG_BADBR, /* Invalid contents of \{\}. */
+ _REG_ERANGE, /* Invalid range end. */
+ _REG_ESPACE, /* Ran out of memory. */
+ _REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ _REG_EEND, /* Premature end. */
+ _REG_ESIZE, /* Too large (e.g., repeat count too large). */
+ _REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+#if defined _XOPEN_SOURCE || defined __USE_XOPEN2K
+# define REG_ENOSYS _REG_ENOSYS
+#endif
+#define REG_NOERROR _REG_NOERROR
+#define REG_NOMATCH _REG_NOMATCH
+#define REG_BADPAT _REG_BADPAT
+#define REG_ECOLLATE _REG_ECOLLATE
+#define REG_ECTYPE _REG_ECTYPE
+#define REG_EESCAPE _REG_EESCAPE
+#define REG_ESUBREG _REG_ESUBREG
+#define REG_EBRACK _REG_EBRACK
+#define REG_EPAREN _REG_EPAREN
+#define REG_EBRACE _REG_EBRACE
+#define REG_BADBR _REG_BADBR
+#define REG_ERANGE _REG_ERANGE
+#define REG_ESPACE _REG_ESPACE
+#define REG_BADRPT _REG_BADRPT
+#define REG_EEND _REG_EEND
+#define REG_ESIZE _REG_ESIZE
+#define REG_ERPAREN _REG_ERPAREN
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields 'buffer', 'allocated', 'fastmap',
+ and 'translate' can be set. After the pattern has been compiled,
+ the fields 're_nsub', 'not_bol' and 'not_eol' are available. All
+ other fields are private to the regex routines. */
+
+#ifndef RE_TRANSLATE_TYPE
+# define __RE_TRANSLATE_TYPE unsigned char *
+# ifdef __USE_GNU
+# define RE_TRANSLATE_TYPE __RE_TRANSLATE_TYPE
+# endif
+#endif
+
+#ifdef __USE_GNU
+# define __REPB_PREFIX(name) name
+#else
+# define __REPB_PREFIX(name) __##name
+#endif
+
+struct re_pattern_buffer
+{
+ /* Space that holds the compiled pattern. The type
+ 'struct re_dfa_t' is private and is not declared here. */
+ struct re_dfa_t *__REPB_PREFIX(buffer);
+
+ /* Number of bytes to which 'buffer' points. */
+ __re_long_size_t __REPB_PREFIX(allocated);
+
+ /* Number of bytes actually used in 'buffer'. */
+ __re_long_size_t __REPB_PREFIX(used);
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t __REPB_PREFIX(syntax);
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses the
+ fastmap, if there is one, to skip over impossible starting points
+ for matches. */
+ char *__REPB_PREFIX(fastmap);
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation is
+ applied to a pattern when it is compiled and to a string when it
+ is matched. */
+ __RE_TRANSLATE_TYPE __REPB_PREFIX(translate);
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in 're_search_2', to see whether or
+ not we should use the fastmap, so we don't set this absolutely
+ perfectly; see 're_compile_fastmap' (the "duplicate" case). */
+ unsigned __REPB_PREFIX(can_be_null) : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the 'regs' structure
+ for 'max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#ifdef __USE_GNU
+# define REGS_UNALLOCATED 0
+# define REGS_REALLOCATE 1
+# define REGS_FIXED 2
+#endif
+ unsigned __REPB_PREFIX(regs_allocated) : 2;
+
+ /* Set to zero when 're_compile_pattern' compiles a pattern; set to
+ one by 're_compile_fastmap' if it updates the fastmap. */
+ unsigned __REPB_PREFIX(fastmap_accurate) : 1;
+
+ /* If set, 're_match_2' does not return information about
+ subexpressions. */
+ unsigned __REPB_PREFIX(no_sub) : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the beginning
+ of the string. */
+ unsigned __REPB_PREFIX(not_bol) : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned __REPB_PREFIX(not_eol) : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned __REPB_PREFIX(newline_anchor) : 1;
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+#ifdef _REGEX_LARGE_OFFSETS
+/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as
+ ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t
+ is wider than ssize_t, so ssize_t is safe. ptrdiff_t is not
+ visible here, so use ssize_t. */
+typedef ssize_t regoff_t;
+#else
+/* The traditional GNU regex implementation mishandles strings longer
+ than INT_MAX. */
+typedef int regoff_t;
+#endif
+
+
+#ifdef __USE_GNU
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ __re_size_t num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If 'regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ 're_match_2' returns information about at least this many registers
+ the first time a 'regs' structure is passed. */
+# ifndef RE_NREGS
+# define RE_NREGS 30
+# endif
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ 're_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+#ifndef _REGEX_NELTS
+# if (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ \
+ && !defined __STDC_NO_VLA__)
+# define _REGEX_NELTS(n) n
+# else
+# define _REGEX_NELTS(n)
+# endif
+#endif
+
+#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wvla"
+#endif
+
+#ifndef _Attr_access_
+# ifdef __attr_access
+# define _Attr_access_(arg) __attr_access (arg)
+# elif defined __GNUC__ && 10 <= __GNUC__
+# define _Attr_access_(x) __attribute__ ((__access__ x))
+# else
+# define _Attr_access_(x)
+# endif
+#endif
+
+#ifdef __USE_GNU
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the 're_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global 're_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not.
+
+ To free the allocated storage, you must call 'regfree' on BUFFER.
+ Note that the translate table must either have been initialized by
+ 'regcomp', with a malloc'ed value, or set to NULL before calling
+ 'regfree'. */
+extern const char *re_compile_pattern (const char *__pattern, size_t __length,
+ struct re_pattern_buffer *__buffer)
+ _Attr_access_ ((__read_only__, 1, 2));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern regoff_t re_search (struct re_pattern_buffer *__buffer,
+ const char *__String, regoff_t __length,
+ regoff_t __start, regoff_t __range,
+ struct re_registers *__regs)
+ _Attr_access_ ((__read_only__, 2, 3));
+
+
+/* Like 're_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, regoff_t __length1,
+ const char *__string2, regoff_t __length2,
+ regoff_t __start, regoff_t __range,
+ struct re_registers *__regs,
+ regoff_t __stop)
+ _Attr_access_ ((__read_only__, 2, 3))
+ _Attr_access_ ((__read_only__, 4, 5));
+
+
+/* Like 're_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern regoff_t re_match (struct re_pattern_buffer *__buffer,
+ const char *__String, regoff_t __length,
+ regoff_t __start, struct re_registers *__regs)
+ _Attr_access_ ((__read_only__, 2, 3));
+
+
+/* Relates to 're_match' as 're_search_2' relates to 're_search'. */
+extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, regoff_t __length1,
+ const char *__string2, regoff_t __length2,
+ regoff_t __start, struct re_registers *__regs,
+ regoff_t __stop)
+ _Attr_access_ ((__read_only__, 2, 3))
+ _Attr_access_ ((__read_only__, 4, 5));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least 'NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers (struct re_pattern_buffer *__buffer,
+ struct re_registers *__regs,
+ __re_size_t __num_regs,
+ regoff_t *__starts, regoff_t *__ends);
+#endif /* Use GNU */
+
+#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC)
+/* 4.2 bsd compatibility. */
+extern char *re_comp (const char *);
+extern int re_exec (const char *);
+#endif
+
+/* For plain 'restrict', use glibc's __restrict if defined.
+ Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict".
+ Other compilers use __restrict, __restrict__, and _Restrict, and
+ 'configure' might #define 'restrict' to those words, so pick a
+ different name. */
+#ifndef _Restrict_
+# if defined __restrict \
+ || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3
+# define _Restrict_ __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+# define _Restrict_ restrict
+# else
+# define _Restrict_
+# endif
+#endif
+/* For the ISO C99 syntax
+ array_name[restrict]
+ use glibc's __restrict_arr if available.
+ Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
+ Other ISO C99 compilers support it as well. */
+#ifndef _Restrict_arr_
+# ifdef __restrict_arr
+# define _Restrict_arr_ __restrict_arr
+# elif ((199901L <= __STDC_VERSION__ \
+ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ || __clang_major__ >= 3) \
+ && !defined __cplusplus)
+# define _Restrict_arr_ _Restrict_
+# else
+# define _Restrict_arr_
+# endif
+#endif
+
+/* POSIX compatibility. */
+extern int regcomp (regex_t *_Restrict_ __preg,
+ const char *_Restrict_ __pattern,
+ int __cflags);
+
+extern int regexec (const regex_t *_Restrict_ __preg,
+ const char *_Restrict_ __String, size_t __nmatch,
+ regmatch_t __pmatch[_Restrict_arr_
+ _REGEX_NELTS (__nmatch)],
+ int __eflags);
+
+extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,
+ char *_Restrict_ __errbuf, size_t __errbuf_size)
+ _Attr_access_ ((__write_only__, 3, 4));
+
+extern void regfree (regex_t *__preg);
+
+#if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# pragma GCC diagnostic pop
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* regex.h */
diff --git a/gl/regex_internal.c b/gl/regex_internal.c
new file mode 100644
index 0000000..998a19b
--- /dev/null
+++ b/gl/regex_internal.c
@@ -0,0 +1,1711 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+static void re_string_construct_common (const char *str, Idx len,
+ re_string_t *pstr,
+ RE_TRANSLATE_TYPE trans, bool icase,
+ const re_dfa_t *dfa);
+static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa,
+ const re_node_set *nodes,
+ re_hashval_t hash);
+static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
+ const re_node_set *nodes,
+ unsigned int context,
+ re_hashval_t hash);
+static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
+ Idx new_buf_len);
+static void build_wcs_buffer (re_string_t *pstr);
+static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr);
+static void build_upper_buffer (re_string_t *pstr);
+static void re_string_translate_buffer (re_string_t *pstr);
+static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
+ int eflags) __attribute__ ((pure));
+
+/* Functions for string operation. */
+
+/* This function allocate the buffers. It is necessary to call
+ re_string_reconstruct before using the object. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len,
+ RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
+{
+ reg_errcode_t ret;
+ Idx init_buf_len;
+
+ /* Ensure at least one character fits into the buffers. */
+ if (init_len < dfa->mb_cur_max)
+ init_len = dfa->mb_cur_max;
+ init_buf_len = (len + 1 < init_len) ? len + 1: init_len;
+ re_string_construct_common (str, len, pstr, trans, icase, dfa);
+
+ ret = re_string_realloc_buffers (pstr, init_buf_len);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+
+ pstr->word_char = dfa->word_char;
+ pstr->word_ops_used = dfa->word_ops_used;
+ pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
+ pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len;
+ pstr->valid_raw_len = pstr->valid_len;
+ return REG_NOERROR;
+}
+
+/* This function allocate the buffers, and initialize them. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_construct (re_string_t *pstr, const char *str, Idx len,
+ RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
+{
+ reg_errcode_t ret;
+ memset (pstr, '\0', sizeof (re_string_t));
+ re_string_construct_common (str, len, pstr, trans, icase, dfa);
+
+ if (len > 0)
+ {
+ ret = re_string_realloc_buffers (pstr, len + 1);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
+
+ if (icase)
+ {
+ if (dfa->mb_cur_max > 1)
+ {
+ while (1)
+ {
+ ret = build_wcs_upper_buffer (pstr);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ if (pstr->valid_raw_len >= len)
+ break;
+ if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max)
+ break;
+ ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ }
+ else
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+ if (dfa->mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+ {
+ if (trans != NULL)
+ re_string_translate_buffer (pstr);
+ else
+ {
+ pstr->valid_len = pstr->bufs_len;
+ pstr->valid_raw_len = pstr->bufs_len;
+ }
+ }
+ }
+
+ return REG_NOERROR;
+}
+
+/* Helper functions for re_string_allocate, and re_string_construct. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
+{
+ if (pstr->mb_cur_max > 1)
+ {
+ wint_t *new_wcs;
+
+ /* Avoid overflow in realloc. */
+ const size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx));
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size)
+ < new_buf_len))
+ return REG_ESPACE;
+
+ new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
+ if (__glibc_unlikely (new_wcs == NULL))
+ return REG_ESPACE;
+ pstr->wcs = new_wcs;
+ if (pstr->offsets != NULL)
+ {
+ Idx *new_offsets = re_realloc (pstr->offsets, Idx, new_buf_len);
+ if (__glibc_unlikely (new_offsets == NULL))
+ return REG_ESPACE;
+ pstr->offsets = new_offsets;
+ }
+ }
+ if (pstr->mbs_allocated)
+ {
+ unsigned char *new_mbs = re_realloc (pstr->mbs, unsigned char,
+ new_buf_len);
+ if (__glibc_unlikely (new_mbs == NULL))
+ return REG_ESPACE;
+ pstr->mbs = new_mbs;
+ }
+ pstr->bufs_len = new_buf_len;
+ return REG_NOERROR;
+}
+
+
+static void
+re_string_construct_common (const char *str, Idx len, re_string_t *pstr,
+ RE_TRANSLATE_TYPE trans, bool icase,
+ const re_dfa_t *dfa)
+{
+ pstr->raw_mbs = (const unsigned char *) str;
+ pstr->len = len;
+ pstr->raw_len = len;
+ pstr->trans = trans;
+ pstr->icase = icase;
+ pstr->mbs_allocated = (trans != NULL || icase);
+ pstr->mb_cur_max = dfa->mb_cur_max;
+ pstr->is_utf8 = dfa->is_utf8;
+ pstr->map_notascii = dfa->map_notascii;
+ pstr->stop = pstr->len;
+ pstr->raw_stop = pstr->stop;
+}
+
+
+/* Build wide character buffer PSTR->WCS.
+ If the byte sequence of the string are:
+ <mb1>(0), <mb1>(1), <mb2>(0), <mb2>(1), <sb3>
+ Then wide character buffer will be:
+ <wc1> , WEOF , <wc2> , WEOF , <wc3>
+ We use WEOF for padding, they indicate that the position isn't
+ a first byte of a multibyte character.
+
+ Note that this function assumes PSTR->VALID_LEN elements are already
+ built and starts from PSTR->VALID_LEN. */
+
+static void
+build_wcs_buffer (re_string_t *pstr)
+{
+#ifdef _LIBC
+ unsigned char buf[MB_LEN_MAX];
+ DEBUG_ASSERT (MB_LEN_MAX >= pstr->mb_cur_max);
+#else
+ unsigned char buf[64];
+#endif
+ mbstate_t prev_st;
+ Idx byte_idx, end_idx, remain_len;
+ size_t mbclen;
+
+ /* Build the buffers from pstr->valid_len to either pstr->len or
+ pstr->bufs_len. */
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+ for (byte_idx = pstr->valid_len; byte_idx < end_idx;)
+ {
+ wchar_t wc;
+ const char *p;
+
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ /* Apply the translation if we need. */
+ if (__glibc_unlikely (pstr->trans != NULL))
+ {
+ int i, ch;
+
+ for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i)
+ {
+ ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i];
+ buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch];
+ }
+ p = (const char *) buf;
+ }
+ else
+ p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx;
+ mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+ if (__glibc_unlikely (mbclen == (size_t) -1 || mbclen == 0
+ || (mbclen == (size_t) -2
+ && pstr->bufs_len >= pstr->len)))
+ {
+ /* We treat these cases as a singlebyte character. */
+ mbclen = 1;
+ wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+ if (__glibc_unlikely (pstr->trans != NULL))
+ wc = pstr->trans[wc];
+ pstr->cur_state = prev_st;
+ }
+ else if (__glibc_unlikely (mbclen == (size_t) -2))
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+
+ /* Write wide character and padding. */
+ pstr->wcs[byte_idx++] = wc;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ pstr->valid_len = byte_idx;
+ pstr->valid_raw_len = byte_idx;
+}
+
+/* Build wide character buffer PSTR->WCS like build_wcs_buffer,
+ but for REG_ICASE. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+build_wcs_upper_buffer (re_string_t *pstr)
+{
+ mbstate_t prev_st;
+ Idx src_idx, byte_idx, end_idx, remain_len;
+ size_t mbclen;
+#ifdef _LIBC
+ char buf[MB_LEN_MAX];
+ DEBUG_ASSERT (pstr->mb_cur_max <= MB_LEN_MAX);
+#else
+ char buf[64];
+#endif
+
+ byte_idx = pstr->valid_len;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ /* The following optimization assumes that ASCII characters can be
+ mapped to wide characters with a simple cast. */
+ if (! pstr->map_notascii && pstr->trans == NULL && !pstr->offsets_needed)
+ {
+ while (byte_idx < end_idx)
+ {
+ wchar_t wc;
+ unsigned char ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+
+ if (isascii (ch) && mbsinit (&pstr->cur_state))
+ {
+ /* The next step uses the assumption that wchar_t is encoded
+ ASCII-safe: all ASCII values can be converted like this. */
+ wchar_t wcu = __towupper (ch);
+ if (isascii (wcu))
+ {
+ pstr->mbs[byte_idx] = wcu;
+ pstr->wcs[byte_idx] = wcu;
+ byte_idx++;
+ continue;
+ }
+ }
+
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ mbclen = __mbrtowc (&wc,
+ ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
+ + byte_idx), remain_len, &pstr->cur_state);
+ if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2))
+ {
+ wchar_t wcu = __towupper (wc);
+ if (wcu != wc)
+ {
+ size_t mbcdlen;
+
+ mbcdlen = __wcrtomb (buf, wcu, &prev_st);
+ if (__glibc_likely (mbclen == mbcdlen))
+ memcpy (pstr->mbs + byte_idx, buf, mbclen);
+ else
+ {
+ src_idx = byte_idx;
+ goto offsets_needed;
+ }
+ }
+ else
+ memcpy (pstr->mbs + byte_idx,
+ pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx, mbclen);
+ pstr->wcs[byte_idx++] = wcu;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ else if (mbclen == (size_t) -1 || mbclen == 0
+ || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
+ {
+ /* It is an invalid character, an incomplete character
+ at the end of the string, or '\0'. Just use the byte. */
+ pstr->mbs[byte_idx] = ch;
+ /* And also cast it to wide char. */
+ pstr->wcs[byte_idx++] = (wchar_t) ch;
+ if (__glibc_unlikely (mbclen == (size_t) -1))
+ pstr->cur_state = prev_st;
+ }
+ else
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+ }
+ pstr->valid_len = byte_idx;
+ pstr->valid_raw_len = byte_idx;
+ return REG_NOERROR;
+ }
+ else
+ for (src_idx = pstr->valid_raw_len; byte_idx < end_idx;)
+ {
+ wchar_t wc;
+ const char *p;
+ offsets_needed:
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ if (__glibc_unlikely (pstr->trans != NULL))
+ {
+ int i, ch;
+
+ for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i)
+ {
+ ch = pstr->raw_mbs [pstr->raw_mbs_idx + src_idx + i];
+ buf[i] = pstr->trans[ch];
+ }
+ p = (const char *) buf;
+ }
+ else
+ p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx;
+ mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+ if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2))
+ {
+ wchar_t wcu = __towupper (wc);
+ if (wcu != wc)
+ {
+ size_t mbcdlen;
+
+ mbcdlen = __wcrtomb ((char *) buf, wcu, &prev_st);
+ if (__glibc_likely (mbclen == mbcdlen))
+ memcpy (pstr->mbs + byte_idx, buf, mbclen);
+ else if (mbcdlen != (size_t) -1)
+ {
+ size_t i;
+
+ if (byte_idx + mbcdlen > pstr->bufs_len)
+ {
+ pstr->cur_state = prev_st;
+ break;
+ }
+
+ if (pstr->offsets == NULL)
+ {
+ pstr->offsets = re_malloc (Idx, pstr->bufs_len);
+
+ if (pstr->offsets == NULL)
+ return REG_ESPACE;
+ }
+ if (!pstr->offsets_needed)
+ {
+ for (i = 0; i < (size_t) byte_idx; ++i)
+ pstr->offsets[i] = i;
+ pstr->offsets_needed = 1;
+ }
+
+ memcpy (pstr->mbs + byte_idx, buf, mbcdlen);
+ pstr->wcs[byte_idx] = wcu;
+ pstr->offsets[byte_idx] = src_idx;
+ for (i = 1; i < mbcdlen; ++i)
+ {
+ pstr->offsets[byte_idx + i]
+ = src_idx + (i < mbclen ? i : mbclen - 1);
+ pstr->wcs[byte_idx + i] = WEOF;
+ }
+ pstr->len += mbcdlen - mbclen;
+ if (pstr->raw_stop > src_idx)
+ pstr->stop += mbcdlen - mbclen;
+ end_idx = (pstr->bufs_len > pstr->len)
+ ? pstr->len : pstr->bufs_len;
+ byte_idx += mbcdlen;
+ src_idx += mbclen;
+ continue;
+ }
+ else
+ memcpy (pstr->mbs + byte_idx, p, mbclen);
+ }
+ else
+ memcpy (pstr->mbs + byte_idx, p, mbclen);
+
+ if (__glibc_unlikely (pstr->offsets_needed != 0))
+ {
+ size_t i;
+ for (i = 0; i < mbclen; ++i)
+ pstr->offsets[byte_idx + i] = src_idx + i;
+ }
+ src_idx += mbclen;
+
+ pstr->wcs[byte_idx++] = wcu;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ else if (mbclen == (size_t) -1 || mbclen == 0
+ || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len))
+ {
+ /* It is an invalid character or '\0'. Just use the byte. */
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx];
+
+ if (__glibc_unlikely (pstr->trans != NULL))
+ ch = pstr->trans [ch];
+ pstr->mbs[byte_idx] = ch;
+
+ if (__glibc_unlikely (pstr->offsets_needed != 0))
+ pstr->offsets[byte_idx] = src_idx;
+ ++src_idx;
+
+ /* And also cast it to wide char. */
+ pstr->wcs[byte_idx++] = (wchar_t) ch;
+ if (__glibc_unlikely (mbclen == (size_t) -1))
+ pstr->cur_state = prev_st;
+ }
+ else
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+ }
+ pstr->valid_len = byte_idx;
+ pstr->valid_raw_len = src_idx;
+ return REG_NOERROR;
+}
+
+/* Skip characters until the index becomes greater than NEW_RAW_IDX.
+ Return the index. */
+
+static Idx
+re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc)
+{
+ mbstate_t prev_st;
+ Idx rawbuf_idx;
+ size_t mbclen;
+ wint_t wc = WEOF;
+
+ /* Skip the characters which are not necessary to check. */
+ for (rawbuf_idx = pstr->raw_mbs_idx + pstr->valid_raw_len;
+ rawbuf_idx < new_raw_idx;)
+ {
+ wchar_t wc2;
+ Idx remain_len = pstr->raw_len - rawbuf_idx;
+ prev_st = pstr->cur_state;
+ mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx,
+ remain_len, &pstr->cur_state);
+ if (__glibc_unlikely (mbclen == (size_t) -2 || mbclen == (size_t) -1
+ || mbclen == 0))
+ {
+ /* We treat these cases as a single byte character. */
+ if (mbclen == 0 || remain_len == 0)
+ wc = L'\0';
+ else
+ wc = *(unsigned char *) (pstr->raw_mbs + rawbuf_idx);
+ mbclen = 1;
+ pstr->cur_state = prev_st;
+ }
+ else
+ wc = wc2;
+ /* Then proceed the next character. */
+ rawbuf_idx += mbclen;
+ }
+ *last_wc = wc;
+ return rawbuf_idx;
+}
+
+/* Build the buffer PSTR->MBS, and apply the translation if we need.
+ This function is used in case of REG_ICASE. */
+
+static void
+build_upper_buffer (re_string_t *pstr)
+{
+ Idx char_idx, end_idx;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx)
+ {
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx];
+ if (__glibc_unlikely (pstr->trans != NULL))
+ ch = pstr->trans[ch];
+ pstr->mbs[char_idx] = toupper (ch);
+ }
+ pstr->valid_len = char_idx;
+ pstr->valid_raw_len = char_idx;
+}
+
+/* Apply TRANS to the buffer in PSTR. */
+
+static void
+re_string_translate_buffer (re_string_t *pstr)
+{
+ Idx buf_idx, end_idx;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ for (buf_idx = pstr->valid_len; buf_idx < end_idx; ++buf_idx)
+ {
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + buf_idx];
+ pstr->mbs[buf_idx] = pstr->trans[ch];
+ }
+
+ pstr->valid_len = buf_idx;
+ pstr->valid_raw_len = buf_idx;
+}
+
+/* This function re-construct the buffers.
+ Concretely, convert to wide character in case of pstr->mb_cur_max > 1,
+ convert to upper case in case of REG_ICASE, apply translation. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
+{
+ Idx offset;
+
+ if (__glibc_unlikely (pstr->raw_mbs_idx <= idx))
+ offset = idx - pstr->raw_mbs_idx;
+ else
+ {
+ /* Reset buffer. */
+ if (pstr->mb_cur_max > 1)
+ memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
+ pstr->len = pstr->raw_len;
+ pstr->stop = pstr->raw_stop;
+ pstr->valid_len = 0;
+ pstr->raw_mbs_idx = 0;
+ pstr->valid_raw_len = 0;
+ pstr->offsets_needed = 0;
+ pstr->tip_context = ((eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
+ : CONTEXT_NEWLINE | CONTEXT_BEGBUF);
+ if (!pstr->mbs_allocated)
+ pstr->mbs = (unsigned char *) pstr->raw_mbs;
+ offset = idx;
+ }
+
+ if (__glibc_likely (offset != 0))
+ {
+ /* Should the already checked characters be kept? */
+ if (__glibc_likely (offset < pstr->valid_raw_len))
+ {
+ /* Yes, move them to the front of the buffer. */
+ if (__glibc_unlikely (pstr->offsets_needed))
+ {
+ Idx low = 0, high = pstr->valid_len, mid;
+ do
+ {
+ mid = (high + low) / 2;
+ if (pstr->offsets[mid] > offset)
+ high = mid;
+ else if (pstr->offsets[mid] < offset)
+ low = mid + 1;
+ else
+ break;
+ }
+ while (low < high);
+ if (pstr->offsets[mid] < offset)
+ ++mid;
+ pstr->tip_context = re_string_context_at (pstr, mid - 1,
+ eflags);
+ /* This can be quite complicated, so handle specially
+ only the common and easy case where the character with
+ different length representation of lower and upper
+ case is present at or after offset. */
+ if (pstr->valid_len > offset
+ && mid == offset && pstr->offsets[mid] == offset)
+ {
+ memmove (pstr->wcs, pstr->wcs + offset,
+ (pstr->valid_len - offset) * sizeof (wint_t));
+ memmove (pstr->mbs, pstr->mbs + offset, pstr->valid_len - offset);
+ pstr->valid_len -= offset;
+ pstr->valid_raw_len -= offset;
+ for (low = 0; low < pstr->valid_len; low++)
+ pstr->offsets[low] = pstr->offsets[low + offset] - offset;
+ }
+ else
+ {
+ /* Otherwise, just find out how long the partial multibyte
+ character at offset is and fill it with WEOF/255. */
+ pstr->len = pstr->raw_len - idx + offset;
+ pstr->stop = pstr->raw_stop - idx + offset;
+ pstr->offsets_needed = 0;
+ while (mid > 0 && pstr->offsets[mid - 1] == offset)
+ --mid;
+ while (mid < pstr->valid_len)
+ if (pstr->wcs[mid] != WEOF)
+ break;
+ else
+ ++mid;
+ if (mid == pstr->valid_len)
+ pstr->valid_len = 0;
+ else
+ {
+ pstr->valid_len = pstr->offsets[mid] - offset;
+ if (pstr->valid_len)
+ {
+ for (low = 0; low < pstr->valid_len; ++low)
+ pstr->wcs[low] = WEOF;
+ memset (pstr->mbs, 255, pstr->valid_len);
+ }
+ }
+ pstr->valid_raw_len = pstr->valid_len;
+ }
+ }
+ else
+ {
+ pstr->tip_context = re_string_context_at (pstr, offset - 1,
+ eflags);
+ if (pstr->mb_cur_max > 1)
+ memmove (pstr->wcs, pstr->wcs + offset,
+ (pstr->valid_len - offset) * sizeof (wint_t));
+ if (__glibc_unlikely (pstr->mbs_allocated))
+ memmove (pstr->mbs, pstr->mbs + offset,
+ pstr->valid_len - offset);
+ pstr->valid_len -= offset;
+ pstr->valid_raw_len -= offset;
+ DEBUG_ASSERT (pstr->valid_len > 0);
+ }
+ }
+ else
+ {
+ /* No, skip all characters until IDX. */
+ Idx prev_valid_len = pstr->valid_len;
+
+ if (__glibc_unlikely (pstr->offsets_needed))
+ {
+ pstr->len = pstr->raw_len - idx + offset;
+ pstr->stop = pstr->raw_stop - idx + offset;
+ pstr->offsets_needed = 0;
+ }
+ pstr->valid_len = 0;
+ if (pstr->mb_cur_max > 1)
+ {
+ Idx wcs_idx;
+ wint_t wc = WEOF;
+
+ if (pstr->is_utf8)
+ {
+ const unsigned char *raw, *p, *end;
+
+ /* Special case UTF-8. Multi-byte chars start with any
+ byte other than 0x80 - 0xbf. */
+ raw = pstr->raw_mbs + pstr->raw_mbs_idx;
+ end = raw + (offset - pstr->mb_cur_max);
+ if (end < pstr->raw_mbs)
+ end = pstr->raw_mbs;
+ p = raw + offset - 1;
+#ifdef _LIBC
+ /* We know the wchar_t encoding is UCS4, so for the simple
+ case, ASCII characters, skip the conversion step. */
+ if (isascii (*p) && __glibc_likely (pstr->trans == NULL))
+ {
+ memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
+ /* pstr->valid_len = 0; */
+ wc = (wchar_t) *p;
+ }
+ else
+#endif
+ for (; p >= end; --p)
+ if ((*p & 0xc0) != 0x80)
+ {
+ mbstate_t cur_state;
+ wchar_t wc2;
+ Idx mlen = raw + pstr->len - p;
+ unsigned char buf[6];
+ size_t mbclen;
+
+ const unsigned char *pp = p;
+ if (__glibc_unlikely (pstr->trans != NULL))
+ {
+ int i = mlen < 6 ? mlen : 6;
+ while (--i >= 0)
+ buf[i] = pstr->trans[p[i]];
+ pp = buf;
+ }
+ /* XXX Don't use mbrtowc, we know which conversion
+ to use (UTF-8 -> UCS4). */
+ memset (&cur_state, 0, sizeof (cur_state));
+ mbclen = __mbrtowc (&wc2, (const char *) pp, mlen,
+ &cur_state);
+ if (raw + offset - p <= mbclen
+ && mbclen < (size_t) -2)
+ {
+ memset (&pstr->cur_state, '\0',
+ sizeof (mbstate_t));
+ pstr->valid_len = mbclen - (raw + offset - p);
+ wc = wc2;
+ }
+ break;
+ }
+ }
+
+ if (wc == WEOF)
+ pstr->valid_len = re_string_skip_chars (pstr, idx, &wc) - idx;
+ if (wc == WEOF)
+ pstr->tip_context
+ = re_string_context_at (pstr, prev_valid_len - 1, eflags);
+ else
+ pstr->tip_context = ((__glibc_unlikely (pstr->word_ops_used != 0)
+ && IS_WIDE_WORD_CHAR (wc))
+ ? CONTEXT_WORD
+ : ((IS_WIDE_NEWLINE (wc)
+ && pstr->newline_anchor)
+ ? CONTEXT_NEWLINE : 0));
+ if (__glibc_unlikely (pstr->valid_len))
+ {
+ for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx)
+ pstr->wcs[wcs_idx] = WEOF;
+ if (pstr->mbs_allocated)
+ memset (pstr->mbs, 255, pstr->valid_len);
+ }
+ pstr->valid_raw_len = pstr->valid_len;
+ }
+ else
+ {
+ int c = pstr->raw_mbs[pstr->raw_mbs_idx + offset - 1];
+ pstr->valid_raw_len = 0;
+ if (pstr->trans)
+ c = pstr->trans[c];
+ pstr->tip_context = (bitset_contain (pstr->word_char, c)
+ ? CONTEXT_WORD
+ : ((IS_NEWLINE (c) && pstr->newline_anchor)
+ ? CONTEXT_NEWLINE : 0));
+ }
+ }
+ if (!__glibc_unlikely (pstr->mbs_allocated))
+ pstr->mbs += offset;
+ }
+ pstr->raw_mbs_idx = idx;
+ pstr->len -= offset;
+ pstr->stop -= offset;
+
+ /* Then build the buffers. */
+ if (pstr->mb_cur_max > 1)
+ {
+ if (pstr->icase)
+ {
+ reg_errcode_t ret = build_wcs_upper_buffer (pstr);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ else
+ build_wcs_buffer (pstr);
+ }
+ else
+ if (__glibc_unlikely (pstr->mbs_allocated))
+ {
+ if (pstr->icase)
+ build_upper_buffer (pstr);
+ else if (pstr->trans != NULL)
+ re_string_translate_buffer (pstr);
+ }
+ else
+ pstr->valid_len = pstr->len;
+
+ pstr->cur_idx = 0;
+ return REG_NOERROR;
+}
+
+static unsigned char
+__attribute__ ((pure))
+re_string_peek_byte_case (const re_string_t *pstr, Idx idx)
+{
+ int ch;
+ Idx off;
+
+ /* Handle the common (easiest) cases first. */
+ if (__glibc_likely (!pstr->mbs_allocated))
+ return re_string_peek_byte (pstr, idx);
+
+ if (pstr->mb_cur_max > 1
+ && ! re_string_is_single_byte_char (pstr, pstr->cur_idx + idx))
+ return re_string_peek_byte (pstr, idx);
+
+ off = pstr->cur_idx + idx;
+ if (pstr->offsets_needed)
+ off = pstr->offsets[off];
+
+ ch = pstr->raw_mbs[pstr->raw_mbs_idx + off];
+
+ /* Ensure that e.g. for tr_TR.UTF-8 BACKSLASH DOTLESS SMALL LETTER I
+ this function returns CAPITAL LETTER I instead of first byte of
+ DOTLESS SMALL LETTER I. The latter would confuse the parser,
+ since peek_byte_case doesn't advance cur_idx in any way. */
+ if (pstr->offsets_needed && !isascii (ch))
+ return re_string_peek_byte (pstr, idx);
+
+ return ch;
+}
+
+static unsigned char
+re_string_fetch_byte_case (re_string_t *pstr)
+{
+ if (__glibc_likely (!pstr->mbs_allocated))
+ return re_string_fetch_byte (pstr);
+
+ if (pstr->offsets_needed)
+ {
+ Idx off;
+ int ch;
+
+ /* For tr_TR.UTF-8 [[:islower:]] there is
+ [[: CAPITAL LETTER I WITH DOT lower:]] in mbs. Skip
+ in that case the whole multi-byte character and return
+ the original letter. On the other side, with
+ [[: DOTLESS SMALL LETTER I return [[:I, as doing
+ anything else would complicate things too much. */
+
+ if (!re_string_first_byte (pstr, pstr->cur_idx))
+ return re_string_fetch_byte (pstr);
+
+ off = pstr->offsets[pstr->cur_idx];
+ ch = pstr->raw_mbs[pstr->raw_mbs_idx + off];
+
+ if (! isascii (ch))
+ return re_string_fetch_byte (pstr);
+
+ re_string_skip_bytes (pstr,
+ re_string_char_size_at (pstr, pstr->cur_idx));
+ return ch;
+ }
+
+ return pstr->raw_mbs[pstr->raw_mbs_idx + pstr->cur_idx++];
+}
+
+static void
+re_string_destruct (re_string_t *pstr)
+{
+ re_free (pstr->wcs);
+ re_free (pstr->offsets);
+ if (pstr->mbs_allocated)
+ re_free (pstr->mbs);
+}
+
+/* Return the context at IDX in INPUT. */
+
+static unsigned int
+re_string_context_at (const re_string_t *input, Idx idx, int eflags)
+{
+ int c;
+ if (__glibc_unlikely (idx < 0))
+ /* In this case, we use the value stored in input->tip_context,
+ since we can't know the character in input->mbs[-1] here. */
+ return input->tip_context;
+ if (__glibc_unlikely (idx == input->len))
+ return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
+ : CONTEXT_NEWLINE | CONTEXT_ENDBUF);
+ if (input->mb_cur_max > 1)
+ {
+ wint_t wc;
+ Idx wc_idx = idx;
+ while(input->wcs[wc_idx] == WEOF)
+ {
+ DEBUG_ASSERT (wc_idx >= 0);
+ --wc_idx;
+ if (wc_idx < 0)
+ return input->tip_context;
+ }
+ wc = input->wcs[wc_idx];
+ if (__glibc_unlikely (input->word_ops_used != 0)
+ && IS_WIDE_WORD_CHAR (wc))
+ return CONTEXT_WORD;
+ return (IS_WIDE_NEWLINE (wc) && input->newline_anchor
+ ? CONTEXT_NEWLINE : 0);
+ }
+ else
+ {
+ c = re_string_byte_at (input, idx);
+ if (bitset_contain (input->word_char, c))
+ return CONTEXT_WORD;
+ return IS_NEWLINE (c) && input->newline_anchor ? CONTEXT_NEWLINE : 0;
+ }
+}
+
+/* Functions for set operation. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_alloc (re_node_set *set, Idx size)
+{
+ set->alloc = size;
+ set->nelem = 0;
+ set->elems = re_malloc (Idx, size);
+ if (__glibc_unlikely (set->elems == NULL)
+ && (MALLOC_0_IS_NONNULL || size != 0))
+ return REG_ESPACE;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_1 (re_node_set *set, Idx elem)
+{
+ set->alloc = 1;
+ set->nelem = 1;
+ set->elems = re_malloc (Idx, 1);
+ if (__glibc_unlikely (set->elems == NULL))
+ {
+ set->alloc = set->nelem = 0;
+ return REG_ESPACE;
+ }
+ set->elems[0] = elem;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2)
+{
+ set->alloc = 2;
+ set->elems = re_malloc (Idx, 2);
+ if (__glibc_unlikely (set->elems == NULL))
+ return REG_ESPACE;
+ if (elem1 == elem2)
+ {
+ set->nelem = 1;
+ set->elems[0] = elem1;
+ }
+ else
+ {
+ set->nelem = 2;
+ if (elem1 < elem2)
+ {
+ set->elems[0] = elem1;
+ set->elems[1] = elem2;
+ }
+ else
+ {
+ set->elems[0] = elem2;
+ set->elems[1] = elem1;
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
+{
+ dest->nelem = src->nelem;
+ if (src->nelem > 0)
+ {
+ dest->alloc = dest->nelem;
+ dest->elems = re_malloc (Idx, dest->alloc);
+ if (__glibc_unlikely (dest->elems == NULL))
+ {
+ dest->alloc = dest->nelem = 0;
+ return REG_ESPACE;
+ }
+ memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx));
+ }
+ else
+ re_node_set_init_empty (dest);
+ return REG_NOERROR;
+}
+
+/* Calculate the intersection of the sets SRC1 and SRC2. And merge it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded.
+ Note: We assume dest->elems is NULL, when dest->alloc is 0. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
+ const re_node_set *src2)
+{
+ Idx i1, i2, is, id, delta, sbase;
+ if (src1->nelem == 0 || src2->nelem == 0)
+ return REG_NOERROR;
+
+ /* We need dest->nelem + 2 * elems_in_intersection; this is a
+ conservative estimate. */
+ if (src1->nelem + src2->nelem + dest->nelem > dest->alloc)
+ {
+ Idx new_alloc = src1->nelem + src2->nelem + dest->alloc;
+ Idx *new_elems = re_realloc (dest->elems, Idx, new_alloc);
+ if (__glibc_unlikely (new_elems == NULL))
+ return REG_ESPACE;
+ dest->elems = new_elems;
+ dest->alloc = new_alloc;
+ }
+
+ /* Find the items in the intersection of SRC1 and SRC2, and copy
+ into the top of DEST those that are not already in DEST itself. */
+ sbase = dest->nelem + src1->nelem + src2->nelem;
+ i1 = src1->nelem - 1;
+ i2 = src2->nelem - 1;
+ id = dest->nelem - 1;
+ for (;;)
+ {
+ if (src1->elems[i1] == src2->elems[i2])
+ {
+ /* Try to find the item in DEST. Maybe we could binary search? */
+ while (id >= 0 && dest->elems[id] > src1->elems[i1])
+ --id;
+
+ if (id < 0 || dest->elems[id] != src1->elems[i1])
+ dest->elems[--sbase] = src1->elems[i1];
+
+ if (--i1 < 0 || --i2 < 0)
+ break;
+ }
+
+ /* Lower the highest of the two items. */
+ else if (src1->elems[i1] < src2->elems[i2])
+ {
+ if (--i2 < 0)
+ break;
+ }
+ else
+ {
+ if (--i1 < 0)
+ break;
+ }
+ }
+
+ id = dest->nelem - 1;
+ is = dest->nelem + src1->nelem + src2->nelem - 1;
+ delta = is - sbase + 1;
+
+ /* Now copy. When DELTA becomes zero, the remaining
+ DEST elements are already in place; this is more or
+ less the same loop that is in re_node_set_merge. */
+ dest->nelem += delta;
+ if (delta > 0 && id >= 0)
+ for (;;)
+ {
+ if (dest->elems[is] > dest->elems[id])
+ {
+ /* Copy from the top. */
+ dest->elems[id + delta--] = dest->elems[is--];
+ if (delta == 0)
+ break;
+ }
+ else
+ {
+ /* Slide from the bottom. */
+ dest->elems[id + delta] = dest->elems[id];
+ if (--id < 0)
+ break;
+ }
+ }
+
+ /* Copy remaining SRC elements. */
+ memcpy (dest->elems, dest->elems + sbase, delta * sizeof (Idx));
+
+ return REG_NOERROR;
+}
+
+/* Calculate the union set of the sets SRC1 and SRC2. And store it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_init_union (re_node_set *dest, const re_node_set *src1,
+ const re_node_set *src2)
+{
+ Idx i1, i2, id;
+ if (src1 != NULL && src1->nelem > 0 && src2 != NULL && src2->nelem > 0)
+ {
+ dest->alloc = src1->nelem + src2->nelem;
+ dest->elems = re_malloc (Idx, dest->alloc);
+ if (__glibc_unlikely (dest->elems == NULL))
+ return REG_ESPACE;
+ }
+ else
+ {
+ if (src1 != NULL && src1->nelem > 0)
+ return re_node_set_init_copy (dest, src1);
+ else if (src2 != NULL && src2->nelem > 0)
+ return re_node_set_init_copy (dest, src2);
+ else
+ re_node_set_init_empty (dest);
+ return REG_NOERROR;
+ }
+ for (i1 = i2 = id = 0 ; i1 < src1->nelem && i2 < src2->nelem ;)
+ {
+ if (src1->elems[i1] > src2->elems[i2])
+ {
+ dest->elems[id++] = src2->elems[i2++];
+ continue;
+ }
+ if (src1->elems[i1] == src2->elems[i2])
+ ++i2;
+ dest->elems[id++] = src1->elems[i1++];
+ }
+ if (i1 < src1->nelem)
+ {
+ memcpy (dest->elems + id, src1->elems + i1,
+ (src1->nelem - i1) * sizeof (Idx));
+ id += src1->nelem - i1;
+ }
+ else if (i2 < src2->nelem)
+ {
+ memcpy (dest->elems + id, src2->elems + i2,
+ (src2->nelem - i2) * sizeof (Idx));
+ id += src2->nelem - i2;
+ }
+ dest->nelem = id;
+ return REG_NOERROR;
+}
+
+/* Calculate the union set of the sets DEST and SRC. And store it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_node_set_merge (re_node_set *dest, const re_node_set *src)
+{
+ Idx is, id, sbase, delta;
+ if (src == NULL || src->nelem == 0)
+ return REG_NOERROR;
+ if (dest->alloc < 2 * src->nelem + dest->nelem)
+ {
+ Idx new_alloc = 2 * (src->nelem + dest->alloc);
+ Idx *new_buffer = re_realloc (dest->elems, Idx, new_alloc);
+ if (__glibc_unlikely (new_buffer == NULL))
+ return REG_ESPACE;
+ dest->elems = new_buffer;
+ dest->alloc = new_alloc;
+ }
+
+ if (__glibc_unlikely (dest->nelem == 0))
+ {
+ /* Although we already guaranteed above that dest->alloc != 0 and
+ therefore dest->elems != NULL, add a debug assertion to pacify
+ GCC 11.2.1's -fanalyzer. */
+ DEBUG_ASSERT (dest->elems);
+ dest->nelem = src->nelem;
+ memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx));
+ return REG_NOERROR;
+ }
+
+ /* Copy into the top of DEST the items of SRC that are not
+ found in DEST. Maybe we could binary search in DEST? */
+ for (sbase = dest->nelem + 2 * src->nelem,
+ is = src->nelem - 1, id = dest->nelem - 1; is >= 0 && id >= 0; )
+ {
+ if (dest->elems[id] == src->elems[is])
+ is--, id--;
+ else if (dest->elems[id] < src->elems[is])
+ dest->elems[--sbase] = src->elems[is--];
+ else /* if (dest->elems[id] > src->elems[is]) */
+ --id;
+ }
+
+ if (is >= 0)
+ {
+ /* If DEST is exhausted, the remaining items of SRC must be unique. */
+ sbase -= is + 1;
+ memcpy (dest->elems + sbase, src->elems, (is + 1) * sizeof (Idx));
+ }
+
+ id = dest->nelem - 1;
+ is = dest->nelem + 2 * src->nelem - 1;
+ delta = is - sbase + 1;
+ if (delta == 0)
+ return REG_NOERROR;
+
+ /* Now copy. When DELTA becomes zero, the remaining
+ DEST elements are already in place. */
+ dest->nelem += delta;
+ for (;;)
+ {
+ if (dest->elems[is] > dest->elems[id])
+ {
+ /* Copy from the top. */
+ dest->elems[id + delta--] = dest->elems[is--];
+ if (delta == 0)
+ break;
+ }
+ else
+ {
+ /* Slide from the bottom. */
+ dest->elems[id + delta] = dest->elems[id];
+ if (--id < 0)
+ {
+ /* Copy remaining SRC elements. */
+ memcpy (dest->elems, dest->elems + sbase,
+ delta * sizeof (Idx));
+ break;
+ }
+ }
+ }
+
+ return REG_NOERROR;
+}
+
+/* Insert the new element ELEM to the re_node_set* SET.
+ SET should not already have ELEM.
+ Return true if successful. */
+
+static bool
+__attribute_warn_unused_result__
+re_node_set_insert (re_node_set *set, Idx elem)
+{
+ Idx idx;
+ /* In case the set is empty. */
+ if (set->alloc == 0)
+ return __glibc_likely (re_node_set_init_1 (set, elem) == REG_NOERROR);
+
+ if (__glibc_unlikely (set->nelem) == 0)
+ {
+ /* Although we already guaranteed above that set->alloc != 0 and
+ therefore set->elems != NULL, add a debug assertion to pacify
+ GCC 11.2 -fanalyzer. */
+ DEBUG_ASSERT (set->elems);
+ set->elems[0] = elem;
+ ++set->nelem;
+ return true;
+ }
+
+ /* Realloc if we need. */
+ if (set->alloc == set->nelem)
+ {
+ Idx *new_elems;
+ set->alloc = set->alloc * 2;
+ new_elems = re_realloc (set->elems, Idx, set->alloc);
+ if (__glibc_unlikely (new_elems == NULL))
+ return false;
+ set->elems = new_elems;
+ }
+
+ /* Move the elements which follows the new element. Test the
+ first element separately to skip a check in the inner loop. */
+ if (elem < set->elems[0])
+ {
+ for (idx = set->nelem; idx > 0; idx--)
+ set->elems[idx] = set->elems[idx - 1];
+ }
+ else
+ {
+ for (idx = set->nelem; set->elems[idx - 1] > elem; idx--)
+ set->elems[idx] = set->elems[idx - 1];
+ DEBUG_ASSERT (set->elems[idx - 1] < elem);
+ }
+
+ /* Insert the new element. */
+ set->elems[idx] = elem;
+ ++set->nelem;
+ return true;
+}
+
+/* Insert the new element ELEM to the re_node_set* SET.
+ SET should not already have any element greater than or equal to ELEM.
+ Return true if successful. */
+
+static bool
+__attribute_warn_unused_result__
+re_node_set_insert_last (re_node_set *set, Idx elem)
+{
+ /* Realloc if we need. */
+ if (set->alloc == set->nelem)
+ {
+ Idx *new_elems;
+ set->alloc = (set->alloc + 1) * 2;
+ new_elems = re_realloc (set->elems, Idx, set->alloc);
+ if (__glibc_unlikely (new_elems == NULL))
+ return false;
+ set->elems = new_elems;
+ }
+
+ /* Insert the new element. */
+ set->elems[set->nelem++] = elem;
+ return true;
+}
+
+/* Compare two node sets SET1 and SET2.
+ Return true if SET1 and SET2 are equivalent. */
+
+static bool
+__attribute__ ((pure))
+re_node_set_compare (const re_node_set *set1, const re_node_set *set2)
+{
+ Idx i;
+ if (set1 == NULL || set2 == NULL || set1->nelem != set2->nelem)
+ return false;
+ for (i = set1->nelem ; --i >= 0 ; )
+ if (set1->elems[i] != set2->elems[i])
+ return false;
+ return true;
+}
+
+/* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */
+
+static Idx
+__attribute__ ((pure))
+re_node_set_contains (const re_node_set *set, Idx elem)
+{
+ __re_size_t idx, right, mid;
+ if (set->nelem <= 0)
+ return 0;
+
+ /* Binary search the element. */
+ idx = 0;
+ right = set->nelem - 1;
+ while (idx < right)
+ {
+ mid = (idx + right) / 2;
+ if (set->elems[mid] < elem)
+ idx = mid + 1;
+ else
+ right = mid;
+ }
+ return set->elems[idx] == elem ? idx + 1 : 0;
+}
+
+static void
+re_node_set_remove_at (re_node_set *set, Idx idx)
+{
+ if (idx < 0 || idx >= set->nelem)
+ return;
+ --set->nelem;
+ for (; idx < set->nelem; idx++)
+ set->elems[idx] = set->elems[idx + 1];
+}
+
+
+/* Add the token TOKEN to dfa->nodes, and return the index of the token.
+ Or return -1 if an error occurred. */
+
+static Idx
+re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
+{
+ if (__glibc_unlikely (dfa->nodes_len >= dfa->nodes_alloc))
+ {
+ size_t new_nodes_alloc = dfa->nodes_alloc * 2;
+ Idx *new_nexts, *new_indices;
+ re_node_set *new_edests, *new_eclosures;
+ re_token_t *new_nodes;
+
+ /* Avoid overflows in realloc. */
+ const size_t max_object_size = MAX (sizeof (re_token_t),
+ MAX (sizeof (re_node_set),
+ sizeof (Idx)));
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size)
+ < new_nodes_alloc))
+ return -1;
+
+ new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);
+ if (__glibc_unlikely (new_nodes == NULL))
+ return -1;
+ dfa->nodes = new_nodes;
+ dfa->nodes_alloc = new_nodes_alloc;
+ new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc);
+ if (new_nexts != NULL)
+ dfa->nexts = new_nexts;
+ new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc);
+ if (new_indices != NULL)
+ dfa->org_indices = new_indices;
+ new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc);
+ if (new_edests != NULL)
+ dfa->edests = new_edests;
+ new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc);
+ if (new_eclosures != NULL)
+ dfa->eclosures = new_eclosures;
+ if (__glibc_unlikely (new_nexts == NULL || new_indices == NULL
+ || new_edests == NULL || new_eclosures == NULL))
+ return -1;
+ }
+ dfa->nodes[dfa->nodes_len] = token;
+ dfa->nodes[dfa->nodes_len].constraint = 0;
+ dfa->nodes[dfa->nodes_len].accept_mb =
+ ((token.type == OP_PERIOD && dfa->mb_cur_max > 1)
+ || token.type == COMPLEX_BRACKET);
+ dfa->nexts[dfa->nodes_len] = -1;
+ re_node_set_init_empty (dfa->edests + dfa->nodes_len);
+ re_node_set_init_empty (dfa->eclosures + dfa->nodes_len);
+ return dfa->nodes_len++;
+}
+
+static re_hashval_t
+calc_state_hash (const re_node_set *nodes, unsigned int context)
+{
+ re_hashval_t hash = nodes->nelem + context;
+ Idx i;
+ for (i = 0 ; i < nodes->nelem ; i++)
+ hash += nodes->elems[i];
+ return hash;
+}
+
+/* Search for the state whose node_set is equivalent to NODES.
+ Return the pointer to the state, if we found it in the DFA.
+ Otherwise create the new one and return it. In case of an error
+ return NULL and set the error code in ERR.
+ Note: - We assume NULL as the invalid state, then it is possible that
+ return value is NULL and ERR is REG_NOERROR.
+ - We never return non-NULL value in case of any errors, it is for
+ optimization. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
+ const re_node_set *nodes)
+{
+ re_hashval_t hash;
+ re_dfastate_t *new_state;
+ struct re_state_table_entry *spot;
+ Idx i;
+#if defined GCC_LINT || defined lint
+ /* Suppress bogus uninitialized-variable warnings. */
+ *err = REG_NOERROR;
+#endif
+ if (__glibc_unlikely (nodes->nelem == 0))
+ {
+ *err = REG_NOERROR;
+ return NULL;
+ }
+ hash = calc_state_hash (nodes, 0);
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+
+ for (i = 0 ; i < spot->num ; i++)
+ {
+ re_dfastate_t *state = spot->array[i];
+ if (hash != state->hash)
+ continue;
+ if (re_node_set_compare (&state->nodes, nodes))
+ return state;
+ }
+
+ /* There are no appropriate state in the dfa, create the new one. */
+ new_state = create_ci_newstate (dfa, nodes, hash);
+ if (__glibc_unlikely (new_state == NULL))
+ *err = REG_ESPACE;
+
+ return new_state;
+}
+
+/* Search for the state whose node_set is equivalent to NODES and
+ whose context is equivalent to CONTEXT.
+ Return the pointer to the state, if we found it in the DFA.
+ Otherwise create the new one and return it. In case of an error
+ return NULL and set the error code in ERR.
+ Note: - We assume NULL as the invalid state, then it is possible that
+ return value is NULL and ERR is REG_NOERROR.
+ - We never return non-NULL value in case of any errors, it is for
+ optimization. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
+ const re_node_set *nodes, unsigned int context)
+{
+ re_hashval_t hash;
+ re_dfastate_t *new_state;
+ struct re_state_table_entry *spot;
+ Idx i;
+#if defined GCC_LINT || defined lint
+ /* Suppress bogus uninitialized-variable warnings. */
+ *err = REG_NOERROR;
+#endif
+ if (nodes->nelem == 0)
+ {
+ *err = REG_NOERROR;
+ return NULL;
+ }
+ hash = calc_state_hash (nodes, context);
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+
+ for (i = 0 ; i < spot->num ; i++)
+ {
+ re_dfastate_t *state = spot->array[i];
+ if (state->hash == hash
+ && state->context == context
+ && re_node_set_compare (state->entrance_nodes, nodes))
+ return state;
+ }
+ /* There are no appropriate state in 'dfa', create the new one. */
+ new_state = create_cd_newstate (dfa, nodes, context, hash);
+ if (__glibc_unlikely (new_state == NULL))
+ *err = REG_ESPACE;
+
+ return new_state;
+}
+
+/* Finish initialization of the new state NEWSTATE, and using its hash value
+ HASH put in the appropriate bucket of DFA's state table. Return value
+ indicates the error code if failed. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+register_state (const re_dfa_t *dfa, re_dfastate_t *newstate,
+ re_hashval_t hash)
+{
+ struct re_state_table_entry *spot;
+ reg_errcode_t err;
+ Idx i;
+
+ newstate->hash = hash;
+ err = re_node_set_alloc (&newstate->non_eps_nodes, newstate->nodes.nelem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return REG_ESPACE;
+ for (i = 0; i < newstate->nodes.nelem; i++)
+ {
+ Idx elem = newstate->nodes.elems[i];
+ if (!IS_EPSILON_NODE (dfa->nodes[elem].type))
+ if (! re_node_set_insert_last (&newstate->non_eps_nodes, elem))
+ return REG_ESPACE;
+ }
+
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+ if (__glibc_unlikely (spot->alloc <= spot->num))
+ {
+ Idx new_alloc = 2 * spot->num + 2;
+ re_dfastate_t **new_array = re_realloc (spot->array, re_dfastate_t *,
+ new_alloc);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ spot->array = new_array;
+ spot->alloc = new_alloc;
+ }
+ spot->array[spot->num++] = newstate;
+ return REG_NOERROR;
+}
+
+static void
+free_state (re_dfastate_t *state)
+{
+ re_node_set_free (&state->non_eps_nodes);
+ re_node_set_free (&state->inveclosure);
+ if (state->entrance_nodes != &state->nodes)
+ {
+ re_node_set_free (state->entrance_nodes);
+ re_free (state->entrance_nodes);
+ }
+ re_node_set_free (&state->nodes);
+ re_free (state->word_trtable);
+ re_free (state->trtable);
+ re_free (state);
+}
+
+/* Create the new state which is independent of contexts.
+ Return the new state if succeeded, otherwise return NULL. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
+ re_hashval_t hash)
+{
+ Idx i;
+ reg_errcode_t err;
+ re_dfastate_t *newstate;
+
+ newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1);
+ if (__glibc_unlikely (newstate == NULL))
+ return NULL;
+ err = re_node_set_init_copy (&newstate->nodes, nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_free (newstate);
+ return NULL;
+ }
+
+ newstate->entrance_nodes = &newstate->nodes;
+ for (i = 0 ; i < nodes->nelem ; i++)
+ {
+ re_token_t *node = dfa->nodes + nodes->elems[i];
+ re_token_type_t type = node->type;
+ if (type == CHARACTER && !node->constraint)
+ continue;
+ newstate->accept_mb |= node->accept_mb;
+
+ /* If the state has the halt node, the state is a halt state. */
+ if (type == END_OF_RE)
+ newstate->halt = 1;
+ else if (type == OP_BACK_REF)
+ newstate->has_backref = 1;
+ else if (type == ANCHOR || node->constraint)
+ newstate->has_constraint = 1;
+ }
+ err = register_state (dfa, newstate, hash);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ free_state (newstate);
+ newstate = NULL;
+ }
+ return newstate;
+}
+
+/* Create the new state which is depend on the context CONTEXT.
+ Return the new state if succeeded, otherwise return NULL. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
+ unsigned int context, re_hashval_t hash)
+{
+ Idx i, nctx_nodes = 0;
+ reg_errcode_t err;
+ re_dfastate_t *newstate;
+
+ newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1);
+ if (__glibc_unlikely (newstate == NULL))
+ return NULL;
+ err = re_node_set_init_copy (&newstate->nodes, nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_free (newstate);
+ return NULL;
+ }
+
+ newstate->context = context;
+ newstate->entrance_nodes = &newstate->nodes;
+
+ for (i = 0 ; i < nodes->nelem ; i++)
+ {
+ re_token_t *node = dfa->nodes + nodes->elems[i];
+ re_token_type_t type = node->type;
+ unsigned int constraint = node->constraint;
+
+ if (type == CHARACTER && !constraint)
+ continue;
+ newstate->accept_mb |= node->accept_mb;
+
+ /* If the state has the halt node, the state is a halt state. */
+ if (type == END_OF_RE)
+ newstate->halt = 1;
+ else if (type == OP_BACK_REF)
+ newstate->has_backref = 1;
+
+ if (constraint)
+ {
+ if (newstate->entrance_nodes == &newstate->nodes)
+ {
+ re_node_set *entrance_nodes = re_malloc (re_node_set, 1);
+ if (__glibc_unlikely (entrance_nodes == NULL))
+ {
+ free_state (newstate);
+ return NULL;
+ }
+ newstate->entrance_nodes = entrance_nodes;
+ if (re_node_set_init_copy (newstate->entrance_nodes, nodes)
+ != REG_NOERROR)
+ {
+ free_state (newstate);
+ return NULL;
+ }
+ nctx_nodes = 0;
+ newstate->has_constraint = 1;
+ }
+
+ if (NOT_SATISFY_PREV_CONSTRAINT (constraint,context))
+ {
+ re_node_set_remove_at (&newstate->nodes, i - nctx_nodes);
+ ++nctx_nodes;
+ }
+ }
+ }
+ err = register_state (dfa, newstate, hash);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ free_state (newstate);
+ newstate = NULL;
+ }
+ return newstate;
+}
diff --git a/gl/regex_internal.h b/gl/regex_internal.h
new file mode 100644
index 0000000..149ec2e
--- /dev/null
+++ b/gl/regex_internal.h
@@ -0,0 +1,834 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _REGEX_INTERNAL_H
+#define _REGEX_INTERNAL_H 1
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <langinfo.h>
+#include <locale.h>
+#include <wchar.h>
+#include <wctype.h>
+#include <stdint.h>
+
+#ifndef _LIBC
+# include <dynarray.h>
+#endif
+
+#include <intprops.h>
+#include <verify.h>
+
+#if defined DEBUG && DEBUG != 0
+# include <assert.h>
+# define DEBUG_ASSERT(x) assert (x)
+#else
+# define DEBUG_ASSERT(x) assume (x)
+#endif
+
+#ifdef _LIBC
+# include <libc-lock.h>
+# define lock_define(name) __libc_lock_define (, name)
+# define lock_init(lock) (__libc_lock_init (lock), 0)
+# define lock_fini(lock) ((void) 0)
+# define lock_lock(lock) __libc_lock_lock (lock)
+# define lock_unlock(lock) __libc_lock_unlock (lock)
+#elif defined GNULIB_LOCK && !defined GNULIB_REGEX_SINGLE_THREAD
+# include "glthread/lock.h"
+# define lock_define(name) gl_lock_define (, name)
+# define lock_init(lock) glthread_lock_init (&(lock))
+# define lock_fini(lock) glthread_lock_destroy (&(lock))
+# define lock_lock(lock) glthread_lock_lock (&(lock))
+# define lock_unlock(lock) glthread_lock_unlock (&(lock))
+#elif defined GNULIB_PTHREAD && !defined GNULIB_REGEX_SINGLE_THREAD
+# include <pthread.h>
+# define lock_define(name) pthread_mutex_t name;
+# define lock_init(lock) pthread_mutex_init (&(lock), 0)
+# define lock_fini(lock) pthread_mutex_destroy (&(lock))
+# define lock_lock(lock) pthread_mutex_lock (&(lock))
+# define lock_unlock(lock) pthread_mutex_unlock (&(lock))
+#else
+# define lock_define(name)
+# define lock_init(lock) 0
+# define lock_fini(lock) ((void) 0)
+ /* The 'dfa' avoids an "unused variable 'dfa'" warning from GCC. */
+# define lock_lock(lock) ((void) dfa)
+# define lock_unlock(lock) ((void) 0)
+#endif
+
+/* In case that the system doesn't have isblank(). */
+#if !defined _LIBC && ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK))
+# define isblank(ch) ((ch) == ' ' || (ch) == '\t')
+#endif
+
+/* regex code assumes isascii has its usual numeric meaning,
+ even if the portable character set uses EBCDIC encoding,
+ and even if wint_t is wider than int. */
+#ifndef _LIBC
+# undef isascii
+# define isascii(c) (((c) & ~0x7f) == 0)
+#endif
+
+#ifdef _LIBC
+# ifndef _RE_DEFINE_LOCALE_FUNCTIONS
+# define _RE_DEFINE_LOCALE_FUNCTIONS 1
+# include <locale/localeinfo.h>
+# include <locale/coll-lookup.h>
+# endif
+#endif
+
+/* This is for other GNU distributions with internationalized messages. */
+#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
+# include <libintl.h>
+# ifdef _LIBC
+# undef gettext
+# define gettext(msgid) \
+ __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
+# endif
+#else
+# undef gettext
+# define gettext(msgid) (msgid)
+#endif
+
+#ifndef gettext_noop
+/* This define is so xgettext can find the internationalizable
+ strings. */
+# define gettext_noop(String) String
+#endif
+
+/* Number of ASCII characters. */
+#define ASCII_CHARS 0x80
+
+/* Number of single byte characters. */
+#define SBC_MAX (UCHAR_MAX + 1)
+
+#define COLL_ELEM_LEN_MAX 8
+
+/* The character which represents newline. */
+#define NEWLINE_CHAR '\n'
+#define WIDE_NEWLINE_CHAR L'\n'
+
+/* Rename to standard API for using out of glibc. */
+#ifndef _LIBC
+# undef __wctype
+# undef __iswalnum
+# undef __iswctype
+# undef __towlower
+# undef __towupper
+# define __wctype wctype
+# define __iswalnum iswalnum
+# define __iswctype iswctype
+# define __towlower towlower
+# define __towupper towupper
+# define __btowc btowc
+# define __mbrtowc mbrtowc
+# define __wcrtomb wcrtomb
+# define __regfree regfree
+#endif /* not _LIBC */
+
+/* Types related to integers. Unless protected by #ifdef _LIBC, the
+ regex code should avoid exact-width types like int32_t and uint64_t
+ as some non-GCC platforms lack them, an issue when this code is
+ used in Gnulib. */
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
+#endif
+#ifndef ULONG_WIDTH
+# define ULONG_WIDTH REGEX_UINTEGER_WIDTH (ULONG_MAX)
+/* The number of usable bits in an unsigned integer type with maximum
+ value MAX, as an int expression suitable in #if. Cover all known
+ practical hosts. This implementation exploits the fact that MAX is
+ 1 less than a power of 2, and merely counts the number of 1 bits in
+ MAX; "COBn" means "count the number of 1 bits in the low-order n bits". */
+# define REGEX_UINTEGER_WIDTH(max) REGEX_COB128 (max)
+# define REGEX_COB128(n) (REGEX_COB64 ((n) >> 31 >> 31 >> 2) + REGEX_COB64 (n))
+# define REGEX_COB64(n) (REGEX_COB32 ((n) >> 31 >> 1) + REGEX_COB32 (n))
+# define REGEX_COB32(n) (REGEX_COB16 ((n) >> 16) + REGEX_COB16 (n))
+# define REGEX_COB16(n) (REGEX_COB8 ((n) >> 8) + REGEX_COB8 (n))
+# define REGEX_COB8(n) (REGEX_COB4 ((n) >> 4) + REGEX_COB4 (n))
+# define REGEX_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + ((n) & 1))
+# if ULONG_MAX / 2 + 1 != 1ul << (ULONG_WIDTH - 1)
+# error "ULONG_MAX out of range"
+# endif
+#endif
+
+/* The type of indexes into strings. This is signed, not size_t,
+ since the API requires indexes to fit in regoff_t anyway, and using
+ signed integers makes the code a bit smaller and presumably faster.
+ The traditional GNU regex implementation uses int for indexes.
+ The POSIX-compatible implementation uses a possibly-wider type.
+ The name 'Idx' is three letters to minimize the hassle of
+ reindenting a lot of regex code that formerly used 'int'. */
+typedef regoff_t Idx;
+#ifdef _REGEX_LARGE_OFFSETS
+# define IDX_MAX SSIZE_MAX
+#else
+# define IDX_MAX INT_MAX
+#endif
+
+/* A hash value, suitable for computing hash tables. */
+typedef __re_size_t re_hashval_t;
+
+/* An integer used to represent a set of bits. It must be unsigned,
+ and must be at least as wide as unsigned int. */
+typedef unsigned long int bitset_word_t;
+/* All bits set in a bitset_word_t. */
+#define BITSET_WORD_MAX ULONG_MAX
+/* Number of bits in a bitset_word_t. */
+#define BITSET_WORD_BITS ULONG_WIDTH
+
+/* Number of bitset_word_t values in a bitset_t. */
+#define BITSET_WORDS ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
+
+typedef bitset_word_t bitset_t[BITSET_WORDS];
+typedef bitset_word_t *re_bitset_ptr_t;
+typedef const bitset_word_t *re_const_bitset_ptr_t;
+
+#define PREV_WORD_CONSTRAINT 0x0001
+#define PREV_NOTWORD_CONSTRAINT 0x0002
+#define NEXT_WORD_CONSTRAINT 0x0004
+#define NEXT_NOTWORD_CONSTRAINT 0x0008
+#define PREV_NEWLINE_CONSTRAINT 0x0010
+#define NEXT_NEWLINE_CONSTRAINT 0x0020
+#define PREV_BEGBUF_CONSTRAINT 0x0040
+#define NEXT_ENDBUF_CONSTRAINT 0x0080
+#define WORD_DELIM_CONSTRAINT 0x0100
+#define NOT_WORD_DELIM_CONSTRAINT 0x0200
+
+typedef enum
+{
+ INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
+ WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
+ WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
+ INSIDE_NOTWORD = PREV_NOTWORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
+ LINE_FIRST = PREV_NEWLINE_CONSTRAINT,
+ LINE_LAST = NEXT_NEWLINE_CONSTRAINT,
+ BUF_FIRST = PREV_BEGBUF_CONSTRAINT,
+ BUF_LAST = NEXT_ENDBUF_CONSTRAINT,
+ WORD_DELIM = WORD_DELIM_CONSTRAINT,
+ NOT_WORD_DELIM = NOT_WORD_DELIM_CONSTRAINT
+} re_context_type;
+
+typedef struct
+{
+ Idx alloc;
+ Idx nelem;
+ Idx *elems;
+} re_node_set;
+
+typedef enum
+{
+ NON_TYPE = 0,
+
+ /* Node type, These are used by token, node, tree. */
+ CHARACTER = 1,
+ END_OF_RE = 2,
+ SIMPLE_BRACKET = 3,
+ OP_BACK_REF = 4,
+ OP_PERIOD = 5,
+ COMPLEX_BRACKET = 6,
+ OP_UTF8_PERIOD = 7,
+
+ /* We define EPSILON_BIT as a macro so that OP_OPEN_SUBEXP is used
+ when the debugger shows values of this enum type. */
+#define EPSILON_BIT 8
+ OP_OPEN_SUBEXP = EPSILON_BIT | 0,
+ OP_CLOSE_SUBEXP = EPSILON_BIT | 1,
+ OP_ALT = EPSILON_BIT | 2,
+ OP_DUP_ASTERISK = EPSILON_BIT | 3,
+ ANCHOR = EPSILON_BIT | 4,
+
+ /* Tree type, these are used only by tree. */
+ CONCAT = 16,
+ SUBEXP = 17,
+
+ /* Token type, these are used only by token. */
+ OP_DUP_PLUS = 18,
+ OP_DUP_QUESTION,
+ OP_OPEN_BRACKET,
+ OP_CLOSE_BRACKET,
+ OP_CHARSET_RANGE,
+ OP_OPEN_DUP_NUM,
+ OP_CLOSE_DUP_NUM,
+ OP_NON_MATCH_LIST,
+ OP_OPEN_COLL_ELEM,
+ OP_CLOSE_COLL_ELEM,
+ OP_OPEN_EQUIV_CLASS,
+ OP_CLOSE_EQUIV_CLASS,
+ OP_OPEN_CHAR_CLASS,
+ OP_CLOSE_CHAR_CLASS,
+ OP_WORD,
+ OP_NOTWORD,
+ OP_SPACE,
+ OP_NOTSPACE,
+ BACK_SLASH
+
+} re_token_type_t;
+
+typedef struct
+{
+ /* Multibyte characters. */
+ wchar_t *mbchars;
+
+#ifdef _LIBC
+ /* Collating symbols. */
+ int32_t *coll_syms;
+#endif
+
+#ifdef _LIBC
+ /* Equivalence classes. */
+ int32_t *equiv_classes;
+#endif
+
+ /* Range expressions. */
+#ifdef _LIBC
+ uint32_t *range_starts;
+ uint32_t *range_ends;
+#else
+ wchar_t *range_starts;
+ wchar_t *range_ends;
+#endif
+
+ /* Character classes. */
+ wctype_t *char_classes;
+
+ /* If this character set is the non-matching list. */
+ unsigned int non_match : 1;
+
+ /* # of multibyte characters. */
+ Idx nmbchars;
+
+ /* # of collating symbols. */
+ Idx ncoll_syms;
+
+ /* # of equivalence classes. */
+ Idx nequiv_classes;
+
+ /* # of range expressions. */
+ Idx nranges;
+
+ /* # of character classes. */
+ Idx nchar_classes;
+} re_charset_t;
+
+typedef struct
+{
+ union
+ {
+ unsigned char c; /* for CHARACTER */
+ re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */
+ re_charset_t *mbcset; /* for COMPLEX_BRACKET */
+ Idx idx; /* for BACK_REF */
+ re_context_type ctx_type; /* for ANCHOR */
+ } opr;
+#if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__
+ re_token_type_t type : 8;
+#else
+ re_token_type_t type;
+#endif
+ unsigned int constraint : 10; /* context constraint */
+ unsigned int duplicated : 1;
+ unsigned int opt_subexp : 1;
+ unsigned int accept_mb : 1;
+ /* These 2 bits can be moved into the union if needed (e.g. if running out
+ of bits; move opr.c to opr.c.c and move the flags to opr.c.flags). */
+ unsigned int mb_partial : 1;
+ unsigned int word_char : 1;
+} re_token_t;
+
+#define IS_EPSILON_NODE(type) ((type) & EPSILON_BIT)
+
+struct re_string_t
+{
+ /* Indicate the raw buffer which is the original string passed as an
+ argument of regexec(), re_search(), etc.. */
+ const unsigned char *raw_mbs;
+ /* Store the multibyte string. In case of "case insensitive mode" like
+ REG_ICASE, upper cases of the string are stored, otherwise MBS points
+ the same address that RAW_MBS points. */
+ unsigned char *mbs;
+ /* Store the wide character string which is corresponding to MBS. */
+ wint_t *wcs;
+ Idx *offsets;
+ mbstate_t cur_state;
+ /* Index in RAW_MBS. Each character mbs[i] corresponds to
+ raw_mbs[raw_mbs_idx + i]. */
+ Idx raw_mbs_idx;
+ /* The length of the valid characters in the buffers. */
+ Idx valid_len;
+ /* The corresponding number of bytes in raw_mbs array. */
+ Idx valid_raw_len;
+ /* The length of the buffers MBS and WCS. */
+ Idx bufs_len;
+ /* The index in MBS, which is updated by re_string_fetch_byte. */
+ Idx cur_idx;
+ /* length of RAW_MBS array. */
+ Idx raw_len;
+ /* This is RAW_LEN - RAW_MBS_IDX + VALID_LEN - VALID_RAW_LEN. */
+ Idx len;
+ /* End of the buffer may be shorter than its length in the cases such
+ as re_match_2, re_search_2. Then, we use STOP for end of the buffer
+ instead of LEN. */
+ Idx raw_stop;
+ /* This is RAW_STOP - RAW_MBS_IDX adjusted through OFFSETS. */
+ Idx stop;
+
+ /* The context of mbs[0]. We store the context independently, since
+ the context of mbs[0] may be different from raw_mbs[0], which is
+ the beginning of the input string. */
+ unsigned int tip_context;
+ /* The translation passed as a part of an argument of re_compile_pattern. */
+ RE_TRANSLATE_TYPE trans;
+ /* Copy of re_dfa_t's word_char. */
+ re_const_bitset_ptr_t word_char;
+ /* true if REG_ICASE. */
+ unsigned char icase;
+ unsigned char is_utf8;
+ unsigned char map_notascii;
+ unsigned char mbs_allocated;
+ unsigned char offsets_needed;
+ unsigned char newline_anchor;
+ unsigned char word_ops_used;
+ int mb_cur_max;
+};
+typedef struct re_string_t re_string_t;
+
+
+struct re_dfa_t;
+typedef struct re_dfa_t re_dfa_t;
+
+#ifndef _LIBC
+# define IS_IN(libc) false
+#endif
+
+#define re_string_peek_byte(pstr, offset) \
+ ((pstr)->mbs[(pstr)->cur_idx + offset])
+#define re_string_fetch_byte(pstr) \
+ ((pstr)->mbs[(pstr)->cur_idx++])
+#define re_string_first_byte(pstr, idx) \
+ ((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF)
+#define re_string_is_single_byte_char(pstr, idx) \
+ ((pstr)->wcs[idx] != WEOF && ((pstr)->valid_len == (idx) + 1 \
+ || (pstr)->wcs[(idx) + 1] != WEOF))
+#define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx)
+#define re_string_cur_idx(pstr) ((pstr)->cur_idx)
+#define re_string_get_buffer(pstr) ((pstr)->mbs)
+#define re_string_length(pstr) ((pstr)->len)
+#define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx])
+#define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
+#define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
+
+#ifdef _LIBC
+# define MALLOC_0_IS_NONNULL 1
+#elif !defined MALLOC_0_IS_NONNULL
+# define MALLOC_0_IS_NONNULL 0
+#endif
+
+#ifndef MAX
+# define MAX(a,b) ((a) < (b) ? (b) : (a))
+#endif
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+#define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
+#define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
+#define re_free(p) free (p)
+
+struct bin_tree_t
+{
+ struct bin_tree_t *parent;
+ struct bin_tree_t *left;
+ struct bin_tree_t *right;
+ struct bin_tree_t *first;
+ struct bin_tree_t *next;
+
+ re_token_t token;
+
+ /* 'node_idx' is the index in dfa->nodes, if 'type' == 0.
+ Otherwise 'type' indicate the type of this node. */
+ Idx node_idx;
+};
+typedef struct bin_tree_t bin_tree_t;
+
+#define BIN_TREE_STORAGE_SIZE \
+ ((1024 - sizeof (void *)) / sizeof (bin_tree_t))
+
+struct bin_tree_storage_t
+{
+ struct bin_tree_storage_t *next;
+ bin_tree_t data[BIN_TREE_STORAGE_SIZE];
+};
+typedef struct bin_tree_storage_t bin_tree_storage_t;
+
+#define CONTEXT_WORD 1
+#define CONTEXT_NEWLINE (CONTEXT_WORD << 1)
+#define CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1)
+#define CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1)
+
+#define IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD)
+#define IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE)
+#define IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF)
+#define IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF)
+#define IS_ORDINARY_CONTEXT(c) ((c) == 0)
+
+#define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_')
+#define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR)
+#define IS_WIDE_WORD_CHAR(ch) (__iswalnum (ch) || (ch) == L'_')
+#define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR)
+
+#define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \
+ ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
+ || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
+ || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\
+ || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context)))
+
+#define NOT_SATISFY_NEXT_CONSTRAINT(constraint,context) \
+ ((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
+ || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
+ || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \
+ || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context)))
+
+struct re_dfastate_t
+{
+ re_hashval_t hash;
+ re_node_set nodes;
+ re_node_set non_eps_nodes;
+ re_node_set inveclosure;
+ re_node_set *entrance_nodes;
+ struct re_dfastate_t **trtable, **word_trtable;
+ unsigned int context : 4;
+ unsigned int halt : 1;
+ /* If this state can accept "multi byte".
+ Note that we refer to multibyte characters, and multi character
+ collating elements as "multi byte". */
+ unsigned int accept_mb : 1;
+ /* If this state has backreference node(s). */
+ unsigned int has_backref : 1;
+ unsigned int has_constraint : 1;
+};
+typedef struct re_dfastate_t re_dfastate_t;
+
+struct re_state_table_entry
+{
+ Idx num;
+ Idx alloc;
+ re_dfastate_t **array;
+};
+
+/* Array type used in re_sub_match_last_t and re_sub_match_top_t. */
+
+typedef struct
+{
+ Idx next_idx;
+ Idx alloc;
+ re_dfastate_t **array;
+} state_array_t;
+
+/* Store information about the node NODE whose type is OP_CLOSE_SUBEXP. */
+
+typedef struct
+{
+ Idx node;
+ Idx str_idx; /* The position NODE match at. */
+ state_array_t path;
+} re_sub_match_last_t;
+
+/* Store information about the node NODE whose type is OP_OPEN_SUBEXP.
+ And information about the node, whose type is OP_CLOSE_SUBEXP,
+ corresponding to NODE is stored in LASTS. */
+
+typedef struct
+{
+ Idx str_idx;
+ Idx node;
+ state_array_t *path;
+ Idx alasts; /* Allocation size of LASTS. */
+ Idx nlasts; /* The number of LASTS. */
+ re_sub_match_last_t **lasts;
+} re_sub_match_top_t;
+
+struct re_backref_cache_entry
+{
+ Idx node;
+ Idx str_idx;
+ Idx subexp_from;
+ Idx subexp_to;
+ bitset_word_t eps_reachable_subexps_map;
+ char more;
+};
+
+typedef struct
+{
+ /* The string object corresponding to the input string. */
+ re_string_t input;
+ const re_dfa_t *const dfa;
+ /* EFLAGS of the argument of regexec. */
+ int eflags;
+ /* Where the matching ends. */
+ Idx match_last;
+ Idx last_node;
+ /* The state log used by the matcher. */
+ re_dfastate_t **state_log;
+ Idx state_log_top;
+ /* Back reference cache. */
+ Idx nbkref_ents;
+ Idx abkref_ents;
+ struct re_backref_cache_entry *bkref_ents;
+ int max_mb_elem_len;
+ Idx nsub_tops;
+ Idx asub_tops;
+ re_sub_match_top_t **sub_tops;
+} re_match_context_t;
+
+typedef struct
+{
+ re_dfastate_t **sifted_states;
+ re_dfastate_t **limited_states;
+ Idx last_node;
+ Idx last_str_idx;
+ re_node_set limits;
+} re_sift_context_t;
+
+struct re_fail_stack_ent_t
+{
+ Idx idx;
+ Idx node;
+ regmatch_t *regs;
+ re_node_set eps_via_nodes;
+};
+
+struct re_fail_stack_t
+{
+ Idx num;
+ Idx alloc;
+ struct re_fail_stack_ent_t *stack;
+};
+
+struct re_dfa_t
+{
+ re_token_t *nodes;
+ size_t nodes_alloc;
+ size_t nodes_len;
+ Idx *nexts;
+ Idx *org_indices;
+ re_node_set *edests;
+ re_node_set *eclosures;
+ re_node_set *inveclosures;
+ struct re_state_table_entry *state_table;
+ re_dfastate_t *init_state;
+ re_dfastate_t *init_state_word;
+ re_dfastate_t *init_state_nl;
+ re_dfastate_t *init_state_begbuf;
+ bin_tree_t *str_tree;
+ bin_tree_storage_t *str_tree_storage;
+ re_bitset_ptr_t sb_char;
+ int str_tree_storage_idx;
+
+ /* number of subexpressions 're_nsub' is in regex_t. */
+ re_hashval_t state_hash_mask;
+ Idx init_node;
+ Idx nbackref; /* The number of backreference in this dfa. */
+
+ /* Bitmap expressing which backreference is used. */
+ bitset_word_t used_bkref_map;
+ bitset_word_t completed_bkref_map;
+
+ unsigned int has_plural_match : 1;
+ /* If this dfa has "multibyte node", which is a backreference or
+ a node which can accept multibyte character or multi character
+ collating element. */
+ unsigned int has_mb_node : 1;
+ unsigned int is_utf8 : 1;
+ unsigned int map_notascii : 1;
+ unsigned int word_ops_used : 1;
+ int mb_cur_max;
+ bitset_t word_char;
+ reg_syntax_t syntax;
+ Idx *subexp_map;
+#ifdef DEBUG
+ char* re_str;
+#endif
+ lock_define (lock)
+};
+
+#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
+#define re_node_set_remove(set,id) \
+ (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
+#define re_node_set_empty(p) ((p)->nelem = 0)
+#define re_node_set_free(set) re_free ((set)->elems)
+
+
+typedef enum
+{
+ SB_CHAR,
+ MB_CHAR,
+ EQUIV_CLASS,
+ COLL_SYM,
+ CHAR_CLASS
+} bracket_elem_type;
+
+typedef struct
+{
+ bracket_elem_type type;
+ union
+ {
+ unsigned char ch;
+ unsigned char *name;
+ wchar_t wch;
+ } opr;
+} bracket_elem_t;
+
+
+/* Functions for bitset_t operation. */
+
+static inline void
+bitset_set (bitset_t set, Idx i)
+{
+ set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS;
+}
+
+static inline void
+bitset_clear (bitset_t set, Idx i)
+{
+ set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS);
+}
+
+static inline bool
+bitset_contain (const bitset_t set, Idx i)
+{
+ return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1;
+}
+
+static inline void
+bitset_empty (bitset_t set)
+{
+ memset (set, '\0', sizeof (bitset_t));
+}
+
+static inline void
+bitset_set_all (bitset_t set)
+{
+ memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS));
+ if (SBC_MAX % BITSET_WORD_BITS != 0)
+ set[BITSET_WORDS - 1] =
+ ((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1;
+}
+
+static inline void
+bitset_copy (bitset_t dest, const bitset_t src)
+{
+ memcpy (dest, src, sizeof (bitset_t));
+}
+
+static inline void
+bitset_not (bitset_t set)
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < SBC_MAX / BITSET_WORD_BITS; ++bitset_i)
+ set[bitset_i] = ~set[bitset_i];
+ if (SBC_MAX % BITSET_WORD_BITS != 0)
+ set[BITSET_WORDS - 1] =
+ ((((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1)
+ & ~set[BITSET_WORDS - 1]);
+}
+
+static inline void
+bitset_merge (bitset_t dest, const bitset_t src)
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
+ dest[bitset_i] |= src[bitset_i];
+}
+
+static inline void
+bitset_mask (bitset_t dest, const bitset_t src)
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
+ dest[bitset_i] &= src[bitset_i];
+}
+
+/* Functions for re_string. */
+static int
+__attribute__ ((pure, unused))
+re_string_char_size_at (const re_string_t *pstr, Idx idx)
+{
+ int byte_idx;
+ if (pstr->mb_cur_max == 1)
+ return 1;
+ for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx)
+ if (pstr->wcs[idx + byte_idx] != WEOF)
+ break;
+ return byte_idx;
+}
+
+static wint_t
+__attribute__ ((pure, unused))
+re_string_wchar_at (const re_string_t *pstr, Idx idx)
+{
+ if (pstr->mb_cur_max == 1)
+ return (wint_t) pstr->mbs[idx];
+ return (wint_t) pstr->wcs[idx];
+}
+
+#ifdef _LIBC
+# include <locale/weight.h>
+#endif
+
+static int
+__attribute__ ((pure, unused))
+re_string_elem_size_at (const re_string_t *pstr, Idx idx)
+{
+#ifdef _LIBC
+ const unsigned char *p, *extra;
+ const int32_t *table, *indirect;
+ uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+
+ if (nrules != 0)
+ {
+ table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_INDIRECTMB);
+ p = pstr->mbs + idx;
+ findidx (table, indirect, extra, &p, pstr->len - idx);
+ return p - pstr->mbs - idx;
+ }
+#endif /* _LIBC */
+
+ return 1;
+}
+
+#ifdef _LIBC
+# if __GNUC__ >= 7
+# define FALLTHROUGH __attribute__ ((__fallthrough__))
+# else
+# define FALLTHROUGH ((void) 0)
+# endif
+#else
+# include "attribute.h"
+#endif
+
+#endif /* _REGEX_INTERNAL_H */
diff --git a/gl/regexec.c b/gl/regexec.c
new file mode 100644
index 0000000..13e0349
--- /dev/null
+++ b/gl/regexec.c
@@ -0,0 +1,4221 @@
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
+ Idx n);
+static void match_ctx_clean (re_match_context_t *mctx);
+static void match_ctx_free (re_match_context_t *cache);
+static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, Idx node,
+ Idx str_idx, Idx from, Idx to);
+static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx);
+static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, Idx node,
+ Idx str_idx);
+static re_sub_match_last_t * match_ctx_add_sublast (re_sub_match_top_t *subtop,
+ Idx node, Idx str_idx);
+static void sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts,
+ re_dfastate_t **limited_sts, Idx last_node,
+ Idx last_str_idx);
+static reg_errcode_t re_search_internal (const regex_t *preg,
+ const char *string, Idx length,
+ Idx start, Idx last_start, Idx stop,
+ size_t nmatch, regmatch_t pmatch[],
+ int eflags);
+static regoff_t re_search_2_stub (struct re_pattern_buffer *bufp,
+ const char *string1, Idx length1,
+ const char *string2, Idx length2,
+ Idx start, regoff_t range,
+ struct re_registers *regs,
+ Idx stop, bool ret_len);
+static regoff_t re_search_stub (struct re_pattern_buffer *bufp,
+ const char *string, Idx length, Idx start,
+ regoff_t range, Idx stop,
+ struct re_registers *regs,
+ bool ret_len);
+static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
+ Idx nregs, int regs_allocated);
+static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx);
+static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match,
+ Idx *p_match_first);
+static Idx check_halt_state_context (const re_match_context_t *mctx,
+ const re_dfastate_t *state, Idx idx);
+static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
+ regmatch_t *prev_idx_match, Idx cur_node,
+ Idx cur_idx, Idx nmatch);
+static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs,
+ Idx str_idx, Idx dest_node, Idx nregs,
+ regmatch_t *regs, regmatch_t *prevregs,
+ re_node_set *eps_via_nodes);
+static reg_errcode_t set_regs (const regex_t *preg,
+ const re_match_context_t *mctx,
+ size_t nmatch, regmatch_t *pmatch,
+ bool fl_backtrack);
+static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs);
+
+static int sift_states_iter_mb (const re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ Idx node_idx, Idx str_idx, Idx max_str_idx);
+static reg_errcode_t sift_states_backward (const re_match_context_t *mctx,
+ re_sift_context_t *sctx);
+static reg_errcode_t build_sifted_states (const re_match_context_t *mctx,
+ re_sift_context_t *sctx, Idx str_idx,
+ re_node_set *cur_dest);
+static reg_errcode_t update_cur_sifted_state (const re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ Idx str_idx,
+ re_node_set *dest_nodes);
+static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa,
+ re_node_set *dest_nodes,
+ const re_node_set *candidates);
+static bool check_dst_limits (const re_match_context_t *mctx,
+ const re_node_set *limits,
+ Idx dst_node, Idx dst_idx, Idx src_node,
+ Idx src_idx);
+static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx,
+ int boundaries, Idx subexp_idx,
+ Idx from_node, Idx bkref_idx);
+static int check_dst_limits_calc_pos (const re_match_context_t *mctx,
+ Idx limit, Idx subexp_idx,
+ Idx node, Idx str_idx,
+ Idx bkref_idx);
+static reg_errcode_t check_subexp_limits (const re_dfa_t *dfa,
+ re_node_set *dest_nodes,
+ const re_node_set *candidates,
+ re_node_set *limits,
+ struct re_backref_cache_entry *bkref_ents,
+ Idx str_idx);
+static reg_errcode_t sift_states_bkref (const re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ Idx str_idx, const re_node_set *candidates);
+static reg_errcode_t merge_state_array (const re_dfa_t *dfa,
+ re_dfastate_t **dst,
+ re_dfastate_t **src, Idx num);
+static re_dfastate_t *find_recover_state (reg_errcode_t *err,
+ re_match_context_t *mctx);
+static re_dfastate_t *transit_state (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *state);
+static re_dfastate_t *merge_state_with_log (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *next_state);
+static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx,
+ re_node_set *cur_nodes,
+ Idx str_idx);
+#if 0
+static re_dfastate_t *transit_state_sb (reg_errcode_t *err,
+ re_match_context_t *mctx,
+ re_dfastate_t *pstate);
+#endif
+static reg_errcode_t transit_state_mb (re_match_context_t *mctx,
+ re_dfastate_t *pstate);
+static reg_errcode_t transit_state_bkref (re_match_context_t *mctx,
+ const re_node_set *nodes);
+static reg_errcode_t get_subexp (re_match_context_t *mctx,
+ Idx bkref_node, Idx bkref_str_idx);
+static reg_errcode_t get_subexp_sub (re_match_context_t *mctx,
+ const re_sub_match_top_t *sub_top,
+ re_sub_match_last_t *sub_last,
+ Idx bkref_node, Idx bkref_str);
+static Idx find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
+ Idx subexp_idx, int type);
+static reg_errcode_t check_arrival (re_match_context_t *mctx,
+ state_array_t *path, Idx top_node,
+ Idx top_str, Idx last_node, Idx last_str,
+ int type);
+static reg_errcode_t check_arrival_add_next_nodes (re_match_context_t *mctx,
+ Idx str_idx,
+ re_node_set *cur_nodes,
+ re_node_set *next_nodes);
+static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa,
+ re_node_set *cur_nodes,
+ Idx ex_subexp, int type);
+static reg_errcode_t check_arrival_expand_ecl_sub (const re_dfa_t *dfa,
+ re_node_set *dst_nodes,
+ Idx target, Idx ex_subexp,
+ int type);
+static reg_errcode_t expand_bkref_cache (re_match_context_t *mctx,
+ re_node_set *cur_nodes, Idx cur_str,
+ Idx subexp_num, int type);
+static bool build_trtable (const re_dfa_t *dfa, re_dfastate_t *state);
+static int check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
+ const re_string_t *input, Idx idx);
+#ifdef _LIBC
+static unsigned int find_collation_sequence_value (const unsigned char *mbs,
+ size_t name_len);
+#endif
+static Idx group_nodes_into_DFAstates (const re_dfa_t *dfa,
+ const re_dfastate_t *state,
+ re_node_set *states_node,
+ bitset_t *states_ch);
+static bool check_node_accept (const re_match_context_t *mctx,
+ const re_token_t *node, Idx idx);
+static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len);
+
+/* Entry point for POSIX code. */
+
+/* regexec searches for a given pattern, specified by PREG, in the
+ string STRING.
+
+ If NMATCH is zero or REG_NOSUB was set in the cflags argument to
+ 'regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
+ least NMATCH elements, and we set them to the offsets of the
+ corresponding matched substrings.
+
+ EFLAGS specifies "execution flags" which affect matching: if
+ REG_NOTBOL is set, then ^ does not match at the beginning of the
+ string; if REG_NOTEOL is set, then $ does not match at the end.
+
+ Return 0 if a match is found, REG_NOMATCH if not, REG_BADPAT if
+ EFLAGS is invalid. */
+
+int
+regexec (const regex_t *__restrict preg, const char *__restrict string,
+ size_t nmatch, regmatch_t pmatch[_REGEX_NELTS (nmatch)], int eflags)
+{
+ reg_errcode_t err;
+ Idx start, length;
+ re_dfa_t *dfa = preg->buffer;
+
+ if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND))
+ return REG_BADPAT;
+
+ if (eflags & REG_STARTEND)
+ {
+ start = pmatch[0].rm_so;
+ length = pmatch[0].rm_eo;
+ }
+ else
+ {
+ start = 0;
+ length = strlen (string);
+ }
+
+ lock_lock (dfa->lock);
+ if (preg->no_sub)
+ err = re_search_internal (preg, string, length, start, length,
+ length, 0, NULL, eflags);
+ else
+ err = re_search_internal (preg, string, length, start, length,
+ length, nmatch, pmatch, eflags);
+ lock_unlock (dfa->lock);
+ return err != REG_NOERROR;
+}
+
+#ifdef _LIBC
+libc_hidden_def (__regexec)
+
+# include <shlib-compat.h>
+versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
+
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+__typeof__ (__regexec) __compat_regexec;
+
+int
+attribute_compat_text_section
+__compat_regexec (const regex_t *__restrict preg,
+ const char *__restrict string, size_t nmatch,
+ regmatch_t pmatch[_REGEX_NELTS (nmatch)], int eflags)
+{
+ return regexec (preg, string, nmatch, pmatch,
+ eflags & (REG_NOTBOL | REG_NOTEOL));
+}
+compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
+# endif
+#endif
+
+/* Entry points for GNU code. */
+
+/* re_match, re_search, re_match_2, re_search_2
+
+ The former two functions operate on STRING with length LENGTH,
+ while the later two operate on concatenation of STRING1 and STRING2
+ with lengths LENGTH1 and LENGTH2, respectively.
+
+ re_match() matches the compiled pattern in BUFP against the string,
+ starting at index START.
+
+ re_search() first tries matching at index START, then it tries to match
+ starting from index START + 1, and so on. The last start position tried
+ is START + RANGE. (Thus RANGE = 0 forces re_search to operate the same
+ way as re_match().)
+
+ The parameter STOP of re_{match,search}_2 specifies that no match exceeding
+ the first STOP characters of the concatenation of the strings should be
+ concerned.
+
+ If REGS is not NULL, and BUFP->no_sub is not set, the offsets of the match
+ and all groups is stored in REGS. (For the "_2" variants, the offsets are
+ computed relative to the concatenation, not relative to the individual
+ strings.)
+
+ On success, re_match* functions return the length of the match, re_search*
+ return the position of the start of the match. They return -1 on
+ match failure, -2 on error. */
+
+regoff_t
+re_match (struct re_pattern_buffer *bufp, const char *string, Idx length,
+ Idx start, struct re_registers *regs)
+{
+ return re_search_stub (bufp, string, length, start, 0, length, regs, true);
+}
+#ifdef _LIBC
+weak_alias (__re_match, re_match)
+#endif
+
+regoff_t
+re_search (struct re_pattern_buffer *bufp, const char *string, Idx length,
+ Idx start, regoff_t range, struct re_registers *regs)
+{
+ return re_search_stub (bufp, string, length, start, range, length, regs,
+ false);
+}
+#ifdef _LIBC
+weak_alias (__re_search, re_search)
+#endif
+
+regoff_t
+re_match_2 (struct re_pattern_buffer *bufp, const char *string1, Idx length1,
+ const char *string2, Idx length2, Idx start,
+ struct re_registers *regs, Idx stop)
+{
+ return re_search_2_stub (bufp, string1, length1, string2, length2,
+ start, 0, regs, stop, true);
+}
+#ifdef _LIBC
+weak_alias (__re_match_2, re_match_2)
+#endif
+
+regoff_t
+re_search_2 (struct re_pattern_buffer *bufp, const char *string1, Idx length1,
+ const char *string2, Idx length2, Idx start, regoff_t range,
+ struct re_registers *regs, Idx stop)
+{
+ return re_search_2_stub (bufp, string1, length1, string2, length2,
+ start, range, regs, stop, false);
+}
+#ifdef _LIBC
+weak_alias (__re_search_2, re_search_2)
+#endif
+
+static regoff_t
+re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
+ Idx length1, const char *string2, Idx length2, Idx start,
+ regoff_t range, struct re_registers *regs,
+ Idx stop, bool ret_len)
+{
+ const char *str;
+ regoff_t rval;
+ Idx len;
+ char *s = NULL;
+
+ if (__glibc_unlikely ((length1 < 0 || length2 < 0 || stop < 0
+ || INT_ADD_WRAPV (length1, length2, &len))))
+ return -2;
+
+ /* Concatenate the strings. */
+ if (length2 > 0)
+ if (length1 > 0)
+ {
+ s = re_malloc (char, len);
+
+ if (__glibc_unlikely (s == NULL))
+ return -2;
+#ifdef _LIBC
+ memcpy (__mempcpy (s, string1, length1), string2, length2);
+#else
+ memcpy (s, string1, length1);
+ memcpy (s + length1, string2, length2);
+#endif
+ str = s;
+ }
+ else
+ str = string2;
+ else
+ str = string1;
+
+ rval = re_search_stub (bufp, str, len, start, range, stop, regs,
+ ret_len);
+ re_free (s);
+ return rval;
+}
+
+/* The parameters have the same meaning as those of re_search.
+ Additional parameters:
+ If RET_LEN is true the length of the match is returned (re_match style);
+ otherwise the position of the match is returned. */
+
+static regoff_t
+re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
+ Idx start, regoff_t range, Idx stop, struct re_registers *regs,
+ bool ret_len)
+{
+ reg_errcode_t result;
+ regmatch_t *pmatch;
+ Idx nregs;
+ regoff_t rval;
+ int eflags = 0;
+ re_dfa_t *dfa = bufp->buffer;
+ Idx last_start = start + range;
+
+ /* Check for out-of-range. */
+ if (__glibc_unlikely (start < 0 || start > length))
+ return -1;
+ if (__glibc_unlikely (length < last_start
+ || (0 <= range && last_start < start)))
+ last_start = length;
+ else if (__glibc_unlikely (last_start < 0
+ || (range < 0 && start <= last_start)))
+ last_start = 0;
+
+ lock_lock (dfa->lock);
+
+ eflags |= (bufp->not_bol) ? REG_NOTBOL : 0;
+ eflags |= (bufp->not_eol) ? REG_NOTEOL : 0;
+
+ /* Compile fastmap if we haven't yet. */
+ if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate)
+ re_compile_fastmap (bufp);
+
+ if (__glibc_unlikely (bufp->no_sub))
+ regs = NULL;
+
+ /* We need at least 1 register. */
+ if (regs == NULL)
+ nregs = 1;
+ else if (__glibc_unlikely (bufp->regs_allocated == REGS_FIXED
+ && regs->num_regs <= bufp->re_nsub))
+ {
+ nregs = regs->num_regs;
+ if (__glibc_unlikely (nregs < 1))
+ {
+ /* Nothing can be copied to regs. */
+ regs = NULL;
+ nregs = 1;
+ }
+ }
+ else
+ nregs = bufp->re_nsub + 1;
+ pmatch = re_malloc (regmatch_t, nregs);
+ if (__glibc_unlikely (pmatch == NULL))
+ {
+ rval = -2;
+ goto out;
+ }
+
+ result = re_search_internal (bufp, string, length, start, last_start, stop,
+ nregs, pmatch, eflags);
+
+ rval = 0;
+
+ /* I hope we needn't fill their regs with -1's when no match was found. */
+ if (result != REG_NOERROR)
+ rval = result == REG_NOMATCH ? -1 : -2;
+ else if (regs != NULL)
+ {
+ /* If caller wants register contents data back, copy them. */
+ bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs,
+ bufp->regs_allocated);
+ if (__glibc_unlikely (bufp->regs_allocated == REGS_UNALLOCATED))
+ rval = -2;
+ }
+
+ if (__glibc_likely (rval == 0))
+ {
+ if (ret_len)
+ {
+ DEBUG_ASSERT (pmatch[0].rm_so == start);
+ rval = pmatch[0].rm_eo - start;
+ }
+ else
+ rval = pmatch[0].rm_so;
+ }
+ re_free (pmatch);
+ out:
+ lock_unlock (dfa->lock);
+ return rval;
+}
+
+static unsigned
+re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
+ int regs_allocated)
+{
+ int rval = REGS_REALLOCATE;
+ Idx i;
+ Idx need_regs = nregs + 1;
+ /* We need one extra element beyond 'num_regs' for the '-1' marker GNU code
+ uses. */
+
+ /* Have the register data arrays been allocated? */
+ if (regs_allocated == REGS_UNALLOCATED)
+ { /* No. So allocate them with malloc. */
+ regs->start = re_malloc (regoff_t, need_regs);
+ if (__glibc_unlikely (regs->start == NULL))
+ return REGS_UNALLOCATED;
+ regs->end = re_malloc (regoff_t, need_regs);
+ if (__glibc_unlikely (regs->end == NULL))
+ {
+ re_free (regs->start);
+ return REGS_UNALLOCATED;
+ }
+ regs->num_regs = need_regs;
+ }
+ else if (regs_allocated == REGS_REALLOCATE)
+ { /* Yes. If we need more elements than were already
+ allocated, reallocate them. If we need fewer, just
+ leave it alone. */
+ if (__glibc_unlikely (need_regs > regs->num_regs))
+ {
+ regoff_t *new_start = re_realloc (regs->start, regoff_t, need_regs);
+ regoff_t *new_end;
+ if (__glibc_unlikely (new_start == NULL))
+ return REGS_UNALLOCATED;
+ new_end = re_realloc (regs->end, regoff_t, need_regs);
+ if (__glibc_unlikely (new_end == NULL))
+ {
+ re_free (new_start);
+ return REGS_UNALLOCATED;
+ }
+ regs->start = new_start;
+ regs->end = new_end;
+ regs->num_regs = need_regs;
+ }
+ }
+ else
+ {
+ DEBUG_ASSERT (regs_allocated == REGS_FIXED);
+ /* This function may not be called with REGS_FIXED and nregs too big. */
+ DEBUG_ASSERT (nregs <= regs->num_regs);
+ rval = REGS_FIXED;
+ }
+
+ /* Copy the regs. */
+ for (i = 0; i < nregs; ++i)
+ {
+ regs->start[i] = pmatch[i].rm_so;
+ regs->end[i] = pmatch[i].rm_eo;
+ }
+ for ( ; i < regs->num_regs; ++i)
+ regs->start[i] = regs->end[i] = -1;
+
+ return rval;
+}
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
+ this memory for recording register information. STARTS and ENDS
+ must be allocated using the malloc library routine, and must each
+ be at least NUM_REGS * sizeof (regoff_t) bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+
+void
+re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs,
+ __re_size_t num_regs, regoff_t *starts, regoff_t *ends)
+{
+ if (num_regs)
+ {
+ bufp->regs_allocated = REGS_REALLOCATE;
+ regs->num_regs = num_regs;
+ regs->start = starts;
+ regs->end = ends;
+ }
+ else
+ {
+ bufp->regs_allocated = REGS_UNALLOCATED;
+ regs->num_regs = 0;
+ regs->start = regs->end = NULL;
+ }
+}
+#ifdef _LIBC
+weak_alias (__re_set_registers, re_set_registers)
+#endif
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them unless specifically requested. */
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+int
+# ifdef _LIBC
+weak_function
+# endif
+re_exec (const char *s)
+{
+ return 0 == regexec (&re_comp_buf, s, 0, NULL, 0);
+}
+#endif /* _REGEX_RE_COMP */
+
+/* Internal entry point. */
+
+/* Searches for a compiled pattern PREG in the string STRING, whose
+ length is LENGTH. NMATCH, PMATCH, and EFLAGS have the same
+ meaning as with regexec. LAST_START is START + RANGE, where
+ START and RANGE have the same meaning as with re_search.
+ Return REG_NOERROR if we find a match, and REG_NOMATCH if not,
+ otherwise return the error code.
+ Note: We assume front end functions already check ranges.
+ (0 <= LAST_START && LAST_START <= LENGTH) */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+re_search_internal (const regex_t *preg, const char *string, Idx length,
+ Idx start, Idx last_start, Idx stop, size_t nmatch,
+ regmatch_t pmatch[], int eflags)
+{
+ reg_errcode_t err;
+ const re_dfa_t *dfa = preg->buffer;
+ Idx left_lim, right_lim;
+ int incr;
+ bool fl_longest_match;
+ int match_kind;
+ Idx match_first;
+ Idx match_last = -1;
+ Idx extra_nmatch;
+ bool sb;
+ int ch;
+ re_match_context_t mctx = { .dfa = dfa };
+ char *fastmap = ((preg->fastmap != NULL && preg->fastmap_accurate
+ && start != last_start && !preg->can_be_null)
+ ? preg->fastmap : NULL);
+ RE_TRANSLATE_TYPE t = preg->translate;
+
+ extra_nmatch = (nmatch > preg->re_nsub) ? nmatch - (preg->re_nsub + 1) : 0;
+ nmatch -= extra_nmatch;
+
+ /* Check if the DFA haven't been compiled. */
+ if (__glibc_unlikely (preg->used == 0 || dfa->init_state == NULL
+ || dfa->init_state_word == NULL
+ || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL))
+ return REG_NOMATCH;
+
+ /* We assume front-end functions already check them. */
+ DEBUG_ASSERT (0 <= last_start && last_start <= length);
+
+ /* If initial states with non-begbuf contexts have no elements,
+ the regex must be anchored. If preg->newline_anchor is set,
+ we'll never use init_state_nl, so do not check it. */
+ if (dfa->init_state->nodes.nelem == 0
+ && dfa->init_state_word->nodes.nelem == 0
+ && (dfa->init_state_nl->nodes.nelem == 0
+ || !preg->newline_anchor))
+ {
+ if (start != 0 && last_start != 0)
+ return REG_NOMATCH;
+ start = last_start = 0;
+ }
+
+ /* We must check the longest matching, if nmatch > 0. */
+ fl_longest_match = (nmatch != 0 || dfa->nbackref);
+
+ err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1,
+ preg->translate, (preg->syntax & RE_ICASE) != 0,
+ dfa);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ mctx.input.stop = stop;
+ mctx.input.raw_stop = stop;
+ mctx.input.newline_anchor = preg->newline_anchor;
+
+ err = match_ctx_init (&mctx, eflags, dfa->nbackref * 2);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* We will log all the DFA states through which the dfa pass,
+ if nmatch > 1, or this dfa has "multibyte node", which is a
+ back-reference or a node which can accept multibyte character or
+ multi character collating element. */
+ if (nmatch > 1 || dfa->has_mb_node)
+ {
+ /* Avoid overflow. */
+ if (__glibc_unlikely ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+ <= mctx.input.bufs_len)))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+
+ mctx.state_log = re_malloc (re_dfastate_t *, mctx.input.bufs_len + 1);
+ if (__glibc_unlikely (mctx.state_log == NULL))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ }
+
+ match_first = start;
+ mctx.input.tip_context = (eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
+ : CONTEXT_NEWLINE | CONTEXT_BEGBUF;
+
+ /* Check incrementally whether the input string matches. */
+ incr = (last_start < start) ? -1 : 1;
+ left_lim = (last_start < start) ? last_start : start;
+ right_lim = (last_start < start) ? start : last_start;
+ sb = dfa->mb_cur_max == 1;
+ match_kind =
+ (fastmap
+ ? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0)
+ | (start <= last_start ? 2 : 0)
+ | (t != NULL ? 1 : 0))
+ : 8);
+
+ for (;; match_first += incr)
+ {
+ err = REG_NOMATCH;
+ if (match_first < left_lim || right_lim < match_first)
+ goto free_return;
+
+ /* Advance as rapidly as possible through the string, until we
+ find a plausible place to start matching. This may be done
+ with varying efficiency, so there are various possibilities:
+ only the most common of them are specialized, in order to
+ save on code size. We use a switch statement for speed. */
+ switch (match_kind)
+ {
+ case 8:
+ /* No fastmap. */
+ break;
+
+ case 7:
+ /* Fastmap with single-byte translation, match forward. */
+ while (__glibc_likely (match_first < right_lim)
+ && !fastmap[t[(unsigned char) string[match_first]]])
+ ++match_first;
+ goto forward_match_found_start_or_reached_end;
+
+ case 6:
+ /* Fastmap without translation, match forward. */
+ while (__glibc_likely (match_first < right_lim)
+ && !fastmap[(unsigned char) string[match_first]])
+ ++match_first;
+
+ forward_match_found_start_or_reached_end:
+ if (__glibc_unlikely (match_first == right_lim))
+ {
+ ch = match_first >= length
+ ? 0 : (unsigned char) string[match_first];
+ if (!fastmap[t ? t[ch] : ch])
+ goto free_return;
+ }
+ break;
+
+ case 4:
+ case 5:
+ /* Fastmap without multi-byte translation, match backwards. */
+ while (match_first >= left_lim)
+ {
+ ch = match_first >= length
+ ? 0 : (unsigned char) string[match_first];
+ if (fastmap[t ? t[ch] : ch])
+ break;
+ --match_first;
+ }
+ if (match_first < left_lim)
+ goto free_return;
+ break;
+
+ default:
+ /* In this case, we can't determine easily the current byte,
+ since it might be a component byte of a multibyte
+ character. Then we use the constructed buffer instead. */
+ for (;;)
+ {
+ /* If MATCH_FIRST is out of the valid range, reconstruct the
+ buffers. */
+ __re_size_t offset = match_first - mctx.input.raw_mbs_idx;
+ if (__glibc_unlikely (offset
+ >= (__re_size_t) mctx.input.valid_raw_len))
+ {
+ err = re_string_reconstruct (&mctx.input, match_first,
+ eflags);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ offset = match_first - mctx.input.raw_mbs_idx;
+ }
+ /* Use buffer byte if OFFSET is in buffer, otherwise '\0'. */
+ ch = (offset < mctx.input.valid_len
+ ? re_string_byte_at (&mctx.input, offset) : 0);
+ if (fastmap[ch])
+ break;
+ match_first += incr;
+ if (match_first < left_lim || match_first > right_lim)
+ {
+ err = REG_NOMATCH;
+ goto free_return;
+ }
+ }
+ break;
+ }
+
+ /* Reconstruct the buffers so that the matcher can assume that
+ the matching starts from the beginning of the buffer. */
+ err = re_string_reconstruct (&mctx.input, match_first, eflags);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* Don't consider this char as a possible match start if it part,
+ yet isn't the head, of a multibyte character. */
+ if (!sb && !re_string_first_byte (&mctx.input, 0))
+ continue;
+
+ /* It seems to be appropriate one, then use the matcher. */
+ /* We assume that the matching starts from 0. */
+ mctx.state_log_top = mctx.nbkref_ents = mctx.max_mb_elem_len = 0;
+ match_last = check_matching (&mctx, fl_longest_match,
+ start <= last_start ? &match_first : NULL);
+ if (match_last != -1)
+ {
+ if (__glibc_unlikely (match_last == -2))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ else
+ {
+ mctx.match_last = match_last;
+ if ((!preg->no_sub && nmatch > 1) || dfa->nbackref)
+ {
+ re_dfastate_t *pstate = mctx.state_log[match_last];
+ mctx.last_node = check_halt_state_context (&mctx, pstate,
+ match_last);
+ }
+ if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match)
+ || dfa->nbackref)
+ {
+ err = prune_impossible_nodes (&mctx);
+ if (err == REG_NOERROR)
+ break;
+ if (__glibc_unlikely (err != REG_NOMATCH))
+ goto free_return;
+ match_last = -1;
+ }
+ else
+ break; /* We found a match. */
+ }
+ }
+
+ match_ctx_clean (&mctx);
+ }
+
+ DEBUG_ASSERT (match_last != -1);
+ DEBUG_ASSERT (err == REG_NOERROR);
+
+ /* Set pmatch[] if we need. */
+ if (nmatch > 0)
+ {
+ Idx reg_idx;
+
+ /* Initialize registers. */
+ for (reg_idx = 1; reg_idx < nmatch; ++reg_idx)
+ pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1;
+
+ /* Set the points where matching start/end. */
+ pmatch[0].rm_so = 0;
+ pmatch[0].rm_eo = mctx.match_last;
+ /* FIXME: This function should fail if mctx.match_last exceeds
+ the maximum possible regoff_t value. We need a new error
+ code REG_OVERFLOW. */
+
+ if (!preg->no_sub && nmatch > 1)
+ {
+ err = set_regs (preg, &mctx, nmatch, pmatch,
+ dfa->has_plural_match && dfa->nbackref > 0);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+
+ /* At last, add the offset to each register, since we slid
+ the buffers so that we could assume that the matching starts
+ from 0. */
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ if (pmatch[reg_idx].rm_so != -1)
+ {
+ if (__glibc_unlikely (mctx.input.offsets_needed != 0))
+ {
+ pmatch[reg_idx].rm_so =
+ (pmatch[reg_idx].rm_so == mctx.input.valid_len
+ ? mctx.input.valid_raw_len
+ : mctx.input.offsets[pmatch[reg_idx].rm_so]);
+ pmatch[reg_idx].rm_eo =
+ (pmatch[reg_idx].rm_eo == mctx.input.valid_len
+ ? mctx.input.valid_raw_len
+ : mctx.input.offsets[pmatch[reg_idx].rm_eo]);
+ }
+ pmatch[reg_idx].rm_so += match_first;
+ pmatch[reg_idx].rm_eo += match_first;
+ }
+ for (reg_idx = 0; reg_idx < extra_nmatch; ++reg_idx)
+ {
+ pmatch[nmatch + reg_idx].rm_so = -1;
+ pmatch[nmatch + reg_idx].rm_eo = -1;
+ }
+
+ if (dfa->subexp_map)
+ for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++)
+ if (dfa->subexp_map[reg_idx] != reg_idx)
+ {
+ pmatch[reg_idx + 1].rm_so
+ = pmatch[dfa->subexp_map[reg_idx] + 1].rm_so;
+ pmatch[reg_idx + 1].rm_eo
+ = pmatch[dfa->subexp_map[reg_idx] + 1].rm_eo;
+ }
+ }
+
+ free_return:
+ re_free (mctx.state_log);
+ if (dfa->nbackref)
+ match_ctx_free (&mctx);
+ re_string_destruct (&mctx.input);
+ return err;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+prune_impossible_nodes (re_match_context_t *mctx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx halt_node, match_last;
+ reg_errcode_t ret;
+ re_dfastate_t **sifted_states;
+ re_dfastate_t **lim_states = NULL;
+ re_sift_context_t sctx;
+ DEBUG_ASSERT (mctx->state_log != NULL);
+ match_last = mctx->match_last;
+ halt_node = mctx->last_node;
+
+ /* Avoid overflow. */
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+ <= match_last))
+ return REG_ESPACE;
+
+ sifted_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (__glibc_unlikely (sifted_states == NULL))
+ {
+ ret = REG_ESPACE;
+ goto free_return;
+ }
+ if (dfa->nbackref)
+ {
+ lim_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (__glibc_unlikely (lim_states == NULL))
+ {
+ ret = REG_ESPACE;
+ goto free_return;
+ }
+ while (1)
+ {
+ memset (lim_states, '\0',
+ sizeof (re_dfastate_t *) * (match_last + 1));
+ sift_ctx_init (&sctx, sifted_states, lim_states, halt_node,
+ match_last);
+ ret = sift_states_backward (mctx, &sctx);
+ re_node_set_free (&sctx.limits);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ goto free_return;
+ if (sifted_states[0] != NULL || lim_states[0] != NULL)
+ break;
+ do
+ {
+ --match_last;
+ if (match_last < 0)
+ {
+ ret = REG_NOMATCH;
+ goto free_return;
+ }
+ } while (mctx->state_log[match_last] == NULL
+ || !mctx->state_log[match_last]->halt);
+ halt_node = check_halt_state_context (mctx,
+ mctx->state_log[match_last],
+ match_last);
+ }
+ ret = merge_state_array (dfa, sifted_states, lim_states,
+ match_last + 1);
+ re_free (lim_states);
+ lim_states = NULL;
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ goto free_return;
+ }
+ else
+ {
+ sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, match_last);
+ ret = sift_states_backward (mctx, &sctx);
+ re_node_set_free (&sctx.limits);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ goto free_return;
+ if (sifted_states[0] == NULL)
+ {
+ ret = REG_NOMATCH;
+ goto free_return;
+ }
+ }
+ re_free (mctx->state_log);
+ mctx->state_log = sifted_states;
+ sifted_states = NULL;
+ mctx->last_node = halt_node;
+ mctx->match_last = match_last;
+ ret = REG_NOERROR;
+ free_return:
+ re_free (sifted_states);
+ re_free (lim_states);
+ return ret;
+}
+
+/* Acquire an initial state and return it.
+ We must select appropriate initial state depending on the context,
+ since initial states may have constraints like "\<", "^", etc.. */
+
+static __always_inline re_dfastate_t *
+acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
+ Idx idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ if (dfa->init_state->has_constraint)
+ {
+ unsigned int context;
+ context = re_string_context_at (&mctx->input, idx - 1, mctx->eflags);
+ if (IS_WORD_CONTEXT (context))
+ return dfa->init_state_word;
+ else if (IS_ORDINARY_CONTEXT (context))
+ return dfa->init_state;
+ else if (IS_BEGBUF_CONTEXT (context) && IS_NEWLINE_CONTEXT (context))
+ return dfa->init_state_begbuf;
+ else if (IS_NEWLINE_CONTEXT (context))
+ return dfa->init_state_nl;
+ else if (IS_BEGBUF_CONTEXT (context))
+ {
+ /* It is relatively rare case, then calculate on demand. */
+ return re_acquire_state_context (err, dfa,
+ dfa->init_state->entrance_nodes,
+ context);
+ }
+ else
+ /* Must not happen? */
+ return dfa->init_state;
+ }
+ else
+ return dfa->init_state;
+}
+
+/* Check whether the regular expression match input string INPUT or not,
+ and return the index where the matching end. Return -1 if
+ there is no match, and return -2 in case of an error.
+ FL_LONGEST_MATCH means we want the POSIX longest matching.
+ If P_MATCH_FIRST is not NULL, and the match fails, it is set to the
+ next place where we may want to try matching.
+ Note that the matcher assumes that the matching starts from the current
+ index of the buffer. */
+
+static Idx
+__attribute_warn_unused_result__
+check_matching (re_match_context_t *mctx, bool fl_longest_match,
+ Idx *p_match_first)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx match = 0;
+ Idx match_last = -1;
+ Idx cur_str_idx = re_string_cur_idx (&mctx->input);
+ re_dfastate_t *cur_state;
+ bool at_init_state = p_match_first != NULL;
+ Idx next_start_idx = cur_str_idx;
+
+ err = REG_NOERROR;
+ cur_state = acquire_init_state_context (&err, mctx, cur_str_idx);
+ /* An initial state must not be NULL (invalid). */
+ if (__glibc_unlikely (cur_state == NULL))
+ {
+ DEBUG_ASSERT (err == REG_ESPACE);
+ return -2;
+ }
+
+ if (mctx->state_log != NULL)
+ {
+ mctx->state_log[cur_str_idx] = cur_state;
+
+ /* Check OP_OPEN_SUBEXP in the initial state in case that we use them
+ later. E.g. Processing back references. */
+ if (__glibc_unlikely (dfa->nbackref))
+ {
+ at_init_state = false;
+ err = check_subexp_matching_top (mctx, &cur_state->nodes, 0);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ if (cur_state->has_backref)
+ {
+ err = transit_state_bkref (mctx, &cur_state->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ }
+
+ /* If the RE accepts NULL string. */
+ if (__glibc_unlikely (cur_state->halt))
+ {
+ if (!cur_state->has_constraint
+ || check_halt_state_context (mctx, cur_state, cur_str_idx))
+ {
+ if (!fl_longest_match)
+ return cur_str_idx;
+ else
+ {
+ match_last = cur_str_idx;
+ match = 1;
+ }
+ }
+ }
+
+ while (!re_string_eoi (&mctx->input))
+ {
+ re_dfastate_t *old_state = cur_state;
+ Idx next_char_idx = re_string_cur_idx (&mctx->input) + 1;
+
+ if ((__glibc_unlikely (next_char_idx >= mctx->input.bufs_len)
+ && mctx->input.bufs_len < mctx->input.len)
+ || (__glibc_unlikely (next_char_idx >= mctx->input.valid_len)
+ && mctx->input.valid_len < mctx->input.len))
+ {
+ err = extend_buffers (mctx, next_char_idx + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ DEBUG_ASSERT (err == REG_ESPACE);
+ return -2;
+ }
+ }
+
+ cur_state = transit_state (&err, mctx, cur_state);
+ if (mctx->state_log != NULL)
+ cur_state = merge_state_with_log (&err, mctx, cur_state);
+
+ if (cur_state == NULL)
+ {
+ /* Reached the invalid state or an error. Try to recover a valid
+ state using the state log, if available and if we have not
+ already found a valid (even if not the longest) match. */
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return -2;
+
+ if (mctx->state_log == NULL
+ || (match && !fl_longest_match)
+ || (cur_state = find_recover_state (&err, mctx)) == NULL)
+ break;
+ }
+
+ if (__glibc_unlikely (at_init_state))
+ {
+ if (old_state == cur_state)
+ next_start_idx = next_char_idx;
+ else
+ at_init_state = false;
+ }
+
+ if (cur_state->halt)
+ {
+ /* Reached a halt state.
+ Check the halt state can satisfy the current context. */
+ if (!cur_state->has_constraint
+ || check_halt_state_context (mctx, cur_state,
+ re_string_cur_idx (&mctx->input)))
+ {
+ /* We found an appropriate halt state. */
+ match_last = re_string_cur_idx (&mctx->input);
+ match = 1;
+
+ /* We found a match, do not modify match_first below. */
+ p_match_first = NULL;
+ if (!fl_longest_match)
+ break;
+ }
+ }
+ }
+
+ if (p_match_first)
+ *p_match_first += next_start_idx;
+
+ return match_last;
+}
+
+/* Check NODE match the current context. */
+
+static bool
+check_halt_node_context (const re_dfa_t *dfa, Idx node, unsigned int context)
+{
+ re_token_type_t type = dfa->nodes[node].type;
+ unsigned int constraint = dfa->nodes[node].constraint;
+ if (type != END_OF_RE)
+ return false;
+ if (!constraint)
+ return true;
+ if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context))
+ return false;
+ return true;
+}
+
+/* Check the halt state STATE match the current context.
+ Return 0 if not match, if the node, STATE has, is a halt node and
+ match the context, return the node. */
+
+static Idx
+check_halt_state_context (const re_match_context_t *mctx,
+ const re_dfastate_t *state, Idx idx)
+{
+ Idx i;
+ unsigned int context;
+ DEBUG_ASSERT (state->halt);
+ context = re_string_context_at (&mctx->input, idx, mctx->eflags);
+ for (i = 0; i < state->nodes.nelem; ++i)
+ if (check_halt_node_context (mctx->dfa, state->nodes.elems[i], context))
+ return state->nodes.elems[i];
+ return 0;
+}
+
+/* Compute the next node to which "NFA" transit from NODE("NFA" is a NFA
+ corresponding to the DFA).
+ Return the destination node, and update EPS_VIA_NODES;
+ return -1 on match failure, -2 on error. */
+
+static Idx
+proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
+ regmatch_t *prevregs,
+ Idx *pidx, Idx node, re_node_set *eps_via_nodes,
+ struct re_fail_stack_t *fs)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ if (IS_EPSILON_NODE (dfa->nodes[node].type))
+ {
+ re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes;
+ re_node_set *edests = &dfa->edests[node];
+
+ if (! re_node_set_contains (eps_via_nodes, node))
+ {
+ bool ok = re_node_set_insert (eps_via_nodes, node);
+ if (__glibc_unlikely (! ok))
+ return -2;
+ }
+
+ /* Pick a valid destination, or return -1 if none is found. */
+ Idx dest_node = -1;
+ for (Idx i = 0; i < edests->nelem; i++)
+ {
+ Idx candidate = edests->elems[i];
+ if (!re_node_set_contains (cur_nodes, candidate))
+ continue;
+ if (dest_node == -1)
+ dest_node = candidate;
+
+ else
+ {
+ /* In order to avoid infinite loop like "(a*)*", return the second
+ epsilon-transition if the first was already considered. */
+ if (re_node_set_contains (eps_via_nodes, dest_node))
+ return candidate;
+
+ /* Otherwise, push the second epsilon-transition on the fail stack. */
+ else if (fs != NULL
+ && push_fail_stack (fs, *pidx, candidate, nregs, regs,
+ prevregs, eps_via_nodes))
+ return -2;
+
+ /* We know we are going to exit. */
+ break;
+ }
+ }
+ return dest_node;
+ }
+ else
+ {
+ Idx naccepted = 0;
+ re_token_type_t type = dfa->nodes[node].type;
+
+ if (dfa->nodes[node].accept_mb)
+ naccepted = check_node_accept_bytes (dfa, node, &mctx->input, *pidx);
+ else if (type == OP_BACK_REF)
+ {
+ Idx subexp_idx = dfa->nodes[node].opr.idx + 1;
+ if (subexp_idx < nregs)
+ naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so;
+ if (fs != NULL)
+ {
+ if (subexp_idx >= nregs
+ || regs[subexp_idx].rm_so == -1
+ || regs[subexp_idx].rm_eo == -1)
+ return -1;
+ else if (naccepted)
+ {
+ char *buf = (char *) re_string_get_buffer (&mctx->input);
+ if (mctx->input.valid_len - *pidx < naccepted
+ || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+ naccepted)
+ != 0))
+ return -1;
+ }
+ }
+
+ if (naccepted == 0)
+ {
+ Idx dest_node;
+ bool ok = re_node_set_insert (eps_via_nodes, node);
+ if (__glibc_unlikely (! ok))
+ return -2;
+ dest_node = dfa->edests[node].elems[0];
+ if (re_node_set_contains (&mctx->state_log[*pidx]->nodes,
+ dest_node))
+ return dest_node;
+ }
+ }
+
+ if (naccepted != 0
+ || check_node_accept (mctx, dfa->nodes + node, *pidx))
+ {
+ Idx dest_node = dfa->nexts[node];
+ *pidx = (naccepted == 0) ? *pidx + 1 : *pidx + naccepted;
+ if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL
+ || !re_node_set_contains (&mctx->state_log[*pidx]->nodes,
+ dest_node)))
+ return -1;
+ re_node_set_empty (eps_via_nodes);
+ return dest_node;
+ }
+ }
+ return -1;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
+ Idx nregs, regmatch_t *regs, regmatch_t *prevregs,
+ re_node_set *eps_via_nodes)
+{
+ reg_errcode_t err;
+ Idx num = fs->num;
+ if (num == fs->alloc)
+ {
+ struct re_fail_stack_ent_t *new_array;
+ new_array = re_realloc (fs->stack, struct re_fail_stack_ent_t,
+ fs->alloc * 2);
+ if (new_array == NULL)
+ return REG_ESPACE;
+ fs->alloc *= 2;
+ fs->stack = new_array;
+ }
+ fs->stack[num].idx = str_idx;
+ fs->stack[num].node = dest_node;
+ fs->stack[num].regs = re_malloc (regmatch_t, 2 * nregs);
+ if (fs->stack[num].regs == NULL)
+ return REG_ESPACE;
+ fs->num = num + 1;
+ memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
+ memcpy (fs->stack[num].regs + nregs, prevregs, sizeof (regmatch_t) * nregs);
+ err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes);
+ return err;
+}
+
+static Idx
+pop_fail_stack (struct re_fail_stack_t *fs, Idx *pidx, Idx nregs,
+ regmatch_t *regs, regmatch_t *prevregs,
+ re_node_set *eps_via_nodes)
+{
+ if (fs == NULL || fs->num == 0)
+ return -1;
+ Idx num = --fs->num;
+ *pidx = fs->stack[num].idx;
+ memcpy (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs);
+ memcpy (prevregs, fs->stack[num].regs + nregs, sizeof (regmatch_t) * nregs);
+ re_node_set_free (eps_via_nodes);
+ re_free (fs->stack[num].regs);
+ *eps_via_nodes = fs->stack[num].eps_via_nodes;
+ DEBUG_ASSERT (0 <= fs->stack[num].node);
+ return fs->stack[num].node;
+}
+
+
+#define DYNARRAY_STRUCT regmatch_list
+#define DYNARRAY_ELEMENT regmatch_t
+#define DYNARRAY_PREFIX regmatch_list_
+#include <malloc/dynarray-skeleton.c>
+
+/* Set the positions where the subexpressions are starts/ends to registers
+ PMATCH.
+ Note: We assume that pmatch[0] is already set, and
+ pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
+ regmatch_t *pmatch, bool fl_backtrack)
+{
+ const re_dfa_t *dfa = preg->buffer;
+ Idx idx, cur_node;
+ re_node_set eps_via_nodes;
+ struct re_fail_stack_t *fs;
+ struct re_fail_stack_t fs_body = { 0, 2, NULL };
+ struct regmatch_list prev_match;
+ regmatch_list_init (&prev_match);
+
+ DEBUG_ASSERT (nmatch > 1);
+ DEBUG_ASSERT (mctx->state_log != NULL);
+ if (fl_backtrack)
+ {
+ fs = &fs_body;
+ fs->stack = re_malloc (struct re_fail_stack_ent_t, fs->alloc);
+ if (fs->stack == NULL)
+ return REG_ESPACE;
+ }
+ else
+ fs = NULL;
+
+ cur_node = dfa->init_node;
+ re_node_set_init_empty (&eps_via_nodes);
+
+ if (!regmatch_list_resize (&prev_match, nmatch))
+ {
+ regmatch_list_free (&prev_match);
+ free_fail_stack_return (fs);
+ return REG_ESPACE;
+ }
+ regmatch_t *prev_idx_match = regmatch_list_begin (&prev_match);
+ memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
+
+ for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
+ {
+ update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
+
+ if ((idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
+ || (fs && re_node_set_contains (&eps_via_nodes, cur_node)))
+ {
+ Idx reg_idx;
+ cur_node = -1;
+ if (fs)
+ {
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
+ {
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ prev_idx_match, &eps_via_nodes);
+ break;
+ }
+ }
+ if (cur_node < 0)
+ {
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ return free_fail_stack_return (fs);
+ }
+ }
+
+ /* Proceed to next node. */
+ cur_node = proceed_next_node (mctx, nmatch, pmatch, prev_idx_match,
+ &idx, cur_node,
+ &eps_via_nodes, fs);
+
+ if (__glibc_unlikely (cur_node < 0))
+ {
+ if (__glibc_unlikely (cur_node == -2))
+ {
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ free_fail_stack_return (fs);
+ return REG_ESPACE;
+ }
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ prev_idx_match, &eps_via_nodes);
+ if (cur_node < 0)
+ {
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ free_fail_stack_return (fs);
+ return REG_NOMATCH;
+ }
+ }
+ }
+ re_node_set_free (&eps_via_nodes);
+ regmatch_list_free (&prev_match);
+ return free_fail_stack_return (fs);
+}
+
+static reg_errcode_t
+free_fail_stack_return (struct re_fail_stack_t *fs)
+{
+ if (fs)
+ {
+ Idx fs_idx;
+ for (fs_idx = 0; fs_idx < fs->num; ++fs_idx)
+ {
+ re_node_set_free (&fs->stack[fs_idx].eps_via_nodes);
+ re_free (fs->stack[fs_idx].regs);
+ }
+ re_free (fs->stack);
+ }
+ return REG_NOERROR;
+}
+
+static void
+update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
+ regmatch_t *prev_idx_match, Idx cur_node, Idx cur_idx, Idx nmatch)
+{
+ int type = dfa->nodes[cur_node].type;
+ if (type == OP_OPEN_SUBEXP)
+ {
+ Idx reg_num = dfa->nodes[cur_node].opr.idx + 1;
+
+ /* We are at the first node of this sub expression. */
+ if (reg_num < nmatch)
+ {
+ pmatch[reg_num].rm_so = cur_idx;
+ pmatch[reg_num].rm_eo = -1;
+ }
+ }
+ else if (type == OP_CLOSE_SUBEXP)
+ {
+ /* We are at the last node of this sub expression. */
+ Idx reg_num = dfa->nodes[cur_node].opr.idx + 1;
+ if (reg_num < nmatch)
+ {
+ if (pmatch[reg_num].rm_so < cur_idx)
+ {
+ pmatch[reg_num].rm_eo = cur_idx;
+ /* This is a non-empty match or we are not inside an optional
+ subexpression. Accept this right away. */
+ memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
+ }
+ else
+ {
+ if (dfa->nodes[cur_node].opt_subexp
+ && prev_idx_match[reg_num].rm_so != -1)
+ /* We transited through an empty match for an optional
+ subexpression, like (a?)*, and this is not the subexp's
+ first match. Copy back the old content of the registers
+ so that matches of an inner subexpression are undone as
+ well, like in ((a?))*. */
+ memcpy (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch);
+ else
+ /* We completed a subexpression, but it may be part of
+ an optional one, so do not update PREV_IDX_MATCH. */
+ pmatch[reg_num].rm_eo = cur_idx;
+ }
+ }
+ }
+}
+
+/* This function checks the STATE_LOG from the SCTX->last_str_idx to 0
+ and sift the nodes in each states according to the following rules.
+ Updated state_log will be wrote to STATE_LOG.
+
+ Rules: We throw away the Node 'a' in the STATE_LOG[STR_IDX] if...
+ 1. When STR_IDX == MATCH_LAST(the last index in the state_log):
+ If 'a' isn't the LAST_NODE and 'a' can't epsilon transit to
+ the LAST_NODE, we throw away the node 'a'.
+ 2. When 0 <= STR_IDX < MATCH_LAST and 'a' accepts
+ string 's' and transit to 'b':
+ i. If 'b' isn't in the STATE_LOG[STR_IDX+strlen('s')], we throw
+ away the node 'a'.
+ ii. If 'b' is in the STATE_LOG[STR_IDX+strlen('s')] but 'b' is
+ thrown away, we throw away the node 'a'.
+ 3. When 0 <= STR_IDX < MATCH_LAST and 'a' epsilon transit to 'b':
+ i. If 'b' isn't in the STATE_LOG[STR_IDX], we throw away the
+ node 'a'.
+ ii. If 'b' is in the STATE_LOG[STR_IDX] but 'b' is thrown away,
+ we throw away the node 'a'. */
+
+#define STATE_NODE_CONTAINS(state,node) \
+ ((state) != NULL && re_node_set_contains (&(state)->nodes, node))
+
+static reg_errcode_t
+sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
+{
+ reg_errcode_t err;
+ int null_cnt = 0;
+ Idx str_idx = sctx->last_str_idx;
+ re_node_set cur_dest;
+
+ DEBUG_ASSERT (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL);
+
+ /* Build sifted state_log[str_idx]. It has the nodes which can epsilon
+ transit to the last_node and the last_node itself. */
+ err = re_node_set_init_1 (&cur_dest, sctx->last_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* Then check each states in the state_log. */
+ while (str_idx > 0)
+ {
+ /* Update counters. */
+ null_cnt = (sctx->sifted_states[str_idx] == NULL) ? null_cnt + 1 : 0;
+ if (null_cnt > mctx->max_mb_elem_len)
+ {
+ memset (sctx->sifted_states, '\0',
+ sizeof (re_dfastate_t *) * str_idx);
+ re_node_set_free (&cur_dest);
+ return REG_NOERROR;
+ }
+ re_node_set_empty (&cur_dest);
+ --str_idx;
+
+ if (mctx->state_log[str_idx])
+ {
+ err = build_sifted_states (mctx, sctx, str_idx, &cur_dest);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+
+ /* Add all the nodes which satisfy the following conditions:
+ - It can epsilon transit to a node in CUR_DEST.
+ - It is in CUR_SRC.
+ And update state_log. */
+ err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ err = REG_NOERROR;
+ free_return:
+ re_node_set_free (&cur_dest);
+ return err;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
+ Idx str_idx, re_node_set *cur_dest)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ const re_node_set *cur_src = &mctx->state_log[str_idx]->non_eps_nodes;
+ Idx i;
+
+ /* Then build the next sifted state.
+ We build the next sifted state on 'cur_dest', and update
+ 'sifted_states[str_idx]' with 'cur_dest'.
+ Note:
+ 'cur_dest' is the sifted state from 'state_log[str_idx + 1]'.
+ 'cur_src' points the node_set of the old 'state_log[str_idx]'
+ (with the epsilon nodes pre-filtered out). */
+ for (i = 0; i < cur_src->nelem; i++)
+ {
+ Idx prev_node = cur_src->elems[i];
+ int naccepted = 0;
+ bool ok;
+ DEBUG_ASSERT (!IS_EPSILON_NODE (dfa->nodes[prev_node].type));
+
+ /* If the node may accept "multi byte". */
+ if (dfa->nodes[prev_node].accept_mb)
+ naccepted = sift_states_iter_mb (mctx, sctx, prev_node,
+ str_idx, sctx->last_str_idx);
+
+ /* We don't check backreferences here.
+ See update_cur_sifted_state(). */
+ if (!naccepted
+ && check_node_accept (mctx, dfa->nodes + prev_node, str_idx)
+ && STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + 1],
+ dfa->nexts[prev_node]))
+ naccepted = 1;
+
+ if (naccepted == 0)
+ continue;
+
+ if (sctx->limits.nelem)
+ {
+ Idx to_idx = str_idx + naccepted;
+ if (check_dst_limits (mctx, &sctx->limits,
+ dfa->nexts[prev_node], to_idx,
+ prev_node, str_idx))
+ continue;
+ }
+ ok = re_node_set_insert (cur_dest, prev_node);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+
+ return REG_NOERROR;
+}
+
+/* Helper functions. */
+
+static reg_errcode_t
+clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx)
+{
+ Idx top = mctx->state_log_top;
+
+ if ((next_state_log_idx >= mctx->input.bufs_len
+ && mctx->input.bufs_len < mctx->input.len)
+ || (next_state_log_idx >= mctx->input.valid_len
+ && mctx->input.valid_len < mctx->input.len))
+ {
+ reg_errcode_t err;
+ err = extend_buffers (mctx, next_state_log_idx + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ if (top < next_state_log_idx)
+ {
+ DEBUG_ASSERT (mctx->state_log != NULL);
+ memset (mctx->state_log + top + 1, '\0',
+ sizeof (re_dfastate_t *) * (next_state_log_idx - top));
+ mctx->state_log_top = next_state_log_idx;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst,
+ re_dfastate_t **src, Idx num)
+{
+ Idx st_idx;
+ reg_errcode_t err;
+ for (st_idx = 0; st_idx < num; ++st_idx)
+ {
+ if (dst[st_idx] == NULL)
+ dst[st_idx] = src[st_idx];
+ else if (src[st_idx] != NULL)
+ {
+ re_node_set merged_set;
+ err = re_node_set_init_union (&merged_set, &dst[st_idx]->nodes,
+ &src[st_idx]->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ dst[st_idx] = re_acquire_state (&err, dfa, &merged_set);
+ re_node_set_free (&merged_set);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+update_cur_sifted_state (const re_match_context_t *mctx,
+ re_sift_context_t *sctx, Idx str_idx,
+ re_node_set *dest_nodes)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err = REG_NOERROR;
+ const re_node_set *candidates;
+ candidates = ((mctx->state_log[str_idx] == NULL) ? NULL
+ : &mctx->state_log[str_idx]->nodes);
+
+ if (dest_nodes->nelem == 0)
+ sctx->sifted_states[str_idx] = NULL;
+ else
+ {
+ if (candidates)
+ {
+ /* At first, add the nodes which can epsilon transit to a node in
+ DEST_NODE. */
+ err = add_epsilon_src_nodes (dfa, dest_nodes, candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ /* Then, check the limitations in the current sift_context. */
+ if (sctx->limits.nelem)
+ {
+ err = check_subexp_limits (dfa, dest_nodes, candidates, &sctx->limits,
+ mctx->bkref_ents, str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+
+ sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ if (candidates && mctx->state_log[str_idx]->has_backref)
+ {
+ err = sift_states_bkref (mctx, sctx, str_idx, candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes,
+ const re_node_set *candidates)
+{
+ reg_errcode_t err = REG_NOERROR;
+ Idx i;
+
+ re_dfastate_t *state = re_acquire_state (&err, dfa, dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ if (!state->inveclosure.alloc)
+ {
+ err = re_node_set_alloc (&state->inveclosure, dest_nodes->nelem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return REG_ESPACE;
+ for (i = 0; i < dest_nodes->nelem; i++)
+ {
+ err = re_node_set_merge (&state->inveclosure,
+ dfa->inveclosures + dest_nodes->elems[i]);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return REG_ESPACE;
+ }
+ }
+ return re_node_set_add_intersect (dest_nodes, candidates,
+ &state->inveclosure);
+}
+
+static reg_errcode_t
+sub_epsilon_src_nodes (const re_dfa_t *dfa, Idx node, re_node_set *dest_nodes,
+ const re_node_set *candidates)
+{
+ Idx ecl_idx;
+ reg_errcode_t err;
+ re_node_set *inv_eclosure = dfa->inveclosures + node;
+ re_node_set except_nodes;
+ re_node_set_init_empty (&except_nodes);
+ for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx)
+ {
+ Idx cur_node = inv_eclosure->elems[ecl_idx];
+ if (cur_node == node)
+ continue;
+ if (IS_EPSILON_NODE (dfa->nodes[cur_node].type))
+ {
+ Idx edst1 = dfa->edests[cur_node].elems[0];
+ Idx edst2 = ((dfa->edests[cur_node].nelem > 1)
+ ? dfa->edests[cur_node].elems[1] : -1);
+ if ((!re_node_set_contains (inv_eclosure, edst1)
+ && re_node_set_contains (dest_nodes, edst1))
+ || (edst2 > 0
+ && !re_node_set_contains (inv_eclosure, edst2)
+ && re_node_set_contains (dest_nodes, edst2)))
+ {
+ err = re_node_set_add_intersect (&except_nodes, candidates,
+ dfa->inveclosures + cur_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&except_nodes);
+ return err;
+ }
+ }
+ }
+ }
+ for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx)
+ {
+ Idx cur_node = inv_eclosure->elems[ecl_idx];
+ if (!re_node_set_contains (&except_nodes, cur_node))
+ {
+ Idx idx = re_node_set_contains (dest_nodes, cur_node) - 1;
+ re_node_set_remove_at (dest_nodes, idx);
+ }
+ }
+ re_node_set_free (&except_nodes);
+ return REG_NOERROR;
+}
+
+static bool
+check_dst_limits (const re_match_context_t *mctx, const re_node_set *limits,
+ Idx dst_node, Idx dst_idx, Idx src_node, Idx src_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx lim_idx, src_pos, dst_pos;
+
+ Idx dst_bkref_idx = search_cur_bkref_entry (mctx, dst_idx);
+ Idx src_bkref_idx = search_cur_bkref_entry (mctx, src_idx);
+ for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx)
+ {
+ Idx subexp_idx;
+ struct re_backref_cache_entry *ent;
+ ent = mctx->bkref_ents + limits->elems[lim_idx];
+ subexp_idx = dfa->nodes[ent->node].opr.idx;
+
+ dst_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx],
+ subexp_idx, dst_node, dst_idx,
+ dst_bkref_idx);
+ src_pos = check_dst_limits_calc_pos (mctx, limits->elems[lim_idx],
+ subexp_idx, src_node, src_idx,
+ src_bkref_idx);
+
+ /* In case of:
+ <src> <dst> ( <subexp> )
+ ( <subexp> ) <src> <dst>
+ ( <subexp1> <src> <subexp2> <dst> <subexp3> ) */
+ if (src_pos == dst_pos)
+ continue; /* This is unrelated limitation. */
+ else
+ return true;
+ }
+ return false;
+}
+
+static int
+check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
+ Idx subexp_idx, Idx from_node, Idx bkref_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ const re_node_set *eclosures = dfa->eclosures + from_node;
+ Idx node_idx;
+
+ /* Else, we are on the boundary: examine the nodes on the epsilon
+ closure. */
+ for (node_idx = 0; node_idx < eclosures->nelem; ++node_idx)
+ {
+ Idx node = eclosures->elems[node_idx];
+ switch (dfa->nodes[node].type)
+ {
+ case OP_BACK_REF:
+ if (bkref_idx != -1)
+ {
+ struct re_backref_cache_entry *ent = mctx->bkref_ents + bkref_idx;
+ do
+ {
+ Idx dst;
+ int cpos;
+
+ if (ent->node != node)
+ continue;
+
+ if (subexp_idx < BITSET_WORD_BITS
+ && !(ent->eps_reachable_subexps_map
+ & ((bitset_word_t) 1 << subexp_idx)))
+ continue;
+
+ /* Recurse trying to reach the OP_OPEN_SUBEXP and
+ OP_CLOSE_SUBEXP cases below. But, if the
+ destination node is the same node as the source
+ node, don't recurse because it would cause an
+ infinite loop: a regex that exhibits this behavior
+ is ()\1*\1* */
+ dst = dfa->edests[node].elems[0];
+ if (dst == from_node)
+ {
+ if (boundaries & 1)
+ return -1;
+ else /* if (boundaries & 2) */
+ return 0;
+ }
+
+ cpos =
+ check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx,
+ dst, bkref_idx);
+ if (cpos == -1 /* && (boundaries & 1) */)
+ return -1;
+ if (cpos == 0 && (boundaries & 2))
+ return 0;
+
+ if (subexp_idx < BITSET_WORD_BITS)
+ ent->eps_reachable_subexps_map
+ &= ~((bitset_word_t) 1 << subexp_idx);
+ }
+ while (ent++->more);
+ }
+ break;
+
+ case OP_OPEN_SUBEXP:
+ if ((boundaries & 1) && subexp_idx == dfa->nodes[node].opr.idx)
+ return -1;
+ break;
+
+ case OP_CLOSE_SUBEXP:
+ if ((boundaries & 2) && subexp_idx == dfa->nodes[node].opr.idx)
+ return 0;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return (boundaries & 2) ? 1 : 0;
+}
+
+static int
+check_dst_limits_calc_pos (const re_match_context_t *mctx, Idx limit,
+ Idx subexp_idx, Idx from_node, Idx str_idx,
+ Idx bkref_idx)
+{
+ struct re_backref_cache_entry *lim = mctx->bkref_ents + limit;
+ int boundaries;
+
+ /* If we are outside the range of the subexpression, return -1 or 1. */
+ if (str_idx < lim->subexp_from)
+ return -1;
+
+ if (lim->subexp_to < str_idx)
+ return 1;
+
+ /* If we are within the subexpression, return 0. */
+ boundaries = (str_idx == lim->subexp_from);
+ boundaries |= (str_idx == lim->subexp_to) << 1;
+ if (boundaries == 0)
+ return 0;
+
+ /* Else, examine epsilon closure. */
+ return check_dst_limits_calc_pos_1 (mctx, boundaries, subexp_idx,
+ from_node, bkref_idx);
+}
+
+/* Check the limitations of sub expressions LIMITS, and remove the nodes
+ which are against limitations from DEST_NODES. */
+
+static reg_errcode_t
+check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
+ const re_node_set *candidates, re_node_set *limits,
+ struct re_backref_cache_entry *bkref_ents, Idx str_idx)
+{
+ reg_errcode_t err;
+ Idx node_idx, lim_idx;
+
+ for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx)
+ {
+ Idx subexp_idx;
+ struct re_backref_cache_entry *ent;
+ ent = bkref_ents + limits->elems[lim_idx];
+
+ if (str_idx <= ent->subexp_from || ent->str_idx < str_idx)
+ continue; /* This is unrelated limitation. */
+
+ subexp_idx = dfa->nodes[ent->node].opr.idx;
+ if (ent->subexp_to == str_idx)
+ {
+ Idx ops_node = -1;
+ Idx cls_node = -1;
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ Idx node = dest_nodes->elems[node_idx];
+ re_token_type_t type = dfa->nodes[node].type;
+ if (type == OP_OPEN_SUBEXP
+ && subexp_idx == dfa->nodes[node].opr.idx)
+ ops_node = node;
+ else if (type == OP_CLOSE_SUBEXP
+ && subexp_idx == dfa->nodes[node].opr.idx)
+ cls_node = node;
+ }
+
+ /* Check the limitation of the open subexpression. */
+ /* Note that (ent->subexp_to = str_idx != ent->subexp_from). */
+ if (ops_node >= 0)
+ {
+ err = sub_epsilon_src_nodes (dfa, ops_node, dest_nodes,
+ candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ /* Check the limitation of the close subexpression. */
+ if (cls_node >= 0)
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ Idx node = dest_nodes->elems[node_idx];
+ if (!re_node_set_contains (dfa->inveclosures + node,
+ cls_node)
+ && !re_node_set_contains (dfa->eclosures + node,
+ cls_node))
+ {
+ /* It is against this limitation.
+ Remove it form the current sifted state. */
+ err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
+ candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ --node_idx;
+ }
+ }
+ }
+ else /* (ent->subexp_to != str_idx) */
+ {
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ Idx node = dest_nodes->elems[node_idx];
+ re_token_type_t type = dfa->nodes[node].type;
+ if (type == OP_CLOSE_SUBEXP || type == OP_OPEN_SUBEXP)
+ {
+ if (subexp_idx != dfa->nodes[node].opr.idx)
+ continue;
+ /* It is against this limitation.
+ Remove it form the current sifted state. */
+ err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
+ candidates);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
+ Idx str_idx, const re_node_set *candidates)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx node_idx, node;
+ re_sift_context_t local_sctx;
+ Idx first_idx = search_cur_bkref_entry (mctx, str_idx);
+
+ if (first_idx == -1)
+ return REG_NOERROR;
+
+ local_sctx.sifted_states = NULL; /* Mark that it hasn't been initialized. */
+
+ for (node_idx = 0; node_idx < candidates->nelem; ++node_idx)
+ {
+ Idx enabled_idx;
+ re_token_type_t type;
+ struct re_backref_cache_entry *entry;
+ node = candidates->elems[node_idx];
+ type = dfa->nodes[node].type;
+ /* Avoid infinite loop for the REs like "()\1+". */
+ if (node == sctx->last_node && str_idx == sctx->last_str_idx)
+ continue;
+ if (type != OP_BACK_REF)
+ continue;
+
+ entry = mctx->bkref_ents + first_idx;
+ enabled_idx = first_idx;
+ do
+ {
+ Idx subexp_len;
+ Idx to_idx;
+ Idx dst_node;
+ bool ok;
+ re_dfastate_t *cur_state;
+
+ if (entry->node != node)
+ continue;
+ subexp_len = entry->subexp_to - entry->subexp_from;
+ to_idx = str_idx + subexp_len;
+ dst_node = (subexp_len ? dfa->nexts[node]
+ : dfa->edests[node].elems[0]);
+
+ if (to_idx > sctx->last_str_idx
+ || sctx->sifted_states[to_idx] == NULL
+ || !STATE_NODE_CONTAINS (sctx->sifted_states[to_idx], dst_node)
+ || check_dst_limits (mctx, &sctx->limits, node,
+ str_idx, dst_node, to_idx))
+ continue;
+
+ if (local_sctx.sifted_states == NULL)
+ {
+ local_sctx = *sctx;
+ err = re_node_set_init_copy (&local_sctx.limits, &sctx->limits);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ local_sctx.last_node = node;
+ local_sctx.last_str_idx = str_idx;
+ ok = re_node_set_insert (&local_sctx.limits, enabled_idx);
+ if (__glibc_unlikely (! ok))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ cur_state = local_sctx.sifted_states[str_idx];
+ err = sift_states_backward (mctx, &local_sctx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ if (sctx->limited_states != NULL)
+ {
+ err = merge_state_array (dfa, sctx->limited_states,
+ local_sctx.sifted_states,
+ str_idx + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ local_sctx.sifted_states[str_idx] = cur_state;
+ re_node_set_remove (&local_sctx.limits, enabled_idx);
+
+ /* mctx->bkref_ents may have changed, reload the pointer. */
+ entry = mctx->bkref_ents + enabled_idx;
+ }
+ while (enabled_idx++, entry++->more);
+ }
+ err = REG_NOERROR;
+ free_return:
+ if (local_sctx.sifted_states != NULL)
+ {
+ re_node_set_free (&local_sctx.limits);
+ }
+
+ return err;
+}
+
+
+static int
+sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
+ Idx node_idx, Idx str_idx, Idx max_str_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ int naccepted;
+ /* Check the node can accept "multi byte". */
+ naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx);
+ if (naccepted > 0 && str_idx + naccepted <= max_str_idx
+ && !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
+ dfa->nexts[node_idx]))
+ /* The node can't accept the "multi byte", or the
+ destination was already thrown away, then the node
+ couldn't accept the current input "multi byte". */
+ naccepted = 0;
+ /* Otherwise, it is sure that the node could accept
+ 'naccepted' bytes input. */
+ return naccepted;
+}
+
+/* Functions for state transition. */
+
+/* Return the next state to which the current state STATE will transit by
+ accepting the current input byte, and update STATE_LOG if necessary.
+ Return NULL on failure.
+ If STATE can accept a multibyte char/collating element/back reference
+ update the destination of STATE_LOG. */
+
+static re_dfastate_t *
+__attribute_warn_unused_result__
+transit_state (reg_errcode_t *err, re_match_context_t *mctx,
+ re_dfastate_t *state)
+{
+ re_dfastate_t **trtable;
+ unsigned char ch;
+
+ /* If the current state can accept multibyte. */
+ if (__glibc_unlikely (state->accept_mb))
+ {
+ *err = transit_state_mb (mctx, state);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ }
+
+ /* Then decide the next state with the single byte. */
+#if 0
+ if (0)
+ /* don't use transition table */
+ return transit_state_sb (err, mctx, state);
+#endif
+
+ /* Use transition table */
+ ch = re_string_fetch_byte (&mctx->input);
+ for (;;)
+ {
+ trtable = state->trtable;
+ if (__glibc_likely (trtable != NULL))
+ return trtable[ch];
+
+ trtable = state->word_trtable;
+ if (__glibc_likely (trtable != NULL))
+ {
+ unsigned int context;
+ context
+ = re_string_context_at (&mctx->input,
+ re_string_cur_idx (&mctx->input) - 1,
+ mctx->eflags);
+ if (IS_WORD_CONTEXT (context))
+ return trtable[ch + SBC_MAX];
+ else
+ return trtable[ch];
+ }
+
+ if (!build_trtable (mctx->dfa, state))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ /* Retry, we now have a transition table. */
+ }
+}
+
+/* Update the state_log if we need */
+static re_dfastate_t *
+merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
+ re_dfastate_t *next_state)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx cur_idx = re_string_cur_idx (&mctx->input);
+
+ if (cur_idx > mctx->state_log_top)
+ {
+ mctx->state_log[cur_idx] = next_state;
+ mctx->state_log_top = cur_idx;
+ }
+ else if (mctx->state_log[cur_idx] == 0)
+ {
+ mctx->state_log[cur_idx] = next_state;
+ }
+ else
+ {
+ re_dfastate_t *pstate;
+ unsigned int context;
+ re_node_set next_nodes, *log_nodes, *table_nodes = NULL;
+ /* If (state_log[cur_idx] != 0), it implies that cur_idx is
+ the destination of a multibyte char/collating element/
+ back reference. Then the next state is the union set of
+ these destinations and the results of the transition table. */
+ pstate = mctx->state_log[cur_idx];
+ log_nodes = pstate->entrance_nodes;
+ if (next_state != NULL)
+ {
+ table_nodes = next_state->entrance_nodes;
+ *err = re_node_set_init_union (&next_nodes, table_nodes,
+ log_nodes);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ }
+ else
+ next_nodes = *log_nodes;
+ /* Note: We already add the nodes of the initial state,
+ then we don't need to add them here. */
+
+ context = re_string_context_at (&mctx->input,
+ re_string_cur_idx (&mctx->input) - 1,
+ mctx->eflags);
+ next_state = mctx->state_log[cur_idx]
+ = re_acquire_state_context (err, dfa, &next_nodes, context);
+ /* We don't need to check errors here, since the return value of
+ this function is next_state and ERR is already set. */
+
+ if (table_nodes != NULL)
+ re_node_set_free (&next_nodes);
+ }
+
+ if (__glibc_unlikely (dfa->nbackref) && next_state != NULL)
+ {
+ /* Check OP_OPEN_SUBEXP in the current state in case that we use them
+ later. We must check them here, since the back references in the
+ next state might use them. */
+ *err = check_subexp_matching_top (mctx, &next_state->nodes,
+ cur_idx);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+
+ /* If the next state has back references. */
+ if (next_state->has_backref)
+ {
+ *err = transit_state_bkref (mctx, &next_state->nodes);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ next_state = mctx->state_log[cur_idx];
+ }
+ }
+
+ return next_state;
+}
+
+/* Skip bytes in the input that correspond to part of a
+ multi-byte match, then look in the log for a state
+ from which to restart matching. */
+static re_dfastate_t *
+find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
+{
+ re_dfastate_t *cur_state;
+ do
+ {
+ Idx max = mctx->state_log_top;
+ Idx cur_str_idx = re_string_cur_idx (&mctx->input);
+
+ do
+ {
+ if (++cur_str_idx > max)
+ return NULL;
+ re_string_skip_bytes (&mctx->input, 1);
+ }
+ while (mctx->state_log[cur_str_idx] == NULL);
+
+ cur_state = merge_state_with_log (err, mctx, NULL);
+ }
+ while (*err == REG_NOERROR && cur_state == NULL);
+ return cur_state;
+}
+
+/* Helper functions for transit_state. */
+
+/* From the node set CUR_NODES, pick up the nodes whose types are
+ OP_OPEN_SUBEXP and which have corresponding back references in the regular
+ expression. And register them to use them later for evaluating the
+ corresponding back references. */
+
+static reg_errcode_t
+check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes,
+ Idx str_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx node_idx;
+ reg_errcode_t err;
+
+ /* TODO: This isn't efficient.
+ Because there might be more than one nodes whose types are
+ OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all
+ nodes.
+ E.g. RE: (a){2} */
+ for (node_idx = 0; node_idx < cur_nodes->nelem; ++node_idx)
+ {
+ Idx node = cur_nodes->elems[node_idx];
+ if (dfa->nodes[node].type == OP_OPEN_SUBEXP
+ && dfa->nodes[node].opr.idx < BITSET_WORD_BITS
+ && (dfa->used_bkref_map
+ & ((bitset_word_t) 1 << dfa->nodes[node].opr.idx)))
+ {
+ err = match_ctx_add_subtop (mctx, node, str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+#if 0
+/* Return the next state to which the current state STATE will transit by
+ accepting the current input byte. Return NULL on failure. */
+
+static re_dfastate_t *
+transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
+ re_dfastate_t *state)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ re_node_set next_nodes;
+ re_dfastate_t *next_state;
+ Idx node_cnt, cur_str_idx = re_string_cur_idx (&mctx->input);
+ unsigned int context;
+
+ *err = re_node_set_alloc (&next_nodes, state->nodes.nelem + 1);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ return NULL;
+ for (node_cnt = 0; node_cnt < state->nodes.nelem; ++node_cnt)
+ {
+ Idx cur_node = state->nodes.elems[node_cnt];
+ if (check_node_accept (mctx, dfa->nodes + cur_node, cur_str_idx))
+ {
+ *err = re_node_set_merge (&next_nodes,
+ dfa->eclosures + dfa->nexts[cur_node]);
+ if (__glibc_unlikely (*err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return NULL;
+ }
+ }
+ }
+ context = re_string_context_at (&mctx->input, cur_str_idx, mctx->eflags);
+ next_state = re_acquire_state_context (err, dfa, &next_nodes, context);
+ /* We don't need to check errors here, since the return value of
+ this function is next_state and ERR is already set. */
+
+ re_node_set_free (&next_nodes);
+ re_string_skip_bytes (&mctx->input, 1);
+ return next_state;
+}
+#endif
+
+static reg_errcode_t
+transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx i;
+
+ for (i = 0; i < pstate->nodes.nelem; ++i)
+ {
+ re_node_set dest_nodes, *new_nodes;
+ Idx cur_node_idx = pstate->nodes.elems[i];
+ int naccepted;
+ Idx dest_idx;
+ unsigned int context;
+ re_dfastate_t *dest_state;
+
+ if (!dfa->nodes[cur_node_idx].accept_mb)
+ continue;
+
+ if (dfa->nodes[cur_node_idx].constraint)
+ {
+ context = re_string_context_at (&mctx->input,
+ re_string_cur_idx (&mctx->input),
+ mctx->eflags);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint,
+ context))
+ continue;
+ }
+
+ /* How many bytes the node can accept? */
+ naccepted = check_node_accept_bytes (dfa, cur_node_idx, &mctx->input,
+ re_string_cur_idx (&mctx->input));
+ if (naccepted == 0)
+ continue;
+
+ /* The node can accepts 'naccepted' bytes. */
+ dest_idx = re_string_cur_idx (&mctx->input) + naccepted;
+ mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted
+ : mctx->max_mb_elem_len);
+ err = clean_state_log_if_needed (mctx, dest_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ DEBUG_ASSERT (dfa->nexts[cur_node_idx] != -1);
+ new_nodes = dfa->eclosures + dfa->nexts[cur_node_idx];
+
+ dest_state = mctx->state_log[dest_idx];
+ if (dest_state == NULL)
+ dest_nodes = *new_nodes;
+ else
+ {
+ err = re_node_set_init_union (&dest_nodes,
+ dest_state->entrance_nodes, new_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ context = re_string_context_at (&mctx->input, dest_idx - 1,
+ mctx->eflags);
+ mctx->state_log[dest_idx]
+ = re_acquire_state_context (&err, dfa, &dest_nodes, context);
+ if (dest_state != NULL)
+ re_node_set_free (&dest_nodes);
+ if (__glibc_unlikely (mctx->state_log[dest_idx] == NULL
+ && err != REG_NOERROR))
+ return err;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx i;
+ Idx cur_str_idx = re_string_cur_idx (&mctx->input);
+
+ for (i = 0; i < nodes->nelem; ++i)
+ {
+ Idx dest_str_idx, prev_nelem, bkc_idx;
+ Idx node_idx = nodes->elems[i];
+ unsigned int context;
+ const re_token_t *node = dfa->nodes + node_idx;
+ re_node_set *new_dest_nodes;
+
+ /* Check whether 'node' is a backreference or not. */
+ if (node->type != OP_BACK_REF)
+ continue;
+
+ if (node->constraint)
+ {
+ context = re_string_context_at (&mctx->input, cur_str_idx,
+ mctx->eflags);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context))
+ continue;
+ }
+
+ /* 'node' is a backreference.
+ Check the substring which the substring matched. */
+ bkc_idx = mctx->nbkref_ents;
+ err = get_subexp (mctx, node_idx, cur_str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+
+ /* And add the epsilon closures (which is 'new_dest_nodes') of
+ the backreference to appropriate state_log. */
+ DEBUG_ASSERT (dfa->nexts[node_idx] != -1);
+ for (; bkc_idx < mctx->nbkref_ents; ++bkc_idx)
+ {
+ Idx subexp_len;
+ re_dfastate_t *dest_state;
+ struct re_backref_cache_entry *bkref_ent;
+ bkref_ent = mctx->bkref_ents + bkc_idx;
+ if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx)
+ continue;
+ subexp_len = bkref_ent->subexp_to - bkref_ent->subexp_from;
+ new_dest_nodes = (subexp_len == 0
+ ? dfa->eclosures + dfa->edests[node_idx].elems[0]
+ : dfa->eclosures + dfa->nexts[node_idx]);
+ dest_str_idx = (cur_str_idx + bkref_ent->subexp_to
+ - bkref_ent->subexp_from);
+ context = re_string_context_at (&mctx->input, dest_str_idx - 1,
+ mctx->eflags);
+ dest_state = mctx->state_log[dest_str_idx];
+ prev_nelem = ((mctx->state_log[cur_str_idx] == NULL) ? 0
+ : mctx->state_log[cur_str_idx]->nodes.nelem);
+ /* Add 'new_dest_node' to state_log. */
+ if (dest_state == NULL)
+ {
+ mctx->state_log[dest_str_idx]
+ = re_acquire_state_context (&err, dfa, new_dest_nodes,
+ context);
+ if (__glibc_unlikely (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR))
+ goto free_return;
+ }
+ else
+ {
+ re_node_set dest_nodes;
+ err = re_node_set_init_union (&dest_nodes,
+ dest_state->entrance_nodes,
+ new_dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&dest_nodes);
+ goto free_return;
+ }
+ mctx->state_log[dest_str_idx]
+ = re_acquire_state_context (&err, dfa, &dest_nodes, context);
+ re_node_set_free (&dest_nodes);
+ if (__glibc_unlikely (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR))
+ goto free_return;
+ }
+ /* We need to check recursively if the backreference can epsilon
+ transit. */
+ if (subexp_len == 0
+ && mctx->state_log[cur_str_idx]->nodes.nelem > prev_nelem)
+ {
+ err = check_subexp_matching_top (mctx, new_dest_nodes,
+ cur_str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ err = transit_state_bkref (mctx, new_dest_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto free_return;
+ }
+ }
+ }
+ err = REG_NOERROR;
+ free_return:
+ return err;
+}
+
+/* Enumerate all the candidates which the backreference BKREF_NODE can match
+ at BKREF_STR_IDX, and register them by match_ctx_add_entry().
+ Note that we might collect inappropriate candidates here.
+ However, the cost of checking them strictly here is too high, then we
+ delay these checking for prune_impossible_nodes(). */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ Idx subexp_num, sub_top_idx;
+ const char *buf = (const char *) re_string_get_buffer (&mctx->input);
+ /* Return if we have already checked BKREF_NODE at BKREF_STR_IDX. */
+ Idx cache_idx = search_cur_bkref_entry (mctx, bkref_str_idx);
+ if (cache_idx != -1)
+ {
+ const struct re_backref_cache_entry *entry
+ = mctx->bkref_ents + cache_idx;
+ do
+ if (entry->node == bkref_node)
+ return REG_NOERROR; /* We already checked it. */
+ while (entry++->more);
+ }
+
+ subexp_num = dfa->nodes[bkref_node].opr.idx;
+
+ /* For each sub expression */
+ for (sub_top_idx = 0; sub_top_idx < mctx->nsub_tops; ++sub_top_idx)
+ {
+ reg_errcode_t err;
+ re_sub_match_top_t *sub_top = mctx->sub_tops[sub_top_idx];
+ re_sub_match_last_t *sub_last;
+ Idx sub_last_idx, sl_str, bkref_str_off;
+
+ if (dfa->nodes[sub_top->node].opr.idx != subexp_num)
+ continue; /* It isn't related. */
+
+ sl_str = sub_top->str_idx;
+ bkref_str_off = bkref_str_idx;
+ /* At first, check the last node of sub expressions we already
+ evaluated. */
+ for (sub_last_idx = 0; sub_last_idx < sub_top->nlasts; ++sub_last_idx)
+ {
+ regoff_t sl_str_diff;
+ sub_last = sub_top->lasts[sub_last_idx];
+ sl_str_diff = sub_last->str_idx - sl_str;
+ /* The matched string by the sub expression match with the substring
+ at the back reference? */
+ if (sl_str_diff > 0)
+ {
+ if (__glibc_unlikely (bkref_str_off + sl_str_diff
+ > mctx->input.valid_len))
+ {
+ /* Not enough chars for a successful match. */
+ if (bkref_str_off + sl_str_diff > mctx->input.len)
+ break;
+
+ err = clean_state_log_if_needed (mctx,
+ bkref_str_off
+ + sl_str_diff);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+ }
+ if (memcmp (buf + bkref_str_off, buf + sl_str, sl_str_diff) != 0)
+ /* We don't need to search this sub expression any more. */
+ break;
+ }
+ bkref_str_off += sl_str_diff;
+ sl_str += sl_str_diff;
+ err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node,
+ bkref_str_idx);
+
+ /* Reload buf, since the preceding call might have reallocated
+ the buffer. */
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+
+ if (err == REG_NOMATCH)
+ continue;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+
+ if (sub_last_idx < sub_top->nlasts)
+ continue;
+ if (sub_last_idx > 0)
+ ++sl_str;
+ /* Then, search for the other last nodes of the sub expression. */
+ for (; sl_str <= bkref_str_idx; ++sl_str)
+ {
+ Idx cls_node;
+ regoff_t sl_str_off;
+ const re_node_set *nodes;
+ sl_str_off = sl_str - sub_top->str_idx;
+ /* The matched string by the sub expression match with the substring
+ at the back reference? */
+ if (sl_str_off > 0)
+ {
+ if (__glibc_unlikely (bkref_str_off >= mctx->input.valid_len))
+ {
+ /* If we are at the end of the input, we cannot match. */
+ if (bkref_str_off >= mctx->input.len)
+ break;
+
+ err = extend_buffers (mctx, bkref_str_off + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+ }
+ if (buf [bkref_str_off++] != buf[sl_str - 1])
+ break; /* We don't need to search this sub expression
+ any more. */
+ }
+ if (mctx->state_log[sl_str] == NULL)
+ continue;
+ /* Does this state have a ')' of the sub expression? */
+ nodes = &mctx->state_log[sl_str]->nodes;
+ cls_node = find_subexp_node (dfa, nodes, subexp_num,
+ OP_CLOSE_SUBEXP);
+ if (cls_node == -1)
+ continue; /* No. */
+ if (sub_top->path == NULL)
+ {
+ sub_top->path = calloc (sizeof (state_array_t),
+ sl_str - sub_top->str_idx + 1);
+ if (sub_top->path == NULL)
+ return REG_ESPACE;
+ }
+ /* Can the OP_OPEN_SUBEXP node arrive the OP_CLOSE_SUBEXP node
+ in the current context? */
+ err = check_arrival (mctx, sub_top->path, sub_top->node,
+ sub_top->str_idx, cls_node, sl_str,
+ OP_CLOSE_SUBEXP);
+ if (err == REG_NOMATCH)
+ continue;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ sub_last = match_ctx_add_sublast (sub_top, cls_node, sl_str);
+ if (__glibc_unlikely (sub_last == NULL))
+ return REG_ESPACE;
+ err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node,
+ bkref_str_idx);
+ buf = (const char *) re_string_get_buffer (&mctx->input);
+ if (err == REG_NOMATCH)
+ continue;
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Helper functions for get_subexp(). */
+
+/* Check SUB_LAST can arrive to the back reference BKREF_NODE at BKREF_STR.
+ If it can arrive, register the sub expression expressed with SUB_TOP
+ and SUB_LAST. */
+
+static reg_errcode_t
+get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top,
+ re_sub_match_last_t *sub_last, Idx bkref_node, Idx bkref_str)
+{
+ reg_errcode_t err;
+ Idx to_idx;
+ /* Can the subexpression arrive the back reference? */
+ err = check_arrival (mctx, &sub_last->path, sub_last->node,
+ sub_last->str_idx, bkref_node, bkref_str,
+ OP_OPEN_SUBEXP);
+ if (err != REG_NOERROR)
+ return err;
+ err = match_ctx_add_entry (mctx, bkref_node, bkref_str, sub_top->str_idx,
+ sub_last->str_idx);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ to_idx = bkref_str + sub_last->str_idx - sub_top->str_idx;
+ return clean_state_log_if_needed (mctx, to_idx);
+}
+
+/* Find the first node which is '(' or ')' and whose index is SUBEXP_IDX.
+ Search '(' if FL_OPEN, or search ')' otherwise.
+ TODO: This function isn't efficient...
+ Because there might be more than one nodes whose types are
+ OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all
+ nodes.
+ E.g. RE: (a){2} */
+
+static Idx
+find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
+ Idx subexp_idx, int type)
+{
+ Idx cls_idx;
+ for (cls_idx = 0; cls_idx < nodes->nelem; ++cls_idx)
+ {
+ Idx cls_node = nodes->elems[cls_idx];
+ const re_token_t *node = dfa->nodes + cls_node;
+ if (node->type == type
+ && node->opr.idx == subexp_idx)
+ return cls_node;
+ }
+ return -1;
+}
+
+/* Check whether the node TOP_NODE at TOP_STR can arrive to the node
+ LAST_NODE at LAST_STR. We record the path onto PATH since it will be
+ heavily reused.
+ Return REG_NOERROR if it can arrive, REG_NOMATCH if it cannot,
+ REG_ESPACE if memory is exhausted. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
+ Idx top_str, Idx last_node, Idx last_str, int type)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err = REG_NOERROR;
+ Idx subexp_num, backup_cur_idx, str_idx, null_cnt;
+ re_dfastate_t *cur_state = NULL;
+ re_node_set *cur_nodes, next_nodes;
+ re_dfastate_t **backup_state_log;
+ unsigned int context;
+
+ subexp_num = dfa->nodes[top_node].opr.idx;
+ /* Extend the buffer if we need. */
+ if (__glibc_unlikely (path->alloc < last_str + mctx->max_mb_elem_len + 1))
+ {
+ re_dfastate_t **new_array;
+ Idx old_alloc = path->alloc;
+ Idx incr_alloc = last_str + mctx->max_mb_elem_len + 1;
+ Idx new_alloc;
+ if (__glibc_unlikely (IDX_MAX - old_alloc < incr_alloc))
+ return REG_ESPACE;
+ new_alloc = old_alloc + incr_alloc;
+ if (__glibc_unlikely (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc))
+ return REG_ESPACE;
+ new_array = re_realloc (path->array, re_dfastate_t *, new_alloc);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ path->array = new_array;
+ path->alloc = new_alloc;
+ memset (new_array + old_alloc, '\0',
+ sizeof (re_dfastate_t *) * (path->alloc - old_alloc));
+ }
+
+ str_idx = path->next_idx ? path->next_idx : top_str;
+
+ /* Temporary modify MCTX. */
+ backup_state_log = mctx->state_log;
+ backup_cur_idx = mctx->input.cur_idx;
+ mctx->state_log = path->array;
+ mctx->input.cur_idx = str_idx;
+
+ /* Setup initial node set. */
+ context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags);
+ if (str_idx == top_str)
+ {
+ err = re_node_set_init_1 (&next_nodes, top_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ else
+ {
+ cur_state = mctx->state_log[str_idx];
+ if (cur_state && cur_state->has_backref)
+ {
+ err = re_node_set_init_copy (&next_nodes, &cur_state->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ else
+ re_node_set_init_empty (&next_nodes);
+ }
+ if (str_idx == top_str || (cur_state && cur_state->has_backref))
+ {
+ if (next_nodes.nelem)
+ {
+ err = expand_bkref_cache (mctx, &next_nodes, str_idx,
+ subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
+ if (__glibc_unlikely (cur_state == NULL && err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ mctx->state_log[str_idx] = cur_state;
+ }
+
+ for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;)
+ {
+ re_node_set_empty (&next_nodes);
+ if (mctx->state_log[str_idx + 1])
+ {
+ err = re_node_set_merge (&next_nodes,
+ &mctx->state_log[str_idx + 1]->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ if (cur_state)
+ {
+ err = check_arrival_add_next_nodes (mctx, str_idx,
+ &cur_state->non_eps_nodes,
+ &next_nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ ++str_idx;
+ if (next_nodes.nelem)
+ {
+ err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ err = expand_bkref_cache (mctx, &next_nodes, str_idx,
+ subexp_num, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags);
+ cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
+ if (__glibc_unlikely (cur_state == NULL && err != REG_NOERROR))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ mctx->state_log[str_idx] = cur_state;
+ null_cnt = cur_state == NULL ? null_cnt + 1 : 0;
+ }
+ re_node_set_free (&next_nodes);
+ cur_nodes = (mctx->state_log[last_str] == NULL ? NULL
+ : &mctx->state_log[last_str]->nodes);
+ path->next_idx = str_idx;
+
+ /* Fix MCTX. */
+ mctx->state_log = backup_state_log;
+ mctx->input.cur_idx = backup_cur_idx;
+
+ /* Then check the current node set has the node LAST_NODE. */
+ if (cur_nodes != NULL && re_node_set_contains (cur_nodes, last_node))
+ return REG_NOERROR;
+
+ return REG_NOMATCH;
+}
+
+/* Helper functions for check_arrival. */
+
+/* Calculate the destination nodes of CUR_NODES at STR_IDX, and append them
+ to NEXT_NODES.
+ TODO: This function is similar to the functions transit_state*(),
+ however this function has many additional works.
+ Can't we unify them? */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
+ re_node_set *cur_nodes, re_node_set *next_nodes)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ bool ok;
+ Idx cur_idx;
+ reg_errcode_t err = REG_NOERROR;
+ re_node_set union_set;
+ re_node_set_init_empty (&union_set);
+ for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx)
+ {
+ int naccepted = 0;
+ Idx cur_node = cur_nodes->elems[cur_idx];
+ DEBUG_ASSERT (!IS_EPSILON_NODE (dfa->nodes[cur_node].type));
+
+ /* If the node may accept "multi byte". */
+ if (dfa->nodes[cur_node].accept_mb)
+ {
+ naccepted = check_node_accept_bytes (dfa, cur_node, &mctx->input,
+ str_idx);
+ if (naccepted > 1)
+ {
+ re_dfastate_t *dest_state;
+ Idx next_node = dfa->nexts[cur_node];
+ Idx next_idx = str_idx + naccepted;
+ dest_state = mctx->state_log[next_idx];
+ re_node_set_empty (&union_set);
+ if (dest_state)
+ {
+ err = re_node_set_merge (&union_set, &dest_state->nodes);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ }
+ ok = re_node_set_insert (&union_set, next_node);
+ if (__glibc_unlikely (! ok))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ mctx->state_log[next_idx] = re_acquire_state (&err, dfa,
+ &union_set);
+ if (__glibc_unlikely (mctx->state_log[next_idx] == NULL
+ && err != REG_NOERROR))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ }
+ }
+
+ if (naccepted
+ || check_node_accept (mctx, dfa->nodes + cur_node, str_idx))
+ {
+ ok = re_node_set_insert (next_nodes, dfa->nexts[cur_node]);
+ if (__glibc_unlikely (! ok))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ }
+ }
+ re_node_set_free (&union_set);
+ return REG_NOERROR;
+}
+
+/* For all the nodes in CUR_NODES, add the epsilon closures of them to
+ CUR_NODES, however exclude the nodes which are:
+ - inside the sub expression whose number is EX_SUBEXP, if FL_OPEN.
+ - out of the sub expression whose number is EX_SUBEXP, if !FL_OPEN.
+*/
+
+static reg_errcode_t
+check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
+ Idx ex_subexp, int type)
+{
+ reg_errcode_t err;
+ Idx idx, outside_node;
+ re_node_set new_nodes;
+ DEBUG_ASSERT (cur_nodes->nelem);
+ err = re_node_set_alloc (&new_nodes, cur_nodes->nelem);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ /* Create a new node set NEW_NODES with the nodes which are epsilon
+ closures of the node in CUR_NODES. */
+
+ for (idx = 0; idx < cur_nodes->nelem; ++idx)
+ {
+ Idx cur_node = cur_nodes->elems[idx];
+ const re_node_set *eclosure = dfa->eclosures + cur_node;
+ outside_node = find_subexp_node (dfa, eclosure, ex_subexp, type);
+ if (outside_node == -1)
+ {
+ /* There are no problematic nodes, just merge them. */
+ err = re_node_set_merge (&new_nodes, eclosure);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&new_nodes);
+ return err;
+ }
+ }
+ else
+ {
+ /* There are problematic nodes, re-calculate incrementally. */
+ err = check_arrival_expand_ecl_sub (dfa, &new_nodes, cur_node,
+ ex_subexp, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ re_node_set_free (&new_nodes);
+ return err;
+ }
+ }
+ }
+ re_node_set_free (cur_nodes);
+ *cur_nodes = new_nodes;
+ return REG_NOERROR;
+}
+
+/* Helper function for check_arrival_expand_ecl.
+ Check incrementally the epsilon closure of TARGET, and if it isn't
+ problematic append it to DST_NODES. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
+ Idx target, Idx ex_subexp, int type)
+{
+ Idx cur_node;
+ for (cur_node = target; !re_node_set_contains (dst_nodes, cur_node);)
+ {
+ bool ok;
+
+ if (dfa->nodes[cur_node].type == type
+ && dfa->nodes[cur_node].opr.idx == ex_subexp)
+ {
+ if (type == OP_CLOSE_SUBEXP)
+ {
+ ok = re_node_set_insert (dst_nodes, cur_node);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ }
+ break;
+ }
+ ok = re_node_set_insert (dst_nodes, cur_node);
+ if (__glibc_unlikely (! ok))
+ return REG_ESPACE;
+ if (dfa->edests[cur_node].nelem == 0)
+ break;
+ if (dfa->edests[cur_node].nelem == 2)
+ {
+ reg_errcode_t err;
+ err = check_arrival_expand_ecl_sub (dfa, dst_nodes,
+ dfa->edests[cur_node].elems[1],
+ ex_subexp, type);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ cur_node = dfa->edests[cur_node].elems[0];
+ }
+ return REG_NOERROR;
+}
+
+
+/* For all the back references in the current state, calculate the
+ destination of the back references by the appropriate entry
+ in MCTX->BKREF_ENTS. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
+ Idx cur_str, Idx subexp_num, int type)
+{
+ const re_dfa_t *const dfa = mctx->dfa;
+ reg_errcode_t err;
+ Idx cache_idx_start = search_cur_bkref_entry (mctx, cur_str);
+ struct re_backref_cache_entry *ent;
+
+ if (cache_idx_start == -1)
+ return REG_NOERROR;
+
+ restart:
+ ent = mctx->bkref_ents + cache_idx_start;
+ do
+ {
+ Idx to_idx, next_node;
+
+ /* Is this entry ENT is appropriate? */
+ if (!re_node_set_contains (cur_nodes, ent->node))
+ continue; /* No. */
+
+ to_idx = cur_str + ent->subexp_to - ent->subexp_from;
+ /* Calculate the destination of the back reference, and append it
+ to MCTX->STATE_LOG. */
+ if (to_idx == cur_str)
+ {
+ /* The backreference did epsilon transit, we must re-check all the
+ node in the current state. */
+ re_node_set new_dests;
+ reg_errcode_t err2, err3;
+ next_node = dfa->edests[ent->node].elems[0];
+ if (re_node_set_contains (cur_nodes, next_node))
+ continue;
+ err = re_node_set_init_1 (&new_dests, next_node);
+ err2 = check_arrival_expand_ecl (dfa, &new_dests, subexp_num, type);
+ err3 = re_node_set_merge (cur_nodes, &new_dests);
+ re_node_set_free (&new_dests);
+ if (__glibc_unlikely (err != REG_NOERROR || err2 != REG_NOERROR
+ || err3 != REG_NOERROR))
+ {
+ err = (err != REG_NOERROR ? err
+ : (err2 != REG_NOERROR ? err2 : err3));
+ return err;
+ }
+ /* TODO: It is still inefficient... */
+ goto restart;
+ }
+ else
+ {
+ re_node_set union_set;
+ next_node = dfa->nexts[ent->node];
+ if (mctx->state_log[to_idx])
+ {
+ bool ok;
+ if (re_node_set_contains (&mctx->state_log[to_idx]->nodes,
+ next_node))
+ continue;
+ err = re_node_set_init_copy (&union_set,
+ &mctx->state_log[to_idx]->nodes);
+ ok = re_node_set_insert (&union_set, next_node);
+ if (__glibc_unlikely (err != REG_NOERROR || ! ok))
+ {
+ re_node_set_free (&union_set);
+ err = err != REG_NOERROR ? err : REG_ESPACE;
+ return err;
+ }
+ }
+ else
+ {
+ err = re_node_set_init_1 (&union_set, next_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ return err;
+ }
+ mctx->state_log[to_idx] = re_acquire_state (&err, dfa, &union_set);
+ re_node_set_free (&union_set);
+ if (__glibc_unlikely (mctx->state_log[to_idx] == NULL
+ && err != REG_NOERROR))
+ return err;
+ }
+ }
+ while (ent++->more);
+ return REG_NOERROR;
+}
+
+/* Build transition table for the state.
+ Return true if successful. */
+
+static bool __attribute_noinline__
+build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
+{
+ reg_errcode_t err;
+ Idx i, j;
+ int ch;
+ bool need_word_trtable = false;
+ bitset_word_t elem, mask;
+ Idx ndests; /* Number of the destination states from 'state'. */
+ re_dfastate_t **trtable;
+ re_dfastate_t *dest_states[SBC_MAX];
+ re_dfastate_t *dest_states_word[SBC_MAX];
+ re_dfastate_t *dest_states_nl[SBC_MAX];
+ re_node_set follows;
+ bitset_t acceptable;
+
+ /* We build DFA states which corresponds to the destination nodes
+ from 'state'. 'dests_node[i]' represents the nodes which i-th
+ destination state contains, and 'dests_ch[i]' represents the
+ characters which i-th destination state accepts. */
+ re_node_set dests_node[SBC_MAX];
+ bitset_t dests_ch[SBC_MAX];
+
+ /* Initialize transition table. */
+ state->word_trtable = state->trtable = NULL;
+
+ /* At first, group all nodes belonging to 'state' into several
+ destinations. */
+ ndests = group_nodes_into_DFAstates (dfa, state, dests_node, dests_ch);
+ if (__glibc_unlikely (ndests <= 0))
+ {
+ /* Return false in case of an error, true otherwise. */
+ if (ndests == 0)
+ {
+ state->trtable = (re_dfastate_t **)
+ calloc (sizeof (re_dfastate_t *), SBC_MAX);
+ if (__glibc_unlikely (state->trtable == NULL))
+ return false;
+ return true;
+ }
+ return false;
+ }
+
+ err = re_node_set_alloc (&follows, ndests + 1);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ {
+ out_free:
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+ return false;
+ }
+
+ bitset_empty (acceptable);
+
+ /* Then build the states for all destinations. */
+ for (i = 0; i < ndests; ++i)
+ {
+ Idx next_node;
+ re_node_set_empty (&follows);
+ /* Merge the follows of this destination states. */
+ for (j = 0; j < dests_node[i].nelem; ++j)
+ {
+ next_node = dfa->nexts[dests_node[i].elems[j]];
+ if (next_node != -1)
+ {
+ err = re_node_set_merge (&follows, dfa->eclosures + next_node);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto out_free;
+ }
+ }
+ dest_states[i] = re_acquire_state_context (&err, dfa, &follows, 0);
+ if (__glibc_unlikely (dest_states[i] == NULL && err != REG_NOERROR))
+ goto out_free;
+ /* If the new state has context constraint,
+ build appropriate states for these contexts. */
+ if (dest_states[i]->has_constraint)
+ {
+ dest_states_word[i] = re_acquire_state_context (&err, dfa, &follows,
+ CONTEXT_WORD);
+ if (__glibc_unlikely (dest_states_word[i] == NULL
+ && err != REG_NOERROR))
+ goto out_free;
+
+ if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1)
+ need_word_trtable = true;
+
+ dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows,
+ CONTEXT_NEWLINE);
+ if (__glibc_unlikely (dest_states_nl[i] == NULL && err != REG_NOERROR))
+ goto out_free;
+ }
+ else
+ {
+ dest_states_word[i] = dest_states[i];
+ dest_states_nl[i] = dest_states[i];
+ }
+ bitset_merge (acceptable, dests_ch[i]);
+ }
+
+ if (!__glibc_unlikely (need_word_trtable))
+ {
+ /* We don't care about whether the following character is a word
+ character, or we are in a single-byte character set so we can
+ discern by looking at the character code: allocate a
+ 256-entry transition table. */
+ trtable = state->trtable =
+ (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), SBC_MAX);
+ if (__glibc_unlikely (trtable == NULL))
+ goto out_free;
+
+ /* For all characters ch...: */
+ for (i = 0; i < BITSET_WORDS; ++i)
+ for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1;
+ elem;
+ mask <<= 1, elem >>= 1, ++ch)
+ if (__glibc_unlikely (elem & 1))
+ {
+ /* There must be exactly one destination which accepts
+ character ch. See group_nodes_into_DFAstates. */
+ for (j = 0; (dests_ch[j][i] & mask) == 0; ++j)
+ ;
+
+ /* j-th destination accepts the word character ch. */
+ if (dfa->word_char[i] & mask)
+ trtable[ch] = dest_states_word[j];
+ else
+ trtable[ch] = dest_states[j];
+ }
+ }
+ else
+ {
+ /* We care about whether the following character is a word
+ character, and we are in a multi-byte character set: discern
+ by looking at the character code: build two 256-entry
+ transition tables, one starting at trtable[0] and one
+ starting at trtable[SBC_MAX]. */
+ trtable = state->word_trtable =
+ (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), 2 * SBC_MAX);
+ if (__glibc_unlikely (trtable == NULL))
+ goto out_free;
+
+ /* For all characters ch...: */
+ for (i = 0; i < BITSET_WORDS; ++i)
+ for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1;
+ elem;
+ mask <<= 1, elem >>= 1, ++ch)
+ if (__glibc_unlikely (elem & 1))
+ {
+ /* There must be exactly one destination which accepts
+ character ch. See group_nodes_into_DFAstates. */
+ for (j = 0; (dests_ch[j][i] & mask) == 0; ++j)
+ ;
+
+ /* j-th destination accepts the word character ch. */
+ trtable[ch] = dest_states[j];
+ trtable[ch + SBC_MAX] = dest_states_word[j];
+ }
+ }
+
+ /* new line */
+ if (bitset_contain (acceptable, NEWLINE_CHAR))
+ {
+ /* The current state accepts newline character. */
+ for (j = 0; j < ndests; ++j)
+ if (bitset_contain (dests_ch[j], NEWLINE_CHAR))
+ {
+ /* k-th destination accepts newline character. */
+ trtable[NEWLINE_CHAR] = dest_states_nl[j];
+ if (need_word_trtable)
+ trtable[NEWLINE_CHAR + SBC_MAX] = dest_states_nl[j];
+ /* There must be only one destination which accepts
+ newline. See group_nodes_into_DFAstates. */
+ break;
+ }
+ }
+
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+ return true;
+}
+
+/* Group all nodes belonging to STATE into several destinations.
+ Then for all destinations, set the nodes belonging to the destination
+ to DESTS_NODE[i] and set the characters accepted by the destination
+ to DEST_CH[i]. Return the number of destinations if successful,
+ -1 on internal error. */
+
+static Idx
+group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+ re_node_set *dests_node, bitset_t *dests_ch)
+{
+ reg_errcode_t err;
+ bool ok;
+ Idx i, j, k;
+ Idx ndests; /* Number of the destinations from 'state'. */
+ bitset_t accepts; /* Characters a node can accept. */
+ const re_node_set *cur_nodes = &state->nodes;
+ bitset_empty (accepts);
+ ndests = 0;
+
+ /* For all the nodes belonging to 'state', */
+ for (i = 0; i < cur_nodes->nelem; ++i)
+ {
+ re_token_t *node = &dfa->nodes[cur_nodes->elems[i]];
+ re_token_type_t type = node->type;
+ unsigned int constraint = node->constraint;
+
+ /* Enumerate all single byte character this node can accept. */
+ if (type == CHARACTER)
+ bitset_set (accepts, node->opr.c);
+ else if (type == SIMPLE_BRACKET)
+ {
+ bitset_merge (accepts, node->opr.sbcset);
+ }
+ else if (type == OP_PERIOD)
+ {
+ if (dfa->mb_cur_max > 1)
+ bitset_merge (accepts, dfa->sb_char);
+ else
+ bitset_set_all (accepts);
+ if (!(dfa->syntax & RE_DOT_NEWLINE))
+ bitset_clear (accepts, '\n');
+ if (dfa->syntax & RE_DOT_NOT_NULL)
+ bitset_clear (accepts, '\0');
+ }
+ else if (type == OP_UTF8_PERIOD)
+ {
+ if (ASCII_CHARS % BITSET_WORD_BITS == 0)
+ memset (accepts, -1, ASCII_CHARS / CHAR_BIT);
+ else
+ bitset_merge (accepts, utf8_sb_map);
+ if (!(dfa->syntax & RE_DOT_NEWLINE))
+ bitset_clear (accepts, '\n');
+ if (dfa->syntax & RE_DOT_NOT_NULL)
+ bitset_clear (accepts, '\0');
+ }
+ else
+ continue;
+
+ /* Check the 'accepts' and sift the characters which are not
+ match it the context. */
+ if (constraint)
+ {
+ if (constraint & NEXT_NEWLINE_CONSTRAINT)
+ {
+ bool accepts_newline = bitset_contain (accepts, NEWLINE_CHAR);
+ bitset_empty (accepts);
+ if (accepts_newline)
+ bitset_set (accepts, NEWLINE_CHAR);
+ else
+ continue;
+ }
+ if (constraint & NEXT_ENDBUF_CONSTRAINT)
+ {
+ bitset_empty (accepts);
+ continue;
+ }
+
+ if (constraint & NEXT_WORD_CONSTRAINT)
+ {
+ bitset_word_t any_set = 0;
+ if (type == CHARACTER && !node->word_char)
+ {
+ bitset_empty (accepts);
+ continue;
+ }
+ if (dfa->mb_cur_max > 1)
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j]));
+ else
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= dfa->word_char[j]);
+ if (!any_set)
+ continue;
+ }
+ if (constraint & NEXT_NOTWORD_CONSTRAINT)
+ {
+ bitset_word_t any_set = 0;
+ if (type == CHARACTER && node->word_char)
+ {
+ bitset_empty (accepts);
+ continue;
+ }
+ if (dfa->mb_cur_max > 1)
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j]));
+ else
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= ~dfa->word_char[j]);
+ if (!any_set)
+ continue;
+ }
+ }
+
+ /* Then divide 'accepts' into DFA states, or create a new
+ state. Above, we make sure that accepts is not empty. */
+ for (j = 0; j < ndests; ++j)
+ {
+ bitset_t intersec; /* Intersection sets, see below. */
+ bitset_t remains;
+ /* Flags, see below. */
+ bitset_word_t has_intersec, not_subset, not_consumed;
+
+ /* Optimization, skip if this state doesn't accept the character. */
+ if (type == CHARACTER && !bitset_contain (dests_ch[j], node->opr.c))
+ continue;
+
+ /* Enumerate the intersection set of this state and 'accepts'. */
+ has_intersec = 0;
+ for (k = 0; k < BITSET_WORDS; ++k)
+ has_intersec |= intersec[k] = accepts[k] & dests_ch[j][k];
+ /* And skip if the intersection set is empty. */
+ if (!has_intersec)
+ continue;
+
+ /* Then check if this state is a subset of 'accepts'. */
+ not_subset = not_consumed = 0;
+ for (k = 0; k < BITSET_WORDS; ++k)
+ {
+ not_subset |= remains[k] = ~accepts[k] & dests_ch[j][k];
+ not_consumed |= accepts[k] = accepts[k] & ~dests_ch[j][k];
+ }
+
+ /* If this state isn't a subset of 'accepts', create a
+ new group state, which has the 'remains'. */
+ if (not_subset)
+ {
+ bitset_copy (dests_ch[ndests], remains);
+ bitset_copy (dests_ch[j], intersec);
+ err = re_node_set_init_copy (dests_node + ndests, &dests_node[j]);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto error_return;
+ ++ndests;
+ }
+
+ /* Put the position in the current group. */
+ ok = re_node_set_insert (&dests_node[j], cur_nodes->elems[i]);
+ if (__glibc_unlikely (! ok))
+ goto error_return;
+
+ /* If all characters are consumed, go to next node. */
+ if (!not_consumed)
+ break;
+ }
+ /* Some characters remain, create a new group. */
+ if (j == ndests)
+ {
+ bitset_copy (dests_ch[ndests], accepts);
+ err = re_node_set_init_1 (dests_node + ndests, cur_nodes->elems[i]);
+ if (__glibc_unlikely (err != REG_NOERROR))
+ goto error_return;
+ ++ndests;
+ bitset_empty (accepts);
+ }
+ }
+ assume (ndests <= SBC_MAX);
+ return ndests;
+ error_return:
+ for (j = 0; j < ndests; ++j)
+ re_node_set_free (dests_node + j);
+ return -1;
+}
+
+/* Check how many bytes the node 'dfa->nodes[node_idx]' accepts.
+ Return the number of the bytes the node accepts.
+ STR_IDX is the current index of the input string.
+
+ This function handles the nodes which can accept one character, or
+ one collating element like '.', '[a-z]', opposite to the other nodes
+ can only accept one byte. */
+
+#ifdef _LIBC
+# include <locale/weight.h>
+#endif
+
+static int
+check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
+ const re_string_t *input, Idx str_idx)
+{
+ const re_token_t *node = dfa->nodes + node_idx;
+ int char_len, elem_len;
+ Idx i;
+
+ if (__glibc_unlikely (node->type == OP_UTF8_PERIOD))
+ {
+ unsigned char c = re_string_byte_at (input, str_idx), d;
+ if (__glibc_likely (c < 0xc2))
+ return 0;
+
+ if (str_idx + 2 > input->len)
+ return 0;
+
+ d = re_string_byte_at (input, str_idx + 1);
+ if (c < 0xe0)
+ return (d < 0x80 || d > 0xbf) ? 0 : 2;
+ else if (c < 0xf0)
+ {
+ char_len = 3;
+ if (c == 0xe0 && d < 0xa0)
+ return 0;
+ }
+ else if (c < 0xf8)
+ {
+ char_len = 4;
+ if (c == 0xf0 && d < 0x90)
+ return 0;
+ }
+ else if (c < 0xfc)
+ {
+ char_len = 5;
+ if (c == 0xf8 && d < 0x88)
+ return 0;
+ }
+ else if (c < 0xfe)
+ {
+ char_len = 6;
+ if (c == 0xfc && d < 0x84)
+ return 0;
+ }
+ else
+ return 0;
+
+ if (str_idx + char_len > input->len)
+ return 0;
+
+ for (i = 1; i < char_len; ++i)
+ {
+ d = re_string_byte_at (input, str_idx + i);
+ if (d < 0x80 || d > 0xbf)
+ return 0;
+ }
+ return char_len;
+ }
+
+ char_len = re_string_char_size_at (input, str_idx);
+ if (node->type == OP_PERIOD)
+ {
+ if (char_len <= 1)
+ return 0;
+ /* FIXME: I don't think this if is needed, as both '\n'
+ and '\0' are char_len == 1. */
+ /* '.' accepts any one character except the following two cases. */
+ if ((!(dfa->syntax & RE_DOT_NEWLINE)
+ && re_string_byte_at (input, str_idx) == '\n')
+ || ((dfa->syntax & RE_DOT_NOT_NULL)
+ && re_string_byte_at (input, str_idx) == '\0'))
+ return 0;
+ return char_len;
+ }
+
+ elem_len = re_string_elem_size_at (input, str_idx);
+ if ((elem_len <= 1 && char_len <= 1) || char_len == 0)
+ return 0;
+
+ if (node->type == COMPLEX_BRACKET)
+ {
+ const re_charset_t *cset = node->opr.mbcset;
+#ifdef _LIBC
+ const unsigned char *pin
+ = ((const unsigned char *) re_string_get_buffer (input) + str_idx);
+ Idx j;
+ uint32_t nrules;
+#endif
+ int match_len = 0;
+ wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars)
+ ? re_string_wchar_at (input, str_idx) : 0);
+
+ /* match with multibyte character? */
+ for (i = 0; i < cset->nmbchars; ++i)
+ if (wc == cset->mbchars[i])
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ /* match with character_class? */
+ for (i = 0; i < cset->nchar_classes; ++i)
+ {
+ wctype_t wt = cset->char_classes[i];
+ if (__iswctype (wc, wt))
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+
+#ifdef _LIBC
+ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules != 0)
+ {
+ unsigned int in_collseq = 0;
+ const int32_t *table, *indirect;
+ const unsigned char *weights, *extra;
+ const char *collseqwc;
+
+ /* match with collating_symbol? */
+ if (cset->ncoll_syms)
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
+ for (i = 0; i < cset->ncoll_syms; ++i)
+ {
+ const unsigned char *coll_sym = extra + cset->coll_syms[i];
+ /* Compare the length of input collating element and
+ the length of current collating element. */
+ if (*coll_sym != elem_len)
+ continue;
+ /* Compare each bytes. */
+ for (j = 0; j < *coll_sym; j++)
+ if (pin[j] != coll_sym[1 + j])
+ break;
+ if (j == *coll_sym)
+ {
+ /* Match if every bytes is equal. */
+ match_len = j;
+ goto check_node_accept_bytes_match;
+ }
+ }
+
+ if (cset->nranges)
+ {
+ if (elem_len <= char_len)
+ {
+ collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ in_collseq = __collseq_table_lookup (collseqwc, wc);
+ }
+ else
+ in_collseq = find_collation_sequence_value (pin, elem_len);
+ }
+ /* match with range expression? */
+ /* FIXME: Implement rational ranges here, too. */
+ for (i = 0; i < cset->nranges; ++i)
+ if (cset->range_starts[i] <= in_collseq
+ && in_collseq <= cset->range_ends[i])
+ {
+ match_len = elem_len;
+ goto check_node_accept_bytes_match;
+ }
+
+ /* match with equivalence_class? */
+ if (cset->nequiv_classes)
+ {
+ const unsigned char *cp = pin;
+ table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
+ int32_t idx = findidx (table, indirect, extra, &cp, elem_len);
+ int32_t rule = idx >> 24;
+ idx &= 0xffffff;
+ if (idx > 0)
+ {
+ size_t weight_len = weights[idx];
+ for (i = 0; i < cset->nequiv_classes; ++i)
+ {
+ int32_t equiv_class_idx = cset->equiv_classes[i];
+ int32_t equiv_class_rule = equiv_class_idx >> 24;
+ equiv_class_idx &= 0xffffff;
+ if (weights[equiv_class_idx] == weight_len
+ && equiv_class_rule == rule
+ && memcmp (weights + idx + 1,
+ weights + equiv_class_idx + 1,
+ weight_len) == 0)
+ {
+ match_len = elem_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+ }
+ }
+ }
+ else
+#endif /* _LIBC */
+ {
+ /* match with range expression? */
+ for (i = 0; i < cset->nranges; ++i)
+ {
+ if (cset->range_starts[i] <= wc && wc <= cset->range_ends[i])
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+ }
+ check_node_accept_bytes_match:
+ if (!cset->non_match)
+ return match_len;
+ else
+ {
+ if (match_len > 0)
+ return 0;
+ else
+ return (elem_len > char_len) ? elem_len : char_len;
+ }
+ }
+ return 0;
+}
+
+#ifdef _LIBC
+static unsigned int
+find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
+{
+ uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules == 0)
+ {
+ if (mbs_len == 1)
+ {
+ /* No valid character. Match it as a single byte character. */
+ const unsigned char *collseq = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+ return collseq[mbs[0]];
+ }
+ return UINT_MAX;
+ }
+ else
+ {
+ int32_t idx;
+ const unsigned char *extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
+ int32_t extrasize = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB + 1) - extra;
+
+ for (idx = 0; idx < extrasize;)
+ {
+ int mbs_cnt;
+ bool found = false;
+ int32_t elem_mbs_len;
+ /* Skip the name of collating element name. */
+ idx = idx + extra[idx] + 1;
+ elem_mbs_len = extra[idx++];
+ if (mbs_len == elem_mbs_len)
+ {
+ for (mbs_cnt = 0; mbs_cnt < elem_mbs_len; ++mbs_cnt)
+ if (extra[idx + mbs_cnt] != mbs[mbs_cnt])
+ break;
+ if (mbs_cnt == elem_mbs_len)
+ /* Found the entry. */
+ found = true;
+ }
+ /* Skip the byte sequence of the collating element. */
+ idx += elem_mbs_len;
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ /* Skip the collation sequence value. */
+ idx += sizeof (uint32_t);
+ /* Skip the wide char sequence of the collating element. */
+ idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1);
+ /* If we found the entry, return the sequence value. */
+ if (found)
+ return *(uint32_t *) (extra + idx);
+ /* Skip the collation sequence value. */
+ idx += sizeof (uint32_t);
+ }
+ return UINT_MAX;
+ }
+}
+#endif /* _LIBC */
+
+/* Check whether the node accepts the byte which is IDX-th
+ byte of the INPUT. */
+
+static bool
+check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
+ Idx idx)
+{
+ unsigned char ch;
+ ch = re_string_byte_at (&mctx->input, idx);
+ switch (node->type)
+ {
+ case CHARACTER:
+ if (node->opr.c != ch)
+ return false;
+ break;
+
+ case SIMPLE_BRACKET:
+ if (!bitset_contain (node->opr.sbcset, ch))
+ return false;
+ break;
+
+ case OP_UTF8_PERIOD:
+ if (ch >= ASCII_CHARS)
+ return false;
+ FALLTHROUGH;
+ case OP_PERIOD:
+ if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE))
+ || (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL)))
+ return false;
+ break;
+
+ default:
+ return false;
+ }
+
+ if (node->constraint)
+ {
+ /* The node has constraints. Check whether the current context
+ satisfies the constraints. */
+ unsigned int context = re_string_context_at (&mctx->input, idx,
+ mctx->eflags);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context))
+ return false;
+ }
+
+ return true;
+}
+
+/* Extend the buffers, if the buffers have run out. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+extend_buffers (re_match_context_t *mctx, int min_len)
+{
+ reg_errcode_t ret;
+ re_string_t *pstr = &mctx->input;
+
+ /* Avoid overflow. */
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2
+ <= pstr->bufs_len))
+ return REG_ESPACE;
+
+ /* Double the lengths of the buffers, but allocate at least MIN_LEN. */
+ ret = re_string_realloc_buffers (pstr,
+ MAX (min_len,
+ MIN (pstr->len, pstr->bufs_len * 2)));
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+
+ if (mctx->state_log != NULL)
+ {
+ /* And double the length of state_log. */
+ /* XXX We have no indication of the size of this buffer. If this
+ allocation fail we have no indication that the state_log array
+ does not have the right size. */
+ re_dfastate_t **new_array = re_realloc (mctx->state_log, re_dfastate_t *,
+ pstr->bufs_len + 1);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ mctx->state_log = new_array;
+ }
+
+ /* Then reconstruct the buffers. */
+ if (pstr->icase)
+ {
+ if (pstr->mb_cur_max > 1)
+ {
+ ret = build_wcs_upper_buffer (pstr);
+ if (__glibc_unlikely (ret != REG_NOERROR))
+ return ret;
+ }
+ else
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+ if (pstr->mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+ {
+ if (pstr->trans != NULL)
+ re_string_translate_buffer (pstr);
+ }
+ }
+ return REG_NOERROR;
+}
+
+
+/* Functions for matching context. */
+
+/* Initialize MCTX. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+match_ctx_init (re_match_context_t *mctx, int eflags, Idx n)
+{
+ mctx->eflags = eflags;
+ mctx->match_last = -1;
+ if (n > 0)
+ {
+ /* Avoid overflow. */
+ size_t max_object_size =
+ MAX (sizeof (struct re_backref_cache_entry),
+ sizeof (re_sub_match_top_t *));
+ if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n))
+ return REG_ESPACE;
+
+ mctx->bkref_ents = re_malloc (struct re_backref_cache_entry, n);
+ mctx->sub_tops = re_malloc (re_sub_match_top_t *, n);
+ if (__glibc_unlikely (mctx->bkref_ents == NULL || mctx->sub_tops == NULL))
+ return REG_ESPACE;
+ }
+ /* Already zero-ed by the caller.
+ else
+ mctx->bkref_ents = NULL;
+ mctx->nbkref_ents = 0;
+ mctx->nsub_tops = 0; */
+ mctx->abkref_ents = n;
+ mctx->max_mb_elem_len = 1;
+ mctx->asub_tops = n;
+ return REG_NOERROR;
+}
+
+/* Clean the entries which depend on the current input in MCTX.
+ This function must be invoked when the matcher changes the start index
+ of the input, or changes the input string. */
+
+static void
+match_ctx_clean (re_match_context_t *mctx)
+{
+ Idx st_idx;
+ for (st_idx = 0; st_idx < mctx->nsub_tops; ++st_idx)
+ {
+ Idx sl_idx;
+ re_sub_match_top_t *top = mctx->sub_tops[st_idx];
+ for (sl_idx = 0; sl_idx < top->nlasts; ++sl_idx)
+ {
+ re_sub_match_last_t *last = top->lasts[sl_idx];
+ re_free (last->path.array);
+ re_free (last);
+ }
+ re_free (top->lasts);
+ if (top->path)
+ {
+ re_free (top->path->array);
+ re_free (top->path);
+ }
+ re_free (top);
+ }
+
+ mctx->nsub_tops = 0;
+ mctx->nbkref_ents = 0;
+}
+
+/* Free all the memory associated with MCTX. */
+
+static void
+match_ctx_free (re_match_context_t *mctx)
+{
+ /* First, free all the memory associated with MCTX->SUB_TOPS. */
+ match_ctx_clean (mctx);
+ re_free (mctx->sub_tops);
+ re_free (mctx->bkref_ents);
+}
+
+/* Add a new backreference entry to MCTX.
+ Note that we assume that caller never call this function with duplicate
+ entry, and call with STR_IDX which isn't smaller than any existing entry.
+*/
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from,
+ Idx to)
+{
+ if (mctx->nbkref_ents >= mctx->abkref_ents)
+ {
+ struct re_backref_cache_entry* new_entry;
+ new_entry = re_realloc (mctx->bkref_ents, struct re_backref_cache_entry,
+ mctx->abkref_ents * 2);
+ if (__glibc_unlikely (new_entry == NULL))
+ {
+ re_free (mctx->bkref_ents);
+ return REG_ESPACE;
+ }
+ mctx->bkref_ents = new_entry;
+ memset (mctx->bkref_ents + mctx->nbkref_ents, '\0',
+ sizeof (struct re_backref_cache_entry) * mctx->abkref_ents);
+ mctx->abkref_ents *= 2;
+ }
+ if (mctx->nbkref_ents > 0
+ && mctx->bkref_ents[mctx->nbkref_ents - 1].str_idx == str_idx)
+ mctx->bkref_ents[mctx->nbkref_ents - 1].more = 1;
+
+ mctx->bkref_ents[mctx->nbkref_ents].node = node;
+ mctx->bkref_ents[mctx->nbkref_ents].str_idx = str_idx;
+ mctx->bkref_ents[mctx->nbkref_ents].subexp_from = from;
+ mctx->bkref_ents[mctx->nbkref_ents].subexp_to = to;
+
+ /* This is a cache that saves negative results of check_dst_limits_calc_pos.
+ If bit N is clear, means that this entry won't epsilon-transition to
+ an OP_OPEN_SUBEXP or OP_CLOSE_SUBEXP for the N+1-th subexpression. If
+ it is set, check_dst_limits_calc_pos_1 will recurse and try to find one
+ such node.
+
+ A backreference does not epsilon-transition unless it is empty, so set
+ to all zeros if FROM != TO. */
+ mctx->bkref_ents[mctx->nbkref_ents].eps_reachable_subexps_map
+ = (from == to ? -1 : 0);
+
+ mctx->bkref_ents[mctx->nbkref_ents++].more = 0;
+ if (mctx->max_mb_elem_len < to - from)
+ mctx->max_mb_elem_len = to - from;
+ return REG_NOERROR;
+}
+
+/* Return the first entry with the same str_idx, or -1 if none is
+ found. Note that MCTX->BKREF_ENTS is already sorted by MCTX->STR_IDX. */
+
+static Idx
+search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
+{
+ Idx left, right, mid, last;
+ last = right = mctx->nbkref_ents;
+ for (left = 0; left < right;)
+ {
+ mid = (left + right) / 2;
+ if (mctx->bkref_ents[mid].str_idx < str_idx)
+ left = mid + 1;
+ else
+ right = mid;
+ }
+ if (left < last && mctx->bkref_ents[left].str_idx == str_idx)
+ return left;
+ else
+ return -1;
+}
+
+/* Register the node NODE, whose type is OP_OPEN_SUBEXP, and which matches
+ at STR_IDX. */
+
+static reg_errcode_t
+__attribute_warn_unused_result__
+match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx)
+{
+ DEBUG_ASSERT (mctx->sub_tops != NULL);
+ DEBUG_ASSERT (mctx->asub_tops > 0);
+ if (__glibc_unlikely (mctx->nsub_tops == mctx->asub_tops))
+ {
+ Idx new_asub_tops = mctx->asub_tops * 2;
+ re_sub_match_top_t **new_array = re_realloc (mctx->sub_tops,
+ re_sub_match_top_t *,
+ new_asub_tops);
+ if (__glibc_unlikely (new_array == NULL))
+ return REG_ESPACE;
+ mctx->sub_tops = new_array;
+ mctx->asub_tops = new_asub_tops;
+ }
+ mctx->sub_tops[mctx->nsub_tops] = calloc (1, sizeof (re_sub_match_top_t));
+ if (__glibc_unlikely (mctx->sub_tops[mctx->nsub_tops] == NULL))
+ return REG_ESPACE;
+ mctx->sub_tops[mctx->nsub_tops]->node = node;
+ mctx->sub_tops[mctx->nsub_tops++]->str_idx = str_idx;
+ return REG_NOERROR;
+}
+
+/* Register the node NODE, whose type is OP_CLOSE_SUBEXP, and which matches
+ at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP.
+ Return the new entry if successful, NULL if memory is exhausted. */
+
+static re_sub_match_last_t *
+match_ctx_add_sublast (re_sub_match_top_t *subtop, Idx node, Idx str_idx)
+{
+ re_sub_match_last_t *new_entry;
+ if (__glibc_unlikely (subtop->nlasts == subtop->alasts))
+ {
+ Idx new_alasts = 2 * subtop->alasts + 1;
+ re_sub_match_last_t **new_array = re_realloc (subtop->lasts,
+ re_sub_match_last_t *,
+ new_alasts);
+ if (__glibc_unlikely (new_array == NULL))
+ return NULL;
+ subtop->lasts = new_array;
+ subtop->alasts = new_alasts;
+ }
+ new_entry = calloc (1, sizeof (re_sub_match_last_t));
+ if (__glibc_likely (new_entry != NULL))
+ {
+ subtop->lasts[subtop->nlasts] = new_entry;
+ new_entry->node = node;
+ new_entry->str_idx = str_idx;
+ ++subtop->nlasts;
+ }
+ return new_entry;
+}
+
+static void
+sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts,
+ re_dfastate_t **limited_sts, Idx last_node, Idx last_str_idx)
+{
+ sctx->sifted_states = sifted_sts;
+ sctx->limited_states = limited_sts;
+ sctx->last_node = last_node;
+ sctx->last_str_idx = last_str_idx;
+ re_node_set_init_empty (&sctx->limits);
+}
diff --git a/gl/setenv.c b/gl/setenv.c
new file mode 100644
index 0000000..f0b8899
--- /dev/null
+++ b/gl/setenv.c
@@ -0,0 +1,390 @@
+/* Copyright (C) 1992, 1995-2003, 2005-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if !_LIBC
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+# define _GL_ARG_NONNULL(params)
+
+# define _GL_USE_STDLIB_ALLOC 1
+# include <config.h>
+#endif
+
+#include <alloca.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#if _LIBC || HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if !_LIBC
+# include "malloca.h"
+#endif
+
+#if _LIBC || !HAVE_SETENV
+
+#if !_LIBC
+# define __environ environ
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+/* In the GNU C library we must keep the namespace clean. */
+#ifdef _LIBC
+# define setenv __setenv
+# define clearenv __clearenv
+# define tfind __tfind
+# define tsearch __tsearch
+#endif
+
+/* In the GNU C library implementation we try to be more clever and
+ allow arbitrarily many changes of the environment given that the used
+ values are from a small set. Outside glibc this will eat up all
+ memory after a while. */
+#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \
+ && (defined __GNUC__ || defined __clang__))
+# define USE_TSEARCH 1
+# include <search.h>
+typedef int (*compar_fn_t) (const void *, const void *);
+
+/* This is a pointer to the root of the search tree with the known
+ values. */
+static void *known_values;
+
+# define KNOWN_VALUE(Str) \
+ ({ \
+ void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \
+ value != NULL ? *(char **) value : NULL; \
+ })
+# define STORE_VALUE(Str) \
+ tsearch (Str, &known_values, (compar_fn_t) strcmp)
+
+#else
+# undef USE_TSEARCH
+
+# define KNOWN_VALUE(Str) NULL
+# define STORE_VALUE(Str) do { } while (0)
+
+#endif
+
+
+/* If this variable is not a null pointer we allocated the current
+ environment. */
+static char **last_environ;
+
+
+/* This function is used by 'setenv' and 'putenv'. The difference between
+ the two functions is that for the former must create a new string which
+ is then placed in the environment, while the argument of 'putenv'
+ must be used directly. This is all complicated by the fact that we try
+ to reuse values once generated for a 'setenv' call since we can never
+ free the strings. */
+int
+__add_to_environ (const char *name, const char *value, const char *combined,
+ int replace)
+{
+ char **ep;
+ size_t size;
+ const size_t namelen = strlen (name);
+ const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
+
+ LOCK;
+
+ /* We have to get the pointer now that we have the lock and not earlier
+ since another thread might have created a new environment. */
+ ep = __environ;
+
+ size = 0;
+ if (ep != NULL)
+ {
+ for (; *ep != NULL; ++ep)
+ if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
+ break;
+ else
+ ++size;
+ }
+
+ if (ep == NULL || *ep == NULL)
+ {
+ char **new_environ;
+#ifdef USE_TSEARCH
+ char *new_value;
+#endif
+
+ /* We allocated this space; we can extend it. */
+ new_environ =
+ (char **) (last_environ == NULL
+ ? malloc ((size + 2) * sizeof (char *))
+ : realloc (last_environ, (size + 2) * sizeof (char *)));
+ if (new_environ == NULL)
+ {
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'malloc-posix' and 'realloc-posix' gnulib modules. */
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+ /* If the whole entry is given add it. */
+ if (combined != NULL)
+ /* We must not add the string to the search tree since it belongs
+ to the user. */
+ new_environ[size] = (char *) combined;
+ else
+ {
+ /* See whether the value is already known. */
+#ifdef USE_TSEARCH
+# ifdef _LIBC
+ new_value = (char *) alloca (namelen + 1 + vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
+# else
+ new_value = (char *) malloca (namelen + 1 + vallen);
+ if (new_value == NULL)
+ {
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
+# endif
+
+ new_environ[size] = KNOWN_VALUE (new_value);
+ if (new_environ[size] == NULL)
+#endif
+ {
+ new_environ[size] = (char *) malloc (namelen + 1 + vallen);
+ if (new_environ[size] == NULL)
+ {
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+#ifdef USE_TSEARCH
+ memcpy (new_environ[size], new_value, namelen + 1 + vallen);
+#else
+ memcpy (new_environ[size], name, namelen);
+ new_environ[size][namelen] = '=';
+ memcpy (&new_environ[size][namelen + 1], value, vallen);
+#endif
+ /* And save the value now. We cannot do this when we remove
+ the string since then we cannot decide whether it is a
+ user string or not. */
+ STORE_VALUE (new_environ[size]);
+ }
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ }
+
+ if (__environ != last_environ)
+ memcpy ((char *) new_environ, (char *) __environ,
+ size * sizeof (char *));
+
+ new_environ[size + 1] = NULL;
+
+ last_environ = __environ = new_environ;
+ }
+ else if (replace)
+ {
+ char *np;
+
+ /* Use the user string if given. */
+ if (combined != NULL)
+ np = (char *) combined;
+ else
+ {
+#ifdef USE_TSEARCH
+ char *new_value;
+# ifdef _LIBC
+ new_value = alloca (namelen + 1 + vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
+# else
+ new_value = malloca (namelen + 1 + vallen);
+ if (new_value == NULL)
+ {
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
+# endif
+
+ np = KNOWN_VALUE (new_value);
+ if (np == NULL)
+#endif
+ {
+ np = (char *) malloc (namelen + 1 + vallen);
+ if (np == NULL)
+ {
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
+
+#ifdef USE_TSEARCH
+ memcpy (np, new_value, namelen + 1 + vallen);
+#else
+ memcpy (np, name, namelen);
+ np[namelen] = '=';
+ memcpy (&np[namelen + 1], value, vallen);
+#endif
+ /* And remember the value. */
+ STORE_VALUE (np);
+ }
+#if defined USE_TSEARCH && !defined _LIBC
+ freea (new_value);
+#endif
+ }
+
+ *ep = np;
+ }
+
+ UNLOCK;
+
+ return 0;
+}
+
+int
+setenv (const char *name, const char *value, int replace)
+{
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __add_to_environ (name, value, NULL, replace);
+}
+
+/* The 'clearenv' was planned to be added to POSIX.1 but probably
+ never made it. Nevertheless the POSIX.9 standard (POSIX bindings
+ for Fortran 77) requires this function. */
+int
+clearenv (void)
+{
+ LOCK;
+
+ if (__environ == last_environ && __environ != NULL)
+ {
+ /* We allocated this environment so we can free it. */
+ free (__environ);
+ last_environ = NULL;
+ }
+
+ /* Clear the environment pointer removes the whole environment. */
+ __environ = NULL;
+
+ UNLOCK;
+
+ return 0;
+}
+
+#ifdef _LIBC
+static void
+free_mem (void)
+{
+ /* Remove all traces. */
+ clearenv ();
+
+ /* Now remove the search tree. */
+ __tdestroy (known_values, free);
+ known_values = NULL;
+}
+text_set_element (__libc_subfreeres, free_mem);
+
+
+# undef setenv
+# undef clearenv
+weak_alias (__setenv, setenv)
+weak_alias (__clearenv, clearenv)
+#endif
+
+#endif /* _LIBC || !HAVE_SETENV */
+
+/* The rest of this file is called into use when replacing an existing
+ but buggy setenv. Known bugs include failure to diagnose invalid
+ name, and consuming a leading '=' from value. */
+#if HAVE_SETENV
+
+# undef setenv
+# if !HAVE_DECL_SETENV
+extern int setenv (const char *, const char *, int);
+# endif
+# define STREQ(a, b) (strcmp (a, b) == 0)
+
+int
+rpl_setenv (const char *name, const char *value, int replace)
+{
+ int result;
+ if (!name || !*name || strchr (name, '='))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ /* Call the real setenv even if replace is 0, in case implementation
+ has underlying data to update, such as when environ changes. */
+ result = setenv (name, value, replace);
+ if (result == 0 && replace && *value == '=')
+ {
+ char *tmp = getenv (name);
+ if (!STREQ (tmp, value))
+ {
+ int saved_errno;
+ size_t len = strlen (value);
+ tmp = malloca (len + 2);
+ /* Since leading '=' is eaten, double it up. */
+ *tmp = '=';
+ memcpy (tmp + 1, value, len + 1);
+ result = setenv (name, tmp, replace);
+ saved_errno = errno;
+ freea (tmp);
+ errno = saved_errno;
+ }
+ }
+ return result;
+}
+
+#endif /* HAVE_SETENV */
diff --git a/gl/setlocale-lock.c b/gl/setlocale-lock.c
new file mode 100644
index 0000000..b70ba09
--- /dev/null
+++ b/gl/setlocale-lock.c
@@ -0,0 +1,150 @@
+/* Return the internal lock used by setlocale_null_r.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019. */
+
+#include <config.h>
+
+/* When it is known that the gl_get_setlocale_null_lock function is defined
+ by a dependency library, it should not be defined here. */
+#if OMIT_SETLOCALE_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by setlocale_null_r.
+ It is a separate compilation unit, so that only one copy of it is
+ present when linking statically. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_setlocale_null_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+ when compiled into a shared library. */
+# ifndef DLL_EXPORTED
+# if HAVE_VISIBILITY
+ /* Override the effect of the compiler option '-fvisibility=hidden'. */
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# elif defined _WIN32 || defined __CYGWIN__
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+ because the latter is not guaranteed to be a stable ABI in the future. */
+
+/* Make sure the function gets exported from DLLs. */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by setlocale_null_r. */
+CRITICAL_SECTION *
+gl_get_setlocale_null_lock (void)
+{
+ if (!guard.done)
+ {
+ if (InterlockedIncrement (&guard.started) == 0)
+ {
+ /* This thread is the first one to need the lock. Initialize it. */
+ InitializeCriticalSection (&lock);
+ guard.done = 1;
+ }
+ else
+ {
+ /* Don't let guard.started grow and wrap around. */
+ InterlockedDecrement (&guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!guard.done)
+ Sleep (0);
+ }
+ }
+ return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED pthread_mutex_t *gl_get_setlocale_null_lock (void);
+
+/* Returns the internal lock used by setlocale_null_r. */
+pthread_mutex_t *
+gl_get_setlocale_null_lock (void)
+{
+ return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+# include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+ if (mtx_init (&mutex, mtx_plain) != thrd_success)
+ abort ();
+ init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED mtx_t *gl_get_setlocale_null_lock (void);
+
+/* Returns the internal lock used by setlocale_null_r. */
+mtx_t *
+gl_get_setlocale_null_lock (void)
+{
+ if (init_needed)
+ call_once (&init_once, atomic_init);
+ return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in setlocale_null.c does not cause
+ a link failure when no DLLs are involved. */
+# if defined _WIN64 || defined _LP64
+# define IMP(x) __imp_##x
+# else
+# define IMP(x) _imp__##x
+# endif
+void * IMP(gl_get_setlocale_null_lock) = &gl_get_setlocale_null_lock;
+# endif
+
+#endif
diff --git a/gl/setlocale_null.c b/gl/setlocale_null.c
new file mode 100644
index 0000000..6ac563d
--- /dev/null
+++ b/gl/setlocale_null.c
@@ -0,0 +1,411 @@
+/* Query the name of the current global locale.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019. */
+
+#include <config.h>
+
+/* Specification. */
+#include "setlocale_null.h"
+
+#include <errno.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <wchar.h>
+#endif
+
+#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE)
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+# if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+
+# endif
+#endif
+
+/* Use the system's setlocale() function, not the gnulib override, here. */
+#undef setlocale
+
+static const char *
+setlocale_null_androidfix (int category)
+{
+ const char *result = setlocale (category, NULL);
+
+#ifdef __ANDROID__
+ if (result == NULL)
+ switch (category)
+ {
+ case LC_CTYPE:
+ case LC_NUMERIC:
+ case LC_TIME:
+ case LC_COLLATE:
+ case LC_MONETARY:
+ case LC_MESSAGES:
+ case LC_ALL:
+ case LC_PAPER:
+ case LC_NAME:
+ case LC_ADDRESS:
+ case LC_TELEPHONE:
+ case LC_MEASUREMENT:
+ result = "C";
+ break;
+ default:
+ break;
+ }
+#endif
+
+ return result;
+}
+
+static int
+setlocale_null_unlocked (int category, char *buf, size_t bufsize)
+{
+#if defined _WIN32 && !defined __CYGWIN__ && defined _MSC_VER
+ /* On native Windows, nowadays, the setlocale() implementation is based
+ on _wsetlocale() and uses malloc() for the result. We are better off
+ using _wsetlocale() directly. */
+ const wchar_t *result = _wsetlocale (category, NULL);
+
+ if (result == NULL)
+ {
+ /* CATEGORY is invalid. */
+ if (bufsize > 0)
+ /* Return an empty string in BUF.
+ This is a convenience for callers that don't want to write explicit
+ code for handling EINVAL. */
+ buf[0] = '\0';
+ return EINVAL;
+ }
+ else
+ {
+ size_t length = wcslen (result);
+ if (length < bufsize)
+ {
+ size_t i;
+
+ /* Convert wchar_t[] -> char[], assuming plain ASCII. */
+ for (i = 0; i <= length; i++)
+ buf[i] = result[i];
+
+ return 0;
+ }
+ else
+ {
+ if (bufsize > 0)
+ {
+ /* Return a truncated result in BUF.
+ This is a convenience for callers that don't want to write
+ explicit code for handling ERANGE. */
+ size_t i;
+
+ /* Convert wchar_t[] -> char[], assuming plain ASCII. */
+ for (i = 0; i < bufsize; i++)
+ buf[i] = result[i];
+ buf[bufsize - 1] = '\0';
+ }
+ return ERANGE;
+ }
+ }
+#else
+ const char *result = setlocale_null_androidfix (category);
+
+ if (result == NULL)
+ {
+ /* CATEGORY is invalid. */
+ if (bufsize > 0)
+ /* Return an empty string in BUF.
+ This is a convenience for callers that don't want to write explicit
+ code for handling EINVAL. */
+ buf[0] = '\0';
+ return EINVAL;
+ }
+ else
+ {
+ size_t length = strlen (result);
+ if (length < bufsize)
+ {
+ memcpy (buf, result, length + 1);
+ return 0;
+ }
+ else
+ {
+ if (bufsize > 0)
+ {
+ /* Return a truncated result in BUF.
+ This is a convenience for callers that don't want to write
+ explicit code for handling ERANGE. */
+ memcpy (buf, result, bufsize - 1);
+ buf[bufsize - 1] = '\0';
+ }
+ return ERANGE;
+ }
+ }
+#endif
+}
+
+#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+
+/* Use a lock, so that no two threads can invoke setlocale_null_unlocked
+ at the same time. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_setlocale_null_lock
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+ CRITICAL_SECTION *lock = gl_get_setlocale_null_lock ();
+ int ret;
+
+ EnterCriticalSection (lock);
+ ret = setlocale_null_unlocked (category, buf, bufsize);
+ LeaveCriticalSection (lock);
+
+ return ret;
+}
+
+# elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+ __declspec(dllimport)
+# endif
+ pthread_mutex_t *gl_get_setlocale_null_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* musl libc, FreeBSD, NetBSD, OpenBSD, Haiku */
+
+ /* Avoid the need to link with '-lpthread'. */
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+
+ /* Determine whether libpthread is in use. */
+# pragma weak pthread_mutexattr_gettype
+ /* See the comments in lock.h. */
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+# define pthread_in_use() 1
+# endif
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+ if (pthread_in_use())
+ {
+ pthread_mutex_t *lock = gl_get_setlocale_null_lock ();
+ int ret;
+
+ if (pthread_mutex_lock (lock))
+ abort ();
+ ret = setlocale_null_unlocked (category, buf, bufsize);
+ if (pthread_mutex_unlock (lock))
+ abort ();
+
+ return ret;
+ }
+ else
+ return setlocale_null_unlocked (category, buf, bufsize);
+}
+
+# elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_setlocale_null_lock (void);
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+ mtx_t *lock = gl_get_setlocale_null_lock ();
+ int ret;
+
+ if (mtx_lock (lock) != thrd_success)
+ abort ();
+ ret = setlocale_null_unlocked (category, buf, bufsize);
+ if (mtx_unlock (lock) != thrd_success)
+ abort ();
+
+ return ret;
+}
+
+# endif
+
+#endif
+
+int
+setlocale_null_r (int category, char *buf, size_t bufsize)
+{
+#if SETLOCALE_NULL_ALL_MTSAFE
+# if SETLOCALE_NULL_ONE_MTSAFE
+
+ return setlocale_null_unlocked (category, buf, bufsize);
+
+# else
+
+ if (category == LC_ALL)
+ return setlocale_null_unlocked (category, buf, bufsize);
+ else
+ return setlocale_null_with_lock (category, buf, bufsize);
+
+# endif
+#else
+# if SETLOCALE_NULL_ONE_MTSAFE
+
+ if (category == LC_ALL)
+ return setlocale_null_with_lock (category, buf, bufsize);
+ else
+ return setlocale_null_unlocked (category, buf, bufsize);
+
+# else
+
+ return setlocale_null_with_lock (category, buf, bufsize);
+
+# endif
+#endif
+}
+
+const char *
+setlocale_null (int category)
+{
+#if SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE
+ return setlocale_null_androidfix (category);
+#else
+
+ /* This call must be multithread-safe. To achieve this without using
+ thread-local storage:
+ 1. We use a specific static buffer for each possible CATEGORY
+ argument. So that different threads can call setlocale_mtsafe
+ with different CATEGORY arguments, without interfering.
+ 2. We use a simple strcpy or memcpy to fill this static buffer.
+ Filling it through, for example, strcpy + strcat would not be
+ guaranteed to leave the buffer's contents intact if another thread
+ is currently accessing it. If necessary, the contents is first
+ assembled in a stack-allocated buffer. */
+ if (category == LC_ALL)
+ {
+# if SETLOCALE_NULL_ALL_MTSAFE
+ return setlocale_null_androidfix (LC_ALL);
+# else
+ char buf[SETLOCALE_NULL_ALL_MAX];
+ static char resultbuf[SETLOCALE_NULL_ALL_MAX];
+
+ if (setlocale_null_r (LC_ALL, buf, sizeof (buf)))
+ return "C";
+ strcpy (resultbuf, buf);
+ return resultbuf;
+# endif
+ }
+ else
+ {
+# if SETLOCALE_NULL_ONE_MTSAFE
+ return setlocale_null_androidfix (category);
+# else
+ enum
+ {
+ LC_CTYPE_INDEX,
+ LC_NUMERIC_INDEX,
+ LC_TIME_INDEX,
+ LC_COLLATE_INDEX,
+ LC_MONETARY_INDEX,
+ LC_MESSAGES_INDEX,
+# ifdef LC_PAPER
+ LC_PAPER_INDEX,
+# endif
+# ifdef LC_NAME
+ LC_NAME_INDEX,
+# endif
+# ifdef LC_ADDRESS
+ LC_ADDRESS_INDEX,
+# endif
+# ifdef LC_TELEPHONE
+ LC_TELEPHONE_INDEX,
+# endif
+# ifdef LC_MEASUREMENT
+ LC_MEASUREMENT_INDEX,
+# endif
+# ifdef LC_IDENTIFICATION
+ LC_IDENTIFICATION_INDEX,
+# endif
+ LC_INDICES_COUNT
+ }
+ i;
+ char buf[SETLOCALE_NULL_MAX];
+ static char resultbuf[LC_INDICES_COUNT][SETLOCALE_NULL_MAX];
+ int err;
+
+ err = setlocale_null_r (category, buf, sizeof (buf));
+ if (err == EINVAL)
+ return NULL;
+ if (err)
+ return "C";
+
+ switch (category)
+ {
+ case LC_CTYPE: i = LC_CTYPE_INDEX; break;
+ case LC_NUMERIC: i = LC_NUMERIC_INDEX; break;
+ case LC_TIME: i = LC_TIME_INDEX; break;
+ case LC_COLLATE: i = LC_COLLATE_INDEX; break;
+ case LC_MONETARY: i = LC_MONETARY_INDEX; break;
+ case LC_MESSAGES: i = LC_MESSAGES_INDEX; break;
+# ifdef LC_PAPER
+ case LC_PAPER: i = LC_PAPER_INDEX; break;
+# endif
+# ifdef LC_NAME
+ case LC_NAME: i = LC_NAME_INDEX; break;
+# endif
+# ifdef LC_ADDRESS
+ case LC_ADDRESS: i = LC_ADDRESS_INDEX; break;
+# endif
+# ifdef LC_TELEPHONE
+ case LC_TELEPHONE: i = LC_TELEPHONE_INDEX; break;
+# endif
+# ifdef LC_MEASUREMENT
+ case LC_MEASUREMENT: i = LC_MEASUREMENT_INDEX; break;
+# endif
+# ifdef LC_IDENTIFICATION
+ case LC_IDENTIFICATION: i = LC_IDENTIFICATION_INDEX; break;
+# endif
+ default:
+ /* If you get here, a #ifdef LC_xxx is missing. */
+ abort ();
+ }
+
+ strcpy (resultbuf[i], buf);
+ return resultbuf[i];
+# endif
+ }
+#endif
+}
diff --git a/gl/setlocale_null.h b/gl/setlocale_null.h
new file mode 100644
index 0000000..c740fa0
--- /dev/null
+++ b/gl/setlocale_null.h
@@ -0,0 +1,82 @@
+/* Query the name of the current global locale.
+ Copyright (C) 2019-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019. */
+
+#ifndef _SETLOCALE_NULL_H
+#define _SETLOCALE_NULL_H
+
+#include <stddef.h>
+
+#include "arg-nonnull.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Recommended size of a buffer for a locale name for a single category.
+ On glibc systems, you can have locale names that are relative file names;
+ assume a maximum length 256.
+ In native Windows, in 2018 the longest locale name was of length 58
+ ("FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251"). */
+#define SETLOCALE_NULL_MAX (256+1)
+
+/* Recommended size of a buffer for a locale name with all categories.
+ On glibc systems, you can have locale names that are relative file names;
+ assume maximum length 256 for each. There are 12 categories; so, the
+ maximum total length is 148+12*256.
+ In native Windows, there are 5 categories, and the maximum total length is
+ 55+5*58. */
+#define SETLOCALE_NULL_ALL_MAX (148+12*256+1)
+
+/* setlocale_null_r (CATEGORY, BUF, BUFSIZE) is like setlocale (CATEGORY, NULL),
+ except that
+ - it is guaranteed to be multithread-safe,
+ - it returns the resulting locale category name or locale name in the
+ user-supplied buffer BUF, which must be BUFSIZE bytes long.
+ The recommended minimum buffer size is
+ - SETLOCALE_NULL_MAX for CATEGORY != LC_ALL, and
+ - SETLOCALE_NULL_ALL_MAX for CATEGORY == LC_ALL.
+ The return value is an error code: 0 if the call is successful, EINVAL if
+ CATEGORY is invalid, or ERANGE if BUFSIZE is smaller than the length needed
+ size (including the trailing NUL byte). In the latter case, a truncated
+ result is returned in BUF, but still NUL-terminated if BUFSIZE > 0.
+ For this call to be multithread-safe, *all* calls to
+ setlocale (CATEGORY, NULL) in all other threads must have been converted
+ to use setlocale_null_r or setlocale_null as well, and the other threads
+ must not make other setlocale invocations (since changing the global locale
+ has side effects on all threads). */
+extern int setlocale_null_r (int category, char *buf, size_t bufsize)
+ _GL_ARG_NONNULL ((2));
+
+/* setlocale_null (CATEGORY) is like setlocale (CATEGORY, NULL), except that
+ it is guaranteed to be multithread-safe.
+ The return value is NULL if CATEGORY is invalid.
+ For this call to be multithread-safe, *all* calls to
+ setlocale (CATEGORY, NULL) in all other threads must have been converted
+ to use setlocale_null_r or setlocale_null as well, and the other threads
+ must not make other setlocale invocations (since changing the global locale
+ has side effects on all threads). */
+extern const char *setlocale_null (int category);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SETLOCALE_NULL_H */
diff --git a/gl/sha256-stream.c b/gl/sha256-stream.c
new file mode 100644
index 0000000..0e83380
--- /dev/null
+++ b/gl/sha256-stream.c
@@ -0,0 +1,145 @@
+/* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or
+ memory blocks according to the NIST specification FIPS-180-2.
+
+ Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by David Madore, considerably copypasting from
+ Scott G. Miller's sha1.c
+*/
+
+#include <config.h>
+
+/* Specification. */
+#if HAVE_OPENSSL_SHA256
+# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+#endif
+#include "sha256.h"
+
+#include <stdlib.h>
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+#include "af_alg.h"
+
+#define BLOCKSIZE 32768
+#if BLOCKSIZE % 64 != 0
+# error "invalid BLOCKSIZE"
+#endif
+
+/* Compute message digest for bytes read from STREAM using algorithm ALG.
+ Write the message digest into RESBLOCK, which contains HASHLEN bytes.
+ The initial and finishing operations are INIT_CTX and FINISH_CTX.
+ Return zero if and only if successful. */
+static int
+shaxxx_stream (FILE *stream, char const *alg, void *resblock,
+ ssize_t hashlen, void (*init_ctx) (struct sha256_ctx *),
+ void *(*finish_ctx) (struct sha256_ctx *, void *))
+{
+ switch (afalg_stream (stream, alg, resblock, hashlen))
+ {
+ case 0: return 0;
+ case -EIO: return 1;
+ }
+
+ char *buffer = malloc (BLOCKSIZE + 72);
+ if (!buffer)
+ return 1;
+
+ struct sha256_ctx ctx;
+ init_ctx (&ctx);
+ size_t sum;
+
+ /* Iterate over full file contents. */
+ while (1)
+ {
+ /* We read the file in blocks of BLOCKSIZE bytes. One call of the
+ computation function processes the whole buffer so that with the
+ next round of the loop another block can be read. */
+ size_t n;
+ sum = 0;
+
+ /* Read block. Take care for partial reads. */
+ while (1)
+ {
+ /* Either process a partial fread() from this loop,
+ or the fread() in afalg_stream may have gotten EOF.
+ We need to avoid a subsequent fread() as EOF may
+ not be sticky. For details of such systems, see:
+ https://sourceware.org/bugzilla/show_bug.cgi?id=1190 */
+ if (feof (stream))
+ goto process_partial_block;
+
+ n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
+
+ sum += n;
+
+ if (sum == BLOCKSIZE)
+ break;
+
+ if (n == 0)
+ {
+ /* Check for the error flag IFF N == 0, so that we don't
+ exit the loop after a partial read due to e.g., EAGAIN
+ or EWOULDBLOCK. */
+ if (ferror (stream))
+ {
+ free (buffer);
+ return 1;
+ }
+ goto process_partial_block;
+ }
+ }
+
+ /* Process buffer with BLOCKSIZE bytes. Note that
+ BLOCKSIZE % 64 == 0
+ */
+ sha256_process_block (buffer, BLOCKSIZE, &ctx);
+ }
+
+ process_partial_block:;
+
+ /* Process any remaining bytes. */
+ if (sum > 0)
+ sha256_process_bytes (buffer, sum, &ctx);
+
+ /* Construct result in desired memory. */
+ finish_ctx (&ctx, resblock);
+ free (buffer);
+ return 0;
+}
+
+int
+sha256_stream (FILE *stream, void *resblock)
+{
+ return shaxxx_stream (stream, "sha256", resblock, SHA256_DIGEST_SIZE,
+ sha256_init_ctx, sha256_finish_ctx);
+}
+
+int
+sha224_stream (FILE *stream, void *resblock)
+{
+ return shaxxx_stream (stream, "sha224", resblock, SHA224_DIGEST_SIZE,
+ sha224_init_ctx, sha224_finish_ctx);
+}
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
diff --git a/gl/sha256.c b/gl/sha256.c
new file mode 100644
index 0000000..e5fea02
--- /dev/null
+++ b/gl/sha256.c
@@ -0,0 +1,432 @@
+/* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or
+ memory blocks according to the NIST specification FIPS-180-2.
+
+ Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by David Madore, considerably copypasting from
+ Scott G. Miller's sha1.c
+*/
+
+#include <config.h>
+
+/* Specification. */
+#if HAVE_OPENSSL_SHA256
+# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+#endif
+#include "sha256.h"
+
+#include <stdint.h>
+#include <string.h>
+
+#include <byteswap.h>
+#ifdef WORDS_BIGENDIAN
+# define SWAP(n) (n)
+#else
+# define SWAP(n) bswap_32 (n)
+#endif
+
+#if ! HAVE_OPENSSL_SHA256
+
+/* This array contains the bytes used to pad the buffer to the next
+ 64-byte boundary. */
+static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
+
+
+/*
+ Takes a pointer to a 256 bit block of data (eight 32 bit ints) and
+ initializes it to the start constants of the SHA256 algorithm. This
+ must be called before using hash in the call to sha256_hash
+*/
+void
+sha256_init_ctx (struct sha256_ctx *ctx)
+{
+ ctx->state[0] = 0x6a09e667UL;
+ ctx->state[1] = 0xbb67ae85UL;
+ ctx->state[2] = 0x3c6ef372UL;
+ ctx->state[3] = 0xa54ff53aUL;
+ ctx->state[4] = 0x510e527fUL;
+ ctx->state[5] = 0x9b05688cUL;
+ ctx->state[6] = 0x1f83d9abUL;
+ ctx->state[7] = 0x5be0cd19UL;
+
+ ctx->total[0] = ctx->total[1] = 0;
+ ctx->buflen = 0;
+}
+
+void
+sha224_init_ctx (struct sha256_ctx *ctx)
+{
+ ctx->state[0] = 0xc1059ed8UL;
+ ctx->state[1] = 0x367cd507UL;
+ ctx->state[2] = 0x3070dd17UL;
+ ctx->state[3] = 0xf70e5939UL;
+ ctx->state[4] = 0xffc00b31UL;
+ ctx->state[5] = 0x68581511UL;
+ ctx->state[6] = 0x64f98fa7UL;
+ ctx->state[7] = 0xbefa4fa4UL;
+
+ ctx->total[0] = ctx->total[1] = 0;
+ ctx->buflen = 0;
+}
+
+/* Copy the value from v into the memory location pointed to by *CP,
+ If your architecture allows unaligned access, this is equivalent to
+ * (__typeof__ (v) *) cp = v */
+static void
+set_uint32 (char *cp, uint32_t v)
+{
+ memcpy (cp, &v, sizeof v);
+}
+
+/* Put result from CTX in first 32 bytes following RESBUF.
+ The result must be in little endian byte order. */
+void *
+sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf)
+{
+ int i;
+ char *r = resbuf;
+
+ for (i = 0; i < 8; i++)
+ set_uint32 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i]));
+
+ return resbuf;
+}
+
+void *
+sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf)
+{
+ int i;
+ char *r = resbuf;
+
+ for (i = 0; i < 7; i++)
+ set_uint32 (r + i * sizeof ctx->state[0], SWAP (ctx->state[i]));
+
+ return resbuf;
+}
+
+/* Process the remaining bytes in the internal buffer and the usual
+ prolog according to the standard and write the result to RESBUF. */
+static void
+sha256_conclude_ctx (struct sha256_ctx *ctx)
+{
+ /* Take yet unprocessed bytes into account. */
+ size_t bytes = ctx->buflen;
+ size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4;
+
+ /* Now count remaining bytes. */
+ ctx->total[0] += bytes;
+ if (ctx->total[0] < bytes)
+ ++ctx->total[1];
+
+ /* Put the 64-bit file length in *bits* at the end of the buffer.
+ Use set_uint32 rather than a simple assignment, to avoid risk of
+ unaligned access. */
+ set_uint32 ((char *) &ctx->buffer[size - 2],
+ SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)));
+ set_uint32 ((char *) &ctx->buffer[size - 1],
+ SWAP (ctx->total[0] << 3));
+
+ memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes);
+
+ /* Process last bytes. */
+ sha256_process_block (ctx->buffer, size * 4, ctx);
+}
+
+void *
+sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
+{
+ sha256_conclude_ctx (ctx);
+ return sha256_read_ctx (ctx, resbuf);
+}
+
+void *
+sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
+{
+ sha256_conclude_ctx (ctx);
+ return sha224_read_ctx (ctx, resbuf);
+}
+
+/* Compute SHA256 message digest for LEN bytes beginning at BUFFER. The
+ result is always in little endian byte order, so that a byte-wise
+ output yields to the wanted ASCII representation of the message
+ digest. */
+void *
+sha256_buffer (const char *buffer, size_t len, void *resblock)
+{
+ struct sha256_ctx ctx;
+
+ /* Initialize the computation context. */
+ sha256_init_ctx (&ctx);
+
+ /* Process whole buffer but last len % 64 bytes. */
+ sha256_process_bytes (buffer, len, &ctx);
+
+ /* Put result in desired memory area. */
+ return sha256_finish_ctx (&ctx, resblock);
+}
+
+void *
+sha224_buffer (const char *buffer, size_t len, void *resblock)
+{
+ struct sha256_ctx ctx;
+
+ /* Initialize the computation context. */
+ sha224_init_ctx (&ctx);
+
+ /* Process whole buffer but last len % 64 bytes. */
+ sha256_process_bytes (buffer, len, &ctx);
+
+ /* Put result in desired memory area. */
+ return sha224_finish_ctx (&ctx, resblock);
+}
+
+void
+sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
+{
+ /* When we already have some bits in our internal buffer concatenate
+ both inputs first. */
+ if (ctx->buflen != 0)
+ {
+ size_t left_over = ctx->buflen;
+ size_t add = 128 - left_over > len ? len : 128 - left_over;
+
+ memcpy (&((char *) ctx->buffer)[left_over], buffer, add);
+ ctx->buflen += add;
+
+ if (ctx->buflen > 64)
+ {
+ sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
+
+ ctx->buflen &= 63;
+ /* The regions in the following copy operation cannot overlap,
+ because ctx->buflen < 64 ≤ (left_over + add) & ~63. */
+ memcpy (ctx->buffer,
+ &((char *) ctx->buffer)[(left_over + add) & ~63],
+ ctx->buflen);
+ }
+
+ buffer = (const char *) buffer + add;
+ len -= add;
+ }
+
+ /* Process available complete blocks. */
+ if (len >= 64)
+ {
+#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned)
+# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
+ if (UNALIGNED_P (buffer))
+ while (len > 64)
+ {
+ sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
+ buffer = (const char *) buffer + 64;
+ len -= 64;
+ }
+ else
+#endif
+ {
+ sha256_process_block (buffer, len & ~63, ctx);
+ buffer = (const char *) buffer + (len & ~63);
+ len &= 63;
+ }
+ }
+
+ /* Move remaining bytes in internal buffer. */
+ if (len > 0)
+ {
+ size_t left_over = ctx->buflen;
+
+ memcpy (&((char *) ctx->buffer)[left_over], buffer, len);
+ left_over += len;
+ if (left_over >= 64)
+ {
+ sha256_process_block (ctx->buffer, 64, ctx);
+ left_over -= 64;
+ /* The regions in the following copy operation cannot overlap,
+ because left_over ≤ 64. */
+ memcpy (ctx->buffer, &ctx->buffer[16], left_over);
+ }
+ ctx->buflen = left_over;
+ }
+}
+
+/* --- Code below is the primary difference between sha1.c and sha256.c --- */
+
+/* SHA256 round constants */
+#define K(I) sha256_round_constants[I]
+static const uint32_t sha256_round_constants[64] = {
+ 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
+ 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
+ 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
+ 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
+ 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
+ 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
+ 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
+ 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
+ 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
+ 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
+ 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
+ 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
+ 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
+ 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
+ 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
+ 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL,
+};
+
+/* Round functions. */
+#define F2(A,B,C) ( ( A & B ) | ( C & ( A | B ) ) )
+#define F1(E,F,G) ( G ^ ( E & ( F ^ G ) ) )
+
+/* Process LEN bytes of BUFFER, accumulating context into CTX.
+ It is assumed that LEN % 64 == 0.
+ Most of this code comes from GnuPG's cipher/sha1.c. */
+
+void
+sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
+{
+ const uint32_t *words = buffer;
+ size_t nwords = len / sizeof (uint32_t);
+ const uint32_t *endp = words + nwords;
+ uint32_t x[16];
+ uint32_t a = ctx->state[0];
+ uint32_t b = ctx->state[1];
+ uint32_t c = ctx->state[2];
+ uint32_t d = ctx->state[3];
+ uint32_t e = ctx->state[4];
+ uint32_t f = ctx->state[5];
+ uint32_t g = ctx->state[6];
+ uint32_t h = ctx->state[7];
+ uint32_t lolen = len;
+
+ /* First increment the byte count. FIPS PUB 180-2 specifies the possible
+ length of the file up to 2^64 bits. Here we only compute the
+ number of bytes. Do a double word increment. */
+ ctx->total[0] += lolen;
+ ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
+
+#define rol(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
+#define S0(x) (rol(x,25)^rol(x,14)^(x>>3))
+#define S1(x) (rol(x,15)^rol(x,13)^(x>>10))
+#define SS0(x) (rol(x,30)^rol(x,19)^rol(x,10))
+#define SS1(x) (rol(x,26)^rol(x,21)^rol(x,7))
+
+#define M(I) ( tm = S1(x[(I-2)&0x0f]) + x[(I-7)&0x0f] \
+ + S0(x[(I-15)&0x0f]) + x[I&0x0f] \
+ , x[I&0x0f] = tm )
+
+#define R(A,B,C,D,E,F,G,H,K,M) do { t0 = SS0(A) + F2(A,B,C); \
+ t1 = H + SS1(E) \
+ + F1(E,F,G) \
+ + K \
+ + M; \
+ D += t1; H = t0 + t1; \
+ } while(0)
+
+ while (words < endp)
+ {
+ uint32_t tm;
+ uint32_t t0, t1;
+ int t;
+ /* FIXME: see sha1.c for a better implementation. */
+ for (t = 0; t < 16; t++)
+ {
+ x[t] = SWAP (*words);
+ words++;
+ }
+
+ R( a, b, c, d, e, f, g, h, K( 0), x[ 0] );
+ R( h, a, b, c, d, e, f, g, K( 1), x[ 1] );
+ R( g, h, a, b, c, d, e, f, K( 2), x[ 2] );
+ R( f, g, h, a, b, c, d, e, K( 3), x[ 3] );
+ R( e, f, g, h, a, b, c, d, K( 4), x[ 4] );
+ R( d, e, f, g, h, a, b, c, K( 5), x[ 5] );
+ R( c, d, e, f, g, h, a, b, K( 6), x[ 6] );
+ R( b, c, d, e, f, g, h, a, K( 7), x[ 7] );
+ R( a, b, c, d, e, f, g, h, K( 8), x[ 8] );
+ R( h, a, b, c, d, e, f, g, K( 9), x[ 9] );
+ R( g, h, a, b, c, d, e, f, K(10), x[10] );
+ R( f, g, h, a, b, c, d, e, K(11), x[11] );
+ R( e, f, g, h, a, b, c, d, K(12), x[12] );
+ R( d, e, f, g, h, a, b, c, K(13), x[13] );
+ R( c, d, e, f, g, h, a, b, K(14), x[14] );
+ R( b, c, d, e, f, g, h, a, K(15), x[15] );
+ R( a, b, c, d, e, f, g, h, K(16), M(16) );
+ R( h, a, b, c, d, e, f, g, K(17), M(17) );
+ R( g, h, a, b, c, d, e, f, K(18), M(18) );
+ R( f, g, h, a, b, c, d, e, K(19), M(19) );
+ R( e, f, g, h, a, b, c, d, K(20), M(20) );
+ R( d, e, f, g, h, a, b, c, K(21), M(21) );
+ R( c, d, e, f, g, h, a, b, K(22), M(22) );
+ R( b, c, d, e, f, g, h, a, K(23), M(23) );
+ R( a, b, c, d, e, f, g, h, K(24), M(24) );
+ R( h, a, b, c, d, e, f, g, K(25), M(25) );
+ R( g, h, a, b, c, d, e, f, K(26), M(26) );
+ R( f, g, h, a, b, c, d, e, K(27), M(27) );
+ R( e, f, g, h, a, b, c, d, K(28), M(28) );
+ R( d, e, f, g, h, a, b, c, K(29), M(29) );
+ R( c, d, e, f, g, h, a, b, K(30), M(30) );
+ R( b, c, d, e, f, g, h, a, K(31), M(31) );
+ R( a, b, c, d, e, f, g, h, K(32), M(32) );
+ R( h, a, b, c, d, e, f, g, K(33), M(33) );
+ R( g, h, a, b, c, d, e, f, K(34), M(34) );
+ R( f, g, h, a, b, c, d, e, K(35), M(35) );
+ R( e, f, g, h, a, b, c, d, K(36), M(36) );
+ R( d, e, f, g, h, a, b, c, K(37), M(37) );
+ R( c, d, e, f, g, h, a, b, K(38), M(38) );
+ R( b, c, d, e, f, g, h, a, K(39), M(39) );
+ R( a, b, c, d, e, f, g, h, K(40), M(40) );
+ R( h, a, b, c, d, e, f, g, K(41), M(41) );
+ R( g, h, a, b, c, d, e, f, K(42), M(42) );
+ R( f, g, h, a, b, c, d, e, K(43), M(43) );
+ R( e, f, g, h, a, b, c, d, K(44), M(44) );
+ R( d, e, f, g, h, a, b, c, K(45), M(45) );
+ R( c, d, e, f, g, h, a, b, K(46), M(46) );
+ R( b, c, d, e, f, g, h, a, K(47), M(47) );
+ R( a, b, c, d, e, f, g, h, K(48), M(48) );
+ R( h, a, b, c, d, e, f, g, K(49), M(49) );
+ R( g, h, a, b, c, d, e, f, K(50), M(50) );
+ R( f, g, h, a, b, c, d, e, K(51), M(51) );
+ R( e, f, g, h, a, b, c, d, K(52), M(52) );
+ R( d, e, f, g, h, a, b, c, K(53), M(53) );
+ R( c, d, e, f, g, h, a, b, K(54), M(54) );
+ R( b, c, d, e, f, g, h, a, K(55), M(55) );
+ R( a, b, c, d, e, f, g, h, K(56), M(56) );
+ R( h, a, b, c, d, e, f, g, K(57), M(57) );
+ R( g, h, a, b, c, d, e, f, K(58), M(58) );
+ R( f, g, h, a, b, c, d, e, K(59), M(59) );
+ R( e, f, g, h, a, b, c, d, K(60), M(60) );
+ R( d, e, f, g, h, a, b, c, K(61), M(61) );
+ R( c, d, e, f, g, h, a, b, K(62), M(62) );
+ R( b, c, d, e, f, g, h, a, K(63), M(63) );
+
+ a = ctx->state[0] += a;
+ b = ctx->state[1] += b;
+ c = ctx->state[2] += c;
+ d = ctx->state[3] += d;
+ e = ctx->state[4] += e;
+ f = ctx->state[5] += f;
+ g = ctx->state[6] += g;
+ h = ctx->state[7] += h;
+ }
+}
+
+#endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
diff --git a/gl/sha256.h b/gl/sha256.h
new file mode 100644
index 0000000..2879477
--- /dev/null
+++ b/gl/sha256.h
@@ -0,0 +1,121 @@
+/* Declarations of functions and data types used for SHA256 and SHA224 sum
+ library functions.
+ Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef SHA256_H
+# define SHA256_H 1
+
+# include <stdio.h>
+# include <stdint.h>
+
+# if HAVE_OPENSSL_SHA256
+# ifndef OPENSSL_API_COMPAT
+# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */
+# endif
+# include <openssl/sha.h>
+# endif
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+enum { SHA224_DIGEST_SIZE = 224 / 8 };
+enum { SHA256_DIGEST_SIZE = 256 / 8 };
+
+# if HAVE_OPENSSL_SHA256
+# define GL_OPENSSL_NAME 224
+# include "gl_openssl.h"
+# define GL_OPENSSL_NAME 256
+# include "gl_openssl.h"
+# else
+/* Structure to save state of computation between the single steps. */
+struct sha256_ctx
+{
+ uint32_t state[8];
+
+ uint32_t total[2];
+ size_t buflen; /* ≥ 0, ≤ 128 */
+ uint32_t buffer[32]; /* 128 bytes; the first buflen bytes are in use */
+};
+
+/* Initialize structure containing state of computation. */
+extern void sha256_init_ctx (struct sha256_ctx *ctx);
+extern void sha224_init_ctx (struct sha256_ctx *ctx);
+
+/* Starting with the result of former calls of this function (or the
+ initialization function update the context for the next LEN bytes
+ starting at BUFFER.
+ It is necessary that LEN is a multiple of 64!!! */
+extern void sha256_process_block (const void *buffer, size_t len,
+ struct sha256_ctx *ctx);
+
+/* Starting with the result of former calls of this function (or the
+ initialization function update the context for the next LEN bytes
+ starting at BUFFER.
+ It is NOT required that LEN is a multiple of 64. */
+extern void sha256_process_bytes (const void *buffer, size_t len,
+ struct sha256_ctx *ctx);
+
+/* Process the remaining bytes in the buffer and put result from CTX
+ in first 32 (28) bytes following RESBUF. The result is always in little
+ endian byte order, so that a byte-wise output yields to the wanted
+ ASCII representation of the message digest. */
+extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
+extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
+
+
+/* Put result from CTX in first 32 (28) bytes following RESBUF. The result is
+ always in little endian byte order, so that a byte-wise output yields
+ to the wanted ASCII representation of the message digest. */
+extern void *sha256_read_ctx (const struct sha256_ctx *ctx,
+ void *restrict resbuf);
+extern void *sha224_read_ctx (const struct sha256_ctx *ctx,
+ void *restrict resbuf);
+
+
+/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER.
+ The result is always in little endian byte order, so that a byte-wise
+ output yields to the wanted ASCII representation of the message
+ digest. */
+extern void *sha256_buffer (const char *buffer, size_t len,
+ void *restrict resblock);
+extern void *sha224_buffer (const char *buffer, size_t len,
+ void *restrict resblock);
+
+# endif
+
+/* Compute SHA256 (SHA224) message digest for bytes read from STREAM.
+ STREAM is an open file stream. Regular files are handled more efficiently.
+ The contents of STREAM from its current position to its end will be read.
+ The case that the last operation on STREAM was an 'ungetc' is not supported.
+ The resulting message digest number will be written into the 32 (28) bytes
+ beginning at RESBLOCK. */
+extern int sha256_stream (FILE *stream, void *resblock);
+extern int sha224_stream (FILE *stream, void *resblock);
+
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
diff --git a/gl/size_max.h b/gl/size_max.h
new file mode 100644
index 0000000..48af025
--- /dev/null
+++ b/gl/size_max.h
@@ -0,0 +1,30 @@
+/* size_max.h -- declare SIZE_MAX through system headers
+ Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef GNULIB_SIZE_MAX_H
+#define GNULIB_SIZE_MAX_H
+
+/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
+# include <limits.h>
+/* Get SIZE_MAX declaration on systems like glibc 2. */
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+/* On systems where these include files don't define it, SIZE_MAX is defined
+ in config.h. */
+
+#endif /* GNULIB_SIZE_MAX_H */
diff --git a/gl/snprintf.c b/gl/snprintf.c
new file mode 100644
index 0000000..cdff314
--- /dev/null
+++ b/gl/snprintf.c
@@ -0,0 +1,71 @@
+/* Formatted output to strings.
+ Copyright (C) 2004, 2006-2023 Free Software Foundation, Inc.
+ Written by Simon Josefsson and Paul Eggert.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vasnprintf.h"
+
+/* Print formatted output to string STR. Similar to sprintf, but
+ additional length SIZE limit how much is written into STR. Returns
+ string length of formatted string (which may be larger than SIZE).
+ STR may be NULL, in which case nothing will be written. On error,
+ return a negative value. */
+int
+snprintf (char *str, size_t size, const char *format, ...)
+{
+ char *output;
+ size_t len;
+ size_t lenbuf = size;
+ va_list args;
+
+ va_start (args, format);
+ output = vasnprintf (str, &lenbuf, format, args);
+ len = lenbuf;
+ va_end (args);
+
+ if (!output)
+ return -1;
+
+ if (output != str)
+ {
+ if (size)
+ {
+ size_t pruned_len = (len < size ? len : size - 1);
+ memcpy (str, output, pruned_len);
+ str[pruned_len] = '\0';
+ }
+
+ free (output);
+ }
+
+ if (INT_MAX < len)
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+ return len;
+}
diff --git a/gl/sockets.c b/gl/sockets.c
new file mode 100644
index 0000000..ca99db8
--- /dev/null
+++ b/gl/sockets.c
@@ -0,0 +1,161 @@
+/* sockets.c --- wrappers for Windows socket functions
+
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson */
+
+#include <config.h>
+
+/* Specification. */
+#include "sockets.h"
+
+#if WINDOWS_SOCKETS
+
+/* This includes winsock2.h on MinGW. */
+# include <sys/socket.h>
+
+# include "fd-hook.h"
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+# include "w32sock.h"
+
+static int
+close_fd_maybe_socket (const struct fd_hook *remaining_list,
+ gl_close_fn primary,
+ int fd)
+{
+ /* Note about multithread-safety: There is a race condition where, between
+ our calls to closesocket() and the primary close(), some other thread
+ could make system calls that allocate precisely the same HANDLE value
+ as sock; then the primary close() would call CloseHandle() on it. */
+ SOCKET sock;
+ WSANETWORKEVENTS ev;
+
+ /* Test whether fd refers to a socket. */
+ sock = FD_TO_SOCKET (fd);
+ ev.lNetworkEvents = 0xDEADBEEF;
+ WSAEnumNetworkEvents (sock, NULL, &ev);
+ if (ev.lNetworkEvents != 0xDEADBEEF)
+ {
+ /* fd refers to a socket. */
+ /* FIXME: other applications, like squid, use an undocumented
+ _free_osfhnd free function. But this is not enough: The 'osfile'
+ flags for fd also needs to be cleared, but it is hard to access it.
+ Instead, here we just close twice the file descriptor. */
+ if (closesocket (sock))
+ {
+ set_winsock_errno ();
+ return -1;
+ }
+ else
+ {
+ /* This call frees the file descriptor and does a
+ CloseHandle ((HANDLE) _get_osfhandle (fd)), which fails. */
+ _close (fd);
+ return 0;
+ }
+ }
+ else
+ /* Some other type of file descriptor. */
+ return execute_close_hooks (remaining_list, primary, fd);
+}
+
+static int
+ioctl_fd_maybe_socket (const struct fd_hook *remaining_list,
+ gl_ioctl_fn primary,
+ int fd, int request, void *arg)
+{
+ SOCKET sock;
+ WSANETWORKEVENTS ev;
+
+ /* Test whether fd refers to a socket. */
+ sock = FD_TO_SOCKET (fd);
+ ev.lNetworkEvents = 0xDEADBEEF;
+ WSAEnumNetworkEvents (sock, NULL, &ev);
+ if (ev.lNetworkEvents != 0xDEADBEEF)
+ {
+ /* fd refers to a socket. */
+ if (ioctlsocket (sock, request, arg) < 0)
+ {
+ set_winsock_errno ();
+ return -1;
+ }
+ else
+ return 0;
+ }
+ else
+ /* Some other type of file descriptor. */
+ return execute_ioctl_hooks (remaining_list, primary, fd, request, arg);
+}
+
+static struct fd_hook fd_sockets_hook;
+
+static int initialized_sockets_version /* = 0 */;
+
+#endif /* WINDOWS_SOCKETS */
+
+int
+gl_sockets_startup (_GL_UNUSED int version)
+{
+#if WINDOWS_SOCKETS
+ if (version > initialized_sockets_version)
+ {
+ WSADATA data;
+ int err;
+
+ err = WSAStartup (version, &data);
+ if (err != 0)
+ return 1;
+
+ if (data.wVersion != version)
+ {
+ WSACleanup ();
+ return 2;
+ }
+
+ if (initialized_sockets_version == 0)
+ register_fd_hook (close_fd_maybe_socket, ioctl_fd_maybe_socket,
+ &fd_sockets_hook);
+
+ initialized_sockets_version = version;
+ }
+#endif
+
+ return 0;
+}
+
+int
+gl_sockets_cleanup (void)
+{
+#if WINDOWS_SOCKETS
+ int err;
+
+ initialized_sockets_version = 0;
+
+ unregister_fd_hook (&fd_sockets_hook);
+
+ err = WSACleanup ();
+ if (err != 0)
+ return 1;
+#endif
+
+ return 0;
+}
diff --git a/gl/sockets.h b/gl/sockets.h
new file mode 100644
index 0000000..a0b1601
--- /dev/null
+++ b/gl/sockets.h
@@ -0,0 +1,66 @@
+/* sockets.h - wrappers for Windows socket functions
+
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Simon Josefsson */
+
+#ifndef SOCKETS_H
+#define SOCKETS_H 1
+
+#define SOCKETS_1_0 0x0001
+#define SOCKETS_1_1 0x0101
+#define SOCKETS_2_0 0x0002
+#define SOCKETS_2_1 0x0102
+#define SOCKETS_2_2 0x0202
+
+int gl_sockets_startup (int version)
+#ifndef WINDOWS_SOCKETS
+ _GL_ATTRIBUTE_CONST
+#endif
+ ;
+
+int gl_sockets_cleanup (void)
+#ifndef WINDOWS_SOCKETS
+ _GL_ATTRIBUTE_CONST
+#endif
+ ;
+
+/* This function is useful it you create a socket using gnulib's
+ Winsock wrappers but needs to pass on the socket handle to some
+ other library that only accepts sockets. */
+#ifdef WINDOWS_SOCKETS
+
+# include <sys/socket.h>
+
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+static inline SOCKET
+gl_fd_to_handle (int fd)
+{
+ return _get_osfhandle (fd);
+}
+
+#else
+
+# define gl_fd_to_handle(x) (x)
+
+#endif /* WINDOWS_SOCKETS */
+
+#endif /* SOCKETS_H */
diff --git a/gl/stat-time.c b/gl/stat-time.c
new file mode 100644
index 0000000..bc28223
--- /dev/null
+++ b/gl/stat-time.c
@@ -0,0 +1,21 @@
+/* stat-related time functions.
+
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE
+#include "stat-time.h"
diff --git a/gl/stat-time.h b/gl/stat-time.h
new file mode 100644
index 0000000..92aa1e6
--- /dev/null
+++ b/gl/stat-time.h
@@ -0,0 +1,251 @@
+/* stat-related time functions.
+
+ Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#ifndef STAT_TIME_H
+#define STAT_TIME_H 1
+
+#include <errno.h>
+#include <stdckdint.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <time.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_STAT_TIME_INLINE
+# define _GL_STAT_TIME_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
+ struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,
+ ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
+ if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim
+ for access, status change, data modification, or birth (creation)
+ time respectively.
+
+ These macros are private to stat-time.h. */
+#if _GL_WINDOWS_STAT_TIMESPEC || defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+# if _GL_WINDOWS_STAT_TIMESPEC || defined TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
+# else
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec)
+# endif
+#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec)
+#endif
+
+/* Return the nanosecond component of *ST's access time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_atime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_atim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_atim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's status change time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_ctime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_ctim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_ctim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's data modification time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_mtime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_mtim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+ return STAT_TIMESPEC_NS (st, st_mtim);
+# else
+ return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's birth time. */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_birthtime_ns (_GL_UNUSED struct stat const *st)
+{
+# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+ return STAT_TIMESPEC (st, st_birthtim).tv_nsec;
+# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+ return STAT_TIMESPEC_NS (st, st_birthtim);
+# else
+ return 0;
+# endif
+}
+
+/* Return *ST's access time. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_atime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_atim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_atime;
+ t.tv_nsec = get_stat_atime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's status change time. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_ctime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_ctim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_ctime;
+ t.tv_nsec = get_stat_ctime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's data modification time. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_mtime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+ return STAT_TIMESPEC (st, st_mtim);
+#else
+ struct timespec t;
+ t.tv_sec = st->st_mtime;
+ t.tv_nsec = get_stat_mtime_ns (st);
+ return t;
+#endif
+}
+
+/* Return *ST's birth time, if available; otherwise return a value
+ with tv_sec and tv_nsec both equal to -1. */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_birthtime (_GL_UNUSED struct stat const *st)
+{
+ struct timespec t;
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC)
+ t = STAT_TIMESPEC (st, st_birthtim);
+#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+ t.tv_sec = st->st_birthtime;
+ t.tv_nsec = st->st_birthtimensec;
+#elif defined _WIN32 && ! defined __CYGWIN__
+ /* Native Windows platforms (but not Cygwin) put the "file creation
+ time" in st_ctime (!). See
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions>. */
+# if _GL_WINDOWS_STAT_TIMESPEC
+ t = st->st_ctim;
+# else
+ t.tv_sec = st->st_ctime;
+ t.tv_nsec = 0;
+# endif
+#else
+ /* Birth time is not supported. */
+ t.tv_sec = -1;
+ t.tv_nsec = -1;
+#endif
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \
+ || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
+ /* FreeBSD and NetBSD sometimes signal the absence of knowledge by
+ using zero. Attempt to work around this problem. Alas, this can
+ report failure even for valid timestamps. Also, NetBSD
+ sometimes returns junk in the birth time fields; work around this
+ bug if it is detected. */
+ if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))
+ {
+ t.tv_sec = -1;
+ t.tv_nsec = -1;
+ }
+#endif
+
+ return t;
+}
+
+/* If a stat-like function returned RESULT, normalize the timestamps
+ in *ST, in case this platform suffers from the Solaris 11 bug where
+ tv_nsec might be negative. Return the adjusted RESULT, setting
+ errno to EOVERFLOW if normalization overflowed. This function
+ is intended to be private to this .h file. */
+_GL_STAT_TIME_INLINE int
+stat_time_normalize (int result, _GL_UNUSED struct stat *st)
+{
+#if defined __sun && defined STAT_TIMESPEC
+ if (result == 0)
+ {
+ long int timespec_hz = 1000000000;
+ short int const ts_off[] = { offsetof (struct stat, st_atim),
+ offsetof (struct stat, st_mtim),
+ offsetof (struct stat, st_ctim) };
+ int i;
+ for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
+ {
+ struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]);
+ long int q = ts->tv_nsec / timespec_hz;
+ long int r = ts->tv_nsec % timespec_hz;
+ if (r < 0)
+ {
+ r += timespec_hz;
+ q--;
+ }
+ ts->tv_nsec = r;
+ /* Overflow is possible, as Solaris 11 stat can yield
+ tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000.
+ INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */
+ if (ckd_add (&ts->tv_sec, q, ts->tv_sec))
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ }
+ }
+#endif
+ return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif
diff --git a/gl/stat-w32.c b/gl/stat-w32.c
new file mode 100644
index 0000000..2f01197
--- /dev/null
+++ b/gl/stat-w32.c
@@ -0,0 +1,460 @@
+/* Core of implementation of fstat and stat for native Windows.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible. */
+
+#include <config.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Attempt to make <windows.h> define FILE_ID_INFO.
+ But ensure that the redefinition of _WIN32_WINNT does not make us assume
+ Windows Vista or newer when building for an older version of Windows. */
+#if HAVE_SDKDDKVER_H
+# include <sdkddkver.h>
+# if _WIN32_WINNT >= _WIN32_WINNT_VISTA
+# define WIN32_ASSUME_VISTA 1
+# else
+# define WIN32_ASSUME_VISTA 0
+# endif
+# if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN8)
+# undef _WIN32_WINNT
+# define _WIN32_WINNT _WIN32_WINNT_WIN8
+# endif
+#else
+# define WIN32_ASSUME_VISTA (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+#include <windows.h>
+
+/* Specification. */
+#include "stat-w32.h"
+
+#include "pathmax.h"
+
+/* Don't assume that UNICODE is not defined. */
+#undef LoadLibrary
+#define LoadLibrary LoadLibraryA
+#undef GetFinalPathNameByHandle
+#define GetFinalPathNameByHandle GetFinalPathNameByHandleA
+
+/* Older mingw headers do not define VOLUME_NAME_NONE. */
+#ifndef VOLUME_NAME_NONE
+# define VOLUME_NAME_NONE 4
+#endif
+
+#if !WIN32_ASSUME_VISTA
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
+# if _GL_WINDOWS_STAT_INODES == 2
+/* GetFileInformationByHandleEx was introduced only in Windows Vista. */
+typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile,
+ FILE_INFO_BY_HANDLE_CLASS fiClass,
+ LPVOID lpBuffer,
+ DWORD dwBufferSize);
+static GetFileInformationByHandleExFuncType GetFileInformationByHandleExFunc = NULL;
+# endif
+/* GetFinalPathNameByHandle was introduced only in Windows Vista. */
+typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile,
+ LPSTR lpFilePath,
+ DWORD lenFilePath,
+ DWORD dwFlags);
+static GetFinalPathNameByHandleFuncType GetFinalPathNameByHandleFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+ HMODULE kernel32 = LoadLibrary ("kernel32.dll");
+ if (kernel32 != NULL)
+ {
+# if _GL_WINDOWS_STAT_INODES == 2
+ GetFileInformationByHandleExFunc =
+ (GetFileInformationByHandleExFuncType) GetProcAddress (kernel32, "GetFileInformationByHandleEx");
+# endif
+ GetFinalPathNameByHandleFunc =
+ (GetFinalPathNameByHandleFuncType) GetProcAddress (kernel32, "GetFinalPathNameByHandleA");
+ }
+ initialized = TRUE;
+}
+
+#else
+
+# define GetFileInformationByHandleExFunc GetFileInformationByHandleEx
+# define GetFinalPathNameByHandleFunc GetFinalPathNameByHandle
+
+#endif
+
+/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */
+#if _GL_WINDOWS_STAT_TIMESPEC
+struct timespec
+_gl_convert_FILETIME_to_timespec (const FILETIME *ft)
+{
+ struct timespec result;
+ /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ unsigned long long since_1601 =
+ ((unsigned long long) ft->dwHighDateTime << 32)
+ | (unsigned long long) ft->dwLowDateTime;
+ if (since_1601 == 0)
+ {
+ result.tv_sec = 0;
+ result.tv_nsec = 0;
+ }
+ else
+ {
+ /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89
+ leap years, in total 134774 days. */
+ unsigned long long since_1970 =
+ since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000;
+ result.tv_sec = since_1970 / (unsigned long long) 10000000;
+ result.tv_nsec = (unsigned long) (since_1970 % (unsigned long long) 10000000) * 100;
+ }
+ return result;
+}
+#else
+time_t
+_gl_convert_FILETIME_to_POSIX (const FILETIME *ft)
+{
+ /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ unsigned long long since_1601 =
+ ((unsigned long long) ft->dwHighDateTime << 32)
+ | (unsigned long long) ft->dwLowDateTime;
+ if (since_1601 == 0)
+ return 0;
+ else
+ {
+ /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89
+ leap years, in total 134774 days. */
+ unsigned long long since_1970 =
+ since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000;
+ return since_1970 / (unsigned long long) 10000000;
+ }
+}
+#endif
+
+/* Fill *BUF with information about the file designated by H.
+ PATH is the file name, if known, otherwise NULL.
+ Return 0 if successful, or -1 with errno set upon failure. */
+int
+_gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
+{
+ /* GetFileType
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletype> */
+ DWORD type = GetFileType (h);
+ if (type == FILE_TYPE_DISK)
+ {
+#if !WIN32_ASSUME_VISTA
+ if (!initialized)
+ initialize ();
+#endif
+
+ /* st_mode can be determined through
+ GetFileAttributesEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+ or through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileBasicInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ BY_HANDLE_FILE_INFORMATION info;
+ if (! GetFileInformationByHandle (h, &info))
+ goto failed;
+
+ /* Test for error conditions before starting to fill *buf. */
+ if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0)
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+#if _GL_WINDOWS_STAT_INODES
+ /* st_ino can be determined through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ as 64 bits, or through
+ GetFileInformationByHandleEx with argument FileIdInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_id_info>
+ as 128 bits.
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_WIN8 or higher. */
+ /* Experiments show that GetFileInformationByHandleEx does not provide
+ much more information than GetFileInformationByHandle:
+ * The dwVolumeSerialNumber from GetFileInformationByHandle is equal
+ to the low 32 bits of the 64-bit VolumeSerialNumber from
+ GetFileInformationByHandleEx, and is apparently sufficient for
+ identifying the device.
+ * The nFileIndex from GetFileInformationByHandle is equal to the low
+ 64 bits of the 128-bit FileId from GetFileInformationByHandleEx,
+ and the high 64 bits of this 128-bit FileId are zero.
+ * On a FAT file system, GetFileInformationByHandleEx fails with error
+ ERROR_INVALID_PARAMETER, whereas GetFileInformationByHandle
+ succeeds.
+ * On a CIFS/SMB file system, GetFileInformationByHandleEx fails with
+ error ERROR_INVALID_LEVEL, whereas GetFileInformationByHandle
+ succeeds. */
+# if _GL_WINDOWS_STAT_INODES == 2
+ if (GetFileInformationByHandleExFunc != NULL)
+ {
+ FILE_ID_INFO id;
+ if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id)))
+ {
+ buf->st_dev = id.VolumeSerialNumber;
+ static_assert (sizeof (ino_t) == sizeof (id.FileId));
+ memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t));
+ goto ino_done;
+ }
+ else
+ {
+ switch (GetLastError ())
+ {
+ case ERROR_INVALID_PARAMETER: /* older Windows version, or FAT */
+ case ERROR_INVALID_LEVEL: /* CIFS/SMB file system */
+ goto fallback;
+ default:
+ goto failed;
+ }
+ }
+ }
+ fallback: ;
+ /* Fallback for older Windows versions. */
+ buf->st_dev = info.dwVolumeSerialNumber;
+ buf->st_ino._gl_ino[0] = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow;
+ buf->st_ino._gl_ino[1] = 0;
+ ino_done: ;
+# else /* _GL_WINDOWS_STAT_INODES == 1 */
+ buf->st_dev = info.dwVolumeSerialNumber;
+ buf->st_ino = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow;
+# endif
+#else
+ /* st_ino is not wide enough for identifying a file on a device.
+ Without st_ino, st_dev is pointless. */
+ buf->st_dev = 0;
+ buf->st_ino = 0;
+#endif
+
+ /* st_mode. */
+ unsigned int mode =
+ /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ? */
+ ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG)
+ | S_IREAD_UGO
+ | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO);
+ if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ /* Determine whether the file is executable by looking at the file
+ name suffix.
+ If the file name is already known, use it. Otherwise, for
+ non-empty files, it can be determined through
+ GetFinalPathNameByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea>
+ or through
+ GetFileInformationByHandleEx with argument FileNameInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_name_info>
+ Both require -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0)
+ {
+ char fpath[PATH_MAX];
+ if (path != NULL
+ || (GetFinalPathNameByHandleFunc != NULL
+ && GetFinalPathNameByHandleFunc (h, fpath, sizeof (fpath), VOLUME_NAME_NONE)
+ < sizeof (fpath)
+ && (path = fpath, 1)))
+ {
+ const char *last_dot = NULL;
+ const char *p;
+ for (p = path; *p != '\0'; p++)
+ if (*p == '.')
+ last_dot = p;
+ if (last_dot != NULL)
+ {
+ const char *suffix = last_dot + 1;
+ if (_stricmp (suffix, "exe") == 0
+ || _stricmp (suffix, "bat") == 0
+ || _stricmp (suffix, "cmd") == 0
+ || _stricmp (suffix, "com") == 0)
+ mode |= S_IEXEC_UGO;
+ }
+ }
+ else
+ /* Cannot determine file name. Pretend that it is executable. */
+ mode |= S_IEXEC_UGO;
+ }
+ }
+ buf->st_mode = mode;
+
+ /* st_nlink can be determined through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileStandardInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ buf->st_nlink = (info.nNumberOfLinks > SHRT_MAX ? SHRT_MAX : info.nNumberOfLinks);
+
+ /* There's no easy way to map the Windows SID concept to an integer. */
+ buf->st_uid = 0;
+ buf->st_gid = 0;
+
+ /* st_rdev is irrelevant for normal files and directories. */
+ buf->st_rdev = 0;
+
+ /* st_size can be determined through
+ GetFileSizeEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfilesizeex>
+ or through
+ GetFileAttributesEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+ or through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileStandardInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+ if (sizeof (buf->st_size) <= 4)
+ /* Range check already done above. */
+ buf->st_size = info.nFileSizeLow;
+ else
+ buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow;
+
+ /* st_atime, st_mtime, st_ctime can be determined through
+ GetFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletime>
+ or through
+ GetFileAttributesEx
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+ or through
+ GetFileInformationByHandle
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+ or through
+ GetFileInformationByHandleEx with argument FileBasicInfo
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info>
+ The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher. */
+#if _GL_WINDOWS_STAT_TIMESPEC
+ buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime);
+ buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime);
+ buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime);
+#else
+ buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime);
+ buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime);
+ buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime);
+#endif
+
+ return 0;
+ }
+ else if (type == FILE_TYPE_CHAR || type == FILE_TYPE_PIPE)
+ {
+ buf->st_dev = 0;
+#if _GL_WINDOWS_STAT_INODES == 2
+ buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0;
+#else
+ buf->st_ino = 0;
+#endif
+ buf->st_mode = (type == FILE_TYPE_PIPE ? _S_IFIFO : _S_IFCHR);
+ buf->st_nlink = 1;
+ buf->st_uid = 0;
+ buf->st_gid = 0;
+ buf->st_rdev = 0;
+ if (type == FILE_TYPE_PIPE)
+ {
+ /* PeekNamedPipe
+ <https://msdn.microsoft.com/en-us/library/aa365779.aspx> */
+ DWORD bytes_available;
+ if (PeekNamedPipe (h, NULL, 0, NULL, &bytes_available, NULL))
+ buf->st_size = bytes_available;
+ else
+ buf->st_size = 0;
+ }
+ else
+ buf->st_size = 0;
+#if _GL_WINDOWS_STAT_TIMESPEC
+ buf->st_atim.tv_sec = 0; buf->st_atim.tv_nsec = 0;
+ buf->st_mtim.tv_sec = 0; buf->st_mtim.tv_nsec = 0;
+ buf->st_ctim.tv_sec = 0; buf->st_ctim.tv_nsec = 0;
+#else
+ buf->st_atime = 0;
+ buf->st_mtime = 0;
+ buf->st_ctime = 0;
+#endif
+ return 0;
+ }
+ else
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
+ failed:
+ {
+ DWORD error = GetLastError ();
+ #if 0
+ fprintf (stderr, "_gl_fstat_by_handle error 0x%x\n", (unsigned int) error);
+ #endif
+ switch (error)
+ {
+ case ERROR_ACCESS_DENIED:
+ case ERROR_SHARING_VIOLATION:
+ errno = EACCES;
+ break;
+
+ case ERROR_OUTOFMEMORY:
+ errno = ENOMEM;
+ break;
+
+ case ERROR_WRITE_FAULT:
+ case ERROR_READ_FAULT:
+ case ERROR_GEN_FAILURE:
+ errno = EIO;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+ return -1;
+ }
+}
+
+#else
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#endif
diff --git a/gl/stat-w32.h b/gl/stat-w32.h
new file mode 100644
index 0000000..c673874
--- /dev/null
+++ b/gl/stat-w32.h
@@ -0,0 +1,37 @@
+/* Core of implementation of fstat and stat for native Windows.
+ Copyright (C) 2017-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _STAT_W32_H
+#define _STAT_W32_H 1
+
+/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */
+#if _GL_WINDOWS_STAT_TIMESPEC
+extern struct timespec _gl_convert_FILETIME_to_timespec (const FILETIME *ft);
+#else
+extern time_t _gl_convert_FILETIME_to_POSIX (const FILETIME *ft);
+#endif
+
+/* Fill *BUF with information about the file designated by H.
+ PATH is the file name, if known, otherwise NULL.
+ Return 0 if successful, or -1 with errno set upon failure. */
+extern int _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf);
+
+/* Bitmasks for st_mode. */
+#define S_IREAD_UGO (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6))
+#define S_IWRITE_UGO (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
+#define S_IEXEC_UGO (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6))
+
+#endif /* _STAT_W32_H */
diff --git a/gl/stat.c b/gl/stat.c
new file mode 100644
index 0000000..7987e26
--- /dev/null
+++ b/gl/stat.c
@@ -0,0 +1,438 @@
+/* Work around platform bugs in stat.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake and Bruno Haible. */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_stat doesn't recurse to
+ rpl_stat. */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of stat. It might be defined as a macro. */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+#endif
+
+#if !defined WINDOWS_NATIVE
+
+static int
+orig_stat (const char *filename, struct stat *buf)
+{
+ return stat (filename, buf);
+}
+
+#endif
+
+/* Specification. */
+#ifdef __osf__
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+ eliminates this include because of the preliminary #include <sys/stat.h>
+ above. */
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
+#endif
+
+#include "stat-time.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
+#include "filename.h"
+#include "malloca.h"
+
+#ifdef WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# include "stat-w32.h"
+/* Don't assume that UNICODE is not defined. */
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef CreateFile
+# define CreateFile CreateFileA
+# undef FindFirstFile
+# define FindFirstFile FindFirstFileA
+#endif
+
+#ifdef WINDOWS_NATIVE
+/* Return TRUE if the given file name denotes an UNC root. */
+static BOOL
+is_unc_root (const char *rname)
+{
+ /* Test whether it has the syntax '\\server\share'. */
+ if (ISSLASH (rname[0]) && ISSLASH (rname[1]))
+ {
+ /* It starts with two slashes. Find the next slash. */
+ const char *p = rname + 2;
+ const char *q = p;
+ while (*q != '\0' && !ISSLASH (*q))
+ q++;
+ if (q > p && *q != '\0')
+ {
+ /* Found the next slash at q. */
+ q++;
+ const char *r = q;
+ while (*r != '\0' && !ISSLASH (*r))
+ r++;
+ if (r > q && *r == '\0')
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+#endif
+
+/* Store information about NAME into ST. Work around bugs with
+ trailing slashes. Mingw has other bugs (such as st_ino always
+ being 0 on success) which this wrapper does not work around. But
+ at least this implementation provides the ability to emulate fchdir
+ correctly. */
+
+int
+rpl_stat (char const *name, struct stat *buf)
+{
+#ifdef WINDOWS_NATIVE
+ /* Fill the fields ourselves, because the original stat function returns
+ values for st_atime, st_mtime, st_ctime that depend on the current time
+ zone. See
+ <https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html> */
+ /* XXX Should we convert to wchar_t* and prepend '\\?\', in order to work
+ around length limitations
+ <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ? */
+
+ /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
+ specifies: "More than two leading <slash> characters shall be treated as
+ a single <slash> character." */
+ if (ISSLASH (name[0]) && ISSLASH (name[1]) && ISSLASH (name[2]))
+ {
+ name += 2;
+ while (ISSLASH (name[1]))
+ name++;
+ }
+
+ size_t len = strlen (name);
+ size_t drive_prefix_len = (HAS_DEVICE (name) ? 2 : 0);
+
+ /* Remove trailing slashes (except the very first one, at position
+ drive_prefix_len), but remember their presence. */
+ size_t rlen;
+ bool check_dir = false;
+
+ rlen = len;
+ while (rlen > drive_prefix_len && ISSLASH (name[rlen-1]))
+ {
+ check_dir = true;
+ if (rlen == drive_prefix_len + 1)
+ break;
+ rlen--;
+ }
+
+ /* Handle '' and 'C:'. */
+ if (!check_dir && rlen == drive_prefix_len)
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
+ /* Handle '\\'. */
+ if (rlen == 1 && ISSLASH (name[0]) && len >= 2)
+ {
+ errno = ENOENT;
+ return -1;
+ }
+
+ const char *rname;
+ char *malloca_rname;
+ if (rlen == len)
+ {
+ rname = name;
+ malloca_rname = NULL;
+ }
+ else
+ {
+ malloca_rname = malloca (rlen + 1);
+ if (malloca_rname == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ memcpy (malloca_rname, name, rlen);
+ malloca_rname[rlen] = '\0';
+ rname = malloca_rname;
+ }
+
+ /* There are two ways to get at the requested information:
+ - by scanning the parent directory and examining the relevant
+ directory entry,
+ - by opening the file directly.
+ The first approach fails for root directories (e.g. 'C:\') and
+ UNC root directories (e.g. '\\server\share').
+ The second approach fails for some system files (e.g. 'C:\pagefile.sys'
+ and 'C:\hiberfil.sys'): ERROR_SHARING_VIOLATION.
+ The second approach gives more information (in particular, correct
+ st_dev, st_ino, st_nlink fields).
+ So we use the second approach and, as a fallback except for root and
+ UNC root directories, also the first approach. */
+ {
+ int ret;
+
+ {
+ /* Approach based on the file. */
+
+ /* Open a handle to the file.
+ CreateFile
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea>
+ <https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files> */
+ HANDLE h =
+ CreateFile (rname,
+ FILE_READ_ATTRIBUTES,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL,
+ OPEN_EXISTING,
+ /* FILE_FLAG_POSIX_SEMANTICS (treat file names that differ only
+ in case as different) makes sense only when applied to *all*
+ filesystem operations. */
+ FILE_FLAG_BACKUP_SEMANTICS /* | FILE_FLAG_POSIX_SEMANTICS */,
+ NULL);
+ if (h != INVALID_HANDLE_VALUE)
+ {
+ ret = _gl_fstat_by_handle (h, rname, buf);
+ CloseHandle (h);
+ goto done;
+ }
+ }
+
+ /* Test for root and UNC root directories. */
+ if ((rlen == drive_prefix_len + 1 && ISSLASH (rname[drive_prefix_len]))
+ || is_unc_root (rname))
+ goto failed;
+
+ /* Fallback. */
+ {
+ /* Approach based on the directory entry. */
+
+ if (strchr (rname, '?') != NULL || strchr (rname, '*') != NULL)
+ {
+ /* Other Windows API functions would fail with error
+ ERROR_INVALID_NAME. */
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+ errno = ENOENT;
+ return -1;
+ }
+
+ /* Get the details about the directory entry. This can be done through
+ FindFirstFile
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa>
+ or through
+ FindFirstFileEx with argument FindExInfoBasic
+ <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexa>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ne-minwinbase-findex_info_levels>
+ <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa> */
+ WIN32_FIND_DATA info;
+ HANDLE h = FindFirstFile (rname, &info);
+ if (h == INVALID_HANDLE_VALUE)
+ goto failed;
+
+ /* Test for error conditions before starting to fill *buf. */
+ if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0)
+ {
+ FindClose (h);
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+# if _GL_WINDOWS_STAT_INODES
+ buf->st_dev = 0;
+# if _GL_WINDOWS_STAT_INODES == 2
+ buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0;
+# else /* _GL_WINDOWS_STAT_INODES == 1 */
+ buf->st_ino = 0;
+# endif
+# else
+ /* st_ino is not wide enough for identifying a file on a device.
+ Without st_ino, st_dev is pointless. */
+ buf->st_dev = 0;
+ buf->st_ino = 0;
+# endif
+
+ /* st_mode. */
+ unsigned int mode =
+ /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ? */
+ ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG)
+ | S_IREAD_UGO
+ | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO);
+ if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ /* Determine whether the file is executable by looking at the file
+ name suffix. */
+ if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0)
+ {
+ const char *last_dot = NULL;
+ const char *p;
+ for (p = info.cFileName; *p != '\0'; p++)
+ if (*p == '.')
+ last_dot = p;
+ if (last_dot != NULL)
+ {
+ const char *suffix = last_dot + 1;
+ if (_stricmp (suffix, "exe") == 0
+ || _stricmp (suffix, "bat") == 0
+ || _stricmp (suffix, "cmd") == 0
+ || _stricmp (suffix, "com") == 0)
+ mode |= S_IEXEC_UGO;
+ }
+ }
+ }
+ buf->st_mode = mode;
+
+ /* st_nlink. Ignore hard links here. */
+ buf->st_nlink = 1;
+
+ /* There's no easy way to map the Windows SID concept to an integer. */
+ buf->st_uid = 0;
+ buf->st_gid = 0;
+
+ /* st_rdev is irrelevant for normal files and directories. */
+ buf->st_rdev = 0;
+
+ /* st_size. */
+ if (sizeof (buf->st_size) <= 4)
+ /* Range check already done above. */
+ buf->st_size = info.nFileSizeLow;
+ else
+ buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow;
+
+ /* st_atime, st_mtime, st_ctime. */
+# if _GL_WINDOWS_STAT_TIMESPEC
+ buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime);
+ buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime);
+ buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime);
+# else
+ buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime);
+ buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime);
+ buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime);
+# endif
+
+ FindClose (h);
+
+ ret = 0;
+ }
+
+ done:
+ if (ret >= 0 && check_dir && !S_ISDIR (buf->st_mode))
+ {
+ errno = ENOTDIR;
+ ret = -1;
+ }
+ if (malloca_rname != NULL)
+ {
+ int saved_errno = errno;
+ freea (malloca_rname);
+ errno = saved_errno;
+ }
+ return ret;
+ }
+
+ failed:
+ {
+ DWORD error = GetLastError ();
+ #if 0
+ fprintf (stderr, "rpl_stat error 0x%x\n", (unsigned int) error);
+ #endif
+
+ if (malloca_rname != NULL)
+ freea (malloca_rname);
+
+ switch (error)
+ {
+ /* Some of these errors probably cannot happen with the specific flags
+ that we pass to CreateFile. But who knows... */
+ case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist. */
+ case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist. */
+ case ERROR_BAD_PATHNAME: /* rname is such as '\\server'. */
+ case ERROR_BAD_NET_NAME: /* rname is such as '\\server\nonexistentshare'. */
+ case ERROR_INVALID_NAME: /* rname contains wildcards, misplaced colon, etc. */
+ case ERROR_DIRECTORY:
+ errno = ENOENT;
+ break;
+
+ case ERROR_ACCESS_DENIED: /* rname is such as 'C:\System Volume Information\foo'. */
+ case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys' (second approach only). */
+ /* XXX map to EACCES or EPERM? */
+ errno = EACCES;
+ break;
+
+ case ERROR_OUTOFMEMORY:
+ errno = ENOMEM;
+ break;
+
+ case ERROR_WRITE_PROTECT:
+ errno = EROFS;
+ break;
+
+ case ERROR_WRITE_FAULT:
+ case ERROR_READ_FAULT:
+ case ERROR_GEN_FAILURE:
+ errno = EIO;
+ break;
+
+ case ERROR_BUFFER_OVERFLOW:
+ case ERROR_FILENAME_EXCED_RANGE:
+ errno = ENAMETOOLONG;
+ break;
+
+ case ERROR_DELETE_PENDING: /* XXX map to EACCES or EPERM? */
+ errno = EPERM;
+ break;
+
+ default:
+ errno = EINVAL;
+ break;
+ }
+
+ return -1;
+ }
+#else
+ int result = orig_stat (name, buf);
+ if (result == 0)
+ {
+# if REPLACE_FUNC_STAT_FILE
+ /* Solaris 9 mistakenly succeeds when given a non-directory with a
+ trailing slash. */
+ if (!S_ISDIR (buf->st_mode))
+ {
+ size_t len = strlen (name);
+ if (ISSLASH (name[len - 1]))
+ {
+ errno = ENOTDIR;
+ return -1;
+ }
+ }
+# endif /* REPLACE_FUNC_STAT_FILE */
+ result = stat_time_normalize (result, buf);
+ }
+ return result;
+#endif
+}
diff --git a/gl/stdalign.in.h b/gl/stdalign.in.h
new file mode 100644
index 0000000..7f9dbb4
--- /dev/null
+++ b/gl/stdalign.in.h
@@ -0,0 +1,137 @@
+/* A substitute for ISO C11 <stdalign.h>.
+
+ Copyright 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert and Bruno Haible. */
+
+#ifndef _GL_STDALIGN_H
+#define _GL_STDALIGN_H
+
+/* ISO C11 <stdalign.h> for platforms that lack it.
+
+ References:
+ ISO C11 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
+ sections 6.5.3.4, 6.7.5, 7.15.
+ C++11 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
+ section 18.10. */
+
+/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
+ requirement of a structure member (i.e., slot or field) that is of
+ type TYPE, as an integer constant expression.
+
+ This differs from GCC's and clang's __alignof__ operator, which can
+ yield a better-performing alignment for an object of that type. For
+ example, on x86 with GCC and on Linux/x86 with clang,
+ __alignof__ (double) and __alignof__ (long long) are 8, whereas
+ alignof (double) and alignof (long long) are 4 unless the option
+ '-malign-double' is used.
+
+ The result cannot be used as a value for an 'enum' constant, if you
+ want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
+
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
+ standard headers, defines conflicting implementations of _Alignas
+ and _Alignof that are no better than ours; override them. */
+#undef _Alignas
+#undef _Alignof
+
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ clang versions < 8.0.0 have the same bug. */
+#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# ifdef __cplusplus
+# if (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignof(type) alignof (type)
+# else
+ template <class __t> struct __alignof_helper { char __a; __t __b; };
+# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# else
+# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
+# define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+# else
+# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# endif
+#endif
+#if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))
+# define alignof _Alignof
+#endif
+#define __alignof_is_defined 1
+
+/* alignas (A), also known as _Alignas (A), aligns a variable or type
+ to the alignment A, where A is an integer constant expression. For
+ example:
+
+ int alignas (8) foo;
+ struct s { int a; int alignas (8) bar; };
+
+ aligns the address of FOO and the offset of BAR to be multiples of 8.
+
+ A should be a power of two that is at least the type's alignment
+ and at most the implementation's alignment limit. This limit is
+ 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
+ to MSVC through at least version 10.0, A should be an integer
+ constant, as MSVC does not support expressions such as 1 << 3.
+ To be portable to Sun C 5.11, do not align auto variables to
+ anything stricter than their default alignment.
+
+ The following C11 requirements are not supported here:
+
+ - If A is zero, alignas has no effect.
+ - alignas can be used multiple times; the strictest one wins.
+ - alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
+
+ */
+
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignas(a) alignas (a)
+# elif (!defined __attribute__ \
+ && ((defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__ && !defined __ibmxl__) \
+ || (4 <= __clang_major__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
+# define _Alignas(a) __attribute__ ((__aligned__ (a)))
+# elif 1300 <= _MSC_VER
+# define _Alignas(a) __declspec (align (a))
+# endif
+#endif
+#if ((defined _Alignas \
+ && !(defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# define alignas _Alignas
+#endif
+#if (defined alignas \
+ || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)))
+# define __alignas_is_defined 1
+#endif
+
+/* Include <stddef.h> if needed for offsetof. */
+#if _GL_STDALIGN_NEEDS_STDDEF
+# include <stddef.h>
+#endif
+
+#endif /* _GL_STDALIGN_H */
diff --git a/gl/stdckdint.in.h b/gl/stdckdint.in.h
new file mode 100644
index 0000000..71bab5f
--- /dev/null
+++ b/gl/stdckdint.in.h
@@ -0,0 +1,35 @@
+/* stdckdint.h -- checked integer arithmetic
+
+ Copyright 2022-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_STDCKDINT_H
+#define _GL_STDCKDINT_H
+
+#include "intprops-internal.h"
+
+/* Store into *R the low-order bits of A + B, A - B, A * B, respectively.
+ Return 1 if the result overflows, 0 otherwise.
+ A, B, and *R can have any integer type other than char, bool, a
+ bit-precise integer type, or an enumeration type.
+
+ These are like the standard macros introduced in C23, except that
+ arguments should not have side effects. */
+
+#define ckd_add(r, a, b) ((bool) _GL_INT_ADD_WRAPV (a, b, r))
+#define ckd_sub(r, a, b) ((bool) _GL_INT_SUBTRACT_WRAPV (a, b, r))
+#define ckd_mul(r, a, b) ((bool) _GL_INT_MULTIPLY_WRAPV (a, b, r))
+
+#endif /* _GL_STDCKDINT_H */
diff --git a/gl/stddef.in.h b/gl/stddef.in.h
new file mode 100644
index 0000000..6eadcc3
--- /dev/null
+++ b/gl/stddef.in.h
@@ -0,0 +1,147 @@
+/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
+
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake. */
+
+/*
+ * POSIX 2008 <stddef.h> for platforms that have issues.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html>
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_wchar_t || defined __need_size_t \
+ || defined __need_ptrdiff_t || defined __need_NULL \
+ || defined __need_wint_t
+/* Special invocation convention inside gcc header files. In
+ particular, gcc provides a version of <stddef.h> that blindly
+ redefines NULL even when __need_wint_t was defined, even though
+ wint_t is not normally provided by <stddef.h>. Hence, we must
+ remember if special invocation has ever been used to obtain wint_t,
+ in which case we need to clean up NULL yet again. */
+
+# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
+# ifdef __need_wint_t
+# define _GL_STDDEF_WINT_T
+# endif
+# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+ /* On TinyCC, make sure that the macros that indicate the special invocation
+ convention get undefined. */
+# undef __need_wchar_t
+# undef __need_size_t
+# undef __need_ptrdiff_t
+# undef __need_NULL
+# undef __need_wint_t
+# endif
+
+#else
+/* Normal invocation convention. */
+
+# ifndef _@GUARD_PREFIX@_STDDEF_H
+
+/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a
+ type with alignment 4, but 'long' has alignment 8. */
+# if defined _AIX && defined __LP64__
+# if !GNULIB_defined_max_align_t
+# ifdef _MAX_ALIGN_T
+/* /usr/include/stddef.h has already defined max_align_t. Override it. */
+typedef long rpl_max_align_t;
+# define max_align_t rpl_max_align_t
+# else
+/* Prevent /usr/include/stddef.h from defining max_align_t. */
+typedef long max_align_t;
+# define _MAX_ALIGN_T
+# endif
+# define GNULIB_defined_max_align_t 1
+# endif
+# endif
+
+/* The include_next requires a split double-inclusion guard. */
+
+# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+
+/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
+# if (@REPLACE_NULL@ \
+ && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T))
+# undef NULL
+# ifdef __cplusplus
+ /* ISO C++ says that the macro NULL must expand to an integer constant
+ expression, hence '((void *) 0)' is not allowed in C++. */
+# if __GNUG__ >= 3
+ /* GNU C++ has a __null macro that behaves like an integer ('int' or
+ 'long') but has the same size as a pointer. Use that, to avoid
+ warnings. */
+# define NULL __null
+# else
+# define NULL 0L
+# endif
+# else
+# define NULL ((void *) 0)
+# endif
+# endif
+
+# ifndef _@GUARD_PREFIX@_STDDEF_H
+# define _@GUARD_PREFIX@_STDDEF_H
+
+/* Some platforms lack wchar_t. */
+#if !@HAVE_WCHAR_T@
+# define wchar_t int
+#endif
+
+/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is
+ a hack in case the configure-time test was done with g++ even though
+ we are currently compiling with gcc.
+ On MSVC, max_align_t is defined only in C++ mode, after <cstddef> was
+ included. Its definition is good since it has an alignment of 8 (on x86
+ and x86_64).
+ Similarly on OS/2 kLIBC. */
+#if (defined _MSC_VER || (defined __KLIBC__ && !defined __LIBCN__)) \
+ && defined __cplusplus
+# include <cstddef>
+#else
+# if ! (@HAVE_MAX_ALIGN_T@ || (defined _GCC_MAX_ALIGN_T && !defined __clang__))
+# if !GNULIB_defined_max_align_t
+/* On the x86, the maximum storage alignment of double, long, etc. is 4,
+ but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
+ and the C11 standard allows this. Work around this problem by
+ using __alignof__ (which returns 8 for double) rather than _Alignof
+ (which returns 4), and align each union member accordingly. */
+# if defined __GNUC__ || (__clang_major__ >= 4)
+# define _GL_STDDEF_ALIGNAS(type) \
+ __attribute__ ((__aligned__ (__alignof__ (type))))
+# else
+# define _GL_STDDEF_ALIGNAS(type) /* */
+# endif
+typedef union
+{
+ char *__p _GL_STDDEF_ALIGNAS (char *);
+ double __d _GL_STDDEF_ALIGNAS (double);
+ long double __ld _GL_STDDEF_ALIGNAS (long double);
+ long int __i _GL_STDDEF_ALIGNAS (long int);
+} rpl_max_align_t;
+# define max_align_t rpl_max_align_t
+# define GNULIB_defined_max_align_t 1
+# endif
+# endif
+#endif
+
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
+#endif /* __need_XXX */
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
new file mode 100644
index 0000000..5ddc644
--- /dev/null
+++ b/gl/stdint.in.h
@@ -0,0 +1,740 @@
+/* Copyright (C) 2001-2002, 2004-2023 Free Software Foundation, Inc.
+ Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
+ This file is part of gnulib.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C 99 <stdint.h> for platforms that lack it.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html>
+ */
+
+#ifndef _@GUARD_PREFIX@_STDINT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* When including a system file that in turn includes <inttypes.h>,
+ use the system <inttypes.h>, not our substitute. This avoids
+ problems with (for example) VMS, whose <sys/bitypes.h> includes
+ <inttypes.h>. */
+#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+
+/* On Android (Bionic libc), <sys/types.h> includes this file before
+ having defined 'time_t'. Therefore in this case avoid including
+ other system header files; just include the system's <stdint.h>.
+ Ideally we should test __BIONIC__ here, but it is only defined after
+ <sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
+#if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#else
+
+/* Get those types that are already defined in other system include
+ files, so that we can "#define int8_t signed char" below without
+ worrying about a later system include file containing a "typedef
+ signed char int8_t;" that will get messed up by our macro. Our
+ macros should all be consistent with the system versions, except
+ for the "fast" types and macros, which we recommend against using
+ in public interfaces due to compiler differences. */
+
+#if @HAVE_STDINT_H@
+# if defined __sgi && ! defined __c99
+ /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
+ with "This header file is to be used only for c99 mode compilations"
+ diagnostics. */
+# define __STDINT_H__
+# endif
+
+ /* Some pre-C++11 <stdint.h> implementations need this. */
+# ifdef __cplusplus
+# ifndef __STDC_CONSTANT_MACROS
+# define __STDC_CONSTANT_MACROS 1
+# endif
+# ifndef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS 1
+# endif
+# endif
+
+ /* Other systems may have an incomplete or buggy <stdint.h>.
+ Include it before <inttypes.h>, since any "#include <stdint.h>"
+ in <inttypes.h> would reinclude us, skipping our contents because
+ _@GUARD_PREFIX@_STDINT_H is defined.
+ The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#endif
+
+#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+#define _@GUARD_PREFIX@_STDINT_H
+
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+ LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */
+#include <limits.h>
+
+/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
+ wint_t. */
+#if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# undef WINT_MIN
+# undef WINT_MAX
+# define WINT_MIN 0x0U
+# define WINT_MAX 0xffffffffU
+#endif
+
+#if ! @HAVE_C99_STDINT_H@
+
+/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
+ IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
+ AIX 5.2 <sys/types.h> isn't needed and causes troubles.
+ Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
+ relies on the system <stdint.h> definitions, so include
+ <sys/types.h> after @NEXT_STDINT_H@. */
+# if @HAVE_SYS_TYPES_H@ && ! defined _AIX
+# include <sys/types.h>
+# endif
+
+# if @HAVE_INTTYPES_H@
+ /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
+ int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
+ <inttypes.h> also defines intptr_t and uintptr_t. */
+# include <inttypes.h>
+# elif @HAVE_SYS_INTTYPES_H@
+ /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
+ the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
+# include <sys/inttypes.h>
+# endif
+
+# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
+ /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
+ int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
+ included by <sys/types.h>. */
+# include <sys/bitypes.h>
+# endif
+
+# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+
+/* Minimum and maximum values for an integer type under the usual assumption.
+ Return an unspecified value if BITS == 0, adding a check to pacify
+ picky compilers. */
+
+/* These are separate macros, because if you try to merge these macros into
+ a single one, HP-UX cc rejects the resulting expression in constant
+ expressions. */
+# define _STDINT_UNSIGNED_MIN(bits, zero) \
+ (zero)
+# define _STDINT_SIGNED_MIN(bits, zero) \
+ (~ _STDINT_MAX (1, bits, zero))
+
+# define _STDINT_MAX(signed, bits, zero) \
+ (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+
+#if !GNULIB_defined_stdint_types
+
+/* 7.18.1.1. Exact-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. */
+
+# undef int8_t
+# undef uint8_t
+typedef signed char gl_int8_t;
+typedef unsigned char gl_uint8_t;
+# define int8_t gl_int8_t
+# define uint8_t gl_uint8_t
+
+# undef int16_t
+# undef uint16_t
+typedef short int gl_int16_t;
+typedef unsigned short int gl_uint16_t;
+# define int16_t gl_int16_t
+# define uint16_t gl_uint16_t
+
+# undef int32_t
+# undef uint32_t
+typedef int gl_int32_t;
+typedef unsigned int gl_uint32_t;
+# define int32_t gl_int32_t
+# define uint32_t gl_uint32_t
+
+/* If the system defines INT64_MAX, assume int64_t works. That way,
+ if the underlying platform defines int64_t to be a 64-bit long long
+ int, the code below won't mistakenly define it to be a 64-bit long
+ int, which would mess up C++ name mangling. We must use #ifdef
+ rather than #if, to avoid an error with HP-UX 10.20 cc. */
+
+# ifdef INT64_MAX
+# define GL_INT64_T
+# else
+/* Do not undefine int64_t if gnulib is not being used with 64-bit
+ types, since otherwise it breaks platforms like Tandem/NSK. */
+# if LONG_MAX >> 31 >> 31 == 1
+# undef int64_t
+typedef long int gl_int64_t;
+# define int64_t gl_int64_t
+# define GL_INT64_T
+# elif defined _MSC_VER
+# undef int64_t
+typedef __int64 gl_int64_t;
+# define int64_t gl_int64_t
+# define GL_INT64_T
+# else
+# undef int64_t
+typedef long long int gl_int64_t;
+# define int64_t gl_int64_t
+# define GL_INT64_T
+# endif
+# endif
+
+# ifdef UINT64_MAX
+# define GL_UINT64_T
+# else
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# undef uint64_t
+typedef unsigned long int gl_uint64_t;
+# define uint64_t gl_uint64_t
+# define GL_UINT64_T
+# elif defined _MSC_VER
+# undef uint64_t
+typedef unsigned __int64 gl_uint64_t;
+# define uint64_t gl_uint64_t
+# define GL_UINT64_T
+# else
+# undef uint64_t
+typedef unsigned long long int gl_uint64_t;
+# define uint64_t gl_uint64_t
+# define GL_UINT64_T
+# endif
+# endif
+
+/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
+# define _UINT8_T
+# define _UINT32_T
+# define _UINT64_T
+
+
+/* 7.18.1.2. Minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
+ are the same as the corresponding N_t types. */
+
+# undef int_least8_t
+# undef uint_least8_t
+# undef int_least16_t
+# undef uint_least16_t
+# undef int_least32_t
+# undef uint_least32_t
+# undef int_least64_t
+# undef uint_least64_t
+# define int_least8_t int8_t
+# define uint_least8_t uint8_t
+# define int_least16_t int16_t
+# define uint_least16_t uint16_t
+# define int_least32_t int32_t
+# define uint_least32_t uint32_t
+# ifdef GL_INT64_T
+# define int_least64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+# define uint_least64_t uint64_t
+# endif
+
+/* 7.18.1.3. Fastest minimum-width integer types */
+
+/* Note: Other <stdint.h> substitutes may define these types differently.
+ It is not recommended to use these types in public header files. */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
+ are taken from the same list of types. The following code normally
+ uses types consistent with glibc, as that lessens the chance of
+ incompatibility with older GNU hosts. */
+
+# undef int_fast8_t
+# undef uint_fast8_t
+# undef int_fast16_t
+# undef uint_fast16_t
+# undef int_fast32_t
+# undef uint_fast32_t
+# undef int_fast64_t
+# undef uint_fast64_t
+typedef signed char gl_int_fast8_t;
+typedef unsigned char gl_uint_fast8_t;
+
+# ifdef __sun
+/* Define types compatible with SunOS 5.10, so that code compiled under
+ earlier SunOS versions works with code compiled under SunOS 5.10. */
+typedef int gl_int_fast32_t;
+typedef unsigned int gl_uint_fast32_t;
+# else
+typedef long int gl_int_fast32_t;
+typedef unsigned long int gl_uint_fast32_t;
+# endif
+typedef gl_int_fast32_t gl_int_fast16_t;
+typedef gl_uint_fast32_t gl_uint_fast16_t;
+
+# define int_fast8_t gl_int_fast8_t
+# define uint_fast8_t gl_uint_fast8_t
+# define int_fast16_t gl_int_fast16_t
+# define uint_fast16_t gl_uint_fast16_t
+# define int_fast32_t gl_int_fast32_t
+# define uint_fast32_t gl_uint_fast32_t
+# ifdef GL_INT64_T
+# define int_fast64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+# define uint_fast64_t uint64_t
+# endif
+
+/* 7.18.1.4. Integer types capable of holding object pointers */
+
+/* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own
+ definitions of intptr_t and uintptr_t (which use int and unsigned)
+ to avoid clashes with declarations of system functions like sbrk.
+ Similarly, MinGW WSL-5.4.1 <stdint.h> needs its own intptr_t and
+ uintptr_t to avoid conflicting declarations of system functions like
+ _findclose in <io.h>. */
+# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \
+ || defined __MINGW32__)
+# undef intptr_t
+# undef uintptr_t
+# ifdef _WIN64
+typedef long long int gl_intptr_t;
+typedef unsigned long long int gl_uintptr_t;
+# else
+typedef long int gl_intptr_t;
+typedef unsigned long int gl_uintptr_t;
+# endif
+# define intptr_t gl_intptr_t
+# define uintptr_t gl_uintptr_t
+# endif
+
+/* 7.18.1.5. Greatest-width integer types */
+
+/* Note: These types are compiler dependent. It may be unwise to use them in
+ public header files. */
+
+/* If the system defines INTMAX_MAX, assume that intmax_t works, and
+ similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
+ assuming one type where another is used by the system. */
+
+# ifndef INTMAX_MAX
+# undef INTMAX_C
+# undef intmax_t
+# if LONG_MAX >> 30 == 1
+typedef long long int gl_intmax_t;
+# define intmax_t gl_intmax_t
+# elif defined GL_INT64_T
+# define intmax_t int64_t
+# else
+typedef long int gl_intmax_t;
+# define intmax_t gl_intmax_t
+# endif
+# endif
+
+# ifndef UINTMAX_MAX
+# undef UINTMAX_C
+# undef uintmax_t
+# if ULONG_MAX >> 31 == 1
+typedef unsigned long long int gl_uintmax_t;
+# define uintmax_t gl_uintmax_t
+# elif defined GL_UINT64_T
+# define uintmax_t uint64_t
+# else
+typedef unsigned long int gl_uintmax_t;
+# define uintmax_t gl_uintmax_t
+# endif
+# endif
+
+/* Verify that intmax_t and uintmax_t have the same size. Too much code
+ breaks if this is not the case. If this check fails, the reason is likely
+ to be found in the autoconf macros. */
+typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
+ ? 1 : -1];
+
+# define GNULIB_defined_stdint_types 1
+# endif /* !GNULIB_defined_stdint_types */
+
+/* 7.18.2. Limits of specified-width integer types */
+
+/* 7.18.2.1. Limits of exact-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. */
+
+# undef INT8_MIN
+# undef INT8_MAX
+# undef UINT8_MAX
+# define INT8_MIN (~ INT8_MAX)
+# define INT8_MAX 127
+# define UINT8_MAX 255
+
+# undef INT16_MIN
+# undef INT16_MAX
+# undef UINT16_MAX
+# define INT16_MIN (~ INT16_MAX)
+# define INT16_MAX 32767
+# define UINT16_MAX 65535
+
+# undef INT32_MIN
+# undef INT32_MAX
+# undef UINT32_MAX
+# define INT32_MIN (~ INT32_MAX)
+# define INT32_MAX 2147483647
+# define UINT32_MAX 4294967295U
+
+# if defined GL_INT64_T && ! defined INT64_MAX
+/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
+ evaluates the latter incorrectly in preprocessor expressions. */
+# define INT64_MIN (- INTMAX_C (1) << 63)
+# define INT64_MAX INTMAX_C (9223372036854775807)
+# endif
+
+# if defined GL_UINT64_T && ! defined UINT64_MAX
+# define UINT64_MAX UINTMAX_C (18446744073709551615)
+# endif
+
+/* 7.18.2.2. Limits of minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
+ are the same as the corresponding N_t types. */
+
+# undef INT_LEAST8_MIN
+# undef INT_LEAST8_MAX
+# undef UINT_LEAST8_MAX
+# define INT_LEAST8_MIN INT8_MIN
+# define INT_LEAST8_MAX INT8_MAX
+# define UINT_LEAST8_MAX UINT8_MAX
+
+# undef INT_LEAST16_MIN
+# undef INT_LEAST16_MAX
+# undef UINT_LEAST16_MAX
+# define INT_LEAST16_MIN INT16_MIN
+# define INT_LEAST16_MAX INT16_MAX
+# define UINT_LEAST16_MAX UINT16_MAX
+
+# undef INT_LEAST32_MIN
+# undef INT_LEAST32_MAX
+# undef UINT_LEAST32_MAX
+# define INT_LEAST32_MIN INT32_MIN
+# define INT_LEAST32_MAX INT32_MAX
+# define UINT_LEAST32_MAX UINT32_MAX
+
+# undef INT_LEAST64_MIN
+# undef INT_LEAST64_MAX
+# ifdef GL_INT64_T
+# define INT_LEAST64_MIN INT64_MIN
+# define INT_LEAST64_MAX INT64_MAX
+# endif
+
+# undef UINT_LEAST64_MAX
+# ifdef GL_UINT64_T
+# define UINT_LEAST64_MAX UINT64_MAX
+# endif
+
+/* 7.18.2.3. Limits of fastest minimum-width integer types */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
+ are taken from the same list of types. */
+
+# undef INT_FAST8_MIN
+# undef INT_FAST8_MAX
+# undef UINT_FAST8_MAX
+# define INT_FAST8_MIN SCHAR_MIN
+# define INT_FAST8_MAX SCHAR_MAX
+# define UINT_FAST8_MAX UCHAR_MAX
+
+# undef INT_FAST16_MIN
+# undef INT_FAST16_MAX
+# undef UINT_FAST16_MAX
+# define INT_FAST16_MIN INT_FAST32_MIN
+# define INT_FAST16_MAX INT_FAST32_MAX
+# define UINT_FAST16_MAX UINT_FAST32_MAX
+
+# undef INT_FAST32_MIN
+# undef INT_FAST32_MAX
+# undef UINT_FAST32_MAX
+# ifdef __sun
+# define INT_FAST32_MIN INT_MIN
+# define INT_FAST32_MAX INT_MAX
+# define UINT_FAST32_MAX UINT_MAX
+# else
+# define INT_FAST32_MIN LONG_MIN
+# define INT_FAST32_MAX LONG_MAX
+# define UINT_FAST32_MAX ULONG_MAX
+# endif
+
+# undef INT_FAST64_MIN
+# undef INT_FAST64_MAX
+# ifdef GL_INT64_T
+# define INT_FAST64_MIN INT64_MIN
+# define INT_FAST64_MAX INT64_MAX
+# endif
+
+# undef UINT_FAST64_MAX
+# ifdef GL_UINT64_T
+# define UINT_FAST64_MAX UINT64_MAX
+# endif
+
+/* 7.18.2.4. Limits of integer types capable of holding object pointers */
+
+# undef INTPTR_MIN
+# undef INTPTR_MAX
+# undef UINTPTR_MAX
+# ifdef _WIN64
+# define INTPTR_MIN LLONG_MIN
+# define INTPTR_MAX LLONG_MAX
+# define UINTPTR_MAX ULLONG_MAX
+# else
+# define INTPTR_MIN LONG_MIN
+# define INTPTR_MAX LONG_MAX
+# define UINTPTR_MAX ULONG_MAX
+# endif
+
+/* 7.18.2.5. Limits of greatest-width integer types */
+
+# ifndef INTMAX_MAX
+# undef INTMAX_MIN
+# ifdef INT64_MAX
+# define INTMAX_MIN INT64_MIN
+# define INTMAX_MAX INT64_MAX
+# else
+# define INTMAX_MIN INT32_MIN
+# define INTMAX_MAX INT32_MAX
+# endif
+# endif
+
+# ifndef UINTMAX_MAX
+# ifdef UINT64_MAX
+# define UINTMAX_MAX UINT64_MAX
+# else
+# define UINTMAX_MAX UINT32_MAX
+# endif
+# endif
+
+/* 7.18.3. Limits of other integer types */
+
+/* ptrdiff_t limits */
+# undef PTRDIFF_MIN
+# undef PTRDIFF_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+# ifdef _LP64
+# define PTRDIFF_MIN _STDINT_SIGNED_MIN (64, 0l)
+# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
+# else
+# define PTRDIFF_MIN _STDINT_SIGNED_MIN (32, 0)
+# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
+# endif
+# else
+# define PTRDIFF_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+# define PTRDIFF_MAX \
+ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+# endif
+
+/* sig_atomic_t limits */
+# undef SIG_ATOMIC_MIN
+# undef SIG_ATOMIC_MAX
+# if @HAVE_SIGNED_SIG_ATOMIC_T@
+# define SIG_ATOMIC_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# else
+# define SIG_ATOMIC_MIN \
+ _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# endif
+# define SIG_ATOMIC_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
+ 0@SIG_ATOMIC_T_SUFFIX@)
+
+
+/* size_t limit */
+# undef SIZE_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+# ifdef _LP64
+# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
+# else
+# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
+# endif
+# else
+# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
+# endif
+
+/* wchar_t limits */
+/* Get WCHAR_MIN, WCHAR_MAX.
+ This include is not on the top, above, because on OSF/1 4.0 we have a
+ sequence of nested includes
+ <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
+ <stdint.h> and assumes its types are already defined. */
+# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# include <wchar.h>
+# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# endif
+# undef WCHAR_MIN
+# undef WCHAR_MAX
+# if @HAVE_SIGNED_WCHAR_T@
+# define WCHAR_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# else
+# define WCHAR_MIN \
+ _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# endif
+# define WCHAR_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+
+/* wint_t limits */
+/* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not
+ accurate, therefore use the definitions from above. */
+# if !@GNULIBHEADERS_OVERRIDE_WINT_T@
+# undef WINT_MIN
+# undef WINT_MAX
+# if @HAVE_SIGNED_WINT_T@
+# define WINT_MIN \
+ _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# else
+# define WINT_MIN \
+ _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# endif
+# define WINT_MAX \
+ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# endif
+
+/* 7.18.4. Macros for integer constants */
+
+/* 7.18.4.1. Macros for minimum-width integer constants */
+/* According to ISO C 99 Technical Corrigendum 1 */
+
+/* Here we assume a standard architecture where the hardware integer
+ types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
+
+# undef INT8_C
+# undef UINT8_C
+# define INT8_C(x) x
+# define UINT8_C(x) x
+
+# undef INT16_C
+# undef UINT16_C
+# define INT16_C(x) x
+# define UINT16_C(x) x
+
+# undef INT32_C
+# undef UINT32_C
+# define INT32_C(x) x
+# define UINT32_C(x) x ## U
+
+# undef INT64_C
+# undef UINT64_C
+# if LONG_MAX >> 31 >> 31 == 1
+# define INT64_C(x) x##L
+# elif defined _MSC_VER
+# define INT64_C(x) x##i64
+# else
+# define INT64_C(x) x##LL
+# endif
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+# define UINT64_C(x) x##UL
+# elif defined _MSC_VER
+# define UINT64_C(x) x##ui64
+# else
+# define UINT64_C(x) x##ULL
+# endif
+
+/* 7.18.4.2. Macros for greatest-width integer constants */
+
+# ifndef INTMAX_C
+# if LONG_MAX >> 30 == 1
+# define INTMAX_C(x) x##LL
+# elif defined GL_INT64_T
+# define INTMAX_C(x) INT64_C(x)
+# else
+# define INTMAX_C(x) x##L
+# endif
+# endif
+
+# ifndef UINTMAX_C
+# if ULONG_MAX >> 31 == 1
+# define UINTMAX_C(x) x##ULL
+# elif defined GL_UINT64_T
+# define UINTMAX_C(x) UINT64_C(x)
+# else
+# define UINTMAX_C(x) x##UL
+# endif
+# endif
+
+#endif /* !@HAVE_C99_STDINT_H@ */
+
+/* Macros specified by ISO/IEC TS 18661-1:2014. */
+
+#if (!defined UINTMAX_WIDTH \
+ && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# ifdef INT8_MAX
+# define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX)
+# endif
+# ifdef UINT8_MAX
+# define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX)
+# endif
+# ifdef INT16_MAX
+# define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX)
+# endif
+# ifdef UINT16_MAX
+# define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX)
+# endif
+# ifdef INT32_MAX
+# define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX)
+# endif
+# ifdef UINT32_MAX
+# define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX)
+# endif
+# ifdef INT64_MAX
+# define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX)
+# endif
+# ifdef UINT64_MAX
+# define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX)
+# endif
+# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX)
+# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX)
+# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX)
+# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX)
+# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX)
+# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX)
+# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX)
+# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX)
+# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX)
+# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX)
+# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX)
+# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX)
+# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX)
+# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX)
+# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX)
+# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX)
+# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX)
+# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX)
+# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX)
+# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX)
+# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX)
+# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX)
+# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
+# ifdef WINT_MAX
+# define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX)
+# endif
+# ifdef SIG_ATOMIC_MAX
+# define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX)
+# endif
+#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
+
+#endif /* _@GUARD_PREFIX@_STDINT_H */
+#endif /* !(defined __ANDROID__ && ...) */
+#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h
new file mode 100644
index 0000000..46608be
--- /dev/null
+++ b/gl/stdio-impl.h
@@ -0,0 +1,218 @@
+/* Implementation details of FILE streams.
+ Copyright (C) 2007-2008, 2010-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Many stdio implementations have the same logic and therefore can share
+ the same implementation of stdio extension API, except that some fields
+ have different naming conventions, or their access requires some casts. */
+
+/* Glibc 2.28 made _IO_UNBUFFERED and _IO_IN_BACKUP private. For now, work
+ around this problem by defining them ourselves. FIXME: Do not rely on glibc
+ internals. */
+#if defined _IO_EOF_SEEN
+# if !defined _IO_UNBUFFERED
+# define _IO_UNBUFFERED 0x2
+# endif
+# if !defined _IO_IN_BACKUP
+# define _IO_IN_BACKUP 0x100
+# endif
+#endif
+
+/* BSD stdio derived implementations. */
+
+#if defined __NetBSD__ /* NetBSD */
+/* Get __NetBSD_Version__. */
+# include <sys/param.h>
+#endif
+
+#include <errno.h> /* For detecting Plan9. */
+
+#if defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+
+# if defined __DragonFly__ /* DragonFly */
+ /* See <https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/lib/libc/stdio/priv_stdio.h>. */
+# define fp_ ((struct { struct __FILE_public pub; \
+ struct { unsigned char *_base; int _size; } _bf; \
+ void *cookie; \
+ void *_close; \
+ void *_read; \
+ void *_seek; \
+ void *_write; \
+ struct { unsigned char *_base; int _size; } _ub; \
+ int _ur; \
+ unsigned char _ubuf[3]; \
+ unsigned char _nbuf[1]; \
+ struct { unsigned char *_base; int _size; } _lb; \
+ int _blksize; \
+ fpos_t _offset; \
+ /* More fields, not relevant here. */ \
+ } *) fp)
+ /* See <https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/stdio.h>. */
+# define _p pub._p
+# define _flags pub._flags
+# define _r pub._r
+# define _w pub._w
+# elif defined __ANDROID__ /* Android */
+# ifdef __LP64__
+# define _gl_flags_file_t int
+# else
+# define _gl_flags_file_t short
+# endif
+# ifdef __LP64__
+# define _gl_file_offset_t int64_t
+# else
+ /* see https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */
+# define _gl_file_offset_t __kernel_off_t
+# endif
+ /* Up to this commit from 2015-10-12
+ <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>
+ the innards of FILE were public, and fp_ub could be defined like for OpenBSD,
+ see <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/fileext.h>
+ and <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/local.h>.
+ After this commit, the innards of FILE are hidden. */
+# define fp_ ((struct { unsigned char *_p; \
+ int _r; \
+ int _w; \
+ _gl_flags_file_t _flags; \
+ _gl_flags_file_t _file; \
+ struct { unsigned char *_base; size_t _size; } _bf; \
+ int _lbfsize; \
+ void *_cookie; \
+ void *_close; \
+ void *_read; \
+ void *_seek; \
+ void *_write; \
+ struct { unsigned char *_base; size_t _size; } _ext; \
+ unsigned char *_up; \
+ int _ur; \
+ unsigned char _ubuf[3]; \
+ unsigned char _nbuf[1]; \
+ struct { unsigned char *_base; size_t _size; } _lb; \
+ int _blksize; \
+ _gl_file_offset_t _offset; \
+ /* More fields, not relevant here. */ \
+ } *) fp)
+# else
+# define fp_ fp
+# endif
+
+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix /* NetBSD >= 1.5ZA, OpenBSD, Minix 3 */
+ /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
+ and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
+ and <https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/lib/libc/stdio/fileext.h> */
+ struct __sfileext
+ {
+ struct __sbuf _ub; /* ungetc buffer */
+ /* More fields, not relevant here. */
+ };
+# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
+# elif defined __ANDROID__ /* Android */
+ struct __sfileext
+ {
+ struct { unsigned char *_base; size_t _size; } _ub; /* ungetc buffer */
+ /* More fields, not relevant here. */
+ };
+# define fp_ub ((struct __sfileext *) fp_->_ext._base)->_ub
+# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */
+# define fp_ub fp_->_ub
+# endif
+
+# define HASUB(fp) (fp_ub._base != NULL)
+
+# if defined __ANDROID__ /* Android */
+ /* Needed after this commit from 2016-01-25
+ <https://android.googlesource.com/platform/bionic.git/+/e70e0e9267d069bf56a5078c99307e08a7280de7> */
+# ifndef __SEOF
+# define __SLBF 1
+# define __SNBF 2
+# define __SRD 4
+# define __SWR 8
+# define __SRW 0x10
+# define __SEOF 0x20
+# define __SERR 0x40
+# endif
+# ifndef __SOFF
+# define __SOFF 0x1000
+# endif
+# endif
+
+#endif
+
+
+/* SystemV derived implementations. */
+
+#ifdef __TANDEM /* NonStop Kernel */
+# ifndef _IOERR
+/* These values were determined by the program 'stdioext-flags' at
+ <https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html>. */
+# define _IOERR 0x40
+# define _IOREAD 0x80
+# define _IOWRT 0x4
+# define _IORW 0x100
+# endif
+#endif
+
+#if defined _IOERR
+
+# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
+# define fp_ ((struct { unsigned char *_ptr; \
+ unsigned char *_base; \
+ unsigned char *_end; \
+ long _cnt; \
+ int _file; \
+ unsigned int _flag; \
+ } *) fp)
+# elif defined __VMS /* OpenVMS */
+# define fp_ ((struct _iobuf *) fp)
+# else
+# define fp_ fp
+# endif
+
+# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__) /* OpenServer 5, OpenServer 6, UnixWare 7 */
+# define _cnt __cnt
+# define _ptr __ptr
+# define _base __base
+# define _flag __flag
+# endif
+
+#elif defined _WIN32 && ! defined __CYGWIN__ /* newer Windows with MSVC */
+
+/* <stdio.h> does not define the innards of FILE any more. */
+# define WINDOWS_OPAQUE_FILE
+
+struct _gl_real_FILE
+{
+ /* Note: Compared to older Windows and to mingw, it has the fields
+ _base and _cnt swapped. */
+ unsigned char *_ptr;
+ unsigned char *_base;
+ int _cnt;
+ int _flag;
+ int _file;
+ int _charbuf;
+ int _bufsiz;
+};
+# define fp_ ((struct _gl_real_FILE *) fp)
+
+/* These values were determined by a program similar to the one at
+ <https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html>. */
+# define _IOREAD 0x1
+# define _IOWRT 0x2
+# define _IORW 0x4
+# define _IOEOF 0x8
+# define _IOERR 0x10
+
+#endif
diff --git a/gl/stdio-read.c b/gl/stdio-read.c
new file mode 100644
index 0000000..6e2984c
--- /dev/null
+++ b/gl/stdio-read.c
@@ -0,0 +1,168 @@
+/* POSIX compatible FILE stream read function.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Replace these functions only if module 'nonblocking' is requested. */
+#if GNULIB_NONBLOCKING
+
+/* On native Windows platforms, when read() is called on a non-blocking pipe
+ with an empty buffer, ReadFile() fails with error GetLastError() =
+ ERROR_NO_DATA, and read() in consequence fails with error EINVAL. This
+ read() function is at the basis of the function which fills the buffer of
+ a FILE stream. */
+
+# if defined _WIN32 && ! defined __CYGWIN__
+
+# include <errno.h>
+# include <io.h>
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
+# define CALL_WITH_ERRNO_FIX(RETTYPE, EXPRESSION, FAILED) \
+ if (ferror (stream)) \
+ return (EXPRESSION); \
+ else \
+ { \
+ RETTYPE ret; \
+ SetLastError (0); \
+ ret = (EXPRESSION); \
+ if (FAILED) \
+ { \
+ if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \
+ { \
+ int fd = fileno (stream); \
+ if (fd >= 0) \
+ { \
+ HANDLE h = (HANDLE) _get_osfhandle (fd); \
+ if (GetFileType (h) == FILE_TYPE_PIPE) \
+ { \
+ /* h is a pipe or socket. */ \
+ DWORD state; \
+ if (GetNamedPipeHandleState (h, &state, NULL, NULL, \
+ NULL, NULL, 0) \
+ && (state & PIPE_NOWAIT) != 0) \
+ /* h is a pipe in non-blocking mode. \
+ Change errno from EINVAL to EAGAIN. */ \
+ errno = EAGAIN; \
+ } \
+ } \
+ } \
+ } \
+ return ret; \
+ }
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_SCANF
+int
+scanf (const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfscanf (stdin, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_FSCANF
+int
+fscanf (FILE *stream, const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfscanf (stream, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_VSCANF
+int
+vscanf (const char *format, va_list args)
+{
+ return vfscanf (stdin, format, args);
+}
+# endif
+
+/* Enable this function definition only if gnulib's <stdio.h> has prepared it.
+ Otherwise we get a function definition conflict with mingw64's <stdio.h>. */
+# if GNULIB_VFSCANF
+int
+vfscanf (FILE *stream, const char *format, va_list args)
+#undef vfscanf
+{
+ CALL_WITH_ERRNO_FIX (int, vfscanf (stream, format, args), ret == EOF)
+}
+# endif
+
+int
+getchar (void)
+{
+ return fgetc (stdin);
+}
+
+int
+fgetc (FILE *stream)
+#undef fgetc
+{
+ CALL_WITH_ERRNO_FIX (int, fgetc (stream), ret == EOF)
+}
+
+char *
+fgets (char *s, int n, FILE *stream)
+#undef fgets
+{
+ CALL_WITH_ERRNO_FIX (char *, fgets (s, n, stream), ret == NULL)
+}
+
+/* We intentionally don't bother to fix gets. */
+
+size_t
+fread (void *ptr, size_t s, size_t n, FILE *stream)
+#undef fread
+{
+ CALL_WITH_ERRNO_FIX (size_t, fread (ptr, s, n, stream), ret < n)
+}
+
+# endif
+#endif
diff --git a/gl/stdio-write.c b/gl/stdio-write.c
new file mode 100644
index 0000000..9cf36cc
--- /dev/null
+++ b/gl/stdio-write.c
@@ -0,0 +1,206 @@
+/* POSIX compatible FILE stream write function.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Replace these functions only if module 'nonblocking' or module 'sigpipe' is
+ requested. */
+#if GNULIB_NONBLOCKING || GNULIB_SIGPIPE
+
+/* On native Windows platforms, SIGPIPE does not exist. When write() is
+ called on a pipe with no readers, WriteFile() fails with error
+ GetLastError() = ERROR_NO_DATA, and write() in consequence fails with
+ error EINVAL. This write() function is at the basis of the function
+ which flushes the buffer of a FILE stream. */
+
+# if defined _WIN32 && ! defined __CYGWIN__
+
+# include <errno.h>
+# include <signal.h>
+# include <io.h>
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+# else
+# include <io.h>
+# endif
+
+/* Don't assume that UNICODE is not defined. */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
+
+# if GNULIB_NONBLOCKING
+# define CLEAR_ERRNO \
+ errno = 0;
+# define HANDLE_ENOSPC \
+ if (errno == ENOSPC && ferror (stream)) \
+ { \
+ int fd = fileno (stream); \
+ if (fd >= 0) \
+ { \
+ HANDLE h = (HANDLE) _get_osfhandle (fd); \
+ if (GetFileType (h) == FILE_TYPE_PIPE) \
+ { \
+ /* h is a pipe or socket. */ \
+ DWORD state; \
+ if (GetNamedPipeHandleState (h, &state, NULL, NULL, \
+ NULL, NULL, 0) \
+ && (state & PIPE_NOWAIT) != 0) \
+ /* h is a pipe in non-blocking mode. \
+ Change errno from ENOSPC to EAGAIN. */ \
+ errno = EAGAIN; \
+ } \
+ } \
+ } \
+ else
+# else
+# define CLEAR_ERRNO
+# define HANDLE_ENOSPC
+# endif
+
+# if GNULIB_SIGPIPE
+# define CLEAR_LastError \
+ SetLastError (0);
+# define HANDLE_ERROR_NO_DATA \
+ if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \
+ { \
+ int fd = fileno (stream); \
+ if (fd >= 0 \
+ && GetFileType ((HANDLE) _get_osfhandle (fd)) \
+ == FILE_TYPE_PIPE) \
+ { \
+ /* Try to raise signal SIGPIPE. */ \
+ raise (SIGPIPE); \
+ /* If it is currently blocked or ignored, change errno from \
+ EINVAL to EPIPE. */ \
+ errno = EPIPE; \
+ } \
+ } \
+ else
+# else
+# define CLEAR_LastError
+# define HANDLE_ERROR_NO_DATA
+# endif
+
+# define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \
+ if (ferror (stream)) \
+ return (EXPRESSION); \
+ else \
+ { \
+ RETTYPE ret; \
+ CLEAR_ERRNO \
+ CLEAR_LastError \
+ ret = (EXPRESSION); \
+ if (FAILED) \
+ { \
+ HANDLE_ENOSPC \
+ HANDLE_ERROR_NO_DATA \
+ ; \
+ } \
+ return ret; \
+ }
+
+# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
+int
+printf (const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfprintf (stdout, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
+int
+fprintf (FILE *stream, const char *format, ...)
+{
+ int retval;
+ va_list args;
+
+ va_start (args, format);
+ retval = vfprintf (stream, format, args);
+ va_end (args);
+
+ return retval;
+}
+# endif
+
+# if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */
+int
+vprintf (const char *format, va_list args)
+{
+ return vfprintf (stdout, format, args);
+}
+# endif
+
+# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */
+int
+vfprintf (FILE *stream, const char *format, va_list args)
+#undef vfprintf
+{
+ CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF)
+}
+# endif
+
+int
+putchar (int c)
+{
+ return fputc (c, stdout);
+}
+
+int
+fputc (int c, FILE *stream)
+#undef fputc
+{
+ CALL_WITH_SIGPIPE_EMULATION (int, fputc (c, stream), ret == EOF)
+}
+
+int
+fputs (const char *string, FILE *stream)
+#undef fputs
+{
+ CALL_WITH_SIGPIPE_EMULATION (int, fputs (string, stream), ret == EOF)
+}
+
+int
+puts (const char *string)
+#undef puts
+{
+ FILE *stream = stdout;
+ CALL_WITH_SIGPIPE_EMULATION (int, puts (string), ret == EOF)
+}
+
+size_t
+fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
+#undef fwrite
+{
+ CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n)
+}
+
+# endif
+#endif
diff --git a/gl/stdio.in.h b/gl/stdio.in.h
new file mode 100644
index 0000000..59cbea3
--- /dev/null
+++ b/gl/stdio.in.h
@@ -0,0 +1,1711 @@
+/* A GNU-like <stdio.h>.
+
+ Copyright (C) 2004, 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+/* Special invocation convention:
+ - Inside glibc header files.
+ - On OSF/1 5.1 we have a sequence of nested includes
+ <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
+ <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STDIO_H
+
+#define _GL_ALREADY_INCLUDING_STDIO_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDIO_H@
+
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
+#ifndef _@GUARD_PREFIX@_STDIO_H
+#define _@GUARD_PREFIX@_STDIO_H
+
+/* Get va_list. Needed on many systems, including glibc 2.8. */
+#include <stdarg.h>
+
+#include <stddef.h>
+
+/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
+ and eglibc 2.11.2.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+
+/* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && (defined __sun || defined __NetBSD__) \
+ && ! defined __GLIBC__
+# include <unistd.h>
+#endif
+
+/* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+ && ! defined __GLIBC__
+# include <sys/stat.h>
+#endif
+
+/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>. We must include
+ it before we #define perror rpl_perror. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
+ && ! defined __GLIBC__
+# include <stdlib.h>
+#endif
+
+/* MSVC declares 'remove' in <io.h>, not in <stdio.h>. We must include
+ it before we #define remove rpl_remove. */
+/* MSVC declares 'rename' in <io.h>, not in <stdio.h>. We must include
+ it before we #define rename rpl_rename. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__) \
+ && ! defined __GLIBC__
+# include <io.h>
+#endif
+
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The __-protected variants of the attributes 'format' and 'printf' are
+ accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
+ gnulib and libintl do '#define printf __printf__' when they override
+ the 'printf' function. */
+#ifndef _GL_ATTRIBUTE_FORMAT
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+# endif
+#endif
+
+/* An __attribute__ __format__ specifier for a function that takes a format
+ string and arguments, where the format string directives are the ones
+ standardized by ISO C99 and POSIX.
+ _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */
+/* __gnu_printf__ is supported in GCC >= 4.4. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
+#else
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
+#endif
+
+/* An __attribute__ __format__ specifier for a function that takes a format
+ string and arguments, where the format string directives are the ones of the
+ system printf(), rather than the ones standardized by ISO C99 and POSIX.
+ _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM */
+/* On mingw, Gnulib sets __USE_MINGW_ANSI_STDIO in order to get closer to
+ the standards. The macro GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU indicates
+ whether this change is effective. On older mingw, it is not. */
+#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD
+#else
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM __printf__
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD
+ indicates to GCC that the function takes a format string and arguments,
+ where the format string directives are the ones standardized by ISO C99
+ and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, formatstring_parameter, first_argument))
+
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD,
+ except that it indicates to GCC that the supported format string directives
+ are the ones of the system printf(), rather than the ones standardized by
+ ISO C99 and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, formatstring_parameter, first_argument))
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF
+ indicates to GCC that the function takes a format string and arguments,
+ where the format string directives are the ones standardized by ISO C99
+ and POSIX. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
+ except that it indicates to GCC that the supported format string directives
+ are the ones of the system scanf(), rather than the ones standardized by
+ ISO C99 and POSIX. */
+#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
+ _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Macros for stringification. */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
+
+/* When also using extern inline, suppress the use of static inline in
+ standard headers of problematic Apple configurations, as Libc at
+ least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+ <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
+ && defined __GNUC__ && defined __STDC__)
+# undef putc_unlocked
+#endif
+
+#if @GNULIB_DPRINTF@
+# if @REPLACE_DPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dprintf rpl_dprintf
+# endif
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
+# else
+# if !@HAVE_DPRINTF@
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...));
+# endif
+_GL_CXXALIASWARN (dprintf);
+#elif defined GNULIB_POSIXCHECK
+# undef dprintf
+# if HAVE_RAW_DECL_DPRINTF
+_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
+ "use gnulib module dprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_FCLOSE@
+/* Close STREAM and its underlying file descriptor. */
+# if @REPLACE_FCLOSE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fclose rpl_fclose
+# endif
+_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fclose);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fclose
+/* Assume fclose is always declared. */
+_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
+ "use gnulib module fclose for portable POSIX compliance");
+#endif
+
+#if @GNULIB_MDA_FCLOSEALL@
+/* On native Windows, map 'fcloseall' to '_fcloseall', so that -loldnames is
+ not required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fcloseall on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcloseall
+# define fcloseall _fcloseall
+# endif
+_GL_CXXALIAS_MDA (fcloseall, int, (void));
+# else
+# if @HAVE_DECL_FCLOSEALL@
+# if defined __FreeBSD__ || defined __DragonFly__
+_GL_CXXALIAS_SYS (fcloseall, void, (void));
+# else
+_GL_CXXALIAS_SYS (fcloseall, int, (void));
+# endif
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCLOSEALL@
+_GL_CXXALIASWARN (fcloseall);
+# endif
+#endif
+
+#if @GNULIB_FDOPEN@
+# if @REPLACE_FDOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopen
+# define fdopen rpl_fdopen
+# endif
+_GL_FUNCDECL_RPL (fdopen, FILE *,
+ (int fd, const char *mode)
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopen
+# define fdopen _fdopen
+# endif
+_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fdopen, FILE *,
+ (int fd, const char *mode)
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+#else
+# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fdopen
+/* For -Wmismatched-dealloc: Associate fdopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fdopen, FILE *,
+ (int fd, const char *mode)
+ _GL_ARG_NONNULL ((2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef fdopen
+/* Assume fdopen is always declared. */
+_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module fdopen for portability");
+# elif @GNULIB_MDA_FDOPEN@
+/* On native Windows, map 'fdopen' to '_fdopen', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fdopen always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fdopen
+# define fdopen _fdopen
+# endif
+_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+# endif
+#endif
+
+#if @GNULIB_FFLUSH@
+/* Flush all pending data on STREAM according to POSIX rules. Both
+ output and seekable input streams are supported.
+ Note! LOSS OF DATA can occur if fflush is applied on an input stream
+ that is _not_seekable_ or on an update stream that is _not_seekable_
+ and in which the most recent operation was input. Seekability can
+ be tested with lseek(fileno(fp),0,SEEK_CUR). */
+# if @REPLACE_FFLUSH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fflush rpl_fflush
+# endif
+_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
+_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
+# else
+_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fflush);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fflush
+/* Assume fflush is always declared. */
+_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
+ "use gnulib module fflush for portable POSIX compliance");
+#endif
+
+#if @GNULIB_FGETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fgetc
+# define fgetc rpl_fgetc
+# endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fgetc);
+# endif
+#endif
+
+#if @GNULIB_FGETS@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fgets
+# define fgets rpl_fgets
+# endif
+_GL_FUNCDECL_RPL (fgets, char *,
+ (char *restrict s, int n, FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (fgets, char *,
+ (char *restrict s, int n, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fgets, char *,
+ (char *restrict s, int n, FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fgets);
+# endif
+#endif
+
+#if @GNULIB_MDA_FILENO@
+/* On native Windows, map 'fileno' to '_fileno', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fileno always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fileno
+# define fileno _fileno
+# endif
+_GL_CXXALIAS_MDA (fileno, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fileno, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (fileno);
+#endif
+
+#if @GNULIB_FOPEN@
+# if (@GNULIB_FOPEN@ && @REPLACE_FOPEN@) \
+ || (@GNULIB_FOPEN_GNU@ && @REPLACE_FOPEN_FOR_FOPEN_GNU@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fopen
+# define fopen rpl_fopen
+# endif
+_GL_FUNCDECL_RPL (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+_GL_CXXALIAS_RPL (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+_GL_CXXALIAS_SYS (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fopen);
+# endif
+#else
+# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined fopen
+/* For -Wmismatched-dealloc: Associate fopen with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (fopen, FILE *,
+ (const char *restrict filename, const char *restrict mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef fopen
+/* Assume fopen is always declared. */
+_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module fopen for portability");
+# endif
+#endif
+
+#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
+ || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fprintf rpl_fprintf
+# endif
+# define GNULIB_overrides_fprintf 1
+# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...));
+# else
+_GL_CXXALIAS_SYS (fprintf, int,
+ (FILE *restrict fp, const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fprintf);
+# endif
+#endif
+#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_fprintf
+# undef fprintf
+# endif
+/* Assume fprintf is always declared. */
+_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
+ "use gnulib module fprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_FPURGE@
+/* Discard all pending buffered I/O data on STREAM.
+ STREAM must not be wide-character oriented.
+ When discarding pending output, the file position is set back to where it
+ was before the write calls. When discarding pending input, the file
+ position is advanced to match the end of the previously read input.
+ Return 0 if successful. Upon error, return -1 and set errno. */
+# if @REPLACE_FPURGE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define fpurge rpl_fpurge
+# endif
+_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
+# else
+# if !@HAVE_DECL_FPURGE@
+_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
+# endif
+_GL_CXXALIASWARN (fpurge);
+#elif defined GNULIB_POSIXCHECK
+# undef fpurge
+# if HAVE_RAW_DECL_FPURGE
+_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
+ "use gnulib module fpurge for portability");
+# endif
+#endif
+
+#if @GNULIB_FPUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fputc
+# define fputc rpl_fputc
+# endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fputc);
+# endif
+#endif
+
+#if @GNULIB_FPUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fputs
+# define fputs rpl_fputs
+# endif
+_GL_FUNCDECL_RPL (fputs, int,
+ (const char *restrict string, FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fputs, int,
+ (const char *restrict string, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fputs, int,
+ (const char *restrict string, FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fputs);
+# endif
+#endif
+
+#if @GNULIB_FREAD@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fread
+# define fread rpl_fread
+# endif
+_GL_FUNCDECL_RPL (fread, size_t,
+ (void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (fread, size_t,
+ (void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fread, size_t,
+ (void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fread);
+# endif
+#endif
+
+#if @GNULIB_FREOPEN@
+# if @REPLACE_FREOPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef freopen
+# define freopen rpl_freopen
+# endif
+_GL_FUNCDECL_RPL (freopen, FILE *,
+ (const char *restrict filename, const char *restrict mode,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (freopen, FILE *,
+ (const char *restrict filename, const char *restrict mode,
+ FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (freopen, FILE *,
+ (const char *restrict filename, const char *restrict mode,
+ FILE *restrict stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (freopen);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef freopen
+/* Assume freopen is always declared. */
+_GL_WARN_ON_USE (freopen,
+ "freopen on native Windows platforms is not POSIX compliant - "
+ "use gnulib module freopen for portability");
+#endif
+
+#if @GNULIB_FSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fscanf
+# define fscanf rpl_fscanf
+# endif
+_GL_FUNCDECL_RPL (fscanf, int,
+ (FILE *restrict stream, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fscanf, int,
+ (FILE *restrict stream, const char *restrict format, ...));
+# else
+_GL_CXXALIAS_SYS (fscanf, int,
+ (FILE *restrict stream, const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fscanf);
+# endif
+#endif
+
+
+/* Set up the following warnings, based on which modules are in use.
+ GNU Coding Standards discourage the use of fseek, since it imposes
+ an arbitrary limitation on some 32-bit hosts. Remember that the
+ fseek module depends on the fseeko module, so we only have three
+ cases to consider:
+
+ 1. The developer is not using either module. Issue a warning under
+ GNULIB_POSIXCHECK for both functions, to remind them that both
+ functions have bugs on some systems. _GL_NO_LARGE_FILES has no
+ impact on this warning.
+
+ 2. The developer is using both modules. They may be unaware of the
+ arbitrary limitations of fseek, so issue a warning under
+ GNULIB_POSIXCHECK. On the other hand, they may be using both
+ modules intentionally, so the developer can define
+ _GL_NO_LARGE_FILES in the compilation units where the use of fseek
+ is safe, to silence the warning.
+
+ 3. The developer is using the fseeko module, but not fseek. Gnulib
+ guarantees that fseek will still work around platform bugs in that
+ case, but we presume that the developer is aware of the pitfalls of
+ fseek and was trying to avoid it, so issue a warning even when
+ GNULIB_POSIXCHECK is undefined. Again, _GL_NO_LARGE_FILES can be
+ defined to silence the warning in particular compilation units.
+ In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
+ fseek gets defined as a macro, it is recommended that the developer
+ uses the fseek module, even if he is not calling the fseek function.
+
+ Most gnulib clients that perform stream operations should fall into
+ category 3. */
+
+#if @GNULIB_FSEEK@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+# define _GL_FSEEK_WARN /* Category 2, above. */
+# undef fseek
+# endif
+# if @REPLACE_FSEEK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fseek
+# define fseek rpl_fseek
+# endif
+_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fseek);
+# endif
+#endif
+
+#if @GNULIB_FSEEKO@
+# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
+# define _GL_FSEEK_WARN /* Category 3, above. */
+# undef fseek
+# endif
+# if @REPLACE_FSEEKO@
+/* Provide an fseeko function that is aware of a preceding fflush(), and which
+ detects pipes. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fseeko
+# define fseeko rpl_fseeko
+# endif
+_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
+# else
+# if ! @HAVE_DECL_FSEEKO@
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (fseeko);
+#elif defined GNULIB_POSIXCHECK
+# define _GL_FSEEK_WARN /* Category 1, above. */
+# undef fseek
+# undef fseeko
+# if HAVE_RAW_DECL_FSEEKO
+_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
+ "use gnulib module fseeko for portability");
+# endif
+#endif
+
+#ifdef _GL_FSEEK_WARN
+# undef _GL_FSEEK_WARN
+/* Here, either fseek is undefined (but C89 guarantees that it is
+ declared), or it is defined as rpl_fseek (declared above). */
+_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
+ "on 32-bit platforms - "
+ "use fseeko function for handling of large files");
+#endif
+
+
+/* ftell, ftello. See the comments on fseek/fseeko. */
+
+#if @GNULIB_FTELL@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+# define _GL_FTELL_WARN /* Category 2, above. */
+# undef ftell
+# endif
+# if @REPLACE_FTELL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftell
+# define ftell rpl_ftell
+# endif
+_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
+# else
+_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ftell);
+# endif
+#endif
+
+#if @GNULIB_FTELLO@
+# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
+# define _GL_FTELL_WARN /* Category 3, above. */
+# undef ftell
+# endif
+# if @REPLACE_FTELLO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftello
+# define ftello rpl_ftello
+# endif
+_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
+# else
+# if ! @HAVE_DECL_FTELLO@
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
+# endif
+_GL_CXXALIASWARN (ftello);
+#elif defined GNULIB_POSIXCHECK
+# define _GL_FTELL_WARN /* Category 1, above. */
+# undef ftell
+# undef ftello
+# if HAVE_RAW_DECL_FTELLO
+_GL_WARN_ON_USE (ftello, "ftello is unportable - "
+ "use gnulib module ftello for portability");
+# endif
+#endif
+
+#ifdef _GL_FTELL_WARN
+# undef _GL_FTELL_WARN
+/* Here, either ftell is undefined (but C89 guarantees that it is
+ declared), or it is defined as rpl_ftell (declared above). */
+_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
+ "on 32-bit platforms - "
+ "use ftello function for handling of large files");
+#endif
+
+
+#if @GNULIB_FWRITE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fwrite
+# define fwrite rpl_fwrite
+# endif
+_GL_FUNCDECL_RPL (fwrite, size_t,
+ (const void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (fwrite, size_t,
+ (const void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fwrite, size_t,
+ (const void *restrict ptr, size_t s, size_t n,
+ FILE *restrict stream));
+
+/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
+ <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
+ which sometimes causes an unwanted diagnostic for fwrite calls.
+ This affects only function declaration attributes under certain
+ versions of gcc and clang, and is not needed for C++. */
+# if (0 < __USE_FORTIFY_LEVEL \
+ && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
+ && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
+ && !defined __cplusplus)
+# undef fwrite
+# undef fwrite_unlocked
+extern size_t __REDIRECT (rpl_fwrite,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite);
+extern size_t __REDIRECT (rpl_fwrite_unlocked,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite_unlocked);
+# define fwrite rpl_fwrite
+# define fwrite_unlocked rpl_fwrite_unlocked
+# endif
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fwrite);
+# endif
+#endif
+
+#if @GNULIB_GETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getc
+# define getc rpl_fgetc
+# endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (getc);
+# endif
+#endif
+
+#if @GNULIB_GETCHAR@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getchar
+# define getchar rpl_getchar
+# endif
+_GL_FUNCDECL_RPL (getchar, int, (void));
+_GL_CXXALIAS_RPL (getchar, int, (void));
+# else
+_GL_CXXALIAS_SYS (getchar, int, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (getchar);
+# endif
+#endif
+
+#if @GNULIB_GETDELIM@
+/* Read input, up to (and including) the next occurrence of DELIMITER, from
+ STREAM, store it in *LINEPTR (and NUL-terminate it).
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+ bytes of space. It is realloc'd as necessary.
+ Return the number of bytes read and stored at *LINEPTR (not including the
+ NUL terminator), or -1 on error or EOF. */
+# if @REPLACE_GETDELIM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getdelim
+# define getdelim rpl_getdelim
+# endif
+_GL_FUNCDECL_RPL (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+_GL_CXXALIAS_RPL (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream));
+# else
+# if !@HAVE_DECL_GETDELIM@
+_GL_FUNCDECL_SYS (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 4)));
+# endif
+_GL_CXXALIAS_SYS (getdelim, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ int delimiter,
+ FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (getdelim);
+#elif defined GNULIB_POSIXCHECK
+# undef getdelim
+# if HAVE_RAW_DECL_GETDELIM
+_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
+ "use gnulib module getdelim for portability");
+# endif
+#endif
+
+#if @GNULIB_GETLINE@
+/* Read a line, up to (and including) the next newline, from STREAM, store it
+ in *LINEPTR (and NUL-terminate it).
+ *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
+ bytes of space. It is realloc'd as necessary.
+ Return the number of bytes read and stored at *LINEPTR (not including the
+ NUL terminator), or -1 on error or EOF. */
+# if @REPLACE_GETLINE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getline
+# define getline rpl_getline
+# endif
+_GL_FUNCDECL_RPL (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream));
+# else
+# if !@HAVE_DECL_GETLINE@
+_GL_FUNCDECL_SYS (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (getline, ssize_t,
+ (char **restrict lineptr, size_t *restrict linesize,
+ FILE *restrict stream));
+# endif
+# if @HAVE_DECL_GETLINE@
+_GL_CXXALIASWARN (getline);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getline
+# if HAVE_RAW_DECL_GETLINE
+_GL_WARN_ON_USE (getline, "getline is unportable - "
+ "use gnulib module getline for portability");
+# endif
+#endif
+
+/* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning; besides, C11
+ removed it. */
+#undef gets
+#if HAVE_RAW_DECL_GETS && !defined __cplusplus
+_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
+
+#if @GNULIB_MDA_GETW@
+/* On native Windows, map 'getw' to '_getw', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::getw always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getw
+# define getw _getw
+# endif
+_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (getw);
+#endif
+
+#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+struct obstack;
+/* Grow an obstack with formatted output. Return the number of
+ bytes added to OBS. No trailing nul byte is added, and the
+ object should be closed with obstack_finish before use. Upon
+ memory allocation error, call obstack_alloc_failed_handler. Upon
+ other error, return -1. */
+# if @REPLACE_OBSTACK_PRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define obstack_printf rpl_obstack_printf
+# endif
+_GL_FUNCDECL_RPL (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...));
+# else
+# if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (obstack_printf, int,
+ (struct obstack *obs, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (obstack_printf);
+# if @REPLACE_OBSTACK_PRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define obstack_vprintf rpl_obstack_vprintf
+# endif
+_GL_FUNCDECL_RPL (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args));
+# else
+# if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (obstack_vprintf, int,
+ (struct obstack *obs, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (obstack_vprintf);
+#endif
+
+#if @GNULIB_PCLOSE@
+# if !@HAVE_PCLOSE@
+_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
+_GL_CXXALIASWARN (pclose);
+#elif defined GNULIB_POSIXCHECK
+# undef pclose
+# if HAVE_RAW_DECL_PCLOSE
+_GL_WARN_ON_USE (pclose, "pclose is unportable - "
+ "use gnulib module pclose for more portability");
+# endif
+#endif
+
+#if @GNULIB_PERROR@
+/* Print a message to standard error, describing the value of ERRNO,
+ (if STRING is not NULL and not empty) prefixed with STRING and ": ",
+ and terminated with a newline. */
+# if @REPLACE_PERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define perror rpl_perror
+# endif
+_GL_FUNCDECL_RPL (perror, void, (const char *string));
+_GL_CXXALIAS_RPL (perror, void, (const char *string));
+# else
+_GL_CXXALIAS_SYS (perror, void, (const char *string));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (perror);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef perror
+/* Assume perror is always declared. */
+_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
+ "use gnulib module perror for portability");
+#endif
+
+#if @GNULIB_POPEN@
+# if @REPLACE_POPEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef popen
+# define popen rpl_popen
+# endif
+_GL_FUNCDECL_RPL (popen, FILE *,
+ (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
+# else
+# if !@HAVE_POPEN@ || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (popen, FILE *,
+ (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+# endif
+_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
+# endif
+_GL_CXXALIASWARN (popen);
+#else
+# if @GNULIB_PCLOSE@ && __GNUC__ >= 11 && !defined popen
+/* For -Wmismatched-dealloc: Associate popen with pclose or rpl_pclose. */
+_GL_FUNCDECL_SYS (popen, FILE *,
+ (const char *cmd, const char *mode)
+ _GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (pclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef popen
+# if HAVE_RAW_DECL_POPEN
+_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
+ "use gnulib module popen or pipe for more portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
+ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if defined __GNUC__ || defined __clang__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+/* Don't break __attribute__((format(printf,M,N))). */
+# define printf __printf__
+# endif
+# if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+ (const char *restrict format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+ (const char *restrict format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define printf rpl_printf
+# endif
+_GL_FUNCDECL_RPL (printf, int,
+ (const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
+# endif
+# define GNULIB_overrides_printf 1
+# else
+_GL_CXXALIAS_SYS (printf, int, (const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (printf);
+# endif
+#endif
+#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_printf
+# undef printf
+# endif
+/* Assume printf is always declared. */
+_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
+ "use gnulib module printf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_PUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putc
+# define putc rpl_fputc
+# endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (putc);
+# endif
+#endif
+
+#if @GNULIB_PUTCHAR@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putchar
+# define putchar rpl_putchar
+# endif
+_GL_FUNCDECL_RPL (putchar, int, (int c));
+_GL_CXXALIAS_RPL (putchar, int, (int c));
+# else
+_GL_CXXALIAS_SYS (putchar, int, (int c));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (putchar);
+# endif
+#endif
+
+#if @GNULIB_PUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef puts
+# define puts rpl_puts
+# endif
+_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (puts, int, (const char *string));
+# else
+_GL_CXXALIAS_SYS (puts, int, (const char *string));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (puts);
+# endif
+#endif
+
+#if @GNULIB_MDA_PUTW@
+/* On native Windows, map 'putw' to '_putw', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::putw always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putw
+# define putw _putw
+# endif
+_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (putw);
+#endif
+
+#if @GNULIB_REMOVE@
+# if @REPLACE_REMOVE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef remove
+# define remove rpl_remove
+# endif
+_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (remove, int, (const char *name));
+# else
+_GL_CXXALIAS_SYS (remove, int, (const char *name));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (remove);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef remove
+/* Assume remove is always declared. */
+_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
+ "use gnulib module remove for more portability");
+#endif
+
+#if @GNULIB_RENAME@
+# if @REPLACE_RENAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rename
+# define rename rpl_rename
+# endif
+_GL_FUNCDECL_RPL (rename, int,
+ (const char *old_filename, const char *new_filename)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (rename, int,
+ (const char *old_filename, const char *new_filename));
+# else
+_GL_CXXALIAS_SYS (rename, int,
+ (const char *old_filename, const char *new_filename));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (rename);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rename
+/* Assume rename is always declared. */
+_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
+ "use gnulib module rename for more portability");
+#endif
+
+#if @GNULIB_RENAMEAT@
+# if @REPLACE_RENAMEAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef renameat
+# define renameat rpl_renameat
+# endif
+_GL_FUNCDECL_RPL (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2)
+ _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2));
+# else
+# if !@HAVE_RENAMEAT@
+_GL_FUNCDECL_SYS (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2)
+ _GL_ARG_NONNULL ((2, 4)));
+# endif
+_GL_CXXALIAS_SYS (renameat, int,
+ (int fd1, char const *file1, int fd2, char const *file2));
+# endif
+_GL_CXXALIASWARN (renameat);
+#elif defined GNULIB_POSIXCHECK
+# undef renameat
+# if HAVE_RAW_DECL_RENAMEAT
+_GL_WARN_ON_USE (renameat, "renameat is not portable - "
+ "use gnulib module renameat for portability");
+# endif
+#endif
+
+#if @GNULIB_SCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if defined __GNUC__ || defined __clang__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef scanf
+/* Don't break __attribute__((format(scanf,M,N))). */
+# define scanf __scanf__
+# endif
+_GL_FUNCDECL_RPL_1 (__scanf__, int,
+ (const char *restrict format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
+# else
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef scanf
+# define scanf rpl_scanf
+# endif
+_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
+# endif
+# else
+_GL_CXXALIAS_SYS (scanf, int, (const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (scanf);
+# endif
+#endif
+
+#if @GNULIB_SNPRINTF@
+# if @REPLACE_SNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define snprintf rpl_snprintf
+# endif
+# define GNULIB_overrides_snprintf 1
+_GL_FUNCDECL_RPL (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...));
+# else
+# if !@HAVE_DECL_SNPRINTF@
+_GL_FUNCDECL_SYS (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (snprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (snprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef snprintf
+# if HAVE_RAW_DECL_SNPRINTF
+_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ "use gnulib module snprintf for portability");
+# endif
+#endif
+
+/* Some people would argue that all sprintf uses should be warned about
+ (for example, OpenBSD issues a link warning for it),
+ since it can cause security holes due to buffer overruns.
+ However, we believe that sprintf can be used safely, and is more
+ efficient than snprintf in those safe cases; and as proof of our
+ belief, we use sprintf in several gnulib modules. So this header
+ intentionally avoids adding a warning to sprintf except when
+ GNULIB_POSIXCHECK is defined. */
+
+#if @GNULIB_SPRINTF_POSIX@
+# if @REPLACE_SPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define sprintf rpl_sprintf
+# endif
+# define GNULIB_overrides_sprintf 1
+_GL_FUNCDECL_RPL (sprintf, int,
+ (char *restrict str, const char *restrict format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (sprintf, int,
+ (char *restrict str, const char *restrict format, ...));
+# else
+_GL_CXXALIAS_SYS (sprintf, int,
+ (char *restrict str, const char *restrict format, ...));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (sprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sprintf
+/* Assume sprintf is always declared. */
+_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
+ "use gnulib module sprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_MDA_TEMPNAM@
+/* On native Windows, map 'tempnam' to '_tempnam', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::tempnam always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tempnam
+# define tempnam _tempnam
+# endif
+_GL_CXXALIAS_MDA (tempnam, char *, (const char *dir, const char *prefix));
+# else
+_GL_CXXALIAS_SYS (tempnam, char *, (const char *dir, const char *prefix));
+# endif
+_GL_CXXALIASWARN (tempnam);
+#endif
+
+#if @GNULIB_TMPFILE@
+# if @REPLACE_TMPFILE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define tmpfile rpl_tmpfile
+# endif
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void)
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (tmpfile);
+# endif
+#else
+# if @GNULIB_FCLOSE@ && __GNUC__ >= 11 && !defined tmpfile
+/* For -Wmismatched-dealloc: Associate tmpfile with fclose or rpl_fclose. */
+_GL_FUNCDECL_SYS (tmpfile, FILE *, (void)
+ _GL_ATTRIBUTE_DEALLOC (fclose, 1));
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef tmpfile
+# if HAVE_RAW_DECL_TMPFILE
+_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
+ "use gnulib module tmpfile for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_VASPRINTF@
+/* Write formatted output to a string dynamically allocated with malloc().
+ If the memory allocation succeeds, store the address of the string in
+ *RESULT and return the number of resulting bytes, excluding the trailing
+ NUL. Upon memory allocation error, or some other error, return -1. */
+# if @REPLACE_VASPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define asprintf rpl_asprintf
+# endif
+# define GNULIB_overrides_asprintf
+_GL_FUNCDECL_RPL (asprintf, int,
+ (char **result, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (asprintf, int,
+ (char **result, const char *format, ...));
+# else
+# if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (asprintf, int,
+ (char **result, const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (asprintf, int,
+ (char **result, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (asprintf);
+# if @REPLACE_VASPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vasprintf rpl_vasprintf
+# endif
+# define GNULIB_overrides_vasprintf 1
+_GL_FUNCDECL_RPL (vasprintf, int,
+ (char **result, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vasprintf, int,
+ (char **result, const char *format, va_list args));
+# else
+# if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (vasprintf, int,
+ (char **result, const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (vasprintf, int,
+ (char **result, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vasprintf);
+#endif
+
+#if @GNULIB_VDPRINTF@
+# if @REPLACE_VDPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vdprintf rpl_vdprintf
+# endif
+_GL_FUNCDECL_RPL (vdprintf, int,
+ (int fd, const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (vdprintf, int,
+ (int fd, const char *restrict format, va_list args));
+# else
+# if !@HAVE_VDPRINTF@
+_GL_FUNCDECL_SYS (vdprintf, int,
+ (int fd, const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((2)));
+# endif
+/* Need to cast, because on Solaris, the third parameter will likely be
+ __va_list args. */
+_GL_CXXALIAS_SYS_CAST (vdprintf, int,
+ (int fd, const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vdprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vdprintf
+# if HAVE_RAW_DECL_VDPRINTF
+_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
+ "use gnulib module vdprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
+ || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vfprintf rpl_vfprintf
+# endif
+# define GNULIB_overrides_vfprintf 1
+# if @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# else
+_GL_FUNCDECL_RPL (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_RPL (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vfprintf, int,
+ (FILE *restrict fp,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vfprintf);
+# endif
+#endif
+#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vfprintf
+# undef vfprintf
+# endif
+/* Assume vfprintf is always declared. */
+_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
+ "use gnulib module vfprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_VFSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef vfscanf
+# define vfscanf rpl_vfscanf
+# endif
+_GL_FUNCDECL_RPL (vfscanf, int,
+ (FILE *restrict stream,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vfscanf, int,
+ (FILE *restrict stream,
+ const char *restrict format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vfscanf, int,
+ (FILE *restrict stream,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vfscanf);
+# endif
+#endif
+
+#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
+ || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vprintf rpl_vprintf
+# endif
+# define GNULIB_overrides_vprintf 1
+# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# else
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_RPL (vprintf, int, (const char *restrict format, va_list args));
+# else
+/* Need to cast, because on Solaris, the second parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vprintf, int,
+ (const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vprintf);
+# endif
+#endif
+#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vprintf
+# undef vprintf
+# endif
+/* Assume vprintf is always declared. */
+_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
+ "use gnulib module vprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#if @GNULIB_VSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef vscanf
+# define vscanf rpl_vscanf
+# endif
+_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vscanf);
+# endif
+#endif
+
+#if @GNULIB_VSNPRINTF@
+# if @REPLACE_VSNPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vsnprintf rpl_vsnprintf
+# endif
+# define GNULIB_overrides_vsnprintf 1
+_GL_FUNCDECL_RPL (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
+ _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args));
+# else
+# if !@HAVE_DECL_VSNPRINTF@
+_GL_FUNCDECL_SYS (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
+ _GL_ARG_NONNULL ((3)));
+# endif
+_GL_CXXALIAS_SYS (vsnprintf, int,
+ (char *restrict str, size_t size,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vsnprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsnprintf
+# if HAVE_RAW_DECL_VSNPRINTF
+_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
+ "use gnulib module vsnprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_VSPRINTF_POSIX@
+# if @REPLACE_VSPRINTF@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define vsprintf rpl_vsprintf
+# endif
+# define GNULIB_overrides_vsprintf 1
+_GL_FUNCDECL_RPL (vsprintf, int,
+ (char *restrict str,
+ const char *restrict format, va_list args)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vsprintf, int,
+ (char *restrict str,
+ const char *restrict format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+ __va_list args
+ and GCC's fixincludes did not change this to __gnuc_va_list. */
+_GL_CXXALIAS_SYS_CAST (vsprintf, int,
+ (char *restrict str,
+ const char *restrict format, va_list args));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (vsprintf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsprintf
+/* Assume vsprintf is always declared. */
+_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
+ "use gnulib module vsprintf-posix for portable "
+ "POSIX compliance");
+#endif
+
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
new file mode 100644
index 0000000..b79e5f7
--- /dev/null
+++ b/gl/stdlib.in.h
@@ -0,0 +1,1563 @@
+/* A GNU-like <stdlib.h>.
+
+ Copyright (C) 1995, 2001-2004, 2006-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+/* Special invocation conventions inside some gnulib header files,
+ and inside some glibc header files, respectively. */
+
+#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STDLIB_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+
+#ifndef _@GUARD_PREFIX@_STDLIB_H
+#define _@GUARD_PREFIX@_STDLIB_H
+
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
+
+/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
+#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
+# include <sys/wait.h>
+#endif
+
+/* Solaris declares getloadavg() in <sys/loadavg.h>. */
+#if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+# include <sys/time.h>
+# include <sys/loadavg.h>
+#endif
+
+/* Native Windows platforms declare _mktemp() in <io.h>. */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <io.h>
+#endif
+
+#if @GNULIB_RANDOM_R@
+
+/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
+ from <stdlib.h> if _REENTRANT is defined. Include it whenever we need
+ 'struct random_data'. */
+# if @HAVE_RANDOM_H@
+# include <random.h>
+# endif
+
+# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
+# include <stdint.h>
+# endif
+
+# if !@HAVE_STRUCT_RANDOM_DATA@
+/* Define 'struct random_data'.
+ But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
+# if !GNULIB_defined_struct_random_data
+struct random_data
+{
+ int32_t *fptr; /* Front pointer. */
+ int32_t *rptr; /* Rear pointer. */
+ int32_t *state; /* Array of state values. */
+ int rand_type; /* Type of random number generator. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
+ int32_t *end_ptr; /* Pointer behind state table. */
+};
+# define GNULIB_defined_struct_random_data 1
+# endif
+# endif
+#endif
+
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
+/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
+/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
+/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps. */
+/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
+/* But avoid namespace pollution on glibc systems and native Windows. */
+# include <unistd.h>
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definition of _Noreturn is copied here. */
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Some systems do not define EXIT_*, despite otherwise supporting C89. */
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+#endif
+/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
+ with proper operation of xargs. */
+#ifndef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#elif EXIT_FAILURE != 1
+# undef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#endif
+
+
+#if @GNULIB__EXIT@
+/* Terminate the current process with the given return code, without running
+ the 'atexit' handlers. */
+# if !@HAVE__EXIT@
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
+# endif
+_GL_CXXALIAS_SYS (_Exit, void, (int status));
+_GL_CXXALIASWARN (_Exit);
+#elif defined GNULIB_POSIXCHECK
+# undef _Exit
+# if HAVE_RAW_DECL__EXIT
+_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
+ "use gnulib module _Exit for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FREE_POSIX@
+# if @REPLACE_FREE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef free
+# define free rpl_free
+# endif
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
+# else
+_GL_FUNCDECL_RPL (free, void, (void *ptr));
+# endif
+_GL_CXXALIAS_RPL (free, void, (void *ptr));
+# else
+_GL_CXXALIAS_SYS (free, void, (void *ptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (free);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef free
+/* Assume free is always declared. */
+_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
+ "use gnulib module free for portability");
+#endif
+
+
+/* Allocate memory with indefinite extent and specified alignment. */
+#if @GNULIB_ALIGNED_ALLOC@
+# if @REPLACE_ALIGNED_ALLOC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef aligned_alloc
+# define aligned_alloc rpl_aligned_alloc
+# endif
+_GL_FUNCDECL_RPL (aligned_alloc, void *,
+ (size_t alignment, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
+# else
+# if @HAVE_ALIGNED_ALLOC@
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (aligned_alloc, void *,
+ (size_t alignment, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
+# endif
+# endif
+# if (__GLIBC__ >= 2) && @HAVE_ALIGNED_ALLOC@
+_GL_CXXALIASWARN (aligned_alloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined aligned_alloc
+/* For -Wmismatched-dealloc: Associate aligned_alloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (aligned_alloc, void *,
+ (size_t alignment, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef aligned_alloc
+# if HAVE_RAW_DECL_ALIGNED_ALLOC
+_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
+ "use gnulib module aligned_alloc for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_ATOLL@
+/* Parse a signed decimal integer.
+ Returns the value of the integer. Errors are not detected. */
+# if !@HAVE_ATOLL@
+_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
+_GL_CXXALIASWARN (atoll);
+#elif defined GNULIB_POSIXCHECK
+# undef atoll
+# if HAVE_RAW_DECL_ATOLL
+_GL_WARN_ON_USE (atoll, "atoll is unportable - "
+ "use gnulib module atoll for portability");
+# endif
+#endif
+
+#if @GNULIB_CALLOC_POSIX@
+# if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
+ || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef calloc
+# define calloc rpl_calloc
+# endif
+_GL_FUNCDECL_RPL (calloc, void *,
+ (size_t nmemb, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (calloc, void *,
+ (size_t nmemb, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (calloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined calloc
+/* For -Wmismatched-dealloc: Associate calloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (calloc, void *,
+ (size_t nmemb, size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef calloc
+/* Assume calloc is always declared. */
+_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
+ "use gnulib module calloc-posix for portability");
+# endif
+#endif
+
+#if @GNULIB_CANONICALIZE_FILE_NAME@
+# if @REPLACE_CANONICALIZE_FILE_NAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define canonicalize_file_name rpl_canonicalize_file_name
+# endif
+_GL_FUNCDECL_RPL (canonicalize_file_name, char *,
+ (const char *name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
+# else
+# if !@HAVE_CANONICALIZE_FILE_NAME@ || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
+ (const char *name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
+# endif
+# ifndef GNULIB_defined_canonicalize_file_name
+# define GNULIB_defined_canonicalize_file_name \
+ (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
+# endif
+_GL_CXXALIASWARN (canonicalize_file_name);
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined canonicalize_file_name
+/* For -Wmismatched-dealloc: Associate canonicalize_file_name with free or
+ rpl_free. */
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *,
+ (const char *name)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef canonicalize_file_name
+# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+_GL_WARN_ON_USE (canonicalize_file_name,
+ "canonicalize_file_name is unportable - "
+ "use gnulib module canonicalize-lgpl for portability");
+# endif
+# endif
+#endif
+
+#if @GNULIB_MDA_ECVT@
+/* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ecvt
+# define ecvt _ecvt
+# endif
+_GL_CXXALIAS_MDA (ecvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# else
+# if @HAVE_DECL_ECVT@
+_GL_CXXALIAS_SYS (ecvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@
+_GL_CXXALIASWARN (ecvt);
+# endif
+#endif
+
+#if @GNULIB_MDA_FCVT@
+/* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fcvt
+# define fcvt _fcvt
+# endif
+_GL_CXXALIAS_MDA (fcvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# else
+# if @HAVE_DECL_FCVT@
+_GL_CXXALIAS_SYS (fcvt, char *,
+ (double number, int ndigits, int *decptp, int *signp));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@
+_GL_CXXALIASWARN (fcvt);
+# endif
+#endif
+
+#if @GNULIB_MDA_GCVT@
+/* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gcvt
+# define gcvt _gcvt
+# endif
+_GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf));
+# else
+# if @HAVE_DECL_GCVT@
+_GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@
+_GL_CXXALIASWARN (gcvt);
+# endif
+#endif
+
+#if @GNULIB_GETLOADAVG@
+/* Store max(NELEM,3) load average numbers in LOADAVG[].
+ The three numbers are the load average of the last 1 minute, the last 5
+ minutes, and the last 15 minutes, respectively.
+ LOADAVG is an array of NELEM numbers. */
+# if !@HAVE_DECL_GETLOADAVG@
+_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
+_GL_CXXALIASWARN (getloadavg);
+#elif defined GNULIB_POSIXCHECK
+# undef getloadavg
+# if HAVE_RAW_DECL_GETLOADAVG
+_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
+ "use gnulib module getloadavg for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSUBOPT@
+/* Assuming *OPTIONP is a comma separated list of elements of the form
+ "token" or "token=value", getsubopt parses the first of these elements.
+ If the first element refers to a "token" that is member of the given
+ NULL-terminated array of tokens:
+ - It replaces the comma with a NUL byte, updates *OPTIONP to point past
+ the first option and the comma, sets *VALUEP to the value of the
+ element (or NULL if it doesn't contain an "=" sign),
+ - It returns the index of the "token" in the given array of tokens.
+ Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
+ For more details see the POSIX specification.
+ https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
+# if !@HAVE_GETSUBOPT@
+_GL_FUNCDECL_SYS (getsubopt, int,
+ (char **optionp, char *const *tokens, char **valuep)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (getsubopt, int,
+ (char **optionp, char *const *tokens, char **valuep));
+_GL_CXXALIASWARN (getsubopt);
+#elif defined GNULIB_POSIXCHECK
+# undef getsubopt
+# if HAVE_RAW_DECL_GETSUBOPT
+_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
+ "use gnulib module getsubopt for portability");
+# endif
+#endif
+
+#if @GNULIB_GRANTPT@
+/* Change the ownership and access permission of the slave side of the
+ pseudo-terminal whose master side is specified by FD. */
+# if !@HAVE_GRANTPT@
+_GL_FUNCDECL_SYS (grantpt, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (grantpt, int, (int fd));
+_GL_CXXALIASWARN (grantpt);
+#elif defined GNULIB_POSIXCHECK
+# undef grantpt
+# if HAVE_RAW_DECL_GRANTPT
+_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
+ "use gnulib module grantpt for portability");
+# endif
+#endif
+
+/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
+ rely on GNU or POSIX semantics for malloc and realloc (for example,
+ by never specifying a zero size), so it does not need malloc or
+ realloc to be redefined. */
+#if @GNULIB_MALLOC_POSIX@
+# if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
+ || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
+# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+ || _GL_USE_STDLIB_ALLOC)
+# undef malloc
+# define malloc rpl_malloc
+# endif
+_GL_FUNCDECL_RPL (malloc, void *,
+ (size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (malloc, void *,
+ (size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (malloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined malloc
+/* For -Wmismatched-dealloc: Associate malloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (malloc, void *,
+ (size_t size)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
+# undef malloc
+/* Assume malloc is always declared. */
+_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
+ "use gnulib module malloc-posix for portability");
+# endif
+#endif
+
+/* Convert a multibyte character to a wide character. */
+#if @GNULIB_MBTOWC@
+# if @REPLACE_MBTOWC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbtowc
+# define mbtowc rpl_mbtowc
+# endif
+_GL_FUNCDECL_RPL (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+_GL_CXXALIAS_RPL (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+# else
+# if !@HAVE_MBTOWC@
+_GL_FUNCDECL_SYS (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+# endif
+_GL_CXXALIAS_SYS (mbtowc, int,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbtowc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbtowc
+# if HAVE_RAW_DECL_MBTOWC
+_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
+ "use gnulib module mbtowc for portability");
+# endif
+#endif
+
+#if @GNULIB_MKDTEMP@
+/* Create a unique temporary directory from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the directory name unique.
+ Returns TEMPLATE, or a null pointer if it cannot get a unique name.
+ The directory is created mode 700. */
+# if !@HAVE_MKDTEMP@
+_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
+_GL_CXXALIASWARN (mkdtemp);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdtemp
+# if HAVE_RAW_DECL_MKDTEMP
+_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
+ "use gnulib module mkdtemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKOSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ The file is then created, with the specified flags, ensuring it didn't exist
+ before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if !@HAVE_MKOSTEMP@
+_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemp);
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemp
+# if HAVE_RAW_DECL_MKOSTEMP
+_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
+ "use gnulib module mkostemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKOSTEMPS@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE before a suffix of length
+ SUFFIXLEN must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ The file is then created, with the specified flags, ensuring it didn't exist
+ before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if !@HAVE_MKOSTEMPS@
+_GL_FUNCDECL_SYS (mkostemps, int,
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkostemps, int,
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemps);
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemps
+# if HAVE_RAW_DECL_MKOSTEMPS
+_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
+ "use gnulib module mkostemps for portability");
+# endif
+#endif
+
+#if @GNULIB_MKSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The file is then created, ensuring it didn't exist before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if @REPLACE_MKSTEMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mkstemp rpl_mkstemp
+# endif
+_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
+# else
+# if ! @HAVE_MKSTEMP@
+_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
+# endif
+_GL_CXXALIASWARN (mkstemp);
+#elif defined GNULIB_POSIXCHECK
+# undef mkstemp
+# if HAVE_RAW_DECL_MKSTEMP
+_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
+ "use gnulib module mkstemp for portability");
+# endif
+#endif
+
+#if @GNULIB_MKSTEMPS@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE prior to a suffix of length
+ SUFFIXLEN must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The file is then created, ensuring it didn't exist before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+# if !@HAVE_MKSTEMPS@
+_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
+_GL_CXXALIASWARN (mkstemps);
+#elif defined GNULIB_POSIXCHECK
+# undef mkstemps
+# if HAVE_RAW_DECL_MKSTEMPS
+_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
+ "use gnulib module mkstemps for portability");
+# endif
+#endif
+
+#if @GNULIB_MDA_MKTEMP@
+/* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::mktemp always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mktemp
+# define mktemp _mktemp
+# endif
+_GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/));
+# else
+_GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/));
+# endif
+_GL_CXXALIASWARN (mktemp);
+#endif
+
+/* Allocate memory with indefinite extent and specified alignment. */
+#if @GNULIB_POSIX_MEMALIGN@
+# if @REPLACE_POSIX_MEMALIGN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef posix_memalign
+# define posix_memalign rpl_posix_memalign
+# endif
+_GL_FUNCDECL_RPL (posix_memalign, int,
+ (void **memptr, size_t alignment, size_t size)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (posix_memalign, int,
+ (void **memptr, size_t alignment, size_t size));
+# else
+# if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIAS_SYS (posix_memalign, int,
+ (void **memptr, size_t alignment, size_t size));
+# endif
+# endif
+# if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIASWARN (posix_memalign);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_memalign
+# if HAVE_RAW_DECL_POSIX_MEMALIGN
+_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
+ "use gnulib module posix_memalign for portability");
+# endif
+#endif
+
+#if @GNULIB_POSIX_OPENPT@
+/* Return an FD open to the master side of a pseudo-terminal. Flags should
+ include O_RDWR, and may also include O_NOCTTY. */
+# if !@HAVE_POSIX_OPENPT@
+_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
+# endif
+_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
+_GL_CXXALIASWARN (posix_openpt);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_openpt
+# if HAVE_RAW_DECL_POSIX_OPENPT
+_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
+ "use gnulib module posix_openpt for portability");
+# endif
+#endif
+
+#if @GNULIB_PTSNAME@
+/* Return the pathname of the pseudo-terminal slave associated with
+ the master FD is open on, or NULL on errors. */
+# if @REPLACE_PTSNAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ptsname
+# define ptsname rpl_ptsname
+# endif
+_GL_FUNCDECL_RPL (ptsname, char *, (int fd));
+_GL_CXXALIAS_RPL (ptsname, char *, (int fd));
+# else
+# if !@HAVE_PTSNAME@
+_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
+# endif
+_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
+# endif
+_GL_CXXALIASWARN (ptsname);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname
+# if HAVE_RAW_DECL_PTSNAME
+_GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
+ "use gnulib module ptsname for portability");
+# endif
+#endif
+
+#if @GNULIB_PTSNAME_R@
+/* Set the pathname of the pseudo-terminal slave associated with
+ the master FD is open on and return 0, or set errno and return
+ non-zero on errors. */
+# if @REPLACE_PTSNAME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ptsname_r
+# define ptsname_r rpl_ptsname_r
+# endif
+_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+# else
+# if !@HAVE_PTSNAME_R@
+_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+# endif
+_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+# endif
+# ifndef GNULIB_defined_ptsname_r
+# define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
+# endif
+_GL_CXXALIASWARN (ptsname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname_r
+# if HAVE_RAW_DECL_PTSNAME_R
+_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
+ "use gnulib module ptsname_r for portability");
+# endif
+#endif
+
+#if @GNULIB_PUTENV@
+# if @REPLACE_PUTENV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putenv
+# define putenv rpl_putenv
+# endif
+_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (putenv, int, (char *string));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putenv
+# define putenv _putenv
+# endif
+_GL_CXXALIAS_MDA (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
+# endif
+_GL_CXXALIASWARN (putenv);
+#elif @GNULIB_MDA_PUTENV@
+/* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::putenv always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef putenv
+# define putenv _putenv
+# endif
+/* Need to cast, because on mingw, the parameter is either
+ 'const char *string' or 'char *string'. */
+_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
+# endif
+_GL_CXXALIASWARN (putenv);
+#endif
+
+#if @GNULIB_QSORT_R@
+/* Sort an array of NMEMB elements, starting at address BASE, each element
+ occupying SIZE bytes, in ascending order according to the comparison
+ function COMPARE. */
+# ifdef __cplusplus
+extern "C" {
+# endif
+# if !GNULIB_defined_qsort_r_fn_types
+typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
+# define GNULIB_defined_qsort_r_fn_types 1
+# endif
+# ifdef __cplusplus
+}
+# endif
+# if @REPLACE_QSORT_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef qsort_r
+# define qsort_r rpl_qsort_r
+# endif
+_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg) _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg));
+# else
+# if !@HAVE_QSORT_R@
+_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg) _GL_ARG_NONNULL ((1, 4)));
+# endif
+_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
+ _gl_qsort_r_compar_fn compare,
+ void *arg));
+# endif
+_GL_CXXALIASWARN (qsort_r);
+#elif defined GNULIB_POSIXCHECK
+# undef qsort_r
+# if HAVE_RAW_DECL_QSORT_R
+_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
+ "use gnulib module qsort_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+# ifndef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_RANDOM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef random
+# define random rpl_random
+# endif
+_GL_FUNCDECL_RPL (random, long, (void));
+_GL_CXXALIAS_RPL (random, long, (void));
+# else
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (random, long, (void));
+# endif
+/* Need to cast, because on Haiku, the return type is
+ int. */
+_GL_CXXALIAS_SYS_CAST (random, long, (void));
+# endif
+_GL_CXXALIASWARN (random);
+#elif defined GNULIB_POSIXCHECK
+# undef random
+# if HAVE_RAW_DECL_RANDOM
+_GL_WARN_ON_USE (random, "random is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_RANDOM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef srandom
+# define srandom rpl_srandom
+# endif
+_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
+_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
+# else
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
+# endif
+/* Need to cast, because on FreeBSD, the first parameter is
+ unsigned long seed. */
+_GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
+# endif
+_GL_CXXALIASWARN (srandom);
+#elif defined GNULIB_POSIXCHECK
+# undef srandom
+# if HAVE_RAW_DECL_SRANDOM
+_GL_WARN_ON_USE (srandom, "srandom is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_INITSTATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef initstate
+# define initstate rpl_initstate
+# endif
+_GL_FUNCDECL_RPL (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size));
+# else
+# if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
+_GL_FUNCDECL_SYS (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size)
+ _GL_ARG_NONNULL ((2)));
+# endif
+/* Need to cast, because on FreeBSD, the first parameter is
+ unsigned long seed. */
+_GL_CXXALIAS_SYS_CAST (initstate, char *,
+ (unsigned int seed, char *buf, size_t buf_size));
+# endif
+_GL_CXXALIASWARN (initstate);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate
+# if HAVE_RAW_DECL_INITSTATE
+_GL_WARN_ON_USE (initstate, "initstate is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if @REPLACE_SETSTATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setstate
+# define setstate rpl_setstate
+# endif
+_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
+# else
+# if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
+ is const char *arg_state. */
+_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
+# endif
+_GL_CXXALIASWARN (setstate);
+#elif defined GNULIB_POSIXCHECK
+# undef setstate
+# if HAVE_RAW_DECL_SETSTATE
+_GL_WARN_ON_USE (setstate, "setstate is unportable - "
+ "use gnulib module random for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef random_r
+# define random_r rpl_random_r
+# endif
+_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
+# endif
+_GL_CXXALIASWARN (random_r);
+#elif defined GNULIB_POSIXCHECK
+# undef random_r
+# if HAVE_RAW_DECL_RANDOM_R
+_GL_WARN_ON_USE (random_r, "random_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef srandom_r
+# define srandom_r rpl_srandom_r
+# endif
+_GL_FUNCDECL_RPL (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (srandom_r, int,
+ (unsigned int seed, struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (srandom_r);
+#elif defined GNULIB_POSIXCHECK
+# undef srandom_r
+# if HAVE_RAW_DECL_SRANDOM_R
+_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef initstate_r
+# define initstate_r rpl_initstate_r
+# endif
+_GL_FUNCDECL_RPL (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state)
+ _GL_ARG_NONNULL ((2, 4)));
+# endif
+/* Need to cast, because on Haiku, the third parameter is
+ unsigned long buf_size. */
+_GL_CXXALIAS_SYS_CAST (initstate_r, int,
+ (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (initstate_r);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate_r
+# if HAVE_RAW_DECL_INITSTATE_R
+_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setstate_r
+# define setstate_r rpl_setstate_r
+# endif
+_GL_FUNCDECL_RPL (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state));
+# else
+# if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+/* Need to cast, because on Haiku, the first parameter is
+ void *arg_state. */
+_GL_CXXALIAS_SYS_CAST (setstate_r, int,
+ (char *arg_state, struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (setstate_r);
+#elif defined GNULIB_POSIXCHECK
+# undef setstate_r
+# if HAVE_RAW_DECL_SETSTATE_R
+_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
+ "use gnulib module random_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_REALLOC_POSIX@
+# if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \
+ || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@)
+# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+ || _GL_USE_STDLIB_ALLOC)
+# undef realloc
+# define realloc rpl_realloc
+# endif
+_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size)
+ _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
+# else
+# if __GNUC__ >= 11
+/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
+ _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (realloc);
+# endif
+#else
+# if @GNULIB_FREE_POSIX@ && __GNUC__ >= 11 && !defined realloc
+/* For -Wmismatched-dealloc: Associate realloc with free or rpl_free. */
+_GL_FUNCDECL_SYS (realloc, void *, (void *ptr, size_t size)
+ _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
+# undef realloc
+/* Assume realloc is always declared. */
+_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
+ "use gnulib module realloc-posix for portability");
+# endif
+#endif
+
+
+#if @GNULIB_REALLOCARRAY@
+# if @REPLACE_REALLOCARRAY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef reallocarray
+# define reallocarray rpl_reallocarray
+# endif
+_GL_FUNCDECL_RPL (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+_GL_CXXALIAS_RPL (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+# else
+# if ! @HAVE_REALLOCARRAY@
+_GL_FUNCDECL_SYS (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+# endif
+_GL_CXXALIAS_SYS (reallocarray, void *,
+ (void *ptr, size_t nmemb, size_t size));
+# endif
+_GL_CXXALIASWARN (reallocarray);
+#elif defined GNULIB_POSIXCHECK
+# undef reallocarray
+# if HAVE_RAW_DECL_REALLOCARRAY
+_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
+ "use gnulib module reallocarray for portability");
+# endif
+#endif
+
+#if @GNULIB_REALPATH@
+# if @REPLACE_REALPATH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define realpath rpl_realpath
+# endif
+_GL_FUNCDECL_RPL (realpath, char *,
+ (const char *restrict name, char *restrict resolved)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (realpath, char *,
+ (const char *restrict name, char *restrict resolved));
+# else
+# if !@HAVE_REALPATH@
+_GL_FUNCDECL_SYS (realpath, char *,
+ (const char *restrict name, char *restrict resolved)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (realpath, char *,
+ (const char *restrict name, char *restrict resolved));
+# endif
+_GL_CXXALIASWARN (realpath);
+#elif defined GNULIB_POSIXCHECK
+# undef realpath
+# if HAVE_RAW_DECL_REALPATH
+_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
+ "canonicalize or canonicalize-lgpl for portability");
+# endif
+#endif
+
+#if @GNULIB_RPMATCH@
+/* Test a user response to a question.
+ Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
+# if !@HAVE_RPMATCH@
+_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
+_GL_CXXALIASWARN (rpmatch);
+#elif defined GNULIB_POSIXCHECK
+# undef rpmatch
+# if HAVE_RAW_DECL_RPMATCH
+_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
+ "use gnulib module rpmatch for portability");
+# endif
+#endif
+
+#if @GNULIB_SECURE_GETENV@
+/* Look up NAME in the environment, returning 0 in insecure situations. */
+# if !@HAVE_SECURE_GETENV@
+_GL_FUNCDECL_SYS (secure_getenv, char *,
+ (char const *name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (secure_getenv, char *, (char const *name));
+_GL_CXXALIASWARN (secure_getenv);
+#elif defined GNULIB_POSIXCHECK
+# undef secure_getenv
+# if HAVE_RAW_DECL_SECURE_GETENV
+_GL_WARN_ON_USE (secure_getenv, "secure_getenv is unportable - "
+ "use gnulib module secure_getenv for portability");
+# endif
+#endif
+
+#if @GNULIB_SETENV@
+/* Set NAME to VALUE in the environment.
+ If REPLACE is nonzero, overwrite an existing value. */
+# if @REPLACE_SETENV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setenv
+# define setenv rpl_setenv
+# endif
+_GL_FUNCDECL_RPL (setenv, int,
+ (const char *name, const char *value, int replace)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (setenv, int,
+ (const char *name, const char *value, int replace));
+# else
+# if !@HAVE_DECL_SETENV@
+_GL_FUNCDECL_SYS (setenv, int,
+ (const char *name, const char *value, int replace)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (setenv, int,
+ (const char *name, const char *value, int replace));
+# endif
+# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
+_GL_CXXALIASWARN (setenv);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef setenv
+# if HAVE_RAW_DECL_SETENV
+_GL_WARN_ON_USE (setenv, "setenv is unportable - "
+ "use gnulib module setenv for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOD@
+ /* Parse a double from STRING, updating ENDP if appropriate. */
+# if @REPLACE_STRTOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtod rpl_strtod
+# endif
+# define GNULIB_defined_strtod_function 1
+_GL_FUNCDECL_RPL (strtod, double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtod, double,
+ (const char *restrict str, char **restrict endp));
+# else
+# if !@HAVE_STRTOD@
+_GL_FUNCDECL_SYS (strtod, double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtod, double,
+ (const char *restrict str, char **restrict endp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strtod);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtod
+# if HAVE_RAW_DECL_STRTOD
+_GL_WARN_ON_USE (strtod, "strtod is unportable - "
+ "use gnulib module strtod for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOLD@
+ /* Parse a 'long double' from STRING, updating ENDP if appropriate. */
+# if @REPLACE_STRTOLD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtold rpl_strtold
+# endif
+# define GNULIB_defined_strtold_function 1
+_GL_FUNCDECL_RPL (strtold, long double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtold, long double,
+ (const char *restrict str, char **restrict endp));
+# else
+# if !@HAVE_STRTOLD@
+_GL_FUNCDECL_SYS (strtold, long double,
+ (const char *restrict str, char **restrict endp)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtold, long double,
+ (const char *restrict str, char **restrict endp));
+# endif
+_GL_CXXALIASWARN (strtold);
+#elif defined GNULIB_POSIXCHECK
+# undef strtold
+# if HAVE_RAW_DECL_STRTOLD
+_GL_WARN_ON_USE (strtold, "strtold is unportable - "
+ "use gnulib module strtold for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOL@
+/* Parse a signed integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set
+ to ERANGE. */
+# if @REPLACE_STRTOL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtol rpl_strtol
+# endif
+# define GNULIB_defined_strtol_function 1
+_GL_FUNCDECL_RPL (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOL@
+_GL_FUNCDECL_SYS (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtol, long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strtol);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtol
+# if HAVE_RAW_DECL_STRTOL
+_GL_WARN_ON_USE (strtol, "strtol is unportable - "
+ "use gnulib module strtol for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOLL@
+/* Parse a signed integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
+ to ERANGE. */
+# if @REPLACE_STRTOLL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtoll rpl_strtoll
+# endif
+# define GNULIB_defined_strtoll_function 1
+_GL_FUNCDECL_RPL (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOLL@
+_GL_FUNCDECL_SYS (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoll, long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+_GL_CXXALIASWARN (strtoll);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoll
+# if HAVE_RAW_DECL_STRTOLL
+_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
+ "use gnulib module strtoll for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOUL@
+/* Parse an unsigned integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE. */
+# if @REPLACE_STRTOUL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtoul rpl_strtoul
+# endif
+# define GNULIB_defined_strtoul_function 1
+_GL_FUNCDECL_RPL (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOUL@
+_GL_FUNCDECL_SYS (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoul, unsigned long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strtoul);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtoul
+# if HAVE_RAW_DECL_STRTOUL
+_GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
+ "use gnulib module strtoul for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOULL@
+/* Parse an unsigned integer whose textual representation starts at STRING.
+ The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+ it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+ "0x").
+ If ENDPTR is not NULL, the address of the first byte after the integer is
+ stored in *ENDPTR.
+ Upon overflow, the return value is ULLONG_MAX, and errno is set to
+ ERANGE. */
+# if @REPLACE_STRTOULL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strtoull rpl_strtoull
+# endif
+# define GNULIB_defined_strtoull_function 1
+_GL_FUNCDECL_RPL (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# else
+# if !@HAVE_STRTOULL@
+_GL_FUNCDECL_SYS (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strtoull, unsigned long long,
+ (const char *restrict string, char **restrict endptr,
+ int base));
+# endif
+_GL_CXXALIASWARN (strtoull);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoull
+# if HAVE_RAW_DECL_STRTOULL
+_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
+ "use gnulib module strtoull for portability");
+# endif
+#endif
+
+#if @GNULIB_UNLOCKPT@
+/* Unlock the slave side of the pseudo-terminal whose master side is specified
+ by FD, so that it can be opened. */
+# if !@HAVE_UNLOCKPT@
+_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
+_GL_CXXALIASWARN (unlockpt);
+#elif defined GNULIB_POSIXCHECK
+# undef unlockpt
+# if HAVE_RAW_DECL_UNLOCKPT
+_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
+ "use gnulib module unlockpt for portability");
+# endif
+#endif
+
+#if @GNULIB_UNSETENV@
+/* Remove the variable NAME from the environment. */
+# if @REPLACE_UNSETENV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unsetenv
+# define unsetenv rpl_unsetenv
+# endif
+_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
+# else
+# if !@HAVE_DECL_UNSETENV@
+_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
+# endif
+# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
+_GL_CXXALIASWARN (unsetenv);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef unsetenv
+# if HAVE_RAW_DECL_UNSETENV
+_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
+ "use gnulib module unsetenv for portability");
+# endif
+#endif
+
+/* Convert a wide character to a multibyte character. */
+#if @GNULIB_WCTOMB@
+# if @REPLACE_WCTOMB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wctomb
+# define wctomb rpl_wctomb
+# endif
+_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
+_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
+# else
+_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctomb);
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif
diff --git a/gl/str-two-way.h b/gl/str-two-way.h
new file mode 100644
index 0000000..dfe7022
--- /dev/null
+++ b/gl/str-two-way.h
@@ -0,0 +1,452 @@
+/* Byte-wise substring search, using the Two-Way algorithm.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Written by Eric Blake <ebb9@byu.net>, 2008.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Before including this file, you need to include <config.h> and
+ <string.h>, and define:
+ RETURN_TYPE A macro that expands to the return type.
+ AVAILABLE(h, h_l, j, n_l)
+ A macro that returns nonzero if there are
+ at least N_L bytes left starting at H[J].
+ H is 'unsigned char *', H_L, J, and N_L
+ are 'size_t'; H_L is an lvalue. For
+ NUL-terminated searches, H_L can be
+ modified each iteration to avoid having
+ to compute the end of H up front.
+
+ For case-insensitivity, you may optionally define:
+ CMP_FUNC(p1, p2, l) A macro that returns 0 iff the first L
+ characters of P1 and P2 are equal.
+ CANON_ELEMENT(c) A macro that canonicalizes an element right after
+ it has been fetched from one of the two strings.
+ The argument is an 'unsigned char'; the result
+ must be an 'unsigned char' as well.
+
+ This file undefines the macros documented above, and defines
+ LONG_NEEDLE_THRESHOLD.
+*/
+
+#include <limits.h>
+#include <stdint.h>
+
+/* We use the Two-Way string matching algorithm (also known as
+ Chrochemore-Perrin), which guarantees linear complexity with
+ constant space. Additionally, for long needles, we also use a bad
+ character shift table similar to the Boyer-Moore algorithm to
+ achieve improved (potentially sub-linear) performance.
+
+ See https://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260,
+ https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm,
+ https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf
+*/
+
+/* Point at which computing a bad-byte shift table is likely to be
+ worthwhile. Small needles should not compute a table, since it
+ adds (1 << CHAR_BIT) + NEEDLE_LEN computations of preparation for a
+ speedup no greater than a factor of NEEDLE_LEN. The larger the
+ needle, the better the potential performance gain. On the other
+ hand, on non-POSIX systems with CHAR_BIT larger than eight, the
+ memory required for the table is prohibitive. */
+#if CHAR_BIT < 10
+# define LONG_NEEDLE_THRESHOLD 32U
+#else
+# define LONG_NEEDLE_THRESHOLD SIZE_MAX
+#endif
+
+#ifndef MAX
+# define MAX(a, b) ((a < b) ? (b) : (a))
+#endif
+
+#ifndef CANON_ELEMENT
+# define CANON_ELEMENT(c) c
+#endif
+#ifndef CMP_FUNC
+# define CMP_FUNC memcmp
+#endif
+
+/* Perform a critical factorization of NEEDLE, of length NEEDLE_LEN.
+ Return the index of the first byte in the right half, and set
+ *PERIOD to the global period of the right half.
+
+ The global period of a string is the smallest index (possibly its
+ length) at which all remaining bytes in the string are repetitions
+ of the prefix (the last repetition may be a subset of the prefix).
+
+ When NEEDLE is factored into two halves, a local period is the
+ length of the smallest word that shares a suffix with the left half
+ and shares a prefix with the right half. All factorizations of a
+ non-empty NEEDLE have a local period of at least 1 and no greater
+ than NEEDLE_LEN.
+
+ A critical factorization has the property that the local period
+ equals the global period. All strings have at least one critical
+ factorization with the left half smaller than the global period.
+ And while some strings have more than one critical factorization,
+ it is provable that with an ordered alphabet, at least one of the
+ critical factorizations corresponds to a maximal suffix.
+
+ Given an ordered alphabet, a critical factorization can be computed
+ in linear time, with 2 * NEEDLE_LEN comparisons, by computing the
+ shorter of two ordered maximal suffixes. The ordered maximal
+ suffixes are determined by lexicographic comparison while tracking
+ periodicity. */
+static size_t
+critical_factorization (const unsigned char *needle, size_t needle_len,
+ size_t *period)
+{
+ /* Index of last byte of left half, or SIZE_MAX. */
+ size_t max_suffix, max_suffix_rev;
+ size_t j; /* Index into NEEDLE for current candidate suffix. */
+ size_t k; /* Offset into current period. */
+ size_t p; /* Intermediate period. */
+ unsigned char a, b; /* Current comparison bytes. */
+
+ /* Special case NEEDLE_LEN of 1 or 2 (all callers already filtered
+ out 0-length needles. */
+ if (needle_len < 3)
+ {
+ *period = 1;
+ return needle_len - 1;
+ }
+
+ /* Invariants:
+ 0 <= j < NEEDLE_LEN - 1
+ -1 <= max_suffix{,_rev} < j (treating SIZE_MAX as if it were signed)
+ min(max_suffix, max_suffix_rev) < global period of NEEDLE
+ 1 <= p <= global period of NEEDLE
+ p == global period of the substring NEEDLE[max_suffix{,_rev}+1...j]
+ 1 <= k <= p
+ */
+
+ /* Perform lexicographic search. */
+ max_suffix = SIZE_MAX;
+ j = 0;
+ k = p = 1;
+ while (j + k < needle_len)
+ {
+ a = CANON_ELEMENT (needle[j + k]);
+ b = CANON_ELEMENT (needle[max_suffix + k]);
+ if (a < b)
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix;
+ }
+ else if (a == b)
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* b < a */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix = j++;
+ k = p = 1;
+ }
+ }
+ *period = p;
+
+ /* Perform reverse lexicographic search. */
+ max_suffix_rev = SIZE_MAX;
+ j = 0;
+ k = p = 1;
+ while (j + k < needle_len)
+ {
+ a = CANON_ELEMENT (needle[j + k]);
+ b = CANON_ELEMENT (needle[max_suffix_rev + k]);
+ if (b < a)
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix_rev;
+ }
+ else if (a == b)
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* a < b */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix_rev = j++;
+ k = p = 1;
+ }
+ }
+
+ /* Choose the shorter suffix. Return the index of the first byte of
+ the right half, rather than the last byte of the left half.
+
+ For some examples, 'banana' has two critical factorizations, both
+ exposed by the two lexicographic extreme suffixes of 'anana' and
+ 'nana', where both suffixes have a period of 2. On the other
+ hand, with 'aab' and 'bba', both strings have a single critical
+ factorization of the last byte, with the suffix having a period
+ of 1. While the maximal lexicographic suffix of 'aab' is 'b',
+ the maximal lexicographic suffix of 'bba' is 'ba', which is not a
+ critical factorization. Conversely, the maximal reverse
+ lexicographic suffix of 'a' works for 'bba', but not 'ab' for
+ 'aab'. The shorter suffix of the two will always be a critical
+ factorization. */
+ if (max_suffix_rev + 1 < max_suffix + 1)
+ return max_suffix + 1;
+ *period = p;
+ return max_suffix_rev + 1;
+}
+
+/* Return the first location of non-empty NEEDLE within HAYSTACK, or
+ NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
+ method is optimized for NEEDLE_LEN < LONG_NEEDLE_THRESHOLD.
+ Performance is guaranteed to be linear, with an initialization cost
+ of 2 * NEEDLE_LEN comparisons.
+
+ If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
+ most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching.
+ If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
+ HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */
+static RETURN_TYPE _GL_ATTRIBUTE_PURE
+two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
+ const unsigned char *needle, size_t needle_len)
+{
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
+
+ /* Factor the needle into two halves, such that the left half is
+ smaller than the global period, and the right half is
+ periodic (with a period as large as NEEDLE_LEN - suffix). */
+ suffix = critical_factorization (needle, needle_len, &period);
+
+ /* Perform the search. Each iteration compares the right half
+ first. */
+ if (CMP_FUNC (needle, needle + period, suffix) == 0)
+ {
+ /* Entire needle is periodic; a mismatch in the left half can
+ only advance by the period, so use memory to avoid rescanning
+ known occurrences of the period in the right half. */
+ size_t memory = 0;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Scan for matches in right half. */
+ i = MAX (suffix, memory);
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
+ }
+ else
+ {
+ /* The two halves of needle are distinct; no extra memory is
+ required, and any mismatch results in a maximal shift. */
+ period = MAX (suffix, needle_len - suffix) + 1;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Scan for matches in right half. */
+ i = suffix;
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
+ }
+ return NULL;
+}
+
+/* Return the first location of non-empty NEEDLE within HAYSTACK, or
+ NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
+ method is optimized for LONG_NEEDLE_THRESHOLD <= NEEDLE_LEN.
+ Performance is guaranteed to be linear, with an initialization cost
+ of 3 * NEEDLE_LEN + (1 << CHAR_BIT) operations.
+
+ If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
+ most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching,
+ and sublinear performance O(HAYSTACK_LEN / NEEDLE_LEN) is possible.
+ If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
+ HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and
+ sublinear performance is not possible. */
+static RETURN_TYPE _GL_ATTRIBUTE_PURE
+two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
+ const unsigned char *needle, size_t needle_len)
+{
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
+ size_t shift_table[1U << CHAR_BIT]; /* See below. */
+
+ /* Factor the needle into two halves, such that the left half is
+ smaller than the global period, and the right half is
+ periodic (with a period as large as NEEDLE_LEN - suffix). */
+ suffix = critical_factorization (needle, needle_len, &period);
+
+ /* Populate shift_table. For each possible byte value c,
+ shift_table[c] is the distance from the last occurrence of c to
+ the end of NEEDLE, or NEEDLE_LEN if c is absent from the NEEDLE.
+ shift_table[NEEDLE[NEEDLE_LEN - 1]] contains the only 0. */
+ for (i = 0; i < 1U << CHAR_BIT; i++)
+ shift_table[i] = needle_len;
+ for (i = 0; i < needle_len; i++)
+ shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1;
+
+ /* Perform the search. Each iteration compares the right half
+ first. */
+ if (CMP_FUNC (needle, needle + period, suffix) == 0)
+ {
+ /* Entire needle is periodic; a mismatch in the left half can
+ only advance by the period, so use memory to avoid rescanning
+ known occurrences of the period in the right half. */
+ size_t memory = 0;
+ size_t shift;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ if (memory && shift < period)
+ {
+ /* Since needle is periodic, but the last period has
+ a byte out of place, there can be no match until
+ after the mismatch. */
+ shift = needle_len - period;
+ }
+ memory = 0;
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = MAX (suffix, memory);
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
+ }
+ else
+ {
+ /* The two halves of needle are distinct; no extra memory is
+ required, and any mismatch results in a maximal shift. */
+ size_t shift;
+ period = MAX (suffix, needle_len - suffix) + 1;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = suffix;
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
+ }
+ return NULL;
+}
+
+#undef AVAILABLE
+#undef CANON_ELEMENT
+#undef CMP_FUNC
+#undef MAX
+#undef RETURN_TYPE
diff --git a/gl/strcasecmp.c b/gl/strcasecmp.c
new file mode 100644
index 0000000..3a5ce3e
--- /dev/null
+++ b/gl/strcasecmp.c
@@ -0,0 +1,62 @@
+/* Case-insensitive string comparison function.
+ Copyright (C) 1998-1999, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <ctype.h>
+#include <limits.h>
+
+#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+
+/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
+ greater than zero if S1 is lexicographically less than, equal to or greater
+ than S2.
+ Note: This function does not work with multibyte strings! */
+
+int
+strcasecmp (const char *s1, const char *s2)
+{
+ const unsigned char *p1 = (const unsigned char *) s1;
+ const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ c1 = TOLOWER (*p1);
+ c2 = TOLOWER (*p2);
+
+ if (c1 == '\0')
+ break;
+
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ if (UCHAR_MAX <= INT_MAX)
+ return c1 - c2;
+ else
+ /* On machines where 'char' and 'int' are types of the same size, the
+ difference of two 'unsigned char' values - including the sign bit -
+ doesn't fit in an 'int'. */
+ return _GL_CMP (c1, c2);
+}
diff --git a/gl/strcasestr.c b/gl/strcasestr.c
new file mode 100644
index 0000000..8eea435
--- /dev/null
+++ b/gl/strcasestr.c
@@ -0,0 +1,81 @@
+/* Case-insensitive searching in a string.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2005.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <ctype.h>
+#include <strings.h>
+
+#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+
+/* Two-Way algorithm. */
+#define RETURN_TYPE char *
+#define AVAILABLE(h, h_l, j, n_l) \
+ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
+ && ((h_l) = (j) + (n_l)))
+#define CANON_ELEMENT(c) TOLOWER (c)
+#define CMP_FUNC(p1, p2, l) \
+ strncasecmp ((const char *) (p1), (const char *) (p2), l)
+#include "str-two-way.h"
+
+/* Find the first occurrence of NEEDLE in HAYSTACK, using
+ case-insensitive comparison. This function gives unspecified
+ results in multibyte locales. */
+char *
+strcasestr (const char *haystack_start, const char *needle_start)
+{
+ const char *haystack = haystack_start;
+ const char *needle = needle_start;
+ size_t needle_len; /* Length of NEEDLE. */
+ size_t haystack_len; /* Known minimum length of HAYSTACK. */
+ bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */
+
+ /* Determine length of NEEDLE, and in the process, make sure
+ HAYSTACK is at least as long (no point processing all of a long
+ NEEDLE if HAYSTACK is too short). */
+ while (*haystack && *needle)
+ {
+ ok &= (TOLOWER ((unsigned char) *haystack)
+ == TOLOWER ((unsigned char) *needle));
+ haystack++;
+ needle++;
+ }
+ if (*needle)
+ return NULL;
+ if (ok)
+ return (char *) haystack_start;
+ needle_len = needle - needle_start;
+ haystack = haystack_start + 1;
+ haystack_len = needle_len - 1;
+
+ /* Perform the search. Abstract memory is considered to be an array
+ of 'unsigned char' values, not an array of 'char' values. See
+ ISO C 99 section 6.2.6.1. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ return two_way_short_needle ((const unsigned char *) haystack,
+ haystack_len,
+ (const unsigned char *) needle_start,
+ needle_len);
+ return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
+ (const unsigned char *) needle_start,
+ needle_len);
+}
+
+#undef LONG_NEEDLE_THRESHOLD
diff --git a/gl/streq.h b/gl/streq.h
new file mode 100644
index 0000000..712948e
--- /dev/null
+++ b/gl/streq.h
@@ -0,0 +1,176 @@
+/* Optimized string comparison.
+ Copyright (C) 2001-2002, 2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>. */
+
+#ifndef _GL_STREQ_H
+#define _GL_STREQ_H
+
+#include <string.h>
+
+/* STREQ_OPT allows to optimize string comparison with a small literal string.
+ STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+ is semantically equivalent to
+ strcmp (s, "EUC-KR") == 0
+ just faster. */
+
+/* Help GCC to generate good code for string comparisons with
+ immediate strings. */
+#if (defined __GNUC__ || defined __clang__) && defined __OPTIMIZE__
+
+static inline int
+streq9 (const char *s1, const char *s2)
+{
+ return strcmp (s1 + 9, s2 + 9) == 0;
+}
+
+static inline int
+streq8 (const char *s1, const char *s2, char s28)
+{
+ if (s1[8] == s28)
+ {
+ if (s28 == 0)
+ return 1;
+ else
+ return streq9 (s1, s2);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq7 (const char *s1, const char *s2, char s27, char s28)
+{
+ if (s1[7] == s27)
+ {
+ if (s27 == 0)
+ return 1;
+ else
+ return streq8 (s1, s2, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq6 (const char *s1, const char *s2, char s26, char s27, char s28)
+{
+ if (s1[6] == s26)
+ {
+ if (s26 == 0)
+ return 1;
+ else
+ return streq7 (s1, s2, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28)
+{
+ if (s1[5] == s25)
+ {
+ if (s25 == 0)
+ return 1;
+ else
+ return streq6 (s1, s2, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[4] == s24)
+ {
+ if (s24 == 0)
+ return 1;
+ else
+ return streq5 (s1, s2, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[3] == s23)
+ {
+ if (s23 == 0)
+ return 1;
+ else
+ return streq4 (s1, s2, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[2] == s22)
+ {
+ if (s22 == 0)
+ return 1;
+ else
+ return streq3 (s1, s2, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[1] == s21)
+ {
+ if (s21 == 0)
+ return 1;
+ else
+ return streq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+static inline int
+streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+ if (s1[0] == s20)
+ {
+ if (s20 == 0)
+ return 1;
+ else
+ return streq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
+ }
+ else
+ return 0;
+}
+
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+ streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
+
+#else
+
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+ (strcmp (s1, s2) == 0)
+
+#endif
+
+#endif /* _GL_STREQ_H */
diff --git a/gl/strerror-override.c b/gl/strerror-override.c
new file mode 100644
index 0000000..cddaa4a
--- /dev/null
+++ b/gl/strerror-override.c
@@ -0,0 +1,306 @@
+/* strerror-override.c --- POSIX compatible system error routine
+
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010. */
+
+#include <config.h>
+
+#include "strerror-override.h"
+
+#include <errno.h>
+
+#if GNULIB_defined_EWINSOCK /* native Windows platforms */
+# if HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+#endif
+
+#if !GNULIB_defined_strerror_override_macro
+
+/* If ERRNUM maps to an errno value defined by gnulib, return a string
+ describing the error. Otherwise return NULL. */
+const char *
+strerror_override (int errnum)
+{
+ /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */
+ switch (errnum)
+ {
+# if REPLACE_STRERROR_0
+ case 0:
+ return "Success";
+# endif
+
+# if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */
+ case EINPROGRESS:
+ return "Operation now in progress";
+ case EALREADY:
+ return "Operation already in progress";
+ case ENOTSOCK:
+ return "Socket operation on non-socket";
+ case EDESTADDRREQ:
+ return "Destination address required";
+ case EMSGSIZE:
+ return "Message too long";
+ case EPROTOTYPE:
+ return "Protocol wrong type for socket";
+ case ENOPROTOOPT:
+ return "Protocol not available";
+ case EPROTONOSUPPORT:
+ return "Protocol not supported";
+ case EOPNOTSUPP:
+ return "Operation not supported";
+ case EAFNOSUPPORT:
+ return "Address family not supported by protocol";
+ case EADDRINUSE:
+ return "Address already in use";
+ case EADDRNOTAVAIL:
+ return "Cannot assign requested address";
+ case ENETDOWN:
+ return "Network is down";
+ case ENETUNREACH:
+ return "Network is unreachable";
+ case ECONNRESET:
+ return "Connection reset by peer";
+ case ENOBUFS:
+ return "No buffer space available";
+ case EISCONN:
+ return "Transport endpoint is already connected";
+ case ENOTCONN:
+ return "Transport endpoint is not connected";
+ case ETIMEDOUT:
+ return "Connection timed out";
+ case ECONNREFUSED:
+ return "Connection refused";
+ case ELOOP:
+ return "Too many levels of symbolic links";
+ case EHOSTUNREACH:
+ return "No route to host";
+ case EWOULDBLOCK:
+ return "Operation would block";
+# endif
+# if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */
+ case ETXTBSY:
+ return "Text file busy";
+ case ENODATA:
+ return "No data available";
+ case ENOSR:
+ return "Out of streams resources";
+ case ENOSTR:
+ return "Device not a stream";
+ case ETIME:
+ return "Timer expired";
+ case EOTHER:
+ return "Other error";
+# endif
+# if GNULIB_defined_EWINSOCK /* native Windows platforms */
+ case ESOCKTNOSUPPORT:
+ return "Socket type not supported";
+ case EPFNOSUPPORT:
+ return "Protocol family not supported";
+ case ESHUTDOWN:
+ return "Cannot send after transport endpoint shutdown";
+ case ETOOMANYREFS:
+ return "Too many references: cannot splice";
+ case EHOSTDOWN:
+ return "Host is down";
+ case EPROCLIM:
+ return "Too many processes";
+ case EUSERS:
+ return "Too many users";
+ case EDQUOT:
+ return "Disk quota exceeded";
+ case ESTALE:
+ return "Stale NFS file handle";
+ case EREMOTE:
+ return "Object is remote";
+# if HAVE_WINSOCK2_H
+ /* WSA_INVALID_HANDLE maps to EBADF */
+ /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
+ /* WSA_INVALID_PARAMETER maps to EINVAL */
+ case WSA_OPERATION_ABORTED:
+ return "Overlapped operation aborted";
+ case WSA_IO_INCOMPLETE:
+ return "Overlapped I/O event object not in signaled state";
+ case WSA_IO_PENDING:
+ return "Overlapped operations will complete later";
+ /* WSAEINTR maps to EINTR */
+ /* WSAEBADF maps to EBADF */
+ /* WSAEACCES maps to EACCES */
+ /* WSAEFAULT maps to EFAULT */
+ /* WSAEINVAL maps to EINVAL */
+ /* WSAEMFILE maps to EMFILE */
+ /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
+ /* WSAEINPROGRESS maps to EINPROGRESS */
+ /* WSAEALREADY maps to EALREADY */
+ /* WSAENOTSOCK maps to ENOTSOCK */
+ /* WSAEDESTADDRREQ maps to EDESTADDRREQ */
+ /* WSAEMSGSIZE maps to EMSGSIZE */
+ /* WSAEPROTOTYPE maps to EPROTOTYPE */
+ /* WSAENOPROTOOPT maps to ENOPROTOOPT */
+ /* WSAEPROTONOSUPPORT maps to EPROTONOSUPPORT */
+ /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
+ /* WSAEOPNOTSUPP maps to EOPNOTSUPP */
+ /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
+ /* WSAEAFNOSUPPORT maps to EAFNOSUPPORT */
+ /* WSAEADDRINUSE maps to EADDRINUSE */
+ /* WSAEADDRNOTAVAIL maps to EADDRNOTAVAIL */
+ /* WSAENETDOWN maps to ENETDOWN */
+ /* WSAENETUNREACH maps to ENETUNREACH */
+ /* WSAENETRESET maps to ENETRESET */
+ /* WSAECONNABORTED maps to ECONNABORTED */
+ /* WSAECONNRESET maps to ECONNRESET */
+ /* WSAENOBUFS maps to ENOBUFS */
+ /* WSAEISCONN maps to EISCONN */
+ /* WSAENOTCONN maps to ENOTCONN */
+ /* WSAESHUTDOWN is ESHUTDOWN */
+ /* WSAETOOMANYREFS is ETOOMANYREFS */
+ /* WSAETIMEDOUT maps to ETIMEDOUT */
+ /* WSAECONNREFUSED maps to ECONNREFUSED */
+ /* WSAELOOP maps to ELOOP */
+ /* WSAENAMETOOLONG maps to ENAMETOOLONG */
+ /* WSAEHOSTDOWN is EHOSTDOWN */
+ /* WSAEHOSTUNREACH maps to EHOSTUNREACH */
+ /* WSAENOTEMPTY maps to ENOTEMPTY */
+ /* WSAEPROCLIM is EPROCLIM */
+ /* WSAEUSERS is EUSERS */
+ /* WSAEDQUOT is EDQUOT */
+ /* WSAESTALE is ESTALE */
+ /* WSAEREMOTE is EREMOTE */
+ case WSASYSNOTREADY:
+ return "Network subsystem is unavailable";
+ case WSAVERNOTSUPPORTED:
+ return "Winsock.dll version out of range";
+ case WSANOTINITIALISED:
+ return "Successful WSAStartup not yet performed";
+ case WSAEDISCON:
+ return "Graceful shutdown in progress";
+ case WSAENOMORE: case WSA_E_NO_MORE:
+ return "No more results";
+ case WSAECANCELLED: case WSA_E_CANCELLED:
+ return "Call was canceled";
+ case WSAEINVALIDPROCTABLE:
+ return "Procedure call table is invalid";
+ case WSAEINVALIDPROVIDER:
+ return "Service provider is invalid";
+ case WSAEPROVIDERFAILEDINIT:
+ return "Service provider failed to initialize";
+ case WSASYSCALLFAILURE:
+ return "System call failure";
+ case WSASERVICE_NOT_FOUND:
+ return "Service not found";
+ case WSATYPE_NOT_FOUND:
+ return "Class type not found";
+ case WSAEREFUSED:
+ return "Database query was refused";
+ case WSAHOST_NOT_FOUND:
+ return "Host not found";
+ case WSATRY_AGAIN:
+ return "Nonauthoritative host not found";
+ case WSANO_RECOVERY:
+ return "Nonrecoverable error";
+ case WSANO_DATA:
+ return "Valid name, no data record of requested type";
+ /* WSA_QOS_* omitted */
+# endif
+# endif
+
+# if GNULIB_defined_ENOMSG
+ case ENOMSG:
+ return "No message of desired type";
+# endif
+
+# if GNULIB_defined_EIDRM
+ case EIDRM:
+ return "Identifier removed";
+# endif
+
+# if GNULIB_defined_ENOLINK
+ case ENOLINK:
+ return "Link has been severed";
+# endif
+
+# if GNULIB_defined_EPROTO
+ case EPROTO:
+ return "Protocol error";
+# endif
+
+# if GNULIB_defined_EMULTIHOP
+ case EMULTIHOP:
+ return "Multihop attempted";
+# endif
+
+# if GNULIB_defined_EBADMSG
+ case EBADMSG:
+ return "Bad message";
+# endif
+
+# if GNULIB_defined_EOVERFLOW
+ case EOVERFLOW:
+ return "Value too large for defined data type";
+# endif
+
+# if GNULIB_defined_ENOTSUP
+ case ENOTSUP:
+ return "Not supported";
+# endif
+
+# if GNULIB_defined_ENETRESET
+ case ENETRESET:
+ return "Network dropped connection on reset";
+# endif
+
+# if GNULIB_defined_ECONNABORTED
+ case ECONNABORTED:
+ return "Software caused connection abort";
+# endif
+
+# if GNULIB_defined_ESTALE
+ case ESTALE:
+ return "Stale NFS file handle";
+# endif
+
+# if GNULIB_defined_EDQUOT
+ case EDQUOT:
+ return "Disk quota exceeded";
+# endif
+
+# if GNULIB_defined_ECANCELED
+ case ECANCELED:
+ return "Operation canceled";
+# endif
+
+# if GNULIB_defined_EOWNERDEAD
+ case EOWNERDEAD:
+ return "Owner died";
+# endif
+
+# if GNULIB_defined_ENOTRECOVERABLE
+ case ENOTRECOVERABLE:
+ return "State not recoverable";
+# endif
+
+# if GNULIB_defined_EILSEQ
+ case EILSEQ:
+ return "Invalid or incomplete multibyte or wide character";
+# endif
+
+ default:
+ return NULL;
+ }
+}
+
+#endif
diff --git a/gl/strerror-override.h b/gl/strerror-override.h
new file mode 100644
index 0000000..388cc28
--- /dev/null
+++ b/gl/strerror-override.h
@@ -0,0 +1,57 @@
+/* strerror-override.h --- POSIX compatible system error routine
+
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_STRERROR_OVERRIDE_H
+# define _GL_STRERROR_OVERRIDE_H
+
+# include <errno.h>
+# include <stddef.h>
+
+/* Reasonable buffer size that should never trigger ERANGE; if this
+ proves too small, we intentionally abort(), to remind us to fix
+ this value. */
+# define STACKBUF_LEN 256
+
+/* If ERRNUM maps to an errno value defined by gnulib, return a string
+ describing the error. Otherwise return NULL. */
+# if REPLACE_STRERROR_0 \
+ || GNULIB_defined_ESOCK \
+ || GNULIB_defined_ESTREAMS \
+ || GNULIB_defined_EWINSOCK \
+ || GNULIB_defined_ENOMSG \
+ || GNULIB_defined_EIDRM \
+ || GNULIB_defined_ENOLINK \
+ || GNULIB_defined_EPROTO \
+ || GNULIB_defined_EMULTIHOP \
+ || GNULIB_defined_EBADMSG \
+ || GNULIB_defined_EOVERFLOW \
+ || GNULIB_defined_ENOTSUP \
+ || GNULIB_defined_ENETRESET \
+ || GNULIB_defined_ECONNABORTED \
+ || GNULIB_defined_ESTALE \
+ || GNULIB_defined_EDQUOT \
+ || GNULIB_defined_ECANCELED \
+ || GNULIB_defined_EOWNERDEAD \
+ || GNULIB_defined_ENOTRECOVERABLE \
+ || GNULIB_defined_EILSEQ
+extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
+# else
+# define strerror_override(ignored) NULL
+# define GNULIB_defined_strerror_override_macro 1
+# endif
+
+#endif /* _GL_STRERROR_OVERRIDE_H */
diff --git a/gl/strerror.c b/gl/strerror.c
new file mode 100644
index 0000000..d754f60
--- /dev/null
+++ b/gl/strerror.c
@@ -0,0 +1,70 @@
+/* strerror.c --- POSIX compatible system error routine
+
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "intprops.h"
+#include "strerror-override.h"
+
+/* Use the system functions, not the gnulib overrides in this file. */
+#undef sprintf
+
+char *
+strerror (int n)
+#undef strerror
+{
+ static char buf[STACKBUF_LEN];
+ size_t len;
+
+ /* Cast away const, due to the historical signature of strerror;
+ callers should not be modifying the string. */
+ const char *msg = strerror_override (n);
+ if (msg)
+ return (char *) msg;
+
+ msg = strerror (n);
+
+ /* Our strerror_r implementation might use the system's strerror
+ buffer, so all other clients of strerror have to see the error
+ copied into a buffer that we manage. This is not thread-safe,
+ even if the system strerror is, but portable programs shouldn't
+ be using strerror if they care about thread-safety. */
+ if (!msg || !*msg)
+ {
+ static char const fmt[] = "Unknown error %d";
+ static_assert (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+ sprintf (buf, fmt, n);
+ errno = EINVAL;
+ return buf;
+ }
+
+ /* Fix STACKBUF_LEN if this ever aborts. */
+ len = strlen (msg);
+ if (sizeof buf <= len)
+ abort ();
+
+ memcpy (buf, msg, len + 1);
+ return buf;
+}
diff --git a/gl/string.in.h b/gl/string.in.h
new file mode 100644
index 0000000..e993b2f
--- /dev/null
+++ b/gl/string.in.h
@@ -0,0 +1,1322 @@
+/* A GNU-like <string.h>.
+
+ Copyright (C) 1995-1996, 2001-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_STRING_H
+/* Special invocation convention:
+ - On OS X/NetBSD we have a sequence of nested includes
+ <string.h> -> <strings.h> -> "string.h"
+ In this situation system _chk variants due to -D_FORTIFY_SOURCE
+ might be used after any replacements defined here. */
+
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STRING_H
+
+#define _GL_ALREADY_INCLUDING_STRING_H
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+#undef _GL_ALREADY_INCLUDING_STRING_H
+
+#ifndef _@GUARD_PREFIX@_STRING_H
+#define _@GUARD_PREFIX@_STRING_H
+
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
+
+/* MirBSD defines mbslen as a macro. */
+#if @GNULIB_MBSLEN@ && defined __MirBSD__
+# include <wchar.h>
+#endif
+
+/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
+ && ! defined __GLIBC__
+# include <unistd.h>
+#endif
+
+/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>. */
+/* But in any case avoid namespace pollution on glibc systems. */
+#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \
+ && defined _AIX) \
+ && ! defined __GLIBC__
+# include <strings.h>
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have
+ been included yet. */
+#if @GNULIB_FREE_POSIX@
+# if (@REPLACE_FREE@ && !defined free \
+ && !(defined __cplusplus && defined GNULIB_NAMESPACE))
+/* We can't do '#define free rpl_free' here. */
+_GL_EXTERN_C void rpl_free (void *);
+# undef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
+# else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+# endif
+#else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+#endif
+
+/* Clear a block of memory. The compiler will not delete a call to
+ this function, even if the block is dead after the call. */
+#if @GNULIB_EXPLICIT_BZERO@
+# if ! @HAVE_EXPLICIT_BZERO@
+_GL_FUNCDECL_SYS (explicit_bzero, void,
+ (void *__dest, size_t __n) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
+_GL_CXXALIASWARN (explicit_bzero);
+#elif defined GNULIB_POSIXCHECK
+# undef explicit_bzero
+# if HAVE_RAW_DECL_EXPLICIT_BZERO
+_GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
+ "use gnulib module explicit_bzero for portability");
+# endif
+#endif
+
+/* Find the index of the least-significant set bit. */
+#if @GNULIB_FFSL@
+# if !@HAVE_FFSL@
+_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsl, int, (long int i));
+_GL_CXXALIASWARN (ffsl);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsl
+# if HAVE_RAW_DECL_FFSL
+_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
+# endif
+#endif
+
+
+/* Find the index of the least-significant set bit. */
+#if @GNULIB_FFSLL@
+# if @REPLACE_FFSLL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define ffsll rpl_ffsll
+# endif
+_GL_FUNCDECL_RPL (ffsll, int, (long long int i));
+_GL_CXXALIAS_RPL (ffsll, int, (long long int i));
+# else
+# if !@HAVE_FFSLL@
+_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIASWARN (ffsll);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsll
+# if HAVE_RAW_DECL_FFSLL
+_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_MEMCCPY@
+/* On native Windows, map 'memccpy' to '_memccpy', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::memccpy always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef memccpy
+# define memccpy _memccpy
+# endif
+_GL_CXXALIAS_MDA (memccpy, void *,
+ (void *dest, const void *src, int c, size_t n));
+# else
+_GL_CXXALIAS_SYS (memccpy, void *,
+ (void *dest, const void *src, int c, size_t n));
+# endif
+_GL_CXXALIASWARN (memccpy);
+#endif
+
+
+/* Return the first instance of C within N bytes of S, or NULL. */
+#if @GNULIB_MEMCHR@
+# if @REPLACE_MEMCHR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef memchr
+# define memchr rpl_memchr
+# endif
+_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
+# else
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C" { const void * std::memchr (const void *, int, size_t); }
+ extern "C++" { void * std::memchr (void *, int, size_t); } */
+_GL_CXXALIAS_SYS_CAST2 (memchr,
+ void *, (void const *__s, int __c, size_t __n),
+ void const *, (void const *__s, int __c, size_t __n));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n) throw ());
+_GL_CXXALIASWARN1 (memchr, void const *,
+ (void const *__s, int __c, size_t __n) throw ());
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (memchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memchr
+/* Assume memchr is always declared. */
+_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
+ "use gnulib module memchr for portability" );
+#endif
+
+/* Return the first occurrence of NEEDLE in HAYSTACK. */
+#if @GNULIB_MEMMEM@
+# if @REPLACE_MEMMEM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define memmem rpl_memmem
+# endif
+_GL_FUNCDECL_RPL (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len));
+# else
+# if ! @HAVE_DECL_MEMMEM@
+_GL_FUNCDECL_SYS (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
+# endif
+_GL_CXXALIAS_SYS (memmem, void *,
+ (void const *__haystack, size_t __haystack_len,
+ void const *__needle, size_t __needle_len));
+# endif
+_GL_CXXALIASWARN (memmem);
+#elif defined GNULIB_POSIXCHECK
+# undef memmem
+# if HAVE_RAW_DECL_MEMMEM
+_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
+ "use gnulib module memmem-simple for portability, "
+ "and module memmem for speed" );
+# endif
+#endif
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+#if @GNULIB_MEMPCPY@
+# if ! @HAVE_MEMPCPY@
+_GL_FUNCDECL_SYS (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (mempcpy, void *,
+ (void *restrict __dest, void const *restrict __src,
+ size_t __n));
+_GL_CXXALIASWARN (mempcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef mempcpy
+# if HAVE_RAW_DECL_MEMPCPY
+_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
+ "use gnulib module mempcpy for portability");
+# endif
+#endif
+
+/* Search backwards through a block for a byte (specified as an int). */
+#if @GNULIB_MEMRCHR@
+# if ! @HAVE_DECL_MEMRCHR@
+_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const void * std::memrchr (const void *, int, size_t); }
+ extern "C++" { void * std::memrchr (void *, int, size_t); } */
+_GL_CXXALIAS_SYS_CAST2 (memrchr,
+ void *, (void const *, int, size_t),
+ void const *, (void const *, int, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ());
+_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ());
+# else
+_GL_CXXALIASWARN (memrchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memrchr
+# if HAVE_RAW_DECL_MEMRCHR
+_GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
+ "use gnulib module memrchr for portability");
+# endif
+#endif
+
+/* Overwrite a block of memory. The compiler will not optimize
+ effects away, even if the block is dead after the call. */
+#if @GNULIB_MEMSET_EXPLICIT@
+# if ! @HAVE_MEMSET_EXPLICIT@
+_GL_FUNCDECL_SYS (memset_explicit, void *,
+ (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n));
+_GL_CXXALIASWARN (memset_explicit);
+#elif defined GNULIB_POSIXCHECK
+# undef memset_explicit
+# if HAVE_RAW_DECL_MEMSET_EXPLICIT
+_GL_WARN_ON_USE (memset_explicit, "memset_explicit is unportable - "
+ "use gnulib module memset_explicit for portability");
+# endif
+#endif
+
+/* Find the first occurrence of C in S. More efficient than
+ memchr(S,C,N), at the expense of undefined behavior if C does not
+ occur within N bytes. */
+#if @GNULIB_RAWMEMCHR@
+# if ! @HAVE_RAWMEMCHR@
+_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const void * std::rawmemchr (const void *, int); }
+ extern "C++" { void * std::rawmemchr (void *, int); } */
+_GL_CXXALIAS_SYS_CAST2 (rawmemchr,
+ void *, (void const *__s, int __c_in),
+ void const *, (void const *__s, int __c_in));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in) throw ());
+_GL_CXXALIASWARN1 (rawmemchr, void const *,
+ (void const *__s, int __c_in) throw ());
+# else
+_GL_CXXALIASWARN (rawmemchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rawmemchr
+# if HAVE_RAW_DECL_RAWMEMCHR
+_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
+ "use gnulib module rawmemchr for portability");
+# endif
+#endif
+
+/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
+#if @GNULIB_STPCPY@
+# if ! @HAVE_STPCPY@
+_GL_FUNCDECL_SYS (stpcpy, char *,
+ (char *restrict __dst, char const *restrict __src)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (stpcpy, char *,
+ (char *restrict __dst, char const *restrict __src));
+_GL_CXXALIASWARN (stpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpcpy
+# if HAVE_RAW_DECL_STPCPY
+_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
+ "use gnulib module stpcpy for portability");
+# endif
+#endif
+
+/* Copy no more than N bytes of SRC to DST, returning a pointer past the
+ last non-NUL byte written into DST. */
+#if @GNULIB_STPNCPY@
+# if @REPLACE_STPNCPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
+# define stpncpy rpl_stpncpy
+# endif
+_GL_FUNCDECL_RPL (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n));
+# else
+# if ! @HAVE_STPNCPY@
+_GL_FUNCDECL_SYS (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (stpncpy, char *,
+ (char *restrict __dst, char const *restrict __src,
+ size_t __n));
+# endif
+_GL_CXXALIASWARN (stpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef stpncpy
+# if HAVE_RAW_DECL_STPNCPY
+_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
+ "use gnulib module stpncpy for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strchr() does not work with multibyte strings if the locale encoding is
+ GB18030 and the character to be searched is a digit. */
+# undef strchr
+/* Assume strchr is always declared. */
+_GL_WARN_ON_USE_CXX (strchr,
+ const char *, char *, (const char *, int),
+ "strchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbschr if you care about internationalization");
+#endif
+
+/* Find the first occurrence of C in S or the final NUL byte. */
+#if @GNULIB_STRCHRNUL@
+# if @REPLACE_STRCHRNUL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strchrnul rpl_strchrnul
+# endif
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strchrnul, char *,
+ (const char *str, int ch));
+# else
+# if ! @HAVE_STRCHRNUL@
+_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * std::strchrnul (const char *, int); }
+ extern "C++" { char * std::strchrnul (char *, int); } */
+_GL_CXXALIAS_SYS_CAST2 (strchrnul,
+ char *, (char const *__s, int __c_in),
+ char const *, (char const *__s, int __c_in));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ());
+_GL_CXXALIASWARN1 (strchrnul, char const *,
+ (char const *__s, int __c_in) throw ());
+# else
+_GL_CXXALIASWARN (strchrnul);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strchrnul
+# if HAVE_RAW_DECL_STRCHRNUL
+_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
+ "use gnulib module strchrnul for portability");
+# endif
+#endif
+
+/* Duplicate S, returning an identical malloc'd string. */
+#if @GNULIB_STRDUP@
+# if @REPLACE_STRDUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strdup
+# define strdup rpl_strdup
+# endif
+_GL_FUNCDECL_RPL (strdup, char *,
+ (char const *__s)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strdup
+# define strdup _strdup
+# endif
+_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+ /* strdup exists as a function and as a macro. Get rid of the macro. */
+# undef strdup
+# endif
+# if (!@HAVE_DECL_STRDUP@ || __GNUC__ >= 11) && !defined strdup
+_GL_FUNCDECL_SYS (strdup, char *,
+ (char const *__s)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
+#else
+# if __GNUC__ >= 11 && !defined strdup
+/* For -Wmismatched-dealloc: Associate strdup with free or rpl_free. */
+_GL_FUNCDECL_SYS (strdup, char *,
+ (char const *__s)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef strdup
+# if HAVE_RAW_DECL_STRDUP
+_GL_WARN_ON_USE (strdup, "strdup is unportable - "
+ "use gnulib module strdup for portability");
+# endif
+# elif @GNULIB_MDA_STRDUP@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::strdup always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strdup
+# define strdup _strdup
+# endif
+_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
+# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+# undef strdup
+# endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
+# endif
+#endif
+
+/* Append no more than N characters from SRC onto DEST. */
+#if @GNULIB_STRNCAT@
+# if @REPLACE_STRNCAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strncat
+# define strncat rpl_strncat
+# endif
+_GL_FUNCDECL_RPL (strncat, char *,
+ (char *restrict dest, const char *restrict src, size_t n)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strncat, char *,
+ (char *restrict dest, const char *restrict src, size_t n));
+# else
+_GL_CXXALIAS_SYS (strncat, char *,
+ (char *restrict dest, const char *restrict src, size_t n));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strncat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strncat
+# if HAVE_RAW_DECL_STRNCAT
+_GL_WARN_ON_USE (strncat, "strncat is unportable - "
+ "use gnulib module strncat for portability");
+# endif
+#endif
+
+/* Return a newly allocated copy of at most N bytes of STRING. */
+#if @GNULIB_STRNDUP@
+# if @REPLACE_STRNDUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strndup
+# define strndup rpl_strndup
+# endif
+_GL_FUNCDECL_RPL (strndup, char *,
+ (char const *__s, size_t __n)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
+# else
+# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup)
+_GL_FUNCDECL_SYS (strndup, char *,
+ (char const *__s, size_t __n)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
+# endif
+_GL_CXXALIASWARN (strndup);
+#else
+# if __GNUC__ >= 11 && !defined strndup
+/* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */
+_GL_FUNCDECL_SYS (strndup, char *,
+ (char const *__s, size_t __n)
+ _GL_ARG_NONNULL ((1))
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef strndup
+# if HAVE_RAW_DECL_STRNDUP
+_GL_WARN_ON_USE (strndup, "strndup is unportable - "
+ "use gnulib module strndup for portability");
+# endif
+# endif
+#endif
+
+/* Find the length (number of bytes) of STRING, but scan at most
+ MAXLEN bytes. If no '\0' terminator is found in that many bytes,
+ return MAXLEN. */
+#if @GNULIB_STRNLEN@
+# if @REPLACE_STRNLEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strnlen
+# define strnlen rpl_strnlen
+# endif
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
+# else
+# if ! @HAVE_DECL_STRNLEN@
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen));
+# endif
+_GL_CXXALIASWARN (strnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef strnlen
+# if HAVE_RAW_DECL_STRNLEN
+_GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
+ "use gnulib module strnlen for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strcspn() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it does not work with multibyte strings if the
+ locale encoding is GB18030 and one of the characters to be searched is a
+ digit. */
+# undef strcspn
+/* Assume strcspn is always declared. */
+_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbscspn if you care about internationalization");
+#endif
+
+/* Find the first occurrence in S of any character in ACCEPT. */
+#if @GNULIB_STRPBRK@
+# if ! @HAVE_STRPBRK@
+_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C" { const char * strpbrk (const char *, const char *); }
+ extern "C++" { char * strpbrk (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strpbrk,
+ char *, (char const *__s, char const *__accept),
+ const char *, (char const *__s, char const *__accept));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept) throw ());
+_GL_CXXALIASWARN1 (strpbrk, char const *,
+ (char const *__s, char const *__accept) throw ());
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (strpbrk);
+# endif
+# if defined GNULIB_POSIXCHECK
+/* strpbrk() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it does not work with multibyte strings if the
+ locale encoding is GB18030 and one of the characters to be searched is a
+ digit. */
+# undef strpbrk
+_GL_WARN_ON_USE_CXX (strpbrk,
+ const char *, char *, (const char *, const char *),
+ "strpbrk cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbspbrk if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strpbrk
+# if HAVE_RAW_DECL_STRPBRK
+_GL_WARN_ON_USE_CXX (strpbrk,
+ const char *, char *, (const char *, const char *),
+ "strpbrk is unportable - "
+ "use gnulib module strpbrk for portability");
+# endif
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strspn() assumes the second argument is a list of single-byte characters.
+ Even in this simple case, it cannot work with multibyte strings. */
+# undef strspn
+/* Assume strspn is always declared. */
+_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbsspn if you care about internationalization");
+#endif
+
+#if defined GNULIB_POSIXCHECK
+/* strrchr() does not work with multibyte strings if the locale encoding is
+ GB18030 and the character to be searched is a digit. */
+# undef strrchr
+/* Assume strrchr is always declared. */
+_GL_WARN_ON_USE_CXX (strrchr,
+ const char *, char *, (const char *, int),
+ "strrchr cannot work correctly on character strings "
+ "in some multibyte locales - "
+ "use mbsrchr if you care about internationalization");
+#endif
+
+/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
+ If one is found, overwrite it with a NUL, and advance *STRINGP
+ to point to the next char after it. Otherwise, set *STRINGP to NULL.
+ If *STRINGP was already NULL, nothing happens.
+ Return the old value of *STRINGP.
+
+ This is a variant of strtok() that is multithread-safe and supports
+ empty fields.
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+ Caveat: It doesn't work with multibyte strings unless all of the delimiter
+ characters are ASCII characters < 0x30.
+
+ See also strtok_r(). */
+#if @GNULIB_STRSEP@
+# if ! @HAVE_STRSEP@
+_GL_FUNCDECL_SYS (strsep, char *,
+ (char **restrict __stringp, char const *restrict __delim)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strsep, char *,
+ (char **restrict __stringp, char const *restrict __delim));
+_GL_CXXALIASWARN (strsep);
+# if defined GNULIB_POSIXCHECK
+# undef strsep
+_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
+ "in multibyte locales - "
+ "use mbssep if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strsep
+# if HAVE_RAW_DECL_STRSEP
+_GL_WARN_ON_USE (strsep, "strsep is unportable - "
+ "use gnulib module strsep for portability");
+# endif
+#endif
+
+#if @GNULIB_STRSTR@
+# if @REPLACE_STRSTR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strstr rpl_strstr
+# endif
+_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
+# else
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * strstr (const char *, const char *); }
+ extern "C++" { char * strstr (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strstr,
+ char *, (const char *haystack, const char *needle),
+ const char *, (const char *haystack, const char *needle));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strstr, char *,
+ (char *haystack, const char *needle) throw ());
+_GL_CXXALIASWARN1 (strstr, const char *,
+ (const char *haystack, const char *needle) throw ());
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (strstr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strstr() does not work with multibyte strings if the locale encoding is
+ different from UTF-8:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
+# undef strstr
+/* Assume strstr is always declared. */
+_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
+ "work correctly on character strings in most "
+ "multibyte locales - "
+ "use mbsstr if you care about internationalization, "
+ "or use strstr if you care about speed");
+#endif
+
+/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
+ comparison. */
+#if @GNULIB_STRCASESTR@
+# if @REPLACE_STRCASESTR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strcasestr rpl_strcasestr
+# endif
+_GL_FUNCDECL_RPL (strcasestr, char *,
+ (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strcasestr, char *,
+ (const char *haystack, const char *needle));
+# else
+# if ! @HAVE_STRCASESTR@
+_GL_FUNCDECL_SYS (strcasestr, char *,
+ (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" { const char * strcasestr (const char *, const char *); }
+ extern "C++" { char * strcasestr (char *, const char *); } */
+_GL_CXXALIAS_SYS_CAST2 (strcasestr,
+ char *, (const char *haystack, const char *needle),
+ const char *, (const char *haystack, const char *needle));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \
+ || defined __clang__)
+_GL_CXXALIASWARN1 (strcasestr, char *,
+ (char *haystack, const char *needle) throw ());
+_GL_CXXALIASWARN1 (strcasestr, const char *,
+ (const char *haystack, const char *needle) throw ());
+# else
+_GL_CXXALIASWARN (strcasestr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+/* strcasestr() does not work with multibyte strings:
+ It is a glibc extension, and glibc implements it only for unibyte
+ locales. */
+# undef strcasestr
+# if HAVE_RAW_DECL_STRCASESTR
+_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
+ "strings in multibyte locales - "
+ "use mbscasestr if you care about "
+ "internationalization, or use c-strcasestr if you want "
+ "a locale independent function");
+# endif
+#endif
+
+/* Parse S into tokens separated by characters in DELIM.
+ If S is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = strtok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+
+ This is a variant of strtok() that is multithread-safe.
+
+ For the POSIX documentation for this function, see:
+ https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok.html
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+ Caveat: It doesn't work with multibyte strings unless all of the delimiter
+ characters are ASCII characters < 0x30.
+
+ See also strsep(). */
+#if @GNULIB_STRTOK_R@
+# if @REPLACE_STRTOK_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strtok_r
+# define strtok_r rpl_strtok_r
+# endif
+_GL_FUNCDECL_RPL (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr));
+# else
+# if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
+# undef strtok_r
+# endif
+# if ! @HAVE_DECL_STRTOK_R@
+_GL_FUNCDECL_SYS (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (strtok_r, char *,
+ (char *restrict s, char const *restrict delim,
+ char **restrict save_ptr));
+# endif
+_GL_CXXALIASWARN (strtok_r);
+# if defined GNULIB_POSIXCHECK
+_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
+ "strings in multibyte locales - "
+ "use mbstok_r if you care about internationalization");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtok_r
+# if HAVE_RAW_DECL_STRTOK_R
+_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
+ "use gnulib module strtok_r for portability");
+# endif
+#endif
+
+
+/* The following functions are not specified by POSIX. They are gnulib
+ extensions. */
+
+#if @GNULIB_MBSLEN@
+/* Return the number of multibyte characters in the character string STRING.
+ This considers multibyte characters, unlike strlen, which counts bytes. */
+# ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */
+# undef mbslen
+# endif
+# if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbslen rpl_mbslen
+# endif
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
+# else
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbslen);
+# endif
+#endif
+
+#if @GNULIB_MBSNLEN@
+/* Return the number of multibyte characters in the character string starting
+ at STRING and ending at STRING + LEN. */
+_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1));
+#endif
+
+#if @GNULIB_MBSCHR@
+/* Locate the first single-byte character C in the character string STRING,
+ and return a pointer to it. Return NULL if C is not found in STRING.
+ Unlike strchr(), this function works correctly in multibyte locales with
+ encodings such as GB18030. */
+# if defined __hpux
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
+# endif
+_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbschr);
+#endif
+
+#if @GNULIB_MBSRCHR@
+/* Locate the last single-byte character C in the character string STRING,
+ and return a pointer to it. Return NULL if C is not found in STRING.
+ Unlike strrchr(), this function works correctly in multibyte locales with
+ encodings such as GB18030. */
+# if defined __hpux || defined __INTERIX
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbsrchr rpl_mbsrchr /* avoid collision with system function */
+# endif
+_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbsrchr);
+#endif
+
+#if @GNULIB_MBSSTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+ string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK.
+ Unlike strstr(), this function works correctly in multibyte locales with
+ encodings different from UTF-8. */
+_GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASECMP@
+/* Compare the character strings S1 and S2, ignoring case, returning less than,
+ equal to or greater than zero if S1 is lexicographically less than, equal to
+ or greater than S2.
+ Note: This function may, in multibyte locales, return 0 for strings of
+ different lengths!
+ Unlike strcasecmp(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSNCASECMP@
+/* Compare the initial segment of the character string S1 consisting of at most
+ N characters with the initial segment of the character string S2 consisting
+ of at most N characters, ignoring case, returning less than, equal to or
+ greater than zero if the initial segment of S1 is lexicographically less
+ than, equal to or greater than the initial segment of S2.
+ Note: This function may, in multibyte locales, return 0 for initial segments
+ of different lengths!
+ Unlike strncasecmp(), this function works correctly in multibyte locales.
+ But beware that N is not a byte count but a character count! */
+_GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPCASECMP@
+/* Compare the initial segment of the character string STRING consisting of
+ at most mbslen (PREFIX) characters with the character string PREFIX,
+ ignoring case. If the two match, return a pointer to the first byte
+ after this prefix in STRING. Otherwise, return NULL.
+ Note: This function may, in multibyte locales, return non-NULL if STRING
+ is of smaller length than PREFIX!
+ Unlike strncasecmp(), this function works correctly in multibyte
+ locales. */
+_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCASESTR@
+/* Find the first occurrence of the character string NEEDLE in the character
+ string HAYSTACK, using case-insensitive comparison.
+ Note: This function may, in multibyte locales, return success even if
+ strlen (haystack) < strlen (needle) !
+ Unlike strcasestr(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSCSPN@
+/* Find the first occurrence in the character string STRING of any character
+ in the character string ACCEPT. Return the number of bytes from the
+ beginning of the string to this occurrence, or to the end of the string
+ if none exists.
+ Unlike strcspn(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSPBRK@
+/* Find the first occurrence in the character string STRING of any character
+ in the character string ACCEPT. Return the pointer to it, or NULL if none
+ exists.
+ Unlike strpbrk(), this function works correctly in multibyte locales. */
+# if defined __hpux
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
+# endif
+_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
+# else
+_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
+# endif
+_GL_CXXALIASWARN (mbspbrk);
+#endif
+
+#if @GNULIB_MBSSPN@
+/* Find the first occurrence in the character string STRING of any character
+ not in the character string REJECT. Return the number of bytes from the
+ beginning of the string to this occurrence, or to the end of the string
+ if none exists.
+ Unlike strspn(), this function works correctly in multibyte locales. */
+_GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSSEP@
+/* Search the next delimiter (multibyte character listed in the character
+ string DELIM) starting at the character string *STRINGP.
+ If one is found, overwrite it with a NUL, and advance *STRINGP to point
+ to the next multibyte character after it. Otherwise, set *STRINGP to NULL.
+ If *STRINGP was already NULL, nothing happens.
+ Return the old value of *STRINGP.
+
+ This is a variant of mbstok_r() that supports empty fields.
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+
+ See also mbstok_r(). */
+_GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+
+#if @GNULIB_MBSTOK_R@
+/* Parse the character string STRING into tokens separated by characters in
+ the character string DELIM.
+ If STRING is NULL, the saved pointer in SAVE_PTR is used as
+ the next starting point. For example:
+ char s[] = "-abc-=-def";
+ char *sp;
+ x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def"
+ x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL
+ x = mbstok_r(NULL, "=", &sp); // x = NULL
+ // s = "abc\0-def\0"
+
+ Caveat: It modifies the original string.
+ Caveat: These functions cannot be used on constant strings.
+ Caveat: The identity of the delimiting character is lost.
+
+ See also mbssep(). */
+_GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
+ char **save_ptr)
+ _GL_ARG_NONNULL ((2, 3));
+#endif
+
+/* Map any int, typically from errno, into an error message. */
+#if @GNULIB_STRERROR@
+# if @REPLACE_STRERROR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerror
+# define strerror rpl_strerror
+# endif
+_GL_FUNCDECL_RPL (strerror, char *, (int));
+_GL_CXXALIAS_RPL (strerror, char *, (int));
+# else
+_GL_CXXALIAS_SYS (strerror, char *, (int));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strerror);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strerror
+/* Assume strerror is always declared. */
+_GL_WARN_ON_USE (strerror, "strerror is unportable - "
+ "use gnulib module strerror to guarantee non-NULL result");
+#endif
+
+/* Map any int, typically from errno, into an error message. Multithread-safe.
+ Uses the POSIX declaration, not the glibc declaration. */
+#if @GNULIB_STRERROR_R@
+# if @REPLACE_STRERROR_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerror_r
+# define strerror_r rpl_strerror_r
+# endif
+_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# else
+# if !@HAVE_DECL_STRERROR_R@
+_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# endif
+# if @HAVE_DECL_STRERROR_R@
+_GL_CXXALIASWARN (strerror_r);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strerror_r
+# if HAVE_RAW_DECL_STRERROR_R
+_GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
+ "use gnulib module strerror_r-posix for portability");
+# endif
+#endif
+
+/* Return the name of the system error code ERRNUM. */
+#if @GNULIB_STRERRORNAME_NP@
+# if @REPLACE_STRERRORNAME_NP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strerrorname_np
+# define strerrorname_np rpl_strerrorname_np
+# endif
+_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum));
+_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum));
+# else
+# if !@HAVE_STRERRORNAME_NP@
+_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum));
+# endif
+_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum));
+# endif
+_GL_CXXALIASWARN (strerrorname_np);
+#elif defined GNULIB_POSIXCHECK
+# undef strerrorname_np
+# if HAVE_RAW_DECL_STRERRORNAME_NP
+_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - "
+ "use gnulib module strerrorname_np for portability");
+# endif
+#endif
+
+/* Return an abbreviation string for the signal number SIG. */
+#if @GNULIB_SIGABBREV_NP@
+# if ! @HAVE_SIGABBREV_NP@
+_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig));
+# endif
+_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig));
+_GL_CXXALIASWARN (sigabbrev_np);
+#elif defined GNULIB_POSIXCHECK
+# undef sigabbrev_np
+# if HAVE_RAW_DECL_SIGABBREV_NP
+_GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - "
+ "use gnulib module sigabbrev_np for portability");
+# endif
+#endif
+
+/* Return an English description string for the signal number SIG. */
+#if @GNULIB_SIGDESCR_NP@
+# if ! @HAVE_SIGDESCR_NP@
+_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig));
+# endif
+_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig));
+_GL_CXXALIASWARN (sigdescr_np);
+#elif defined GNULIB_POSIXCHECK
+# undef sigdescr_np
+# if HAVE_RAW_DECL_SIGDESCR_NP
+_GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - "
+ "use gnulib module sigdescr_np for portability");
+# endif
+#endif
+
+#if @GNULIB_STRSIGNAL@
+# if @REPLACE_STRSIGNAL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strsignal rpl_strsignal
+# endif
+_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
+_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
+# else
+# if ! @HAVE_DECL_STRSIGNAL@
+_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
+# endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is
+ 'const char *'. */
+_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
+# endif
+_GL_CXXALIASWARN (strsignal);
+#elif defined GNULIB_POSIXCHECK
+# undef strsignal
+# if HAVE_RAW_DECL_STRSIGNAL
+_GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
+ "use gnulib module strsignal for portability");
+# endif
+#endif
+
+#if @GNULIB_STRVERSCMP@
+# if !@HAVE_STRVERSCMP@
+_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
+_GL_CXXALIASWARN (strverscmp);
+#elif defined GNULIB_POSIXCHECK
+# undef strverscmp
+# if HAVE_RAW_DECL_STRVERSCMP
+_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
+ "use gnulib module strverscmp for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif
diff --git a/gl/strings.in.h b/gl/strings.in.h
new file mode 100644
index 0000000..2cfe8b1
--- /dev/null
+++ b/gl/strings.in.h
@@ -0,0 +1,122 @@
+/* A substitute <strings.h>.
+
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_STRINGS_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>.
+ But avoid namespace pollution on glibc systems. */
+#if defined __minix && !defined __GLIBC__
+# include <sys/types.h>
+#endif
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_STRINGS_H@
+# @INCLUDE_NEXT@ @NEXT_STRINGS_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_STRINGS_H
+#define _@GUARD_PREFIX@_STRINGS_H
+
+#if ! @HAVE_DECL_STRNCASECMP@
+/* Get size_t. */
+# include <stddef.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /* Find the index of the least-significant set bit. */
+#if @GNULIB_FFS@
+# if !@HAVE_FFS@
+_GL_FUNCDECL_SYS (ffs, int, (int i));
+# endif
+_GL_CXXALIAS_SYS (ffs, int, (int i));
+_GL_CXXALIASWARN (ffs);
+#elif defined GNULIB_POSIXCHECK
+# undef ffs
+# if HAVE_RAW_DECL_FFS
+_GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module");
+# endif
+#endif
+
+/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
+ greater than zero if S1 is lexicographically less than, equal to or greater
+ than S2.
+ Note: This function does not work in multibyte locales. */
+#if ! @HAVE_STRCASECMP@
+extern int strcasecmp (char const *s1, char const *s2)
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+#if defined GNULIB_POSIXCHECK
+/* strcasecmp() does not work with multibyte strings:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
+# undef strcasecmp
+# if HAVE_RAW_DECL_STRCASECMP
+_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
+ "strings in multibyte locales - "
+ "use mbscasecmp if you care about "
+ "internationalization, or use c_strcasecmp , "
+ "gnulib module c-strcase) if you want a locale "
+ "independent function");
+# endif
+#endif
+
+/* Compare no more than N bytes of strings S1 and S2, ignoring case,
+ returning less than, equal to or greater than zero if S1 is
+ lexicographically less than, equal to or greater than S2.
+ Note: This function cannot work correctly in multibyte locales. */
+#if ! @HAVE_DECL_STRNCASECMP@
+extern int strncasecmp (char const *s1, char const *s2, size_t n)
+ _GL_ARG_NONNULL ((1, 2));
+#endif
+#if defined GNULIB_POSIXCHECK
+/* strncasecmp() does not work with multibyte strings:
+ POSIX says that it operates on "strings", and "string" in POSIX is defined
+ as a sequence of bytes, not of characters. */
+# undef strncasecmp
+# if HAVE_RAW_DECL_STRNCASECMP
+_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
+ "strings in multibyte locales - "
+ "use mbsncasecmp or mbspcasecmp if you care about "
+ "internationalization, or use c_strncasecmp , "
+ "gnulib module c-strcase) if you want a locale "
+ "independent function");
+# endif
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
diff --git a/gl/stripslash.c b/gl/stripslash.c
new file mode 100644
index 0000000..fe46a9c
--- /dev/null
+++ b/gl/stripslash.c
@@ -0,0 +1,45 @@
+/* stripslash.c -- remove redundant trailing slashes from a file name
+
+ Copyright (C) 1990, 2001, 2003-2006, 2009-2023 Free Software Foundation,
+ Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "dirname.h"
+
+/* Remove trailing slashes from FILE. Return true if a trailing slash
+ was removed. This is useful when using file name completion from a
+ shell that adds a "/" after directory names (such as tcsh and
+ bash), because on symlinks to directories, several system calls
+ have different semantics according to whether a trailing slash is
+ present. */
+
+bool
+strip_trailing_slashes (char *file)
+{
+ char *base = last_component (file);
+ char *base_lim;
+ bool had_slash;
+
+ /* last_component returns "" for file system roots, but we need to turn
+ "///" into "/". */
+ if (! *base)
+ base = file;
+ base_lim = base + base_len (base);
+ had_slash = (*base_lim != '\0');
+ *base_lim = '\0';
+ return had_slash;
+}
diff --git a/gl/strncasecmp.c b/gl/strncasecmp.c
new file mode 100644
index 0000000..c5c2cd3
--- /dev/null
+++ b/gl/strncasecmp.c
@@ -0,0 +1,62 @@
+/* strncasecmp.c -- case insensitive string comparator
+ Copyright (C) 1998-1999, 2005-2007, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <string.h>
+
+#include <ctype.h>
+#include <limits.h>
+
+#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+
+/* Compare no more than N bytes of strings S1 and S2, ignoring case,
+ returning less than, equal to or greater than zero if S1 is
+ lexicographically less than, equal to or greater than S2.
+ Note: This function cannot work correctly in multibyte locales. */
+
+int
+strncasecmp (const char *s1, const char *s2, size_t n)
+{
+ register const unsigned char *p1 = (const unsigned char *) s1;
+ register const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ if (p1 == p2 || n == 0)
+ return 0;
+
+ do
+ {
+ c1 = TOLOWER (*p1);
+ c2 = TOLOWER (*p2);
+
+ if (--n == 0 || c1 == '\0')
+ break;
+
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ if (UCHAR_MAX <= INT_MAX)
+ return c1 - c2;
+ else
+ /* On machines where 'char' and 'int' are types of the same size, the
+ difference of two 'unsigned char' values - including the sign bit -
+ doesn't fit in an 'int'. */
+ return _GL_CMP (c1, c2);
+}
diff --git a/gl/strsep.c b/gl/strsep.c
new file mode 100644
index 0000000..8e9708a
--- /dev/null
+++ b/gl/strsep.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2004, 2007, 2009-2023 Free Software Foundation, Inc.
+
+ Written by Yoann Vandoorselaere <yoann@prelude-ids.org>.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include <string.h>
+
+char *
+strsep (char **stringp, const char *delim)
+{
+ char *start = *stringp;
+ char *ptr;
+
+ if (start == NULL)
+ return NULL;
+
+ /* Optimize the case of no delimiters. */
+ if (delim[0] == '\0')
+ {
+ *stringp = NULL;
+ return start;
+ }
+
+ /* Optimize the case of one delimiter. */
+ if (delim[1] == '\0')
+ ptr = strchr (start, delim[0]);
+ else
+ /* The general case. */
+ ptr = strpbrk (start, delim);
+ if (ptr == NULL)
+ {
+ *stringp = NULL;
+ return start;
+ }
+
+ *ptr = '\0';
+ *stringp = ptr + 1;
+
+ return start;
+}
diff --git a/gl/strstr.c b/gl/strstr.c
new file mode 100644
index 0000000..574f4d5
--- /dev/null
+++ b/gl/strstr.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2023 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* This particular implementation was written by Eric Blake, 2008. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+/* Specification of strstr. */
+#include <string.h>
+
+#define RETURN_TYPE char *
+#define AVAILABLE(h, h_l, j, n_l) \
+ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
+ && ((h_l) = (j) + (n_l)))
+#include "str-two-way.h"
+
+/* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK
+ if NEEDLE is empty, otherwise NULL if NEEDLE is not found in
+ HAYSTACK. */
+char *
+strstr (const char *haystack_start, const char *needle_start)
+{
+ const char *haystack = haystack_start;
+ const char *needle = needle_start;
+ size_t needle_len; /* Length of NEEDLE. */
+ size_t haystack_len; /* Known minimum length of HAYSTACK. */
+ bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */
+
+ /* Determine length of NEEDLE, and in the process, make sure
+ HAYSTACK is at least as long (no point processing all of a long
+ NEEDLE if HAYSTACK is too short). */
+ while (*haystack && *needle)
+ ok &= *haystack++ == *needle++;
+ if (*needle)
+ return NULL;
+ if (ok)
+ return (char *) haystack_start;
+
+ /* Reduce the size of haystack using strchr, since it has a smaller
+ linear coefficient than the Two-Way algorithm. */
+ needle_len = needle - needle_start;
+ haystack = strchr (haystack_start + 1, *needle_start);
+ if (!haystack || __builtin_expect (needle_len == 1, 0))
+ return (char *) haystack;
+ needle -= needle_len;
+ haystack_len = (haystack > haystack_start + needle_len ? 1
+ : needle_len + haystack_start - haystack);
+
+ /* Perform the search. Abstract memory is considered to be an array
+ of 'unsigned char' values, not an array of 'char' values. See
+ ISO C 99 section 6.2.6.1. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ return two_way_short_needle ((const unsigned char *) haystack,
+ haystack_len,
+ (const unsigned char *) needle, needle_len);
+ return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
+ (const unsigned char *) needle, needle_len);
+}
+
+#undef LONG_NEEDLE_THRESHOLD
diff --git a/gl/sys-limits.h b/gl/sys-limits.h
new file mode 100644
index 0000000..0e9556d
--- /dev/null
+++ b/gl/sys-limits.h
@@ -0,0 +1,42 @@
+/* System call limits
+
+ Copyright 2018-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _GL_SYS_LIMITS_H
+#define _GL_SYS_LIMITS_H
+
+#include <limits.h>
+
+/* Maximum number of bytes to read or write in a single system call.
+ This can be useful for system calls like sendfile on GNU/Linux,
+ which do not handle more than MAX_RW_COUNT bytes correctly.
+ The Linux kernel MAX_RW_COUNT is at least INT_MAX >> 20 << 20,
+ where the 20 comes from the Hexagon port with 1 MiB pages; use that
+ as an approximation, as the exact value may not be available to us.
+
+ Using this also works around a serious Linux bug before 2.6.16; see
+ <https://bugzilla.redhat.com/show_bug.cgi?id=612839>.
+
+ Using this also works around a Tru64 5.1 bug, where attempting
+ to read INT_MAX bytes fails with errno == EINVAL. See
+ <https://lists.gnu.org/r/bug-gnu-utils/2002-04/msg00010.html>.
+
+ Using this is likely to work around similar bugs in other operating
+ systems. */
+
+enum { SYS_BUFSIZE_MAX = INT_MAX >> 20 << 20 };
+
+#endif
diff --git a/gl/sys_socket.c b/gl/sys_socket.c
new file mode 100644
index 0000000..b7388ce
--- /dev/null
+++ b/gl/sys_socket.c
@@ -0,0 +1,22 @@
+/* Inline functions for <sys/socket.h>.
+
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define _GL_SYS_SOCKET_INLINE _GL_EXTERN_INLINE
+#include "sys/socket.h"
+typedef int dummy;
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
new file mode 100644
index 0000000..6705593
--- /dev/null
+++ b/gl/sys_socket.in.h
@@ -0,0 +1,733 @@
+/* Provide a sys/socket header file for systems lacking it (read: MinGW)
+ and for systems where it is incomplete.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* This file is supposed to be used on platforms that lack <sys/socket.h>,
+ on platforms where <sys/socket.h> cannot be included standalone, and on
+ platforms where <sys/socket.h> does not provide all necessary definitions.
+ It is intended to provide definitions and prototypes needed by an
+ application. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+/* Special invocation convention:
+ - On Cygwin 1.5.x we have a sequence of nested includes
+ <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
+ and the latter includes <sys/socket.h>. In this situation, the functions
+ are not yet declared, therefore we cannot provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
+
+#if @HAVE_SYS_SOCKET_H@
+
+# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+
+/* On many platforms, <sys/socket.h> assumes prior inclusion of
+ <sys/types.h>. */
+# include <sys/types.h>
+
+/* On FreeBSD 6.4, <sys/socket.h> defines some macros that assume that NULL
+ is defined. */
+# include <stddef.h>
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
+#define _@GUARD_PREFIX@_SYS_SOCKET_H
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_SYS_SOCKET_INLINE
+# define _GL_SYS_SOCKET_INLINE _GL_INLINE
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
+/* On OS/2 kLIBC, sa_family_t is unsigned char unless TCPV40HDRS is defined. */
+# if !defined __KLIBC__ || defined TCPV40HDRS
+typedef unsigned short sa_family_t;
+# else
+typedef unsigned char sa_family_t;
+# endif
+# define GNULIB_defined_sa_family_t 1
+# endif
+#endif
+
+#if @HAVE_STRUCT_SOCKADDR_STORAGE@
+/* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1. */
+# if !@HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+# ifndef ss_family
+# define ss_family __ss_family
+# endif
+# endif
+#else
+/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
+ 2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
+# define __ss_aligntype unsigned long int
+# define _SS_SIZE 256
+# define _SS_PADSIZE \
+ (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \
+ ? sizeof (sa_family_t) \
+ : alignof (__ss_aligntype)) \
+ + sizeof (__ss_aligntype)))
+
+# if !GNULIB_defined_struct_sockaddr_storage
+struct sockaddr_storage
+{
+ sa_family_t ss_family; /* Address family, etc. */
+ __ss_aligntype __ss_align; /* Force desired alignment. */
+ char __ss_padding[_SS_PADSIZE];
+};
+# define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
+#endif
+
+/* Get struct iovec. */
+/* But avoid namespace pollution on glibc systems. */
+#if ! defined __GLIBC__
+# include <sys/uio.h>
+#endif
+
+#if @HAVE_SYS_SOCKET_H@
+
+/* A platform that has <sys/socket.h>. */
+
+/* For shutdown(). */
+# if !defined SHUT_RD
+# define SHUT_RD 0
+# endif
+# if !defined SHUT_WR
+# define SHUT_WR 1
+# endif
+# if !defined SHUT_RDWR
+# define SHUT_RDWR 2
+# endif
+
+# ifdef __VMS /* OpenVMS */
+# ifndef CMSG_SPACE
+# define CMSG_SPACE(length) _CMSG_SPACE(length)
+# endif
+# ifndef CMSG_LEN
+# define CMSG_LEN(length) _CMSG_LEN(length)
+# endif
+# endif
+
+#else
+
+# ifdef __CYGWIN__
+# error "Cygwin does have a sys/socket.h, doesn't it?!?"
+# endif
+
+/* A platform that lacks <sys/socket.h>.
+
+ Currently only MinGW is supported. See the gnulib manual regarding
+ Windows sockets. MinGW has the header files winsock2.h and
+ ws2tcpip.h that declare the sys/socket.h definitions we need. Note
+ that you can influence which definitions you get by setting the
+ WINVER symbol before including these two files. For example,
+ getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
+ symbol is set indirectly through WINVER). You can set this by
+ adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
+ code may not run on older Windows releases then. My Windows 2000
+ box was not able to run the code, for example. The situation is
+ slightly confusing because
+ <https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo>
+ suggests that getaddrinfo should be available on all Windows
+ releases. */
+
+# if @HAVE_WINSOCK2_H@
+# include <winsock2.h>
+# endif
+# if @HAVE_WS2TCPIP_H@
+# include <ws2tcpip.h>
+# endif
+
+/* For shutdown(). */
+# if !defined SHUT_RD && defined SD_RECEIVE
+# define SHUT_RD SD_RECEIVE
+# endif
+# if !defined SHUT_WR && defined SD_SEND
+# define SHUT_WR SD_SEND
+# endif
+# if !defined SHUT_RDWR && defined SD_BOTH
+# define SHUT_RDWR SD_BOTH
+# endif
+
+# if @HAVE_WINSOCK2_H@
+/* Include headers needed by the emulation code. */
+# include <sys/types.h>
+# include <io.h>
+/* If these headers don't define socklen_t, <config.h> does. */
+# endif
+
+/* Rudimentary 'struct msghdr'; this works as long as you don't try to
+ access msg_control or msg_controllen. */
+struct msghdr {
+ void *msg_name;
+ socklen_t msg_namelen;
+ struct iovec *msg_iov;
+ int msg_iovlen;
+ int msg_flags;
+};
+
+#endif
+
+/* Ensure SO_REUSEPORT is defined. */
+/* For the subtle differences between SO_REUSEPORT and SO_REUSEADDR, see
+ https://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t
+ and https://lwn.net/Articles/542629/
+ */
+#ifndef SO_REUSEPORT
+# define SO_REUSEPORT SO_REUSEADDR
+#endif
+
+/* Fix some definitions from <winsock2.h>. */
+
+#if @HAVE_WINSOCK2_H@
+
+# if !GNULIB_defined_rpl_fd_isset
+
+/* Re-define FD_ISSET to avoid a WSA call while we are not using
+ network sockets. */
+_GL_SYS_SOCKET_INLINE int
+rpl_fd_isset (SOCKET fd, fd_set * set)
+{
+ u_int i;
+ if (set == NULL)
+ return 0;
+
+ for (i = 0; i < set->fd_count; i++)
+ if (set->fd_array[i] == fd)
+ return 1;
+
+ return 0;
+}
+
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
+# undef FD_ISSET
+# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
+
+#endif
+
+/* Hide some function declarations from <winsock2.h>. */
+
+#if @HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_UNISTD_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close close_used_without_including_unistd_h
+# elif !defined __clang__
+ _GL_WARN_ON_USE (close,
+ "close() used without including <unistd.h>");
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gethostname
+# define gethostname gethostname_used_without_including_unistd_h
+# else
+ _GL_WARN_ON_USE (gethostname,
+ "gethostname() used without including <unistd.h>");
+# endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef select
+# define select select_used_without_including_sys_select_h
+# else
+ _GL_WARN_ON_USE (select,
+ "select() used without including <sys/select.h>");
+# endif
+# endif
+#endif
+
+/* Wrap everything else to use libc file descriptors for sockets. */
+
+#if @GNULIB_SOCKET@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef socket
+# define socket rpl_socket
+# endif
+_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol));
+_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
+# else
+_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
+# endif
+_GL_CXXALIASWARN (socket);
+#elif @HAVE_WINSOCK2_H@
+# undef socket
+# define socket socket_used_without_requesting_gnulib_module_socket
+#elif defined GNULIB_POSIXCHECK
+# undef socket
+# if HAVE_RAW_DECL_SOCKET
+_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
+ "use gnulib module socket for portability");
+# endif
+#endif
+
+#if @GNULIB_CONNECT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef connect
+# define connect rpl_connect
+# endif
+_GL_FUNCDECL_RPL (connect, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (connect, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (connect, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (connect);
+#elif @HAVE_WINSOCK2_H@
+# undef connect
+# define connect socket_used_without_requesting_gnulib_module_connect
+#elif defined GNULIB_POSIXCHECK
+# undef connect
+# if HAVE_RAW_DECL_CONNECT
+_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
+ "use gnulib module connect for portability");
+# endif
+#endif
+
+#if @GNULIB_ACCEPT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef accept
+# define accept rpl_accept
+# endif
+_GL_FUNCDECL_RPL (accept, int,
+ (int fd,
+ struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+_GL_CXXALIAS_RPL (accept, int,
+ (int fd,
+ struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+ void *addrlen. */
+_GL_CXXALIAS_SYS_CAST (accept, int,
+ (int fd,
+ struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (accept);
+#elif @HAVE_WINSOCK2_H@
+# undef accept
+# define accept accept_used_without_requesting_gnulib_module_accept
+#elif defined GNULIB_POSIXCHECK
+# undef accept
+# if HAVE_RAW_DECL_ACCEPT
+_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
+ "use gnulib module accept for portability");
+# endif
+#endif
+
+#if @GNULIB_BIND@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef bind
+# define bind rpl_bind
+# endif
+_GL_FUNCDECL_RPL (bind, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (bind, int,
+ (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+/* Need to cast, because on NonStop Kernel, the third parameter is
+ size_t addrlen. */
+_GL_CXXALIAS_SYS_CAST (bind, int,
+ (int fd,
+ const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (bind);
+#elif @HAVE_WINSOCK2_H@
+# undef bind
+# define bind bind_used_without_requesting_gnulib_module_bind
+#elif defined GNULIB_POSIXCHECK
+# undef bind
+# if HAVE_RAW_DECL_BIND
+_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
+ "use gnulib module bind for portability");
+# endif
+#endif
+
+#if @GNULIB_GETPEERNAME@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getpeername
+# define getpeername rpl_getpeername
+# endif
+_GL_FUNCDECL_RPL (getpeername, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getpeername, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+ void *addrlen. */
+_GL_CXXALIAS_SYS_CAST (getpeername, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (getpeername);
+#elif @HAVE_WINSOCK2_H@
+# undef getpeername
+# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
+#elif defined GNULIB_POSIXCHECK
+# undef getpeername
+# if HAVE_RAW_DECL_GETPEERNAME
+_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
+ "use gnulib module getpeername for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKNAME@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getsockname
+# define getsockname rpl_getsockname
+# endif
+_GL_FUNCDECL_RPL (getsockname, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getsockname, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+ void *addrlen. */
+_GL_CXXALIAS_SYS_CAST (getsockname, int,
+ (int fd, struct sockaddr *restrict addr,
+ socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (getsockname);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockname
+# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
+#elif defined GNULIB_POSIXCHECK
+# undef getsockname
+# if HAVE_RAW_DECL_GETSOCKNAME
+_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
+ "use gnulib module getsockname for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getsockopt
+# define getsockopt rpl_getsockopt
+# endif
+_GL_FUNCDECL_RPL (getsockopt, int,
+ (int fd, int level, int optname,
+ void *restrict optval, socklen_t *restrict optlen)
+ _GL_ARG_NONNULL ((4, 5)));
+_GL_CXXALIAS_RPL (getsockopt, int,
+ (int fd, int level, int optname,
+ void *restrict optval, socklen_t *restrict optlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the fifth parameter is
+ void *optlen. */
+_GL_CXXALIAS_SYS_CAST (getsockopt, int,
+ (int fd, int level, int optname,
+ void *restrict optval, socklen_t *restrict optlen));
+# endif
+_GL_CXXALIASWARN (getsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockopt
+# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef getsockopt
+# if HAVE_RAW_DECL_GETSOCKOPT
+_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
+ "use gnulib module getsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_LISTEN@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef listen
+# define listen rpl_listen
+# endif
+_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog));
+_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
+# else
+_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
+# endif
+_GL_CXXALIASWARN (listen);
+#elif @HAVE_WINSOCK2_H@
+# undef listen
+# define listen listen_used_without_requesting_gnulib_module_listen
+#elif defined GNULIB_POSIXCHECK
+# undef listen
+# if HAVE_RAW_DECL_LISTEN
+_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
+ "use gnulib module listen for portability");
+# endif
+#endif
+
+#if @GNULIB_RECV@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef recv
+# define recv rpl_recv
+# endif
+_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# else
+/* Need to cast, because on HP-UX 11.31 the return type may be
+ int,
+ depending on compiler options. */
+_GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (recv);
+#elif @HAVE_WINSOCK2_H@
+# undef recv
+# define recv recv_used_without_requesting_gnulib_module_recv
+#elif defined GNULIB_POSIXCHECK
+# undef recv
+# if HAVE_RAW_DECL_RECV
+_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
+ "use gnulib module recv for portability");
+# endif
+#endif
+
+#if @GNULIB_SEND@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef send
+# define send rpl_send
+# endif
+_GL_FUNCDECL_RPL (send, ssize_t,
+ (int fd, const void *buf, size_t len, int flags)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (send, ssize_t,
+ (int fd, const void *buf, size_t len, int flags));
+# else
+/* Need to cast, because on HP-UX 11.31 the return type may be
+ int,
+ depending on compiler options. */
+_GL_CXXALIAS_SYS_CAST (send, ssize_t,
+ (int fd, const void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (send);
+#elif @HAVE_WINSOCK2_H@
+# undef send
+# define send send_used_without_requesting_gnulib_module_send
+#elif defined GNULIB_POSIXCHECK
+# undef send
+# if HAVE_RAW_DECL_SEND
+_GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
+ "use gnulib module send for portability");
+# endif
+#endif
+
+#if @GNULIB_RECVFROM@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef recvfrom
+# define recvfrom rpl_recvfrom
+# endif
+_GL_FUNCDECL_RPL (recvfrom, ssize_t,
+ (int fd, void *restrict buf, size_t len, int flags,
+ struct sockaddr *restrict from,
+ socklen_t *restrict fromlen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recvfrom, ssize_t,
+ (int fd, void *restrict buf, size_t len, int flags,
+ struct sockaddr *restrict from,
+ socklen_t *restrict fromlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the sixth parameter is
+ void *fromlen. */
+_GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
+ (int fd, void *restrict buf, size_t len, int flags,
+ struct sockaddr *restrict from,
+ socklen_t *restrict fromlen));
+# endif
+_GL_CXXALIASWARN (recvfrom);
+#elif @HAVE_WINSOCK2_H@
+# undef recvfrom
+# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
+#elif defined GNULIB_POSIXCHECK
+# undef recvfrom
+# if HAVE_RAW_DECL_RECVFROM
+_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
+ "use gnulib module recvfrom for portability");
+# endif
+#endif
+
+#if @GNULIB_SENDTO@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sendto
+# define sendto rpl_sendto
+# endif
+_GL_FUNCDECL_RPL (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
+# else
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+ size_t tolen. */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+ (int fd, const void *buf, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen));
+# endif
+_GL_CXXALIASWARN (sendto);
+#elif @HAVE_WINSOCK2_H@
+# undef sendto
+# define sendto sendto_used_without_requesting_gnulib_module_sendto
+#elif defined GNULIB_POSIXCHECK
+# undef sendto
+# if HAVE_RAW_DECL_SENDTO
+_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
+ "use gnulib module sendto for portability");
+# endif
+#endif
+
+#if @GNULIB_SETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef setsockopt
+# define setsockopt rpl_setsockopt
+# endif
+_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
+ const void * optval, socklen_t optlen)
+ _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
+# else
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+ size_t optlen. */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+ (int fd, int level, int optname,
+ const void * optval, socklen_t optlen));
+# endif
+_GL_CXXALIASWARN (setsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef setsockopt
+# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef setsockopt
+# if HAVE_RAW_DECL_SETSOCKOPT
+_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
+ "use gnulib module setsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_SHUTDOWN@
+# if @HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef shutdown
+# define shutdown rpl_shutdown
+# endif
+_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how));
+_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
+# else
+_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
+# endif
+_GL_CXXALIASWARN (shutdown);
+#elif @HAVE_WINSOCK2_H@
+# undef shutdown
+# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
+#elif defined GNULIB_POSIXCHECK
+# undef shutdown
+# if HAVE_RAW_DECL_SHUTDOWN
+_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
+ "use gnulib module shutdown for portability");
+# endif
+#endif
+
+#if @GNULIB_ACCEPT4@
+/* Accept a connection on a socket, with specific opening flags.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ See also the Linux man page at
+ <https://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
+# if @HAVE_ACCEPT4@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define accept4 rpl_accept4
+# endif
+_GL_FUNCDECL_RPL (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+_GL_CXXALIAS_RPL (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+# else
+_GL_FUNCDECL_SYS (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+_GL_CXXALIAS_SYS (accept4, int,
+ (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags));
+# endif
+_GL_CXXALIASWARN (accept4);
+#elif defined GNULIB_POSIXCHECK
+# undef accept4
+# if HAVE_RAW_DECL_ACCEPT4
+_GL_WARN_ON_USE (accept4, "accept4 is unportable - "
+ "use gnulib module accept4 for portability");
+# endif
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */
+#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */
+#endif
diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h
new file mode 100644
index 0000000..096887c
--- /dev/null
+++ b/gl/sys_stat.in.h
@@ -0,0 +1,954 @@
+/* Provide a more complete sys/stat.h header file.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */
+
+/* This file is supposed to be used on platforms where <sys/stat.h> is
+ incomplete. It is intended to provide definitions and prototypes
+ needed by an application. Start with what the system provides. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_system_sys_stat_h
+/* Special invocation convention. */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+
+/* Get nlink_t.
+ May also define off_t to a 64-bit type on native Windows. */
+#include <sys/types.h>
+
+/* Get struct timespec. */
+#include <time.h>
+
+/* The include_next requires a split double-inclusion guard. */
+#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
+
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+#define _@GUARD_PREFIX@_SYS_STAT_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Before doing "#define mknod rpl_mknod" below, we need to include all
+ headers that may declare mknod(). OS/2 kLIBC declares mknod() in
+ <unistd.h>, not in <sys/stat.h>. */
+#ifdef __KLIBC__
+# include <unistd.h>
+#endif
+
+/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
+ headers that may declare mkdir(). Native Windows platforms declare mkdir
+ in <io.h> and/or <direct.h>, not in <sys/stat.h>. */
+#if defined _WIN32 && ! defined __CYGWIN__
+# include <io.h> /* mingw32, mingw64 */
+# include <direct.h> /* mingw64, MSVC 9 */
+#endif
+
+/* Native Windows platforms declare umask() in <io.h>. */
+#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
+/* Large File Support on native Windows. */
+#if @WINDOWS_64_BIT_ST_SIZE@
+# define stat _stati64
+#endif
+
+/* Optionally, override 'struct stat' on native Windows. */
+#if @GNULIB_OVERRIDES_STRUCT_STAT@
+
+# undef stat
+# if @GNULIB_STAT@
+# define stat rpl_stat
+# else
+ /* Provoke a clear link error if stat() is used as a function and
+ module 'stat' is not in use. */
+# define stat stat_used_without_requesting_gnulib_module_stat
+# endif
+
+# if !GNULIB_defined_struct_stat
+struct stat
+{
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+# if 0
+ uid_t st_uid;
+# else /* uid_t is not defined by default on native Windows. */
+ short st_uid;
+# endif
+# if 0
+ gid_t st_gid;
+# else /* gid_t is not defined by default on native Windows. */
+ short st_gid;
+# endif
+ dev_t st_rdev;
+ off_t st_size;
+# if 0
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+# endif
+
+# if @WINDOWS_STAT_TIMESPEC@
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+# else
+ time_t st_atime;
+ time_t st_mtime;
+ time_t st_ctime;
+# endif
+};
+# if @WINDOWS_STAT_TIMESPEC@
+# define st_atime st_atim.tv_sec
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+ /* Indicator, for gnulib internal purposes. */
+# define _GL_WINDOWS_STAT_TIMESPEC 1
+# endif
+# define GNULIB_defined_struct_stat 1
+# endif
+
+/* Other possible values of st_mode. */
+# if 0
+# define _S_IFBLK 0x6000
+# endif
+# if 0
+# define _S_IFLNK 0xA000
+# endif
+# if 0
+# define _S_IFSOCK 0xC000
+# endif
+
+#endif
+
+#ifndef S_IFIFO
+# ifdef _S_IFIFO
+# define S_IFIFO _S_IFIFO
+# endif
+#endif
+
+#ifndef S_IFMT
+# define S_IFMT 0170000
+#endif
+
+#if STAT_MACROS_BROKEN
+# undef S_ISBLK
+# undef S_ISCHR
+# undef S_ISDIR
+# undef S_ISFIFO
+# undef S_ISLNK
+# undef S_ISNAM
+# undef S_ISMPB
+# undef S_ISMPC
+# undef S_ISNWK
+# undef S_ISREG
+# undef S_ISSOCK
+#endif
+
+#ifndef S_ISBLK
+# ifdef S_IFBLK
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# else
+# define S_ISBLK(m) 0
+# endif
+#endif
+
+#ifndef S_ISCHR
+# ifdef S_IFCHR
+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+# else
+# define S_ISCHR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDIR
+# ifdef S_IFDIR
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+# else
+# define S_ISDIR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDOOR /* Solaris 2.5 and up */
+# define S_ISDOOR(m) 0
+#endif
+
+#ifndef S_ISFIFO
+# ifdef S_IFIFO
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# else
+# define S_ISFIFO(m) 0
+# endif
+#endif
+
+#ifndef S_ISLNK
+# ifdef S_IFLNK
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# else
+# define S_ISLNK(m) 0
+# endif
+#endif
+
+#ifndef S_ISMPB /* V7 */
+# ifdef S_IFMPB
+# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
+# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
+# else
+# define S_ISMPB(m) 0
+# define S_ISMPC(m) 0
+# endif
+#endif
+
+#ifndef S_ISMPX /* AIX */
+# define S_ISMPX(m) 0
+#endif
+
+#ifndef S_ISNAM /* Xenix */
+# ifdef S_IFNAM
+# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
+# else
+# define S_ISNAM(m) 0
+# endif
+#endif
+
+#ifndef S_ISNWK /* HP/UX */
+# ifdef S_IFNWK
+# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
+# else
+# define S_ISNWK(m) 0
+# endif
+#endif
+
+#ifndef S_ISPORT /* Solaris 10 and up */
+# define S_ISPORT(m) 0
+#endif
+
+#ifndef S_ISREG
+# ifdef S_IFREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# else
+# define S_ISREG(m) 0
+# endif
+#endif
+
+#ifndef S_ISSOCK
+# ifdef S_IFSOCK
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# else
+# define S_ISSOCK(m) 0
+# endif
+#endif
+
+
+#ifndef S_TYPEISMQ
+# define S_TYPEISMQ(p) 0
+#endif
+
+#ifndef S_TYPEISTMO
+# define S_TYPEISTMO(p) 0
+#endif
+
+
+#ifndef S_TYPEISSEM
+# ifdef S_INSEM
+# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
+# else
+# define S_TYPEISSEM(p) 0
+# endif
+#endif
+
+#ifndef S_TYPEISSHM
+# ifdef S_INSHD
+# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
+# else
+# define S_TYPEISSHM(p) 0
+# endif
+#endif
+
+/* high performance ("contiguous data") */
+#ifndef S_ISCTG
+# define S_ISCTG(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with data */
+#ifndef S_ISOFD
+# define S_ISOFD(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with no data */
+#ifndef S_ISOFL
+# define S_ISOFL(p) 0
+#endif
+
+/* 4.4BSD whiteout */
+#ifndef S_ISWHT
+# define S_ISWHT(m) 0
+#endif
+
+/* If any of the following are undefined,
+ define them to their de facto standard values. */
+#if !S_ISUID
+# define S_ISUID 04000
+#endif
+#if !S_ISGID
+# define S_ISGID 02000
+#endif
+
+/* S_ISVTX is a common extension to POSIX. */
+#ifndef S_ISVTX
+# define S_ISVTX 01000
+#endif
+
+#if !S_IRUSR && S_IREAD
+# define S_IRUSR S_IREAD
+#endif
+#if !S_IRUSR
+# define S_IRUSR 00400
+#endif
+#if !S_IRGRP
+# define S_IRGRP (S_IRUSR >> 3)
+#endif
+#if !S_IROTH
+# define S_IROTH (S_IRUSR >> 6)
+#endif
+
+#if !S_IWUSR && S_IWRITE
+# define S_IWUSR S_IWRITE
+#endif
+#if !S_IWUSR
+# define S_IWUSR 00200
+#endif
+#if !S_IWGRP
+# define S_IWGRP (S_IWUSR >> 3)
+#endif
+#if !S_IWOTH
+# define S_IWOTH (S_IWUSR >> 6)
+#endif
+
+#if !S_IXUSR && S_IEXEC
+# define S_IXUSR S_IEXEC
+#endif
+#if !S_IXUSR
+# define S_IXUSR 00100
+#endif
+#if !S_IXGRP
+# define S_IXGRP (S_IXUSR >> 3)
+#endif
+#if !S_IXOTH
+# define S_IXOTH (S_IXUSR >> 6)
+#endif
+
+#if !S_IRWXU
+# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
+#endif
+#if !S_IRWXG
+# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#endif
+#if !S_IRWXO
+# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
+#endif
+
+/* Although S_IXUGO and S_IRWXUGO are not specified by POSIX and are
+ not implemented in GNU/Linux, some Gnulib-using apps use the macros. */
+#if !S_IXUGO
+# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
+#endif
+#ifndef S_IRWXUGO
+# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
+#endif
+
+/* Macros for futimens and utimensat. */
+#ifndef UTIME_NOW
+# define UTIME_NOW (-1)
+# define UTIME_OMIT (-2)
+#endif
+
+
+#if @GNULIB_CHMOD@
+# if @REPLACE_CHMOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod rpl_chmod
+# endif
+_GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (chmod, int, (const char *filename, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod _chmod
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (chmod);
+#elif defined GNULIB_POSIXCHECK
+# undef chmod
+# if HAVE_RAW_DECL_CHMOD
+_GL_WARN_ON_USE (chmod, "chmod has portability problems - "
+ "use gnulib module chmod for portability");
+# endif
+#elif @GNULIB_MDA_CHMOD@
+/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::chmod always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chmod
+# define chmod _chmod
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (chmod);
+#endif
+
+
+#if @GNULIB_FCHMODAT@
+# if @REPLACE_FCHMODAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fchmodat
+# define fchmodat rpl_fchmodat
+# endif
+_GL_FUNCDECL_RPL (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag));
+# else
+# if !@HAVE_FCHMODAT@
+_GL_FUNCDECL_SYS (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag));
+# endif
+_GL_CXXALIASWARN (fchmodat);
+#elif defined GNULIB_POSIXCHECK
+# undef fchmodat
+# if HAVE_RAW_DECL_FCHMODAT
+_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSTAT@
+# if @REPLACE_FSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fstat
+# define fstat rpl_fstat
+# endif
+_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
+# else
+_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (fstat);
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef fstat
+# define fstat fstat_used_without_requesting_gnulib_module_fstat
+#elif @WINDOWS_64_BIT_ST_SIZE@
+/* Above, we define stat to _stati64. */
+# define fstat _fstati64
+#elif defined GNULIB_POSIXCHECK
+# undef fstat
+# if HAVE_RAW_DECL_FSTAT
+_GL_WARN_ON_USE (fstat, "fstat has portability problems - "
+ "use gnulib module fstat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSTATAT@
+# if @REPLACE_FSTATAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fstatat
+# define fstatat rpl_fstatat
+# endif
+_GL_FUNCDECL_RPL (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags));
+# else
+# if !@HAVE_FSTATAT@
+_GL_FUNCDECL_SYS (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (fstatat, int,
+ (int fd, char const *restrict name, struct stat *restrict st,
+ int flags));
+# endif
+_GL_CXXALIASWARN (fstatat);
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef fstatat
+# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat
+#elif defined GNULIB_POSIXCHECK
+# undef fstatat
+# if HAVE_RAW_DECL_FSTATAT
+_GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FUTIMENS@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
+ implementation relies on futimesat, which on Solaris 10 makes an invocation
+ to futimens that is meant to invoke the libc's futimens(), not gnulib's
+ futimens(). */
+# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef futimens
+# define futimens rpl_futimens
+# endif
+_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
+_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
+# else
+# if !@HAVE_FUTIMENS@
+_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
+# endif
+_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
+# endif
+# if @HAVE_FUTIMENS@
+_GL_CXXALIASWARN (futimens);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef futimens
+# if HAVE_RAW_DECL_FUTIMENS
+_GL_WARN_ON_USE (futimens, "futimens is not portable - "
+ "use gnulib module futimens for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETUMASK@
+# if !@HAVE_GETUMASK@
+_GL_FUNCDECL_SYS (getumask, mode_t, (void));
+# endif
+_GL_CXXALIAS_SYS (getumask, mode_t, (void));
+# if @HAVE_GETUMASK@
+_GL_CXXALIASWARN (getumask);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getumask
+# if HAVE_RAW_DECL_GETUMASK
+_GL_WARN_ON_USE (getumask, "getumask is not portable - "
+ "use gnulib module getumask for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LCHMOD@
+/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
+ denotes a symbolic link. */
+# if !@HAVE_LCHMOD@ || defined __hpux
+_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
+_GL_CXXALIASWARN (lchmod);
+#elif defined GNULIB_POSIXCHECK
+# undef lchmod
+# if HAVE_RAW_DECL_LCHMOD
+_GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
+ "use gnulib module lchmod for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKDIR@
+# if @REPLACE_MKDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkdir
+# define mkdir rpl_mkdir
+# endif
+_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
+ Additionally, it declares _mkdir (and depending on compile flags, an
+ alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
+ which are included above. */
+# if !GNULIB_defined_rpl_mkdir
+static int
+rpl_mkdir (char const *name, mode_t mode)
+{
+ return _mkdir (name);
+}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkdir
+# define mkdir rpl_mkdir
+# endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkdir);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdir
+# if HAVE_RAW_DECL_MKDIR
+_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
+ "use gnulib module mkdir for portability");
+# endif
+#elif @GNULIB_MDA_MKDIR@
+/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::mkdir always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !GNULIB_defined_rpl_mkdir
+static int
+rpl_mkdir (char const *name, mode_t mode)
+{
+ return _mkdir (name);
+}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkdir
+# define mkdir rpl_mkdir
+# endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkdir);
+#endif
+
+
+#if @GNULIB_MKDIRAT@
+# if !@HAVE_MKDIRAT@
+_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
+_GL_CXXALIASWARN (mkdirat);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdirat
+# if HAVE_RAW_DECL_MKDIRAT
+_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
+ "use gnulib module openat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKFIFO@
+# if @REPLACE_MKFIFO@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkfifo
+# define mkfifo rpl_mkfifo
+# endif
+_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
+# else
+# if !@HAVE_MKFIFO@
+_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkfifo);
+#elif defined GNULIB_POSIXCHECK
+# undef mkfifo
+# if HAVE_RAW_DECL_MKFIFO
+_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
+ "use gnulib module mkfifo for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKFIFOAT@
+# if @REPLACE_MKFIFOAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkfifoat
+# define mkfifoat rpl_mkfifoat
+# endif
+_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode));
+# else
+# if !@HAVE_MKFIFOAT@
+_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkfifoat);
+#elif defined GNULIB_POSIXCHECK
+# undef mkfifoat
+# if HAVE_RAW_DECL_MKFIFOAT
+_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
+ "use gnulib module mkfifoat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKNOD@
+# if @REPLACE_MKNOD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mknod
+# define mknod rpl_mknod
+# endif
+_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
+# else
+# if !@HAVE_MKNOD@
+_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */
+_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
+# endif
+_GL_CXXALIASWARN (mknod);
+#elif defined GNULIB_POSIXCHECK
+# undef mknod
+# if HAVE_RAW_DECL_MKNOD
+_GL_WARN_ON_USE (mknod, "mknod is not portable - "
+ "use gnulib module mknod for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MKNODAT@
+# if @REPLACE_MKNODAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mknodat
+# define mknodat rpl_mknodat
+# endif
+_GL_FUNCDECL_RPL (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev));
+# else
+# if !@HAVE_MKNODAT@
+_GL_FUNCDECL_SYS (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mknodat, int,
+ (int fd, char const *file, mode_t mode, dev_t dev));
+# endif
+_GL_CXXALIASWARN (mknodat);
+#elif defined GNULIB_POSIXCHECK
+# undef mknodat
+# if HAVE_RAW_DECL_MKNODAT
+_GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
+ "use gnulib module mkfifoat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_STAT@
+# if @REPLACE_STAT@
+# if !@GNULIB_OVERRIDES_STRUCT_STAT@
+ /* We can't use the object-like #define stat rpl_stat, because of
+ struct stat. This means that rpl_stat will not be used if the user
+ does (stat)(a,b). Oh well. */
+# if defined _AIX && defined stat && defined _LARGE_FILES
+ /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+ so we have to replace stat64() instead of stat(). */
+# undef stat64
+# define stat64(name, st) rpl_stat (name, st)
+# elif @WINDOWS_64_BIT_ST_SIZE@
+ /* Above, we define stat to _stati64. */
+# if defined __MINGW32__ && defined _stati64
+# ifndef _USE_32BIT_TIME_T
+ /* The system headers define _stati64 to _stat64. */
+# undef _stat64
+# define _stat64(name, st) rpl_stat (name, st)
+# endif
+# elif defined _MSC_VER && defined _stati64
+# ifdef _USE_32BIT_TIME_T
+ /* The system headers define _stati64 to _stat32i64. */
+# undef _stat32i64
+# define _stat32i64(name, st) rpl_stat (name, st)
+# else
+ /* The system headers define _stati64 to _stat64. */
+# undef _stat64
+# define _stat64(name, st) rpl_stat (name, st)
+# endif
+# else
+# undef _stati64
+# define _stati64(name, st) rpl_stat (name, st)
+# endif
+# elif defined __MINGW32__ && defined stat
+# ifdef _USE_32BIT_TIME_T
+ /* The system headers define stat to _stat32i64. */
+# undef _stat32i64
+# define _stat32i64(name, st) rpl_stat (name, st)
+# else
+ /* The system headers define stat to _stat64. */
+# undef _stat64
+# define _stat64(name, st) rpl_stat (name, st)
+# endif
+# elif defined _MSC_VER && defined stat
+# ifdef _USE_32BIT_TIME_T
+ /* The system headers define stat to _stat32. */
+# undef _stat32
+# define _stat32(name, st) rpl_stat (name, st)
+# else
+ /* The system headers define stat to _stat64i32. */
+# undef _stat64i32
+# define _stat64i32(name, st) rpl_stat (name, st)
+# endif
+# else /* !(_AIX || __MINGW32__ || _MSC_VER) */
+# undef stat
+# define stat(name, st) rpl_stat (name, st)
+# endif /* !_LARGE_FILES */
+# endif /* !@GNULIB_OVERRIDES_STRUCT_STAT@ */
+_GL_EXTERN_C int stat (const char *restrict name, struct stat *restrict buf)
+ _GL_ARG_NONNULL ((1, 2));
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+/* see above:
+ #define stat stat_used_without_requesting_gnulib_module_stat
+ */
+#elif defined GNULIB_POSIXCHECK
+# undef stat
+# if HAVE_RAW_DECL_STAT
+_GL_WARN_ON_USE (stat, "stat is unportable - "
+ "use gnulib module stat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LSTAT@
+# if ! @HAVE_LSTAT@
+/* mingw does not support symlinks, therefore it does not have lstat. But
+ without links, stat does just fine. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define lstat stat
+# endif
+_GL_CXXALIAS_RPL_1 (lstat, stat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# elif @REPLACE_LSTAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lstat
+# define lstat rpl_lstat
+# endif
+_GL_FUNCDECL_RPL (lstat, int,
+ (const char *restrict name, struct stat *restrict buf)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (lstat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# else
+_GL_CXXALIAS_SYS (lstat, int,
+ (const char *restrict name, struct stat *restrict buf));
+# endif
+# if @HAVE_LSTAT@
+_GL_CXXALIASWARN (lstat);
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef lstat
+# define lstat lstat_used_without_requesting_gnulib_module_lstat
+#elif defined GNULIB_POSIXCHECK
+# undef lstat
+# if HAVE_RAW_DECL_LSTAT
+_GL_WARN_ON_USE (lstat, "lstat is unportable - "
+ "use gnulib module lstat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_UMASK@
+/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::umask always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef umask
+# define umask _umask
+# endif
+/* Need to cast, because in mingw the last argument is 'int mode'. */
+_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask));
+# else
+_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask));
+# endif
+_GL_CXXALIASWARN (umask);
+#endif
+
+
+#if @GNULIB_UTIMENSAT@
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
+ implementation relies on futimesat, which on Solaris 10 makes an invocation
+ to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
+ utimensat(). */
+# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef utimensat
+# define utimensat rpl_utimensat
+# endif
+_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag));
+# else
+# if !@HAVE_UTIMENSAT@
+_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
+ struct timespec const times[2], int flag));
+# endif
+# if @HAVE_UTIMENSAT@
+_GL_CXXALIASWARN (utimensat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef utimensat
+# if HAVE_RAW_DECL_UTIMENSAT
+_GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
+ "use gnulib module utimensat for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+#endif
diff --git a/gl/sys_types.in.h b/gl/sys_types.in.h
new file mode 100644
index 0000000..082a6c6
--- /dev/null
+++ b/gl/sys_types.in.h
@@ -0,0 +1,106 @@
+/* Provide a more complete sys/types.h.
+
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _WIN32 && !defined __CYGWIN__ \
+ && (defined __need_off_t || defined __need___off64_t \
+ || defined __need_ssize_t || defined __need_time_t)
+
+/* Special invocation convention inside mingw header files. */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* The include_next requires a split double-inclusion guard. */
+# define _GL_INCLUDING_SYS_TYPES_H
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+# undef _GL_INCLUDING_SYS_TYPES_H
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+#define _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* Override off_t if Large File Support is requested on native Windows. */
+#if @WINDOWS_64_BIT_OFF_T@
+/* Same as int64_t in <stdint.h>. */
+# if defined _MSC_VER
+# define off_t __int64
+# else
+# define off_t long long int
+# endif
+/* Indicator, for gnulib internal purposes. */
+# define _GL_WINDOWS_64_BIT_OFF_T 1
+#endif
+
+/* Override dev_t and ino_t if distinguishable inodes support is requested
+ on native Windows. */
+#if @WINDOWS_STAT_INODES@
+
+# if @WINDOWS_STAT_INODES@ == 2
+/* Experimental, not useful in Windows 10. */
+
+/* Define dev_t to a 64-bit type. */
+# if !defined GNULIB_defined_dev_t
+typedef unsigned long long int rpl_dev_t;
+# undef dev_t
+# define dev_t rpl_dev_t
+# define GNULIB_defined_dev_t 1
+# endif
+
+/* Define ino_t to a 128-bit type. */
+# if !defined GNULIB_defined_ino_t
+/* MSVC does not have a 128-bit integer type.
+ GCC has a 128-bit integer type __int128, but only on 64-bit targets. */
+typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t;
+# undef ino_t
+# define ino_t rpl_ino_t
+# define GNULIB_defined_ino_t 1
+# endif
+
+# else /* @WINDOWS_STAT_INODES@ == 1 */
+
+/* Define ino_t to a 64-bit type. */
+# if !defined GNULIB_defined_ino_t
+typedef unsigned long long int rpl_ino_t;
+# undef ino_t
+# define ino_t rpl_ino_t
+# define GNULIB_defined_ino_t 1
+# endif
+
+# endif
+
+/* Indicator, for gnulib internal purposes. */
+# define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@
+
+#endif
+
+/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
+# include <stddef.h>
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* __need_XXX */
diff --git a/gl/sys_uio.in.h b/gl/sys_uio.in.h
new file mode 100644
index 0000000..64c4fb6
--- /dev/null
+++ b/gl/sys_uio.in.h
@@ -0,0 +1,63 @@
+/* Substitute for <sys/uio.h>.
+ Copyright (C) 2011-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+# if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+#ifndef _@GUARD_PREFIX@_SYS_UIO_H
+
+#if @HAVE_SYS_UIO_H@
+
+/* On OpenBSD 4.4, <sys/uio.h> assumes prior inclusion of <sys/types.h>. */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYS_UIO_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_UIO_H
+#define _@GUARD_PREFIX@_SYS_UIO_H
+
+#if !@HAVE_SYS_UIO_H@
+/* A platform that lacks <sys/uio.h>. */
+/* Get 'size_t' and 'ssize_t'. */
+# include <sys/types.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if !GNULIB_defined_struct_iovec
+/* All known platforms that lack <sys/uio.h> also lack any declaration
+ of struct iovec in any other header. */
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+# define GNULIB_defined_struct_iovec 1
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_UIO_H */
+#endif /* _@GUARD_PREFIX@_SYS_UIO_H */
diff --git a/gl/time.in.h b/gl/time.in.h
new file mode 100644
index 0000000..50c9b30
--- /dev/null
+++ b/gl/time.in.h
@@ -0,0 +1,457 @@
+/* A more-standard <time.h>.
+
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Don't get in the way of glibc when it includes time.h merely to
+ declare a few standard symbols, rather than to declare all the
+ symbols. (However, skip this for MinGW as it treats __need_time_t
+ incompatibly.) Also, Solaris 8 <time.h> eventually includes itself
+ recursively; if that is happening, just include the system <time.h>
+ without adding our own declarations. */
+#if (((defined __need_time_t || defined __need_clock_t \
+ || defined __need_timespec) \
+ && !defined __MINGW32__) \
+ || defined _@GUARD_PREFIX@_TIME_H)
+
+# @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+#else
+
+# define _@GUARD_PREFIX@_TIME_H
+
+/* mingw's <time.h> provides the functions asctime_r, ctime_r, gmtime_r,
+ localtime_r only if <unistd.h> or <pthread.h> has been included before. */
+# if defined __MINGW32__
+# include <unistd.h>
+# endif
+
+# @INCLUDE_NEXT@ @NEXT_TIME_H@
+
+/* NetBSD 5.0 mis-defines NULL. */
+# include <stddef.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Some systems don't define struct timespec (e.g., AIX 4.1).
+ Or they define it with the wrong member names or define it in <sys/time.h>
+ (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it,
+ but the pthreads-win32 library defines it in <pthread.h>. */
+# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
+# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+# include <sys/time.h>
+# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+# include <pthread.h>
+# elif @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+# include <unistd.h>
+# else
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if !GNULIB_defined_struct_timespec
+# undef timespec
+# define timespec rpl_timespec
+struct timespec
+{
+ time_t tv_sec;
+ long int tv_nsec;
+};
+# define GNULIB_defined_struct_timespec 1
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+# endif
+# endif
+
+# if !GNULIB_defined_struct_time_t_must_be_integral
+/* https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
+ requires time_t to be an integer type, even though C99 permits floating
+ point. We don't know of any implementation that uses floating
+ point, and it is much easier to write code that doesn't have to
+ worry about that corner case, so we force the issue. */
+struct __time_t_must_be_integral {
+ unsigned int __floating_time_t_unsupported : (time_t) 1;
+};
+# define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
+
+/* Define TIME_UTC, a positive integer constant used for timespec_get(). */
+# if ! @TIME_H_DEFINES_TIME_UTC@
+# if !GNULIB_defined_TIME_UTC
+# define TIME_UTC 1
+# define GNULIB_defined_TIME_UTC 1
+# endif
+# endif
+
+/* Set *TS to the current time, and return BASE.
+ Upon failure, return 0. */
+# if @GNULIB_TIMESPEC_GET@
+# if ! @HAVE_TIMESPEC_GET@
+_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
+_GL_CXXALIASWARN (timespec_get);
+# endif
+
+/* Set *TS to the current time resolution, and return BASE.
+ Upon failure, return 0. */
+# if @GNULIB_TIMESPEC_GETRES@
+# if ! @HAVE_TIMESPEC_GETRES@
+_GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
+_GL_CXXALIASWARN (timespec_getres);
+# endif
+
+/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
+ return -1 and store the remaining time into RMTP. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html>. */
+# if @GNULIB_NANOSLEEP@
+# if @REPLACE_NANOSLEEP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define nanosleep rpl_nanosleep
+# endif
+_GL_FUNCDECL_RPL (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp));
+# else
+# if ! @HAVE_NANOSLEEP@
+_GL_FUNCDECL_SYS (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (nanosleep, int,
+ (struct timespec const *__rqtp, struct timespec *__rmtp));
+# endif
+_GL_CXXALIASWARN (nanosleep);
+# endif
+
+/* Initialize time conversion information. */
+# if @GNULIB_TZSET@
+# if @REPLACE_TZSET@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tzset
+# define tzset rpl_tzset
+# endif
+_GL_FUNCDECL_RPL (tzset, void, (void));
+_GL_CXXALIAS_RPL (tzset, void, (void));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tzset
+# define tzset _tzset
+# endif
+_GL_CXXALIAS_MDA (tzset, void, (void));
+# else
+_GL_CXXALIAS_SYS (tzset, void, (void));
+# endif
+_GL_CXXALIASWARN (tzset);
+# elif @GNULIB_MDA_TZSET@
+/* On native Windows, map 'tzset' to '_tzset', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::tzset always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef tzset
+# define tzset _tzset
+# endif
+_GL_CXXALIAS_MDA (tzset, void, (void));
+# else
+_GL_CXXALIAS_SYS (tzset, void, (void));
+# endif
+_GL_CXXALIASWARN (tzset);
+# endif
+
+/* Return the 'time_t' representation of TP and normalize TP. */
+# if @GNULIB_MKTIME@
+# if @REPLACE_MKTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define mktime rpl_mktime
+# endif
+_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
+# else
+_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mktime);
+# endif
+# endif
+
+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime_r.html> and
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gmtime_r.html>. */
+# if @GNULIB_TIME_R@
+# if @REPLACE_LOCALTIME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef localtime_r
+# define localtime_r rpl_localtime_r
+# endif
+_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# else
+# if ! @HAVE_DECL_LOCALTIME_R@
+_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# endif
+# if @HAVE_DECL_LOCALTIME_R@
+_GL_CXXALIASWARN (localtime_r);
+# endif
+# if @REPLACE_LOCALTIME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gmtime_r
+# define gmtime_r rpl_gmtime_r
+# endif
+_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# else
+# if ! @HAVE_DECL_LOCALTIME_R@
+_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+ struct tm *restrict __result));
+# endif
+# if @HAVE_DECL_LOCALTIME_R@
+_GL_CXXALIASWARN (gmtime_r);
+# endif
+# endif
+
+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime.html> and
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gmtime.html>. */
+# if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@
+# if @REPLACE_LOCALTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef localtime
+# define localtime rpl_localtime
+# endif
+_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
+# else
+_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (localtime);
+# endif
+# endif
+
+# if 0 || @REPLACE_GMTIME@
+# if @REPLACE_GMTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gmtime
+# define gmtime rpl_gmtime
+# endif
+_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
+# else
+_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
+# endif
+_GL_CXXALIASWARN (gmtime);
+# endif
+
+/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store
+ the resulting broken-down time into TM. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html>. */
+# if @GNULIB_STRPTIME@
+# if ! @HAVE_STRPTIME@
+_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
+ char const *restrict __format,
+ struct tm *restrict __tm)
+ _GL_ARG_NONNULL ((1, 2, 3)));
+# endif
+_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
+ char const *restrict __format,
+ struct tm *restrict __tm));
+_GL_CXXALIASWARN (strptime);
+# endif
+
+/* Convert *TP to a date and time string. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime.html>. */
+# if @GNULIB_CTIME@
+# if @REPLACE_CTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define ctime rpl_ctime
+# endif
+_GL_ATTRIBUTE_DEPRECATED
+_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
+# else
+_GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ctime);
+# endif
+# endif
+
+/* Convert *TP to a date and time string. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html>. */
+# if @GNULIB_STRFTIME@
+# if @REPLACE_STRFTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strftime rpl_strftime
+# endif
+_GL_FUNCDECL_RPL (strftime, size_t,
+ (char *restrict __buf, size_t __bufsize,
+ const char *restrict __fmt, const struct tm *restrict __tp)
+ _GL_ARG_NONNULL ((1, 3, 4)));
+_GL_CXXALIAS_RPL (strftime, size_t,
+ (char *restrict __buf, size_t __bufsize,
+ const char *restrict __fmt, const struct tm *restrict __tp));
+# else
+_GL_CXXALIAS_SYS (strftime, size_t,
+ (char *restrict __buf, size_t __bufsize,
+ const char *restrict __fmt, const struct tm *restrict __tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strftime);
+# endif
+# endif
+
+# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
+/* Functions that use a first-class time zone data type, instead of
+ relying on an implicit global time zone.
+ Inspired by NetBSD. */
+
+/* Represents a time zone.
+ (timezone_t) NULL stands for UTC. */
+typedef struct tm_zone *timezone_t;
+
+/* tzalloc (name)
+ Returns a time zone object for the given time zone NAME. This object
+ represents the time zone that other functions would use it the TZ
+ environment variable was set to NAME.
+ If NAME is NULL, the result represents the time zone that other functions
+ would use it the TZ environment variable was unset.
+ May return NULL if NAME is invalid (this is platform dependent) or
+ upon memory allocation failure. */
+_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
+_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
+
+/* tzfree (tz)
+ Frees a time zone object.
+ The argument must have been returned by tzalloc(). */
+_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
+_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
+
+/* localtime_rz (tz, &t, &result)
+ Converts an absolute time T to a broken-down time RESULT, assuming the
+ time zone TZ.
+ This function is like 'localtime_r', but relies on the argument TZ instead
+ of an implicit global time zone. */
+_GL_FUNCDECL_SYS (localtime_rz, struct tm *,
+ (timezone_t __tz, time_t const *restrict __timer,
+ struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_SYS (localtime_rz, struct tm *,
+ (timezone_t __tz, time_t const *restrict __timer,
+ struct tm *restrict __result));
+
+/* mktime_z (tz, &tm)
+ Normalizes the broken-down time TM and converts it to an absolute time,
+ assuming the time zone TZ. Returns the absolute time.
+ This function is like 'mktime', but relies on the argument TZ instead
+ of an implicit global time zone. */
+_GL_FUNCDECL_SYS (mktime_z, time_t,
+ (timezone_t __tz, struct tm *restrict __tm)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (mktime_z, time_t,
+ (timezone_t __tz, struct tm *restrict __tm));
+
+/* Time zone abbreviation strings (returned by 'localtime_rz' or 'mktime_z'
+ in the 'tm_zone' member of 'struct tm') are valid as long as
+ - the 'struct tm' argument is not destroyed or overwritten,
+ and
+ - the 'timezone_t' argument is not freed through tzfree(). */
+
+# endif
+
+/* Convert TM to a time_t value, assuming UTC. */
+# if @GNULIB_TIMEGM@
+# if @REPLACE_TIMEGM@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef timegm
+# define timegm rpl_timegm
+# endif
+_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
+# else
+# if ! @HAVE_TIMEGM@
+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
+# endif
+_GL_CXXALIASWARN (timegm);
+# endif
+
+/* Encourage applications to avoid unsafe functions that can overrun
+ buffers when given outlandish struct tm values. Portable
+ applications should use strftime (or even sprintf) instead. */
+# if defined GNULIB_POSIXCHECK
+# undef asctime
+_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef asctime_r
+# if HAVE_RAW_DECL_ASCTIME_R
+_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef ctime
+_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef ctime_r
+# if HAVE_RAW_DECL_CTIME_R
+_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
+ "better use strftime (or even sprintf) instead");
+# endif
+# endif
+
+#endif
diff --git a/gl/time_r.c b/gl/time_r.c
new file mode 100644
index 0000000..97be4fd
--- /dev/null
+++ b/gl/time_r.c
@@ -0,0 +1,44 @@
+/* Reentrant time functions like localtime_r.
+
+ Copyright (C) 2003, 2006-2007, 2010-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert. */
+
+#include <config.h>
+
+#include <time.h>
+
+static struct tm *
+copy_tm_result (struct tm *dest, struct tm const *src)
+{
+ if (! src)
+ return 0;
+ *dest = *src;
+ return dest;
+}
+
+
+struct tm *
+gmtime_r (time_t const * restrict t, struct tm * restrict tp)
+{
+ return copy_tm_result (tp, gmtime (t));
+}
+
+struct tm *
+localtime_r (time_t const * restrict t, struct tm * restrict tp)
+{
+ return copy_tm_result (tp, localtime (t));
+}
diff --git a/gl/timegm.c b/gl/timegm.c
new file mode 100644
index 0000000..b47025a
--- /dev/null
+++ b/gl/timegm.c
@@ -0,0 +1,58 @@
+/* Convert UTC calendar time to simple time. Like mktime but assumes UTC.
+
+ Copyright (C) 1994-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <time.h>
+#include <errno.h>
+
+#include "mktime-internal.h"
+
+__time64_t
+__timegm64 (struct tm *tmp)
+{
+ static mktime_offset_t gmtime_offset;
+ tmp->tm_isdst = 0;
+ return __mktime_internal (tmp, __gmtime64_r, &gmtime_offset);
+}
+
+#if defined _LIBC && __TIMESIZE != 64
+
+libc_hidden_def (__timegm64)
+
+time_t
+timegm (struct tm *tmp)
+{
+ struct tm tm = *tmp;
+ __time64_t t = __timegm64 (&tm);
+ if (in_time_t_range (t))
+ {
+ *tmp = tm;
+ return t;
+ }
+ else
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+}
+
+#endif
diff --git a/gl/unistd.c b/gl/unistd.c
new file mode 100644
index 0000000..be7a825
--- /dev/null
+++ b/gl/unistd.c
@@ -0,0 +1,22 @@
+/* Inline functions for <unistd.h>.
+
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
+#include "unistd.h"
+typedef int dummy;
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
new file mode 100644
index 0000000..4812fdb
--- /dev/null
+++ b/gl/unistd.in.h
@@ -0,0 +1,2329 @@
+/* Substitute for and wrapper around <unistd.h>.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _@GUARD_PREFIX@_UNISTD_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_UNISTD_H@ && defined _GL_INCLUDING_UNISTD_H
+/* Special invocation convention:
+ - On Mac OS X 10.3.9 we have a sequence of nested includes
+ <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
+ In this situation, the functions are not yet declared, therefore we cannot
+ provide the C++ aliases. */
+
+#@INCLUDE_NEXT@ @NEXT_UNISTD_H@
+
+#else
+/* Normal invocation convention. */
+
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_UNISTD_H@
+# define _GL_INCLUDING_UNISTD_H
+# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
+# undef _GL_INCLUDING_UNISTD_H
+#endif
+
+/* Get all possible declarations of gethostname(). */
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
+ && !defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+#endif
+
+#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
+#define _@GUARD_PREFIX@_UNISTD_H
+
+/* NetBSD 5.0 mis-defines NULL. Also get size_t. */
+/* But avoid namespace pollution on glibc systems. */
+#ifndef __GLIBC__
+# include <stddef.h>
+#endif
+
+/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
+/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>. We must include
+ it before we #define unlink rpl_unlink. */
+/* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
+ || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
+ && (defined _WIN32 && ! defined __CYGWIN__)) \
+ || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
+ && defined __CYGWIN__)) \
+ && ! defined __GLIBC__
+# include <stdio.h>
+#endif
+
+/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
+ <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
+ && (defined __CYGWIN__ || defined __ANDROID__) \
+ && ! defined __GLIBC__
+# include <fcntl.h>
+#endif
+
+/* mingw fails to declare _exit in <unistd.h>. */
+/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
+ <unistd.h>. */
+/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
+/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
+ included here. */
+/* But avoid namespace pollution on glibc systems. */
+#if !defined __GLIBC__ && !defined __osf__
+# define __need_system_stdlib_h
+# include <stdlib.h>
+# undef __need_system_stdlib_h
+#endif
+
+/* Native Windows platforms declare _chdir, _getcwd, _rmdir in
+ <io.h> and/or <direct.h>, not in <unistd.h>.
+ They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
+ _lseek(), _read(), _unlink(), _write() in <io.h>. */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <io.h>
+# include <direct.h>
+#endif
+
+/* Native Windows platforms declare _execl*, _execv* in <process.h>. */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <process.h>
+#endif
+
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
+ NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
+ || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
+ && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
+/* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in
+ <sys/random.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \
+ && ((defined __APPLE__ && defined __MACH__) || defined __sun \
+ || defined __ANDROID__) \
+ && @UNISTD_H_HAVE_SYS_RANDOM_H@ \
+ && !defined __GLIBC__
+# include <sys/random.h>
+#endif
+
+/* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+ && !defined __GLIBC__
+# include <sys/stat.h>
+#endif
+
+/* MSVC defines off_t in <sys/types.h>.
+ May also define off_t to a 64-bit type on native Windows. */
+/* Get off_t, ssize_t, mode_t. */
+#include <sys/types.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Get getopt(), optarg, optind, opterr, optopt. */
+#if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
+# include <getopt-cdefs.h>
+# include <getopt-pfx-core.h>
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_UNISTD_INLINE
+# define _GL_UNISTD_INLINE _GL_INLINE
+#endif
+
+/* Hide some function declarations from <winsock2.h>. */
+
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef socket
+# define socket socket_used_without_including_sys_socket_h
+# undef connect
+# define connect connect_used_without_including_sys_socket_h
+# undef accept
+# define accept accept_used_without_including_sys_socket_h
+# undef bind
+# define bind bind_used_without_including_sys_socket_h
+# undef getpeername
+# define getpeername getpeername_used_without_including_sys_socket_h
+# undef getsockname
+# define getsockname getsockname_used_without_including_sys_socket_h
+# undef getsockopt
+# define getsockopt getsockopt_used_without_including_sys_socket_h
+# undef listen
+# define listen listen_used_without_including_sys_socket_h
+# undef recv
+# define recv recv_used_without_including_sys_socket_h
+# undef send
+# define send send_used_without_including_sys_socket_h
+# undef recvfrom
+# define recvfrom recvfrom_used_without_including_sys_socket_h
+# undef sendto
+# define sendto sendto_used_without_including_sys_socket_h
+# undef setsockopt
+# define setsockopt setsockopt_used_without_including_sys_socket_h
+# undef shutdown
+# define shutdown shutdown_used_without_including_sys_socket_h
+# else
+ _GL_WARN_ON_USE (socket,
+ "socket() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (connect,
+ "connect() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (accept,
+ "accept() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (bind,
+ "bind() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getpeername,
+ "getpeername() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockname,
+ "getsockname() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (getsockopt,
+ "getsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (listen,
+ "listen() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recv,
+ "recv() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (send,
+ "send() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (recvfrom,
+ "recvfrom() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (sendto,
+ "sendto() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (setsockopt,
+ "setsockopt() used without including <sys/socket.h>");
+ _GL_WARN_ON_USE (shutdown,
+ "shutdown() used without including <sys/socket.h>");
+# endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef select
+# define select select_used_without_including_sys_select_h
+# else
+ _GL_WARN_ON_USE (select,
+ "select() used without including <sys/select.h>");
+# endif
+# endif
+#endif
+
+
+/* OS/2 EMX lacks these macros. */
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+# define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
+
+/* Ensure *_OK macros exist. */
+#ifndef F_OK
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+#endif
+
+
+/* Declare overridden functions. */
+
+
+#if @GNULIB_ACCESS@
+# if @REPLACE_ACCESS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef access
+# define access rpl_access
+# endif
+_GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef access
+# define access _access
+# endif
+_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
+# else
+_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
+# endif
+_GL_CXXALIASWARN (access);
+#elif defined GNULIB_POSIXCHECK
+# undef access
+# if HAVE_RAW_DECL_ACCESS
+/* The access() function is a security risk. */
+_GL_WARN_ON_USE (access, "access does not always support X_OK - "
+ "use gnulib module access for portability; "
+ "also, this function is a security risk - "
+ "use the gnulib module faccessat instead");
+# endif
+#elif @GNULIB_MDA_ACCESS@
+/* On native Windows, map 'access' to '_access', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::access always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef access
+# define access _access
+# endif
+_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
+# else
+_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
+# endif
+_GL_CXXALIASWARN (access);
+#endif
+
+
+#if @GNULIB_CHDIR@
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chdir
+# define chdir _chdir
+# endif
+_GL_CXXALIAS_MDA (chdir, int, (const char *file));
+# else
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIASWARN (chdir);
+#elif defined GNULIB_POSIXCHECK
+# undef chdir
+# if HAVE_RAW_DECL_CHDIR
+_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
+ "use gnulib module chdir for portability");
+# endif
+#elif @GNULIB_MDA_CHDIR@
+/* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::chdir always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chdir
+# define chdir _chdir
+# endif
+_GL_CXXALIAS_MDA (chdir, int, (const char *file));
+# else
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIASWARN (chdir);
+#endif
+
+
+#if @GNULIB_CHOWN@
+/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
+ to GID (if GID is not -1). Follow symbolic links.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html. */
+# if @REPLACE_CHOWN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef chown
+# define chown rpl_chown
+# endif
+_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
+# else
+# if !@HAVE_CHOWN@
+_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
+# endif
+_GL_CXXALIASWARN (chown);
+#elif defined GNULIB_POSIXCHECK
+# undef chown
+# if HAVE_RAW_DECL_CHOWN
+_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
+ "doesn't treat a uid or gid of -1 on some systems - "
+ "use gnulib module chown for portability");
+# endif
+#endif
+
+
+#if @GNULIB_CLOSE@
+# if @REPLACE_CLOSE@
+/* Automatically included by modules that need a replacement for close. */
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close rpl_close
+# endif
+_GL_FUNCDECL_RPL (close, int, (int fd));
+_GL_CXXALIAS_RPL (close, int, (int fd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close _close
+# endif
+_GL_CXXALIAS_MDA (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
+# endif
+_GL_CXXALIASWARN (close);
+#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+# undef close
+# define close close_used_without_requesting_gnulib_module_close
+#elif defined GNULIB_POSIXCHECK
+# undef close
+/* Assume close is always declared. */
+_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
+ "use gnulib module close for portability");
+#elif @GNULIB_MDA_CLOSE@
+/* On native Windows, map 'close' to '_close', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::close always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef close
+# define close _close
+# endif
+_GL_CXXALIAS_MDA (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
+# endif
+_GL_CXXALIASWARN (close);
+#endif
+
+
+#if @GNULIB_COPY_FILE_RANGE@
+# if @REPLACE_COPY_FILE_RANGE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef copy_file_range
+# define copy_file_range rpl_copy_file_range
+# endif
+_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+# else
+# if !@HAVE_COPY_FILE_RANGE@
+_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+# endif
+_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+ int ofd, off_t *opos,
+ size_t len, unsigned flags));
+# endif
+_GL_CXXALIASWARN (copy_file_range);
+#elif defined GNULIB_POSIXCHECK
+# undef copy_file_range
+# if HAVE_RAW_DECL_COPY_FILE_RANGE
+_GL_WARN_ON_USE (copy_file_range,
+ "copy_file_range is unportable - "
+ "use gnulib module copy_file_range for portability");
+# endif
+#endif
+
+
+#if @GNULIB_DUP@
+# if @REPLACE_DUP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dup rpl_dup
+# endif
+_GL_FUNCDECL_RPL (dup, int, (int oldfd));
+_GL_CXXALIAS_RPL (dup, int, (int oldfd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup
+# define dup _dup
+# endif
+_GL_CXXALIAS_MDA (dup, int, (int oldfd));
+# else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+# endif
+_GL_CXXALIASWARN (dup);
+#elif defined GNULIB_POSIXCHECK
+# undef dup
+# if HAVE_RAW_DECL_DUP
+_GL_WARN_ON_USE (dup, "dup is unportable - "
+ "use gnulib module dup for portability");
+# endif
+#elif @GNULIB_MDA_DUP@
+/* On native Windows, map 'dup' to '_dup', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::dup always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup
+# define dup _dup
+# endif
+_GL_CXXALIAS_MDA (dup, int, (int oldfd));
+# else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+# endif
+_GL_CXXALIASWARN (dup);
+#endif
+
+
+#if @GNULIB_DUP2@
+/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
+ NEWFD = OLDFD, otherwise close NEWFD first if it is open.
+ Return newfd if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>. */
+# if @REPLACE_DUP2@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dup2 rpl_dup2
+# endif
+_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
+_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup2
+# define dup2 _dup2
+# endif
+_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
+# else
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
+# endif
+_GL_CXXALIASWARN (dup2);
+#elif defined GNULIB_POSIXCHECK
+# undef dup2
+# if HAVE_RAW_DECL_DUP2
+_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
+ "use gnulib module dup2 for portability");
+# endif
+#elif @GNULIB_MDA_DUP2@
+/* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::dup2 always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef dup2
+# define dup2 _dup2
+# endif
+_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
+# else
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
+# endif
+_GL_CXXALIASWARN (dup2);
+#endif
+
+
+#if @GNULIB_DUP3@
+/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
+ specified flags.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ Close NEWFD first if it is open.
+ Return newfd if successful, otherwise -1 and errno set.
+ See the Linux man page at
+ <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
+# if @HAVE_DUP3@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define dup3 rpl_dup3
+# endif
+_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
+# else
+_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
+# endif
+_GL_CXXALIASWARN (dup3);
+#elif defined GNULIB_POSIXCHECK
+# undef dup3
+# if HAVE_RAW_DECL_DUP3
+_GL_WARN_ON_USE (dup3, "dup3 is unportable - "
+ "use gnulib module dup3 for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ENVIRON@
+# if defined __CYGWIN__ && !defined __i386__
+/* The 'environ' variable is defined in a DLL. Therefore its declaration needs
+ the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
+ This leads to a link error on 64-bit Cygwin when the option
+ -Wl,--disable-auto-import is in use. */
+_GL_EXTERN_C __declspec(dllimport) char **environ;
+# endif
+# if !@HAVE_DECL_ENVIRON@
+/* Set of environment variables and values. An array of strings of the form
+ "VARIABLE=VALUE", terminated with a NULL. */
+# if defined __APPLE__ && defined __MACH__
+# include <TargetConditionals.h>
+# if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
+# define _GL_USE_CRT_EXTERNS
+# endif
+# endif
+# ifdef _GL_USE_CRT_EXTERNS
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron ())
+# else
+# ifdef __cplusplus
+extern "C" {
+# endif
+extern char **environ;
+# ifdef __cplusplus
+}
+# endif
+# endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# if HAVE_RAW_DECL_ENVIRON
+_GL_UNISTD_INLINE char ***
+_GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
+ "use gnulib module environ for portability")
+rpl_environ (void)
+{
+ return &environ;
+}
+# undef environ
+# define environ (*rpl_environ ())
+# endif
+#endif
+
+
+#if @GNULIB_EUIDACCESS@
+/* Like access(), except that it uses the effective user id and group id of
+ the current process. */
+# if !@HAVE_EUIDACCESS@
+_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
+_GL_CXXALIASWARN (euidaccess);
+# if defined GNULIB_POSIXCHECK
+/* Like access(), this function is a security risk. */
+_GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
+ "use the gnulib module faccessat instead");
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef euidaccess
+# if HAVE_RAW_DECL_EUIDACCESS
+_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
+ "use gnulib module euidaccess for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXECL@
+# if @REPLACE_EXECL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execl
+# define execl rpl_execl
+# endif
+_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
+#elif defined GNULIB_POSIXCHECK
+# undef execl
+# if HAVE_RAW_DECL_EXECL
+_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - "
+ "use gnulib module execl for portability");
+# endif
+#elif @GNULIB_MDA_EXECL@
+/* On native Windows, map 'execl' to '_execl', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execl always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execl
+# define execl _execl
+# endif
+_GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
+#endif
+
+#if @GNULIB_EXECLE@
+# if @REPLACE_EXECLE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execle
+# define execle rpl_execle
+# endif
+_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
+#elif defined GNULIB_POSIXCHECK
+# undef execle
+# if HAVE_RAW_DECL_EXECLE
+_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - "
+ "use gnulib module execle for portability");
+# endif
+#elif @GNULIB_MDA_EXECLE@
+/* On native Windows, map 'execle' to '_execle', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execle always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execle
+# define execle _execle
+# endif
+_GL_CXXALIAS_MDA (execle, intptr_t,
+ (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
+#endif
+
+#if @GNULIB_EXECLP@
+# if @REPLACE_EXECLP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execlp
+# define execlp rpl_execlp
+# endif
+_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
+#elif defined GNULIB_POSIXCHECK
+# undef execlp
+# if HAVE_RAW_DECL_EXECLP
+_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - "
+ "use gnulib module execlp for portability");
+# endif
+#elif @GNULIB_MDA_EXECLP@
+/* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execlp always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execlp
+# define execlp _execlp
+# endif
+_GL_CXXALIAS_MDA (execlp, intptr_t,
+ (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
+#endif
+
+
+#if @GNULIB_EXECV@
+# if @REPLACE_EXECV@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execv
+# define execv rpl_execv
+# endif
+_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
+#elif defined GNULIB_POSIXCHECK
+# undef execv
+# if HAVE_RAW_DECL_EXECV
+_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - "
+ "use gnulib module execv for portability");
+# endif
+#elif @GNULIB_MDA_EXECV@
+/* On native Windows, map 'execv' to '_execv', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execv always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execv
+# define execv _execv
+# endif
+_GL_CXXALIAS_MDA_CAST (execv, intptr_t,
+ (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
+#endif
+
+#if @GNULIB_EXECVE@
+# if @REPLACE_EXECVE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execve
+# define execve rpl_execve
+# endif
+_GL_FUNCDECL_RPL (execve, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execve, int,
+ (const char *program, char * const *argv, char * const *env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execve);
+#elif defined GNULIB_POSIXCHECK
+# undef execve
+# if HAVE_RAW_DECL_EXECVE
+_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - "
+ "use gnulib module execve for portability");
+# endif
+#elif @GNULIB_MDA_EXECVE@
+/* On native Windows, map 'execve' to '_execve', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execve always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execve
+# define execve _execve
+# endif
+_GL_CXXALIAS_MDA_CAST (execve, intptr_t,
+ (const char *program, char * const *argv,
+ char * const *env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execve);
+#endif
+
+#if @GNULIB_EXECVP@
+# if @REPLACE_EXECVP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvp
+# define execvp rpl_execvp
+# endif
+_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
+#elif defined GNULIB_POSIXCHECK
+# undef execvp
+# if HAVE_RAW_DECL_EXECVP
+_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - "
+ "use gnulib module execvp for portability");
+# endif
+#elif @GNULIB_MDA_EXECVP@
+/* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execvp always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvp
+# define execvp _execvp
+# endif
+_GL_CXXALIAS_MDA_CAST (execvp, intptr_t,
+ (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
+#endif
+
+#if @GNULIB_EXECVPE@
+# if @REPLACE_EXECVPE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvpe
+# define execvpe rpl_execvpe
+# endif
+_GL_FUNCDECL_RPL (execvpe, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvpe, int,
+ (const char *program, char * const *argv, char * const *env));
+# else
+# if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execvpe);
+#elif defined GNULIB_POSIXCHECK
+# undef execvpe
+# if HAVE_RAW_DECL_EXECVPE
+_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - "
+ "use gnulib module execvpe for portability");
+# endif
+#elif @GNULIB_MDA_EXECVPE@
+/* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have
+ it. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef execvpe
+# define execvpe _execvpe
+# endif
+_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
+ (const char *program, char * const *argv,
+ char * const *env));
+# elif @HAVE_EXECVPE@
+# if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (execvpe, int,
+ (const char *program, char * const *argv, char * const *env));
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@
+_GL_CXXALIASWARN (execvpe);
+# endif
+#endif
+
+
+#if @GNULIB_FACCESSAT@
+# if @REPLACE_FACCESSAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef faccessat
+# define faccessat rpl_faccessat
+# endif
+_GL_FUNCDECL_RPL (faccessat, int,
+ (int fd, char const *name, int mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (faccessat, int,
+ (int fd, char const *name, int mode, int flag));
+# else
+# if !@HAVE_FACCESSAT@
+_GL_FUNCDECL_SYS (faccessat, int,
+ (int fd, char const *file, int mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (faccessat, int,
+ (int fd, char const *file, int mode, int flag));
+# endif
+_GL_CXXALIASWARN (faccessat);
+#elif defined GNULIB_POSIXCHECK
+# undef faccessat
+# if HAVE_RAW_DECL_FACCESSAT
+_GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
+ "use gnulib module faccessat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FCHDIR@
+/* Change the process' current working directory to the directory on which
+ the given file descriptor is open.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>. */
+# if ! @HAVE_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
+
+/* Gnulib internal hooks needed to maintain the fchdir metadata. */
+_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
+ _GL_ARG_NONNULL ((2));
+_GL_EXTERN_C void _gl_unregister_fd (int fd);
+_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
+_GL_EXTERN_C const char *_gl_directory_name (int fd);
+
+# else
+# if !@HAVE_DECL_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
+# endif
+# endif
+_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
+_GL_CXXALIASWARN (fchdir);
+#elif defined GNULIB_POSIXCHECK
+# undef fchdir
+# if HAVE_RAW_DECL_FCHDIR
+_GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
+ "use gnulib module fchdir for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FCHOWNAT@
+# if @REPLACE_FCHOWNAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fchownat
+# define fchownat rpl_fchownat
+# endif
+_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag));
+# else
+# if !@HAVE_FCHOWNAT@
+_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
+ uid_t owner, gid_t group, int flag));
+# endif
+_GL_CXXALIASWARN (fchownat);
+#elif defined GNULIB_POSIXCHECK
+# undef fchownat
+# if HAVE_RAW_DECL_FCHOWNAT
+_GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
+ "use gnulib module fchownat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FDATASYNC@
+/* Synchronize changes to a file.
+ Return 0 if successful, otherwise -1 and errno set.
+ See POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>. */
+# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
+_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
+_GL_CXXALIASWARN (fdatasync);
+#elif defined GNULIB_POSIXCHECK
+# undef fdatasync
+# if HAVE_RAW_DECL_FDATASYNC
+_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
+ "use gnulib module fdatasync for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSYNC@
+/* Synchronize changes, including metadata, to a file.
+ Return 0 if successful, otherwise -1 and errno set.
+ See POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
+# if !@HAVE_FSYNC@
+_GL_FUNCDECL_SYS (fsync, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fsync, int, (int fd));
+_GL_CXXALIASWARN (fsync);
+#elif defined GNULIB_POSIXCHECK
+# undef fsync
+# if HAVE_RAW_DECL_FSYNC
+_GL_WARN_ON_USE (fsync, "fsync is unportable - "
+ "use gnulib module fsync for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FTRUNCATE@
+/* Change the size of the file to which FD is opened to become equal to LENGTH.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */
+# if @REPLACE_FTRUNCATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ftruncate
+# define ftruncate rpl_ftruncate
+# endif
+_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
+# else
+# if !@HAVE_FTRUNCATE@
+_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
+# endif
+_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
+# endif
+_GL_CXXALIASWARN (ftruncate);
+#elif defined GNULIB_POSIXCHECK
+# undef ftruncate
+# if HAVE_RAW_DECL_FTRUNCATE
+_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
+ "use gnulib module ftruncate for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETCWD@
+/* Get the name of the current working directory, and put it in SIZE bytes
+ of BUF.
+ Return BUF if successful, or NULL if the directory couldn't be determined
+ or SIZE was too small.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
+ Additionally, the gnulib module 'getcwd' guarantees the following GNU
+ extension: If BUF is NULL, an array is allocated with 'malloc'; the array
+ is SIZE bytes long, unless SIZE == 0, in which case it is as big as
+ necessary. */
+# if @REPLACE_GETCWD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getcwd rpl_getcwd
+# endif
+_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
+_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getcwd
+# define getcwd _getcwd
+# endif
+_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
+# else
+/* Need to cast, because on mingw, the second parameter is
+ int size. */
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
+# endif
+_GL_CXXALIASWARN (getcwd);
+#elif defined GNULIB_POSIXCHECK
+# undef getcwd
+# if HAVE_RAW_DECL_GETCWD
+_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
+ "use gnulib module getcwd for portability");
+# endif
+#elif @GNULIB_MDA_GETCWD@
+/* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::getcwd always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getcwd
+# define getcwd _getcwd
+# endif
+/* Need to cast, because on mingw, the second parameter is either
+ 'int size' or 'size_t size'. */
+_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size));
+# else
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
+# endif
+_GL_CXXALIASWARN (getcwd);
+#endif
+
+
+#if @GNULIB_GETDOMAINNAME@
+/* Return the NIS domain name of the machine.
+ WARNING! The NIS domain name is unrelated to the fully qualified host name
+ of the machine. It is also unrelated to email addresses.
+ WARNING! The NIS domain name is usually the empty string or "(none)" when
+ not using NIS.
+
+ Put up to LEN bytes of the NIS domain name into NAME.
+ Null terminate it if the name is shorter than LEN.
+ If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
+ Return 0 if successful, otherwise set errno and return -1. */
+# if @REPLACE_GETDOMAINNAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getdomainname
+# define getdomainname rpl_getdomainname
+# endif
+_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
+# else
+# if !@HAVE_DECL_GETDOMAINNAME@
+_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (getdomainname);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getdomainname
+# if HAVE_RAW_DECL_GETDOMAINNAME
+_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
+ "use gnulib module getdomainname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETDTABLESIZE@
+/* Return the maximum number of file descriptors in the current process.
+ In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
+# if @REPLACE_GETDTABLESIZE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getdtablesize
+# define getdtablesize rpl_getdtablesize
+# endif
+_GL_FUNCDECL_RPL (getdtablesize, int, (void));
+_GL_CXXALIAS_RPL (getdtablesize, int, (void));
+# else
+# if !@HAVE_GETDTABLESIZE@
+_GL_FUNCDECL_SYS (getdtablesize, int, (void));
+# endif
+/* Need to cast, because on AIX, the parameter list is
+ (...). */
+_GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void));
+# endif
+_GL_CXXALIASWARN (getdtablesize);
+#elif defined GNULIB_POSIXCHECK
+# undef getdtablesize
+# if HAVE_RAW_DECL_GETDTABLESIZE
+_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
+ "use gnulib module getdtablesize for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETENTROPY@
+/* Fill a buffer with random bytes. */
+# if !@HAVE_GETENTROPY@
+_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
+# endif
+_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_CXXALIASWARN (getentropy);
+#elif defined GNULIB_POSIXCHECK
+# undef getentropy
+# if HAVE_RAW_DECL_GETENTROPY
+_GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
+ "use gnulib module getentropy for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETGROUPS@
+/* Return the supplemental groups that the current process belongs to.
+ It is unspecified whether the effective group id is in the list.
+ If N is 0, return the group count; otherwise, N describes how many
+ entries are available in GROUPS. Return -1 and set errno if N is
+ not 0 and not large enough. Fails with ENOSYS on some systems. */
+# if @REPLACE_GETGROUPS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getgroups
+# define getgroups rpl_getgroups
+# endif
+_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
+_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
+# else
+# if !@HAVE_GETGROUPS@
+_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
+# endif
+_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
+# endif
+_GL_CXXALIASWARN (getgroups);
+#elif defined GNULIB_POSIXCHECK
+# undef getgroups
+# if HAVE_RAW_DECL_GETGROUPS
+_GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
+ "use gnulib module getgroups for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETHOSTNAME@
+/* Return the standard host name of the machine.
+ WARNING! The host name may or may not be fully qualified.
+
+ Put up to LEN bytes of the host name into NAME.
+ Null terminate it if the name is shorter than LEN.
+ If the host name is longer than LEN, set errno = EINVAL and return -1.
+ Return 0 if successful, otherwise set errno and return -1. */
+# if @UNISTD_H_HAVE_WINSOCK2_H@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef gethostname
+# define gethostname rpl_gethostname
+# endif
+_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
+# else
+# if !@HAVE_GETHOSTNAME@
+_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
+ parameter is
+ int len. */
+_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
+# endif
+_GL_CXXALIASWARN (gethostname);
+#elif @UNISTD_H_HAVE_WINSOCK2_H@
+# undef gethostname
+# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
+#elif defined GNULIB_POSIXCHECK
+# undef gethostname
+# if HAVE_RAW_DECL_GETHOSTNAME
+_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
+ "use gnulib module gethostname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETLOGIN@
+/* Returns the user's login name, or NULL if it cannot be found. Upon error,
+ returns NULL with errno set.
+
+ See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
+
+ Most programs don't need to use this function, because the information is
+ available through environment variables:
+ ${LOGNAME-$USER} on Unix platforms,
+ $USERNAME on native Windows platforms.
+ */
+# if !@HAVE_DECL_GETLOGIN@
+_GL_FUNCDECL_SYS (getlogin, char *, (void));
+# endif
+_GL_CXXALIAS_SYS (getlogin, char *, (void));
+_GL_CXXALIASWARN (getlogin);
+#elif defined GNULIB_POSIXCHECK
+# undef getlogin
+# if HAVE_RAW_DECL_GETLOGIN
+_GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
+ "use gnulib module getlogin for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETLOGIN_R@
+/* Copies the user's login name to NAME.
+ The array pointed to by NAME has room for SIZE bytes.
+
+ Returns 0 if successful. Upon error, an error number is returned, or -1 in
+ the case that the login name cannot be found but no specific error is
+ provided (this case is hopefully rare but is left open by the POSIX spec).
+
+ See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
+
+ Most programs don't need to use this function, because the information is
+ available through environment variables:
+ ${LOGNAME-$USER} on Unix platforms,
+ $USERNAME on native Windows platforms.
+ */
+# if @REPLACE_GETLOGIN_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getlogin_r rpl_getlogin_r
+# endif
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
+# else
+# if !@HAVE_DECL_GETLOGIN_R@
+_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Solaris 10 systems, the second argument is
+ int size. */
+_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
+# endif
+_GL_CXXALIASWARN (getlogin_r);
+#elif defined GNULIB_POSIXCHECK
+# undef getlogin_r
+# if HAVE_RAW_DECL_GETLOGIN_R
+_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
+ "use gnulib module getlogin_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETPAGESIZE@
+# if @REPLACE_GETPAGESIZE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getpagesize rpl_getpagesize
+# endif
+_GL_FUNCDECL_RPL (getpagesize, int, (void));
+_GL_CXXALIAS_RPL (getpagesize, int, (void));
+# else
+/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
+ the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */
+# if defined __hpux
+_GL_FUNCDECL_SYS (getpagesize, int, (void));
+# endif
+# if !@HAVE_GETPAGESIZE@
+# if !defined getpagesize
+/* This is for POSIX systems. */
+# if !defined _gl_getpagesize && defined _SC_PAGESIZE
+# if ! (defined __VMS && __VMS_VER < 70000000)
+# define _gl_getpagesize() sysconf (_SC_PAGESIZE)
+# endif
+# endif
+/* This is for older VMS. */
+# if !defined _gl_getpagesize && defined __VMS
+# ifdef __ALPHA
+# define _gl_getpagesize() 8192
+# else
+# define _gl_getpagesize() 512
+# endif
+# endif
+/* This is for BeOS. */
+# if !defined _gl_getpagesize && @HAVE_OS_H@
+# include <OS.h>
+# if defined B_PAGE_SIZE
+# define _gl_getpagesize() B_PAGE_SIZE
+# endif
+# endif
+/* This is for AmigaOS4.0. */
+# if !defined _gl_getpagesize && defined __amigaos4__
+# define _gl_getpagesize() 2048
+# endif
+/* This is for older Unix systems. */
+# if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define _gl_getpagesize() EXEC_PAGESIZE
+# else
+# ifdef NBPG
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif
+# define _gl_getpagesize() (NBPG * CLSIZE)
+# else
+# ifdef NBPC
+# define _gl_getpagesize() NBPC
+# endif
+# endif
+# endif
+# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define getpagesize() _gl_getpagesize ()
+# else
+# if !GNULIB_defined_getpagesize_function
+_GL_UNISTD_INLINE int
+getpagesize ()
+{
+ return _gl_getpagesize ();
+}
+# define GNULIB_defined_getpagesize_function 1
+# endif
+# endif
+# endif
+# endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t. */
+_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
+# endif
+# if @HAVE_DECL_GETPAGESIZE@
+_GL_CXXALIASWARN (getpagesize);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getpagesize
+# if HAVE_RAW_DECL_GETPAGESIZE
+_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
+ "use gnulib module getpagesize for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETPASS@
+/* Function getpass() from module 'getpass':
+ Read a password from /dev/tty or stdin.
+ Function getpass() from module 'getpass-gnu':
+ Read a password of arbitrary length from /dev/tty or stdin. */
+# if (@GNULIB_GETPASS@ && @REPLACE_GETPASS@) \
+ || (@GNULIB_GETPASS_GNU@ && @REPLACE_GETPASS_FOR_GETPASS_GNU@)
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getpass
+# define getpass rpl_getpass
+# endif
+_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
+# else
+# if !@HAVE_GETPASS@
+_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
+# endif
+_GL_CXXALIASWARN (getpass);
+#elif defined GNULIB_POSIXCHECK
+# undef getpass
+# if HAVE_RAW_DECL_GETPASS
+_GL_WARN_ON_USE (getpass, "getpass is unportable - "
+ "use gnulib module getpass or getpass-gnu for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_GETPID@
+/* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::getpid always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getpid
+# define getpid _getpid
+# endif
+_GL_CXXALIAS_MDA (getpid, int, (void));
+# else
+_GL_CXXALIAS_SYS (getpid, pid_t, (void));
+# endif
+_GL_CXXALIASWARN (getpid);
+#endif
+
+
+#if @GNULIB_GETUSERSHELL@
+/* Return the next valid login shell on the system, or NULL when the end of
+ the list has been reached. */
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (getusershell, char *, (void));
+# endif
+_GL_CXXALIAS_SYS (getusershell, char *, (void));
+_GL_CXXALIASWARN (getusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef getusershell
+# if HAVE_RAW_DECL_GETUSERSHELL
+_GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
+ "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
+/* Rewind to pointer that is advanced at each getusershell() call. */
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (setusershell, void, (void));
+# endif
+_GL_CXXALIAS_SYS (setusershell, void, (void));
+_GL_CXXALIASWARN (setusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef setusershell
+# if HAVE_RAW_DECL_SETUSERSHELL
+_GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
+ "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
+/* Free the pointer that is advanced at each getusershell() call and
+ associated resources. */
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (endusershell, void, (void));
+# endif
+_GL_CXXALIAS_SYS (endusershell, void, (void));
+_GL_CXXALIASWARN (endusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef endusershell
+# if HAVE_RAW_DECL_ENDUSERSHELL
+_GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
+ "use gnulib module getusershell for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GROUP_MEMBER@
+/* Determine whether group id is in calling user's group list. */
+# if !@HAVE_GROUP_MEMBER@
+_GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
+# endif
+_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
+_GL_CXXALIASWARN (group_member);
+#elif defined GNULIB_POSIXCHECK
+# undef group_member
+# if HAVE_RAW_DECL_GROUP_MEMBER
+_GL_WARN_ON_USE (group_member, "group_member is unportable - "
+ "use gnulib module group-member for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ISATTY@
+# if @REPLACE_ISATTY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef isatty
+# define isatty rpl_isatty
+# endif
+# define GNULIB_defined_isatty 1
+_GL_FUNCDECL_RPL (isatty, int, (int fd));
+_GL_CXXALIAS_RPL (isatty, int, (int fd));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef isatty
+# define isatty _isatty
+# endif
+_GL_CXXALIAS_MDA (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
+#elif defined GNULIB_POSIXCHECK
+# undef isatty
+# if HAVE_RAW_DECL_ISATTY
+_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
+ "use gnulib module isatty for portability");
+# endif
+#elif @GNULIB_MDA_ISATTY@
+/* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::isatty always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef isatty
+# define isatty _isatty
+# endif
+_GL_CXXALIAS_MDA (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
+#endif
+
+
+#if @GNULIB_LCHOWN@
+/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
+ to GID (if GID is not -1). Do not follow symbolic links.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>. */
+# if @REPLACE_LCHOWN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lchown
+# define lchown rpl_lchown
+# endif
+_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
+# else
+# if !@HAVE_LCHOWN@
+_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
+# endif
+_GL_CXXALIASWARN (lchown);
+#elif defined GNULIB_POSIXCHECK
+# undef lchown
+# if HAVE_RAW_DECL_LCHOWN
+_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
+ "use gnulib module lchown for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LINK@
+/* Create a new hard link for an existing file.
+ Return 0 if successful, otherwise -1 and errno set.
+ See POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>. */
+# if @REPLACE_LINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define link rpl_link
+# endif
+_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
+# else
+# if !@HAVE_LINK@
+_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
+# endif
+_GL_CXXALIASWARN (link);
+#elif defined GNULIB_POSIXCHECK
+# undef link
+# if HAVE_RAW_DECL_LINK
+_GL_WARN_ON_USE (link, "link is unportable - "
+ "use gnulib module link for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LINKAT@
+/* Create a new hard link for an existing file, relative to two
+ directories. FLAG controls whether symlinks are followed.
+ Return 0 if successful, otherwise -1 and errno set. */
+# if @REPLACE_LINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef linkat
+# define linkat rpl_linkat
+# endif
+_GL_FUNCDECL_RPL (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag)
+ _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag));
+# else
+# if !@HAVE_LINKAT@
+_GL_FUNCDECL_SYS (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag)
+ _GL_ARG_NONNULL ((2, 4)));
+# endif
+_GL_CXXALIAS_SYS (linkat, int,
+ (int fd1, const char *path1, int fd2, const char *path2,
+ int flag));
+# endif
+_GL_CXXALIASWARN (linkat);
+#elif defined GNULIB_POSIXCHECK
+# undef linkat
+# if HAVE_RAW_DECL_LINKAT
+_GL_WARN_ON_USE (linkat, "linkat is unportable - "
+ "use gnulib module linkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LSEEK@
+/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
+ Return the new offset if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>. */
+# if @REPLACE_LSEEK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define lseek rpl_lseek
+# endif
+_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lseek
+# define lseek _lseek
+# endif
+_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (lseek);
+#elif defined GNULIB_POSIXCHECK
+# undef lseek
+# if HAVE_RAW_DECL_LSEEK
+_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
+ "systems - use gnulib module lseek for portability");
+# endif
+#elif @GNULIB_MDA_LSEEK@
+/* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::lseek always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef lseek
+# define lseek _lseek
+# endif
+_GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (lseek);
+#endif
+
+
+#if @GNULIB_PIPE@
+/* Create a pipe, defaulting to O_BINARY mode.
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure. */
+# if !@HAVE_PIPE@
+_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
+_GL_CXXALIASWARN (pipe);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe
+# if HAVE_RAW_DECL_PIPE
+_GL_WARN_ON_USE (pipe, "pipe is unportable - "
+ "use gnulib module pipe-posix for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PIPE2@
+/* Create a pipe, applying the given flags when opening the read-end of the
+ pipe and the write-end of the pipe.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure.
+ See also the Linux man page at
+ <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
+# if @HAVE_PIPE2@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define pipe2 rpl_pipe2
+# endif
+_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
+# else
+_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
+# endif
+_GL_CXXALIASWARN (pipe2);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe2
+# if HAVE_RAW_DECL_PIPE2
+_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
+ "use gnulib module pipe2 for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PREAD@
+/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
+ Return the number of bytes placed into BUF if successful, otherwise
+ set errno and return -1. 0 indicates EOF.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>. */
+# if @REPLACE_PREAD@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pread
+# define pread rpl_pread
+# endif
+_GL_FUNCDECL_RPL (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset));
+# else
+# if !@HAVE_PREAD@
+_GL_FUNCDECL_SYS (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (pread, ssize_t,
+ (int fd, void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pread);
+#elif defined GNULIB_POSIXCHECK
+# undef pread
+# if HAVE_RAW_DECL_PREAD
+_GL_WARN_ON_USE (pread, "pread is unportable - "
+ "use gnulib module pread for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+ Return the number of bytes written if successful, otherwise
+ set errno and return -1. 0 indicates nothing written. See the
+ POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>. */
+# if @REPLACE_PWRITE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef pwrite
+# define pwrite rpl_pwrite
+# endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+# if !@HAVE_PWRITE@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+ "use gnulib module pwrite for portability");
+# endif
+#endif
+
+
+#if @GNULIB_READ@
+/* Read up to COUNT bytes from file descriptor FD into the buffer starting
+ at BUF. See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>. */
+# if @REPLACE_READ@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef read
+# define read rpl_read
+# endif
+_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef read
+# define read _read
+# endif
+_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
+# else
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (read);
+#elif @GNULIB_MDA_READ@
+/* On native Windows, map 'read' to '_read', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::read always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef read
+# define read _read
+# endif
+# ifdef __MINGW32__
+_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
+# else
+_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
+# endif
+# else
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (read);
+#endif
+
+
+#if @GNULIB_READLINK@
+/* Read the contents of the symbolic link FILE and place the first BUFSIZE
+ bytes of it into BUF. Return the number of bytes placed into BUF if
+ successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>. */
+# if @REPLACE_READLINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define readlink rpl_readlink
+# endif
+_GL_FUNCDECL_RPL (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize));
+# else
+# if !@HAVE_READLINK@
+_GL_FUNCDECL_SYS (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (readlink, ssize_t,
+ (const char *restrict file,
+ char *restrict buf, size_t bufsize));
+# endif
+_GL_CXXALIASWARN (readlink);
+#elif defined GNULIB_POSIXCHECK
+# undef readlink
+# if HAVE_RAW_DECL_READLINK
+_GL_WARN_ON_USE (readlink, "readlink is unportable - "
+ "use gnulib module readlink for portability");
+# endif
+#endif
+
+
+#if @GNULIB_READLINKAT@
+# if @REPLACE_READLINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define readlinkat rpl_readlinkat
+# endif
+_GL_FUNCDECL_RPL (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len)
+ _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len));
+# else
+# if !@HAVE_READLINKAT@
+_GL_FUNCDECL_SYS (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len)
+ _GL_ARG_NONNULL ((2, 3)));
+# endif
+_GL_CXXALIAS_SYS (readlinkat, ssize_t,
+ (int fd, char const *restrict file,
+ char *restrict buf, size_t len));
+# endif
+_GL_CXXALIASWARN (readlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef readlinkat
+# if HAVE_RAW_DECL_READLINKAT
+_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
+ "use gnulib module readlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RMDIR@
+/* Remove the directory DIR. */
+# if @REPLACE_RMDIR@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define rmdir rpl_rmdir
+# endif
+_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rmdir
+# define rmdir _rmdir
+# endif
+_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
+# endif
+_GL_CXXALIASWARN (rmdir);
+#elif defined GNULIB_POSIXCHECK
+# undef rmdir
+# if HAVE_RAW_DECL_RMDIR
+_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
+ "use gnulib module rmdir for portability");
+# endif
+#elif @GNULIB_MDA_RMDIR@
+/* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::rmdir always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef rmdir
+# define rmdir _rmdir
+# endif
+_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
+# endif
+_GL_CXXALIASWARN (rmdir);
+#endif
+
+
+#if @GNULIB_SETHOSTNAME@
+/* Set the host name of the machine.
+ The host name may or may not be fully qualified.
+
+ Put LEN bytes of NAME into the host name.
+ Return 0 if successful, otherwise, set errno and return -1.
+
+ Platforms with no ability to set the hostname return -1 and set
+ errno = ENOSYS. */
+# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
+_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
+ _GL_ARG_NONNULL ((1)));
+# endif
+/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
+ and FreeBSD 6.4 the second parameter is int. On Solaris 11
+ 2011-10, the first parameter is not const. */
+_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
+_GL_CXXALIASWARN (sethostname);
+#elif defined GNULIB_POSIXCHECK
+# undef sethostname
+# if HAVE_RAW_DECL_SETHOSTNAME
+_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
+ "use gnulib module sethostname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SLEEP@
+/* Pause the execution of the current thread for N seconds.
+ Returns the number of seconds left to sleep.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>. */
+# if @REPLACE_SLEEP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef sleep
+# define sleep rpl_sleep
+# endif
+_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
+_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
+# else
+# if !@HAVE_SLEEP@
+_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
+# endif
+_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
+# endif
+_GL_CXXALIASWARN (sleep);
+#elif defined GNULIB_POSIXCHECK
+# undef sleep
+# if HAVE_RAW_DECL_SLEEP
+_GL_WARN_ON_USE (sleep, "sleep is unportable - "
+ "use gnulib module sleep for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_SWAB@
+/* On native Windows, map 'swab' to '_swab', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::swab always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef swab
+# define swab _swab
+# endif
+/* Need to cast, because in old mingw the arguments are
+ (const char *from, char *to, size_t n). */
+_GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n));
+# else
+# if defined __hpux /* HP-UX */
+_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n));
+# elif defined __sun && (defined __SunOS_5_10 || defined __XOPEN_OR_POSIX) && !defined _XPG4 /* Solaris */
+_GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n));
+# else
+_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
+# endif
+# endif
+_GL_CXXALIASWARN (swab);
+#endif
+
+
+#if @GNULIB_SYMLINK@
+# if @REPLACE_SYMLINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef symlink
+# define symlink rpl_symlink
+# endif
+_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
+ _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
+# else
+# if !@HAVE_SYMLINK@
+_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
+ _GL_ARG_NONNULL ((1, 2)));
+# endif
+_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
+# endif
+_GL_CXXALIASWARN (symlink);
+#elif defined GNULIB_POSIXCHECK
+# undef symlink
+# if HAVE_RAW_DECL_SYMLINK
+_GL_WARN_ON_USE (symlink, "symlink is not portable - "
+ "use gnulib module symlink for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SYMLINKAT@
+# if @REPLACE_SYMLINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef symlinkat
+# define symlinkat rpl_symlinkat
+# endif
+_GL_FUNCDECL_RPL (symlinkat, int,
+ (char const *contents, int fd, char const *file)
+ _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (symlinkat, int,
+ (char const *contents, int fd, char const *file));
+# else
+# if !@HAVE_SYMLINKAT@
+_GL_FUNCDECL_SYS (symlinkat, int,
+ (char const *contents, int fd, char const *file)
+ _GL_ARG_NONNULL ((1, 3)));
+# endif
+_GL_CXXALIAS_SYS (symlinkat, int,
+ (char const *contents, int fd, char const *file));
+# endif
+_GL_CXXALIASWARN (symlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef symlinkat
+# if HAVE_RAW_DECL_SYMLINKAT
+_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
+ "use gnulib module symlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TRUNCATE@
+/* Change the size of the file designated by FILENAME to become equal to LENGTH.
+ Return 0 if successful, otherwise -1 and errno set.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>. */
+# if @REPLACE_TRUNCATE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef truncate
+# define truncate rpl_truncate
+# endif
+_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
+# else
+# if !@HAVE_DECL_TRUNCATE@
+_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
+ _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
+# endif
+_GL_CXXALIASWARN (truncate);
+#elif defined GNULIB_POSIXCHECK
+# undef truncate
+# if HAVE_RAW_DECL_TRUNCATE
+_GL_WARN_ON_USE (truncate, "truncate is unportable - "
+ "use gnulib module truncate for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TTYNAME_R@
+/* Store at most BUFLEN characters of the pathname of the terminal FD is
+ open on in BUF. Return 0 on success, otherwise an error number. */
+# if @REPLACE_TTYNAME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ttyname_r
+# define ttyname_r rpl_ttyname_r
+# endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+ (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+ (int fd, char *buf, size_t buflen));
+# else
+# if !@HAVE_DECL_TTYNAME_R@
+_GL_FUNCDECL_SYS (ttyname_r, int,
+ (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (ttyname_r, int,
+ (int fd, char *buf, size_t buflen));
+# endif
+_GL_CXXALIASWARN (ttyname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ttyname_r
+# if HAVE_RAW_DECL_TTYNAME_R
+_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
+ "use gnulib module ttyname_r for portability");
+# endif
+#endif
+
+
+#if @GNULIB_UNLINK@
+# if @REPLACE_UNLINK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlink
+# define unlink rpl_unlink
+# endif
+_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unlink, int, (char const *file));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlink
+# define unlink _unlink
+# endif
+_GL_CXXALIAS_MDA (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
+# endif
+_GL_CXXALIASWARN (unlink);
+#elif defined GNULIB_POSIXCHECK
+# undef unlink
+# if HAVE_RAW_DECL_UNLINK
+_GL_WARN_ON_USE (unlink, "unlink is not portable - "
+ "use gnulib module unlink for portability");
+# endif
+#elif @GNULIB_MDA_UNLINK@
+/* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::unlink always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlink
+# define unlink _unlink
+# endif
+_GL_CXXALIAS_MDA (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
+# endif
+_GL_CXXALIASWARN (unlink);
+#endif
+
+
+#if @GNULIB_UNLINKAT@
+# if @REPLACE_UNLINKAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef unlinkat
+# define unlinkat rpl_unlinkat
+# endif
+_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
+# else
+# if !@HAVE_UNLINKAT@
+_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
+# endif
+_GL_CXXALIASWARN (unlinkat);
+#elif defined GNULIB_POSIXCHECK
+# undef unlinkat
+# if HAVE_RAW_DECL_UNLINKAT
+_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
+ "use gnulib module unlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_USLEEP@
+/* Pause the execution of the current thread for N microseconds.
+ Returns 0 on completion, or -1 on range error.
+ See the POSIX:2001 specification
+ <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>. */
+# if @REPLACE_USLEEP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef usleep
+# define usleep rpl_usleep
+# endif
+_GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
+_GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
+# else
+# if !@HAVE_USLEEP@
+_GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
+# endif
+/* Need to cast, because on Haiku, the first parameter is
+ unsigned int n. */
+_GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n));
+# endif
+_GL_CXXALIASWARN (usleep);
+#elif defined GNULIB_POSIXCHECK
+# undef usleep
+# if HAVE_RAW_DECL_USLEEP
+_GL_WARN_ON_USE (usleep, "usleep is unportable - "
+ "use gnulib module usleep for portability");
+# endif
+#endif
+
+
+#if @GNULIB_WRITE@
+/* Write up to COUNT bytes starting at BUF to file descriptor FD.
+ See the POSIX:2008 specification
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>. */
+# if @REPLACE_WRITE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef write
+# define write rpl_write
+# endif
+_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
+# elif defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef write
+# define write _write
+# endif
+_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
+# else
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
+#elif @GNULIB_MDA_WRITE@
+/* On native Windows, map 'write' to '_write', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::write always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef write
+# define write _write
+# endif
+# ifdef __MINGW32__
+_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
+# else
+_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count));
+# endif
+# else
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
+#endif /* _GL_INCLUDING_UNISTD_H */
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
diff --git a/gl/unlocked-io.h b/gl/unlocked-io.h
new file mode 100644
index 0000000..fdef624
--- /dev/null
+++ b/gl/unlocked-io.h
@@ -0,0 +1,136 @@
+/* Prefer faster, non-thread-safe stdio functions if available.
+
+ Copyright (C) 2001-2004, 2009-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Jim Meyering. */
+
+#ifndef UNLOCKED_IO_H
+# define UNLOCKED_IO_H 1
+
+/* These are wrappers for functions/macros from the GNU C library, and
+ from other C libraries supporting POSIX's optional thread-safe functions.
+
+ The standard I/O functions are thread-safe. These *_unlocked ones are
+ more efficient but not thread-safe. That they're not thread-safe is
+ fine since all of the applications in this package are single threaded.
+
+ Also, some code that is shared with the GNU C library may invoke
+ the *_unlocked functions directly. On hosts that lack those
+ functions, invoke the non-thread-safe versions instead. */
+
+# include <stdio.h>
+
+# if HAVE_DECL_CLEARERR_UNLOCKED || defined clearerr_unlocked
+# undef clearerr
+# define clearerr(x) clearerr_unlocked (x)
+# else
+# define clearerr_unlocked(x) clearerr (x)
+# endif
+
+# if HAVE_DECL_FEOF_UNLOCKED || defined feof_unlocked
+# undef feof
+# define feof(x) feof_unlocked (x)
+# else
+# define feof_unlocked(x) feof (x)
+# endif
+
+# if HAVE_DECL_FERROR_UNLOCKED || defined ferror_unlocked
+# undef ferror
+# define ferror(x) ferror_unlocked (x)
+# else
+# define ferror_unlocked(x) ferror (x)
+# endif
+
+# if HAVE_DECL_FFLUSH_UNLOCKED || defined fflush_unlocked
+# undef fflush
+# define fflush(x) fflush_unlocked (x)
+# else
+# define fflush_unlocked(x) fflush (x)
+# endif
+
+# if HAVE_DECL_FGETS_UNLOCKED || defined fgets_unlocked
+# undef fgets
+# define fgets(x,y,z) fgets_unlocked (x,y,z)
+# else
+# define fgets_unlocked(x,y,z) fgets (x,y,z)
+# endif
+
+# if HAVE_DECL_FPUTC_UNLOCKED || defined fputc_unlocked
+# undef fputc
+# define fputc(x,y) fputc_unlocked (x,y)
+# else
+# define fputc_unlocked(x,y) fputc (x,y)
+# endif
+
+# if HAVE_DECL_FPUTS_UNLOCKED || defined fputs_unlocked
+# undef fputs
+# define fputs(x,y) fputs_unlocked (x,y)
+# else
+# define fputs_unlocked(x,y) fputs (x,y)
+# endif
+
+# if HAVE_DECL_FREAD_UNLOCKED || defined fread_unlocked
+# undef fread
+# define fread(w,x,y,z) fread_unlocked (w,x,y,z)
+# else
+# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
+# endif
+
+# if HAVE_DECL_FWRITE_UNLOCKED || defined fwrite_unlocked
+# undef fwrite
+# define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
+# else
+# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
+# endif
+
+# if HAVE_DECL_GETC_UNLOCKED || defined get_unlocked
+# undef getc
+# define getc(x) getc_unlocked (x)
+# else
+# define getc_unlocked(x) getc (x)
+# endif
+
+# if HAVE_DECL_GETCHAR_UNLOCKED || defined getchar_unlocked
+# undef getchar
+# define getchar() getchar_unlocked ()
+# else
+# define getchar_unlocked() getchar ()
+# endif
+
+# if HAVE_DECL_PUTC_UNLOCKED || defined putc_unlocked
+# undef putc
+# define putc(x,y) putc_unlocked (x,y)
+# else
+# define putc_unlocked(x,y) putc (x,y)
+# endif
+
+# if HAVE_DECL_PUTCHAR_UNLOCKED || defined putchar_unlocked
+# undef putchar
+# define putchar(x) putchar_unlocked (x)
+# else
+# define putchar_unlocked(x) putchar (x)
+# endif
+
+# undef flockfile
+# define flockfile(x) ((void) 0)
+
+# undef ftrylockfile
+# define ftrylockfile(x) 0
+
+# undef funlockfile
+# define funlockfile(x) ((void) 0)
+
+#endif /* UNLOCKED_IO_H */
diff --git a/gl/unsetenv.c b/gl/unsetenv.c
new file mode 100644
index 0000000..e548949
--- /dev/null
+++ b/gl/unsetenv.c
@@ -0,0 +1,127 @@
+/* Copyright (C) 1992, 1995-2002, 2005-2023 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
+ optimizes away the name == NULL test below. */
+#define _GL_ARG_NONNULL(params)
+
+#include <config.h>
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+#if !_LIBC
+# define __set_errno(ev) ((errno) = (ev))
+#endif
+
+#include <string.h>
+#include <unistd.h>
+
+#if !_LIBC
+# define __environ environ
+#endif
+
+#if _LIBC
+/* This lock protects against simultaneous modifications of 'environ'. */
+# include <bits/libc-lock.h>
+__libc_lock_define_initialized (static, envlock)
+# define LOCK __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+/* In the GNU C library we must keep the namespace clean. */
+#ifdef _LIBC
+# define unsetenv __unsetenv
+#endif
+
+#if _LIBC || !HAVE_UNSETENV
+
+int
+unsetenv (const char *name)
+{
+ size_t len;
+ char **ep;
+
+ if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ len = strlen (name);
+
+ LOCK;
+
+ ep = __environ;
+ while (*ep != NULL)
+ if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+ {
+ /* Found it. Remove this pointer by moving later ones back. */
+ char **dp = ep;
+
+ do
+ dp[0] = dp[1];
+ while (*dp++);
+ /* Continue the loop in case NAME appears again. */
+ }
+ else
+ ++ep;
+
+ UNLOCK;
+
+ return 0;
+}
+
+#ifdef _LIBC
+# undef unsetenv
+weak_alias (__unsetenv, unsetenv)
+#endif
+
+#else /* HAVE_UNSETENV */
+
+# undef unsetenv
+# if !HAVE_DECL_UNSETENV
+# if VOID_UNSETENV
+extern void unsetenv (const char *);
+# else
+extern int unsetenv (const char *);
+# endif
+# endif
+
+/* Call the underlying unsetenv, in case there is hidden bookkeeping
+ that needs updating beyond just modifying environ. */
+int
+rpl_unsetenv (const char *name)
+{
+ int result = 0;
+ if (!name || !*name || strchr (name, '='))
+ {
+ errno = EINVAL;
+ return -1;
+ }
+ while (getenv (name))
+# if !VOID_UNSETENV
+ result =
+# endif
+ unsetenv (name);
+ return result;
+}
+
+#endif /* HAVE_UNSETENV */
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
new file mode 100644
index 0000000..277c39e
--- /dev/null
+++ b/gl/vasnprintf.c
@@ -0,0 +1,5741 @@
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 1999, 2002-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* This file can be parametrized with the following macros:
+ VASNPRINTF The name of the function being defined.
+ FCHAR_T The element type of the format string.
+ DCHAR_T The element type of the destination (result) string.
+ FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
+ in the format string are ASCII. MUST be set if
+ FCHAR_T and DCHAR_T are not the same type.
+ DIRECTIVE Structure denoting a format directive.
+ Depends on FCHAR_T.
+ DIRECTIVES Structure denoting the set of format directives of a
+ format string. Depends on FCHAR_T.
+ PRINTF_PARSE Function that parses a format string.
+ Depends on FCHAR_T.
+ DCHAR_CPY memcpy like function for DCHAR_T[] arrays.
+ DCHAR_SET memset like function for DCHAR_T[] arrays.
+ DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays.
+ SNPRINTF The system's snprintf (or similar) function.
+ This may be either snprintf or swprintf.
+ TCHAR_T The element type of the argument and result string
+ of the said SNPRINTF function. This may be either
+ char or wchar_t. The code exploits that
+ sizeof (TCHAR_T) | sizeof (DCHAR_T) and
+ alignof (TCHAR_T) <= alignof (DCHAR_T).
+ DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type.
+ DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[].
+ DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t.
+ DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t.
+ DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t.
+ ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
+ ENABLE_WCHAR_FALLBACK Set to 1 to avoid EILSEQ during conversion of wide
+ characters (wchar_t) and wide character strings
+ (wchar_t[]) to multibyte sequences. The fallback is the
+ hexadecimal escape syntax (\unnnn or \Unnnnnnnn) or,
+ if wchar_t is not Unicode encoded, \wnnnn or \Wnnnnnnnn.
+ */
+
+/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifndef VASNPRINTF
+# include <config.h>
+#endif
+
+/* As of GCC 11.2.1, gcc -Wanalyzer-too-complex reports that main's
+ use of CHECK macros expands to code that is too complicated for gcc
+ -fanalyzer. Suppress the resulting bogus warnings. */
+#if 10 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
+#endif
+
+#include <alloca.h>
+
+/* Specification. */
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+# include "vasnwprintf.h"
+# else
+# include "vasnprintf.h"
+# endif
+#endif
+
+#include <locale.h> /* localeconv() */
+#include <stdio.h> /* snprintf(), sprintf() */
+#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
+#include <string.h> /* memcpy(), strlen() */
+#include <wchar.h> /* mbstate_t, mbrtowc(), mbrlen(), wcrtomb() */
+#include <errno.h> /* errno */
+#include <limits.h> /* CHAR_BIT */
+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#if HAVE_NL_LANGINFO
+# include <langinfo.h>
+#endif
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+# include "wprintf-parse.h"
+# else
+# include "printf-parse.h"
+# endif
+#endif
+
+/* Checked size_t computations. */
+#include "xsize.h"
+
+#include "attribute.h"
+
+#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "float+.h"
+#endif
+
+#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnand-nolibm.h"
+#endif
+
+#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnanl-nolibm.h"
+# include "fpucw.h"
+#endif
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnand-nolibm.h"
+# include "printf-frexp.h"
+#endif
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+# include <math.h>
+# include "isnanl-nolibm.h"
+# include "printf-frexpl.h"
+# include "fpucw.h"
+#endif
+
+/* Default parameters. */
+#ifndef VASNPRINTF
+# if WIDE_CHAR_VERSION
+# define VASNPRINTF vasnwprintf
+# define FCHAR_T wchar_t
+# define DCHAR_T wchar_t
+# define TCHAR_T wchar_t
+# define DCHAR_IS_TCHAR 1
+# define DIRECTIVE wchar_t_directive
+# define DIRECTIVES wchar_t_directives
+# define PRINTF_PARSE wprintf_parse
+# define DCHAR_CPY wmemcpy
+# define DCHAR_SET wmemset
+# else
+# define VASNPRINTF vasnprintf
+# define FCHAR_T char
+# define DCHAR_T char
+# define TCHAR_T char
+# define DCHAR_IS_TCHAR 1
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+# define PRINTF_PARSE printf_parse
+# define DCHAR_CPY memcpy
+# define DCHAR_SET memset
+# endif
+#endif
+#if WIDE_CHAR_VERSION
+ /* TCHAR_T is wchar_t. */
+# define USE_SNPRINTF 1
+# if HAVE_DECL__SNWPRINTF
+ /* On Windows, the function swprintf() has a different signature than
+ on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+ instead. The mingw function snwprintf() has fewer bugs than the
+ MSVCRT function _snwprintf(), so prefer that. */
+# if defined __MINGW32__
+# define SNPRINTF snwprintf
+# else
+# define SNPRINTF _snwprintf
+# define USE_MSVC__SNPRINTF 1
+# endif
+# else
+ /* Unix. */
+# define SNPRINTF swprintf
+# endif
+#else
+ /* TCHAR_T is char. */
+ /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
+ But don't use it on BeOS, since BeOS snprintf produces no output if the
+ size argument is >= 0x3000000.
+ Also don't use it on Linux libc5, since there snprintf with size = 1
+ writes any output without bounds, like sprintf. */
+# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1)
+# define USE_SNPRINTF 1
+# else
+# define USE_SNPRINTF 0
+# endif
+# if HAVE_DECL__SNPRINTF
+ /* Windows. The mingw function snprintf() has fewer bugs than the MSVCRT
+ function _snprintf(), so prefer that. */
+# if defined __MINGW32__
+# define SNPRINTF snprintf
+ /* Here we need to call the native snprintf, not rpl_snprintf. */
+# undef snprintf
+# else
+ /* MSVC versions < 14 did not have snprintf, only _snprintf. */
+# define SNPRINTF _snprintf
+# define USE_MSVC__SNPRINTF 1
+# endif
+# else
+ /* Unix. */
+# define SNPRINTF snprintf
+ /* Here we need to call the native snprintf, not rpl_snprintf. */
+# undef snprintf
+# endif
+#endif
+/* Here we need to call the native sprintf, not rpl_sprintf. */
+#undef sprintf
+
+/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
+ warnings in this file. Use -Dlint to suppress them. */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+/* Avoid some warnings from "gcc -Wshadow".
+ This file doesn't use the exp() and remainder() functions. */
+#undef exp
+#define exp expo
+#undef remainder
+#define remainder rem
+
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION
+# if (HAVE_STRNLEN && !defined _AIX)
+# define local_strnlen strnlen
+# else
+# ifndef local_strnlen_defined
+# define local_strnlen_defined 1
+static size_t
+local_strnlen (const char *string, size_t maxlen)
+{
+ const char *end = memchr (string, '\0', maxlen);
+ return end ? (size_t) (end - string) : maxlen;
+}
+# endif
+# endif
+#endif
+
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
+# if HAVE_WCSLEN
+# define local_wcslen wcslen
+# else
+ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
+ a dependency towards this library, here is a local substitute.
+ Define this substitute only once, even if this file is included
+ twice in the same compilation unit. */
+# ifndef local_wcslen_defined
+# define local_wcslen_defined 1
+static size_t
+local_wcslen (const wchar_t *s)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+# if HAVE_WCSNLEN
+# define local_wcsnlen wcsnlen
+# else
+# ifndef local_wcsnlen_defined
+# define local_wcsnlen_defined 1
+static size_t
+local_wcsnlen (const wchar_t *s, size_t maxlen)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || (ENABLE_WCHAR_FALLBACK && HAVE_WINT_T)) && !WIDE_CHAR_VERSION
+# if ENABLE_WCHAR_FALLBACK
+static size_t
+wctomb_fallback (char *s, wchar_t wc)
+{
+ static char hex[16] = "0123456789ABCDEF";
+
+ s[0] = '\\';
+ if (sizeof (wchar_t) > 2 && wc > 0xffff)
+ {
+# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+ s[1] = 'U';
+# else
+ s[1] = 'W';
+# endif
+ s[2] = hex[(wc & 0xf0000000U) >> 28];
+ s[3] = hex[(wc & 0xf000000U) >> 24];
+ s[4] = hex[(wc & 0xf00000U) >> 20];
+ s[5] = hex[(wc & 0xf0000U) >> 16];
+ s[6] = hex[(wc & 0xf000U) >> 12];
+ s[7] = hex[(wc & 0xf00U) >> 8];
+ s[8] = hex[(wc & 0xf0U) >> 4];
+ s[9] = hex[wc & 0xfU];
+ return 10;
+ }
+ else
+ {
+# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+ s[1] = 'u';
+# else
+ s[1] = 'w';
+# endif
+ s[2] = hex[(wc & 0xf000U) >> 12];
+ s[3] = hex[(wc & 0xf00U) >> 8];
+ s[4] = hex[(wc & 0xf0U) >> 4];
+ s[5] = hex[wc & 0xfU];
+ return 6;
+ }
+}
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+static size_t
+local_wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+{
+ size_t count = wcrtomb (s, wc, ps);
+ if (count == (size_t)(-1))
+ count = wctomb_fallback (s, wc);
+ return count;
+}
+# else
+static int
+local_wctomb (char *s, wchar_t wc)
+{
+ int count = wctomb (s, wc);
+ if (count < 0)
+ count = wctomb_fallback (s, wc);
+ return count;
+}
+# define local_wcrtomb(S, WC, PS) local_wctomb ((S), (WC))
+# endif
+# else
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+# define local_wcrtomb(S, WC, PS) wcrtomb ((S), (WC), (PS))
+# else
+# define local_wcrtomb(S, WC, PS) wctomb ((S), (WC))
+# endif
+# endif
+#endif
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+/* Determine the decimal-point character according to the current locale. */
+# ifndef decimal_point_char_defined
+# define decimal_point_char_defined 1
+static char
+decimal_point_char (void)
+{
+ const char *point;
+ /* Determine it in a multithread-safe way. We know nl_langinfo is
+ multithread-safe on glibc systems and Mac OS X systems, but is not required
+ to be multithread-safe by POSIX. sprintf(), however, is multithread-safe.
+ localeconv() is rarely multithread-safe. */
+# if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
+ point = nl_langinfo (RADIXCHAR);
+# elif 1
+ char pointbuf[5];
+ sprintf (pointbuf, "%#.0f", 1.0);
+ point = &pointbuf[1];
+# else
+ point = localeconv () -> decimal_point;
+# endif
+ /* The decimal point is always a single byte: either '.' or ','. */
+ return (point[0] != '\0' ? point[0] : '.');
+}
+# endif
+#endif
+
+#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL
+
+/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
+static int
+is_infinite_or_zero (double x)
+{
+ return isnand (x) || x + x == x;
+}
+
+#endif
+
+#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
+
+/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
+static int
+is_infinite_or_zerol (long double x)
+{
+ return isnanl (x) || x + x == x;
+}
+
+#endif
+
+#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+
+/* Converting 'long double' to decimal without rare rounding bugs requires
+ real bignums. We use the naming conventions of GNU gmp, but vastly simpler
+ (and slower) algorithms. */
+
+typedef unsigned int mp_limb_t;
+# define GMP_LIMB_BITS 32
+static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+
+typedef unsigned long long mp_twolimb_t;
+# define GMP_TWOLIMB_BITS 64
+static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+
+/* Representation of a bignum >= 0. */
+typedef struct
+{
+ size_t nlimbs;
+ mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */
+} mpn_t;
+
+/* Compute the product of two bignums >= 0.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
+{
+ const mp_limb_t *p1;
+ const mp_limb_t *p2;
+ size_t len1;
+ size_t len2;
+
+ if (src1.nlimbs <= src2.nlimbs)
+ {
+ len1 = src1.nlimbs;
+ p1 = src1.limbs;
+ len2 = src2.nlimbs;
+ p2 = src2.limbs;
+ }
+ else
+ {
+ len1 = src2.nlimbs;
+ p1 = src2.limbs;
+ len2 = src1.nlimbs;
+ p2 = src1.limbs;
+ }
+ /* Now 0 <= len1 <= len2. */
+ if (len1 == 0)
+ {
+ /* src1 or src2 is zero. */
+ dest->nlimbs = 0;
+ dest->limbs = (mp_limb_t *) malloc (1);
+ }
+ else
+ {
+ /* Here 1 <= len1 <= len2. */
+ size_t dlen;
+ mp_limb_t *dp;
+ size_t k, i, j;
+
+ dlen = len1 + len2;
+ dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
+ if (dp == NULL)
+ return NULL;
+ for (k = len2; k > 0; )
+ dp[--k] = 0;
+ for (i = 0; i < len1; i++)
+ {
+ mp_limb_t digit1 = p1[i];
+ mp_twolimb_t carry = 0;
+ for (j = 0; j < len2; j++)
+ {
+ mp_limb_t digit2 = p2[j];
+ carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+ carry += dp[i + j];
+ dp[i + j] = (mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS;
+ }
+ dp[i + len2] = (mp_limb_t) carry;
+ }
+ /* Normalise. */
+ while (dlen > 0 && dp[dlen - 1] == 0)
+ dlen--;
+ dest->nlimbs = dlen;
+ dest->limbs = dp;
+ }
+ return dest->limbs;
+}
+
+/* Compute the quotient of a bignum a >= 0 and a bignum b > 0.
+ a is written as a = q * b + r with 0 <= r < b. q is the quotient, r
+ the remainder.
+ Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd,
+ q is incremented.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+divide (mpn_t a, mpn_t b, mpn_t *q)
+{
+ /* Algorithm:
+ First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]]
+ with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS).
+ If m<n, then q:=0 and r:=a.
+ If m>=n=1, perform a single-precision division:
+ r:=0, j:=m,
+ while j>0 do
+ {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j =
+ = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r<b[0]<beta}
+ j:=j-1, r:=r*beta+a[j], q[j]:=floor(r/b[0]), r:=r-b[0]*q[j].
+ Normalise [q[m-1],...,q[0]], yields q.
+ If m>=n>1, perform a multiple-precision division:
+ We have a/b < beta^(m-n+1).
+ s:=intDsize-1-(highest bit in b[n-1]), 0<=s<intDsize.
+ Shift a and b left by s bits, copying them. r:=a.
+ r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2.
+ For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).}
+ Compute q* :
+ q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]).
+ In case of overflow (q* >= beta) set q* := beta-1.
+ Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2]
+ and c3 := b[n-2] * q*.
+ {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow
+ occurred. Furthermore 0 <= c3 < beta^2.
+ If there was overflow and
+ r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2,
+ the next test can be skipped.}
+ While c3 > c2, {Here 0 <= c2 < c3 < beta^2}
+ Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2].
+ If q* > 0:
+ Put r := r - b * q* * beta^j. In detail:
+ [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]].
+ hence: u:=0, for i:=0 to n-1 do
+ u := u + q* * b[i],
+ r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry),
+ u:=u div beta (+ 1, if carry in subtraction)
+ r[n+j]:=r[n+j]-u.
+ {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1
+ < q* + 1 <= beta,
+ the carry u does not overflow.}
+ If a negative carry occurs, put q* := q* - 1
+ and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]].
+ Set q[j] := q*.
+ Normalise [q[m-n],..,q[0]]; this yields the quotient q.
+ Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the
+ rest r.
+ The room for q[j] can be allocated at the memory location of r[n+j].
+ Finally, round-to-even:
+ Shift r left by 1 bit.
+ If r > b or if r = b and q[0] is odd, q := q+1.
+ */
+ const mp_limb_t *a_ptr = a.limbs;
+ size_t a_len = a.nlimbs;
+ const mp_limb_t *b_ptr = b.limbs;
+ size_t b_len = b.nlimbs;
+ mp_limb_t *roomptr;
+ mp_limb_t *tmp_roomptr = NULL;
+ mp_limb_t *q_ptr;
+ size_t q_len;
+ mp_limb_t *r_ptr;
+ size_t r_len;
+
+ /* Allocate room for a_len+2 digits.
+ (Need a_len+1 digits for the real division and 1 more digit for the
+ final rounding of q.) */
+ roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t));
+ if (roomptr == NULL)
+ return NULL;
+
+ /* Normalise a. */
+ while (a_len > 0 && a_ptr[a_len - 1] == 0)
+ a_len--;
+
+ /* Normalise b. */
+ for (;;)
+ {
+ if (b_len == 0)
+ /* Division by zero. */
+ abort ();
+ if (b_ptr[b_len - 1] == 0)
+ b_len--;
+ else
+ break;
+ }
+
+ /* Here m = a_len >= 0 and n = b_len > 0. */
+
+ if (a_len < b_len)
+ {
+ /* m<n: trivial case. q=0, r := copy of a. */
+ r_ptr = roomptr;
+ r_len = a_len;
+ memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+ q_ptr = roomptr + a_len;
+ q_len = 0;
+ }
+ else if (b_len == 1)
+ {
+ /* n=1: single precision division.
+ beta^(m-1) <= a < beta^m ==> beta^(m-2) <= a/b < beta^m */
+ r_ptr = roomptr;
+ q_ptr = roomptr + 1;
+ {
+ mp_limb_t den = b_ptr[0];
+ mp_limb_t remainder = 0;
+ const mp_limb_t *sourceptr = a_ptr + a_len;
+ mp_limb_t *destptr = q_ptr + a_len;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ mp_twolimb_t num =
+ ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
+ *--destptr = num / den;
+ remainder = num % den;
+ }
+ /* Normalise and store r. */
+ if (remainder > 0)
+ {
+ r_ptr[0] = remainder;
+ r_len = 1;
+ }
+ else
+ r_len = 0;
+ /* Normalise q. */
+ q_len = a_len;
+ if (q_ptr[q_len - 1] == 0)
+ q_len--;
+ }
+ }
+ else
+ {
+ /* n>1: multiple precision division.
+ beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==>
+ beta^(m-n-1) <= a/b < beta^(m-n+1). */
+ /* Determine s. */
+ size_t s;
+ {
+ mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
+ /* Determine s = GMP_LIMB_BITS - integer_length (msd).
+ Code copied from gnulib's integer_length.c. */
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \
+ || (__clang_major__ >= 4)
+ s = __builtin_clz (msd);
+# else
+# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
+ if (GMP_LIMB_BITS <= DBL_MANT_BIT)
+ {
+ /* Use 'double' operations.
+ Assumes an IEEE 754 'double' implementation. */
+# define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
+# define DBL_EXP_BIAS (DBL_EXP_MASK / 2 - 1)
+# define NWORDS \
+ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+ union { double value; unsigned int word[NWORDS]; } m;
+
+ /* Use a single integer to floating-point conversion. */
+ m.value = msd;
+
+ s = GMP_LIMB_BITS
+ - (((m.word[DBL_EXPBIT0_WORD] >> DBL_EXPBIT0_BIT) & DBL_EXP_MASK)
+ - DBL_EXP_BIAS);
+ }
+ else
+# undef NWORDS
+# endif
+ {
+ s = 31;
+ if (msd >= 0x10000)
+ {
+ msd = msd >> 16;
+ s -= 16;
+ }
+ if (msd >= 0x100)
+ {
+ msd = msd >> 8;
+ s -= 8;
+ }
+ if (msd >= 0x10)
+ {
+ msd = msd >> 4;
+ s -= 4;
+ }
+ if (msd >= 0x4)
+ {
+ msd = msd >> 2;
+ s -= 2;
+ }
+ if (msd >= 0x2)
+ {
+ msd = msd >> 1;
+ s -= 1;
+ }
+ }
+# endif
+ }
+ /* 0 <= s < GMP_LIMB_BITS.
+ Copy b, shifting it left by s bits. */
+ if (s > 0)
+ {
+ tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
+ if (tmp_roomptr == NULL)
+ {
+ free (roomptr);
+ return NULL;
+ }
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = tmp_roomptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ /* accu must be zero, since that was how s was determined. */
+ if (accu != 0)
+ abort ();
+ }
+ b_ptr = tmp_roomptr;
+ }
+ /* Copy a, shifting it left by s bits, yields r.
+ Memory layout:
+ At the beginning: r = roomptr[0..a_len],
+ at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */
+ r_ptr = roomptr;
+ if (s == 0)
+ {
+ memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+ r_ptr[a_len] = 0;
+ }
+ else
+ {
+ const mp_limb_t *sourceptr = a_ptr;
+ mp_limb_t *destptr = r_ptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ *destptr++ = (mp_limb_t) accu;
+ }
+ q_ptr = roomptr + b_len;
+ q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */
+ {
+ size_t j = a_len - b_len; /* m-n */
+ mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
+ mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
+ mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
+ ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
+ /* Division loop, traversed m-n+1 times.
+ j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */
+ for (;;)
+ {
+ mp_limb_t q_star;
+ mp_limb_t c1;
+ if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
+ {
+ /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */
+ mp_twolimb_t num =
+ ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
+ | r_ptr[j + b_len - 1];
+ q_star = num / b_msd;
+ c1 = num % b_msd;
+ }
+ else
+ {
+ /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */
+ q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
+ /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
+ <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
+ <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
+ {<= beta !}.
+ If yes, jump directly to the subtraction loop.
+ (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
+ <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
+ if (r_ptr[j + b_len] > b_msd
+ || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
+ /* r[j+n] >= b[n-1]+1 or
+ r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
+ carry. */
+ goto subtract;
+ }
+ /* q_star = q*,
+ c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta). */
+ {
+ mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
+ ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
+ mp_twolimb_t c3 = /* b[n-2] * q* */
+ (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
+ /* While c2 < c3, increase c2 and decrease c3.
+ Consider c3-c2. While it is > 0, decrease it by
+ b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2
+ this can happen only twice. */
+ if (c3 > c2)
+ {
+ q_star = q_star - 1; /* q* := q* - 1 */
+ if (c3 - c2 > b_msdd)
+ q_star = q_star - 1; /* q* := q* - 1 */
+ }
+ }
+ if (q_star > 0)
+ subtract:
+ {
+ /* Subtract r := r - b * q* * beta^j. */
+ mp_limb_t cr;
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = r_ptr + j;
+ mp_twolimb_t carry = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ /* Here 0 <= carry <= q*. */
+ carry =
+ carry
+ + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
+ + (mp_limb_t) ~(*destptr);
+ /* Here 0 <= carry <= beta*q* + beta-1. */
+ *destptr++ = ~(mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS; /* <= q* */
+ }
+ cr = (mp_limb_t) carry;
+ }
+ /* Subtract cr from r_ptr[j + b_len], then forget about
+ r_ptr[j + b_len]. */
+ if (cr > r_ptr[j + b_len])
+ {
+ /* Subtraction gave a carry. */
+ q_star = q_star - 1; /* q* := q* - 1 */
+ /* Add b back. */
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = r_ptr + j;
+ mp_limb_t carry = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ mp_limb_t source1 = *sourceptr++;
+ mp_limb_t source2 = *destptr;
+ *destptr++ = source1 + source2 + carry;
+ carry =
+ (carry
+ ? source1 >= (mp_limb_t) ~source2
+ : source1 > (mp_limb_t) ~source2);
+ }
+ }
+ /* Forget about the carry and about r[j+n]. */
+ }
+ }
+ /* q* is determined. Store it as q[j]. */
+ q_ptr[j] = q_star;
+ if (j == 0)
+ break;
+ j--;
+ }
+ }
+ r_len = b_len;
+ /* Normalise q. */
+ if (q_ptr[q_len - 1] == 0)
+ q_len--;
+# if 0 /* Not needed here, since we need r only to compare it with b/2, and
+ b is shifted left by s bits. */
+ /* Shift r right by s bits. */
+ if (s > 0)
+ {
+ mp_limb_t ptr = r_ptr + r_len;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = r_len; count > 0; count--)
+ {
+ accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
+ accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
+ *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
+ }
+ }
+# endif
+ /* Normalise r. */
+ while (r_len > 0 && r_ptr[r_len - 1] == 0)
+ r_len--;
+ }
+ /* Compare r << 1 with b. */
+ if (r_len > b_len)
+ goto increment_q;
+ {
+ size_t i;
+ for (i = b_len;;)
+ {
+ mp_limb_t r_i =
+ (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
+ | (i < r_len ? r_ptr[i] << 1 : 0);
+ mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
+ if (r_i > b_i)
+ goto increment_q;
+ if (r_i < b_i)
+ goto keep_q;
+ if (i == 0)
+ break;
+ i--;
+ }
+ }
+ if (q_len > 0 && ((q_ptr[0] & 1) != 0))
+ /* q is odd. */
+ increment_q:
+ {
+ size_t i;
+ for (i = 0; i < q_len; i++)
+ if (++(q_ptr[i]) != 0)
+ goto keep_q;
+ q_ptr[q_len++] = 1;
+ }
+ keep_q:
+ free (tmp_roomptr);
+ q->limbs = q_ptr;
+ q->nlimbs = q_len;
+ return roomptr;
+}
+
+/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal
+ representation.
+ Destroys the contents of a.
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+convert_to_decimal (mpn_t a, size_t extra_zeroes)
+{
+ mp_limb_t *a_ptr = a.limbs;
+ size_t a_len = a.nlimbs;
+ /* 0.03345 is slightly larger than log(2)/(9*log(10)). */
+ size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1);
+ /* We need extra_zeroes bytes for zeroes, followed by c_len bytes for the
+ digits of a, followed by 1 byte for the terminating NUL. */
+ char *c_ptr = (char *) malloc (xsum (xsum (extra_zeroes, c_len), 1));
+ if (c_ptr != NULL)
+ {
+ char *d_ptr = c_ptr;
+ for (; extra_zeroes > 0; extra_zeroes--)
+ *d_ptr++ = '0';
+ while (a_len > 0)
+ {
+ /* Divide a by 10^9, in-place. */
+ mp_limb_t remainder = 0;
+ mp_limb_t *ptr = a_ptr + a_len;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ mp_twolimb_t num =
+ ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
+ *ptr = num / 1000000000;
+ remainder = num % 1000000000;
+ }
+ /* Store the remainder as 9 decimal digits. */
+ for (count = 9; count > 0; count--)
+ {
+ *d_ptr++ = '0' + (remainder % 10);
+ remainder = remainder / 10;
+ }
+ /* Normalize a. */
+ if (a_ptr[a_len - 1] == 0)
+ a_len--;
+ }
+ /* Remove leading zeroes. */
+ while (d_ptr > c_ptr && d_ptr[-1] == '0')
+ d_ptr--;
+ /* But keep at least one zero. */
+ if (d_ptr == c_ptr)
+ *d_ptr++ = '0';
+ /* Terminate the string. */
+ *d_ptr = '\0';
+ }
+ return c_ptr;
+}
+
+# if NEED_PRINTF_LONG_DOUBLE
+
+/* Assuming x is finite and >= 0:
+ write x as x = 2^e * m, where m is a bignum.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+decode_long_double (long double x, int *ep, mpn_t *mp)
+{
+ mpn_t m;
+ int exp;
+ long double y;
+ size_t i;
+
+ /* Allocate memory for result. */
+ m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
+ m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
+ if (m.limbs == NULL)
+ return NULL;
+ /* Split into exponential part and mantissa. */
+ y = frexpl (x, &exp);
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the
+ latter is an integer. */
+ /* Convert the mantissa (y * 2^LDBL_MANT_BIT) to a sequence of limbs.
+ I'm not sure whether it's safe to cast a 'long double' value between
+ 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
+ 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
+ doesn't matter). */
+# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0
+# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2));
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+# else
+ {
+ mp_limb_t d;
+ y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS);
+ d = (int) y;
+ y -= d;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d;
+ }
+# endif
+# endif
+ for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+# if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
+ precision. */
+ if (!(y == 0.0L))
+ abort ();
+# endif
+ /* Normalise. */
+ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
+ m.nlimbs--;
+ *mp = m;
+ *ep = exp - LDBL_MANT_BIT;
+ return m.limbs;
+}
+
+# endif
+
+# if NEED_PRINTF_DOUBLE
+
+/* Assuming x is finite and >= 0:
+ write x as x = 2^e * m, where m is a bignum.
+ Return the allocated memory in case of success, NULL in case of memory
+ allocation failure. */
+static void *
+decode_double (double x, int *ep, mpn_t *mp)
+{
+ mpn_t m;
+ int exp;
+ double y;
+ size_t i;
+
+ /* Allocate memory for result. */
+ m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
+ m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
+ if (m.limbs == NULL)
+ return NULL;
+ /* Split into exponential part and mantissa. */
+ y = frexp (x, &exp);
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the
+ latter is an integer. */
+ /* Convert the mantissa (y * 2^DBL_MANT_BIT) to a sequence of limbs.
+ I'm not sure whether it's safe to cast a 'double' value between
+ 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
+ 'double' values between 0 and 2^16 (to 'unsigned int' or 'int',
+ doesn't matter). */
+# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0
+# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2));
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+# else
+ {
+ mp_limb_t d;
+ y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS);
+ d = (int) y;
+ y -= d;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d;
+ }
+# endif
+# endif
+ for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
+ {
+ mp_limb_t hi, lo;
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ hi = (int) y;
+ y -= hi;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
+ lo = (int) y;
+ y -= lo;
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
+ }
+ if (!(y == 0.0))
+ abort ();
+ /* Normalise. */
+ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
+ m.nlimbs--;
+ *mp = m;
+ *ep = exp - DBL_MANT_BIT;
+ return m.limbs;
+}
+
+# endif
+
+/* Assuming x = 2^e * m is finite and >= 0, and n is an integer:
+ Returns the decimal representation of round (x * 10^n).
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
+{
+ int s;
+ size_t extra_zeroes;
+ unsigned int abs_n;
+ unsigned int abs_s;
+ mp_limb_t *pow5_ptr;
+ size_t pow5_len;
+ unsigned int s_limbs;
+ unsigned int s_bits;
+ mpn_t pow5;
+ mpn_t z;
+ void *z_memory;
+ char *digits;
+
+ if (memory == NULL)
+ return NULL;
+ /* x = 2^e * m, hence
+ y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m)
+ = round (2^s * 5^n * m). */
+ s = e + n;
+ extra_zeroes = 0;
+ /* Factor out a common power of 10 if possible. */
+ if (s > 0 && n > 0)
+ {
+ extra_zeroes = (s < n ? s : n);
+ s -= extra_zeroes;
+ n -= extra_zeroes;
+ }
+ /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes.
+ Before converting to decimal, we need to compute
+ z = round (2^s * 5^n * m). */
+ /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same
+ sign. 2.322 is slightly larger than log(5)/log(2). */
+ abs_n = (n >= 0 ? n : -n);
+ abs_s = (s >= 0 ? s : -s);
+ pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1
+ + abs_s / GMP_LIMB_BITS + 1)
+ * sizeof (mp_limb_t));
+ if (pow5_ptr == NULL)
+ {
+ free (memory);
+ return NULL;
+ }
+ /* Initialize with 1. */
+ pow5_ptr[0] = 1;
+ pow5_len = 1;
+ /* Multiply with 5^|n|. */
+ if (abs_n > 0)
+ {
+ static mp_limb_t const small_pow5[13 + 1] =
+ {
+ 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
+ 48828125, 244140625, 1220703125
+ };
+ unsigned int n13;
+ for (n13 = 0; n13 <= abs_n; n13 += 13)
+ {
+ mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
+ size_t j;
+ mp_twolimb_t carry = 0;
+ for (j = 0; j < pow5_len; j++)
+ {
+ mp_limb_t digit2 = pow5_ptr[j];
+ carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+ pow5_ptr[j] = (mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS;
+ }
+ if (carry > 0)
+ pow5_ptr[pow5_len++] = (mp_limb_t) carry;
+ }
+ }
+ s_limbs = abs_s / GMP_LIMB_BITS;
+ s_bits = abs_s % GMP_LIMB_BITS;
+ if (n >= 0 ? s >= 0 : s <= 0)
+ {
+ /* Multiply with 2^|s|. */
+ if (s_bits > 0)
+ {
+ mp_limb_t *ptr = pow5_ptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = pow5_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *ptr << s_bits;
+ *ptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ if (accu > 0)
+ {
+ *ptr = (mp_limb_t) accu;
+ pow5_len++;
+ }
+ }
+ if (s_limbs > 0)
+ {
+ size_t count;
+ for (count = pow5_len; count > 0;)
+ {
+ count--;
+ pow5_ptr[s_limbs + count] = pow5_ptr[count];
+ }
+ for (count = s_limbs; count > 0;)
+ {
+ count--;
+ pow5_ptr[count] = 0;
+ }
+ pow5_len += s_limbs;
+ }
+ pow5.limbs = pow5_ptr;
+ pow5.nlimbs = pow5_len;
+ if (n >= 0)
+ {
+ /* Multiply m with pow5. No division needed. */
+ z_memory = multiply (m, pow5, &z);
+ }
+ else
+ {
+ /* Divide m by pow5 and round. */
+ z_memory = divide (m, pow5, &z);
+ }
+ }
+ else
+ {
+ pow5.limbs = pow5_ptr;
+ pow5.nlimbs = pow5_len;
+ if (n >= 0)
+ {
+ /* n >= 0, s < 0.
+ Multiply m with pow5, then divide by 2^|s|. */
+ mpn_t numerator;
+ mpn_t denominator;
+ void *tmp_memory;
+ tmp_memory = multiply (m, pow5, &numerator);
+ if (tmp_memory == NULL)
+ {
+ free (pow5_ptr);
+ free (memory);
+ return NULL;
+ }
+ /* Construct 2^|s|. */
+ {
+ mp_limb_t *ptr = pow5_ptr + pow5_len;
+ size_t i;
+ for (i = 0; i < s_limbs; i++)
+ ptr[i] = 0;
+ ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
+ denominator.limbs = ptr;
+ denominator.nlimbs = s_limbs + 1;
+ }
+ z_memory = divide (numerator, denominator, &z);
+ free (tmp_memory);
+ }
+ else
+ {
+ /* n < 0, s > 0.
+ Multiply m with 2^s, then divide by pow5. */
+ mpn_t numerator;
+ mp_limb_t *num_ptr;
+ num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
+ * sizeof (mp_limb_t));
+ if (num_ptr == NULL)
+ {
+ free (pow5_ptr);
+ free (memory);
+ return NULL;
+ }
+ {
+ mp_limb_t *destptr = num_ptr;
+ {
+ size_t i;
+ for (i = 0; i < s_limbs; i++)
+ *destptr++ = 0;
+ }
+ if (s_bits > 0)
+ {
+ const mp_limb_t *sourceptr = m.limbs;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = m.nlimbs; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s_bits;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ if (accu > 0)
+ *destptr++ = (mp_limb_t) accu;
+ }
+ else
+ {
+ const mp_limb_t *sourceptr = m.limbs;
+ size_t count;
+ for (count = m.nlimbs; count > 0; count--)
+ *destptr++ = *sourceptr++;
+ }
+ numerator.limbs = num_ptr;
+ numerator.nlimbs = destptr - num_ptr;
+ }
+ z_memory = divide (numerator, pow5, &z);
+ free (num_ptr);
+ }
+ }
+ free (pow5_ptr);
+ free (memory);
+
+ /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */
+
+ if (z_memory == NULL)
+ return NULL;
+ digits = convert_to_decimal (z, extra_zeroes);
+ free (z_memory);
+ return digits;
+}
+
+# if NEED_PRINTF_LONG_DOUBLE
+
+/* Assuming x is finite and >= 0, and n is an integer:
+ Returns the decimal representation of round (x * 10^n).
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+scale10_round_decimal_long_double (long double x, int n)
+{
+ int e IF_LINT(= 0);
+ mpn_t m;
+ void *memory = decode_long_double (x, &e, &m);
+ return scale10_round_decimal_decoded (e, m, memory, n);
+}
+
+# endif
+
+# if NEED_PRINTF_DOUBLE
+
+/* Assuming x is finite and >= 0, and n is an integer:
+ Returns the decimal representation of round (x * 10^n).
+ Return the allocated memory - containing the decimal digits in low-to-high
+ order, terminated with a NUL character - in case of success, NULL in case
+ of memory allocation failure. */
+static char *
+scale10_round_decimal_double (double x, int n)
+{
+ int e IF_LINT(= 0);
+ mpn_t m;
+ void *memory = decode_double (x, &e, &m);
+ return scale10_round_decimal_decoded (e, m, memory, n);
+}
+
+# endif
+
+# if NEED_PRINTF_LONG_DOUBLE
+
+/* Assuming x is finite and > 0:
+ Return an approximation for n with 10^n <= x < 10^(n+1).
+ The approximation is usually the right n, but may be off by 1 sometimes. */
+static int
+floorlog10l (long double x)
+{
+ int exp;
+ long double y;
+ double z;
+ double l;
+
+ /* Split into exponential part and mantissa. */
+ y = frexpl (x, &exp);
+ if (!(y >= 0.0L && y < 1.0L))
+ abort ();
+ if (y == 0.0L)
+ return INT_MIN;
+ if (y < 0.5L)
+ {
+ while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
+ {
+ y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+ exp -= GMP_LIMB_BITS;
+ }
+ if (y < (1.0L / (1 << 16)))
+ {
+ y *= 1.0L * (1 << 16);
+ exp -= 16;
+ }
+ if (y < (1.0L / (1 << 8)))
+ {
+ y *= 1.0L * (1 << 8);
+ exp -= 8;
+ }
+ if (y < (1.0L / (1 << 4)))
+ {
+ y *= 1.0L * (1 << 4);
+ exp -= 4;
+ }
+ if (y < (1.0L / (1 << 2)))
+ {
+ y *= 1.0L * (1 << 2);
+ exp -= 2;
+ }
+ if (y < (1.0L / (1 << 1)))
+ {
+ y *= 1.0L * (1 << 1);
+ exp -= 1;
+ }
+ }
+ if (!(y >= 0.5L && y < 1.0L))
+ abort ();
+ /* Compute an approximation for l = log2(x) = exp + log2(y). */
+ l = exp;
+ z = y;
+ if (z < 0.70710678118654752444)
+ {
+ z *= 1.4142135623730950488;
+ l -= 0.5;
+ }
+ if (z < 0.8408964152537145431)
+ {
+ z *= 1.1892071150027210667;
+ l -= 0.25;
+ }
+ if (z < 0.91700404320467123175)
+ {
+ z *= 1.0905077326652576592;
+ l -= 0.125;
+ }
+ if (z < 0.9576032806985736469)
+ {
+ z *= 1.0442737824274138403;
+ l -= 0.0625;
+ }
+ /* Now 0.95 <= z <= 1.01. */
+ z = 1 - z;
+ /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
+ Four terms are enough to get an approximation with error < 10^-7. */
+ l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+ /* Finally multiply with log(2)/log(10), yields an approximation for
+ log10(x). */
+ l *= 0.30102999566398119523;
+ /* Round down to the next integer. */
+ return (int) l + (l < 0 ? -1 : 0);
+}
+
+# endif
+
+# if NEED_PRINTF_DOUBLE
+
+/* Assuming x is finite and > 0:
+ Return an approximation for n with 10^n <= x < 10^(n+1).
+ The approximation is usually the right n, but may be off by 1 sometimes. */
+static int
+floorlog10 (double x)
+{
+ int exp;
+ double y;
+ double z;
+ double l;
+
+ /* Split into exponential part and mantissa. */
+ y = frexp (x, &exp);
+ if (!(y >= 0.0 && y < 1.0))
+ abort ();
+ if (y == 0.0)
+ return INT_MIN;
+ if (y < 0.5)
+ {
+ while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
+ {
+ y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+ exp -= GMP_LIMB_BITS;
+ }
+ if (y < (1.0 / (1 << 16)))
+ {
+ y *= 1.0 * (1 << 16);
+ exp -= 16;
+ }
+ if (y < (1.0 / (1 << 8)))
+ {
+ y *= 1.0 * (1 << 8);
+ exp -= 8;
+ }
+ if (y < (1.0 / (1 << 4)))
+ {
+ y *= 1.0 * (1 << 4);
+ exp -= 4;
+ }
+ if (y < (1.0 / (1 << 2)))
+ {
+ y *= 1.0 * (1 << 2);
+ exp -= 2;
+ }
+ if (y < (1.0 / (1 << 1)))
+ {
+ y *= 1.0 * (1 << 1);
+ exp -= 1;
+ }
+ }
+ if (!(y >= 0.5 && y < 1.0))
+ abort ();
+ /* Compute an approximation for l = log2(x) = exp + log2(y). */
+ l = exp;
+ z = y;
+ if (z < 0.70710678118654752444)
+ {
+ z *= 1.4142135623730950488;
+ l -= 0.5;
+ }
+ if (z < 0.8408964152537145431)
+ {
+ z *= 1.1892071150027210667;
+ l -= 0.25;
+ }
+ if (z < 0.91700404320467123175)
+ {
+ z *= 1.0905077326652576592;
+ l -= 0.125;
+ }
+ if (z < 0.9576032806985736469)
+ {
+ z *= 1.0442737824274138403;
+ l -= 0.0625;
+ }
+ /* Now 0.95 <= z <= 1.01. */
+ z = 1 - z;
+ /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
+ Four terms are enough to get an approximation with error < 10^-7. */
+ l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+ /* Finally multiply with log(2)/log(10), yields an approximation for
+ log10(x). */
+ l *= 0.30102999566398119523;
+ /* Round down to the next integer. */
+ return (int) l + (l < 0 ? -1 : 0);
+}
+
+# endif
+
+/* Tests whether a string of digits consists of exactly PRECISION zeroes and
+ a single '1' digit. */
+static int
+is_borderline (const char *digits, size_t precision)
+{
+ for (; precision > 0; precision--, digits++)
+ if (*digits != '0')
+ return 0;
+ if (*digits != '1')
+ return 0;
+ digits++;
+ return *digits == '\0';
+}
+
+#endif
+
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
+
+/* Use a different function name, to make it possible that the 'wchar_t'
+ parametrization and the 'char' parametrization get compiled in the same
+ translation unit. */
+# if WIDE_CHAR_VERSION
+# define MAX_ROOM_NEEDED wmax_room_needed
+# else
+# define MAX_ROOM_NEEDED max_room_needed
+# endif
+
+/* Returns the number of TCHAR_T units needed as temporary space for the result
+ of sprintf or SNPRINTF of a single conversion directive. */
+static size_t
+MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
+ arg_type type, int flags, size_t width, int has_precision,
+ size_t precision, int pad_ourselves)
+{
+ size_t tmp_length;
+
+ switch (conversion)
+ {
+ case 'd': case 'i': case 'u':
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Multiply by 2, as an estimate for FLAG_GROUP. */
+ tmp_length = xsum (tmp_length, tmp_length);
+ /* Add 1, to account for a leading sign. */
+ tmp_length = xsum (tmp_length, 1);
+ break;
+
+ case 'o':
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 1, to account for a leading sign. */
+ tmp_length = xsum (tmp_length, 1);
+ break;
+
+ case 'x': case 'X':
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 2, to account for a leading sign or alternate form. */
+ tmp_length = xsum (tmp_length, 2);
+ break;
+
+ case 'f': case 'F':
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ else
+ tmp_length =
+ (unsigned int) (DBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'e': case 'E': case 'g': case 'G':
+ tmp_length =
+ 12; /* sign, decimal point, exponent etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'a': case 'A':
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_DIG
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (DBL_DIG
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+ break;
+
+ case 'c':
+# if HAVE_WINT_T && !WIDE_CHAR_VERSION
+ if (type == TYPE_WIDE_CHAR)
+ {
+ tmp_length = MB_CUR_MAX;
+# if ENABLE_WCHAR_FALLBACK
+ if (tmp_length < (sizeof (wchar_t) > 2 ? 10 : 6))
+ tmp_length = (sizeof (wchar_t) > 2 ? 10 : 6);
+# endif
+ }
+ else
+# endif
+ tmp_length = 1;
+ break;
+
+ case 's':
+# if HAVE_WCHAR_T
+ if (type == TYPE_WIDE_STRING)
+ {
+# if WIDE_CHAR_VERSION
+ /* ISO C says about %ls in fwprintf:
+ "If the precision is not specified or is greater than the size
+ of the array, the array shall contain a null wide character."
+ So if there is a precision, we must not use wcslen. */
+ const wchar_t *arg = ap->arg[arg_index].a.a_wide_string;
+
+ if (has_precision)
+ tmp_length = local_wcsnlen (arg, precision);
+ else
+ tmp_length = local_wcslen (arg);
+# else
+ /* ISO C says about %ls in fprintf:
+ "If a precision is specified, no more than that many bytes are
+ written (including shift sequences, if any), and the array
+ shall contain a null wide character if, to equal the multibyte
+ character sequence length given by the precision, the function
+ would need to access a wide character one past the end of the
+ array."
+ So if there is a precision, we must not use wcslen. */
+ /* This case has already been handled separately in VASNPRINTF. */
+ abort ();
+# endif
+ }
+ else
+# endif
+ {
+# if WIDE_CHAR_VERSION
+ /* ISO C says about %s in fwprintf:
+ "If the precision is not specified or is greater than the size
+ of the converted array, the converted array shall contain a
+ null wide character."
+ So if there is a precision, we must not use strlen. */
+ /* This case has already been handled separately in VASNPRINTF. */
+ abort ();
+# else
+ /* ISO C says about %s in fprintf:
+ "If the precision is not specified or greater than the size of
+ the array, the array shall contain a null character."
+ So if there is a precision, we must not use strlen. */
+ const char *arg = ap->arg[arg_index].a.a_string;
+
+ if (has_precision)
+ tmp_length = local_strnlen (arg, precision);
+ else
+ tmp_length = strlen (arg);
+# endif
+ }
+ break;
+
+ case 'p':
+ tmp_length =
+ (unsigned int) (sizeof (void *) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading 0x */
+ break;
+
+ default:
+ abort ();
+ }
+
+ if (!pad_ourselves)
+ {
+# if ENABLE_UNISTDIO
+ /* Padding considers the number of characters, therefore the number of
+ elements after padding may be
+ > max (tmp_length, width)
+ but is certainly
+ <= tmp_length + width. */
+ tmp_length = xsum (tmp_length, width);
+# else
+ /* Padding considers the number of elements, says POSIX. */
+ if (tmp_length < width)
+ tmp_length = width;
+# endif
+ }
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ return tmp_length;
+}
+
+#endif
+
+DCHAR_T *
+VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ const FCHAR_T *format, va_list args)
+{
+ DIRECTIVES d;
+ arguments a;
+
+ if (PRINTF_PARSE (format, &d, &a) < 0)
+ /* errno is already set. */
+ return NULL;
+
+ /* Frees the memory allocated by this function. Preserves errno. */
+#define CLEANUP() \
+ if (d.dir != d.direct_alloc_dir) \
+ free (d.dir); \
+ if (a.arg != a.direct_alloc_arg) \
+ free (a.arg);
+
+ if (PRINTF_FETCHARGS (args, &a) < 0)
+ goto fail_1_with_EINVAL;
+
+ {
+ size_t buf_neededlength;
+ TCHAR_T *buf;
+ TCHAR_T *buf_malloced;
+ const FCHAR_T *cp;
+ size_t i;
+ DIRECTIVE *dp;
+ /* Output string accumulator. */
+ DCHAR_T *result;
+ size_t allocated;
+ size_t length;
+
+ /* Allocate a small buffer that will hold a directive passed to
+ sprintf or snprintf. */
+ buf_neededlength =
+ xsum4 (7, d.max_width_length, d.max_precision_length, 6);
+#if HAVE_ALLOCA
+ if (buf_neededlength < 4000 / sizeof (TCHAR_T))
+ {
+ buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
+ buf_malloced = NULL;
+ }
+ else
+#endif
+ {
+ size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
+ if (size_overflow_p (buf_memsize))
+ goto out_of_memory_1;
+ buf = (TCHAR_T *) malloc (buf_memsize);
+ if (buf == NULL)
+ goto out_of_memory_1;
+ buf_malloced = buf;
+ }
+
+ result = resultbuf;
+ allocated = (resultbuf != NULL ? *lengthp : 0);
+ length = 0;
+ /* Invariants:
+ result is either == resultbuf or malloc-allocated.
+ If result == NULL, resultbuf is == NULL as well.
+ If length > 0, then result != NULL. */
+
+ /* Ensures that allocated >= needed. Aborts through a jump to
+ out_of_memory if needed is SIZE_MAX or otherwise too big. */
+#define ENSURE_ALLOCATION_ELSE(needed, oom_statement) \
+ if ((needed) > allocated) \
+ { \
+ size_t memory_size; \
+ DCHAR_T *memory; \
+ \
+ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
+ if ((needed) > allocated) \
+ allocated = (needed); \
+ memory_size = xtimes (allocated, sizeof (DCHAR_T)); \
+ if (size_overflow_p (memory_size)) \
+ oom_statement \
+ if (result == resultbuf) \
+ memory = (DCHAR_T *) malloc (memory_size); \
+ else \
+ memory = (DCHAR_T *) realloc (result, memory_size); \
+ if (memory == NULL) \
+ oom_statement \
+ if (result == resultbuf && length > 0) \
+ DCHAR_CPY (memory, result, length); \
+ result = memory; \
+ }
+#define ENSURE_ALLOCATION(needed) \
+ ENSURE_ALLOCATION_ELSE((needed), goto out_of_memory; )
+
+ for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
+ {
+ if (cp != dp->dir_start)
+ {
+ size_t n = dp->dir_start - cp;
+ size_t augmented_length = xsum (length, n);
+
+ ENSURE_ALLOCATION (augmented_length);
+ /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we
+ need that the format string contains only ASCII characters
+ if FCHAR_T and DCHAR_T are not the same type. */
+ if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
+ {
+ DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
+ length = augmented_length;
+ }
+ else
+ {
+ do
+ result[length++] = *cp++;
+ while (--n > 0);
+ }
+ }
+ if (i == d.count)
+ break;
+
+ /* Execute a single directive. */
+ if (dp->conversion == '%')
+ {
+ size_t augmented_length;
+
+ if (!(dp->arg_index == ARG_NONE))
+ abort ();
+ augmented_length = xsum (length, 1);
+ ENSURE_ALLOCATION (augmented_length);
+ result[length] = '%';
+ length = augmented_length;
+ }
+ else
+ {
+ if (!(dp->arg_index != ARG_NONE))
+ abort ();
+
+ if (dp->conversion == 'n')
+ {
+ switch (a.arg[dp->arg_index].type)
+ {
+ case TYPE_COUNT_SCHAR_POINTER:
+ *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+ break;
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+ break;
+ default:
+ abort ();
+ }
+ }
+#if ENABLE_UNISTDIO
+ /* The unistdio extensions. */
+ else if (dp->conversion == 'U')
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ switch (type)
+ {
+ case TYPE_U8_STRING:
+ {
+ const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
+ const uint8_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u8_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u8_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u8_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_UINT8_T
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
+# else
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
+# if DCHAR_IS_TCHAR
+ /* Convert from UTF-8 to locale encoding. */
+ converted =
+ u8_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
+# else
+ /* Convert from UTF-8 to UTF-16/UTF-32. */
+ converted =
+ U8_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
+# endif
+ if (converted == NULL)
+ goto fail_with_errno;
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
+ { free (converted); goto out_of_memory; });
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
+# endif
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ case TYPE_U16_STRING:
+ {
+ const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
+ const uint16_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u16_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u16_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u16_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_UINT16_T
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
+# else
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
+# if DCHAR_IS_TCHAR
+ /* Convert from UTF-16 to locale encoding. */
+ converted =
+ u16_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
+# else
+ /* Convert from UTF-16 to UTF-8/UTF-32. */
+ converted =
+ U16_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
+# endif
+ if (converted == NULL)
+ goto fail_with_errno;
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
+ { free (converted); goto out_of_memory; });
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
+# endif
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ case TYPE_U32_STRING:
+ {
+ const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
+ const uint32_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u32_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u32_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u32_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_UINT32_T
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
+# else
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
+# if DCHAR_IS_TCHAR
+ /* Convert from UTF-32 to locale encoding. */
+ converted =
+ u32_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
+# else
+ /* Convert from UTF-32 to UTF-8/UTF-16. */
+ converted =
+ U32_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
+# endif
+ if (converted == NULL)
+ goto fail_with_errno;
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
+ { free (converted); goto out_of_memory; });
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
+# endif
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
+#endif
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T
+ else if (dp->conversion == 's'
+# if WIDE_CHAR_VERSION
+ && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
+# else
+ && a.arg[dp->arg_index].type == TYPE_WIDE_STRING
+# endif
+ )
+ {
+ /* The normal handling of the 's' directive below requires
+ allocating a temporary buffer. The determination of its
+ length (tmp_length), in the case when a precision is
+ specified, below requires a conversion between a char[]
+ string and a wchar_t[] wide string. It could be done, but
+ we have no guarantee that the implementation of sprintf will
+ use the exactly same algorithm. Without this guarantee, it
+ is possible to have buffer overrun bugs. In order to avoid
+ such bugs, we implement the entire processing of the 's'
+ directive ourselves. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+# if WIDE_CHAR_VERSION
+ /* %s in vasnwprintf. See the specification of fwprintf. */
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ const char *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only as many bytes as needed to produce PRECISION
+ wide characters, from the left. */
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrlen (arg_end, MB_CUR_MAX, &state);
+# else
+ count = mblen (arg_end, MB_CUR_MAX);
+# endif
+ if (count == 0)
+ /* Found the terminating NUL. */
+ break;
+ if (count < 0)
+ /* Invalid or incomplete multibyte character. */
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of wide
+ characters. */
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrlen (arg_end, MB_CUR_MAX, &state);
+# else
+ count = mblen (arg_end, MB_CUR_MAX);
+# endif
+ if (count == 0)
+ /* Found the terminating NUL. */
+ break;
+ if (count < 0)
+ /* Invalid or incomplete multibyte character. */
+ goto fail_with_EILSEQ;
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (characters < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+ if (has_precision || has_width)
+ {
+ /* We know the number of wide characters in advance. */
+ size_t remaining;
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ ENSURE_ALLOCATION (xsum (length, characters));
+ for (remaining = characters; remaining > 0; remaining--)
+ {
+ wchar_t wc;
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrtowc (&wc, arg, arg_end - arg, &state);
+# else
+ count = mbtowc (&wc, arg, arg_end - arg);
+# endif
+ if (count <= 0)
+ /* mbrtowc not consistent with mbrlen, or mbtowc
+ not consistent with mblen. */
+ abort ();
+ result[length++] = wc;
+ arg += count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+ else
+ {
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ while (arg < arg_end)
+ {
+ wchar_t wc;
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrtowc (&wc, arg, arg_end - arg, &state);
+# else
+ count = mbtowc (&wc, arg, arg_end - arg);
+# endif
+ if (count <= 0)
+ /* mbrtowc not consistent with mbrlen, or mbtowc
+ not consistent with mblen. */
+ abort ();
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length++] = wc;
+ arg += count;
+ }
+ }
+
+ if (characters < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+# else
+ /* %ls in vasnprintf. See the specification of fprintf. */
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+ const wchar_t *arg_end;
+ size_t characters;
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ static_assert (sizeof (TCHAR_T) == 1);
+ TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+ if (has_precision)
+ {
+ /* Use only as many wide characters as needed to produce
+ at most PRECISION bytes, from the left. */
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ while (precision > 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg_end == 0)
+ /* Found the terminating null wide character. */
+ break;
+ count = local_wcrtomb (cbuf, *arg_end, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ if (precision < (unsigned int) count)
+ break;
+ arg_end++;
+ characters += count;
+ precision -= count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else if (has_width)
+# else
+ else
+# endif
+ {
+ /* Use the entire string, and count the number of
+ bytes. */
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg_end == 0)
+ /* Found the terminating null wide character. */
+ break;
+ count = local_wcrtomb (cbuf, *arg_end, &state);
+ if (count < 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ arg_end++;
+ characters += count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + local_wcslen (arg);
+ /* The number of bytes doesn't matter. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert the string into a piece of temporary memory. */
+ tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T));
+ if (tmpsrc == NULL)
+ goto out_of_memory;
+ {
+ TCHAR_T *tmpptr = tmpsrc;
+ size_t remaining;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ for (remaining = characters; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpptr, cbuf, count);
+ tmpptr += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, characters,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ {
+ free (tmpsrc);
+ goto fail_with_errno;
+ }
+ free (tmpsrc);
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, characters);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = characters;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ if (w < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ if (has_precision || has_width)
+ {
+ /* We know the number of bytes in advance. */
+ size_t remaining;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ ENSURE_ALLOCATION (xsum (length, characters));
+ for (remaining = characters; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (result + length, cbuf, count);
+ length += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+ else
+ {
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ while (arg < arg_end)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+ count = local_wcrtomb (cbuf, *arg, &state);
+ if (count <= 0)
+ /* Cannot convert. */
+ goto fail_with_EILSEQ;
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
+ arg++;
+ }
+ }
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
+ { free (tmpdst); goto out_of_memory; });
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (w < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+# endif
+ }
+#endif
+#if ENABLE_WCHAR_FALLBACK && HAVE_WINT_T && !WIDE_CHAR_VERSION
+ else if (dp->conversion == 'c'
+ && a.arg[dp->arg_index].type == TYPE_WIDE_CHAR)
+ {
+ /* Implement the 'lc' directive ourselves, in order to provide
+ the fallback that avoids EILSEQ. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ /* %lc in vasnprintf. See the specification of fprintf. */
+ {
+ wchar_t arg = (wchar_t) a.arg[dp->arg_index].a.a_wide_char;
+ size_t characters;
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ static_assert (sizeof (TCHAR_T) == 1);
+ TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+# if DCHAR_IS_TCHAR
+ if (has_width)
+# endif
+ {
+ /* Count the number of bytes. */
+ characters = 0;
+ if (arg != 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count < 0)
+ /* Inconsistency. */
+ abort ();
+ characters = count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else
+ {
+ /* The number of bytes doesn't matter. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert the string into a piece of temporary memory. */
+ if (characters > 0) /* implies arg != 0 */
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpsrc, cbuf, count);
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, characters,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, characters);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = characters;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ if (w < width && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ if (has_width)
+ {
+ /* We know the number of bytes in advance. */
+ ENSURE_ALLOCATION (xsum (length, characters));
+ if (characters > 0) /* implies arg != 0 */
+ {
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (result + length, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ length += count;
+ }
+ }
+ else
+ {
+ if (arg != 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+ count = local_wcrtomb (cbuf, arg, &state);
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
+ }
+ }
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
+ { free (tmpdst); goto out_of_memory; });
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (w < width && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ }
+#endif
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
+ else if ((dp->conversion == 'a' || dp->conversion == 'A')
+# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
+ && (0
+# if NEED_PRINTF_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_DOUBLE
+# endif
+# if NEED_PRINTF_LONG_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+# endif
+ )
+# endif
+ )
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+ size_t width;
+ int has_precision;
+ size_t precision;
+ size_t tmp_length;
+ size_t count;
+ DCHAR_T tmpbuf[700];
+ DCHAR_T *tmp;
+ DCHAR_T *pad_ptr;
+ DCHAR_T *p;
+
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ /* Allocate a temporary buffer of sufficient size. */
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) ((LDBL_DIG + 1)
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) ((DBL_DIG + 1)
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (DCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+
+ pad_ptr = NULL;
+ p = tmp;
+ if (type == TYPE_LONGDOUBLE)
+ {
+# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+ if (isnanl (arg))
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ if (signbit (arg)) /* arg < 0.0L or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0L && arg + arg == arg)
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+ int exponent;
+ long double mantissa;
+
+ if (arg > 0.0L)
+ mantissa = printf_frexpl (arg, &exponent);
+ else
+ {
+ exponent = 0;
+ mantissa = 0.0L;
+ }
+
+ if (has_precision
+ && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
+ {
+ /* Round the mantissa. */
+ long double tail = mantissa;
+ size_t q;
+
+ for (q = precision; ; q--)
+ {
+ int digit = (int) tail;
+ tail -= digit;
+ if (q == 0)
+ {
+ if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
+ tail = 1 - tail;
+ else
+ tail = - tail;
+ break;
+ }
+ tail *= 16.0L;
+ }
+ if (tail != 0.0L)
+ for (q = precision; q > 0; q--)
+ tail *= 0.0625L;
+ mantissa += tail;
+ }
+
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ {
+ int digit;
+
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = '0' + digit;
+ if ((flags & FLAG_ALT)
+ || mantissa > 0.0L || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ /* This loop terminates because we assume
+ that FLT_RADIX is a power of 2. */
+ while (mantissa > 0.0L)
+ {
+ mantissa *= 16.0L;
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = digit
+ + (digit < 10
+ ? '0'
+ : dp->conversion - 10);
+ if (precision > 0)
+ precision--;
+ }
+ while (precision > 0)
+ {
+ *p++ = '0';
+ precision--;
+ }
+ }
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+
+ END_LONG_DOUBLE_ROUNDING ();
+ }
+# else
+ abort ();
+# endif
+ }
+ else
+ {
+# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
+ double arg = a.arg[dp->arg_index].a.a_double;
+
+ if (isnand (arg))
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+
+ if (signbit (arg)) /* arg < 0.0 or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0 && arg + arg == arg)
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+ int exponent;
+ double mantissa;
+
+ if (arg > 0.0)
+ mantissa = printf_frexp (arg, &exponent);
+ else
+ {
+ exponent = 0;
+ mantissa = 0.0;
+ }
+
+ if (has_precision
+ && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
+ {
+ /* Round the mantissa. */
+ double tail = mantissa;
+ size_t q;
+
+ for (q = precision; ; q--)
+ {
+ int digit = (int) tail;
+ tail -= digit;
+ if (q == 0)
+ {
+ if (digit & 1 ? tail >= 0.5 : tail > 0.5)
+ tail = 1 - tail;
+ else
+ tail = - tail;
+ break;
+ }
+ tail *= 16.0;
+ }
+ if (tail != 0.0)
+ for (q = precision; q > 0; q--)
+ tail *= 0.0625;
+ mantissa += tail;
+ }
+
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ {
+ int digit;
+
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = '0' + digit;
+ if ((flags & FLAG_ALT)
+ || mantissa > 0.0 || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ /* This loop terminates because we assume
+ that FLT_RADIX is a power of 2. */
+ while (mantissa > 0.0)
+ {
+ mantissa *= 16.0;
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = digit
+ + (digit < 10
+ ? '0'
+ : dp->conversion - 10);
+ if (precision > 0)
+ precision--;
+ }
+ while (precision > 0)
+ {
+ *p++ = '0';
+ precision--;
+ }
+ }
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+ }
+# else
+ abort ();
+# endif
+ }
+
+ /* The generated string now extends from tmp to p, with the
+ zero padding insertion point being at pad_ptr. */
+ count = p - tmp;
+
+ if (count < width)
+ {
+ size_t pad = width - count;
+ DCHAR_T *end = p + pad;
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > tmp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+
+ p = end;
+ }
+
+ count = p - tmp;
+
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+
+ /* Make room for the result. */
+ if (count >= allocated - length)
+ {
+ size_t n = xsum (length, count);
+
+ ENSURE_ALLOCATION (n);
+ }
+
+ /* Append the result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+ length += count;
+ }
+#endif
+#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
+ else if ((dp->conversion == 'f' || dp->conversion == 'F'
+ || dp->conversion == 'e' || dp->conversion == 'E'
+ || dp->conversion == 'g' || dp->conversion == 'G'
+ || dp->conversion == 'a' || dp->conversion == 'A')
+ && (0
+# if NEED_PRINTF_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_DOUBLE
+# elif NEED_PRINTF_INFINITE_DOUBLE
+ || (a.arg[dp->arg_index].type == TYPE_DOUBLE
+ /* The systems (mingw) which produce wrong output
+ for Inf, -Inf, and NaN also do so for -0.0.
+ Therefore we treat this case here as well. */
+ && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
+# endif
+# if NEED_PRINTF_LONG_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+# elif NEED_PRINTF_INFINITE_LONG_DOUBLE
+ || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+ /* Some systems produce wrong output for Inf,
+ -Inf, and NaN. Some systems in this category
+ (IRIX 5.3) also do so for -0.0. Therefore we
+ treat this case here as well. */
+ && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
+# endif
+ ))
+ {
+# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE)
+ arg_type type = a.arg[dp->arg_index].type;
+# endif
+ int flags = dp->flags;
+ size_t width;
+ size_t count;
+ int has_precision;
+ size_t precision;
+ size_t tmp_length;
+ DCHAR_T tmpbuf[700];
+ DCHAR_T *tmp;
+ DCHAR_T *pad_ptr;
+ DCHAR_T *p;
+
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ /* POSIX specifies the default precision to be 6 for %f, %F,
+ %e, %E, but not for %g, %G. Implementations appear to use
+ the same default precision also for %g, %G. But for %a, %A,
+ the default precision is 0. */
+ if (!has_precision)
+ if (!(dp->conversion == 'a' || dp->conversion == 'A'))
+ precision = 6;
+
+ /* Allocate a temporary buffer of sufficient size. */
+# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE
+ tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
+# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE
+ tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
+# elif NEED_PRINTF_LONG_DOUBLE
+ tmp_length = LDBL_DIG + 1;
+# elif NEED_PRINTF_DOUBLE
+ tmp_length = DBL_DIG + 1;
+# else
+ tmp_length = 0;
+# endif
+ if (tmp_length < precision)
+ tmp_length = precision;
+# if NEED_PRINTF_LONG_DOUBLE
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ if (type == TYPE_LONGDOUBLE)
+# endif
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ if (!(isnanl (arg) || arg + arg == arg))
+ {
+ /* arg is finite and nonzero. */
+ int exponent = floorlog10l (arg < 0 ? -arg : arg);
+ if (exponent >= 0 && tmp_length < exponent + precision)
+ tmp_length = exponent + precision;
+ }
+ }
+# endif
+# if NEED_PRINTF_DOUBLE
+# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
+ if (type == TYPE_DOUBLE)
+# endif
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ if (!(isnand (arg) || arg + arg == arg))
+ {
+ /* arg is finite and nonzero. */
+ int exponent = floorlog10 (arg < 0 ? -arg : arg);
+ if (exponent >= 0 && tmp_length < exponent + precision)
+ tmp_length = exponent + precision;
+ }
+ }
+# endif
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (DCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+
+ pad_ptr = NULL;
+ p = tmp;
+
+# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ if (type == TYPE_LONGDOUBLE)
+# endif
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+ if (isnanl (arg))
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ if (signbit (arg)) /* arg < 0.0L or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0L && arg + arg == arg)
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+# if NEED_PRINTF_LONG_DOUBLE
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ char *digits;
+ size_t ndigits;
+
+ digits =
+ scale10_round_decimal_long_double (arg, precision);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits > precision)
+ do
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ while (ndigits > precision);
+ else
+ *p++ = '0';
+ /* Here ndigits <= precision. */
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > ndigits; precision--)
+ *p++ = '0';
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ int exponent;
+
+ if (arg == 0.0L)
+ {
+ exponent = 0;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else
+ {
+ /* arg > 0.0L. */
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+
+ exponent = floorlog10l (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_long_double (arg,
+ (int)precision - exponent);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits == precision + 1)
+ break;
+ if (ndigits < precision
+ || ndigits > precision + 2)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits == precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision+1. */
+ if (is_borderline (digits, precision))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_long_double (arg,
+ (int)precision - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision + 1)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision+1. */
+
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+
+ *p++ = dp->conversion; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', '.', '2', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+.2d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+.2d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ if (precision == 0)
+ precision = 1;
+ /* precision >= 1. */
+
+ if (arg == 0.0L)
+ /* The exponent is 0, >= -4, < precision.
+ Use fixed-point notation. */
+ {
+ size_t ndigits = precision;
+ /* Number of trailing zeroes that have to be
+ dropped. */
+ size_t nzeroes =
+ (flags & FLAG_ALT ? 0 : precision - 1);
+
+ --ndigits;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = '0';
+ }
+ }
+ }
+ else
+ {
+ /* arg > 0.0L. */
+ int exponent;
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+ size_t nzeroes;
+
+ exponent = floorlog10l (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_long_double (arg,
+ (int)(precision - 1) - exponent);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits == precision)
+ break;
+ if (ndigits < precision - 1
+ || ndigits > precision + 1)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits < precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision. */
+ if (is_borderline (digits, precision - 1))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_long_double (arg,
+ (int)(precision - 1) - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision. */
+
+ /* Determine the number of trailing zeroes
+ that have to be dropped. */
+ nzeroes = 0;
+ if ((flags & FLAG_ALT) == 0)
+ while (nzeroes < ndigits
+ && digits[nzeroes] == '0')
+ nzeroes++;
+
+ /* The exponent is now determined. */
+ if (exponent >= -4
+ && exponent < (long)precision)
+ {
+ /* Fixed-point notation:
+ max(exponent,0)+1 digits, then the
+ decimal point, then the remaining
+ digits without trailing zeroes. */
+ if (exponent >= 0)
+ {
+ size_t ecount = exponent + 1;
+ /* Note: count <= precision = ndigits. */
+ for (; ecount > 0; ecount--)
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ size_t ecount = -exponent - 1;
+ *p++ = '0';
+ *p++ = decimal_point_char ();
+ for (; ecount > 0; ecount--)
+ *p++ = '0';
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ /* Exponential notation. */
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', '.', '2', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+.2d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+.2d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+# endif
+ }
+
+ free (digits);
+ }
+ }
+ else
+ abort ();
+# else
+ /* arg is finite. */
+ if (!(arg == 0.0L))
+ abort ();
+
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion; /* 'e' or 'E' */
+ *p++ = '+';
+ *p++ = '0';
+ *p++ = '0';
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ *p++ = '0';
+ if (flags & FLAG_ALT)
+ {
+ size_t ndigits =
+ (precision > 0 ? precision - 1 : 0);
+ *p++ = decimal_point_char ();
+ for (; ndigits > 0; --ndigits)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'a' || dp->conversion == 'A')
+ {
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+ *p++ = '+';
+ *p++ = '0';
+ }
+ else
+ abort ();
+# endif
+ }
+
+ END_LONG_DOUBLE_ROUNDING ();
+ }
+ }
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ else
+# endif
+# endif
+# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+
+ if (isnand (arg))
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+
+ if (signbit (arg)) /* arg < 0.0 or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0 && arg + arg == arg)
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+# if NEED_PRINTF_DOUBLE
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ char *digits;
+ size_t ndigits;
+
+ digits =
+ scale10_round_decimal_double (arg, precision);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits > precision)
+ do
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ while (ndigits > precision);
+ else
+ *p++ = '0';
+ /* Here ndigits <= precision. */
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > ndigits; precision--)
+ *p++ = '0';
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ int exponent;
+
+ if (arg == 0.0)
+ {
+ exponent = 0;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else
+ {
+ /* arg > 0.0. */
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+
+ exponent = floorlog10 (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_double (arg,
+ (int)precision - exponent);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits == precision + 1)
+ break;
+ if (ndigits < precision
+ || ndigits > precision + 2)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits == precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision+1. */
+ if (is_borderline (digits, precision))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_double (arg,
+ (int)precision - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision + 1)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision+1. */
+
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+
+ *p++ = dp->conversion; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ { '%', '+', '.', '3', 'd', '\0' };
+# else
+ { '%', '+', '.', '2', 'd', '\0' };
+# endif
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ {
+ static const char decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ "%+.3d";
+# else
+ "%+.2d";
+# endif
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, decimal_format, exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, decimal_format, exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+ }
+# endif
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ if (precision == 0)
+ precision = 1;
+ /* precision >= 1. */
+
+ if (arg == 0.0)
+ /* The exponent is 0, >= -4, < precision.
+ Use fixed-point notation. */
+ {
+ size_t ndigits = precision;
+ /* Number of trailing zeroes that have to be
+ dropped. */
+ size_t nzeroes =
+ (flags & FLAG_ALT ? 0 : precision - 1);
+
+ --ndigits;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = '0';
+ }
+ }
+ }
+ else
+ {
+ /* arg > 0.0. */
+ int exponent;
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+ size_t nzeroes;
+
+ exponent = floorlog10 (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_double (arg,
+ (int)(precision - 1) - exponent);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits == precision)
+ break;
+ if (ndigits < precision - 1
+ || ndigits > precision + 1)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits < precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision. */
+ if (is_borderline (digits, precision - 1))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_double (arg,
+ (int)(precision - 1) - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision. */
+
+ /* Determine the number of trailing zeroes
+ that have to be dropped. */
+ nzeroes = 0;
+ if ((flags & FLAG_ALT) == 0)
+ while (nzeroes < ndigits
+ && digits[nzeroes] == '0')
+ nzeroes++;
+
+ /* The exponent is now determined. */
+ if (exponent >= -4
+ && exponent < (long)precision)
+ {
+ /* Fixed-point notation:
+ max(exponent,0)+1 digits, then the
+ decimal point, then the remaining
+ digits without trailing zeroes. */
+ if (exponent >= 0)
+ {
+ size_t ecount = exponent + 1;
+ /* Note: ecount <= precision = ndigits. */
+ for (; ecount > 0; ecount--)
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ size_t ecount = -exponent - 1;
+ *p++ = '0';
+ *p++ = decimal_point_char ();
+ for (; ecount > 0; ecount--)
+ *p++ = '0';
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ /* Exponential notation. */
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+# if WIDE_CHAR_VERSION
+ {
+ static const wchar_t decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ { '%', '+', '.', '3', 'd', '\0' };
+# else
+ { '%', '+', '.', '2', 'd', '\0' };
+# endif
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
+# else
+ {
+ static const char decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ "%+.3d";
+# else
+ "%+.2d";
+# endif
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, decimal_format, exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, decimal_format, exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+ }
+# endif
+ }
+
+ free (digits);
+ }
+ }
+ else
+ abort ();
+# else
+ /* arg is finite. */
+ if (!(arg == 0.0))
+ abort ();
+
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion; /* 'e' or 'E' */
+ *p++ = '+';
+ /* Produce the same number of exponent digits as
+ the native printf implementation. */
+# if defined _WIN32 && ! defined __CYGWIN__
+ *p++ = '0';
+# endif
+ *p++ = '0';
+ *p++ = '0';
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ *p++ = '0';
+ if (flags & FLAG_ALT)
+ {
+ size_t ndigits =
+ (precision > 0 ? precision - 1 : 0);
+ *p++ = decimal_point_char ();
+ for (; ndigits > 0; --ndigits)
+ *p++ = '0';
+ }
+ }
+ else
+ abort ();
+# endif
+ }
+ }
+ }
+# endif
+
+ /* The generated string now extends from tmp to p, with the
+ zero padding insertion point being at pad_ptr. */
+ count = p - tmp;
+
+ if (count < width)
+ {
+ size_t pad = width - count;
+ DCHAR_T *end = p + pad;
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > tmp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+
+ p = end;
+ }
+
+ count = p - tmp;
+
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+
+ /* Make room for the result. */
+ if (count >= allocated - length)
+ {
+ size_t n = xsum (length, count);
+
+ ENSURE_ALLOCATION (n);
+ }
+
+ /* Append the result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+ length += count;
+ }
+#endif
+ else
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ int has_width;
+#endif
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ size_t width;
+#endif
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
+ int has_precision;
+ size_t precision;
+#endif
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+ int prec_ourselves;
+#else
+# define prec_ourselves 0
+#endif
+#if NEED_PRINTF_FLAG_LEFTADJUST
+# define pad_ourselves 1
+#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ int pad_ourselves;
+#else
+# define pad_ourselves 0
+#endif
+ TCHAR_T *fbp;
+ unsigned int prefix_count;
+ int prefixes[2] IF_LINT (= { 0 });
+ int orig_errno;
+#if !USE_SNPRINTF
+ size_t tmp_length;
+ TCHAR_T tmpbuf[700];
+ TCHAR_T *tmp;
+#endif
+
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_width = 0;
+#endif
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ width = arg;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = -width;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_width = 1;
+#endif
+ }
+#endif
+
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+#endif
+
+ /* Decide whether to handle the precision ourselves. */
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+ switch (dp->conversion)
+ {
+ case 'd': case 'i': case 'u':
+ case 'o':
+ case 'x': case 'X': case 'p':
+ prec_ourselves = has_precision && (precision > 0);
+ break;
+ default:
+ prec_ourselves = 0;
+ break;
+ }
+#endif
+
+ /* Decide whether to perform the padding ourselves. */
+#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
+ switch (dp->conversion)
+ {
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+ /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
+ to perform the padding after this conversion. Functions
+ with unistdio extensions perform the padding based on
+ character count rather than element count. */
+ case 'c': case 's':
+# endif
+# if NEED_PRINTF_FLAG_ZERO
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+# endif
+ pad_ourselves = 1;
+ break;
+ default:
+ pad_ourselves = prec_ourselves;
+ break;
+ }
+#endif
+
+#if !USE_SNPRINTF
+ /* Allocate a temporary buffer of sufficient size for calling
+ sprintf. */
+ tmp_length =
+ MAX_ROOM_NEEDED (&a, dp->arg_index, dp->conversion, type,
+ flags, width, has_precision, precision,
+ pad_ourselves);
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (TCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+#endif
+
+ /* Construct the format string for calling snprintf or
+ sprintf. */
+ fbp = buf;
+ *fbp++ = '%';
+#if NEED_PRINTF_FLAG_GROUPING
+ /* The underlying implementation doesn't support the ' flag.
+ Produce no grouping characters in this case; this is
+ acceptable because the grouping is locale dependent. */
+#else
+ if (flags & FLAG_GROUP)
+ *fbp++ = '\'';
+#endif
+ if (flags & FLAG_LEFT)
+ *fbp++ = '-';
+ if (flags & FLAG_SHOWSIGN)
+ *fbp++ = '+';
+ if (flags & FLAG_SPACE)
+ *fbp++ = ' ';
+ if (flags & FLAG_ALT)
+ *fbp++ = '#';
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+ if (flags & FLAG_LOCALIZED)
+ *fbp++ = 'I';
+#endif
+ if (!pad_ourselves)
+ {
+ if (flags & FLAG_ZERO)
+ *fbp++ = '0';
+ if (dp->width_start != dp->width_end)
+ {
+ size_t n = dp->width_end - dp->width_start;
+ /* The width specification is known to consist only
+ of standard ASCII characters. */
+ if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+ {
+ memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
+ fbp += n;
+ }
+ else
+ {
+ const FCHAR_T *mp = dp->width_start;
+ do
+ *fbp++ = *mp++;
+ while (--n > 0);
+ }
+ }
+ }
+ if (!prec_ourselves)
+ {
+ if (dp->precision_start != dp->precision_end)
+ {
+ size_t n = dp->precision_end - dp->precision_start;
+ /* The precision specification is known to consist only
+ of standard ASCII characters. */
+ if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+ {
+ memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
+ fbp += n;
+ }
+ else
+ {
+ const FCHAR_T *mp = dp->precision_start;
+ do
+ *fbp++ = *mp++;
+ while (--n > 0);
+ }
+ }
+ }
+
+ switch (type)
+ {
+ case TYPE_LONGLONGINT:
+ case TYPE_ULONGLONGINT:
+#if defined _WIN32 && ! defined __CYGWIN__
+ *fbp++ = 'I';
+ *fbp++ = '6';
+ *fbp++ = '4';
+ break;
+#else
+ *fbp++ = 'l';
+#endif
+ FALLTHROUGH;
+ case TYPE_LONGINT:
+ case TYPE_ULONGINT:
+#if HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+#endif
+#if HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+#endif
+ *fbp++ = 'l';
+ break;
+ case TYPE_LONGDOUBLE:
+ *fbp++ = 'L';
+ break;
+ default:
+ break;
+ }
+#if NEED_PRINTF_DIRECTIVE_F
+ if (dp->conversion == 'F')
+ *fbp = 'f';
+ else
+#endif
+ *fbp = dp->conversion;
+#if USE_SNPRINTF
+# if ((HAVE_SNPRINTF_RETVAL_C99 && HAVE_SNPRINTF_TRUNCATION_C99) \
+ || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \
+ && !defined __UCLIBC__) \
+ || (defined __APPLE__ && defined __MACH__) \
+ || defined __ANDROID__ \
+ || (defined _WIN32 && ! defined __CYGWIN__))
+ /* On systems where we know that snprintf's return value
+ conforms to ISO C 99 (HAVE_SNPRINTF_RETVAL_C99) and that
+ snprintf always produces NUL-terminated strings
+ (HAVE_SNPRINTF_TRUNCATION_C99), it is possible to avoid
+ using %n. And it is desirable to do so, because more and
+ more platforms no longer support %n, for "security reasons".
+ In particular, the following platforms:
+ - On glibc2 systems from 2004-10-18 or newer, the use of
+ %n in format strings in writable memory may crash the
+ program (if compiled with _FORTIFY_SOURCE=2).
+ - On Mac OS X 10.13 or newer, the use of %n in format
+ strings in writable memory by default crashes the
+ program.
+ - On Android, starting on 2018-03-07, the use of %n in
+ format strings produces a fatal error (see
+ <https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>).
+ On these platforms, HAVE_SNPRINTF_RETVAL_C99 and
+ HAVE_SNPRINTF_TRUNCATION_C99 are 1. We have listed them
+ explicitly in the condition above, in case of cross-
+ compilation (just to be sure). */
+ /* On native Windows systems (such as mingw), we can avoid using
+ %n because:
+ - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
+ snprintf does not write more than the specified number
+ of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
+ '4', '5', '6' into buf, not '4', '5', '\0'.)
+ - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
+ allows us to recognize the case of an insufficient
+ buffer size: it returns -1 in this case.
+ On native Windows systems (such as mingw) where the OS is
+ Windows Vista, the use of %n in format strings by default
+ crashes the program. See
+ <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
+ So we should avoid %n in this situation. */
+ fbp[1] = '\0';
+# else /* AIX <= 5.1, HP-UX, IRIX, OSF/1, Solaris <= 9, BeOS */
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
+# endif
+#else
+ fbp[1] = '\0';
+#endif
+
+ /* Construct the arguments for calling snprintf or sprintf. */
+ prefix_count = 0;
+ if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
+ }
+ if (!prec_ourselves && dp->precision_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
+ }
+
+#if USE_SNPRINTF
+ /* The SNPRINTF result is appended after result[0..length].
+ The latter is an array of DCHAR_T; SNPRINTF appends an
+ array of TCHAR_T to it. This is possible because
+ sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
+ alignof (TCHAR_T) <= alignof (DCHAR_T). */
+# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T))
+ /* Ensure that maxlen below will be >= 2. Needed on BeOS,
+ where an snprintf() with maxlen==1 acts like sprintf(). */
+ ENSURE_ALLOCATION (xsum (length,
+ (2 + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR));
+ /* Prepare checking whether snprintf returns the count
+ via %n. */
+ *(TCHAR_T *) (result + length) = '\0';
+#endif
+
+ orig_errno = errno;
+
+ for (;;)
+ {
+ int count = -1;
+
+#if USE_SNPRINTF
+ int retcount = 0;
+ size_t maxlen = allocated - length;
+ /* SNPRINTF can fail if its second argument is
+ > INT_MAX. */
+ if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
+ maxlen = INT_MAX / TCHARS_PER_DCHAR;
+ maxlen = maxlen * TCHARS_PER_DCHAR;
+# define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ arg, &count); \
+ break; \
+ case 1: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ prefixes[0], arg, &count); \
+ break; \
+ case 2: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ prefixes[0], prefixes[1], arg, \
+ &count); \
+ break; \
+ default: \
+ abort (); \
+ }
+#else
+# define SNPRINTF_BUF(arg) \
+ switch (prefix_count) \
+ { \
+ case 0: \
+ count = sprintf (tmp, buf, arg); \
+ break; \
+ case 1: \
+ count = sprintf (tmp, buf, prefixes[0], arg); \
+ break; \
+ case 2: \
+ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
+ arg); \
+ break; \
+ default: \
+ abort (); \
+ }
+#endif
+
+ errno = 0;
+ switch (type)
+ {
+ case TYPE_SCHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_schar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UCHAR:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_SHORT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_short;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_USHORT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_int;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGINT:
+ {
+ long int arg = a.arg[dp->arg_index].a.a_longint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGINT:
+ {
+ unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGLONGINT:
+ {
+ long long int arg = a.arg[dp->arg_index].a.a_longlongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGLONGINT:
+ {
+ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_DOUBLE:
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGDOUBLE:
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_CHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#if HAVE_WINT_T
+ case TYPE_WIDE_CHAR:
+ {
+ wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_STRING:
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#if HAVE_WCHAR_T
+ case TYPE_WIDE_STRING:
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+#endif
+ case TYPE_POINTER:
+ {
+ void *arg = a.arg[dp->arg_index].a.a_pointer;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ default:
+ abort ();
+ }
+
+#if USE_SNPRINTF
+ /* Portability: Not all implementations of snprintf()
+ are ISO C 99 compliant. Determine the number of
+ bytes that snprintf() has produced or would have
+ produced. */
+ if (count >= 0)
+ {
+ /* Verify that snprintf() has NUL-terminated its
+ result. */
+ if ((unsigned int) count < maxlen
+ && ((TCHAR_T *) (result + length)) [count] != '\0')
+ abort ();
+ /* Portability hack. */
+ if (retcount > count)
+ count = retcount;
+ }
+ else
+ {
+ /* snprintf() doesn't understand the '%n'
+ directive. */
+ if (fbp[1] != '\0')
+ {
+ /* Don't use the '%n' directive; instead, look
+ at the snprintf() return value. */
+ fbp[1] = '\0';
+ continue;
+ }
+ else
+ {
+ /* Look at the snprintf() return value. */
+ if (retcount < 0)
+ {
+# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
+ /* HP-UX 10.20 snprintf() is doubly deficient:
+ It doesn't understand the '%n' directive,
+ *and* it returns -1 (rather than the length
+ that would have been required) when the
+ buffer is too small.
+ But a failure at this point can also come
+ from other reasons than a too small buffer,
+ such as an invalid wide string argument to
+ the %ls directive, or possibly an invalid
+ floating-point argument. */
+ size_t tmp_length =
+ MAX_ROOM_NEEDED (&a, dp->arg_index,
+ dp->conversion, type, flags,
+ width,
+ has_precision,
+ precision, pad_ourselves);
+
+ if (maxlen < tmp_length)
+ {
+ /* Make more room. But try to do through
+ this reallocation only once. */
+ size_t bigger_need =
+ xsum (length,
+ xsum (tmp_length,
+ TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR);
+ /* And always grow proportionally.
+ (There may be several arguments, each
+ needing a little more room than the
+ previous one.) */
+ size_t bigger_need2 =
+ xsum (xtimes (allocated, 2), 12);
+ if (bigger_need < bigger_need2)
+ bigger_need = bigger_need2;
+ ENSURE_ALLOCATION (bigger_need);
+ continue;
+ }
+# endif
+ }
+ else
+ count = retcount;
+ }
+ }
+#endif
+
+ /* Attempt to handle failure. */
+ if (count < 0)
+ {
+ /* SNPRINTF or sprintf failed. Use the errno that it
+ has set, if any. */
+ if (errno == 0)
+ {
+ if (dp->conversion == 'c' || dp->conversion == 's')
+ errno = EILSEQ;
+ else
+ errno = EINVAL;
+ }
+
+ goto fail_with_errno;
+ }
+
+#if USE_SNPRINTF
+ /* Handle overflow of the allocated buffer.
+ If such an overflow occurs, a C99 compliant snprintf()
+ returns a count >= maxlen. However, a non-compliant
+ snprintf() function returns only count = maxlen - 1. To
+ cover both cases, test whether count >= maxlen - 1. */
+ if ((unsigned int) count + 1 >= maxlen)
+ {
+ /* If maxlen already has attained its allowed maximum,
+ allocating more memory will not increase maxlen.
+ Instead of looping, bail out. */
+ if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
+ goto overflow;
+ else
+ {
+ /* Need at least (count + 1) * sizeof (TCHAR_T)
+ bytes. (The +1 is for the trailing NUL.)
+ But ask for (count + 2) * sizeof (TCHAR_T)
+ bytes, so that in the next round, we likely get
+ maxlen > (unsigned int) count + 1
+ and so we don't get here again.
+ And allocate proportionally, to avoid looping
+ eternally if snprintf() reports a too small
+ count. */
+ size_t n =
+ xmax (xsum (length,
+ ((unsigned int) count + 2
+ + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR),
+ xtimes (allocated, 2));
+
+ ENSURE_ALLOCATION (n);
+ continue;
+ }
+ }
+#endif
+
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+ if (prec_ourselves)
+ {
+ /* Handle the precision. */
+ TCHAR_T *prec_ptr =
+# if USE_SNPRINTF
+ (TCHAR_T *) (result + length);
+# else
+ tmp;
+# endif
+ size_t prefix_count;
+ size_t move;
+
+ prefix_count = 0;
+ /* Put the additional zeroes after the sign. */
+ if (count >= 1
+ && (*prec_ptr == '-' || *prec_ptr == '+'
+ || *prec_ptr == ' '))
+ prefix_count = 1;
+ /* Put the additional zeroes after the 0x prefix if
+ (flags & FLAG_ALT) || (dp->conversion == 'p'). */
+ else if (count >= 2
+ && prec_ptr[0] == '0'
+ && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
+ prefix_count = 2;
+
+ move = count - prefix_count;
+ if (precision > move)
+ {
+ /* Insert zeroes. */
+ size_t insert = precision - move;
+ TCHAR_T *prec_end;
+
+# if USE_SNPRINTF
+ size_t n =
+ xsum (length,
+ (count + insert + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR);
+ length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+ ENSURE_ALLOCATION (n);
+ length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+ prec_ptr = (TCHAR_T *) (result + length);
+# endif
+
+ prec_end = prec_ptr + count;
+ prec_ptr += prefix_count;
+
+ while (prec_end > prec_ptr)
+ {
+ prec_end--;
+ prec_end[insert] = prec_end[0];
+ }
+
+ prec_end += insert;
+ do
+ *--prec_end = '0';
+ while (prec_end > prec_ptr);
+
+ count += insert;
+ }
+ }
+#endif
+
+#if !USE_SNPRINTF
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+#endif
+
+#if !DCHAR_IS_TCHAR
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ if (dp->conversion == 'c' || dp->conversion == 's')
+ {
+ /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
+ TYPE_WIDE_STRING.
+ The result string is not certainly ASCII. */
+ const TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+ /* This code assumes that TCHAR_T is 'char'. */
+ static_assert (sizeof (TCHAR_T) == 1);
+# if USE_SNPRINTF
+ tmpsrc = (TCHAR_T *) (result + length);
+# else
+ tmpsrc = tmp;
+# endif
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, count,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ goto fail_with_errno;
+ ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
+ { free (tmpdst); goto out_of_memory; });
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ count = tmpdst_len;
+ }
+ else
+ {
+ /* The result string is ASCII.
+ Simple 1:1 conversion. */
+# if USE_SNPRINTF
+ /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
+ no-op conversion, in-place on the array starting
+ at (result + length). */
+ if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
+# endif
+ {
+ const TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t n;
+
+# if USE_SNPRINTF
+ if (result == resultbuf)
+ {
+ tmpsrc = (TCHAR_T *) (result + length);
+ /* ENSURE_ALLOCATION will not move tmpsrc
+ (because it's part of resultbuf). */
+ ENSURE_ALLOCATION (xsum (length, count));
+ }
+ else
+ {
+ /* ENSURE_ALLOCATION will move the array
+ (because it uses realloc(). */
+ ENSURE_ALLOCATION (xsum (length, count));
+ tmpsrc = (TCHAR_T *) (result + length);
+ }
+# else
+ tmpsrc = tmp;
+ ENSURE_ALLOCATION (xsum (length, count));
+# endif
+ tmpdst = result + length;
+ /* Copy backwards, because of overlapping. */
+ tmpsrc += count;
+ tmpdst += count;
+ for (n = count; n > 0; n--)
+ *--tmpdst = *--tmpsrc;
+ }
+ }
+#endif
+
+#if DCHAR_IS_TCHAR && !USE_SNPRINTF
+ /* Make room for the result. */
+ if (count > allocated - length)
+ {
+ /* Need at least count elements. But allocate
+ proportionally. */
+ size_t n =
+ xmax (xsum (length, count), xtimes (allocated, 2));
+
+ ENSURE_ALLOCATION (n);
+ }
+#endif
+
+ /* Here count <= allocated - length. */
+
+ /* Perform padding. */
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ if (pad_ourselves && has_width)
+ {
+ size_t w;
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, count);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = count;
+# endif
+ if (w < width)
+ {
+ size_t pad = width - w;
+
+ /* Make room for the result. */
+ if (xsum (count, pad) > allocated - length)
+ {
+ /* Need at least count + pad elements. But
+ allocate proportionally. */
+ size_t n =
+ xmax (xsum3 (length, count, pad),
+ xtimes (allocated, 2));
+
+# if USE_SNPRINTF
+ length += count;
+ ENSURE_ALLOCATION (n);
+ length -= count;
+# else
+ ENSURE_ALLOCATION (n);
+# endif
+ }
+ /* Here count + pad <= allocated - length. */
+
+ {
+# if !DCHAR_IS_TCHAR || USE_SNPRINTF
+ DCHAR_T * const rp = result + length;
+# else
+ DCHAR_T * const rp = tmp;
+# endif
+ DCHAR_T *p = rp + count;
+ DCHAR_T *end = p + pad;
+ DCHAR_T *pad_ptr;
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+ if (dp->conversion == 'c'
+ || dp->conversion == 's')
+ /* No zero-padding for string directives. */
+ pad_ptr = NULL;
+ else
+# endif
+ {
+ pad_ptr = (*rp == '-' ? rp + 1 : rp);
+ /* No zero-padding of "inf" and "nan". */
+ if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
+ || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
+ pad_ptr = NULL;
+ }
+ /* The generated string now extends from rp to p,
+ with the zero padding insertion point being at
+ pad_ptr. */
+
+ count = count + pad; /* = end - rp */
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > rp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ }
+ }
+ }
+#endif
+
+ /* Here still count <= allocated - length. */
+
+#if !DCHAR_IS_TCHAR || USE_SNPRINTF
+ /* The snprintf() result did fit. */
+#else
+ /* Append the sprintf() result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+#endif
+#if !USE_SNPRINTF
+ if (tmp != tmpbuf)
+ free (tmp);
+#endif
+
+#if NEED_PRINTF_DIRECTIVE_F
+ if (dp->conversion == 'F')
+ {
+ /* Convert the %f result to upper case for %F. */
+ DCHAR_T *rp = result + length;
+ size_t rc;
+ for (rc = count; rc > 0; rc--, rp++)
+ if (*rp >= 'a' && *rp <= 'z')
+ *rp = *rp - 'a' + 'A';
+ }
+#endif
+
+ length += count;
+ break;
+ }
+ errno = orig_errno;
+#undef pad_ourselves
+#undef prec_ourselves
+ }
+ }
+ }
+
+ /* Add the final NUL. */
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length] = '\0';
+
+ if (result != resultbuf && length + 1 < allocated)
+ {
+ /* Shrink the allocated memory if possible. */
+ DCHAR_T *memory;
+
+ memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
+ if (memory != NULL)
+ result = memory;
+ }
+
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ *lengthp = length;
+ /* Note that we can produce a big string of a length > INT_MAX. POSIX
+ says that snprintf() fails with errno = EOVERFLOW in this case, but
+ that's only because snprintf() returns an 'int'. This function does
+ not have this limitation. */
+ return result;
+
+#if USE_SNPRINTF
+ overflow:
+ errno = EOVERFLOW;
+ goto fail_with_errno;
+#endif
+
+ out_of_memory:
+ errno = ENOMEM;
+ goto fail_with_errno;
+
+#if ENABLE_UNISTDIO || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T)
+ fail_with_EILSEQ:
+ errno = EILSEQ;
+ goto fail_with_errno;
+#endif
+
+ fail_with_errno:
+ if (result != resultbuf)
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ return NULL;
+ }
+
+ out_of_memory_1:
+ errno = ENOMEM;
+ goto fail_1_with_errno;
+
+ fail_1_with_EINVAL:
+ errno = EINVAL;
+ goto fail_1_with_errno;
+
+ fail_1_with_errno:
+ CLEANUP ();
+ return NULL;
+}
+
+#undef MAX_ROOM_NEEDED
+#undef TCHARS_PER_DCHAR
+#undef SNPRINTF
+#undef USE_SNPRINTF
+#undef DCHAR_SET
+#undef DCHAR_CPY
+#undef PRINTF_PARSE
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef DCHAR_IS_TCHAR
+#undef TCHAR_T
+#undef DCHAR_T
+#undef FCHAR_T
+#undef VASNPRINTF
diff --git a/gl/vasnprintf.h b/gl/vasnprintf.h
new file mode 100644
index 0000000..f69649f
--- /dev/null
+++ b/gl/vasnprintf.h
@@ -0,0 +1,72 @@
+/* vsprintf with automatic memory allocation.
+ Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _VASNPRINTF_H
+#define _VASNPRINTF_H
+
+/* Get va_list. */
+#include <stdarg.h>
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Write formatted output to a string dynamically allocated with malloc().
+ You can pass a preallocated buffer for the result in RESULTBUF and its
+ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
+ If successful, return the address of the string (this may be = RESULTBUF
+ if no dynamic memory allocation was necessary) and set *LENGTHP to the
+ number of resulting bytes, excluding the trailing NUL. Upon error, set
+ errno and return NULL.
+
+ When dynamic memory allocation occurs, the preallocated buffer is left
+ alone (with possibly modified contents). This makes it possible to use
+ a statically allocated or stack-allocated buffer, like this:
+
+ char buf[100];
+ size_t len = sizeof (buf);
+ char *output = vasnprintf (buf, &len, format, args);
+ if (output == NULL)
+ ... error handling ...;
+ else
+ {
+ ... use the output string ...;
+ if (output != buf)
+ free (output);
+ }
+ */
+#if REPLACE_VASNPRINTF
+# define asnprintf rpl_asnprintf
+# define vasnprintf rpl_vasnprintf
+#endif
+extern char * asnprintf (char *restrict resultbuf, size_t *lengthp,
+ const char *format, ...)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));
+extern char * vasnprintf (char *restrict resultbuf, size_t *lengthp,
+ const char *format, va_list args)
+ _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VASNPRINTF_H */
diff --git a/gl/vasprintf.c b/gl/vasprintf.c
new file mode 100644
index 0000000..d2878cd
--- /dev/null
+++ b/gl/vasprintf.c
@@ -0,0 +1,50 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#ifdef IN_LIBASPRINTF
+# include "vasprintf.h"
+#else
+# include <stdio.h>
+#endif
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "vasnprintf.h"
+
+int
+vasprintf (char **resultp, const char *format, va_list args)
+{
+ size_t length;
+ char *result = vasnprintf (NULL, &length, format, args);
+ if (result == NULL)
+ return -1;
+
+ if (length > INT_MAX)
+ {
+ free (result);
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+ *resultp = result;
+ /* Return the number of resulting bytes, excluding the trailing NUL. */
+ return length;
+}
diff --git a/gl/verify.h b/gl/verify.h
new file mode 100644
index 0000000..b63cb26
--- /dev/null
+++ b/gl/verify.h
@@ -0,0 +1,350 @@
+/* Compile-time assert-like macros.
+
+ Copyright (C) 2005-2006, 2009-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
+
+#ifndef _GL_VERIFY_H
+#define _GL_VERIFY_H
+
+
+/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC)
+ works as per C11. This is supported by GCC 4.6.0+ and by clang 4+.
+
+ Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as
+ per C23. This is supported by GCC 9.1+.
+
+ Support compilers claiming conformance to the relevant standard,
+ and also support GCC when not pedantic. If we were willing to slow
+ 'configure' down we could also use it with other compilers, but
+ since this affects only the quality of diagnostics, why bother? */
+#ifndef __cplusplus
+# if (201112 <= __STDC_VERSION__ \
+ || (!defined __STRICT_ANSI__ \
+ && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__)))
+# define _GL_HAVE__STATIC_ASSERT 1
+# endif
+# if (202311 <= __STDC_VERSION__ \
+ || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
+# define _GL_HAVE__STATIC_ASSERT1 1
+# endif
+#endif
+
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
+ system headers, defines a conflicting _Static_assert that is no
+ better than ours; override it. */
+#ifndef _GL_HAVE__STATIC_ASSERT
+# include <stddef.h>
+# undef _Static_assert
+#endif
+
+/* Each of these macros verifies that its argument R is nonzero. To
+ be portable, R should be an integer constant expression. Unlike
+ assert (R), there is no run-time overhead.
+
+ If _Static_assert works, verify (R) uses it directly. Similarly,
+ _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct
+ that is an operand of sizeof.
+
+ The code below uses several ideas for C++ compilers, and for C
+ compilers that do not support _Static_assert:
+
+ * The first step is ((R) ? 1 : -1). Given an expression R, of
+ integral or boolean or floating-point type, this yields an
+ expression of integral type, whose value is later verified to be
+ constant and nonnegative.
+
+ * Next this expression W is wrapped in a type
+ struct _gl_verify_type {
+ unsigned int _gl_verify_error_if_negative: W;
+ }.
+ If W is negative, this yields a compile-time error. No compiler can
+ deal with a bit-field of negative size.
+
+ One might think that an array size check would have the same
+ effect, that is, that the type struct { unsigned int dummy[W]; }
+ would work as well. However, inside a function, some compilers
+ (such as C++ compilers and GNU C) allow local parameters and
+ variables inside array size expressions. With these compilers,
+ an array size check would not properly diagnose this misuse of
+ the verify macro:
+
+ void function (int n) { verify (n < 0); }
+
+ * For the verify macro, the struct _gl_verify_type will need to
+ somehow be embedded into a declaration. To be portable, this
+ declaration must declare an object, a constant, a function, or a
+ typedef name. If the declared entity uses the type directly,
+ such as in
+
+ struct dummy {...};
+ typedef struct {...} dummy;
+ extern struct {...} *dummy;
+ extern void dummy (struct {...} *);
+ extern struct {...} *dummy (void);
+
+ two uses of the verify macro would yield colliding declarations
+ if the entity names are not disambiguated. A workaround is to
+ attach the current line number to the entity name:
+
+ #define _GL_CONCAT0(x, y) x##y
+ #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+ extern struct {...} * _GL_CONCAT (dummy, __LINE__);
+
+ But this has the problem that two invocations of verify from
+ within the same macro would collide, since the __LINE__ value
+ would be the same for both invocations. (The GCC __COUNTER__
+ macro solves this problem, but is not portable.)
+
+ A solution is to use the sizeof operator. It yields a number,
+ getting rid of the identity of the type. Declarations like
+
+ extern int dummy [sizeof (struct {...})];
+ extern void dummy (int [sizeof (struct {...})]);
+ extern int (*dummy (void)) [sizeof (struct {...})];
+
+ can be repeated.
+
+ * Should the implementation use a named struct or an unnamed struct?
+ Which of the following alternatives can be used?
+
+ extern int dummy [sizeof (struct {...})];
+ extern int dummy [sizeof (struct _gl_verify_type {...})];
+ extern void dummy (int [sizeof (struct {...})]);
+ extern void dummy (int [sizeof (struct _gl_verify_type {...})]);
+ extern int (*dummy (void)) [sizeof (struct {...})];
+ extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})];
+
+ In the second and sixth case, the struct type is exported to the
+ outer scope; two such declarations therefore collide. GCC warns
+ about the first, third, and fourth cases. So the only remaining
+ possibility is the fifth case:
+
+ extern int (*dummy (void)) [sizeof (struct {...})];
+
+ * GCC warns about duplicate declarations of the dummy function if
+ -Wredundant-decls is used. GCC 4.3 and later have a builtin
+ __COUNTER__ macro that can let us generate unique identifiers for
+ each dummy function, to suppress this warning.
+
+ * This implementation exploits the fact that older versions of GCC,
+ which do not support _Static_assert, also do not warn about the
+ last declaration mentioned above.
+
+ * GCC warns if -Wnested-externs is enabled and 'verify' is used
+ within a function body; but inside a function, you can always
+ arrange to use verify_expr instead.
+
+ * In C++, any struct definition inside sizeof is invalid.
+ Use a template type to work around the problem. */
+
+/* Concatenate two preprocessor tokens. */
+#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+#define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+ use it. Use __COUNTER__ if it works, falling back on __LINE__
+ otherwise. __LINE__ isn't perfect, but it's better than a
+ constant. */
+#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+# define _GL_COUNTER __COUNTER__
+#else
+# define _GL_COUNTER __LINE__
+#endif
+
+/* Generate a symbol with the given prefix, making it unique if
+ possible. */
+#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
+
+/* Verify requirement R at compile-time, as an integer constant expression
+ that returns 1. If R is false, fail at compile-time, preferably
+ with a diagnostic that includes the string-literal DIAGNOSTIC. */
+
+#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
+ (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
+
+#ifdef __cplusplus
+# if !GNULIB_defined_struct__gl_verify_type
+template <int w>
+ struct _gl_verify_type {
+ unsigned int _gl_verify_error_if_negative: w;
+ };
+# define GNULIB_defined_struct__gl_verify_type 1
+# endif
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+ _gl_verify_type<(R) ? 1 : -1>
+#elif defined _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+ struct { \
+ _Static_assert (R, DIAGNOSTIC); \
+ int _gl_dummy; \
+ }
+#else
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+ struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
+#endif
+
+/* Verify requirement R at compile-time, as a declaration without a
+ trailing ';'. If R is false, fail at compile-time.
+
+ This macro requires three or more arguments but uses at most the first
+ two, so that the _Static_assert macro optionally defined below supports
+ both the C11 two-argument syntax and the C23 one-argument syntax.
+
+ Unfortunately, unlike C11, this implementation must appear as an
+ ordinary declaration, and cannot appear inside struct { ... }. */
+
+#if 202311 <= __STDC_VERSION__ || 200410 <= __cpp_static_assert
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) static_assert (R, DIAGNOSTIC)
+#elif defined _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC)
+#else
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) \
+ extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
+ [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Wnested-externs"
+# endif
+#endif
+
+/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
+#ifdef _GL_STATIC_ASSERT_H
+# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
+# if !defined _MSC_VER || defined __clang__
+# define _Static_assert(...) \
+ _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+# else
+ /* Work around MSVC preprocessor incompatibility with ISO C; see
+ <https://stackoverflow.com/questions/5134523/>. */
+# define _Static_assert(R, ...) \
+ _GL_VERIFY ((R), "static assertion failed", -)
+# endif
+# endif
+# if (!defined static_assert \
+ && __STDC_VERSION__ < 202311 \
+ && (!defined __cplusplus \
+ || (__cpp_static_assert < 201411 \
+ && __GNUG__ < 6 && __clang_major__ < 6)))
+# if defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
+/* MSVC 14 in C++ mode supports the two-arguments static_assert but not
+ the one-argument static_assert, and it does not support _Static_assert.
+ We have to play preprocessor tricks to distinguish the two cases.
+ Since the MSVC preprocessor is not ISO C compliant (see above),.
+ the solution is specific to MSVC. */
+# define _GL_EXPAND(x) x
+# define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
+# define _GL_SA2 static_assert
+# define _GL_SA3 static_assert
+# define _GL_SA_PICK(x1,x2,x3,x4,...) x4
+# define static_assert(...) _GL_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__)
+# else
+# define static_assert _Static_assert /* C11 requires this #define. */
+# endif
+# endif
+#endif
+
+/* @assert.h omit start@ */
+
+#if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_TRAP 0
+#elif 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
+# define _GL_HAS_BUILTIN_TRAP 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
+#else
+# define _GL_HAS_BUILTIN_TRAP 0
+#endif
+
+#if defined __clang_major__ && __clang_major__ < 5
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# define _GL_HAS_BUILTIN_UNREACHABLE 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
+#else
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#endif
+
+/* Each of these macros verifies that its argument R is nonzero. To
+ be portable, R should be an integer constant expression. Unlike
+ assert (R), there is no run-time overhead.
+
+ There are two macros, since no single macro can be used in all
+ contexts in C. verify_expr (R, E) is for scalar contexts, including
+ integer constant expression contexts. verify (R) is for declaration
+ contexts, e.g., the top level. */
+
+/* Verify requirement R at compile-time. Return the value of the
+ expression E. */
+
+#define verify_expr(R, E) \
+ (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
+
+/* Verify requirement R at compile-time, as a declaration without a
+ trailing ';'. verify (R) acts like static_assert (R) except that
+ it is portable to C11/C++14 and earlier, it can issue better
+ diagnostics, and its name is shorter and may be more convenient. */
+
+#ifdef __PGI
+/* PGI barfs if R is long. */
+# define verify(R) _GL_VERIFY (R, "verify (...)", -)
+#else
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")", -)
+#endif
+
+/* Assume that R always holds. Behavior is undefined if R is false,
+ fails to evaluate, or has side effects.
+
+ 'assume (R)' is a directive from the programmer telling the
+ compiler that R is true so the compiler needn't generate code to
+ test R. This is why 'assume' is in verify.h: it's related to
+ static checking (in this case, static checking done by the
+ programmer), not dynamic checking.
+
+ 'assume (R)' can affect compilation of all the code, not just code
+ that happens to be executed after the assume (R) is "executed".
+ For example, if the code mistakenly does 'assert (R); assume (R);'
+ the compiler is entitled to optimize away the 'assert (R)'.
+
+ Although assuming R can help a compiler generate better code or
+ diagnostics, performance can suffer if R uses hard-to-optimize
+ features such as function calls not inlined by the compiler.
+
+ Avoid Clang's __builtin_assume, as it breaks GNU Emacs master
+ as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see
+ <https://bugs.gnu.org/43152#71>. It's not known whether this breakage
+ is a Clang bug or an Emacs bug; play it safe for now. */
+
+#if _GL_HAS_BUILTIN_UNREACHABLE
+# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
+#elif 1200 <= _MSC_VER
+# define assume(R) __assume (R)
+#elif 202311 <= __STDC_VERSION__
+# include <stddef.h>
+# define assume(R) ((R) ? (void) 0 : unreachable ())
+#elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP
+ /* Doing it this way helps various packages when configured with
+ --enable-gcc-warnings, which compiles with -Dlint. It's nicer
+ if 'assume' silences warnings with GCC 3.4 through GCC 4.4.7 (2012). */
+# define assume(R) ((R) ? (void) 0 : __builtin_trap ())
+#else
+ /* Some older tools grok NOTREACHED, e.g., Oracle Studio 12.6 (2017). */
+# define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)
+#endif
+
+/* @assert.h omit end@ */
+
+#endif
diff --git a/gl/vsnprintf.c b/gl/vsnprintf.c
new file mode 100644
index 0000000..acd4e2d
--- /dev/null
+++ b/gl/vsnprintf.c
@@ -0,0 +1,70 @@
+/* Formatted output to strings.
+ Copyright (C) 2004, 2006-2023 Free Software Foundation, Inc.
+ Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include <stdio.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vasnprintf.h"
+
+/* Print formatted output to string STR. Similar to vsprintf, but
+ additional length SIZE limit how much is written into STR. Returns
+ string length of formatted string (which may be larger than SIZE).
+ STR may be NULL, in which case nothing will be written. On error,
+ return a negative value. */
+int
+vsnprintf (char *str, size_t size, const char *format, va_list args)
+{
+ char *output;
+ size_t len;
+ size_t lenbuf = size;
+
+ output = vasnprintf (str, &lenbuf, format, args);
+ len = lenbuf;
+
+ if (!output)
+ return -1;
+
+ if (output != str)
+ {
+ if (size)
+ {
+ size_t pruned_len = (len < size ? len : size - 1);
+ memcpy (str, output, pruned_len);
+ str[pruned_len] = '\0';
+ }
+
+ free (output);
+ }
+
+ if (len > INT_MAX)
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+
+ return len;
+}
diff --git a/gl/w32sock.h b/gl/w32sock.h
new file mode 100644
index 0000000..84e46e3
--- /dev/null
+++ b/gl/w32sock.h
@@ -0,0 +1,140 @@
+/* w32sock.h --- internal auxiliary functions for Windows socket functions
+
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paolo Bonzini */
+
+#include <errno.h>
+
+/* Get O_RDWR and O_BINARY. */
+#include <fcntl.h>
+
+/* Get _open_osfhandle(). */
+#include <io.h>
+
+/* Get _get_osfhandle(). */
+#if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+#else
+# include <io.h>
+#endif
+
+#define FD_TO_SOCKET(fd) ((SOCKET) _get_osfhandle ((fd)))
+#define SOCKET_TO_FD(fh) (_open_osfhandle ((intptr_t) (fh), O_RDWR | O_BINARY))
+
+static inline void
+set_winsock_errno (void)
+{
+ int err = WSAGetLastError ();
+
+ /* Map some WSAE* errors to the runtime library's error codes. */
+ switch (err)
+ {
+ case WSA_INVALID_HANDLE:
+ errno = EBADF;
+ break;
+ case WSA_NOT_ENOUGH_MEMORY:
+ errno = ENOMEM;
+ break;
+ case WSA_INVALID_PARAMETER:
+ errno = EINVAL;
+ break;
+ case WSAENAMETOOLONG:
+ errno = ENAMETOOLONG;
+ break;
+ case WSAENOTEMPTY:
+ errno = ENOTEMPTY;
+ break;
+ case WSAEWOULDBLOCK:
+ errno = EWOULDBLOCK;
+ break;
+ case WSAEINPROGRESS:
+ errno = EINPROGRESS;
+ break;
+ case WSAEALREADY:
+ errno = EALREADY;
+ break;
+ case WSAENOTSOCK:
+ errno = ENOTSOCK;
+ break;
+ case WSAEDESTADDRREQ:
+ errno = EDESTADDRREQ;
+ break;
+ case WSAEMSGSIZE:
+ errno = EMSGSIZE;
+ break;
+ case WSAEPROTOTYPE:
+ errno = EPROTOTYPE;
+ break;
+ case WSAENOPROTOOPT:
+ errno = ENOPROTOOPT;
+ break;
+ case WSAEPROTONOSUPPORT:
+ errno = EPROTONOSUPPORT;
+ break;
+ case WSAEOPNOTSUPP:
+ errno = EOPNOTSUPP;
+ break;
+ case WSAEAFNOSUPPORT:
+ errno = EAFNOSUPPORT;
+ break;
+ case WSAEADDRINUSE:
+ errno = EADDRINUSE;
+ break;
+ case WSAEADDRNOTAVAIL:
+ errno = EADDRNOTAVAIL;
+ break;
+ case WSAENETDOWN:
+ errno = ENETDOWN;
+ break;
+ case WSAENETUNREACH:
+ errno = ENETUNREACH;
+ break;
+ case WSAENETRESET:
+ errno = ENETRESET;
+ break;
+ case WSAECONNABORTED:
+ errno = ECONNABORTED;
+ break;
+ case WSAECONNRESET:
+ errno = ECONNRESET;
+ break;
+ case WSAENOBUFS:
+ errno = ENOBUFS;
+ break;
+ case WSAEISCONN:
+ errno = EISCONN;
+ break;
+ case WSAENOTCONN:
+ errno = ENOTCONN;
+ break;
+ case WSAETIMEDOUT:
+ errno = ETIMEDOUT;
+ break;
+ case WSAECONNREFUSED:
+ errno = ECONNREFUSED;
+ break;
+ case WSAELOOP:
+ errno = ELOOP;
+ break;
+ case WSAEHOSTUNREACH:
+ errno = EHOSTUNREACH;
+ break;
+ default:
+ errno = (err > 10000 && err < 10025) ? err - 10000 : err;
+ break;
+ }
+}
diff --git a/gl/warn-on-use.h b/gl/warn-on-use.h
new file mode 100644
index 0000000..3075603
--- /dev/null
+++ b/gl/warn-on-use.h
@@ -0,0 +1,149 @@
+/* A C macro for emitting warnings if a function is used.
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+ for FUNCTION which will then trigger a compiler warning containing
+ the text of "literal string" anywhere that function is called, if
+ supported by the compiler. If the compiler does not support this
+ feature, the macro expands to an unused extern declaration.
+
+ _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
+ attribute used in _GL_WARN_ON_USE. If the compiler does not support
+ this feature, it expands to empty.
+
+ These macros are useful for marking a function as a potential
+ portability trap, with the intent that "literal string" include
+ instructions on the replacement function that should be used
+ instead.
+ _GL_WARN_ON_USE is for functions with 'extern' linkage.
+ _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
+ linkage.
+
+ However, one of the reasons that a function is a portability trap is
+ if it has the wrong signature. Declaring FUNCTION with a different
+ signature in C is a compilation error, so this macro must use the
+ same type as any existing declaration so that programs that avoid
+ the problematic FUNCTION do not fail to compile merely because they
+ included a header that poisoned the function. But this implies that
+ _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
+ have a declaration. Use of this macro implies that there must not
+ be any other macro hiding the declaration of FUNCTION; but
+ undefining FUNCTION first is part of the poisoning process anyway
+ (although for symbols that are provided only via a macro, the result
+ is a compilation error rather than a warning containing
+ "literal string"). Also note that in C++, it is only safe to use if
+ FUNCTION has no overloads.
+
+ For an example, it is possible to poison 'getline' by:
+ - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+ [getline]) in configure.ac, which potentially defines
+ HAVE_RAW_DECL_GETLINE
+ - adding this code to a header that wraps the system <stdio.h>:
+ #undef getline
+ #if HAVE_RAW_DECL_GETLINE
+ _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+ "not universally present; use the gnulib module getline");
+ #endif
+
+ It is not possible to directly poison global variables. But it is
+ possible to write a wrapper accessor function, and poison that
+ (less common usage, like &environ, will cause a compilation error
+ rather than issue the nice warning, but the end result of informing
+ the developer about their portability problem is still achieved):
+ #if HAVE_RAW_DECL_ENVIRON
+ static char ***
+ rpl_environ (void) { return &environ; }
+ _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+ # undef environ
+ # define environ (*rpl_environ ())
+ #endif
+ or better (avoiding contradictory use of 'static' and 'extern'):
+ #if HAVE_RAW_DECL_ENVIRON
+ static char ***
+ _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
+ rpl_environ (void) { return &environ; }
+ # undef environ
+ # define environ (*rpl_environ ())
+ #endif
+ */
+#ifndef _GL_WARN_ON_USE
+
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
+# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+ __attribute__ ((__warning__ (message)))
+# elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C __typeof__ (function) function \
+ __attribute__ ((__diagnose_if__ (1, message, "warning")))
+# define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+ __attribute__ ((__diagnose_if__ (1, message, "warning")))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C __typeof__ (function) function
+# define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# endif
+#endif
+
+/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
+ is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
+ function is declared with the given prototype, consisting of return type,
+ parameters, and attributes.
+ This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+ not work in this case. */
+#ifndef _GL_WARN_ON_USE_CXX
+# if !defined __cplusplus
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+ _GL_WARN_ON_USE (function, msg)
+# else
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes \
+ __attribute__ ((__warning__ (msg)))
+# elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_clang function parameters_and_attributes \
+ __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes
+# else /* Unsupported. */
+# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
+# endif
+#endif
+
+/* _GL_WARN_EXTERN_C declaration;
+ performs the declaration with C linkage. */
+#ifndef _GL_WARN_EXTERN_C
+# if defined __cplusplus
+# define _GL_WARN_EXTERN_C extern "C"
+# else
+# define _GL_WARN_EXTERN_C extern
+# endif
+#endif
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
new file mode 100644
index 0000000..09c9185
--- /dev/null
+++ b/gl/wchar.in.h
@@ -0,0 +1,1363 @@
+/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
+
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Eric Blake. */
+
+/*
+ * ISO C 99 <wchar.h> for platforms that have issues.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html>
+ *
+ * For now, this just ensures proper prerequisite inclusion order and
+ * the declaration of wcwidth().
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if (((defined __need_mbstate_t || defined __need_wint_t) \
+ && !defined __MINGW32__) \
+ || (defined __hpux \
+ && ((defined _INTTYPES_INCLUDED \
+ && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H) \
+ || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \
+ || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \
+ || defined _GL_ALREADY_INCLUDING_WCHAR_H)
+/* Special invocation convention:
+ - Inside glibc and uClibc header files, but not MinGW.
+ - On HP-UX 11.00 we have a sequence of nested includes
+ <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
+ once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
+ and once directly. In both situations 'wint_t' is not yet defined,
+ therefore we cannot provide the function overrides; instead include only
+ the system's <wchar.h>.
+ - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
+ <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
+ - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
+ the latter includes <wchar.h>. But here, we have no way to detect whether
+ <wctype.h> is completely included or is still being included. */
+
+#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_WCHAR_H
+
+#define _GL_ALREADY_INCLUDING_WCHAR_H
+
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
+/* In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
+ by <stddef.h>.
+ But avoid namespace pollution on glibc systems. */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+#endif
+
+/* Include the original <wchar.h> if it exists.
+ Some builds of uClibc lack it. */
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_WCHAR_H@
+# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
+#endif
+
+#undef _GL_ALREADY_INCLUDING_WCHAR_H
+
+#ifndef _@GUARD_PREFIX@_WCHAR_H
+#define _@GUARD_PREFIX@_WCHAR_H
+
+/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. */
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if __GNUC__ >= 11
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
+ can be freed via 'free'; it can be used only after declaring 'free'. */
+/* Applies to: functions. Cannot be used on inline functions. */
+#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
+#endif
+
+/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
+ allocated memory. */
+/* Applies to: functions. */
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if __GNUC__ >= 3 || defined __clang__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_ARG_NONNULL is copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+
+/* Define wint_t and WEOF. (Also done in wctype.in.h.) */
+#if !@HAVE_WINT_T@ && !defined wint_t
+# define wint_t int
+# ifndef WEOF
+# define WEOF -1
+# endif
+#else
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
+ <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
+ wint_t must be "unchanged by default argument promotions". Override it. */
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# if !GNULIB_defined_wint_t
+# if @HAVE_CRTDEFS_H@
+# include <crtdefs.h>
+# else
+# include <stddef.h>
+# endif
+typedef unsigned int rpl_wint_t;
+# undef wint_t
+# define wint_t rpl_wint_t
+# define GNULIB_defined_wint_t 1
+# endif
+# endif
+# ifndef WEOF
+# define WEOF ((wint_t) -1)
+# endif
+#endif
+
+
+/* Override mbstate_t if it is too small.
+ On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
+ implementing mbrtowc for encodings like UTF-8.
+ On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is
+ large enough and overriding it would cause problems in C++ mode. */
+#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+# if !GNULIB_defined_mbstate_t
+# if !(defined _AIX || defined _MSC_VER)
+typedef int rpl_mbstate_t;
+# undef mbstate_t
+# define mbstate_t rpl_mbstate_t
+# endif
+# define GNULIB_defined_mbstate_t 1
+# endif
+#endif
+
+/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have
+ been included yet. */
+#if @GNULIB_FREE_POSIX@
+# if (@REPLACE_FREE@ && !defined free \
+ && !(defined __cplusplus && defined GNULIB_NAMESPACE))
+/* We can't do '#define free rpl_free' here. */
+_GL_EXTERN_C void rpl_free (void *);
+# undef _GL_ATTRIBUTE_DEALLOC_FREE
+# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
+# else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+# endif
+#else
+# if defined _MSC_VER && !defined free
+_GL_EXTERN_C
+# if defined _DLL
+ __declspec (dllimport)
+# endif
+ void __cdecl free (void *);
+# else
+# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void free (void *) throw ();
+# else
+_GL_EXTERN_C void free (void *);
+# endif
+# endif
+#endif
+
+/* Convert a single-byte character to a wide character. */
+#if @GNULIB_BTOWC@
+# if @REPLACE_BTOWC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef btowc
+# define btowc rpl_btowc
+# endif
+_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
+# else
+# if !@HAVE_BTOWC@
+_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+# endif
+/* Need to cast, because on mingw, the return type is 'unsigned short'. */
+_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (btowc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef btowc
+# if HAVE_RAW_DECL_BTOWC
+_GL_WARN_ON_USE (btowc, "btowc is unportable - "
+ "use gnulib module btowc for portability");
+# endif
+#endif
+
+
+/* Convert a wide character to a single-byte character. */
+#if @GNULIB_WCTOB@
+# if @REPLACE_WCTOB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wctob
+# define wctob rpl_wctob
+# endif
+_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
+# else
+# if !defined wctob && !@HAVE_DECL_WCTOB@
+/* wctob is provided by gnulib, or wctob exists but is not declared. */
+_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctob);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctob
+# if HAVE_RAW_DECL_WCTOB
+_GL_WARN_ON_USE (wctob, "wctob is unportable - "
+ "use gnulib module wctob for portability");
+# endif
+#endif
+
+
+/* Test whether *PS is in the initial state. */
+#if @GNULIB_MBSINIT@
+# if @REPLACE_MBSINIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbsinit
+# define mbsinit rpl_mbsinit
+# endif
+_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
+# else
+# if !@HAVE_MBSINIT@
+_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
+# endif
+_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbsinit);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsinit
+# if HAVE_RAW_DECL_MBSINIT
+_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
+ "use gnulib module mbsinit for portability");
+# endif
+#endif
+
+
+/* Convert a multibyte character to a wide character. */
+#if @GNULIB_MBRTOWC@
+# if @REPLACE_MBRTOWC@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbrtowc
+# define mbrtowc rpl_mbrtowc
+# endif
+_GL_FUNCDECL_RPL (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBRTOWC@
+_GL_FUNCDECL_SYS (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+# endif
+_GL_CXXALIAS_SYS (mbrtowc, size_t,
+ (wchar_t *restrict pwc, const char *restrict s, size_t n,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbrtowc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrtowc
+# if HAVE_RAW_DECL_MBRTOWC
+_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
+ "use gnulib module mbrtowc for portability");
+# endif
+#endif
+
+
+/* Recognize a multibyte character. */
+#if @GNULIB_MBRLEN@
+# if @REPLACE_MBRLEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbrlen
+# define mbrlen rpl_mbrlen
+# endif
+_GL_FUNCDECL_RPL (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBRLEN@
+_GL_FUNCDECL_SYS (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+# endif
+_GL_CXXALIAS_SYS (mbrlen, size_t,
+ (const char *restrict s, size_t n, mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbrlen);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbrlen
+# if HAVE_RAW_DECL_MBRLEN
+_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
+ "use gnulib module mbrlen for portability");
+# endif
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSRTOWCS@
+# if @REPLACE_MBSRTOWCS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbsrtowcs
+# define mbsrtowcs rpl_mbsrtowcs
+# endif
+_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBSRTOWCS@
+_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t len,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (mbsrtowcs);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbsrtowcs
+# if HAVE_RAW_DECL_MBSRTOWCS
+_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
+ "use gnulib module mbsrtowcs for portability");
+# endif
+#endif
+
+
+/* Convert a string to a wide string. */
+#if @GNULIB_MBSNRTOWCS@
+# if @REPLACE_MBSNRTOWCS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mbsnrtowcs
+# define mbsnrtowcs rpl_mbsnrtowcs
+# endif
+_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_MBSNRTOWCS@
+_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
+ (wchar_t *restrict dest,
+ const char **restrict srcp, size_t srclen, size_t len,
+ mbstate_t *restrict ps));
+# endif
+_GL_CXXALIASWARN (mbsnrtowcs);
+#elif defined GNULIB_POSIXCHECK
+# undef mbsnrtowcs
+# if HAVE_RAW_DECL_MBSNRTOWCS
+_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
+ "use gnulib module mbsnrtowcs for portability");
+# endif
+#endif
+
+
+/* Convert a wide character to a multibyte character. */
+#if @GNULIB_WCRTOMB@
+# if @REPLACE_WCRTOMB@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcrtomb
+# define wcrtomb rpl_wcrtomb
+# endif
+_GL_FUNCDECL_RPL (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+# else
+# if !@HAVE_WCRTOMB@
+_GL_FUNCDECL_SYS (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+# endif
+_GL_CXXALIAS_SYS (wcrtomb, size_t,
+ (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcrtomb);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcrtomb
+# if HAVE_RAW_DECL_WCRTOMB
+_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
+ "use gnulib module wcrtomb for portability");
+# endif
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSRTOMBS@
+# if @REPLACE_WCSRTOMBS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsrtombs
+# define wcsrtombs rpl_wcsrtombs
+# endif
+_GL_FUNCDECL_RPL (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_WCSRTOMBS@
+_GL_FUNCDECL_SYS (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (wcsrtombs, size_t,
+ (char *restrict dest, const wchar_t **restrict srcp,
+ size_t len,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsrtombs);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrtombs
+# if HAVE_RAW_DECL_WCSRTOMBS
+_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
+ "use gnulib module wcsrtombs for portability");
+# endif
+#endif
+
+
+/* Convert a wide string to a string. */
+#if @GNULIB_WCSNRTOMBS@
+# if @REPLACE_WCSNRTOMBS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsnrtombs
+# define wcsnrtombs rpl_wcsnrtombs
+# endif
+_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps));
+# else
+# if !@HAVE_WCSNRTOMBS@ || (defined __cplusplus && defined __sun)
+_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
+ (char *restrict dest,
+ const wchar_t **restrict srcp, size_t srclen,
+ size_t len,
+ mbstate_t *restrict ps));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsnrtombs);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnrtombs
+# if HAVE_RAW_DECL_WCSNRTOMBS
+_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
+ "use gnulib module wcsnrtombs for portability");
+# endif
+#endif
+
+
+/* Return the number of screen columns needed for WC. */
+#if @GNULIB_WCWIDTH@
+# if @REPLACE_WCWIDTH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcwidth
+# define wcwidth rpl_wcwidth
+# endif
+_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
+# else
+# if !@HAVE_DECL_WCWIDTH@
+/* wcwidth exists but is not declared. */
+_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcwidth);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcwidth
+# if HAVE_RAW_DECL_WCWIDTH
+_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
+ "use gnulib module wcwidth for portability");
+# endif
+#endif
+
+
+/* Search N wide characters of S for C. */
+#if @GNULIB_WMEMCHR@
+# if !@HAVE_WMEMCHR@
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
+ wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wmemchr,
+ wchar_t *, (const wchar_t *, wchar_t, size_t),
+ const wchar_t *, (const wchar_t *, wchar_t, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
+ (const wchar_t *s, wchar_t c, size_t n));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemchr
+# if HAVE_RAW_DECL_WMEMCHR
+_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
+ "use gnulib module wmemchr for portability");
+# endif
+#endif
+
+
+/* Compare N wide characters of S1 and S2. */
+#if @GNULIB_WMEMCMP@
+# if !@HAVE_WMEMCMP@
+_GL_FUNCDECL_SYS (wmemcmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wmemcmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemcmp);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcmp
+# if HAVE_RAW_DECL_WMEMCMP
+_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
+ "use gnulib module wmemcmp for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST. */
+#if @GNULIB_WMEMCPY@
+# if !@HAVE_WMEMCPY@
+_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemcpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcpy
+# if HAVE_RAW_DECL_WMEMCPY
+_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
+ "use gnulib module wmemcpy for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
+ overlapping memory areas. */
+#if @GNULIB_WMEMMOVE@
+# if !@HAVE_WMEMMOVE@
+_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
+ (wchar_t *dest, const wchar_t *src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemmove);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemmove
+# if HAVE_RAW_DECL_WMEMMOVE
+_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
+ "use gnulib module wmemmove for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST.
+ Return pointer to wide characters after the last written wide character. */
+#if @GNULIB_WMEMPCPY@
+# if !@HAVE_WMEMPCPY@
+_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmempcpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmempcpy
+# if HAVE_RAW_DECL_WMEMPCPY
+_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
+ "use gnulib module wmempcpy for portability");
+# endif
+#endif
+
+
+/* Set N wide characters of S to C. */
+#if @GNULIB_WMEMSET@
+# if !@HAVE_WMEMSET@
+_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmemset);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemset
+# if HAVE_RAW_DECL_WMEMSET
+_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
+ "use gnulib module wmemset for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S. */
+#if @GNULIB_WCSLEN@
+# if !@HAVE_WCSLEN@
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcslen);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcslen
+# if HAVE_RAW_DECL_WCSLEN
+_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
+ "use gnulib module wcslen for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S, but at most MAXLEN. */
+#if @GNULIB_WCSNLEN@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSNLEN@ || (defined __sun && defined __cplusplus)
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+_GL_CXXALIASWARN (wcsnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnlen
+# if HAVE_RAW_DECL_WCSNLEN
+_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
+ "use gnulib module wcsnlen for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST. */
+#if @GNULIB_WCSCPY@
+# if !@HAVE_WCSCPY@
+_GL_FUNCDECL_SYS (wcscpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# endif
+_GL_CXXALIAS_SYS (wcscpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscpy
+# if HAVE_RAW_DECL_WCSCPY
+_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
+ "use gnulib module wcscpy for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
+#if @GNULIB_WCPCPY@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCPCPY@ || (defined __sun && defined __cplusplus)
+_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# endif
+_GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+_GL_CXXALIASWARN (wcpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpcpy
+# if HAVE_RAW_DECL_WCPCPY
+_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
+ "use gnulib module wcpcpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N wide characters of SRC to DEST. */
+#if @GNULIB_WCSNCPY@
+# if !@HAVE_WCSNCPY@
+_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsncpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncpy
+# if HAVE_RAW_DECL_WCSNCPY
+_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
+ "use gnulib module wcsncpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+ the last character written into DEST. */
+#if @GNULIB_WCPNCPY@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCPNCPY@ || (defined __sun && defined __cplusplus)
+_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
+ (wchar_t *restrict dest,
+ const wchar_t *restrict src, size_t n));
+_GL_CXXALIASWARN (wcpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpncpy
+# if HAVE_RAW_DECL_WCPNCPY
+_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
+ "use gnulib module wcpncpy for portability");
+# endif
+#endif
+
+
+/* Append SRC onto DEST. */
+#if @GNULIB_WCSCAT@
+# if !@HAVE_WCSCAT@
+_GL_FUNCDECL_SYS (wcscat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# endif
+_GL_CXXALIAS_SYS (wcscat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscat
+# if HAVE_RAW_DECL_WCSCAT
+_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
+ "use gnulib module wcscat for portability");
+# endif
+#endif
+
+
+/* Append no more than N wide characters of SRC onto DEST. */
+#if @GNULIB_WCSNCAT@
+# if !@HAVE_WCSNCAT@
+_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src,
+ size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
+ (wchar_t *restrict dest, const wchar_t *restrict src,
+ size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsncat);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncat
+# if HAVE_RAW_DECL_WCSNCAT
+_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
+ "use gnulib module wcsncat for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2. */
+#if @GNULIB_WCSCMP@
+# if !@HAVE_WCSCMP@
+_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscmp);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscmp
+# if HAVE_RAW_DECL_WCSCMP
+_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
+ "use gnulib module wcscmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N wide characters of S1 and S2. */
+#if @GNULIB_WCSNCMP@
+# if !@HAVE_WCSNCMP@
+_GL_FUNCDECL_SYS (wcsncmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsncmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsncmp);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncmp
+# if HAVE_RAW_DECL_WCSNCMP
+_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
+ "use gnulib module wcsncmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, ignoring case. */
+#if @GNULIB_WCSCASECMP@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSCASECMP@ || (defined __sun && defined __cplusplus)
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscasecmp
+# if HAVE_RAW_DECL_WCSCASECMP
+_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
+ "use gnulib module wcscasecmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N chars of S1 and S2, ignoring case. */
+#if @GNULIB_WCSNCASECMP@
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSNCASECMP@ || (defined __sun && defined __cplusplus)
+_GL_FUNCDECL_SYS (wcsncasecmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsncasecmp, int,
+ (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncasecmp
+# if HAVE_RAW_DECL_WCSNCASECMP
+_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
+ "use gnulib module wcsncasecmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
+ category of the current locale. */
+#if @GNULIB_WCSCOLL@
+# if !@HAVE_WCSCOLL@
+_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscoll);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscoll
+# if HAVE_RAW_DECL_WCSCOLL
+_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
+ "use gnulib module wcscoll for portability");
+# endif
+#endif
+
+
+/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
+ to two transformed strings the result is the as applying 'wcscoll' to the
+ original strings. */
+#if @GNULIB_WCSXFRM@
+# if !@HAVE_WCSXFRM@
+_GL_FUNCDECL_SYS (wcsxfrm, size_t,
+ (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsxfrm, size_t,
+ (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsxfrm);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsxfrm
+# if HAVE_RAW_DECL_WCSXFRM
+_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
+ "use gnulib module wcsxfrm for portability");
+# endif
+#endif
+
+
+/* Duplicate S, returning an identical malloc'd string. */
+#if @GNULIB_WCSDUP@
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsdup
+# define wcsdup _wcsdup
+# endif
+_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
+# else
+/* On Solaris 11.3, the header files declare the function in the std::
+ namespace, not in the global namespace. So, force a declaration in
+ the global namespace. */
+# if !@HAVE_WCSDUP@ || (defined __sun && defined __cplusplus) || __GNUC__ >= 11
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
+ (const wchar_t *s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+_GL_CXXALIASWARN (wcsdup);
+#else
+# if __GNUC__ >= 11 && !defined wcsdup
+/* For -Wmismatched-dealloc: Associate wcsdup with free or rpl_free. */
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
+ (const wchar_t *s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# endif
+# if defined GNULIB_POSIXCHECK
+# undef wcsdup
+# if HAVE_RAW_DECL_WCSDUP
+_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
+ "use gnulib module wcsdup for portability");
+# endif
+# elif @GNULIB_MDA_WCSDUP@
+/* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not
+ required. In C++ with GNULIB_NAMESPACE, avoid differences between
+ platforms by defining GNULIB_NAMESPACE::wcsdup always. */
+# if defined _WIN32 && !defined __CYGWIN__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsdup
+# define wcsdup _wcsdup
+# endif
+_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
+# else
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *,
+ (const wchar_t *s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
+# if @HAVE_DECL_WCSDUP@
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@
+_GL_CXXALIASWARN (wcsdup);
+# endif
+# endif
+#endif
+
+
+/* Find the first occurrence of WC in WCS. */
+#if @GNULIB_WCSCHR@
+# if !@HAVE_WCSCHR@
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcschr (const wchar_t *, wchar_t);
+ wchar_t * std::wcschr (wchar_t *, wchar_t);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcschr,
+ wchar_t *, (const wchar_t *, wchar_t),
+ const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcschr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcschr
+# if HAVE_RAW_DECL_WCSCHR
+_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
+ "use gnulib module wcschr for portability");
+# endif
+#endif
+
+
+/* Find the last occurrence of WC in WCS. */
+#if @GNULIB_WCSRCHR@
+# if !@HAVE_WCSRCHR@
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
+ wchar_t * std::wcsrchr (wchar_t *, wchar_t);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcsrchr,
+ wchar_t *, (const wchar_t *, wchar_t),
+ const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsrchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrchr
+# if HAVE_RAW_DECL_WCSRCHR
+_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
+ "use gnulib module wcsrchr for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+ of wide characters not in REJECT. */
+#if @GNULIB_WCSCSPN@
+# if !@HAVE_WCSCSPN@
+_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcscspn);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcscspn
+# if HAVE_RAW_DECL_WCSCSPN
+_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
+ "use gnulib module wcscspn for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+ of wide characters in ACCEPT. */
+#if @GNULIB_WCSSPN@
+# if !@HAVE_WCSSPN@
+_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsspn);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsspn
+# if HAVE_RAW_DECL_WCSSPN
+_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
+ "use gnulib module wcsspn for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence in WCS of any character in ACCEPT. */
+#if @GNULIB_WCSPBRK@
+# if !@HAVE_WCSPBRK@
+_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
+ (const wchar_t *wcs, const wchar_t *accept)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
+ wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcspbrk,
+ wchar_t *, (const wchar_t *, const wchar_t *),
+ const wchar_t *, (const wchar_t *, const wchar_t *));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
+ (wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
+ (const wchar_t *wcs, const wchar_t *accept));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcspbrk);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcspbrk
+# if HAVE_RAW_DECL_WCSPBRK
+_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
+ "use gnulib module wcspbrk for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of NEEDLE in HAYSTACK. */
+#if @GNULIB_WCSSTR@
+# if !@HAVE_WCSSTR@
+_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
+ (const wchar_t *restrict haystack,
+ const wchar_t *restrict needle)
+ _GL_ATTRIBUTE_PURE);
+# endif
+ /* On some systems, this function is defined as an overloaded function:
+ extern "C++" {
+ const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
+ wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
+ } */
+_GL_CXXALIAS_SYS_CAST2 (wcsstr,
+ wchar_t *,
+ (const wchar_t *restrict, const wchar_t *restrict),
+ const wchar_t *,
+ (const wchar_t *restrict, const wchar_t *restrict));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
+ (wchar_t *restrict haystack,
+ const wchar_t *restrict needle));
+_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
+ (const wchar_t *restrict haystack,
+ const wchar_t *restrict needle));
+# elif __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsstr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsstr
+# if HAVE_RAW_DECL_WCSSTR
+_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
+ "use gnulib module wcsstr for portability");
+# endif
+#endif
+
+
+/* Divide WCS into tokens separated by characters in DELIM. */
+#if @GNULIB_WCSTOK@
+# if @REPLACE_WCSTOK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcstok
+# define wcstok rpl_wcstok
+# endif
+_GL_FUNCDECL_RPL (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+_GL_CXXALIAS_RPL (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+# else
+# if !@HAVE_WCSTOK@
+_GL_FUNCDECL_SYS (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+# endif
+_GL_CXXALIAS_SYS (wcstok, wchar_t *,
+ (wchar_t *restrict wcs, const wchar_t *restrict delim,
+ wchar_t **restrict ptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcstok);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcstok
+# if HAVE_RAW_DECL_WCSTOK
+_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
+ "use gnulib module wcstok for portability");
+# endif
+#endif
+
+
+/* Determine number of column positions required for first N wide
+ characters (or fewer if S ends before this) in S. */
+#if @GNULIB_WCSWIDTH@
+# if @REPLACE_WCSWIDTH@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcswidth
+# define wcswidth rpl_wcswidth
+# endif
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
+ _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+# else
+# if !@HAVE_WCSWIDTH@
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
+ _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcswidth);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcswidth
+# if HAVE_RAW_DECL_WCSWIDTH
+_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
+ "use gnulib module wcswidth for portability");
+# endif
+#endif
+
+
+/* Convert *TP to a date and time wide string. See
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>. */
+#if @GNULIB_WCSFTIME@
+# if @REPLACE_WCSFTIME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef wcsftime
+# define wcsftime rpl_wcsftime
+# endif
+_GL_FUNCDECL_RPL (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp)
+ _GL_ARG_NONNULL ((1, 3, 4)));
+_GL_CXXALIAS_RPL (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp));
+# else
+# if !@HAVE_WCSFTIME@
+_GL_FUNCDECL_SYS (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp)
+ _GL_ARG_NONNULL ((1, 3, 4)));
+# endif
+_GL_CXXALIAS_SYS (wcsftime, size_t,
+ (wchar_t *restrict __buf, size_t __bufsize,
+ const wchar_t *restrict __fmt,
+ const struct tm *restrict __tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsftime);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsftime
+# if HAVE_RAW_DECL_WCSFTIME
+_GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
+ "use gnulib module wcsftime for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif
diff --git a/gl/wcrtomb.c b/gl/wcrtomb.c
new file mode 100644
index 0000000..48a6c8e
--- /dev/null
+++ b/gl/wcrtomb.c
@@ -0,0 +1,80 @@
+/* Convert wide character to multibyte character.
+ Copyright (C) 2008-2023 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wchar.h>
+
+#include <errno.h>
+#include <stdlib.h>
+
+
+size_t
+wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+#undef wcrtomb
+{
+ /* This implementation of wcrtomb supports only stateless encodings.
+ ps must be in the initial state. */
+ if (ps != NULL && !mbsinit (ps))
+ {
+ errno = EINVAL;
+ return (size_t)(-1);
+ }
+
+#if !HAVE_WCRTOMB /* IRIX 6.5 */ \
+ || WCRTOMB_RETVAL_BUG /* Solaris 11.3, MSVC */ \
+ || WCRTOMB_C_LOCALE_BUG /* Android */
+ if (s == NULL)
+ /* We know the NUL wide character corresponds to the NUL character. */
+ return 1;
+ else
+#endif
+ {
+#if HAVE_WCRTOMB
+# if WCRTOMB_C_LOCALE_BUG /* Android */
+ /* Implement consistently with mbrtowc(): through a 1:1 correspondence,
+ as in ISO-8859-1. */
+ if (wc >= 0 && wc <= 0xff)
+ {
+ *s = (unsigned char) wc;
+ return 1;
+ }
+ else
+ {
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+# else
+ return wcrtomb (s, wc, ps);
+# endif
+#else /* IRIX 6.5 */
+ /* Fallback for platforms that don't have wcrtomb().
+ Implement on top of wctomb().
+ This code is not multithread-safe. */
+ int ret = wctomb (s, wc);
+
+ if (ret >= 0)
+ return ret;
+ else
+ {
+ errno = EILSEQ;
+ return (size_t)(-1);
+ }
+#endif
+ }
+}
diff --git a/gl/wctype-h.c b/gl/wctype-h.c
new file mode 100644
index 0000000..7d3e14a
--- /dev/null
+++ b/gl/wctype-h.c
@@ -0,0 +1,23 @@
+/* Inline functions for <wctype.h>.
+
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Normally this would be wctype.c, but that name's already taken. */
+
+#include <config.h>
+
+#define _GL_WCTYPE_INLINE _GL_EXTERN_INLINE
+#include "wctype.h"
diff --git a/gl/wctype.in.h b/gl/wctype.in.h
new file mode 100644
index 0000000..f6e474d
--- /dev/null
+++ b/gl/wctype.in.h
@@ -0,0 +1,732 @@
+/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
+
+ Copyright (C) 2006-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible and Paul Eggert. */
+
+/*
+ * ISO C 99 <wctype.h> for platforms that lack it.
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html>
+ *
+ * iswctype, towctrans, towlower, towupper, wctrans, wctype,
+ * wctrans_t, and wctype_t are not yet implemented.
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
+
+/* Special invocation convention:
+ - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
+ <wctype.h> is being processed, which doesn't include the idempotency
+ guard. */
+
+#@INCLUDE_NEXT@ @NEXT_WCTYPE_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
+
+#if @HAVE_WINT_T@
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
+# include <wchar.h>
+#endif
+
+/* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and
+ isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>. Include
+ <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
+ declarations. */
+#if defined _WIN32 && ! defined __CYGWIN__
+# include <ctype.h>
+# include <wchar.h>
+#endif
+
+/* Include the original <wctype.h> if it exists.
+ BeOS 5 has the functions but no <wctype.h>. */
+/* The include_next requires a split double-inclusion guard. */
+#if @HAVE_WCTYPE_H@
+# @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
+#define _@GUARD_PREFIX@_WCTYPE_H
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_WCTYPE_INLINE
+# define _GL_WCTYPE_INLINE _GL_INLINE
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
+
+/* The definition of _GL_WARN_ON_USE is copied here. */
+
+/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
+ #defines a number of identifiers in the application namespace. Revert
+ these #defines. */
+#ifdef __sun
+# undef multibyte
+# undef eucw1
+# undef eucw2
+# undef eucw3
+# undef scrw1
+# undef scrw2
+# undef scrw3
+#endif
+
+/* Define wint_t and WEOF. (Also done in wchar.in.h.) */
+#if !@HAVE_WINT_T@ && !defined wint_t
+# define wint_t int
+# ifndef WEOF
+# define WEOF -1
+# endif
+#else
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
+ <stddef.h>. This is too small: ISO C 99 section 7.24.1.(2) says that
+ wint_t must be "unchanged by default argument promotions". Override it. */
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# if !GNULIB_defined_wint_t
+# if @HAVE_CRTDEFS_H@
+# include <crtdefs.h>
+# else
+# include <stddef.h>
+# endif
+typedef unsigned int rpl_wint_t;
+# undef wint_t
+# define wint_t rpl_wint_t
+# define GNULIB_defined_wint_t 1
+# endif
+# endif
+# ifndef WEOF
+# define WEOF ((wint_t) -1)
+# endif
+#endif
+
+
+#if !GNULIB_defined_wctype_functions
+
+/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
+ Linux libc5 has <wctype.h> and the functions but they are broken.
+ mingw and MSVC have <wctype.h> and the functions but they take a wchar_t
+ as argument, not an rpl_wint_t.
+ Assume all 11 functions (all isw* except iswblank) are implemented the
+ same way, or not at all. */
+# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
+
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */
+
+_GL_WCTYPE_INLINE int
+rpl_iswalnum (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswalnum ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswalpha (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswalpha ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswblank (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswblank ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswcntrl (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswcntrl ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswdigit (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? wc >= '0' && wc <= '9' : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswgraph (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswgraph ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswlower (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswlower ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswprint (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswprint ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswpunct (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswpunct ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswspace (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswspace ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswupper (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? iswupper ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswxdigit (wint_t wc)
+{
+ return ((wchar_t) wc == wc
+ ? (wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')
+ : 0);
+}
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towlower (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? (wchar_t) towlower ((wchar_t) wc) : wc);
+}
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towupper (wint_t wc)
+{
+ return ((wchar_t) wc == wc ? (wchar_t) towupper ((wchar_t) wc) : wc);
+}
+
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
+# define iswalnum rpl_iswalnum
+# define iswalpha rpl_iswalpha
+# define iswblank rpl_iswblank
+# define iswcntrl rpl_iswcntrl
+# define iswdigit rpl_iswdigit
+# define iswgraph rpl_iswgraph
+# define iswlower rpl_iswlower
+# define iswprint rpl_iswprint
+# define iswpunct rpl_iswpunct
+# define iswspace rpl_iswspace
+# define iswupper rpl_iswupper
+# define iswxdigit rpl_iswxdigit
+# define towlower rpl_towlower
+# define towupper rpl_towupper
+# endif
+
+# else
+
+/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
+ undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
+ refer to system functions like _iswctype that are not in the
+ standard C library. Rather than try to get ancient buggy
+ implementations like this to work, just disable them. */
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
+
+/* Linux libc5 has <wctype.h> and the functions but they are broken. */
+# if @REPLACE_ISWCNTRL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswalnum rpl_iswalnum
+# define iswalpha rpl_iswalpha
+# define iswblank rpl_iswblank
+# define iswcntrl rpl_iswcntrl
+# define iswdigit rpl_iswdigit
+# define iswgraph rpl_iswgraph
+# define iswlower rpl_iswlower
+# define iswprint rpl_iswprint
+# define iswpunct rpl_iswpunct
+# define iswspace rpl_iswspace
+# define iswupper rpl_iswupper
+# define iswxdigit rpl_iswxdigit
+# endif
+# endif
+# if @REPLACE_TOWLOWER@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towlower rpl_towlower
+# define towupper rpl_towupper
+# endif
+# endif
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswalnum
+# else
+iswalnum
+# endif
+ (wint_t wc)
+{
+ return ((wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswalpha
+# else
+iswalpha
+# endif
+ (wint_t wc)
+{
+ return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswblank
+# else
+iswblank
+# endif
+ (wint_t wc)
+{
+ return wc == ' ' || wc == '\t';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswcntrl
+# else
+iswcntrl
+# endif
+ (wint_t wc)
+{
+ return (wc & ~0x1f) == 0 || wc == 0x7f;
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWDIGIT@
+rpl_iswdigit
+# else
+iswdigit
+# endif
+ (wint_t wc)
+{
+ return wc >= '0' && wc <= '9';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswgraph
+# else
+iswgraph
+# endif
+ (wint_t wc)
+{
+ return wc >= '!' && wc <= '~';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswlower
+# else
+iswlower
+# endif
+ (wint_t wc)
+{
+ return wc >= 'a' && wc <= 'z';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswprint
+# else
+iswprint
+# endif
+ (wint_t wc)
+{
+ return wc >= ' ' && wc <= '~';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswpunct
+# else
+iswpunct
+# endif
+ (wint_t wc)
+{
+ return (wc >= '!' && wc <= '~'
+ && !((wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')));
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswspace
+# else
+iswspace
+# endif
+ (wint_t wc)
+{
+ return (wc == ' ' || wc == '\t'
+ || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWCNTRL@
+rpl_iswupper
+# else
+iswupper
+# endif
+ (wint_t wc)
+{
+ return wc >= 'A' && wc <= 'Z';
+}
+
+_GL_WCTYPE_INLINE int
+# if @REPLACE_ISWXDIGIT@
+rpl_iswxdigit
+# else
+iswxdigit
+# endif
+ (wint_t wc)
+{
+ return ((wc >= '0' && wc <= '9')
+ || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
+}
+
+_GL_WCTYPE_INLINE wint_t
+# if @REPLACE_TOWLOWER@
+rpl_towlower
+# else
+towlower
+# endif
+ (wint_t wc)
+{
+ return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
+}
+
+_GL_WCTYPE_INLINE wint_t
+# if @REPLACE_TOWLOWER@
+rpl_towupper
+# else
+towupper
+# endif
+ (wint_t wc)
+{
+ return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
+}
+
+# endif
+
+# else
+/* Only some of the functions are missing or broken. */
+
+# if @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
+/* Only the iswblank function is missing. */
+# if @REPLACE_ISWBLANK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswblank rpl_iswblank
+# endif
+_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
+# endif
+# endif
+
+# if @GNULIB_ISWDIGIT@
+# if @REPLACE_ISWDIGIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswdigit
+# define iswdigit rpl_iswdigit
+# endif
+_GL_FUNCDECL_RPL (iswdigit, int, (wint_t wc));
+# endif
+# endif
+
+# if @GNULIB_ISWXDIGIT@
+# if @REPLACE_ISWXDIGIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswxdigit
+# define iswxdigit rpl_iswxdigit
+# endif
+_GL_FUNCDECL_RPL (iswxdigit, int, (wint_t wc));
+# endif
+# endif
+
+# endif
+
+# if defined __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@
+
+/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
+ The functions towlower and towupper are implemented in the MSVCRT library
+ to take a wchar_t argument and return a wchar_t result. mingw declares
+ these functions to take a wint_t argument and return a wint_t result.
+ This means that:
+ 1. When the user passes an argument outside the range 0x0000..0xFFFF, the
+ function will look only at the lower 16 bits. This is allowed according
+ to POSIX.
+ 2. The return value is returned in the lower 16 bits of the result register.
+ The upper 16 bits are random: whatever happened to be in that part of the
+ result register. We need to fix this by adding a zero-extend from
+ wchar_t to wint_t after the call. */
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towlower (wint_t wc)
+{
+ return (wint_t) (wchar_t) towlower (wc);
+}
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towlower rpl_towlower
+# endif
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towupper (wint_t wc)
+{
+ return (wint_t) (wchar_t) towupper (wc);
+}
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towupper rpl_towupper
+# endif
+
+# endif /* __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@ */
+
+# define GNULIB_defined_wctype_functions 1
+#endif
+
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
+#endif
+#if @GNULIB_ISWDIGIT@
+# if @REPLACE_ISWDIGIT@
+_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
+# endif
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
+#endif
+#if @GNULIB_ISWXDIGIT@
+# if @REPLACE_ISWXDIGIT@
+_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
+# endif
+#endif
+#if __GLIBC__ >= 2
+_GL_CXXALIASWARN (iswalnum);
+_GL_CXXALIASWARN (iswalpha);
+_GL_CXXALIASWARN (iswcntrl);
+_GL_CXXALIASWARN (iswdigit);
+_GL_CXXALIASWARN (iswgraph);
+_GL_CXXALIASWARN (iswlower);
+_GL_CXXALIASWARN (iswprint);
+_GL_CXXALIASWARN (iswpunct);
+_GL_CXXALIASWARN (iswspace);
+_GL_CXXALIASWARN (iswupper);
+_GL_CXXALIASWARN (iswxdigit);
+#endif
+
+#if @GNULIB_ISWBLANK@
+# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (iswblank);
+# endif
+#endif
+
+#if !@HAVE_WCTYPE_T@
+# if !GNULIB_defined_wctype_t
+typedef void * wctype_t;
+# define GNULIB_defined_wctype_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character property. */
+#if @GNULIB_WCTYPE@
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctype
+# if HAVE_RAW_DECL_WCTYPE
+_GL_WARN_ON_USE (wctype, "wctype is unportable - "
+ "use gnulib module wctype for portability");
+# endif
+#endif
+
+/* Test whether a wide character has a given property.
+ The argument WC must be either a wchar_t value or WEOF.
+ The argument DESC must have been returned by the wctype() function. */
+#if @GNULIB_ISWCTYPE@
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef iswctype
+# define iswctype rpl_iswctype
+# endif
+_GL_FUNCDECL_RPL (iswctype, int, (wint_t wc, wctype_t desc));
+_GL_CXXALIAS_RPL (iswctype, int, (wint_t wc, wctype_t desc));
+# else
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (iswctype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef iswctype
+# if HAVE_RAW_DECL_ISWCTYPE
+_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
+ "use gnulib module iswctype for portability");
+# endif
+#endif
+
+#if @REPLACE_TOWLOWER@ || defined __MINGW32__
+_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
+#endif
+#if __GLIBC__ >= 2
+_GL_CXXALIASWARN (towlower);
+_GL_CXXALIASWARN (towupper);
+#endif
+
+#if !@HAVE_WCTRANS_T@
+# if !GNULIB_defined_wctrans_t
+typedef void * wctrans_t;
+# define GNULIB_defined_wctrans_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character case conversion. */
+#if @GNULIB_WCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wctrans);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wctrans
+# if HAVE_RAW_DECL_WCTRANS
+_GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
+ "use gnulib module wctrans for portability");
+# endif
+#endif
+
+/* Perform a given case conversion on a wide character.
+ The argument WC must be either a wchar_t value or WEOF.
+ The argument DESC must have been returned by the wctrans() function. */
+#if @GNULIB_TOWCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+# endif
+_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (towctrans);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef towctrans
+# if HAVE_RAW_DECL_TOWCTRANS
+_GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
+ "use gnulib module towctrans for portability");
+# endif
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
+#endif
diff --git a/gl/windows-initguard.h b/gl/windows-initguard.h
new file mode 100644
index 0000000..9d36f53
--- /dev/null
+++ b/gl/windows-initguard.h
@@ -0,0 +1,35 @@
+/* Init guards, somewhat like spinlocks (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_INITGUARD_H
+#define _WINDOWS_INITGUARD_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+typedef struct
+ {
+ volatile int done;
+ volatile LONG started;
+ }
+ glwthread_initguard_t;
+
+#define GLWTHREAD_INITGUARD_INIT { 0, -1 }
+
+#endif /* _WINDOWS_INITGUARD_H */
diff --git a/gl/windows-mutex.c b/gl/windows-mutex.c
new file mode 100644
index 0000000..ab7258c
--- /dev/null
+++ b/gl/windows-mutex.c
@@ -0,0 +1,95 @@
+/* Plain mutexes (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-mutex.h"
+
+#include <errno.h>
+
+void
+glwthread_mutex_init (glwthread_mutex_t *mutex)
+{
+ InitializeCriticalSection (&mutex->lock);
+ mutex->guard.done = 1;
+}
+
+int
+glwthread_mutex_lock (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_mutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!mutex->guard.done)
+ Sleep (0);
+ }
+ }
+ EnterCriticalSection (&mutex->lock);
+ return 0;
+}
+
+int
+glwthread_mutex_trylock (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_mutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Let another thread finish initializing this mutex, and let it also
+ lock this mutex. */
+ return EBUSY;
+ }
+ }
+ if (!TryEnterCriticalSection (&mutex->lock))
+ return EBUSY;
+ return 0;
+}
+
+int
+glwthread_mutex_unlock (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ return EINVAL;
+ LeaveCriticalSection (&mutex->lock);
+ return 0;
+}
+
+int
+glwthread_mutex_destroy (glwthread_mutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ return EINVAL;
+ DeleteCriticalSection (&mutex->lock);
+ mutex->guard.done = 0;
+ return 0;
+}
diff --git a/gl/windows-mutex.h b/gl/windows-mutex.h
new file mode 100644
index 0000000..039eb70
--- /dev/null
+++ b/gl/windows-mutex.h
@@ -0,0 +1,51 @@
+/* Plain mutexes (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_MUTEX_H
+#define _WINDOWS_MUTEX_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+typedef struct
+ {
+ glwthread_initguard_t guard; /* protects the initialization */
+ CRITICAL_SECTION lock;
+ }
+ glwthread_mutex_t;
+
+#define GLWTHREAD_MUTEX_INIT { GLWTHREAD_INITGUARD_INIT }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_mutex_init (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_lock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_trylock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_unlock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_destroy (glwthread_mutex_t *mutex);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_MUTEX_H */
diff --git a/gl/windows-once.c b/gl/windows-once.c
new file mode 100644
index 0000000..0d28281
--- /dev/null
+++ b/gl/windows-once.c
@@ -0,0 +1,62 @@
+/* Once-only control (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-once.h"
+
+#include <stdlib.h>
+
+void
+glwthread_once (glwthread_once_t *once_control, void (*initfunction) (void))
+{
+ if (once_control->inited <= 0)
+ {
+ if (InterlockedIncrement (&once_control->started) == 0)
+ {
+ /* This thread is the first one to come to this once_control. */
+ InitializeCriticalSection (&once_control->lock);
+ EnterCriticalSection (&once_control->lock);
+ once_control->inited = 0;
+ initfunction ();
+ once_control->inited = 1;
+ LeaveCriticalSection (&once_control->lock);
+ }
+ else
+ {
+ /* Don't let once_control->started grow and wrap around. */
+ InterlockedDecrement (&once_control->started);
+ /* Some other thread has already started the initialization.
+ Yield the CPU while waiting for the other thread to finish
+ initializing and taking the lock. */
+ while (once_control->inited < 0)
+ Sleep (0);
+ if (once_control->inited <= 0)
+ {
+ /* Take the lock. This blocks until the other thread has
+ finished calling the initfunction. */
+ EnterCriticalSection (&once_control->lock);
+ LeaveCriticalSection (&once_control->lock);
+ if (!(once_control->inited > 0))
+ abort ();
+ }
+ }
+ }
+}
diff --git a/gl/windows-once.h b/gl/windows-once.h
new file mode 100644
index 0000000..5488568
--- /dev/null
+++ b/gl/windows-once.h
@@ -0,0 +1,47 @@
+/* Once-only control (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_ONCE_H
+#define _WINDOWS_ONCE_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+typedef struct
+ {
+ volatile int inited;
+ volatile LONG started;
+ CRITICAL_SECTION lock;
+ }
+ glwthread_once_t;
+
+#define GLWTHREAD_ONCE_INIT { -1, -1 }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_once (glwthread_once_t *once_control,
+ void (*initfunction) (void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_ONCE_H */
diff --git a/gl/windows-recmutex.c b/gl/windows-recmutex.c
new file mode 100644
index 0000000..a8ce9a0
--- /dev/null
+++ b/gl/windows-recmutex.c
@@ -0,0 +1,127 @@
+/* Plain recursive mutexes (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-recmutex.h"
+
+#include <errno.h>
+
+void
+glwthread_recmutex_init (glwthread_recmutex_t *mutex)
+{
+ mutex->owner = 0;
+ mutex->depth = 0;
+ InitializeCriticalSection (&mutex->lock);
+ mutex->guard.done = 1;
+}
+
+int
+glwthread_recmutex_lock (glwthread_recmutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_recmutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!mutex->guard.done)
+ Sleep (0);
+ }
+ }
+ {
+ DWORD self = GetCurrentThreadId ();
+ if (mutex->owner != self)
+ {
+ EnterCriticalSection (&mutex->lock);
+ mutex->owner = self;
+ }
+ if (++(mutex->depth) == 0) /* wraparound? */
+ {
+ mutex->depth--;
+ return EAGAIN;
+ }
+ }
+ return 0;
+}
+
+int
+glwthread_recmutex_trylock (glwthread_recmutex_t *mutex)
+{
+ if (!mutex->guard.done)
+ {
+ if (InterlockedIncrement (&mutex->guard.started) == 0)
+ /* This thread is the first one to need this mutex. Initialize it. */
+ glwthread_recmutex_init (mutex);
+ else
+ {
+ /* Don't let mutex->guard.started grow and wrap around. */
+ InterlockedDecrement (&mutex->guard.started);
+ /* Let another thread finish initializing this mutex, and let it also
+ lock this mutex. */
+ return EBUSY;
+ }
+ }
+ {
+ DWORD self = GetCurrentThreadId ();
+ if (mutex->owner != self)
+ {
+ if (!TryEnterCriticalSection (&mutex->lock))
+ return EBUSY;
+ mutex->owner = self;
+ }
+ if (++(mutex->depth) == 0) /* wraparound? */
+ {
+ mutex->depth--;
+ return EAGAIN;
+ }
+ }
+ return 0;
+}
+
+int
+glwthread_recmutex_unlock (glwthread_recmutex_t *mutex)
+{
+ if (mutex->owner != GetCurrentThreadId ())
+ return EPERM;
+ if (mutex->depth == 0)
+ return EINVAL;
+ if (--(mutex->depth) == 0)
+ {
+ mutex->owner = 0;
+ LeaveCriticalSection (&mutex->lock);
+ }
+ return 0;
+}
+
+int
+glwthread_recmutex_destroy (glwthread_recmutex_t *mutex)
+{
+ if (mutex->owner != 0)
+ return EBUSY;
+ DeleteCriticalSection (&mutex->lock);
+ mutex->guard.done = 0;
+ return 0;
+}
diff --git a/gl/windows-recmutex.h b/gl/windows-recmutex.h
new file mode 100644
index 0000000..08ff459
--- /dev/null
+++ b/gl/windows-recmutex.h
@@ -0,0 +1,57 @@
+/* Plain recursive mutexes (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_RECMUTEX_H
+#define _WINDOWS_RECMUTEX_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+/* The native Windows documentation says that CRITICAL_SECTION already
+ implements a recursive lock. But we need not rely on it: It's easy to
+ implement a recursive lock without this assumption. */
+
+typedef struct
+ {
+ glwthread_initguard_t guard; /* protects the initialization */
+ DWORD owner;
+ unsigned long depth;
+ CRITICAL_SECTION lock;
+ }
+ glwthread_recmutex_t;
+
+#define GLWTHREAD_RECMUTEX_INIT { GLWTHREAD_INITGUARD_INIT, 0, 0 }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_recmutex_init (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_lock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_trylock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_unlock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_destroy (glwthread_recmutex_t *mutex);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_RECMUTEX_H */
diff --git a/gl/windows-rwlock.c b/gl/windows-rwlock.c
new file mode 100644
index 0000000..7cbd7bb
--- /dev/null
+++ b/gl/windows-rwlock.c
@@ -0,0 +1,377 @@
+/* Read-write locks (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#include <config.h>
+
+/* Specification. */
+#include "windows-rwlock.h"
+
+#include <errno.h>
+#include <stdlib.h>
+
+/* Don't assume that UNICODE is not defined. */
+#undef CreateEvent
+#define CreateEvent CreateEventA
+
+/* In this file, the waitqueues are implemented as circular arrays. */
+#define glwthread_waitqueue_t glwthread_carray_waitqueue_t
+
+static void
+glwthread_waitqueue_init (glwthread_waitqueue_t *wq)
+{
+ wq->array = NULL;
+ wq->count = 0;
+ wq->alloc = 0;
+ wq->offset = 0;
+}
+
+/* Enqueues the current thread, represented by an event, in a wait queue.
+ Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */
+static HANDLE
+glwthread_waitqueue_add (glwthread_waitqueue_t *wq)
+{
+ HANDLE event;
+ unsigned int index;
+
+ if (wq->count == wq->alloc)
+ {
+ unsigned int new_alloc = 2 * wq->alloc + 1;
+ HANDLE *new_array =
+ (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+ if (new_array == NULL)
+ /* No more memory. */
+ return INVALID_HANDLE_VALUE;
+ /* Now is a good opportunity to rotate the array so that its contents
+ starts at offset 0. */
+ if (wq->offset > 0)
+ {
+ unsigned int old_count = wq->count;
+ unsigned int old_alloc = wq->alloc;
+ unsigned int old_offset = wq->offset;
+ unsigned int i;
+ if (old_offset + old_count > old_alloc)
+ {
+ unsigned int limit = old_offset + old_count - old_alloc;
+ for (i = 0; i < limit; i++)
+ new_array[old_alloc + i] = new_array[i];
+ }
+ for (i = 0; i < old_count; i++)
+ new_array[i] = new_array[old_offset + i];
+ wq->offset = 0;
+ }
+ wq->array = new_array;
+ wq->alloc = new_alloc;
+ }
+ /* Whether the created event is a manual-reset one or an auto-reset one,
+ does not matter, since we will wait on it only once. */
+ event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ if (event == INVALID_HANDLE_VALUE)
+ /* No way to allocate an event. */
+ return INVALID_HANDLE_VALUE;
+ index = wq->offset + wq->count;
+ if (index >= wq->alloc)
+ index -= wq->alloc;
+ wq->array[index] = event;
+ wq->count++;
+ return event;
+}
+
+/* Notifies the first thread from a wait queue and dequeues it. */
+static void
+glwthread_waitqueue_notify_first (glwthread_waitqueue_t *wq)
+{
+ SetEvent (wq->array[wq->offset + 0]);
+ wq->offset++;
+ wq->count--;
+ if (wq->count == 0 || wq->offset == wq->alloc)
+ wq->offset = 0;
+}
+
+/* Notifies all threads from a wait queue and dequeues them all. */
+static void
+glwthread_waitqueue_notify_all (glwthread_waitqueue_t *wq)
+{
+ unsigned int i;
+
+ for (i = 0; i < wq->count; i++)
+ {
+ unsigned int index = wq->offset + i;
+ if (index >= wq->alloc)
+ index -= wq->alloc;
+ SetEvent (wq->array[index]);
+ }
+ wq->count = 0;
+ wq->offset = 0;
+}
+
+void
+glwthread_rwlock_init (glwthread_rwlock_t *lock)
+{
+ InitializeCriticalSection (&lock->lock);
+ glwthread_waitqueue_init (&lock->waiting_readers);
+ glwthread_waitqueue_init (&lock->waiting_writers);
+ lock->runcount = 0;
+ lock->guard.done = 1;
+}
+
+int
+glwthread_rwlock_rdlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ EnterCriticalSection (&lock->lock);
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ HANDLE event = glwthread_waitqueue_add (&lock->waiting_readers);
+ if (event != INVALID_HANDLE_VALUE)
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_readers, incremented lock->runcount. */
+ if (!(lock->runcount > 0))
+ abort ();
+ return 0;
+ }
+ else
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount + 1 > 0));
+ }
+ }
+ lock->runcount++;
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_wrlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ EnterCriticalSection (&lock->lock);
+ /* Test whether no readers or writers are currently running. */
+ if (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ HANDLE event = glwthread_waitqueue_add (&lock->waiting_writers);
+ if (event != INVALID_HANDLE_VALUE)
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_writers, set lock->runcount = -1. */
+ if (!(lock->runcount == -1))
+ abort ();
+ return 0;
+ }
+ else
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount == 0));
+ }
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ /* It's OK to wait for this critical section, because it is never taken for a
+ long time. */
+ EnterCriticalSection (&lock->lock);
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow, and whether no writer is waiting. The latter
+ condition is because POSIX recommends that "write locks shall take
+ precedence over read locks", to avoid "writer starvation". */
+ if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0))
+ {
+ /* This thread would have to wait for a while. Return instead. */
+ LeaveCriticalSection (&lock->lock);
+ return EBUSY;
+ }
+ lock->runcount++;
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glwthread_rwlock_init (lock);
+ else
+ {
+ /* Don't let lock->guard.started grow and wrap around. */
+ InterlockedDecrement (&lock->guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ }
+ /* It's OK to wait for this critical section, because it is never taken for a
+ long time. */
+ EnterCriticalSection (&lock->lock);
+ /* Test whether no readers or writers are currently running. */
+ if (!(lock->runcount == 0))
+ {
+ /* This thread would have to wait for a while. Return instead. */
+ LeaveCriticalSection (&lock->lock);
+ return EBUSY;
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_unlock (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ EnterCriticalSection (&lock->lock);
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ abort ();
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ LeaveCriticalSection (&lock->lock);
+ return EPERM;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers.count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ lock->runcount--;
+ glwthread_waitqueue_notify_first (&lock->waiting_writers);
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ lock->runcount += lock->waiting_readers.count;
+ glwthread_waitqueue_notify_all (&lock->waiting_readers);
+ }
+ }
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glwthread_rwlock_destroy (glwthread_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ if (lock->runcount != 0)
+ return EBUSY;
+ DeleteCriticalSection (&lock->lock);
+ if (lock->waiting_readers.array != NULL)
+ free (lock->waiting_readers.array);
+ if (lock->waiting_writers.array != NULL)
+ free (lock->waiting_writers.array);
+ lock->guard.done = 0;
+ return 0;
+}
diff --git a/gl/windows-rwlock.h b/gl/windows-rwlock.h
new file mode 100644
index 0000000..fe8381e
--- /dev/null
+++ b/gl/windows-rwlock.h
@@ -0,0 +1,68 @@
+/* Read-write locks (native Windows implementation).
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-win32.h. */
+
+#ifndef _WINDOWS_RWLOCK_H
+#define _WINDOWS_RWLOCK_H
+
+#define WIN32_LEAN_AND_MEAN /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+/* It is impossible to implement read-write locks using plain locks, without
+ introducing an extra thread dedicated to managing read-write locks.
+ Therefore here we need to use the low-level Event type. */
+
+typedef struct
+ {
+ HANDLE *array; /* array of waiting threads, each represented by an event */
+ unsigned int count; /* number of waiting threads */
+ unsigned int alloc; /* length of allocated array */
+ unsigned int offset; /* index of first waiting thread in array */
+ }
+ glwthread_carray_waitqueue_t;
+typedef struct
+ {
+ glwthread_initguard_t guard; /* protects the initialization */
+ CRITICAL_SECTION lock; /* protects the remaining fields */
+ glwthread_carray_waitqueue_t waiting_readers; /* waiting readers */
+ glwthread_carray_waitqueue_t waiting_writers; /* waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ glwthread_rwlock_t;
+
+#define GLWTHREAD_RWLOCK_INIT { GLWTHREAD_INITGUARD_INIT }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_rwlock_init (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_rdlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_wrlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_unlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_destroy (glwthread_rwlock_t *lock);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_RWLOCK_H */
diff --git a/gl/xalloc-die.c b/gl/xalloc-die.c
new file mode 100644
index 0000000..7605eee
--- /dev/null
+++ b/gl/xalloc-die.c
@@ -0,0 +1,41 @@
+/* Report a memory allocation failure and exit.
+
+ Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2023 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "xalloc.h"
+
+#include <stdlib.h>
+
+#include "error.h"
+#include "exitfail.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+void
+xalloc_die (void)
+{
+ error (exit_failure, 0, "%s", _("memory exhausted"));
+
+ /* _Noreturn cannot be given to error, since it may return if
+ its first argument is 0. To help compilers understand the
+ xalloc_die does not return, call abort. Also, the abort is a
+ safety feature if exit_failure is 0 (which shouldn't happen). */
+ abort ();
+}
diff --git a/gl/xalloc-oversized.h b/gl/xalloc-oversized.h
new file mode 100644
index 0000000..5dbdfb5
--- /dev/null
+++ b/gl/xalloc-oversized.h
@@ -0,0 +1,65 @@
+/* xalloc-oversized.h -- memory allocation size checking
+
+ Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef XALLOC_OVERSIZED_H_
+#define XALLOC_OVERSIZED_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+/* True if N * S does not fit into both ptrdiff_t and size_t.
+ N and S should be nonnegative and free of side effects.
+ This expands to a constant expression if N and S are both constants.
+ By gnulib convention, SIZE_MAX represents overflow in size_t
+ calculations, so the conservative size_t-based dividend to use here
+ is SIZE_MAX - 1. */
+#define __xalloc_oversized(n, s) \
+ ((s) != 0 \
+ && ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) \
+ < (n)))
+
+/* Return 1 if and only if an array of N objects, each of size S,
+ cannot exist reliably because its total size in bytes would exceed
+ MIN (PTRDIFF_MAX, SIZE_MAX - 1).
+
+ N and S should be nonnegative and free of side effects.
+
+ Warning: (xalloc_oversized (N, S) ? NULL : malloc (N * S)) can
+ misbehave if N and S are both narrower than ptrdiff_t and size_t,
+ and can be rewritten as (xalloc_oversized (N, S) ? NULL
+ : malloc (N * (size_t) S)).
+
+ This is a macro, not a function, so that it works even if an
+ argument exceeds MAX (PTRDIFF_MAX, SIZE_MAX). */
+#if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
+# define xalloc_oversized(n, s) \
+ __builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
+#elif (5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ \
+ && PTRDIFF_MAX < SIZE_MAX)
+# define xalloc_oversized(n, s) \
+ (__builtin_constant_p (n) && __builtin_constant_p (s) \
+ ? __xalloc_oversized (n, s) \
+ : ({ ptrdiff_t __xalloc_count; \
+ __builtin_mul_overflow (n, s, &__xalloc_count); }))
+
+/* Other compilers use integer division; this may be slower but is
+ more portable. */
+#else
+# define xalloc_oversized(n, s) __xalloc_oversized (n, s)
+#endif
+
+#endif /* !XALLOC_OVERSIZED_H_ */
diff --git a/gl/xalloc.h b/gl/xalloc.h
new file mode 100644
index 0000000..f373c2f
--- /dev/null
+++ b/gl/xalloc.h
@@ -0,0 +1,211 @@
+/* xalloc.h -- malloc with out-of-memory checking
+
+ Copyright (C) 1990-2000, 2003-2004, 2006-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef XALLOC_H_
+#define XALLOC_H_
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#if GNULIB_XALLOC
+# include "idx.h"
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef XALLOC_INLINE
+# define XALLOC_INLINE _GL_INLINE
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if GNULIB_XALLOC_DIE
+
+/* This function is always triggered when memory is exhausted.
+ It must be defined by the application, either explicitly
+ or by using gnulib's xalloc-die module. This is the
+ function to call when one wants the program to die because of a
+ memory allocation failure. */
+/*extern*/ _Noreturn void xalloc_die (void);
+
+#endif /* GNULIB_XALLOC_DIE */
+
+#if GNULIB_XALLOC
+
+void *xmalloc (size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *ximalloc (idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xinmalloc (idx_t n, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xzalloc (size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xizalloc (idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xcalloc (size_t n, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xicalloc (idx_t n, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xrealloc (void *p, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+void *xirealloc (void *p, idx_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xreallocarray (void *p, size_t n, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3));
+void *xireallocarray (void *p, idx_t n, idx_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *x2realloc (void *p, size_t *ps) /* superseded by xpalloc */
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *x2nrealloc (void *p, size_t *pn, size_t s) /* superseded by xpalloc */
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *xmemdup (void const *p, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+void *ximemdup (void const *p, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+char *ximemdup0 (void const *p, idx_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+char *xstrdup (char const *str)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+/* In the following macros, T must be an elementary or structure/union or
+ typedef'ed type, or a pointer to such a type. To apply one of the
+ following macros to a function pointer or array type, you need to typedef
+ it first and use the typedef name. */
+
+/* Allocate an object of type T dynamically, with error checking. */
+/* extern t *XMALLOC (typename t); */
+# define XMALLOC(t) ((t *) xmalloc (sizeof (t)))
+
+/* Allocate memory for N elements of type T, with error checking. */
+/* extern t *XNMALLOC (size_t n, typename t); */
+# define XNMALLOC(n, t) \
+ ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t))))
+
+/* Allocate an object of type T dynamically, with error checking,
+ and zero it. */
+/* extern t *XZALLOC (typename t); */
+# define XZALLOC(t) ((t *) xzalloc (sizeof (t)))
+
+/* Allocate memory for N elements of type T, with error checking,
+ and zero it. */
+/* extern t *XCALLOC (size_t n, typename t); */
+# define XCALLOC(n, t) \
+ ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
+
+
+/* Allocate an array of N objects, each with S bytes of memory,
+ dynamically, with error checking. S must be nonzero. */
+
+void *xnmalloc (size_t n, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+/* FIXME: Deprecate this in favor of xreallocarray? */
+/* Change the size of an allocated block of memory P to an array of N
+ objects each of S bytes, with error checking. S must be nonzero. */
+
+XALLOC_INLINE void *xnrealloc (void *p, size_t n, size_t s)
+ _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3));
+XALLOC_INLINE void *
+xnrealloc (void *p, size_t n, size_t s)
+{
+ return xreallocarray (p, n, s);
+}
+
+/* Return a pointer to a new buffer of N bytes. This is like xmalloc,
+ except it returns char *. */
+
+char *xcharalloc (size_t n)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+#endif /* GNULIB_XALLOC */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#if GNULIB_XALLOC && defined __cplusplus
+
+/* C++ does not allow conversions from void * to other pointer types
+ without a cast. Use templates to work around the problem when
+ possible. */
+
+template <typename T> inline T *
+xrealloc (T *p, size_t s)
+{
+ return (T *) xrealloc ((void *) p, s);
+}
+
+template <typename T> inline T *
+xreallocarray (T *p, size_t n, size_t s)
+{
+ return (T *) xreallocarray ((void *) p, n, s);
+}
+
+/* FIXME: Deprecate this in favor of xreallocarray? */
+template <typename T> inline T *
+xnrealloc (T *p, size_t n, size_t s)
+{
+ return xreallocarray (p, n, s);
+}
+
+template <typename T> inline T *
+x2realloc (T *p, size_t *pn)
+{
+ return (T *) x2realloc ((void *) p, pn);
+}
+
+template <typename T> inline T *
+x2nrealloc (T *p, size_t *pn, size_t s)
+{
+ return (T *) x2nrealloc ((void *) p, pn, s);
+}
+
+template <typename T> inline T *
+xmemdup (T const *p, size_t s)
+{
+ return (T *) xmemdup ((void const *) p, s);
+}
+
+#endif /* GNULIB_XALLOC && C++ */
+
+
+_GL_INLINE_HEADER_END
+
+#endif /* !XALLOC_H_ */
diff --git a/gl/xmalloc.c b/gl/xmalloc.c
new file mode 100644
index 0000000..289cbd0
--- /dev/null
+++ b/gl/xmalloc.c
@@ -0,0 +1,340 @@
+/* xmalloc.c -- malloc with out of memory checking
+
+ Copyright (C) 1990-2000, 2002-2006, 2008-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define XALLOC_INLINE _GL_EXTERN_INLINE
+
+#include "xalloc.h"
+
+#include "ialloc.h"
+#include "minmax.h"
+
+#include <stdckdint.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+static void * _GL_ATTRIBUTE_PURE
+nonnull (void *p)
+{
+ if (!p)
+ xalloc_die ();
+ return p;
+}
+
+/* Allocate S bytes of memory dynamically, with error checking. */
+
+void *
+xmalloc (size_t s)
+{
+ return nonnull (malloc (s));
+}
+
+void *
+ximalloc (idx_t s)
+{
+ return nonnull (imalloc (s));
+}
+
+char *
+xcharalloc (size_t n)
+{
+ return XNMALLOC (n, char);
+}
+
+/* Change the size of an allocated block of memory P to S bytes,
+ with error checking. */
+
+void *
+xrealloc (void *p, size_t s)
+{
+ void *r = realloc (p, s);
+ if (!r && (!p || s))
+ xalloc_die ();
+ return r;
+}
+
+void *
+xirealloc (void *p, idx_t s)
+{
+ return nonnull (irealloc (p, s));
+}
+
+/* Change the size of an allocated block of memory P to an array of N
+ objects each of S bytes, with error checking. */
+
+void *
+xreallocarray (void *p, size_t n, size_t s)
+{
+ void *r = reallocarray (p, n, s);
+ if (!r && (!p || (n && s)))
+ xalloc_die ();
+ return r;
+}
+
+void *
+xireallocarray (void *p, idx_t n, idx_t s)
+{
+ return nonnull (ireallocarray (p, n, s));
+}
+
+/* Allocate an array of N objects, each with S bytes of memory,
+ dynamically, with error checking. S must be nonzero. */
+
+void *
+xnmalloc (size_t n, size_t s)
+{
+ return xreallocarray (NULL, n, s);
+}
+
+void *
+xinmalloc (idx_t n, idx_t s)
+{
+ return xireallocarray (NULL, n, s);
+}
+
+/* If P is null, allocate a block of at least *PS bytes; otherwise,
+ reallocate P so that it contains more than *PS bytes. *PS must be
+ nonzero unless P is null. Set *PS to the new block's size, and
+ return the pointer to the new block. *PS is never set to zero, and
+ the returned pointer is never null. */
+
+void *
+x2realloc (void *p, size_t *ps)
+{
+ return x2nrealloc (p, ps, 1);
+}
+
+/* If P is null, allocate a block of at least *PN such objects;
+ otherwise, reallocate P so that it contains more than *PN objects
+ each of S bytes. S must be nonzero. Set *PN to the new number of
+ objects, and return the pointer to the new block. *PN is never set
+ to zero, and the returned pointer is never null.
+
+ Repeated reallocations are guaranteed to make progress, either by
+ allocating an initial block with a nonzero size, or by allocating a
+ larger block.
+
+ In the following implementation, nonzero sizes are increased by a
+ factor of approximately 1.5 so that repeated reallocations have
+ O(N) overall cost rather than O(N**2) cost, but the
+ specification for this function does not guarantee that rate.
+
+ Here is an example of use:
+
+ int *p = NULL;
+ size_t used = 0;
+ size_t allocated = 0;
+
+ void
+ append_int (int value)
+ {
+ if (used == allocated)
+ p = x2nrealloc (p, &allocated, sizeof *p);
+ p[used++] = value;
+ }
+
+ This causes x2nrealloc to allocate a block of some nonzero size the
+ first time it is called.
+
+ To have finer-grained control over the initial size, set *PN to a
+ nonzero value before calling this function with P == NULL. For
+ example:
+
+ int *p = NULL;
+ size_t used = 0;
+ size_t allocated = 0;
+ size_t allocated1 = 1000;
+
+ void
+ append_int (int value)
+ {
+ if (used == allocated)
+ {
+ p = x2nrealloc (p, &allocated1, sizeof *p);
+ allocated = allocated1;
+ }
+ p[used++] = value;
+ }
+
+ */
+
+void *
+x2nrealloc (void *p, size_t *pn, size_t s)
+{
+ size_t n = *pn;
+
+ if (! p)
+ {
+ if (! n)
+ {
+ /* The approximate size to use for initial small allocation
+ requests, when the invoking code specifies an old size of
+ zero. This is the largest "small" request for the GNU C
+ library malloc. */
+ enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
+
+ n = DEFAULT_MXFAST / s;
+ n += !n;
+ }
+ }
+ else
+ {
+ /* Set N = floor (1.5 * N) + 1 to make progress even if N == 0. */
+ if (ckd_add (&n, n, (n >> 1) + 1))
+ xalloc_die ();
+ }
+
+ p = xreallocarray (p, n, s);
+ *pn = n;
+ return p;
+}
+
+/* Grow PA, which points to an array of *PN items, and return the
+ location of the reallocated array, updating *PN to reflect its
+ new size. The new array will contain at least N_INCR_MIN more
+ items, but will not contain more than N_MAX items total.
+ S is the size of each item, in bytes.
+
+ S and N_INCR_MIN must be positive. *PN must be
+ nonnegative. If N_MAX is -1, it is treated as if it were
+ infinity.
+
+ If PA is null, then allocate a new array instead of reallocating
+ the old one.
+
+ Thus, to grow an array A without saving its old contents, do
+ { free (A); A = xpalloc (NULL, &AITEMS, ...); }. */
+
+void *
+xpalloc (void *pa, idx_t *pn, idx_t n_incr_min, ptrdiff_t n_max, idx_t s)
+{
+ idx_t n0 = *pn;
+
+ /* The approximate size to use for initial small allocation
+ requests. This is the largest "small" request for the GNU C
+ library malloc. */
+ enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
+
+ /* If the array is tiny, grow it to about (but no greater than)
+ DEFAULT_MXFAST bytes. Otherwise, grow it by about 50%.
+ Adjust the growth according to three constraints: N_INCR_MIN,
+ N_MAX, and what the C language can represent safely. */
+
+ idx_t n;
+ if (ckd_add (&n, n0, n0 >> 1))
+ n = IDX_MAX;
+ if (0 <= n_max && n_max < n)
+ n = n_max;
+
+ /* NBYTES is of a type suitable for holding the count of bytes in an object.
+ This is typically idx_t, but it should be size_t on (theoretical?)
+ platforms where SIZE_MAX < IDX_MAX so xpalloc does not pass
+ values greater than SIZE_MAX to xrealloc. */
+#if IDX_MAX <= SIZE_MAX
+ idx_t nbytes;
+#else
+ size_t nbytes;
+#endif
+ idx_t adjusted_nbytes
+ = (ckd_mul (&nbytes, n, s)
+ ? MIN (IDX_MAX, SIZE_MAX)
+ : nbytes < DEFAULT_MXFAST ? DEFAULT_MXFAST : 0);
+ if (adjusted_nbytes)
+ {
+ n = adjusted_nbytes / s;
+ nbytes = adjusted_nbytes - adjusted_nbytes % s;
+ }
+
+ if (! pa)
+ *pn = 0;
+ if (n - n0 < n_incr_min
+ && (ckd_add (&n, n0, n_incr_min)
+ || (0 <= n_max && n_max < n)
+ || ckd_mul (&nbytes, n, s)))
+ xalloc_die ();
+ pa = xrealloc (pa, nbytes);
+ *pn = n;
+ return pa;
+}
+
+/* Allocate S bytes of zeroed memory dynamically, with error checking.
+ There's no need for xnzalloc (N, S), since it would be equivalent
+ to xcalloc (N, S). */
+
+void *
+xzalloc (size_t s)
+{
+ return xcalloc (s, 1);
+}
+
+void *
+xizalloc (idx_t s)
+{
+ return xicalloc (s, 1);
+}
+
+/* Allocate zeroed memory for N elements of S bytes, with error
+ checking. S must be nonzero. */
+
+void *
+xcalloc (size_t n, size_t s)
+{
+ return nonnull (calloc (n, s));
+}
+
+void *
+xicalloc (idx_t n, idx_t s)
+{
+ return nonnull (icalloc (n, s));
+}
+
+/* Clone an object P of size S, with error checking. There's no need
+ for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any
+ need for an arithmetic overflow check. */
+
+void *
+xmemdup (void const *p, size_t s)
+{
+ return memcpy (xmalloc (s), p, s);
+}
+
+void *
+ximemdup (void const *p, idx_t s)
+{
+ return memcpy (ximalloc (s), p, s);
+}
+
+/* Clone an object P of size S, with error checking. Append
+ a terminating NUL byte. */
+
+char *
+ximemdup0 (void const *p, idx_t s)
+{
+ char *result = ximalloc (s + 1);
+ result[s] = 0;
+ return memcpy (result, p, s);
+}
+
+/* Clone STRING. */
+
+char *
+xstrdup (char const *string)
+{
+ return xmemdup (string, strlen (string) + 1);
+}
diff --git a/gl/xsize.c b/gl/xsize.c
new file mode 100644
index 0000000..279ae82
--- /dev/null
+++ b/gl/xsize.c
@@ -0,0 +1,21 @@
+/* Checked size_t computations.
+
+ Copyright (C) 2012-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#define XSIZE_INLINE _GL_EXTERN_INLINE
+#include "xsize.h"
diff --git a/gl/xsize.h b/gl/xsize.h
new file mode 100644
index 0000000..1ec78e7
--- /dev/null
+++ b/gl/xsize.h
@@ -0,0 +1,108 @@
+/* xsize.h -- Checked size_t computations.
+
+ Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc.
+
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ This file is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef _XSIZE_H
+#define _XSIZE_H
+
+/* Get size_t. */
+#include <stddef.h>
+
+/* Get SIZE_MAX. */
+#include <limits.h>
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
+/* Get ATTRIBUTE_PURE. */
+#include "attribute.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef XSIZE_INLINE
+# define XSIZE_INLINE _GL_INLINE
+#endif
+
+/* The size of memory objects is often computed through expressions of
+ type size_t. Example:
+ void* p = malloc (header_size + n * element_size).
+ These computations can lead to overflow. When this happens, malloc()
+ returns a piece of memory that is way too small, and the program then
+ crashes while attempting to fill the memory.
+ To avoid this, the functions and macros in this file check for overflow.
+ The convention is that SIZE_MAX represents overflow.
+ malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
+ implementation that uses mmap --, it's recommended to use size_overflow_p()
+ or size_in_bounds_p() before invoking malloc().
+ The example thus becomes:
+ size_t size = xsum (header_size, xtimes (n, element_size));
+ void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
+*/
+
+/* Convert an arbitrary value >= 0 to type size_t. */
+#define xcast_size_t(N) \
+ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
+
+/* Sum of two sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xsum (size_t size1, size_t size2)
+{
+ size_t sum = size1 + size2;
+ return (sum >= size1 ? sum : SIZE_MAX);
+}
+
+/* Sum of three sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xsum3 (size_t size1, size_t size2, size_t size3)
+{
+ return xsum (xsum (size1, size2), size3);
+}
+
+/* Sum of four sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
+{
+ return xsum (xsum (xsum (size1, size2), size3), size4);
+}
+
+/* Maximum of two sizes, with overflow check. */
+XSIZE_INLINE size_t ATTRIBUTE_PURE
+xmax (size_t size1, size_t size2)
+{
+ /* No explicit check is needed here, because for any n:
+ max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
+ return (size1 >= size2 ? size1 : size2);
+}
+
+/* Multiplication of a count with an element size, with overflow check.
+ The count must be >= 0 and the element size must be > 0.
+ This is a macro, not a function, so that it works correctly even
+ when N is of a wider type and N > SIZE_MAX. */
+#define xtimes(N, ELSIZE) \
+ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
+
+/* Check for overflow. */
+#define size_overflow_p(SIZE) \
+ ((SIZE) == SIZE_MAX)
+/* Check against overflow. */
+#define size_in_bounds_p(SIZE) \
+ ((SIZE) != SIZE_MAX)
+
+_GL_INLINE_HEADER_END
+
+#endif /* _XSIZE_H */
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..dc3ee89
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,19 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = . tests
+
+noinst_LIBRARIES = libmonitoringplug.a
+
+AM_CPPFLAGS = -DNP_STATE_DIR_PREFIX=\"$(localstatedir)\" \
+ -I$(srcdir) -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
+
+libmonitoringplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c utils_cmd.c maxfd.c
+EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h parse_ini.h extra_opts.h maxfd.h
+
+if USE_PARSE_INI
+libmonitoringplug_a_SOURCES += parse_ini.c extra_opts.c
+endif USE_PARSE_INI
+
+test test-debug:
+ cd tests && make $@
+
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 0000000..22dc3f9
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,2179 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@USE_PARSE_INI_TRUE@am__append_1 = parse_ini.c extra_opts.c
+subdir = lib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libmonitoringplug_a_AR = $(AR) $(ARFLAGS)
+libmonitoringplug_a_LIBADD =
+am__libmonitoringplug_a_SOURCES_DIST = utils_base.c utils_disk.c \
+ utils_tcp.c utils_cmd.c maxfd.c parse_ini.c extra_opts.c
+@USE_PARSE_INI_TRUE@am__objects_1 = parse_ini.$(OBJEXT) \
+@USE_PARSE_INI_TRUE@ extra_opts.$(OBJEXT)
+am_libmonitoringplug_a_OBJECTS = utils_base.$(OBJEXT) \
+ utils_disk.$(OBJEXT) utils_tcp.$(OBJEXT) utils_cmd.$(OBJEXT) \
+ maxfd.$(OBJEXT) $(am__objects_1)
+libmonitoringplug_a_OBJECTS = $(am_libmonitoringplug_a_OBJECTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/extra_opts.Po ./$(DEPDIR)/maxfd.Po \
+ ./$(DEPDIR)/parse_ini.Po ./$(DEPDIR)/utils_base.Po \
+ ./$(DEPDIR)/utils_cmd.Po ./$(DEPDIR)/utils_disk.Po \
+ ./$(DEPDIR)/utils_tcp.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libmonitoringplug_a_SOURCES)
+DIST_SOURCES = $(am__libmonitoringplug_a_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/mkinstalldirs
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+SUBDIRS = . tests
+noinst_LIBRARIES = libmonitoringplug.a
+AM_CPPFLAGS = -DNP_STATE_DIR_PREFIX=\"$(localstatedir)\" \
+ -I$(srcdir) -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
+
+libmonitoringplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c \
+ utils_cmd.c maxfd.c $(am__append_1)
+EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h parse_ini.h extra_opts.h maxfd.h
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu lib/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+libmonitoringplug.a: $(libmonitoringplug_a_OBJECTS) $(libmonitoringplug_a_DEPENDENCIES) $(EXTRA_libmonitoringplug_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libmonitoringplug.a
+ $(AM_V_AR)$(libmonitoringplug_a_AR) libmonitoringplug.a $(libmonitoringplug_a_OBJECTS) $(libmonitoringplug_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libmonitoringplug.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extra_opts.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maxfd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_ini.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_base.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_cmd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_disk.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_tcp.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/extra_opts.Po
+ -rm -f ./$(DEPDIR)/maxfd.Po
+ -rm -f ./$(DEPDIR)/parse_ini.Po
+ -rm -f ./$(DEPDIR)/utils_base.Po
+ -rm -f ./$(DEPDIR)/utils_cmd.Po
+ -rm -f ./$(DEPDIR)/utils_disk.Po
+ -rm -f ./$(DEPDIR)/utils_tcp.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f ./$(DEPDIR)/extra_opts.Po
+ -rm -f ./$(DEPDIR)/maxfd.Po
+ -rm -f ./$(DEPDIR)/parse_ini.Po
+ -rm -f ./$(DEPDIR)/utils_base.Po
+ -rm -f ./$(DEPDIR)/utils_cmd.Po
+ -rm -f ./$(DEPDIR)/utils_disk.Po
+ -rm -f ./$(DEPDIR)/utils_tcp.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles check check-am clean clean-generic clean-libtool \
+ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am
+
+.PRECIOUS: Makefile
+
+
+test test-debug:
+ cd tests && make $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/extra_opts.c b/lib/extra_opts.c
new file mode 100644
index 0000000..771621d
--- /dev/null
+++ b/lib/extra_opts.c
@@ -0,0 +1,135 @@
+/*****************************************************************************
+*
+* Monitoring Plugins extra_opts library
+*
+* License: GPL
+* Copyright (c) 2007 Monitoring Plugins Development Team
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_base.h"
+#include "parse_ini.h"
+#include "extra_opts.h"
+
+/* FIXME: copied from utils.h; we should move a bunch of libs! */
+bool is_option2 (char *str)
+{
+ if (!str)
+ return false;
+ else if (strspn (str, "-") == 1 || strspn (str, "-") == 2)
+ return true;
+ else
+ return false;
+}
+
+/* this is the externally visible function used by plugins */
+char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
+ np_arg_list *extra_args=NULL, *ea1=NULL, *ea_tmp=NULL;
+ char **argv_new=NULL;
+ char *argptr=NULL;
+ int i, j, optfound, argc_new, ea_num=*argc;
+
+ if(*argc<2) {
+ /* No arguments provided */
+ return argv;
+ }
+
+ for(i=1; i<*argc; i++){
+ argptr=NULL;
+ optfound=0;
+
+ /* Do we have an extra-opts parameter? */
+ if(strncmp(argv[i], "--extra-opts=", 13)==0){
+ /* It is a single argument with value */
+ argptr=argv[i]+13;
+ /* Delete the extra opts argument */
+ for(j=i;j<*argc;j++) argv[j]=argv[j+1];
+ i--;
+ *argc-=1;
+ }else if(strcmp(argv[i], "--extra-opts")==0){
+ if((i+1<*argc)&&!is_option2(argv[i+1])){
+ /* It is a argument with separate value */
+ argptr=argv[i+1];
+ /* Delete the extra-opts argument/value */
+ for(j=i;j<*argc-1;j++) argv[j]=argv[j+2];
+ i-=2;
+ *argc-=2;
+ ea_num--;
+ }else{
+ /* It has no value */
+ optfound=1;
+ /* Delete the extra opts argument */
+ for(j=i;j<*argc;j++) argv[j]=argv[j+1];
+ i--;
+ *argc-=1;
+ }
+ }
+
+ /* If we found extra-opts, expand them and store them for later*/
+ if(argptr||optfound){
+ /* Process ini section, returning a linked list of arguments */
+ ea1=np_get_defaults(argptr, plugin_name);
+ if(ea1==NULL) {
+ /* no extra args (empty section)? */
+ ea_num--;
+ continue;
+ }
+
+ /* append the list to extra_args */
+ if(extra_args==NULL){
+ extra_args=ea1;
+ while((ea1 = ea1->next)) ea_num++;
+ }else{
+ ea_tmp=extra_args;
+ while(ea_tmp->next) {
+ ea_tmp=ea_tmp->next;
+ }
+ ea_tmp->next=ea1;
+ while((ea1 = ea1->next)) ea_num++;
+ }
+ ea1=ea_tmp=NULL;
+ }
+ } /* lather, rince, repeat */
+
+ if(ea_num==*argc && extra_args==NULL){
+ /* No extra-opts */
+ return argv;
+ }
+
+ /* done processing arguments. now create a new argv array... */
+ argv_new=(char**)malloc((ea_num+1)*sizeof(char**));
+ if(argv_new==NULL) die(STATE_UNKNOWN, _("malloc() failed!\n"));
+
+ /* starting with program name */
+ argv_new[0]=argv[0];
+ argc_new=1;
+ /* then parsed ini opts (frying them up in the same run) */
+ while(extra_args){
+ argv_new[argc_new++]=extra_args->arg;
+ ea1=extra_args;
+ extra_args=extra_args->next;
+ free(ea1);
+ }
+ /* finally the rest of the argv array */
+ for (i=1; i<*argc; i++) argv_new[argc_new++]=argv[i];
+ *argc=argc_new;
+ /* and terminate. */
+ argv_new[argc_new]=NULL;
+
+ return argv_new;
+}
+
diff --git a/lib/extra_opts.h b/lib/extra_opts.h
new file mode 100644
index 0000000..8ff14a1
--- /dev/null
+++ b/lib/extra_opts.h
@@ -0,0 +1,23 @@
+#ifndef _EXTRA_OPTS_H_
+#define _EXTRA_OPTS_H_
+
+/*
+ * extra_opts.h: routines for loading monitoring-plugin defaults from ini
+ * configuration files.
+ */
+
+/* np_extra_opts: Process the --extra-opts arguments and create a new argument
+ * array with ini-processed and argument-passed arguments together. The
+ * ini-procesed arguments always come first (in the order of --extra-opts
+ * arguments). If no --extra-opts arguments are provided or returned nothing
+ * it returns **argv otherwise the new array is returned. --extra-opts are
+ * always removed from **argv. The original pointers from **argv are kept in
+ * the new array to preserve ability to overwrite arguments in processlist.
+ *
+ * The new array can be easily freed as long as a pointer to the original one
+ * is kept. See my_free() in lib/tests/test_opts1.c for an example.
+ */
+char **np_extra_opts(int *argc, char **argv, const char *plugin_name);
+
+#endif /* _EXTRA_OPTS_H_ */
+
diff --git a/lib/maxfd.c b/lib/maxfd.c
new file mode 100644
index 0000000..529b356
--- /dev/null
+++ b/lib/maxfd.c
@@ -0,0 +1,26 @@
+#include "./maxfd.h"
+#include <errno.h>
+
+long mp_open_max (void) {
+ long maxfd = 0L;
+ /* Try sysconf(_SC_OPEN_MAX) first, as it can be higher than OPEN_MAX.
+ * If that fails and the macro isn't defined, we fall back to an educated
+ * guess. There's no guarantee that our guess is adequate and the program
+ * will die with SIGSEGV if it isn't and the upper boundary is breached. */
+
+#ifdef _SC_OPEN_MAX
+ errno = 0;
+ if ((maxfd = sysconf (_SC_OPEN_MAX)) < 0) {
+ if (errno == 0)
+ maxfd = DEFAULT_MAXFD; /* it's indeterminate */
+ else
+ die (STATE_UNKNOWN, _("sysconf error for _SC_OPEN_MAX\n"));
+ }
+#elif defined(OPEN_MAX)
+ return OPEN_MAX
+#else /* sysconf macro unavailable, so guess (may be wildly inaccurate) */
+ return DEFAULT_MAXFD;
+#endif
+
+ return(maxfd);
+}
diff --git a/lib/maxfd.h b/lib/maxfd.h
new file mode 100644
index 0000000..45218d0
--- /dev/null
+++ b/lib/maxfd.h
@@ -0,0 +1,9 @@
+#ifndef _MAXFD_
+#define _MAXFD_
+
+#define DEFAULT_MAXFD 256 /* fallback value if no max open files value is set */
+#define MAXFD_LIMIT 8192 /* upper limit of open files */
+
+long mp_open_max (void);
+
+#endif // _MAXFD_
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
new file mode 100644
index 0000000..0cc864a
--- /dev/null
+++ b/lib/parse_ini.c
@@ -0,0 +1,396 @@
+/*****************************************************************************
+*
+* Monitoring Plugins parse_ini library
+*
+* License: GPL
+* Copyright (c) 2007 Monitoring Plugins Development Team
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "idpriv.h"
+#include "utils_base.h"
+#include "parse_ini.h"
+
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+/* np_ini_info contains the result of parsing a "locator" in the format
+ * [stanza_name][@config_filename] (check_foo@/etc/foo.ini, for example)
+ */
+typedef struct {
+ char *file;
+ char *stanza;
+} np_ini_info;
+
+static char *default_ini_file_names[] = {
+ "monitoring-plugins.ini",
+ "plugins.ini",
+ "nagios-plugins.ini",
+ NULL
+};
+
+static char *default_ini_path_names[] = {
+ "/usr/local/etc/monitoring-plugins/monitoring-plugins.ini",
+ "/usr/local/etc/monitoring-plugins.ini",
+ "/etc/monitoring-plugins/monitoring-plugins.ini",
+ "/etc/monitoring-plugins.ini",
+ /* deprecated path names (for backward compatibility): */
+ "/etc/nagios/plugins.ini",
+ "/usr/local/nagios/etc/plugins.ini",
+ "/usr/local/etc/nagios/plugins.ini",
+ "/etc/opt/nagios/plugins.ini",
+ "/etc/nagios-plugins.ini",
+ "/usr/local/etc/nagios-plugins.ini",
+ "/etc/opt/nagios-plugins.ini",
+ NULL
+};
+
+/* eat all characters from a FILE pointer until n is encountered */
+#define GOBBLE_TO(f, c, n) do { (c)=fgetc((f)); } while((c)!=EOF && (c)!=(n))
+
+/* internal function that returns the constructed defaults options */
+static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts);
+
+/* internal function that converts a single line into options format */
+static int add_option(FILE *f, np_arg_list **optlst);
+
+/* internal functions to find default file */
+static char *default_file(void);
+static char *default_file_in_path(void);
+
+/*
+ * Parse_locator decomposes a string of the form
+ * [stanza][@filename]
+ * into its separate parts.
+ */
+static void
+parse_locator(const char *locator, const char *def_stanza, np_ini_info *i)
+{
+ size_t locator_len = 0, stanza_len = 0;
+
+ /* if locator is NULL we'll use default values */
+ if (locator != NULL) {
+ locator_len = strlen(locator);
+ stanza_len = strcspn(locator, "@");
+ }
+ /* if a non-default stanza is provided */
+ if (stanza_len > 0) {
+ i->stanza = malloc(sizeof(char) * (stanza_len + 1));
+ strncpy(i->stanza, locator, stanza_len);
+ i->stanza[stanza_len] = '\0';
+ } else /* otherwise we use the default stanza */
+ i->stanza = strdup(def_stanza);
+
+ if (i->stanza == NULL)
+ die(STATE_UNKNOWN, _("malloc() failed!\n"));
+
+ /* check whether there's an @file part */
+ i->file = stanza_len == locator_len
+ ? default_file()
+ : strdup(&(locator[stanza_len + 1]));
+ if (i->file == NULL || i->file[0] == '\0')
+ die(STATE_UNKNOWN,
+ _("Cannot find config file in any standard location.\n"));
+}
+
+/*
+ * This is the externally visible function used by extra_opts.
+ */
+np_arg_list *
+np_get_defaults(const char *locator, const char *default_section)
+{
+ FILE *inifile = NULL;
+ np_arg_list *defaults = NULL;
+ np_ini_info i;
+ int is_suid_plugin = mp_suid();
+
+ if (is_suid_plugin && idpriv_temp_drop() == -1)
+ die(STATE_UNKNOWN, _("Cannot drop privileges: %s\n"),
+ strerror(errno));
+
+ parse_locator(locator, default_section, &i);
+ inifile = strcmp(i.file, "-") == 0 ? stdin : fopen(i.file, "r");
+
+ if (inifile == NULL)
+ die(STATE_UNKNOWN, _("Can't read config file: %s\n"),
+ strerror(errno));
+ if (!read_defaults(inifile, i.stanza, &defaults))
+ die(STATE_UNKNOWN,
+ _("Invalid section '%s' in config file '%s'\n"), i.stanza,
+ i.file);
+
+ free(i.file);
+ if (inifile != stdin)
+ fclose(inifile);
+ free(i.stanza);
+ if (is_suid_plugin && idpriv_temp_restore() == -1)
+ die(STATE_UNKNOWN, _("Cannot restore privileges: %s\n"),
+ strerror(errno));
+
+ return defaults;
+}
+
+/*
+ * The read_defaults() function is where the meat of the parsing takes place.
+ *
+ * Note that this may be called by a setuid binary, so we need to
+ * be extra careful about user-supplied input (i.e. avoiding possible
+ * format string vulnerabilities, etc).
+ */
+static int
+read_defaults(FILE *f, const char *stanza, np_arg_list **opts)
+{
+ int c = 0;
+ bool status = false;
+ size_t i, stanza_len;
+ enum { NOSTANZA, WRONGSTANZA, RIGHTSTANZA } stanzastate = NOSTANZA;
+
+ stanza_len = strlen(stanza);
+
+ /* our little stanza-parsing state machine */
+ while ((c = fgetc(f)) != EOF) {
+ /* gobble up leading whitespace */
+ if (isspace(c))
+ continue;
+ switch (c) {
+ /* globble up comment lines */
+ case ';':
+ case '#':
+ GOBBLE_TO(f, c, '\n');
+ break;
+ /* start of a stanza, check to see if it matches */
+ case '[':
+ stanzastate = WRONGSTANZA;
+ for (i = 0; i < stanza_len; i++) {
+ c = fgetc(f);
+ /* strip leading whitespace */
+ if (i == 0)
+ for (; isspace(c); c = fgetc(f))
+ continue;
+ /* nope, read to the end of the line */
+ if (c != stanza[i]) {
+ GOBBLE_TO(f, c, '\n');
+ break;
+ }
+ }
+ /* if it matched up to here and the next char is ']'... */
+ if (i == stanza_len) {
+ c = fgetc(f);
+ /* strip trailing whitespace */
+ for (; isspace(c); c = fgetc(f))
+ continue;
+ if (c == ']')
+ stanzastate = RIGHTSTANZA;
+ }
+ break;
+ /* otherwise, we're in the body of a stanza or a parse error */
+ default:
+ switch (stanzastate) {
+ /* we never found the start of the first stanza, so
+ * we're dealing with a config error
+ */
+ case NOSTANZA:
+ die(STATE_UNKNOWN, "%s\n",
+ _("Config file error"));
+ /* we're in a stanza, but for a different plugin */
+ case WRONGSTANZA:
+ GOBBLE_TO(f, c, '\n');
+ break;
+ /* okay, this is where we start taking the config */
+ case RIGHTSTANZA:
+ ungetc(c, f);
+ if (add_option(f, opts)) {
+ die(STATE_UNKNOWN, "%s\n",
+ _("Config file error"));
+ }
+ status = true;
+ break;
+ }
+ break;
+ }
+ }
+ return status;
+}
+
+/*
+ * Read one line of input in the format
+ * ^option[[:space:]]*(=[[:space:]]*value)?
+ * and create it as a cmdline argument
+ * --option[=value]
+ * appending it to the linked list optbuf.
+ */
+static int
+add_option(FILE *f, np_arg_list **optlst)
+{
+ np_arg_list *opttmp = *optlst, *optnew;
+ char *linebuf = NULL, *lineend = NULL, *optptr = NULL, *optend = NULL;
+ char *eqptr = NULL, *valptr = NULL, *valend = NULL;
+ short done_reading = 0, equals = 0, value = 0;
+ size_t cfg_len = 0, read_sz = 8, linebuf_sz = 0, read_pos = 0;
+ size_t opt_len = 0, val_len = 0;
+
+ /* read one line from the file */
+ while (!done_reading) {
+ /* grow if necessary */
+ if (linebuf == NULL || read_pos + read_sz >= linebuf_sz) {
+ linebuf_sz = linebuf_sz > 0 ? linebuf_sz << 1 : read_sz;
+ linebuf = realloc(linebuf, linebuf_sz);
+ if (linebuf == NULL)
+ die(STATE_UNKNOWN, _("malloc() failed!\n"));
+ }
+ if (fgets(&linebuf[read_pos], (int)read_sz, f) == NULL)
+ done_reading = 1;
+ else {
+ read_pos = strlen(linebuf);
+ if (linebuf[read_pos - 1] == '\n') {
+ linebuf[--read_pos] = '\0';
+ done_reading = 1;
+ }
+ }
+ }
+ lineend = &linebuf[read_pos];
+ /* all that to read one line, isn't C fun? :) now comes the parsing :/ */
+
+ /* skip leading whitespace */
+ for (optptr = linebuf; optptr < lineend && isspace(*optptr); optptr++)
+ continue;
+ /* continue to '=' or EOL, watching for spaces that might precede it */
+ for (eqptr = optptr; eqptr < lineend && *eqptr != '='; eqptr++) {
+ if (isspace(*eqptr) && optend == NULL)
+ optend = eqptr;
+ else
+ optend = NULL;
+ }
+ if (optend == NULL)
+ optend = eqptr;
+ --optend;
+ /* ^[[:space:]]*=foo is a syntax error */
+ if (optptr == eqptr)
+ die(STATE_UNKNOWN, "%s\n", _("Config file error"));
+ /* continue from '=' to start of value or EOL */
+ for (valptr = eqptr + 1; valptr < lineend && isspace(*valptr);
+ valptr++)
+ continue;
+ /* continue to the end of value */
+ for (valend = valptr; valend < lineend; valend++)
+ continue;
+ --valend;
+ /* finally trim off trailing spaces */
+ for (; isspace(*valend); valend--)
+ continue;
+ /* calculate the length of "--foo" */
+ opt_len = (size_t)(1 + optend - optptr);
+ /* 1-character params needs only one dash */
+ if (opt_len == 1)
+ cfg_len = 1 + (opt_len);
+ else
+ cfg_len = 2 + (opt_len);
+ /* if valptr<lineend then we have to also allocate space for "=bar" */
+ if (valptr < lineend) {
+ equals = value = 1;
+ val_len = (size_t)(1 + valend - valptr);
+ cfg_len += 1 + val_len;
+ }
+ /* if valptr==valend then we have "=" but no "bar" */
+ else if (valptr == lineend) {
+ equals = 1;
+ cfg_len += 1;
+ }
+ /* a line with no equal sign isn't valid */
+ if (equals == 0)
+ die(STATE_UNKNOWN, "%s\n", _("Config file error"));
+
+ /* okay, now we have all the info we need, so we create a new np_arg_list
+ * element and set the argument...
+ */
+ optnew = malloc(sizeof(np_arg_list));
+ optnew->next = NULL;
+
+ read_pos = 0;
+ optnew->arg = malloc(cfg_len + 1);
+ /* 1-character params needs only one dash */
+ if (opt_len == 1) {
+ strncpy(&optnew->arg[read_pos], "-", 1);
+ read_pos += 1;
+ } else {
+ strncpy(&optnew->arg[read_pos], "--", 2);
+ read_pos += 2;
+ }
+ strncpy(&optnew->arg[read_pos], optptr, opt_len);
+ read_pos += opt_len;
+ if (value) {
+ optnew->arg[read_pos++] = '=';
+ strncpy(&optnew->arg[read_pos], valptr, val_len);
+ read_pos += val_len;
+ }
+ optnew->arg[read_pos] = '\0';
+
+ /* ...and put that to the end of the list */
+ if (*optlst == NULL)
+ *optlst = optnew;
+ else {
+ while (opttmp->next != NULL)
+ opttmp = opttmp->next;
+ opttmp->next = optnew;
+ }
+
+ free(linebuf);
+ return 0;
+}
+
+static char *
+default_file(void)
+{
+ char **p, *ini_file;
+
+ if ((ini_file = getenv("MP_CONFIG_FILE")) != NULL ||
+ (ini_file = default_file_in_path()) != NULL)
+ return ini_file;
+ for (p = default_ini_path_names; *p != NULL; p++)
+ if (access(*p, F_OK) == 0)
+ return *p;
+ return NULL;
+}
+
+static char *
+default_file_in_path(void)
+{
+ char *config_path, **file;
+ char *dir, *ini_file, *tokens;
+
+ if ((config_path = getenv("NAGIOS_CONFIG_PATH")) == NULL)
+ return NULL;
+ /* shall we spit out a warning that NAGIOS_CONFIG_PATH is deprecated? */
+
+ if ((tokens = strdup(config_path)) == NULL)
+ die(STATE_UNKNOWN, "%s\n", _("Insufficient Memory"));
+ for (dir = strtok(tokens, ":"); dir != NULL; dir = strtok(NULL, ":")) {
+ for (file = default_ini_file_names; *file != NULL; file++) {
+ if ((asprintf(&ini_file, "%s/%s", dir, *file)) < 0)
+ die(STATE_UNKNOWN, "%s\n", _("Insufficient Memory"));
+ if (access(ini_file, F_OK) == 0) {
+ free(tokens);
+ return ini_file;
+ }
+ }
+ }
+ free(tokens);
+ return NULL;
+}
diff --git a/lib/parse_ini.h b/lib/parse_ini.h
new file mode 100644
index 0000000..e37601b
--- /dev/null
+++ b/lib/parse_ini.h
@@ -0,0 +1,22 @@
+#ifndef _PARSE_INI_H_
+#define _PARSE_INI_H_
+
+/*
+ * parse_ini.h: routines for loading monitoring-plugin defaults from ini
+ * configuration files.
+ */
+
+/* np_arg_list is a linked list of arguments passed between the ini
+ * parser and the argument parser to construct the final array */
+typedef struct np_arg_el {
+ char *arg;
+ struct np_arg_el *next;
+} np_arg_list;
+
+/* np_load_defaults: load the default configuration (if present) for
+ * a plugin from the ini file
+ */
+np_arg_list *np_get_defaults(const char *locator, const char *default_section);
+
+#endif /* _PARSE_INI_H_ */
+
diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
new file mode 100644
index 0000000..31d79df
--- /dev/null
+++ b/lib/tests/Makefile.am
@@ -0,0 +1,39 @@
+
+noinst_PROGRAMS = @EXTRA_TEST@
+
+# These two lines support "make check", but we use "make test"
+TESTS = @EXTRA_TEST@
+check_PROGRAMS = @EXTRA_TEST@
+
+AM_CPPFLAGS = -DNP_STATE_DIR_PREFIX=\"$(localstatedir)\" \
+ -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
+
+EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd test_base64 test_ini1 test_ini3 test_opts1 test_opts2 test_opts3
+
+np_test_scripts = test_base64.t test_cmd.t test_disk.t test_ini1.t test_ini3.t test_opts1.t test_opts2.t test_opts3.t test_tcp.t test_utils.t
+np_test_files = config-dos.ini config-opts.ini config-tiny.ini plugin.ini plugins.ini
+EXTRA_DIST = $(np_test_scripts) $(np_test_files) var
+
+LIBS = @LTLIBINTL@
+
+if USE_LIBTAP_LOCAL
+tap_cflags = -I$(top_srcdir)/tap
+tap_ldflags = -L$(top_srcdir)/tap
+tap_ldadd = $(top_srcdir)/gl/libgnu.a
+else
+## Shouldn't we detect that??
+tap_ldflags = -L/usr/local/lib
+endif
+
+AM_CFLAGS = -g -I$(top_srcdir)/lib -I$(top_srcdir)/gl $(tap_cflags)
+AM_LDFLAGS = $(tap_ldflags) -ltap
+LDADD = $(top_srcdir)/lib/libmonitoringplug.a $(top_srcdir)/gl/libgnu.a $(LIB_CRYPTO)
+
+SOURCES = test_utils.c test_disk.c test_tcp.c test_cmd.c test_base64.c test_ini1.c test_ini3.c test_opts1.c test_opts2.c test_opts3.c
+
+test: ${noinst_PROGRAMS}
+ perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
+
+test-debug: ${noinst_PROGRAMS}
+ perl -MTest::Harness -e '$$Test::Harness::verbose=1; $$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
+
diff --git a/lib/tests/Makefile.in b/lib/tests/Makefile.in
new file mode 100644
index 0000000..b06b0d1
--- /dev/null
+++ b/lib/tests/Makefile.in
@@ -0,0 +1,2545 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+EXTRA_PROGRAMS = test_utils$(EXEEXT) test_disk$(EXEEXT) \
+ test_tcp$(EXEEXT) test_cmd$(EXEEXT) test_base64$(EXEEXT) \
+ test_ini1$(EXEEXT) test_ini3$(EXEEXT) test_opts1$(EXEEXT) \
+ test_opts2$(EXEEXT) test_opts3$(EXEEXT)
+subdir = lib/tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+test_base64_SOURCES = test_base64.c
+test_base64_OBJECTS = test_base64.$(OBJEXT)
+test_base64_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+test_base64_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+test_cmd_SOURCES = test_cmd.c
+test_cmd_OBJECTS = test_cmd.$(OBJEXT)
+test_cmd_LDADD = $(LDADD)
+test_cmd_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_disk_SOURCES = test_disk.c
+test_disk_OBJECTS = test_disk.$(OBJEXT)
+test_disk_LDADD = $(LDADD)
+test_disk_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_ini1_SOURCES = test_ini1.c
+test_ini1_OBJECTS = test_ini1.$(OBJEXT)
+test_ini1_LDADD = $(LDADD)
+test_ini1_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_ini3_SOURCES = test_ini3.c
+test_ini3_OBJECTS = test_ini3.$(OBJEXT)
+test_ini3_LDADD = $(LDADD)
+test_ini3_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_opts1_SOURCES = test_opts1.c
+test_opts1_OBJECTS = test_opts1.$(OBJEXT)
+test_opts1_LDADD = $(LDADD)
+test_opts1_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_opts2_SOURCES = test_opts2.c
+test_opts2_OBJECTS = test_opts2.$(OBJEXT)
+test_opts2_LDADD = $(LDADD)
+test_opts2_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_opts3_SOURCES = test_opts3.c
+test_opts3_OBJECTS = test_opts3.$(OBJEXT)
+test_opts3_LDADD = $(LDADD)
+test_opts3_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_tcp_SOURCES = test_tcp.c
+test_tcp_OBJECTS = test_tcp.$(OBJEXT)
+test_tcp_LDADD = $(LDADD)
+test_tcp_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+test_utils_SOURCES = test_utils.c
+test_utils_OBJECTS = test_utils.$(OBJEXT)
+test_utils_LDADD = $(LDADD)
+test_utils_DEPENDENCIES = $(top_srcdir)/lib/libmonitoringplug.a \
+ $(top_srcdir)/gl/libgnu.a $(am__DEPENDENCIES_1)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/test_base64.Po \
+ ./$(DEPDIR)/test_cmd.Po ./$(DEPDIR)/test_disk.Po \
+ ./$(DEPDIR)/test_ini1.Po ./$(DEPDIR)/test_ini3.Po \
+ ./$(DEPDIR)/test_opts1.Po ./$(DEPDIR)/test_opts2.Po \
+ ./$(DEPDIR)/test_opts3.Po ./$(DEPDIR)/test_tcp.Po \
+ ./$(DEPDIR)/test_utils.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+DIST_SOURCES = test_base64.c test_cmd.c test_disk.c test_ini1.c \
+ test_ini3.c test_opts1.c test_opts2.c test_opts3.c test_tcp.c \
+ test_utils.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/mkinstalldirs \
+ $(top_srcdir)/build-aux/test-driver README
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LTLIBINTL@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+noinst_PROGRAMS = @EXTRA_TEST@
+
+# These two lines support "make check", but we use "make test"
+TESTS = @EXTRA_TEST@
+check_PROGRAMS = @EXTRA_TEST@
+AM_CPPFLAGS = -DNP_STATE_DIR_PREFIX=\"$(localstatedir)\" \
+ -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
+
+np_test_scripts = test_base64.t test_cmd.t test_disk.t test_ini1.t test_ini3.t test_opts1.t test_opts2.t test_opts3.t test_tcp.t test_utils.t
+np_test_files = config-dos.ini config-opts.ini config-tiny.ini plugin.ini plugins.ini
+EXTRA_DIST = $(np_test_scripts) $(np_test_files) var
+@USE_LIBTAP_LOCAL_TRUE@tap_cflags = -I$(top_srcdir)/tap
+@USE_LIBTAP_LOCAL_FALSE@tap_ldflags = -L/usr/local/lib
+@USE_LIBTAP_LOCAL_TRUE@tap_ldflags = -L$(top_srcdir)/tap
+@USE_LIBTAP_LOCAL_TRUE@tap_ldadd = $(top_srcdir)/gl/libgnu.a
+AM_CFLAGS = -g -I$(top_srcdir)/lib -I$(top_srcdir)/gl $(tap_cflags)
+AM_LDFLAGS = $(tap_ldflags) -ltap
+LDADD = $(top_srcdir)/lib/libmonitoringplug.a $(top_srcdir)/gl/libgnu.a $(LIB_CRYPTO)
+SOURCES = test_utils.c test_disk.c test_tcp.c test_cmd.c test_base64.c test_ini1.c test_ini3.c test_opts1.c test_opts2.c test_opts3.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu lib/tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+test_base64$(EXEEXT): $(test_base64_OBJECTS) $(test_base64_DEPENDENCIES) $(EXTRA_test_base64_DEPENDENCIES)
+ @rm -f test_base64$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_base64_OBJECTS) $(test_base64_LDADD) $(LIBS)
+
+test_cmd$(EXEEXT): $(test_cmd_OBJECTS) $(test_cmd_DEPENDENCIES) $(EXTRA_test_cmd_DEPENDENCIES)
+ @rm -f test_cmd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_cmd_OBJECTS) $(test_cmd_LDADD) $(LIBS)
+
+test_disk$(EXEEXT): $(test_disk_OBJECTS) $(test_disk_DEPENDENCIES) $(EXTRA_test_disk_DEPENDENCIES)
+ @rm -f test_disk$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_disk_OBJECTS) $(test_disk_LDADD) $(LIBS)
+
+test_ini1$(EXEEXT): $(test_ini1_OBJECTS) $(test_ini1_DEPENDENCIES) $(EXTRA_test_ini1_DEPENDENCIES)
+ @rm -f test_ini1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ini1_OBJECTS) $(test_ini1_LDADD) $(LIBS)
+
+test_ini3$(EXEEXT): $(test_ini3_OBJECTS) $(test_ini3_DEPENDENCIES) $(EXTRA_test_ini3_DEPENDENCIES)
+ @rm -f test_ini3$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ini3_OBJECTS) $(test_ini3_LDADD) $(LIBS)
+
+test_opts1$(EXEEXT): $(test_opts1_OBJECTS) $(test_opts1_DEPENDENCIES) $(EXTRA_test_opts1_DEPENDENCIES)
+ @rm -f test_opts1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_opts1_OBJECTS) $(test_opts1_LDADD) $(LIBS)
+
+test_opts2$(EXEEXT): $(test_opts2_OBJECTS) $(test_opts2_DEPENDENCIES) $(EXTRA_test_opts2_DEPENDENCIES)
+ @rm -f test_opts2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_opts2_OBJECTS) $(test_opts2_LDADD) $(LIBS)
+
+test_opts3$(EXEEXT): $(test_opts3_OBJECTS) $(test_opts3_DEPENDENCIES) $(EXTRA_test_opts3_DEPENDENCIES)
+ @rm -f test_opts3$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_opts3_OBJECTS) $(test_opts3_LDADD) $(LIBS)
+
+test_tcp$(EXEEXT): $(test_tcp_OBJECTS) $(test_tcp_DEPENDENCIES) $(EXTRA_test_tcp_DEPENDENCIES)
+ @rm -f test_tcp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_tcp_OBJECTS) $(test_tcp_LDADD) $(LIBS)
+
+test_utils$(EXEEXT): $(test_utils_OBJECTS) $(test_utils_DEPENDENCIES) $(EXTRA_test_utils_DEPENDENCIES)
+ @rm -f test_utils$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_utils_OBJECTS) $(test_utils_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_base64.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cmd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_disk.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ini1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ini3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_opts1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_opts2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_opts3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tcp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utils.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS: $(check_PROGRAMS)
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_PROGRAMS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/test_base64.Po
+ -rm -f ./$(DEPDIR)/test_cmd.Po
+ -rm -f ./$(DEPDIR)/test_disk.Po
+ -rm -f ./$(DEPDIR)/test_ini1.Po
+ -rm -f ./$(DEPDIR)/test_ini3.Po
+ -rm -f ./$(DEPDIR)/test_opts1.Po
+ -rm -f ./$(DEPDIR)/test_opts2.Po
+ -rm -f ./$(DEPDIR)/test_opts3.Po
+ -rm -f ./$(DEPDIR)/test_tcp.Po
+ -rm -f ./$(DEPDIR)/test_utils.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/test_base64.Po
+ -rm -f ./$(DEPDIR)/test_cmd.Po
+ -rm -f ./$(DEPDIR)/test_disk.Po
+ -rm -f ./$(DEPDIR)/test_ini1.Po
+ -rm -f ./$(DEPDIR)/test_ini3.Po
+ -rm -f ./$(DEPDIR)/test_opts1.Po
+ -rm -f ./$(DEPDIR)/test_opts2.Po
+ -rm -f ./$(DEPDIR)/test_opts3.Po
+ -rm -f ./$(DEPDIR)/test_tcp.Po
+ -rm -f ./$(DEPDIR)/test_utils.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am recheck tags tags-am uninstall \
+ uninstall-am
+
+.PRECIOUS: Makefile
+
+
+test: ${noinst_PROGRAMS}
+ perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
+
+test-debug: ${noinst_PROGRAMS}
+ perl -MTest::Harness -e '$$Test::Harness::verbose=1; $$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/lib/tests/README b/lib/tests/README
new file mode 100644
index 0000000..66935e4
--- /dev/null
+++ b/lib/tests/README
@@ -0,0 +1,5 @@
+The tests in here use the libtap library functions
+(http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap), so are
+more for unit testing the utils.c library functions.
+
+However, it probably should be merged into the plugins/t subdirectory.
diff --git a/lib/tests/config-dos.ini b/lib/tests/config-dos.ini
new file mode 100644
index 0000000..0cea3f3
--- /dev/null
+++ b/lib/tests/config-dos.ini
@@ -0,0 +1,24 @@
+# This config file is amended from perl's Config::Tiny's testcases
+
+# Line below is allowed in perl's Config::Tiny, but not in our parse_ini.c
+#root=something
+
+[section]
+one=two
+Foo=Bar
+this=Your Mother!
+blank=
+
+[Section Two]
+something else=blah
+ remove = whitespace
+
+[ /path/to/file.txt ]
+this=that
+
+[ section2]
+this=that
+
+[section3 ]
+this=that
+
diff --git a/lib/tests/config-opts.ini b/lib/tests/config-opts.ini
new file mode 100644
index 0000000..5c93572
--- /dev/null
+++ b/lib/tests/config-opts.ini
@@ -0,0 +1,14 @@
+# This config file is for testing test_opts
+
+[sect1]
+one=two
+
+[check_disk]
+foo=Bar
+this=Your Mother!
+blank=
+
+[sect2]
+something else=oops
+this=that
+
diff --git a/lib/tests/config-tiny.ini b/lib/tests/config-tiny.ini
new file mode 100644
index 0000000..60f3dad
--- /dev/null
+++ b/lib/tests/config-tiny.ini
@@ -0,0 +1,24 @@
+# This config file is amended from perl's Config::Tiny's testcases
+
+# Line below is allowed in perl's Config::Tiny, but not in our parse_ini.c
+#root=something
+
+[section]
+one=two
+Foo=Bar
+this=Your Mother!
+blank=
+
+[Section Two]
+something else=blah
+ remove = whitespace
+
+[ /path/to/file.txt ]
+this=that
+
+[ section2]
+this=that
+
+[section3 ]
+this=that
+
diff --git a/lib/tests/plugin.ini b/lib/tests/plugin.ini
new file mode 100644
index 0000000..511fd9f
--- /dev/null
+++ b/lib/tests/plugin.ini
@@ -0,0 +1,24 @@
+# Non-standard (but accepted) comment
+; standard ini comment
+
+[check_mysql]
+username=operator
+; comment in the middle
+password=secret
+
+[section_twice]
+foo=bar
+
+[check_mysql2]
+u=admin
+p=secret
+
+[section_twice]
+bar=foo
+
+[check space_and_flags]
+foo=bar
+a=
+b=
+bar=
+
diff --git a/lib/tests/plugins.ini b/lib/tests/plugins.ini
new file mode 100644
index 0000000..6c2039f
--- /dev/null
+++ b/lib/tests/plugins.ini
@@ -0,0 +1,17 @@
+
+[check_disk]
+foo=bar
+
+[section1]
+foobar=baz
+
+; defaults for check_tcp
+[check_tcp]
+timeout = 10
+
+[tcp_long_lines]
+escape =
+send = Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda
+expect = Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda
+jail=
+
diff --git a/lib/tests/test_base64.c b/lib/tests/test_base64.c
new file mode 100644
index 0000000..05dd794
--- /dev/null
+++ b/lib/tests/test_base64.c
@@ -0,0 +1,349 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "gl/base64.h"
+#include "tap.h"
+
+int
+main (int argc, char **argv)
+{
+#if 0 /* The current base64 function doesn't work on 8bit data */
+ char random[1024] = {
+ 0x8b,0xb0,0xc4,0xe2,0xfc,0x22,0x9f,0x0d,0x85,0xe7,0x2c,0xaa,0x39,0xa1,0x46,0x88,
+ 0x50,0xe6,0x34,0x37,0x0b,0x45,0x4b,0xb8,0xb2,0x86,0x7a,0x3e,0x7f,0x0c,0x40,0x18,
+ 0x6b,0xad,0xe0,0x4c,0x60,0x8c,0xa3,0xc3,0x3b,0x3e,0x9b,0x16,0x84,0xc6,0xd8,0x3f,
+ 0x40,0xea,0x91,0x85,0xe3,0x71,0x94,0xb5,0xc7,0xf9,0x13,0xef,0x6b,0xa7,0x18,0x5b,
+ 0x48,0xa7,0xbe,0xef,0x95,0xb3,0xcf,0xbe,0x5e,0x51,0xf3,0x68,0x25,0x8f,0x06,0x5b,
+ 0xfc,0xf2,0xf5,0x3e,0x3f,0x1b,0x5c,0x6d,0xea,0x39,0xfc,0xe3,0xe3,0xe0,0xec,0xfa,
+ 0xb3,0x76,0x52,0x13,0xa5,0x33,0xfd,0x65,0xa3,0xa7,0x91,0x86,0x06,0xc7,0x71,0x9e,
+ 0x14,0x74,0x63,0x70,0xad,0x15,0xa7,0x18,0xd1,0x06,0x85,0x33,0x91,0x2c,0x6b,0x80,
+ 0x2d,0xf7,0x20,0xc8,0x8d,0xf3,0x51,0x45,0xa5,0x7f,0x7f,0xb5,0xa6,0xae,0x26,0x53,
+ 0xa4,0x68,0x1e,0x0e,0xd8,0x3a,0x59,0x50,0xd6,0xb7,0x5f,0xe6,0x01,0x4c,0xda,0xe4,
+ 0x32,0xd0,0xfb,0xea,0xa0,0x72,0x2b,0x9d,0x7e,0x43,0xfb,0xe1,0x42,0x0b,0xe1,0x73,
+ 0xa4,0xf9,0x3a,0x6b,0x4a,0xf9,0x6e,0x89,0x0f,0xa7,0xad,0x8c,0xde,0x32,0x4b,0x0d,
+ 0x79,0xc6,0x39,0xa1,0x0a,0x26,0xdf,0x3a,0x80,0x26,0x3f,0x13,0xae,0xfe,0x50,0x2b,
+ 0xe7,0xc6,0xf2,0x3f,0xbb,0x01,0xc6,0x9b,0x0b,0x35,0xc9,0xb9,0x99,0xf0,0x3d,0x82,
+ 0x41,0x8e,0x38,0x85,0xf6,0x65,0xcf,0xb1,0x6c,0xde,0x97,0x04,0x15,0x36,0xa6,0x64,
+ 0xb4,0x94,0x17,0xfc,0x0e,0x0b,0xdb,0x55,0xd3,0x6b,0x80,0x42,0x41,0xcf,0x82,0x5c,
+ 0x13,0x8a,0x2c,0xac,0x3e,0x90,0x94,0xb3,0x45,0xfc,0xfa,0xda,0xb1,0xe1,0xb9,0x88,
+ 0xa2,0xea,0x9e,0x0f,0xef,0x9b,0x6c,0x13,0xde,0x79,0xa0,0xf9,0xd0,0xe2,0x06,0xac,
+ 0xf6,0x97,0x04,0xab,0xaa,0xf5,0x9f,0x8c,0x37,0xce,0x8f,0xfb,0x2d,0x34,0x75,0xe0,
+ 0x31,0xf4,0xae,0x8a,0x4a,0x11,0xec,0xc9,0xa5,0x81,0x3a,0x3d,0xa2,0x9e,0xed,0x18,
+ 0x51,0x78,0xad,0xe2,0x31,0xcc,0x50,0x40,0x97,0xcb,0x6f,0xa2,0x80,0x7f,0xe1,0x2a,
+ 0x34,0xbe,0x00,0x5f,0x2f,0x5f,0xaf,0x94,0x2a,0xd5,0x27,0x9f,0x46,0x9f,0x92,0x46,
+ 0x5e,0x1e,0x0c,0x7c,0xb8,0x81,0xe1,0xe4,0xf6,0x22,0x6e,0x08,0x20,0xb8,0x4f,0x73,
+ 0x72,0x55,0x92,0xc2,0x99,0x50,0xe1,0xc3,0xf7,0x7d,0xc1,0xae,0x35,0x4f,0xbd,0xb1,
+ 0x28,0xd8,0x67,0x9b,0x03,0xd1,0xa0,0xb2,0x9c,0x88,0xee,0x37,0xf5,0xb7,0x44,0xcf,
+ 0x68,0x19,0x87,0x64,0x14,0xa8,0x25,0xab,0x69,0xb5,0x98,0x27,0x26,0x14,0x93,0xf0,
+ 0x42,0x19,0x12,0x75,0x3e,0x02,0x5d,0x7c,0x93,0x9f,0x96,0xd3,0xbb,0x74,0xc8,0xbc,
+ 0xde,0xb9,0x6c,0x9c,0x9c,0xf4,0xb9,0x9f,0x80,0x9b,0x06,0x8a,0xe8,0xbb,0xd2,0x4f,
+ 0x9e,0xee,0xbc,0x35,0x8c,0xb8,0x0e,0x0b,0xbb,0x9a,0xf6,0x23,0xa9,0xd3,0x9e,0xdf,
+ 0xc1,0x0c,0x4b,0x0a,0x65,0xa8,0x78,0x67,0x48,0x59,0xa6,0x6d,0xb1,0xf6,0xa3,0x70,
+ 0xe1,0x64,0x3b,0xb8,0x79,0x66,0xf4,0xd3,0xac,0x64,0xe4,0x54,0x83,0x54,0x65,0xc4,
+ 0x4c,0x98,0xcf,0x48,0x20,0x4f,0xf2,0x90,0xbf,0x8c,0x52,0x2d,0x03,0x14,0x83,0xd1,
+ 0x42,0x90,0x77,0xea,0x34,0x06,0x32,0x83,0xf2,0x14,0xfc,0x88,0x5d,0xd2,0x9a,0xe2,
+ 0x7c,0x3e,0x30,0xfe,0x5f,0x7f,0xd4,0x0f,0x44,0x49,0x5d,0x5e,0x90,0x6a,0x86,0x2b,
+ 0x86,0xd3,0x90,0x39,0xb7,0x32,0x4a,0x4e,0x3d,0x2b,0xe5,0xb8,0x39,0x87,0x72,0xd4,
+ 0xe4,0x4d,0xd6,0x6a,0x03,0xa2,0x70,0xfb,0x5f,0xe0,0x8b,0xaa,0x8b,0x6b,0x10,0x64,
+ 0x94,0x85,0x22,0x80,0x73,0xc0,0x23,0xdb,0xd1,0x9f,0x2b,0x9a,0xdd,0xe9,0xfa,0xc6,
+ 0x0c,0x5f,0xb2,0xcb,0xca,0x28,0xd2,0xf9,0x5b,0x92,0x42,0x98,0x80,0xdd,0x27,0xb1,
+ 0xd3,0x3c,0x4c,0xb6,0x4e,0x38,0x3f,0x72,0x83,0x71,0x02,0x5b,0xb6,0xd9,0xff,0x75,
+ 0xee,0x88,0xd4,0x8d,0xb4,0x1c,0x34,0xd7,0xdd,0xe9,0x48,0x80,0x3b,0x85,0x07,0xee,
+ 0x27,0xe5,0x6e,0xc0,0xbd,0x3a,0xcf,0xf2,0x5d,0xb9,0x16,0x0f,0xe3,0x92,0x92,0x15,
+ 0x3a,0x70,0x0d,0x57,0x98,0x8d,0xde,0xbd,0xa2,0x68,0x68,0x7c,0x6d,0x4f,0x8c,0xfb,
+ 0x89,0x2d,0x4a,0x73,0xa0,0x47,0x07,0xd7,0x75,0x5d,0x53,0x70,0x34,0x21,0x40,0x57,
+ 0x51,0xde,0xc9,0xc4,0x80,0xd4,0x27,0x84,0x68,0xfe,0x59,0x56,0xd8,0xf4,0x14,0xbc,
+ 0x96,0xb3,0x41,0x96,0x4b,0xaf,0x49,0x37,0x0a,0x54,0x88,0x08,0x1f,0x39,0x67,0xf6,
+ 0xa8,0xa8,0x87,0x9d,0xe1,0xc7,0xd1,0x4d,0x75,0x26,0xd2,0xc7,0xc7,0x8c,0x57,0xd8,
+ 0x74,0x3e,0xe2,0xec,0xd8,0xba,0xc4,0x9e,0x96,0xae,0xa1,0x1c,0x73,0xc5,0x67,0x74,
+ 0x4f,0x33,0xe6,0x0e,0x74,0xe6,0x26,0x1f,0x2e,0x38,0xc4,0x40,0x7e,0xaa,0xd0,0x52,
+ 0xde,0xc3,0x81,0x7a,0xb8,0x49,0xbc,0x55,0x4d,0x5a,0xc4,0x08,0x26,0x59,0xcd,0x45,
+ 0x8b,0x48,0x0a,0x33,0xde,0xca,0xcd,0x75,0x16,0x97,0xe3,0xc6,0x81,0x2a,0xd5,0xfb,
+ 0x8f,0x82,0xf3,0x6a,0x4b,0xff,0xf5,0x65,0xbc,0x4c,0xb3,0x39,0xec,0xf4,0x85,0x60,
+ 0x0f,0xff,0x2d,0x41,0x4d,0x4d,0xc6,0xf1,0x89,0x6f,0x4f,0xe0,0x15,0x0f,0x46,0xf3,
+ 0xe3,0xcc,0xde,0x74,0x30,0x8d,0x28,0x43,0x88,0x72,0xb2,0x04,0xae,0x31,0x29,0xa7,
+ 0x44,0x6d,0x93,0x97,0xc8,0x8f,0x49,0x52,0x10,0x93,0x7f,0x97,0x96,0xe2,0x79,0x35,
+ 0x78,0xbe,0x81,0x7c,0xae,0x0f,0x76,0xbe,0x5e,0x53,0x6c,0x5b,0x5f,0x7c,0x99,0x41,
+ 0x82,0xaf,0x97,0x64,0x41,0x75,0x90,0x04,0x47,0xfc,0xbd,0x4b,0xd2,0x80,0x10,0x5d,
+ 0x51,0x4e,0x7a,0xa7,0x25,0xd5,0xc0,0x12,0x35,0x60,0x05,0x1b,0x34,0xad,0x84,0x7a,
+ 0x6a,0x69,0x82,0x79,0x83,0xba,0x2f,0x06,0x8a,0x79,0x7b,0x12,0x5d,0x7c,0x52,0xa9,
+ 0xc7,0xd8,0x12,0x73,0x3f,0x27,0xd6,0x05,0x8c,0x48,0xb2,0x58,0xeb,0x57,0xdc,0x83,
+ 0x64,0xd6,0x91,0xd2,0x7a,0xb0,0xb6,0x29,0x17,0x3b,0x68,0xfa,0xfc,0x85,0x6b,0xeb,
+ 0x13,0xea,0xa4,0x5c,0x68,0x42,0x98,0xb2,0x83,0xf3,0xee,0x84,0x21,0xae,0x81,0x84,
+ 0xe3,0x7d,0x44,0xc1,0x12,0xb1,0x0b,0x95,0x9f,0x70,0x80,0xae,0xe6,0x94,0x3c,0x7f,
+ 0xab,0x00,0x9f,0x0c,0xa8,0x59,0x0a,0x96,0xc9,0x5a,0x5c,0xe4,0xe5,0xcb,0x91,0x29,
+ 0x15,0xb6,0x5a,0xe5,0x19,0xcf,0x60,0x23,0xba,0x3a,0x93,0x25,0x02,0x78,0xcc,0x54
+ };
+
+ char b64_known[1368] = {
+ 0x69,0x37,0x44,0x45,0x34,0x76,0x77,0x69,0x6e,0x77,0x32,0x46,0x35,0x79,0x79,0x71,
+ 0x4f,0x61,0x46,0x47,0x69,0x46,0x44,0x6d,0x4e,0x44,0x63,0x4c,0x52,0x55,0x75,0x34,
+ 0x73,0x6f,0x5a,0x36,0x50,0x6e,0x38,0x4d,0x51,0x42,0x68,0x72,0x72,0x65,0x42,0x4d,
+ 0x59,0x49,0x79,0x6a,0x77,0x7a,0x73,0x2b,0x6d,0x78,0x61,0x45,0x78,0x74,0x67,0x2f,
+ 0x51,0x4f,0x71,0x52,0x68,0x65,0x4e,0x78,0x6c,0x4c,0x58,0x48,0x2b,0x52,0x50,0x76,
+ 0x61,0x36,0x63,0x59,0x57,0x30,0x69,0x6e,0x76,0x75,0x2b,0x56,0x73,0x38,0x2b,0x2b,
+ 0x58,0x6c,0x48,0x7a,0x61,0x43,0x57,0x50,0x42,0x6c,0x76,0x38,0x38,0x76,0x55,0x2b,
+ 0x50,0x78,0x74,0x63,0x62,0x65,0x6f,0x35,0x2f,0x4f,0x50,0x6a,0x34,0x4f,0x7a,0x36,
+ 0x73,0x33,0x5a,0x53,0x45,0x36,0x55,0x7a,0x2f,0x57,0x57,0x6a,0x70,0x35,0x47,0x47,
+ 0x42,0x73,0x64,0x78,0x6e,0x68,0x52,0x30,0x59,0x33,0x43,0x74,0x46,0x61,0x63,0x59,
+ 0x30,0x51,0x61,0x46,0x4d,0x35,0x45,0x73,0x61,0x34,0x41,0x74,0x39,0x79,0x44,0x49,
+ 0x6a,0x66,0x4e,0x52,0x52,0x61,0x56,0x2f,0x66,0x37,0x57,0x6d,0x72,0x69,0x5a,0x54,
+ 0x70,0x47,0x67,0x65,0x44,0x74,0x67,0x36,0x57,0x56,0x44,0x57,0x74,0x31,0x2f,0x6d,
+ 0x41,0x55,0x7a,0x61,0x35,0x44,0x4c,0x51,0x2b,0x2b,0x71,0x67,0x63,0x69,0x75,0x64,
+ 0x66,0x6b,0x50,0x37,0x34,0x55,0x49,0x4c,0x34,0x58,0x4f,0x6b,0x2b,0x54,0x70,0x72,
+ 0x53,0x76,0x6c,0x75,0x69,0x51,0x2b,0x6e,0x72,0x59,0x7a,0x65,0x4d,0x6b,0x73,0x4e,
+ 0x65,0x63,0x59,0x35,0x6f,0x51,0x6f,0x6d,0x33,0x7a,0x71,0x41,0x4a,0x6a,0x38,0x54,
+ 0x72,0x76,0x35,0x51,0x4b,0x2b,0x66,0x47,0x38,0x6a,0x2b,0x37,0x41,0x63,0x61,0x62,
+ 0x43,0x7a,0x58,0x4a,0x75,0x5a,0x6e,0x77,0x50,0x59,0x4a,0x42,0x6a,0x6a,0x69,0x46,
+ 0x39,0x6d,0x58,0x50,0x73,0x57,0x7a,0x65,0x6c,0x77,0x51,0x56,0x4e,0x71,0x5a,0x6b,
+ 0x74,0x4a,0x51,0x58,0x2f,0x41,0x34,0x4c,0x32,0x31,0x58,0x54,0x61,0x34,0x42,0x43,
+ 0x51,0x63,0x2b,0x43,0x58,0x42,0x4f,0x4b,0x4c,0x4b,0x77,0x2b,0x6b,0x4a,0x53,0x7a,
+ 0x52,0x66,0x7a,0x36,0x32,0x72,0x48,0x68,0x75,0x59,0x69,0x69,0x36,0x70,0x34,0x50,
+ 0x37,0x35,0x74,0x73,0x45,0x39,0x35,0x35,0x6f,0x50,0x6e,0x51,0x34,0x67,0x61,0x73,
+ 0x39,0x70,0x63,0x45,0x71,0x36,0x72,0x31,0x6e,0x34,0x77,0x33,0x7a,0x6f,0x2f,0x37,
+ 0x4c,0x54,0x52,0x31,0x34,0x44,0x48,0x30,0x72,0x6f,0x70,0x4b,0x45,0x65,0x7a,0x4a,
+ 0x70,0x59,0x45,0x36,0x50,0x61,0x4b,0x65,0x37,0x52,0x68,0x52,0x65,0x4b,0x33,0x69,
+ 0x4d,0x63,0x78,0x51,0x51,0x4a,0x66,0x4c,0x62,0x36,0x4b,0x41,0x66,0x2b,0x45,0x71,
+ 0x4e,0x4c,0x34,0x41,0x58,0x79,0x39,0x66,0x72,0x35,0x51,0x71,0x31,0x53,0x65,0x66,
+ 0x52,0x70,0x2b,0x53,0x52,0x6c,0x34,0x65,0x44,0x48,0x79,0x34,0x67,0x65,0x48,0x6b,
+ 0x39,0x69,0x4a,0x75,0x43,0x43,0x43,0x34,0x54,0x33,0x4e,0x79,0x56,0x5a,0x4c,0x43,
+ 0x6d,0x56,0x44,0x68,0x77,0x2f,0x64,0x39,0x77,0x61,0x34,0x31,0x54,0x37,0x32,0x78,
+ 0x4b,0x4e,0x68,0x6e,0x6d,0x77,0x50,0x52,0x6f,0x4c,0x4b,0x63,0x69,0x4f,0x34,0x33,
+ 0x39,0x62,0x64,0x45,0x7a,0x32,0x67,0x5a,0x68,0x32,0x51,0x55,0x71,0x43,0x57,0x72,
+ 0x61,0x62,0x57,0x59,0x4a,0x79,0x59,0x55,0x6b,0x2f,0x42,0x43,0x47,0x52,0x4a,0x31,
+ 0x50,0x67,0x4a,0x64,0x66,0x4a,0x4f,0x66,0x6c,0x74,0x4f,0x37,0x64,0x4d,0x69,0x38,
+ 0x33,0x72,0x6c,0x73,0x6e,0x4a,0x7a,0x30,0x75,0x5a,0x2b,0x41,0x6d,0x77,0x61,0x4b,
+ 0x36,0x4c,0x76,0x53,0x54,0x35,0x37,0x75,0x76,0x44,0x57,0x4d,0x75,0x41,0x34,0x4c,
+ 0x75,0x35,0x72,0x32,0x49,0x36,0x6e,0x54,0x6e,0x74,0x2f,0x42,0x44,0x45,0x73,0x4b,
+ 0x5a,0x61,0x68,0x34,0x5a,0x30,0x68,0x5a,0x70,0x6d,0x32,0x78,0x39,0x71,0x4e,0x77,
+ 0x34,0x57,0x51,0x37,0x75,0x48,0x6c,0x6d,0x39,0x4e,0x4f,0x73,0x5a,0x4f,0x52,0x55,
+ 0x67,0x31,0x52,0x6c,0x78,0x45,0x79,0x59,0x7a,0x30,0x67,0x67,0x54,0x2f,0x4b,0x51,
+ 0x76,0x34,0x78,0x53,0x4c,0x51,0x4d,0x55,0x67,0x39,0x46,0x43,0x6b,0x48,0x66,0x71,
+ 0x4e,0x41,0x59,0x79,0x67,0x2f,0x49,0x55,0x2f,0x49,0x68,0x64,0x30,0x70,0x72,0x69,
+ 0x66,0x44,0x34,0x77,0x2f,0x6c,0x39,0x2f,0x31,0x41,0x39,0x45,0x53,0x56,0x31,0x65,
+ 0x6b,0x47,0x71,0x47,0x4b,0x34,0x62,0x54,0x6b,0x44,0x6d,0x33,0x4d,0x6b,0x70,0x4f,
+ 0x50,0x53,0x76,0x6c,0x75,0x44,0x6d,0x48,0x63,0x74,0x54,0x6b,0x54,0x64,0x5a,0x71,
+ 0x41,0x36,0x4a,0x77,0x2b,0x31,0x2f,0x67,0x69,0x36,0x71,0x4c,0x61,0x78,0x42,0x6b,
+ 0x6c,0x49,0x55,0x69,0x67,0x48,0x50,0x41,0x49,0x39,0x76,0x52,0x6e,0x79,0x75,0x61,
+ 0x33,0x65,0x6e,0x36,0x78,0x67,0x78,0x66,0x73,0x73,0x76,0x4b,0x4b,0x4e,0x4c,0x35,
+ 0x57,0x35,0x4a,0x43,0x6d,0x49,0x44,0x64,0x4a,0x37,0x48,0x54,0x50,0x45,0x79,0x32,
+ 0x54,0x6a,0x67,0x2f,0x63,0x6f,0x4e,0x78,0x41,0x6c,0x75,0x32,0x32,0x66,0x39,0x31,
+ 0x37,0x6f,0x6a,0x55,0x6a,0x62,0x51,0x63,0x4e,0x4e,0x66,0x64,0x36,0x55,0x69,0x41,
+ 0x4f,0x34,0x55,0x48,0x37,0x69,0x66,0x6c,0x62,0x73,0x43,0x39,0x4f,0x73,0x2f,0x79,
+ 0x58,0x62,0x6b,0x57,0x44,0x2b,0x4f,0x53,0x6b,0x68,0x55,0x36,0x63,0x41,0x31,0x58,
+ 0x6d,0x49,0x33,0x65,0x76,0x61,0x4a,0x6f,0x61,0x48,0x78,0x74,0x54,0x34,0x7a,0x37,
+ 0x69,0x53,0x31,0x4b,0x63,0x36,0x42,0x48,0x42,0x39,0x64,0x31,0x58,0x56,0x4e,0x77,
+ 0x4e,0x43,0x46,0x41,0x56,0x31,0x48,0x65,0x79,0x63,0x53,0x41,0x31,0x43,0x65,0x45,
+ 0x61,0x50,0x35,0x5a,0x56,0x74,0x6a,0x30,0x46,0x4c,0x79,0x57,0x73,0x30,0x47,0x57,
+ 0x53,0x36,0x39,0x4a,0x4e,0x77,0x70,0x55,0x69,0x41,0x67,0x66,0x4f,0x57,0x66,0x32,
+ 0x71,0x4b,0x69,0x48,0x6e,0x65,0x48,0x48,0x30,0x55,0x31,0x31,0x4a,0x74,0x4c,0x48,
+ 0x78,0x34,0x78,0x58,0x32,0x48,0x51,0x2b,0x34,0x75,0x7a,0x59,0x75,0x73,0x53,0x65,
+ 0x6c,0x71,0x36,0x68,0x48,0x48,0x50,0x46,0x5a,0x33,0x52,0x50,0x4d,0x2b,0x59,0x4f,
+ 0x64,0x4f,0x59,0x6d,0x48,0x79,0x34,0x34,0x78,0x45,0x42,0x2b,0x71,0x74,0x42,0x53,
+ 0x33,0x73,0x4f,0x42,0x65,0x72,0x68,0x4a,0x76,0x46,0x56,0x4e,0x57,0x73,0x51,0x49,
+ 0x4a,0x6c,0x6e,0x4e,0x52,0x59,0x74,0x49,0x43,0x6a,0x50,0x65,0x79,0x73,0x31,0x31,
+ 0x46,0x70,0x66,0x6a,0x78,0x6f,0x45,0x71,0x31,0x66,0x75,0x50,0x67,0x76,0x4e,0x71,
+ 0x53,0x2f,0x2f,0x31,0x5a,0x62,0x78,0x4d,0x73,0x7a,0x6e,0x73,0x39,0x49,0x56,0x67,
+ 0x44,0x2f,0x38,0x74,0x51,0x55,0x31,0x4e,0x78,0x76,0x47,0x4a,0x62,0x30,0x2f,0x67,
+ 0x46,0x51,0x39,0x47,0x38,0x2b,0x50,0x4d,0x33,0x6e,0x51,0x77,0x6a,0x53,0x68,0x44,
+ 0x69,0x48,0x4b,0x79,0x42,0x4b,0x34,0x78,0x4b,0x61,0x64,0x45,0x62,0x5a,0x4f,0x58,
+ 0x79,0x49,0x39,0x4a,0x55,0x68,0x43,0x54,0x66,0x35,0x65,0x57,0x34,0x6e,0x6b,0x31,
+ 0x65,0x4c,0x36,0x42,0x66,0x4b,0x34,0x50,0x64,0x72,0x35,0x65,0x55,0x32,0x78,0x62,
+ 0x58,0x33,0x79,0x5a,0x51,0x59,0x4b,0x76,0x6c,0x32,0x52,0x42,0x64,0x5a,0x41,0x45,
+ 0x52,0x2f,0x79,0x39,0x53,0x39,0x4b,0x41,0x45,0x46,0x31,0x52,0x54,0x6e,0x71,0x6e,
+ 0x4a,0x64,0x58,0x41,0x45,0x6a,0x56,0x67,0x42,0x52,0x73,0x30,0x72,0x59,0x52,0x36,
+ 0x61,0x6d,0x6d,0x43,0x65,0x59,0x4f,0x36,0x4c,0x77,0x61,0x4b,0x65,0x58,0x73,0x53,
+ 0x58,0x58,0x78,0x53,0x71,0x63,0x66,0x59,0x45,0x6e,0x4d,0x2f,0x4a,0x39,0x59,0x46,
+ 0x6a,0x45,0x69,0x79,0x57,0x4f,0x74,0x58,0x33,0x49,0x4e,0x6b,0x31,0x70,0x48,0x53,
+ 0x65,0x72,0x43,0x32,0x4b,0x52,0x63,0x37,0x61,0x50,0x72,0x38,0x68,0x57,0x76,0x72,
+ 0x45,0x2b,0x71,0x6b,0x58,0x47,0x68,0x43,0x6d,0x4c,0x4b,0x44,0x38,0x2b,0x36,0x45,
+ 0x49,0x61,0x36,0x42,0x68,0x4f,0x4e,0x39,0x52,0x4d,0x45,0x53,0x73,0x51,0x75,0x56,
+ 0x6e,0x33,0x43,0x41,0x72,0x75,0x61,0x55,0x50,0x48,0x2b,0x72,0x41,0x4a,0x38,0x4d,
+ 0x71,0x46,0x6b,0x4b,0x6c,0x73,0x6c,0x61,0x58,0x4f,0x54,0x6c,0x79,0x35,0x45,0x70,
+ 0x46,0x62,0x5a,0x61,0x35,0x52,0x6e,0x50,0x59,0x43,0x4f,0x36,0x4f,0x70,0x4d,0x6c,
+ 0x41,0x6e,0x6a,0x4d,0x56,0x41,0x3d,0x3d
+ };
+#endif
+
+ char random[1024] = {
+ 0x0b,0x30,0x44,0x62,0x7c,0x22,0x1f,0x0d,0x05,0x67,0x2c,0x2a,0x39,0x21,0x46,0x08,
+ 0x50,0x66,0x34,0x37,0x0b,0x45,0x4b,0x38,0x32,0x06,0x7a,0x3e,0x7f,0x0c,0x40,0x18,
+ 0x6b,0x2d,0x60,0x4c,0x60,0x0c,0x23,0x43,0x3b,0x3e,0x1b,0x16,0x04,0x46,0x58,0x3f,
+ 0x40,0x6a,0x11,0x05,0x63,0x71,0x14,0x35,0x47,0x79,0x13,0x6f,0x6b,0x27,0x18,0x5b,
+ 0x48,0x27,0x3e,0x6f,0x15,0x33,0x4f,0x3e,0x5e,0x51,0x73,0x68,0x25,0x0f,0x06,0x5b,
+ 0x7c,0x72,0x75,0x3e,0x3f,0x1b,0x5c,0x6d,0x6a,0x39,0x7c,0x63,0x63,0x60,0x6c,0x7a,
+ 0x33,0x76,0x52,0x13,0x25,0x33,0x7d,0x65,0x23,0x27,0x11,0x06,0x06,0x47,0x71,0x1e,
+ 0x14,0x74,0x63,0x70,0x2d,0x15,0x27,0x18,0x51,0x06,0x05,0x33,0x11,0x2c,0x6b,0x00,
+ 0x2d,0x77,0x20,0x48,0x0d,0x73,0x51,0x45,0x25,0x7f,0x7f,0x35,0x26,0x2e,0x26,0x53,
+ 0x24,0x68,0x1e,0x0e,0x58,0x3a,0x59,0x50,0x56,0x37,0x5f,0x66,0x01,0x4c,0x5a,0x64,
+ 0x32,0x50,0x7b,0x6a,0x20,0x72,0x2b,0x1d,0x7e,0x43,0x7b,0x61,0x42,0x0b,0x61,0x73,
+ 0x24,0x79,0x3a,0x6b,0x4a,0x79,0x6e,0x09,0x0f,0x27,0x2d,0x0c,0x5e,0x32,0x4b,0x0d,
+ 0x79,0x46,0x39,0x21,0x0a,0x26,0x5f,0x3a,0x00,0x26,0x3f,0x13,0x2e,0x7e,0x50,0x2b,
+ 0x67,0x46,0x72,0x3f,0x3b,0x01,0x46,0x1b,0x0b,0x35,0x49,0x39,0x19,0x70,0x3d,0x02,
+ 0x41,0x0e,0x38,0x05,0x76,0x65,0x4f,0x31,0x6c,0x5e,0x17,0x04,0x15,0x36,0x26,0x64,
+ 0x34,0x14,0x17,0x7c,0x0e,0x0b,0x5b,0x55,0x53,0x6b,0x00,0x42,0x41,0x4f,0x02,0x5c,
+ 0x13,0x0a,0x2c,0x2c,0x3e,0x10,0x14,0x33,0x45,0x7c,0x7a,0x5a,0x31,0x61,0x39,0x08,
+ 0x22,0x6a,0x1e,0x0f,0x6f,0x1b,0x6c,0x13,0x5e,0x79,0x20,0x79,0x50,0x62,0x06,0x2c,
+ 0x76,0x17,0x04,0x2b,0x2a,0x75,0x1f,0x0c,0x37,0x4e,0x0f,0x7b,0x2d,0x34,0x75,0x60,
+ 0x31,0x74,0x2e,0x0a,0x4a,0x11,0x6c,0x49,0x25,0x01,0x3a,0x3d,0x22,0x1e,0x6d,0x18,
+ 0x51,0x78,0x2d,0x62,0x31,0x4c,0x50,0x40,0x17,0x4b,0x6f,0x22,0x00,0x7f,0x61,0x2a,
+ 0x34,0x3e,0x00,0x5f,0x2f,0x5f,0x2f,0x14,0x2a,0x55,0x27,0x1f,0x46,0x1f,0x12,0x46,
+ 0x5e,0x1e,0x0c,0x7c,0x38,0x01,0x61,0x64,0x76,0x22,0x6e,0x08,0x20,0x38,0x4f,0x73,
+ 0x72,0x55,0x12,0x42,0x19,0x50,0x61,0x43,0x77,0x7d,0x41,0x2e,0x35,0x4f,0x3d,0x31,
+ 0x28,0x58,0x67,0x1b,0x03,0x51,0x20,0x32,0x1c,0x08,0x6e,0x37,0x75,0x37,0x44,0x4f,
+ 0x68,0x19,0x07,0x64,0x14,0x28,0x25,0x2b,0x69,0x35,0x18,0x27,0x26,0x14,0x13,0x70,
+ 0x42,0x19,0x12,0x75,0x3e,0x02,0x5d,0x7c,0x13,0x1f,0x16,0x53,0x3b,0x74,0x48,0x3c,
+ 0x5e,0x39,0x6c,0x1c,0x1c,0x74,0x39,0x1f,0x00,0x1b,0x06,0x0a,0x68,0x3b,0x52,0x4f,
+ 0x1e,0x6e,0x3c,0x35,0x0c,0x38,0x0e,0x0b,0x3b,0x1a,0x76,0x23,0x29,0x53,0x1e,0x5f,
+ 0x41,0x0c,0x4b,0x0a,0x65,0x28,0x78,0x67,0x48,0x59,0x26,0x6d,0x31,0x76,0x23,0x70,
+ 0x61,0x64,0x3b,0x38,0x79,0x66,0x74,0x53,0x2c,0x64,0x64,0x54,0x03,0x54,0x65,0x44,
+ 0x4c,0x18,0x4f,0x48,0x20,0x4f,0x72,0x10,0x3f,0x0c,0x52,0x2d,0x03,0x14,0x03,0x51,
+ 0x42,0x10,0x77,0x6a,0x34,0x06,0x32,0x03,0x72,0x14,0x7c,0x08,0x5d,0x52,0x1a,0x62,
+ 0x7c,0x3e,0x30,0x7e,0x5f,0x7f,0x54,0x0f,0x44,0x49,0x5d,0x5e,0x10,0x6a,0x06,0x2b,
+ 0x06,0x53,0x10,0x39,0x37,0x32,0x4a,0x4e,0x3d,0x2b,0x65,0x38,0x39,0x07,0x72,0x54,
+ 0x64,0x4d,0x56,0x6a,0x03,0x22,0x70,0x7b,0x5f,0x60,0x0b,0x2a,0x0b,0x6b,0x10,0x64,
+ 0x14,0x05,0x22,0x00,0x73,0x40,0x23,0x5b,0x51,0x1f,0x2b,0x1a,0x5d,0x69,0x7a,0x46,
+ 0x0c,0x5f,0x32,0x4b,0x4a,0x28,0x52,0x79,0x5b,0x12,0x42,0x18,0x00,0x5d,0x27,0x31,
+ 0x53,0x3c,0x4c,0x36,0x4e,0x38,0x3f,0x72,0x03,0x71,0x02,0x5b,0x36,0x59,0x7f,0x75,
+ 0x6e,0x08,0x54,0x0d,0x34,0x1c,0x34,0x57,0x5d,0x69,0x48,0x00,0x3b,0x05,0x07,0x6e,
+ 0x27,0x65,0x6e,0x40,0x3d,0x3a,0x4f,0x72,0x5d,0x39,0x16,0x0f,0x63,0x12,0x12,0x15,
+ 0x3a,0x70,0x0d,0x57,0x18,0x0d,0x5e,0x3d,0x22,0x68,0x68,0x7c,0x6d,0x4f,0x0c,0x7b,
+ 0x09,0x2d,0x4a,0x73,0x20,0x47,0x07,0x57,0x75,0x5d,0x53,0x70,0x34,0x21,0x40,0x57,
+ 0x51,0x5e,0x49,0x44,0x00,0x54,0x27,0x04,0x68,0x7e,0x59,0x56,0x58,0x74,0x14,0x3c,
+ 0x16,0x33,0x41,0x16,0x4b,0x2f,0x49,0x37,0x0a,0x54,0x08,0x08,0x1f,0x39,0x67,0x76,
+ 0x28,0x28,0x07,0x1d,0x61,0x47,0x51,0x4d,0x75,0x26,0x52,0x47,0x47,0x0c,0x57,0x58,
+ 0x74,0x3e,0x62,0x6c,0x58,0x3a,0x44,0x1e,0x16,0x2e,0x21,0x1c,0x73,0x45,0x67,0x74,
+ 0x4f,0x33,0x66,0x0e,0x74,0x66,0x26,0x1f,0x2e,0x38,0x44,0x40,0x7e,0x2a,0x50,0x52,
+ 0x5e,0x43,0x01,0x7a,0x38,0x49,0x3c,0x55,0x4d,0x5a,0x44,0x08,0x26,0x59,0x4d,0x45,
+ 0x0b,0x48,0x0a,0x33,0x5e,0x4a,0x4d,0x75,0x16,0x17,0x63,0x46,0x01,0x2a,0x55,0x7b,
+ 0x0f,0x02,0x73,0x6a,0x4b,0x7f,0x75,0x65,0x3c,0x4c,0x33,0x39,0x6c,0x74,0x05,0x60,
+ 0x0f,0x7f,0x2d,0x41,0x4d,0x4d,0x46,0x71,0x09,0x6f,0x4f,0x60,0x15,0x0f,0x46,0x73,
+ 0x63,0x4c,0x5e,0x74,0x30,0x0d,0x28,0x43,0x08,0x72,0x32,0x04,0x2e,0x31,0x29,0x27,
+ 0x44,0x6d,0x13,0x17,0x48,0x0f,0x49,0x52,0x10,0x13,0x7f,0x17,0x16,0x62,0x79,0x35,
+ 0x78,0x3e,0x01,0x7c,0x2e,0x0f,0x76,0x3e,0x5e,0x53,0x6c,0x5b,0x5f,0x7c,0x19,0x41,
+ 0x02,0x2f,0x17,0x64,0x41,0x75,0x10,0x04,0x47,0x7c,0x3d,0x4b,0x52,0x00,0x10,0x5d,
+ 0x51,0x4e,0x7a,0x27,0x25,0x55,0x40,0x12,0x35,0x60,0x05,0x1b,0x34,0x2d,0x04,0x7a,
+ 0x6a,0x69,0x02,0x79,0x03,0x3a,0x2f,0x06,0x0a,0x79,0x7b,0x12,0x5d,0x7c,0x52,0x29,
+ 0x47,0x58,0x12,0x73,0x3f,0x27,0x56,0x05,0x0c,0x48,0x32,0x58,0x6b,0x57,0x5c,0x03,
+ 0x64,0x56,0x11,0x52,0x7a,0x30,0x36,0x29,0x17,0x3b,0x68,0x7a,0x7c,0x05,0x6b,0x6b,
+ 0x13,0x6a,0x24,0x5c,0x68,0x42,0x18,0x32,0x03,0x73,0x6e,0x04,0x21,0x2e,0x01,0x04,
+ 0x63,0x7d,0x44,0x41,0x12,0x31,0x0b,0x15,0x1f,0x70,0x00,0x2e,0x66,0x14,0x3c,0x7f,
+ 0x2b,0x00,0x1f,0x0c,0x28,0x59,0x0a,0x16,0x49,0x5a,0x5c,0x64,0x65,0x4b,0x11,0x29,
+ 0x15,0x36,0x5a,0x65,0x19,0x4f,0x60,0x23,0x3a,0x3a,0x13,0x25,0x02,0x78,0x4c,0x54
+ };
+ char b64_known[1369] = {
+ 0x43,0x7a,0x42,0x45,0x59,0x6e,0x77,0x69,0x48,0x77,0x30,0x46,0x5a,0x79,0x77,0x71,
+ 0x4f,0x53,0x46,0x47,0x43,0x46,0x42,0x6d,0x4e,0x44,0x63,0x4c,0x52,0x55,0x73,0x34,
+ 0x4d,0x67,0x5a,0x36,0x50,0x6e,0x38,0x4d,0x51,0x42,0x68,0x72,0x4c,0x57,0x42,0x4d,
+ 0x59,0x41,0x77,0x6a,0x51,0x7a,0x73,0x2b,0x47,0x78,0x59,0x45,0x52,0x6c,0x67,0x2f,
+ 0x51,0x47,0x6f,0x52,0x42,0x57,0x4e,0x78,0x46,0x44,0x56,0x48,0x65,0x52,0x4e,0x76,
+ 0x61,0x79,0x63,0x59,0x57,0x30,0x67,0x6e,0x50,0x6d,0x38,0x56,0x4d,0x30,0x38,0x2b,
+ 0x58,0x6c,0x46,0x7a,0x61,0x43,0x55,0x50,0x42,0x6c,0x74,0x38,0x63,0x6e,0x55,0x2b,
+ 0x50,0x78,0x74,0x63,0x62,0x57,0x6f,0x35,0x66,0x47,0x4e,0x6a,0x59,0x47,0x78,0x36,
+ 0x4d,0x33,0x5a,0x53,0x45,0x79,0x55,0x7a,0x66,0x57,0x55,0x6a,0x4a,0x78,0x45,0x47,
+ 0x42,0x6b,0x64,0x78,0x48,0x68,0x52,0x30,0x59,0x33,0x41,0x74,0x46,0x53,0x63,0x59,
+ 0x55,0x51,0x59,0x46,0x4d,0x78,0x45,0x73,0x61,0x77,0x41,0x74,0x64,0x79,0x42,0x49,
+ 0x44,0x58,0x4e,0x52,0x52,0x53,0x56,0x2f,0x66,0x7a,0x55,0x6d,0x4c,0x69,0x5a,0x54,
+ 0x4a,0x47,0x67,0x65,0x44,0x6c,0x67,0x36,0x57,0x56,0x42,0x57,0x4e,0x31,0x39,0x6d,
+ 0x41,0x55,0x78,0x61,0x5a,0x44,0x4a,0x51,0x65,0x32,0x6f,0x67,0x63,0x69,0x73,0x64,
+ 0x66,0x6b,0x4e,0x37,0x59,0x55,0x49,0x4c,0x59,0x58,0x4d,0x6b,0x65,0x54,0x70,0x72,
+ 0x53,0x6e,0x6c,0x75,0x43,0x51,0x38,0x6e,0x4c,0x51,0x78,0x65,0x4d,0x6b,0x73,0x4e,
+ 0x65,0x55,0x59,0x35,0x49,0x51,0x6f,0x6d,0x58,0x7a,0x6f,0x41,0x4a,0x6a,0x38,0x54,
+ 0x4c,0x6e,0x35,0x51,0x4b,0x32,0x64,0x47,0x63,0x6a,0x38,0x37,0x41,0x55,0x59,0x62,
+ 0x43,0x7a,0x56,0x4a,0x4f,0x52,0x6c,0x77,0x50,0x51,0x4a,0x42,0x44,0x6a,0x67,0x46,
+ 0x64,0x6d,0x56,0x50,0x4d,0x57,0x78,0x65,0x46,0x77,0x51,0x56,0x4e,0x69,0x5a,0x6b,
+ 0x4e,0x42,0x51,0x58,0x66,0x41,0x34,0x4c,0x57,0x31,0x56,0x54,0x61,0x77,0x42,0x43,
+ 0x51,0x55,0x38,0x43,0x58,0x42,0x4d,0x4b,0x4c,0x43,0x77,0x2b,0x45,0x42,0x51,0x7a,
+ 0x52,0x58,0x78,0x36,0x57,0x6a,0x46,0x68,0x4f,0x51,0x67,0x69,0x61,0x68,0x34,0x50,
+ 0x62,0x78,0x74,0x73,0x45,0x31,0x35,0x35,0x49,0x48,0x6c,0x51,0x59,0x67,0x59,0x73,
+ 0x64,0x68,0x63,0x45,0x4b,0x79,0x70,0x31,0x48,0x77,0x77,0x33,0x54,0x67,0x39,0x37,
+ 0x4c,0x54,0x52,0x31,0x59,0x44,0x46,0x30,0x4c,0x67,0x70,0x4b,0x45,0x57,0x78,0x4a,
+ 0x4a,0x51,0x45,0x36,0x50,0x53,0x49,0x65,0x62,0x52,0x68,0x52,0x65,0x43,0x31,0x69,
+ 0x4d,0x55,0x78,0x51,0x51,0x42,0x64,0x4c,0x62,0x79,0x49,0x41,0x66,0x32,0x45,0x71,
+ 0x4e,0x44,0x34,0x41,0x58,0x79,0x39,0x66,0x4c,0x78,0x51,0x71,0x56,0x53,0x63,0x66,
+ 0x52,0x68,0x38,0x53,0x52,0x6c,0x34,0x65,0x44,0x48,0x77,0x34,0x41,0x57,0x46,0x6b,
+ 0x64,0x69,0x4a,0x75,0x43,0x43,0x41,0x34,0x54,0x33,0x4e,0x79,0x56,0x52,0x4a,0x43,
+ 0x47,0x56,0x42,0x68,0x51,0x33,0x64,0x39,0x51,0x53,0x34,0x31,0x54,0x7a,0x30,0x78,
+ 0x4b,0x46,0x68,0x6e,0x47,0x77,0x4e,0x52,0x49,0x44,0x49,0x63,0x43,0x47,0x34,0x33,
+ 0x64,0x54,0x64,0x45,0x54,0x32,0x67,0x5a,0x42,0x32,0x51,0x55,0x4b,0x43,0x55,0x72,
+ 0x61,0x54,0x55,0x59,0x4a,0x79,0x59,0x55,0x45,0x33,0x42,0x43,0x47,0x52,0x4a,0x31,
+ 0x50,0x67,0x4a,0x64,0x66,0x42,0x4d,0x66,0x46,0x6c,0x4d,0x37,0x64,0x45,0x67,0x38,
+ 0x58,0x6a,0x6c,0x73,0x48,0x42,0x78,0x30,0x4f,0x52,0x38,0x41,0x47,0x77,0x59,0x4b,
+ 0x61,0x44,0x74,0x53,0x54,0x78,0x35,0x75,0x50,0x44,0x55,0x4d,0x4f,0x41,0x34,0x4c,
+ 0x4f,0x78,0x70,0x32,0x49,0x79,0x6c,0x54,0x48,0x6c,0x39,0x42,0x44,0x45,0x73,0x4b,
+ 0x5a,0x53,0x68,0x34,0x5a,0x30,0x68,0x5a,0x4a,0x6d,0x30,0x78,0x64,0x69,0x4e,0x77,
+ 0x59,0x57,0x51,0x37,0x4f,0x48,0x6c,0x6d,0x64,0x46,0x4d,0x73,0x5a,0x47,0x52,0x55,
+ 0x41,0x31,0x52,0x6c,0x52,0x45,0x77,0x59,0x54,0x30,0x67,0x67,0x54,0x33,0x49,0x51,
+ 0x50,0x77,0x78,0x53,0x4c,0x51,0x4d,0x55,0x41,0x31,0x46,0x43,0x45,0x48,0x64,0x71,
+ 0x4e,0x41,0x59,0x79,0x41,0x33,0x49,0x55,0x66,0x41,0x68,0x64,0x55,0x68,0x70,0x69,
+ 0x66,0x44,0x34,0x77,0x66,0x6c,0x39,0x2f,0x56,0x41,0x39,0x45,0x53,0x56,0x31,0x65,
+ 0x45,0x47,0x6f,0x47,0x4b,0x77,0x5a,0x54,0x45,0x44,0x6b,0x33,0x4d,0x6b,0x70,0x4f,
+ 0x50,0x53,0x74,0x6c,0x4f,0x44,0x6b,0x48,0x63,0x6c,0x52,0x6b,0x54,0x56,0x5a,0x71,
+ 0x41,0x79,0x4a,0x77,0x65,0x31,0x39,0x67,0x43,0x79,0x6f,0x4c,0x61,0x78,0x42,0x6b,
+ 0x46,0x41,0x55,0x69,0x41,0x48,0x4e,0x41,0x49,0x31,0x74,0x52,0x48,0x79,0x73,0x61,
+ 0x58,0x57,0x6c,0x36,0x52,0x67,0x78,0x66,0x4d,0x6b,0x74,0x4b,0x4b,0x46,0x4a,0x35,
+ 0x57,0x78,0x4a,0x43,0x47,0x41,0x42,0x64,0x4a,0x7a,0x46,0x54,0x50,0x45,0x77,0x32,
+ 0x54,0x6a,0x67,0x2f,0x63,0x67,0x4e,0x78,0x41,0x6c,0x73,0x32,0x57,0x58,0x39,0x31,
+ 0x62,0x67,0x68,0x55,0x44,0x54,0x51,0x63,0x4e,0x46,0x64,0x64,0x61,0x55,0x67,0x41,
+ 0x4f,0x77,0x55,0x48,0x62,0x69,0x64,0x6c,0x62,0x6b,0x41,0x39,0x4f,0x6b,0x39,0x79,
+ 0x58,0x54,0x6b,0x57,0x44,0x32,0x4d,0x53,0x45,0x68,0x55,0x36,0x63,0x41,0x31,0x58,
+ 0x47,0x41,0x31,0x65,0x50,0x53,0x4a,0x6f,0x61,0x48,0x78,0x74,0x54,0x77,0x78,0x37,
+ 0x43,0x53,0x31,0x4b,0x63,0x79,0x42,0x48,0x42,0x31,0x64,0x31,0x58,0x56,0x4e,0x77,
+ 0x4e,0x43,0x46,0x41,0x56,0x31,0x46,0x65,0x53,0x55,0x51,0x41,0x56,0x43,0x63,0x45,
+ 0x61,0x48,0x35,0x5a,0x56,0x6c,0x68,0x30,0x46,0x44,0x77,0x57,0x4d,0x30,0x45,0x57,
+ 0x53,0x79,0x39,0x4a,0x4e,0x77,0x70,0x55,0x43,0x41,0x67,0x66,0x4f,0x57,0x64,0x32,
+ 0x4b,0x43,0x67,0x48,0x48,0x57,0x46,0x48,0x55,0x55,0x31,0x31,0x4a,0x6c,0x4a,0x48,
+ 0x52,0x77,0x78,0x58,0x57,0x48,0x51,0x2b,0x59,0x6d,0x78,0x59,0x4f,0x6b,0x51,0x65,
+ 0x46,0x69,0x34,0x68,0x48,0x48,0x4e,0x46,0x5a,0x33,0x52,0x50,0x4d,0x32,0x59,0x4f,
+ 0x64,0x47,0x59,0x6d,0x48,0x79,0x34,0x34,0x52,0x45,0x42,0x2b,0x4b,0x6c,0x42,0x53,
+ 0x58,0x6b,0x4d,0x42,0x65,0x6a,0x68,0x4a,0x50,0x46,0x56,0x4e,0x57,0x6b,0x51,0x49,
+ 0x4a,0x6c,0x6c,0x4e,0x52,0x51,0x74,0x49,0x43,0x6a,0x4e,0x65,0x53,0x6b,0x31,0x31,
+ 0x46,0x68,0x64,0x6a,0x52,0x67,0x45,0x71,0x56,0x58,0x73,0x50,0x41,0x6e,0x4e,0x71,
+ 0x53,0x33,0x39,0x31,0x5a,0x54,0x78,0x4d,0x4d,0x7a,0x6c,0x73,0x64,0x41,0x56,0x67,
+ 0x44,0x33,0x38,0x74,0x51,0x55,0x31,0x4e,0x52,0x6e,0x45,0x4a,0x62,0x30,0x39,0x67,
+ 0x46,0x51,0x39,0x47,0x63,0x32,0x4e,0x4d,0x58,0x6e,0x51,0x77,0x44,0x53,0x68,0x44,
+ 0x43,0x48,0x49,0x79,0x42,0x43,0x34,0x78,0x4b,0x53,0x64,0x45,0x62,0x52,0x4d,0x58,
+ 0x53,0x41,0x39,0x4a,0x55,0x68,0x41,0x54,0x66,0x78,0x63,0x57,0x59,0x6e,0x6b,0x31,
+ 0x65,0x44,0x34,0x42,0x66,0x43,0x34,0x50,0x64,0x6a,0x35,0x65,0x55,0x32,0x78,0x62,
+ 0x58,0x33,0x77,0x5a,0x51,0x51,0x49,0x76,0x46,0x32,0x52,0x42,0x64,0x52,0x41,0x45,
+ 0x52,0x33,0x77,0x39,0x53,0x31,0x49,0x41,0x45,0x46,0x31,0x52,0x54,0x6e,0x6f,0x6e,
+ 0x4a,0x56,0x56,0x41,0x45,0x6a,0x56,0x67,0x42,0x52,0x73,0x30,0x4c,0x51,0x52,0x36,
+ 0x61,0x6d,0x6b,0x43,0x65,0x51,0x4d,0x36,0x4c,0x77,0x59,0x4b,0x65,0x58,0x73,0x53,
+ 0x58,0x58,0x78,0x53,0x4b,0x55,0x64,0x59,0x45,0x6e,0x4d,0x2f,0x4a,0x31,0x59,0x46,
+ 0x44,0x45,0x67,0x79,0x57,0x47,0x74,0x58,0x58,0x41,0x4e,0x6b,0x56,0x68,0x46,0x53,
+ 0x65,0x6a,0x41,0x32,0x4b,0x52,0x63,0x37,0x61,0x48,0x70,0x38,0x42,0x57,0x74,0x72,
+ 0x45,0x32,0x6f,0x6b,0x58,0x47,0x68,0x43,0x47,0x44,0x49,0x44,0x63,0x32,0x34,0x45,
+ 0x49,0x53,0x34,0x42,0x42,0x47,0x4e,0x39,0x52,0x45,0x45,0x53,0x4d,0x51,0x73,0x56,
+ 0x48,0x33,0x41,0x41,0x4c,0x6d,0x59,0x55,0x50,0x48,0x38,0x72,0x41,0x42,0x38,0x4d,
+ 0x4b,0x46,0x6b,0x4b,0x46,0x6b,0x6c,0x61,0x58,0x47,0x52,0x6c,0x53,0x78,0x45,0x70,
+ 0x46,0x54,0x5a,0x61,0x5a,0x52,0x6c,0x50,0x59,0x43,0x4d,0x36,0x4f,0x68,0x4d,0x6c,
+ 0x41,0x6e,0x68,0x4d,0x56,0x41,0x3d,0x3d,0x00
+ };
+ char *b64_test;
+
+ plan_tests(1);
+
+ base64_encode_alloc (random, 1024, &b64_test);
+
+ ok(strcmp(b64_known, b64_test) == 0,
+ "Test matching a base64 encoded 1024 bytes random string");
+
+ return exit_status();
+}
+
diff --git a/lib/tests/test_base64.t b/lib/tests/test_base64.t
new file mode 100755
index 0000000..4ad6473
--- /dev/null
+++ b/lib/tests/test_base64.t
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_base64") {
+ plan skip_all => "./test_base64 not compiled - please enable libtap library to test";
+}
+exec "./test_base64";
diff --git a/lib/tests/test_cmd.c b/lib/tests/test_cmd.c
new file mode 100644
index 0000000..02ae11f
--- /dev/null
+++ b/lib/tests/test_cmd.c
@@ -0,0 +1,233 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_cmd.h"
+#include "utils_base.h"
+#include "tap.h"
+
+#define COMMAND_LINE 1024
+#define UNSET 65530
+
+char *
+get_command (char *const *line)
+{
+ char *cmd;
+ int i = 0;
+
+ asprintf (&cmd, " %s", line[i++]);
+ while (line[i] != NULL) {
+ asprintf (&cmd, "%s %s", cmd, line[i]);
+ i++;
+ }
+
+ return cmd;
+}
+
+int
+main (int argc, char **argv)
+{
+ char **command_line = malloc (sizeof (char *) * COMMAND_LINE);
+ char *command = NULL;
+ char *perl;
+ output chld_out, chld_err;
+ int c;
+ int result = UNSET;
+
+ plan_tests(51);
+
+ diag ("Running plain echo command, set one");
+
+ /* ensure everything is empty before we begin */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
+ ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
+ ok (result == UNSET, "(initialised) Checking exit code is reset");
+
+ command_line[0] = strdup ("/bin/echo");
+ command_line[1] = strdup ("this");
+ command_line[2] = strdup ("is");
+ command_line[3] = strdup ("test");
+ command_line[4] = strdup ("one");
+
+ command = get_command (command_line);
+
+ result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
+ ok (chld_out.lines == 1,
+ "(array) Check for expected number of stdout lines");
+ ok (chld_err.lines == 0,
+ "(array) Check for expected number of stderr lines");
+ ok (strcmp (chld_out.line[0], "this is test one") == 0,
+ "(array) Check for expected stdout output");
+ ok (result == 0, "(array) Checking exit code");
+
+ /* ensure everything is empty again */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ result = UNSET;
+ ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
+ ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
+ ok (result == UNSET, "(initialised) Checking exit code is reset");
+
+ result = cmd_run (command, &chld_out, &chld_err, 0);
+
+ ok (chld_out.lines == 1,
+ "(string) Check for expected number of stdout lines");
+ ok (chld_err.lines == 0,
+ "(string) Check for expected number of stderr lines");
+ ok (strcmp (chld_out.line[0], "this is test one") == 0,
+ "(string) Check for expected stdout output");
+ ok (result == 0, "(string) Checking exit code");
+
+ diag ("Running plain echo command, set two");
+
+ /* ensure everything is empty again */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ result = UNSET;
+ ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
+ ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
+ ok (result == UNSET, "(initialised) Checking exit code is reset");
+
+ command_line[0] = strdup ("/bin/echo");
+ command_line[1] = strdup ("this is test two");
+ command_line[2] = NULL;
+ command_line[3] = NULL;
+ command_line[4] = NULL;
+
+ result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
+ ok (chld_out.lines == 1,
+ "(array) Check for expected number of stdout lines");
+ ok (chld_err.lines == 0,
+ "(array) Check for expected number of stderr lines");
+ ok (strcmp (chld_out.line[0], "this is test two") == 0,
+ "(array) Check for expected stdout output");
+ ok (result == 0, "(array) Checking exit code");
+
+ /* ensure everything is empty again */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ result = UNSET;
+ ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
+ ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
+ ok (result == UNSET, "(initialised) Checking exit code is reset");
+
+ result = cmd_run (command, &chld_out, &chld_err, 0);
+
+ ok (chld_out.lines == 1,
+ "(string) Check for expected number of stdout lines");
+ ok (chld_err.lines == 0,
+ "(string) Check for expected number of stderr lines");
+ ok (strcmp (chld_out.line[0], "this is test one") == 0,
+ "(string) Check for expected stdout output");
+ ok (result == 0, "(string) Checking exit code");
+
+
+ /* ensure everything is empty again */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ result = UNSET;
+ ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
+ ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
+ ok (result == UNSET, "(initialised) Checking exit code is reset");
+
+ /* Pass linefeeds via parameters through - those should be evaluated by echo to give multi line output */
+ command_line[0] = strdup("/bin/echo");
+ command_line[1] = strdup("this is a test via echo\nline two\nit's line 3");
+ command_line[2] = strdup("and (note space between '3' and 'and') $$ will not get evaluated");
+
+ result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
+ ok (chld_out.lines == 3,
+ "(array) Check for expected number of stdout lines");
+ ok (chld_err.lines == 0,
+ "(array) Check for expected number of stderr lines");
+ ok (strcmp (chld_out.line[0], "this is a test via echo") == 0,
+ "(array) Check line 1 for expected stdout output");
+ ok (strcmp (chld_out.line[1], "line two") == 0,
+ "(array) Check line 2 for expected stdout output");
+ ok (strcmp (chld_out.line[2], "it's line 3 and (note space between '3' and 'and') $$ will not get evaluated") == 0,
+ "(array) Check line 3 for expected stdout output");
+ ok (result == 0, "(array) Checking exit code");
+
+
+
+ /* ensure everything is empty again */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ result = UNSET;
+ ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
+ ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
+ ok (result == UNSET, "(initialised) Checking exit code is reset");
+
+ command = (char *)malloc(COMMAND_LINE);
+ strcpy(command, "/bin/echo3456 non-existent command");
+ result = cmd_run (command, &chld_out, &chld_err, 0);
+
+ ok (chld_out.lines == 0,
+ "Non existent command, so no output");
+ ok (chld_err.lines == 0,
+ "No stderr either");
+ ok (result == 3, "Get return code 3 (?) for non-existent command");
+
+
+ /* ensure everything is empty again */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ result = UNSET;
+
+ command = (char *)malloc(COMMAND_LINE);
+ strcpy(command, "/bin/sh non-existent-file");
+ result = cmd_run (command, &chld_out, &chld_err, 0);
+
+ ok (chld_out.lines == 0,
+ "/bin/sh returns no stdout when file is missing...");
+ ok (chld_err.lines == 1,
+ "...but does give an error line");
+ ok (strstr(chld_err.line[0],"non-existent-file") != NULL, "And missing filename is in error message");
+ ok (result != 0, "Get non-zero return code from /bin/sh");
+
+
+ /* ensure everything is empty again */
+ result = UNSET;
+
+ command = (char *)malloc(COMMAND_LINE);
+ strcpy(command, "/bin/sh -c 'exit 7'");
+ result = cmd_run (command, NULL, NULL, 0);
+
+ ok (result == 7, "Get return code 7 from /bin/sh");
+
+
+ /* ensure everything is empty again */
+ memset (&chld_out, 0, sizeof (output));
+ memset (&chld_err, 0, sizeof (output));
+ result = UNSET;
+
+ command = (char *)malloc(COMMAND_LINE);
+ strcpy(command, "/bin/non-existent-command");
+ result = cmd_run (command, &chld_out, &chld_err, 0);
+
+ ok (chld_out.lines == 0,
+ "/bin/non-existent-command returns no stdout...");
+ ok (chld_err.lines == 0,
+ "...and no stderr output either");
+ ok (result == 3, "Get return code 3 = UNKNOWN when command does not exist");
+
+
+ return exit_status ();
+}
diff --git a/lib/tests/test_cmd.t b/lib/tests/test_cmd.t
new file mode 100644
index 0000000..c50dded
--- /dev/null
+++ b/lib/tests/test_cmd.t
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_cmd") {
+ plan skip_all => "./test_cmd not compiled - please enable libtap library to test";
+}
+exec "./test_cmd";
diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c
new file mode 100644
index 0000000..e283fe2
--- /dev/null
+++ b/lib/tests/test_disk.c
@@ -0,0 +1,224 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_disk.h"
+#include "tap.h"
+#include "regex.h"
+
+void np_test_mount_entry_regex (struct mount_entry *dummy_mount_list,
+ char *regstr, int cflags, int expect,
+ char *desc);
+
+
+int
+main (int argc, char **argv)
+{
+ struct name_list *exclude_filesystem=NULL;
+ struct name_list *exclude_fstype=NULL;
+ struct name_list *dummy_mountlist = NULL;
+ struct name_list *temp_name;
+ struct parameter_list *paths = NULL;
+ struct parameter_list *p, *prev = NULL, *last = NULL;
+
+ struct mount_entry *dummy_mount_list;
+ struct mount_entry *me;
+ struct mount_entry **mtail = &dummy_mount_list;
+ int cflags = REG_NOSUB | REG_EXTENDED;
+ int found = 0, count = 0;
+
+ plan_tests(33);
+
+ ok( np_find_name(exclude_filesystem, "/var/log") == false, "/var/log not in list");
+ np_add_name(&exclude_filesystem, "/var/log");
+ ok( np_find_name(exclude_filesystem, "/var/log") == true, "is in list now");
+ ok( np_find_name(exclude_filesystem, "/home") == false, "/home not in list");
+ np_add_name(&exclude_filesystem, "/home");
+ ok( np_find_name(exclude_filesystem, "/home") == true, "is in list now");
+ ok( np_find_name(exclude_filesystem, "/var/log") == true, "/var/log still in list");
+
+ ok( np_find_name(exclude_fstype, "iso9660") == false, "iso9660 not in list");
+ np_add_name(&exclude_fstype, "iso9660");
+ ok( np_find_name(exclude_fstype, "iso9660") == true, "is in list now");
+
+ ok( np_find_name(exclude_filesystem, "iso9660") == false, "Make sure no clashing in variables");
+
+ /*
+ for (temp_name = exclude_filesystem; temp_name; temp_name = temp_name->next) {
+ printf("Name: %s\n", temp_name->name);
+ }
+ */
+
+ me = (struct mount_entry *) malloc(sizeof *me);
+ me->me_devname = strdup("/dev/c0t0d0s0");
+ me->me_mountdir = strdup("/");
+ *mtail = me;
+ mtail = &me->me_next;
+
+ me = (struct mount_entry *) malloc(sizeof *me);
+ me->me_devname = strdup("/dev/c1t0d1s0");
+ me->me_mountdir = strdup("/var");
+ *mtail = me;
+ mtail = &me->me_next;
+
+ me = (struct mount_entry *) malloc(sizeof *me);
+ me->me_devname = strdup("/dev/c2t0d0s0");
+ me->me_mountdir = strdup("/home");
+ *mtail = me;
+ mtail = &me->me_next;
+
+ np_test_mount_entry_regex(dummy_mount_list, strdup("/"),
+ cflags, 3, strdup("a"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("/dev"),
+ cflags, 3,strdup("regex on dev names:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("/foo"),
+ cflags, 0,
+ strdup("regex on non existent dev/path:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("/Foo"),
+ cflags | REG_ICASE,0,
+ strdup("regi on non existent dev/path:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("/c.t0"),
+ cflags, 3,
+ strdup("partial devname regex match:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("c0t0"),
+ cflags, 1,
+ strdup("partial devname regex match:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("C0t0"),
+ cflags | REG_ICASE, 1,
+ strdup("partial devname regi match:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("home"),
+ cflags, 1,
+ strdup("partial pathname regex match:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("hOme"),
+ cflags | REG_ICASE, 1,
+ strdup("partial pathname regi match:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("(/home)|(/var)"),
+ cflags, 2,
+ strdup("grouped regex pathname match:"));
+ np_test_mount_entry_regex(dummy_mount_list, strdup("(/homE)|(/Var)"),
+ cflags | REG_ICASE, 2,
+ strdup("grouped regi pathname match:"));
+
+ np_add_parameter(&paths, "/home/groups");
+ np_add_parameter(&paths, "/var");
+ np_add_parameter(&paths, "/tmp");
+ np_add_parameter(&paths, "/home/tonvoon");
+ np_add_parameter(&paths, "/dev/c2t0d0s0");
+
+ np_set_best_match(paths, dummy_mount_list, false);
+ for (p = paths; p; p = p->name_next) {
+ struct mount_entry *temp_me;
+ temp_me = p->best_match;
+ if (! strcmp(p->name, "/home/groups")) {
+ ok( temp_me && !strcmp(temp_me->me_mountdir, "/home"), "/home/groups got right best match: /home");
+ } else if (! strcmp(p->name, "/var")) {
+ ok( temp_me && !strcmp(temp_me->me_mountdir, "/var"), "/var got right best match: /var");
+ } else if (! strcmp(p->name, "/tmp")) {
+ ok( temp_me && !strcmp(temp_me->me_mountdir, "/"), "/tmp got right best match: /");
+ } else if (! strcmp(p->name, "/home/tonvoon")) {
+ ok( temp_me && !strcmp(temp_me->me_mountdir, "/home"), "/home/tonvoon got right best match: /home");
+ } else if (! strcmp(p->name, "/dev/c2t0d0s0")) {
+ ok( temp_me && !strcmp(temp_me->me_devname, "/dev/c2t0d0s0"), "/dev/c2t0d0s0 got right best match: /dev/c2t0d0s0");
+ }
+ }
+
+ paths = NULL; /* Bad boy - should free, but this is a test suite */
+ np_add_parameter(&paths, "/home/groups");
+ np_add_parameter(&paths, "/var");
+ np_add_parameter(&paths, "/tmp");
+ np_add_parameter(&paths, "/home/tonvoon");
+ np_add_parameter(&paths, "/home");
+
+ np_set_best_match(paths, dummy_mount_list, true);
+ for (p = paths; p; p = p->name_next) {
+ if (! strcmp(p->name, "/home/groups")) {
+ ok( ! p->best_match , "/home/groups correctly not found");
+ } else if (! strcmp(p->name, "/var")) {
+ ok( p->best_match, "/var found");
+ } else if (! strcmp(p->name, "/tmp")) {
+ ok(! p->best_match, "/tmp correctly not found");
+ } else if (! strcmp(p->name, "/home/tonvoon")) {
+ ok(! p->best_match, "/home/tonvoon not found");
+ } else if (! strcmp(p->name, "/home")) {
+ ok( p->best_match, "/home found");
+ }
+ }
+
+ /* test deleting first element in paths */
+ paths = np_del_parameter(paths, NULL);
+ for (p = paths; p; p = p->name_next) {
+ if (! strcmp(p->name, "/home/groups"))
+ found = 1;
+ }
+ ok(found == 0, "first element successfully deleted");
+ found = 0;
+
+ p=paths;
+ while (p) {
+ if (! strcmp(p->name, "/tmp"))
+ p = np_del_parameter(p, prev);
+ else {
+ prev = p;
+ p = p->name_next;
+ }
+ }
+
+ for (p = paths; p; p = p->name_next) {
+ if (! strcmp(p->name, "/tmp"))
+ found = 1;
+ if (p->name_next)
+ prev = p;
+ else
+ last = p;
+ }
+ ok(found == 0, "/tmp element successfully deleted");
+
+ p = np_del_parameter(last, prev);
+ for (p = paths; p; p = p->name_next) {
+ if (! strcmp(p->name, "/home"))
+ found = 1;
+ last = p;
+ count++;
+ }
+ ok(found == 0, "last (/home) element successfully deleted");
+ ok(count == 2, "two elements remaining");
+
+
+ return exit_status();
+}
+
+
+void
+np_test_mount_entry_regex (struct mount_entry *dummy_mount_list, char *regstr, int cflags, int expect, char *desc)
+{
+ int matches = 0;
+ regex_t re;
+ struct mount_entry *me;
+ if (regcomp(&re,regstr, cflags) == 0) {
+ for (me = dummy_mount_list; me; me= me->me_next) {
+ if(np_regex_match_mount_entry(me,&re))
+ matches++;
+ }
+ ok( matches == expect,
+ "%s '%s' matched %i/3 entries. ok: %i/3",
+ desc, regstr, expect, matches);
+
+ } else
+ ok ( false, "regex '%s' not compilable", regstr);
+}
+
diff --git a/lib/tests/test_disk.t b/lib/tests/test_disk.t
new file mode 100755
index 0000000..da84dfd
--- /dev/null
+++ b/lib/tests/test_disk.t
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_disk") {
+ plan skip_all => "./test_disk not compiled - please enable libtap library to test";
+}
+exec "./test_disk";
diff --git a/lib/tests/test_ini1.c b/lib/tests/test_ini1.c
new file mode 100644
index 0000000..6843bac
--- /dev/null
+++ b/lib/tests/test_ini1.c
@@ -0,0 +1,109 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_base.h"
+#include "parse_ini.h"
+
+#include "tap.h"
+
+void my_free(char *string) {
+ if (string != NULL) {
+ printf("string:\n\t|%s|\n", string);
+ free(string);
+ }
+}
+
+char*
+list2str(np_arg_list *optlst)
+{
+ char *optstr=NULL;
+ np_arg_list *optltmp;
+
+ /* Put everything as a space-separated string */
+ asprintf(&optstr, "");
+ while (optlst) {
+ asprintf(&optstr, "%s%s ", optstr, optlst->arg);
+ optltmp=optlst;
+ optlst=optlst->next;
+ free(optltmp);
+ }
+ /* Strip last whitespace */
+ if (strlen(optstr)>1) optstr[strlen(optstr)-1]='\0';
+
+ return optstr;
+}
+
+int
+main (int argc, char **argv)
+{
+ char *optstr=NULL;
+
+ plan_tests(12);
+
+ optstr=list2str(np_get_defaults("section@./config-tiny.ini", "check_disk"));
+ ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "config-tiny.ini's section as expected");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("@./config-tiny.ini", "section"));
+ ok( !strcmp(optstr, "--one=two --Foo=Bar --this=Your Mother! --blank"), "Used default section name, without specific");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("Section Two@./config-tiny.ini", "check_disk"));
+ ok( !strcmp(optstr, "--something else=blah --remove=whitespace"), "config-tiny.ini's Section Two as expected");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("/path/to/file.txt@./config-tiny.ini", "check_disk"));
+ ok( !strcmp(optstr, "--this=that"), "config-tiny.ini's filename as section name");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("section2@./config-tiny.ini", "check_disk"));
+ ok( !strcmp(optstr, "--this=that"), "config-tiny.ini's section2 with whitespace before section name");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("section3@./config-tiny.ini", "check_disk"));
+ ok( !strcmp(optstr, "--this=that"), "config-tiny.ini's section3 with whitespace after section name");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("check_mysql@./plugin.ini", "check_disk"));
+ ok( !strcmp(optstr, "--username=operator --password=secret"), "plugin.ini's check_mysql as expected");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("check_mysql2@./plugin.ini", "check_disk"));
+ ok( !strcmp(optstr, "-u=admin -p=secret"), "plugin.ini's check_mysql2 as expected");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("check space_and_flags@./plugin.ini", "check_disk"));
+ ok( !strcmp(optstr, "--foo=bar -a -b --bar"), "plugin.ini space in stanza and flag arguments");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("Section Two@./config-dos.ini", "check_disk"));
+ ok( !strcmp(optstr, "--something else=blah --remove=whitespace"), "config-dos.ini's Section Two as expected");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("section_twice@./plugin.ini", "check_disk"));
+ ok( !strcmp(optstr, "--foo=bar --bar=foo"), "plugin.ini's section_twice defined twice in the file");
+ my_free(optstr);
+
+ optstr=list2str(np_get_defaults("tcp_long_lines@plugins.ini", "check_tcp"));
+ ok( !strcmp(optstr, "--escape --send=Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda --expect=Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda --jail"), "Long options");
+ my_free(optstr);
+
+ return exit_status();
+}
+
diff --git a/lib/tests/test_ini1.t b/lib/tests/test_ini1.t
new file mode 100755
index 0000000..25baed9
--- /dev/null
+++ b/lib/tests/test_ini1.t
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_ini1") {
+ plan skip_all => "./test_ini not compiled - please enable libtap library and/or extra-opts to test";
+}
+exec "./test_ini1";
diff --git a/lib/tests/test_ini3.c b/lib/tests/test_ini3.c
new file mode 100644
index 0000000..8a2a041
--- /dev/null
+++ b/lib/tests/test_ini3.c
@@ -0,0 +1,33 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "parse_ini.h"
+
+int
+main (int argc, char **argv)
+{
+
+ /*
+ * This is for testing arguments expected to die.
+ */
+
+ np_get_defaults(argv[1], argv[0]);
+
+ return 0;
+}
+
diff --git a/lib/tests/test_ini3.t b/lib/tests/test_ini3.t
new file mode 100755
index 0000000..41169db
--- /dev/null
+++ b/lib/tests/test_ini3.t
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+use Test::More;
+use strict;
+use warnings;
+
+if (! -e "./test_ini3") {
+ plan skip_all => "./test_ini not compiled - please enable libtap library and/or extra-opts to test";
+}
+
+# array of argument arrays
+# - First value is the expected return code
+# - 2nd value is the NAGIOS_CONFIG_PATH
+# TODO: looks like we look in default path after looking through this variable - shall we?
+# - 3rd value is the plugin name
+# - 4th is the ini locator
+my @TESTS = (
+ [3, undef, "section", "section_unknown@./config-tiny.ini"],
+);
+
+plan tests => scalar(@TESTS);
+
+my $count=1;
+
+foreach my $args (@TESTS) {
+ my $rc = shift(@$args);
+ if (my $env = shift(@$args)) {
+ $ENV{"NAGIOS_CONFIG_PATH"} = $env;
+ } else {
+ delete($ENV{"NAGIOS_CONFIG_PATH"});
+ }
+ system {'./test_ini3'} @$args;
+ cmp_ok($?>>8, '==', $rc, "Parse-ini die " . $count++);
+}
+
diff --git a/lib/tests/test_opts1.c b/lib/tests/test_opts1.c
new file mode 100644
index 0000000..077c5b6
--- /dev/null
+++ b/lib/tests/test_opts1.c
@@ -0,0 +1,139 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_base.h"
+#include "extra_opts.h"
+
+#include "tap.h"
+
+/* This my_free would be the most efficient way of freeing an extra-opts array,
+ * provided as an example */
+#if 0
+void my_free(int *argc, char **newargv, char **argv) {
+ int i;
+ /* Return if both arrays are the same */
+ if (newargv == argv) return;
+
+ for (i=1; i<*argc; i++) {
+ /* Free array items until we reach the start of the original argv */
+ if (newargv[i] == argv[1]) break;
+ free(newargv[i]);
+ }
+ /* Free the array itself */
+ free(newargv);
+}
+#else
+void my_free(int *argc, char **newargv, char **argv) {
+ /* Free stuff (and print while we're at it) */
+ int i, freeflag=1;
+ printf (" Arg(%i): ", *argc+1);
+ printf ("'%s' ", newargv[0]);
+ for (i=1; i<*argc; i++) {
+ printf ("'%s' ", newargv[i]);
+ /* Stop freeing when we get to the start of the original array */
+ if (freeflag) {
+ if (newargv[i] == argv[1])
+ freeflag=0;
+ else
+ free(newargv[i]);
+ }
+ }
+ printf ("\n");
+ /* Free only if it's a different array */
+ if (newargv != argv) free(newargv);
+ *argc=0;
+}
+#endif
+
+int array_diff(int i1, char **a1, int i2, char **a2) {
+ int i;
+
+ if (i1 != i2) {
+ printf(" Argument count doesn't match!\n");
+ return 0;
+ }
+ for (i=0; i<=i1; i++) {
+ if (a1[i]==NULL && a2[i]==NULL) continue;
+ if (a1[i]==NULL || a2[i]==NULL) {
+ printf(" Argument # %i null in one array!\n", i);
+ return 0;
+ }
+ if (strcmp(a1[i], a2[i])) {
+ printf(" Argument # %i doesn't match!\n", i);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int
+main (int argc, char **argv)
+{
+ char **argv_new=NULL;
+ int i, argc_test;
+
+ plan_tests(5);
+
+ {
+ char *argv_test[] = {"prog_name", (char *) NULL};
+ argc_test=1;
+ char *argv_known[] = {"prog_name", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 1, argv_known), "No opts, returns correct argv/argc");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"prog_name", "arg1", "--arg2=val1", "--arg3", "val2", (char *) NULL};
+ argc_test=5;
+ char *argv_known[] = {"prog_name", "arg1", "--arg2=val1", "--arg3", "val2", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 5, argv_known), "No extra opts, verbatim copy of argv");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"prog_name", "--extra-opts=@./config-opts.ini", (char *) NULL};
+ argc_test=2;
+ char *argv_known[] = {"prog_name", "--foo=Bar", "--this=Your Mother!", "--blank", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 4, argv_known), "Only extra opts using default section");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"prog_name", "--extra-opts=sect1@./config-opts.ini", "--extra-opts", "sect2@./config-opts.ini", (char *) NULL};
+ argc_test=4;
+ char *argv_known[] = {"prog_name", "--one=two", "--something else=oops", "--this=that", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 4, argv_known), "Only extra opts specified twice");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"prog_name", "--arg1=val1", "--extra-opts=@./config-opts.ini", "--extra-opts", "sect1@./config-opts.ini", "--arg2", (char *) NULL};
+ argc_test=6;
+ char *argv_known[] = {"prog_name", "--foo=Bar", "--this=Your Mother!", "--blank", "--one=two", "--arg1=val1", "--arg2", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 7, argv_known), "twice extra opts using two sections");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ return exit_status();
+}
+
diff --git a/lib/tests/test_opts1.t b/lib/tests/test_opts1.t
new file mode 100755
index 0000000..1934f12
--- /dev/null
+++ b/lib/tests/test_opts1.t
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_opts1") {
+ plan skip_all => "./test_opts1 not compiled - please enable libtap library and/or extra-opts to test";
+}
+exec "./test_opts1";
diff --git a/lib/tests/test_opts2.c b/lib/tests/test_opts2.c
new file mode 100644
index 0000000..780220e
--- /dev/null
+++ b/lib/tests/test_opts2.c
@@ -0,0 +1,121 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_base.h"
+#include "extra_opts.h"
+
+#include "tap.h"
+
+void my_free(int *argc, char **newargv, char **argv) {
+ /* Free stuff (and print while we're at it) */
+ int i, freeflag=1;
+ printf (" Arg(%i): ", *argc+1);
+ printf ("'%s' ", newargv[0]);
+ for (i=1; i<*argc; i++) {
+ printf ("'%s' ", newargv[i]);
+ /* Stop freeing when we get to the start of the original array */
+ if (freeflag) {
+ if (newargv[i] == argv[1])
+ freeflag=0;
+ else
+ free(newargv[i]);
+ }
+ }
+ printf ("\n");
+ /* Free only if it's a different array */
+ if (newargv != argv) free(newargv);
+ *argc=0;
+}
+
+int array_diff(int i1, char **a1, int i2, char **a2) {
+ int i;
+
+ if (i1 != i2) {
+ printf(" Argument count doesn't match!\n");
+ return 0;
+ }
+ for (i=0; i<=i1; i++) {
+ if (a1[i]==NULL && a2[i]==NULL) continue;
+ if (a1[i]==NULL || a2[i]==NULL) {
+ printf(" Argument # %i null in one array!\n", i);
+ return 0;
+ }
+ if (strcmp(a1[i], a2[i])) {
+ printf(" Argument # %i doesn't match!\n", i);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int
+main (int argc, char **argv)
+{
+ char **argv_new=NULL;
+ int i, argc_test;
+
+ plan_tests(5);
+
+ {
+ char *argv_test[] = {"prog_name", "arg1", "--extra-opts", "--arg3", "val2", (char *) NULL};
+ argc_test=5;
+ char *argv_known[] = {"prog_name", "--foo=bar", "arg1", "--arg3", "val2", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 5, argv_known), "Default section 1");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"prog_name", "--extra-opts", (char *) NULL};
+ argc_test=2;
+ char *argv_known[] = {"prog_name", "--foo=bar", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 2, argv_known), "Default section 2");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"prog_name", "arg1", "--extra-opts=section1", "--arg3", "val2", (char *) NULL};
+ argc_test=5;
+ char *argv_known[] = {"prog_name", "--foobar=baz", "arg1", "--arg3", "val2", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 5, argv_known), "Default section 3");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"prog_name", "arg1", "--extra-opts", "-arg3", "val2", (char *) NULL};
+ argc_test=5;
+ char *argv_known[] = {"prog_name", "--foo=bar", "arg1", "-arg3", "val2", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_disk");
+ ok(array_diff(argc_test, argv_new, 5, argv_known), "Default section 4");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ {
+ char *argv_test[] = {"check_tcp", "--extra-opts", "--extra-opts=tcp_long_lines", (char *) NULL};
+ argc_test=3;
+ char *argv_known[] = {"check_tcp", "--timeout=10", "--escape", "--send=Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda", "--expect=Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda Foo bar BAZ yadda yadda yadda", "--jail", (char *) NULL};
+ argv_new=np_extra_opts(&argc_test, argv_test, "check_tcp");
+ ok(array_diff(argc_test, argv_new, 6, argv_known), "Long lines test");
+ my_free(&argc_test, argv_new, argv_test);
+ }
+
+ return exit_status();
+}
+
diff --git a/lib/tests/test_opts2.t b/lib/tests/test_opts2.t
new file mode 100755
index 0000000..59b9fdb
--- /dev/null
+++ b/lib/tests/test_opts2.t
@@ -0,0 +1,7 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_opts2") {
+ plan skip_all => "./test_opts2 not compiled - please enable libtap library and/or extra-opts to test";
+}
+$ENV{"NAGIOS_CONFIG_PATH"} = ".";
+exec "./test_opts2";
diff --git a/lib/tests/test_opts3.c b/lib/tests/test_opts3.c
new file mode 100644
index 0000000..b64270d
--- /dev/null
+++ b/lib/tests/test_opts3.c
@@ -0,0 +1,31 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*****************************************************************************/
+
+#include "extra_opts.h"
+
+int
+main (int argc, char **argv)
+{
+
+ /*
+ * This is for testing arguments expected to die.
+ */
+ argv=np_extra_opts(&argc, argv, argv[0]);
+
+ return 0;
+}
+
diff --git a/lib/tests/test_opts3.t b/lib/tests/test_opts3.t
new file mode 100755
index 0000000..d77a35c
--- /dev/null
+++ b/lib/tests/test_opts3.t
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+use Test::More;
+use strict;
+use warnings;
+
+if (! -e "./test_opts3") {
+ plan skip_all => "./test_opts3 not compiled - please enable libtap library and/or extra-opts to test";
+}
+
+# array of argument arrays
+# - First value is the expected return code
+# - 2nd value is the NAGIOS_CONFIG_PATH
+# TODO: looks like we look in default path after looking through this variable - shall we?
+# - 3rd value is the plugin name
+# - 4th and up are arguments
+my @TESTS = (
+ [3, '/nonexistent', 'prog_name', 'arg1', '--extra-opts', '--arg3', 'val2'],
+ [3, '.', 'prog_name', 'arg1', '--extra-opts=missing@./config-opts.ini', '--arg3', 'val2'],
+ [3, '', 'prog_name', 'arg1', '--extra-opts', 'missing@./config-opts.ini', '--arg3', 'val2'],
+ [3, '.', 'check_missing', 'arg1', '--extra-opts=@./config-opts.ini', '--arg3', 'val2'],
+ [3, '.', 'check_missing', 'arg1', '--extra-opts', '--arg3', 'val2'],
+ [0, '/tmp:/var:/nonexistent:.', 'check_tcp', 'arg1', '--extra-opts', '--arg3', 'val2'],
+ [0, '/usr/local/nagios/etc:.:/etc', 'check_missing', 'arg1', '--extra-opts=check_tcp', '--arg3', 'val2'],
+);
+
+plan tests => scalar(@TESTS);
+
+my $count=1;
+
+foreach my $args (@TESTS) {
+ my $rc = shift(@$args);
+ if (my $env = shift(@$args)) {
+ $ENV{"NAGIOS_CONFIG_PATH"} = $env;
+ } else {
+ delete($ENV{"NAGIOS_CONFIG_PATH"});
+ }
+ system {'./test_opts3'} @$args;
+ cmp_ok($?>>8, '==', $rc, "Extra-opts die " . $count++);
+}
+
diff --git a/lib/tests/test_tcp.c b/lib/tests/test_tcp.c
new file mode 100644
index 0000000..1954b0f
--- /dev/null
+++ b/lib/tests/test_tcp.c
@@ -0,0 +1,58 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_tcp.h"
+#include "tap.h"
+
+int
+main(void)
+{
+ char **server_expect;
+ int server_expect_count = 3;
+
+ plan_tests(9);
+
+ server_expect = malloc(sizeof(char*) * server_expect_count);
+
+ server_expect[0] = strdup("AA");
+ server_expect[1] = strdup("bb");
+ server_expect[2] = strdup("CC");
+
+ ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS,
+ "Test matching any string at the beginning (first expect string)");
+ ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_SUCCESS,
+ "Test matching any string at the beginning (second expect string)");
+ ok(np_expect_match("b", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_RETRY,
+ "Test matching any string at the beginning (substring match)");
+ ok(np_expect_match("XX bb AA CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_FAILURE,
+ "Test with strings not matching at the beginning");
+ ok(np_expect_match("XX CC XX", server_expect, server_expect_count, NP_MATCH_EXACT) == NP_MATCH_FAILURE,
+ "Test matching any string");
+ ok(np_expect_match("XX", server_expect, server_expect_count, 0) == NP_MATCH_RETRY,
+ "Test not matching any string");
+ ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_SUCCESS,
+ "Test matching all strings");
+ ok(np_expect_match("XX bb CC XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY,
+ "Test not matching all strings");
+ ok(np_expect_match("XX XX", server_expect, server_expect_count, NP_MATCH_ALL) == NP_MATCH_RETRY,
+ "Test not matching any string (testing all)");
+
+
+ return exit_status();
+}
diff --git a/lib/tests/test_tcp.t b/lib/tests/test_tcp.t
new file mode 100755
index 0000000..e5e12fc
--- /dev/null
+++ b/lib/tests/test_tcp.t
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_tcp") {
+ plan skip_all => "./test_tcp not compiled - please enable libtap library to test";
+}
+exec "./test_tcp";
diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c
new file mode 100644
index 0000000..01afacd
--- /dev/null
+++ b/lib/tests/test_utils.c
@@ -0,0 +1,510 @@
+/*****************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_base.h"
+
+#include "tap.h"
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "utils_base.c"
+
+int
+main (int argc, char **argv)
+{
+ char state_path[1024];
+ range *range;
+ double temp;
+ thresholds *thresholds = NULL;
+ int i, rc;
+ char *temp_string;
+ state_key *temp_state_key = NULL;
+ state_data *temp_state_data;
+ time_t current_time;
+
+ plan_tests(185);
+
+ ok( this_monitoring_plugin==NULL, "monitoring_plugin not initialised");
+
+ np_init( "check_test", argc, argv );
+
+ ok( this_monitoring_plugin!=NULL, "monitoring_plugin now initialised");
+ ok( !strcmp(this_monitoring_plugin->plugin_name, "check_test"), "plugin name initialised" );
+
+ ok( this_monitoring_plugin->argc==argc, "Argc set" );
+ ok( this_monitoring_plugin->argv==argv, "Argv set" );
+
+ np_set_args(0,0);
+
+ ok( this_monitoring_plugin->argc==0, "argc changed" );
+ ok( this_monitoring_plugin->argv==0, "argv changed" );
+
+ np_set_args(argc, argv);
+
+ range = parse_range_string("6");
+ ok( range != NULL, "'6' is valid range");
+ ok( range->start == 0, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end == 6, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ free(range);
+
+ range = parse_range_string("1:12%%");
+ ok( range != NULL, "'1:12%%' is valid - percentages are ignored");
+ ok( range->start == 1, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end == 12, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ free(range);
+
+ range = parse_range_string("-7:23");
+ ok( range != NULL, "'-7:23' is valid range");
+ ok( range->start == -7, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end == 23, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ free(range);
+
+ range = parse_range_string(":5.75");
+ ok( range != NULL, "':5.75' is valid range");
+ ok( range->start == 0, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end == 5.75, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ free(range);
+
+ range = parse_range_string("~:-95.99");
+ ok( range != NULL, "~:-95.99' is valid range");
+ ok( range->start_infinity == true, "Using negative infinity");
+ ok( range->end == -95.99, "End correct (with rounding errors)");
+ ok( range->end_infinity == false, "Not using infinity");
+ free(range);
+
+ range = parse_range_string("12345678901234567890:");
+ temp = atof("12345678901234567890"); /* Can't just use this because number too large */
+ ok( range != NULL, "'12345678901234567890:' is valid range");
+ ok( range->start == temp, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end_infinity == true, "Using infinity");
+ /* Cannot do a "-1" on temp, as it appears to be same value */
+ ok( check_range(temp/1.1, range) == true, "12345678901234567890/1.1 - alert");
+ ok( check_range(temp, range) == false, "12345678901234567890 - no alert");
+ ok( check_range(temp*2, range) == false, "12345678901234567890*2 - no alert");
+ free(range);
+
+ range = parse_range_string("~:0");
+ ok( range != NULL, "'~:0' is valid range");
+ ok( range->start_infinity == true, "Using negative infinity");
+ ok( range->end == 0, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ ok( range->alert_on == OUTSIDE, "Will alert on outside of this range");
+ ok( check_range(0.5, range) == true, "0.5 - alert");
+ ok( check_range(-10, range) == false, "-10 - no alert");
+ ok( check_range(0, range) == false, "0 - no alert");
+ free(range);
+
+ range = parse_range_string("@0:657.8210567");
+ ok( range != 0, "@0:657.8210567' is a valid range");
+ ok( range->start == 0, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end == 657.8210567, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ ok( range->alert_on == INSIDE, "Will alert on inside of this range" );
+ ok( check_range(32.88, range) == true, "32.88 - alert");
+ ok( check_range(-2, range) == false, "-2 - no alert");
+ ok( check_range(657.8210567, range) == true, "657.8210567 - alert");
+ ok( check_range(0, range) == true, "0 - alert");
+ free(range);
+
+ range = parse_range_string("@1:1");
+ ok( range != NULL, "'@1:1' is a valid range");
+ ok( range->start == 1, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end == 1, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ ok( range->alert_on == INSIDE, "Will alert on inside of this range" );
+ ok( check_range(0.5, range) == false, "0.5 - no alert");
+ ok( check_range(1, range) == true, "1 - alert");
+ ok( check_range(5.2, range) == false, "5.2 - no alert");
+ free(range);
+
+ range = parse_range_string("1:1");
+ ok( range != NULL, "'1:1' is a valid range");
+ ok( range->start == 1, "Start correct");
+ ok( range->start_infinity == false, "Not using negative infinity");
+ ok( range->end == 1, "End correct");
+ ok( range->end_infinity == false, "Not using infinity");
+ ok( check_range(0.5, range) == true, "0.5 - alert");
+ ok( check_range(1, range) == false, "1 - no alert");
+ ok( check_range(5.2, range) == true, "5.2 - alert");
+ free(range);
+
+ range = parse_range_string("2:1");
+ ok( range == NULL, "'2:1' rejected");
+
+ rc = _set_thresholds(&thresholds, NULL, NULL);
+ ok( rc == 0, "Thresholds (NULL, NULL) set");
+ ok( thresholds->warning == NULL, "Warning not set");
+ ok( thresholds->critical == NULL, "Critical not set");
+
+ rc = _set_thresholds(&thresholds, NULL, "80");
+ ok( rc == 0, "Thresholds (NULL, '80') set");
+ ok( thresholds->warning == NULL, "Warning not set");
+ ok( thresholds->critical->end == 80, "Critical set correctly");
+
+ rc = _set_thresholds(&thresholds, "5:33", NULL);
+ ok( rc == 0, "Thresholds ('5:33', NULL) set");
+ ok( thresholds->warning->start == 5, "Warning start set");
+ ok( thresholds->warning->end == 33, "Warning end set");
+ ok( thresholds->critical == NULL, "Critical not set");
+
+ rc = _set_thresholds(&thresholds, "30", "60");
+ ok( rc == 0, "Thresholds ('30', '60') set");
+ ok( thresholds->warning->end == 30, "Warning set correctly");
+ ok( thresholds->critical->end == 60, "Critical set correctly");
+ ok( get_status(15.3, thresholds) == STATE_OK, "15.3 - ok");
+ ok( get_status(30.0001, thresholds) == STATE_WARNING, "30.0001 - warning");
+ ok( get_status(69, thresholds) == STATE_CRITICAL, "69 - critical");
+
+ rc = _set_thresholds(&thresholds, "-10:-2", "-30:20");
+ ok( rc == 0, "Thresholds ('-30:20', '-10:-2') set");
+ ok( thresholds->warning->start == -10, "Warning start set correctly");
+ ok( thresholds->warning->end == -2, "Warning end set correctly");
+ ok( thresholds->critical->start == -30, "Critical start set correctly");
+ ok( thresholds->critical->end == 20, "Critical end set correctly");
+ ok( get_status(-31, thresholds) == STATE_CRITICAL, "-31 - critical");
+ ok( get_status(-29, thresholds) == STATE_WARNING, "-29 - warning");
+ ok( get_status(-11, thresholds) == STATE_WARNING, "-11 - warning");
+ ok( get_status(-10, thresholds) == STATE_OK, "-10 - ok");
+ ok( get_status(-2, thresholds) == STATE_OK, "-2 - ok");
+ ok( get_status(-1, thresholds) == STATE_WARNING, "-1 - warning");
+ ok( get_status(19, thresholds) == STATE_WARNING, "19 - warning");
+ ok( get_status(21, thresholds) == STATE_CRITICAL, "21 - critical");
+
+ char *test;
+ test = np_escaped_string("bob\\n");
+ ok( strcmp(test, "bob\n") == 0, "bob\\n ok");
+ free(test);
+
+ test = np_escaped_string("rhuba\\rb");
+ ok( strcmp(test, "rhuba\rb") == 0, "rhuba\\rb okay");
+ free(test);
+
+ test = np_escaped_string("ba\\nge\\r");
+ ok( strcmp(test, "ba\nge\r") == 0, "ba\\nge\\r okay");
+ free(test);
+
+ test = np_escaped_string("\\rabbi\\t");
+ ok( strcmp(test, "\rabbi\t") == 0, "\\rabbi\\t okay");
+ free(test);
+
+ test = np_escaped_string("and\\\\or");
+ ok( strcmp(test, "and\\or") == 0, "and\\\\or okay");
+ free(test);
+
+ test = np_escaped_string("bo\\gus");
+ ok( strcmp(test, "bogus") == 0, "bo\\gus okay");
+ free(test);
+
+ test = np_escaped_string("everything");
+ ok( strcmp(test, "everything") == 0, "everything okay");
+
+ /* np_extract_ntpvar tests (23) */
+ test=np_extract_ntpvar("foo=bar, bar=foo, foobar=barfoo\n", "foo");
+ ok(test && !strcmp(test, "bar"), "1st test as expected");
+ free(test);
+
+ test=np_extract_ntpvar("foo=bar,bar=foo,foobar=barfoo\n", "bar");
+ ok(test && !strcmp(test, "foo"), "2nd test as expected");
+ free(test);
+
+ test=np_extract_ntpvar("foo=bar, bar=foo, foobar=barfoo\n", "foobar");
+ ok(test && !strcmp(test, "barfoo"), "3rd test as expected");
+ free(test);
+
+ test=np_extract_ntpvar("foo=bar\n", "foo");
+ ok(test && !strcmp(test, "bar"), "Single test as expected");
+ free(test);
+
+ test=np_extract_ntpvar("foo=bar, bar=foo, foobar=barfooi\n", "abcd");
+ ok(!test, "Key not found 1");
+
+ test=np_extract_ntpvar("foo=bar\n", "abcd");
+ ok(!test, "Key not found 2");
+
+ test=np_extract_ntpvar("foo=bar=foobar", "foo");
+ ok(test && !strcmp(test, "bar=foobar"), "Strange string 1");
+ free(test);
+
+ test=np_extract_ntpvar("foo", "foo");
+ ok(!test, "Malformed string 1");
+
+ test=np_extract_ntpvar("foo,", "foo");
+ ok(!test, "Malformed string 2");
+
+ test=np_extract_ntpvar("foo=", "foo");
+ ok(!test, "Malformed string 3");
+
+ test=np_extract_ntpvar("foo=,bar=foo", "foo");
+ ok(!test, "Malformed string 4");
+
+ test=np_extract_ntpvar(",foo", "foo");
+ ok(!test, "Malformed string 5");
+
+ test=np_extract_ntpvar("=foo", "foo");
+ ok(!test, "Malformed string 6");
+
+ test=np_extract_ntpvar("=foo,", "foo");
+ ok(!test, "Malformed string 7");
+
+ test=np_extract_ntpvar(",,,", "foo");
+ ok(!test, "Malformed string 8");
+
+ test=np_extract_ntpvar("===", "foo");
+ ok(!test, "Malformed string 9");
+
+ test=np_extract_ntpvar(",=,=,", "foo");
+ ok(!test, "Malformed string 10");
+
+ test=np_extract_ntpvar("=,=,=", "foo");
+ ok(!test, "Malformed string 11");
+
+ test=np_extract_ntpvar(" foo=bar ,\n bar=foo\n , foobar=barfoo \n ", "foo");
+ ok(test && !strcmp(test, "bar"), "Random spaces and newlines 1");
+ free(test);
+
+ test=np_extract_ntpvar(" foo=bar ,\n bar=foo\n , foobar=barfoo \n ", "bar");
+ ok(test && !strcmp(test, "foo"), "Random spaces and newlines 2");
+ free(test);
+
+ test=np_extract_ntpvar(" foo=bar ,\n bar=foo\n , foobar=barfoo \n ", "foobar");
+ ok(test && !strcmp(test, "barfoo"), "Random spaces and newlines 3");
+ free(test);
+
+ test=np_extract_ntpvar(" foo=bar ,\n bar\n \n= \n foo\n , foobar=barfoo \n ", "bar");
+ ok(test && !strcmp(test, "foo"), "Random spaces and newlines 4");
+ free(test);
+
+ test=np_extract_ntpvar("", "foo");
+ ok(!test, "Empty string return NULL");
+
+
+ /* This is the result of running ./test_utils */
+ temp_string = (char *) _np_state_generate_key();
+ ok(!strcmp(temp_string, "e2d17f995fd4c020411b85e3e3d0ff7306d4147e"), "Got hash with exe and no parameters" ) ||
+ diag( "You are probably running in wrong directory. Must run as ./test_utils" );
+
+
+ this_monitoring_plugin->argc=4;
+ this_monitoring_plugin->argv[0] = "./test_utils";
+ this_monitoring_plugin->argv[1] = "here";
+ this_monitoring_plugin->argv[2] = "--and";
+ this_monitoring_plugin->argv[3] = "now";
+ temp_string = (char *) _np_state_generate_key();
+ ok(!strcmp(temp_string, "bd72da9f78ff1419fad921ea5e43ce56508aef6c"), "Got based on expected argv" );
+
+ unsetenv("MP_STATE_PATH");
+ temp_string = (char *) _np_state_calculate_location_prefix();
+ ok(!strcmp(temp_string, NP_STATE_DIR_PREFIX), "Got default directory" );
+
+ setenv("MP_STATE_PATH", "", 1);
+ temp_string = (char *) _np_state_calculate_location_prefix();
+ ok(!strcmp(temp_string, NP_STATE_DIR_PREFIX), "Got default directory even with empty string" );
+
+ setenv("MP_STATE_PATH", "/usr/local/nagios/var", 1);
+ temp_string = (char *) _np_state_calculate_location_prefix();
+ ok(!strcmp(temp_string, "/usr/local/nagios/var"), "Got default directory" );
+
+
+
+ ok(temp_state_key==NULL, "temp_state_key initially empty");
+
+ this_monitoring_plugin->argc=1;
+ this_monitoring_plugin->argv[0] = "./test_utils";
+ np_enable_state(NULL, 51);
+ temp_state_key = this_monitoring_plugin->state;
+ ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" );
+ ok( !strcmp(temp_state_key->name, "e2d17f995fd4c020411b85e3e3d0ff7306d4147e"), "Got generated filename" );
+
+
+ np_enable_state("allowedchars_in_keyname", 77);
+ temp_state_key = this_monitoring_plugin->state;
+ sprintf(state_path, "/usr/local/nagios/var/%lu/check_test/allowedchars_in_keyname", (unsigned long)geteuid());
+ ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" );
+ ok( !strcmp(temp_state_key->name, "allowedchars_in_keyname"), "Got key name with valid chars" );
+ ok( !strcmp(temp_state_key->_filename, state_path), "Got internal filename" );
+
+
+ /* Don't do this test just yet. Will die */
+ /*
+ np_enable_state("bad^chars$in@here", 77);
+ temp_state_key = this_monitoring_plugin->state;
+ ok( !strcmp(temp_state_key->name, "bad_chars_in_here"), "Got key name with bad chars replaced" );
+ */
+
+ np_enable_state("funnykeyname", 54);
+ temp_state_key = this_monitoring_plugin->state;
+ sprintf(state_path, "/usr/local/nagios/var/%lu/check_test/funnykeyname", (unsigned long)geteuid());
+ ok( !strcmp(temp_state_key->plugin_name, "check_test"), "Got plugin name" );
+ ok( !strcmp(temp_state_key->name, "funnykeyname"), "Got key name" );
+
+
+
+ ok( !strcmp(temp_state_key->_filename, state_path), "Got internal filename" );
+ ok( temp_state_key->data_version==54, "Version set" );
+
+ temp_state_data = np_state_read();
+ ok( temp_state_data==NULL, "Got no state data as file does not exist" );
+
+
+/*
+ temp_fp = fopen("var/statefile", "r");
+ if (temp_fp==NULL)
+ printf("Error opening. errno=%d\n", errno);
+ printf("temp_fp=%s\n", temp_fp);
+ ok( _np_state_read_file(temp_fp) == true, "Can read state file" );
+ fclose(temp_fp);
+*/
+
+ temp_state_key->_filename="var/statefile";
+ temp_state_data = np_state_read();
+ ok( this_monitoring_plugin->state->state_data!=NULL, "Got state data now" ) || diag("Are you running in right directory? Will get coredump next if not");
+ ok( this_monitoring_plugin->state->state_data->time==1234567890, "Got time" );
+ ok( !strcmp((char *)this_monitoring_plugin->state->state_data->data, "String to read"), "Data as expected" );
+
+ temp_state_key->data_version=53;
+ temp_state_data = np_state_read();
+ ok( temp_state_data==NULL, "Older data version gives NULL" );
+ temp_state_key->data_version=54;
+
+ temp_state_key->_filename="var/nonexistent";
+ temp_state_data = np_state_read();
+ ok( temp_state_data==NULL, "Missing file gives NULL" );
+ ok( this_monitoring_plugin->state->state_data==NULL, "No state information" );
+
+ temp_state_key->_filename="var/oldformat";
+ temp_state_data = np_state_read();
+ ok( temp_state_data==NULL, "Old file format gives NULL" );
+
+ temp_state_key->_filename="var/baddate";
+ temp_state_data = np_state_read();
+ ok( temp_state_data==NULL, "Bad date gives NULL" );
+
+ temp_state_key->_filename="var/missingdataline";
+ temp_state_data = np_state_read();
+ ok( temp_state_data==NULL, "Missing data line gives NULL" );
+
+
+
+
+ unlink("var/generated");
+ temp_state_key->_filename="var/generated";
+ current_time=1234567890;
+ np_state_write_string(current_time, "String to read");
+ ok(system("cmp var/generated var/statefile")==0, "Generated file same as expected");
+
+
+
+
+ unlink("var/generated_directory/statefile");
+ unlink("var/generated_directory");
+ temp_state_key->_filename="var/generated_directory/statefile";
+ current_time=1234567890;
+ np_state_write_string(current_time, "String to read");
+ ok(system("cmp var/generated_directory/statefile var/statefile")==0, "Have created directory");
+
+ /* This test to check cannot write to dir - can't automate yet */
+ /*
+ unlink("var/generated_bad_dir");
+ mkdir("var/generated_bad_dir", S_IRUSR);
+ np_state_write_string(current_time, "String to read");
+ */
+
+
+ temp_state_key->_filename="var/generated";
+ time(&current_time);
+ np_state_write_string(0, "String to read");
+ temp_state_data = np_state_read();
+ /* Check time is set to current_time */
+ ok(system("cmp var/generated var/statefile > /dev/null")!=0, "Generated file should be different this time");
+ ok(this_monitoring_plugin->state->state_data->time-current_time<=1, "Has time generated from current time");
+
+
+ /* Don't know how to automatically test this. Need to be able to redefine die and catch the error */
+ /*
+ temp_state_key->_filename="/dev/do/not/expect/to/be/able/to/write";
+ np_state_write_string(0, "Bad file");
+ */
+
+
+ np_cleanup();
+
+ ok(this_monitoring_plugin==NULL, "Free'd this_monitoring_plugin");
+
+ ok(mp_suid() == false, "Test aren't suid");
+
+ /* base states with random case */
+ char *states[] = {
+ "Ok",
+ "wArnINg",
+ "cRiTIcaL",
+ "UnKNoWN",
+ NULL
+ };
+
+ for (i=0; states[i]!=NULL; i++) {
+ /* out of the random case states, create the lower and upper versions + numeric string one */
+ char *statelower = strdup(states[i]);
+ char *stateupper = strdup(states[i]);
+ char statenum[2];
+ char *temp_ptr;
+ for (temp_ptr = statelower; *temp_ptr; temp_ptr++) {
+ *temp_ptr = tolower(*temp_ptr);
+ }
+ for (temp_ptr = stateupper; *temp_ptr; temp_ptr++) {
+ *temp_ptr = toupper(*temp_ptr);
+ }
+ snprintf(statenum, 2, "%i", i);
+
+ /* Base test names, we'll append the state string */
+ char testname[64] = "Translate state string: ";
+ int tlen = strlen(testname);
+
+ strcpy(testname+tlen, states[i]);
+ ok(i==mp_translate_state(states[i]), testname);
+
+ strcpy(testname+tlen, statelower);
+ ok(i==mp_translate_state(statelower), testname);
+
+ strcpy(testname+tlen, stateupper);
+ ok(i==mp_translate_state(stateupper), testname);
+
+ strcpy(testname+tlen, statenum);
+ ok(i==mp_translate_state(statenum), testname);
+ }
+ ok(ERROR==mp_translate_state("warningfewgw"), "Translate state string with garbage");
+ ok(ERROR==mp_translate_state("00"), "Translate state string: bad numeric string 1");
+ ok(ERROR==mp_translate_state("01"), "Translate state string: bad numeric string 2");
+ ok(ERROR==mp_translate_state("10"), "Translate state string: bad numeric string 3");
+ ok(ERROR==mp_translate_state(""), "Translate state string: empty string");
+
+ return exit_status();
+}
diff --git a/lib/tests/test_utils.t b/lib/tests/test_utils.t
new file mode 100755
index 0000000..e2a9311
--- /dev/null
+++ b/lib/tests/test_utils.t
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+use Test::More;
+if (! -e "./test_utils") {
+ plan skip_all => "./test_utils not compiled - please enable libtap library to test";
+}
+exec "./test_utils";
diff --git a/lib/tests/var/.gitignore b/lib/tests/var/.gitignore
new file mode 100644
index 0000000..95a59c1
--- /dev/null
+++ b/lib/tests/var/.gitignore
@@ -0,0 +1,2 @@
+generated
+generated_directory/
diff --git a/lib/tests/var/baddate b/lib/tests/var/baddate
new file mode 100644
index 0000000..2fda432
--- /dev/null
+++ b/lib/tests/var/baddate
@@ -0,0 +1,5 @@
+# NP State file
+1
+54
+2147483647
+Date in future!!!!
diff --git a/lib/tests/var/missingdataline b/lib/tests/var/missingdataline
new file mode 100644
index 0000000..d87f73a
--- /dev/null
+++ b/lib/tests/var/missingdataline
@@ -0,0 +1,4 @@
+# NP State file
+1
+54
+1234567890
diff --git a/lib/tests/var/oldformat b/lib/tests/var/oldformat
new file mode 100644
index 0000000..102f8c9
--- /dev/null
+++ b/lib/tests/var/oldformat
@@ -0,0 +1,5 @@
+# NP State file
+0
+54
+1234567890
+String to read
diff --git a/lib/tests/var/statefile b/lib/tests/var/statefile
new file mode 100644
index 0000000..5002139
--- /dev/null
+++ b/lib/tests/var/statefile
@@ -0,0 +1,5 @@
+# NP State file
+1
+54
+1234567890
+String to read
diff --git a/lib/utils_base.c b/lib/utils_base.c
new file mode 100644
index 0000000..f86efbe
--- /dev/null
+++ b/lib/utils_base.c
@@ -0,0 +1,727 @@
+/*****************************************************************************
+*
+* utils_base.c
+*
+* License: GPL
+* Copyright (c) 2006 Monitoring Plugins Development Team
+*
+* Library of useful functions for plugins
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "../plugins/common.h"
+#include <stdarg.h>
+#include "utils_base.h"
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#define np_free(ptr) { if(ptr) { free(ptr); ptr = NULL; } }
+
+monitoring_plugin *this_monitoring_plugin=NULL;
+
+unsigned int timeout_state = STATE_CRITICAL;
+unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
+
+bool _np_state_read_file(FILE *);
+
+void np_init( char *plugin_name, int argc, char **argv ) {
+ if (this_monitoring_plugin==NULL) {
+ this_monitoring_plugin = calloc(1, sizeof(monitoring_plugin));
+ if (this_monitoring_plugin==NULL) {
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+ }
+ this_monitoring_plugin->plugin_name = strdup(plugin_name);
+ if (this_monitoring_plugin->plugin_name==NULL)
+ die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno));
+ this_monitoring_plugin->argc = argc;
+ this_monitoring_plugin->argv = argv;
+ }
+}
+
+void np_set_args( int argc, char **argv ) {
+ if (this_monitoring_plugin==NULL)
+ die(STATE_UNKNOWN, _("This requires np_init to be called"));
+
+ this_monitoring_plugin->argc = argc;
+ this_monitoring_plugin->argv = argv;
+}
+
+
+void np_cleanup() {
+ if (this_monitoring_plugin!=NULL) {
+ if(this_monitoring_plugin->state!=NULL) {
+ if(this_monitoring_plugin->state->state_data) {
+ np_free(this_monitoring_plugin->state->state_data->data);
+ np_free(this_monitoring_plugin->state->state_data);
+ }
+ np_free(this_monitoring_plugin->state->name);
+ np_free(this_monitoring_plugin->state);
+ }
+ np_free(this_monitoring_plugin->plugin_name);
+ np_free(this_monitoring_plugin);
+ }
+ this_monitoring_plugin=NULL;
+}
+
+/* Hidden function to get a pointer to this_monitoring_plugin for testing */
+void _get_monitoring_plugin( monitoring_plugin **pointer ){
+ *pointer = this_monitoring_plugin;
+}
+
+void
+die (int result, const char *fmt, ...)
+{
+ if(fmt!=NULL) {
+ va_list ap;
+ va_start (ap, fmt);
+ vprintf (fmt, ap);
+ va_end (ap);
+ }
+
+ if(this_monitoring_plugin!=NULL) {
+ np_cleanup();
+ }
+ exit (result);
+}
+
+void set_range_start (range *this, double value) {
+ this->start = value;
+ this->start_infinity = false;
+}
+
+void set_range_end (range *this, double value) {
+ this->end = value;
+ this->end_infinity = false;
+}
+
+range
+*parse_range_string (char *str) {
+ range *temp_range;
+ double start;
+ double end;
+ char *end_str;
+
+ temp_range = (range *) calloc(1, sizeof(range));
+
+ /* Set defaults */
+ temp_range->start = 0;
+ temp_range->start_infinity = false;
+ temp_range->end = 0;
+ temp_range->end_infinity = true;
+ temp_range->alert_on = OUTSIDE;
+ temp_range->text = strdup(str);
+
+ if (str[0] == '@') {
+ temp_range->alert_on = INSIDE;
+ str++;
+ }
+
+ end_str = index(str, ':');
+ if (end_str != NULL) {
+ if (str[0] == '~') {
+ temp_range->start_infinity = true;
+ } else {
+ start = strtod(str, NULL); /* Will stop at the ':' */
+ set_range_start(temp_range, start);
+ }
+ end_str++; /* Move past the ':' */
+ } else {
+ end_str = str;
+ }
+ end = strtod(end_str, NULL);
+ if (strcmp(end_str, "") != 0) {
+ set_range_end(temp_range, end);
+ }
+
+ if (temp_range->start_infinity == true ||
+ temp_range->end_infinity == true ||
+ temp_range->start <= temp_range->end) {
+ return temp_range;
+ }
+ free(temp_range);
+ return NULL;
+}
+
+/* returns 0 if okay, otherwise 1 */
+int
+_set_thresholds(thresholds **my_thresholds, char *warn_string, char *critical_string)
+{
+ thresholds *temp_thresholds = NULL;
+
+ if ((temp_thresholds = calloc(1, sizeof(thresholds))) == NULL)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+
+ temp_thresholds->warning = NULL;
+ temp_thresholds->critical = NULL;
+
+ if (warn_string != NULL) {
+ if ((temp_thresholds->warning = parse_range_string(warn_string)) == NULL) {
+ return NP_RANGE_UNPARSEABLE;
+ }
+ }
+ if (critical_string != NULL) {
+ if ((temp_thresholds->critical = parse_range_string(critical_string)) == NULL) {
+ return NP_RANGE_UNPARSEABLE;
+ }
+ }
+
+ *my_thresholds = temp_thresholds;
+
+ return 0;
+}
+
+void
+set_thresholds(thresholds **my_thresholds, char *warn_string, char *critical_string)
+{
+ switch (_set_thresholds(my_thresholds, warn_string, critical_string)) {
+ case 0:
+ return;
+ case NP_RANGE_UNPARSEABLE:
+ die(STATE_UNKNOWN, _("Range format incorrect"));
+ case NP_WARN_WITHIN_CRIT:
+ die(STATE_UNKNOWN, _("Warning level is a subset of critical and will not be alerted"));
+ break;
+ }
+}
+
+void print_thresholds(const char *threshold_name, thresholds *my_threshold) {
+ printf("%s - ", threshold_name);
+ if (! my_threshold) {
+ printf("Threshold not set");
+ } else {
+ if (my_threshold->warning) {
+ printf("Warning: start=%g end=%g; ", my_threshold->warning->start, my_threshold->warning->end);
+ } else {
+ printf("Warning not set; ");
+ }
+ if (my_threshold->critical) {
+ printf("Critical: start=%g end=%g", my_threshold->critical->start, my_threshold->critical->end);
+ } else {
+ printf("Critical not set");
+ }
+ }
+ printf("\n");
+}
+
+/* Returns true if alert should be raised based on the range */
+bool check_range(double value, range *my_range)
+{
+ bool no = false;
+ bool yes = true;
+
+ if (my_range->alert_on == INSIDE) {
+ no = true;
+ yes = false;
+ }
+
+ if (my_range->end_infinity == false && my_range->start_infinity == false) {
+ if ((my_range->start <= value) && (value <= my_range->end)) {
+ return no;
+ } else {
+ return yes;
+ }
+ } else if (my_range->start_infinity == false && my_range->end_infinity == true) {
+ if (my_range->start <= value) {
+ return no;
+ } else {
+ return yes;
+ }
+ } else if (my_range->start_infinity == true && my_range->end_infinity == false) {
+ if (value <= my_range->end) {
+ return no;
+ } else {
+ return yes;
+ }
+ } else {
+ return no;
+ }
+}
+
+/* Returns status */
+int
+get_status(double value, thresholds *my_thresholds)
+{
+ if (my_thresholds->critical != NULL) {
+ if (check_range(value, my_thresholds->critical) == true) {
+ return STATE_CRITICAL;
+ }
+ }
+ if (my_thresholds->warning != NULL) {
+ if (check_range(value, my_thresholds->warning) == true) {
+ return STATE_WARNING;
+ }
+ }
+ return STATE_OK;
+}
+
+char *np_escaped_string (const char *string) {
+ char *data;
+ int i, j=0;
+ data = strdup(string);
+ for (i=0; data[i]; i++) {
+ if (data[i] == '\\') {
+ switch(data[++i]) {
+ case 'n':
+ data[j++] = '\n';
+ break;
+ case 'r':
+ data[j++] = '\r';
+ break;
+ case 't':
+ data[j++] = '\t';
+ break;
+ case '\\':
+ data[j++] = '\\';
+ break;
+ default:
+ data[j++] = data[i];
+ }
+ } else {
+ data[j++] = data[i];
+ }
+ }
+ data[j] = '\0';
+ return data;
+}
+
+int np_check_if_root(void) { return (geteuid() == 0); }
+
+/*
+ * Extract the value from key/value pairs, or return NULL. The value returned
+ * can be free()ed.
+ * This function can be used to parse NTP control packet data and performance
+ * data strings.
+ */
+char *np_extract_value(const char *varlist, const char *name, char sep) {
+ char *tmp=NULL, *value=NULL;
+ int i;
+
+ while (1) {
+ /* Strip any leading space */
+ for (; isspace(varlist[0]); varlist++);
+
+ if (strncmp(name, varlist, strlen(name)) == 0) {
+ varlist += strlen(name);
+ /* strip trailing spaces */
+ for (; isspace(varlist[0]); varlist++);
+
+ if (varlist[0] == '=') {
+ /* We matched the key, go past the = sign */
+ varlist++;
+ /* strip leading spaces */
+ for (; isspace(varlist[0]); varlist++);
+
+ if ((tmp = index(varlist, sep))) {
+ /* Value is delimited by a comma */
+ if (tmp-varlist == 0) continue;
+ value = (char *)calloc(1, tmp-varlist+1);
+ strncpy(value, varlist, tmp-varlist);
+ value[tmp-varlist] = '\0';
+ } else {
+ /* Value is delimited by a \0 */
+ if (strlen(varlist) == 0) continue;
+ value = (char *)calloc(1, strlen(varlist) + 1);
+ strncpy(value, varlist, strlen(varlist));
+ value[strlen(varlist)] = '\0';
+ }
+ break;
+ }
+ }
+ if ((tmp = index(varlist, sep))) {
+ /* More keys, keep going... */
+ varlist = tmp + 1;
+ } else {
+ /* We're done */
+ break;
+ }
+ }
+
+ /* Clean-up trailing spaces/newlines */
+ if (value) for (i=strlen(value)-1; isspace(value[i]); i--) value[i] = '\0';
+
+ return value;
+}
+
+const char *
+state_text (int result)
+{
+ switch (result) {
+ case STATE_OK:
+ return "OK";
+ case STATE_WARNING:
+ return "WARNING";
+ case STATE_CRITICAL:
+ return "CRITICAL";
+ case STATE_DEPENDENT:
+ return "DEPENDENT";
+ default:
+ return "UNKNOWN";
+ }
+}
+
+/*
+ * Read a string representing a state (ok, warning... or numeric: 0, 1) and
+ * return the corresponding STATE_ value or ERROR)
+ */
+int mp_translate_state (char *state_text) {
+ if (!strcasecmp(state_text,"OK") || !strcmp(state_text,"0"))
+ return STATE_OK;
+ if (!strcasecmp(state_text,"WARNING") || !strcmp(state_text,"1"))
+ return STATE_WARNING;
+ if (!strcasecmp(state_text,"CRITICAL") || !strcmp(state_text,"2"))
+ return STATE_CRITICAL;
+ if (!strcasecmp(state_text,"UNKNOWN") || !strcmp(state_text,"3"))
+ return STATE_UNKNOWN;
+ return ERROR;
+}
+
+/*
+ * Returns a string to use as a keyname, based on an md5 hash of argv, thus
+ * hopefully a unique key per service/plugin invocation. Use the extra-opts
+ * parse of argv, so that uniqueness in parameters are reflected there.
+ */
+char *_np_state_generate_key() {
+ int i;
+ char **argv = this_monitoring_plugin->argv;
+ char keyname[41];
+ char *p=NULL;
+
+ unsigned char result[256];
+
+#ifdef USE_OPENSSL
+ /*
+ * This code path is chosen if openssl is available (which should be the most common
+ * scenario). Alternatively, the gnulib implementation/
+ *
+ */
+ EVP_MD_CTX *ctx = EVP_MD_CTX_new();
+
+ EVP_DigestInit(ctx, EVP_sha256());
+
+ for(i=0; i<this_monitoring_plugin->argc; i++) {
+ EVP_DigestUpdate(ctx, argv[i], strlen(argv[i]));
+ }
+
+ EVP_DigestFinal(ctx, result, NULL);
+#else
+
+ struct sha256_ctx ctx;
+
+ for(i=0; i<this_monitoring_plugin->argc; i++) {
+ sha256_process_bytes(argv[i], strlen(argv[i]), &ctx);
+ }
+
+ sha256_finish_ctx(&ctx, result);
+#endif // FOUNDOPENSSL
+
+ for (i=0; i<20; ++i) {
+ sprintf(&keyname[2*i], "%02x", result[i]);
+ }
+
+ keyname[40]='\0';
+
+ p = strdup(keyname);
+ if(p==NULL) {
+ die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno));
+ }
+ return p;
+}
+
+void _cleanup_state_data() {
+ if (this_monitoring_plugin->state->state_data!=NULL) {
+ np_free(this_monitoring_plugin->state->state_data->data);
+ np_free(this_monitoring_plugin->state->state_data);
+ }
+}
+
+/*
+ * Internal function. Returns either:
+ * envvar NAGIOS_PLUGIN_STATE_DIRECTORY
+ * statically compiled shared state directory
+ */
+char* _np_state_calculate_location_prefix(){
+ char *env_dir;
+
+ /* Do not allow passing MP_STATE_PATH in setuid plugins
+ * for security reasons */
+ if (!mp_suid()) {
+ env_dir = getenv("MP_STATE_PATH");
+ if(env_dir && env_dir[0] != '\0')
+ return env_dir;
+ /* This is the former ENV, for backward-compatibility */
+ env_dir = getenv("NAGIOS_PLUGIN_STATE_DIRECTORY");
+ if(env_dir && env_dir[0] != '\0')
+ return env_dir;
+ }
+
+ return NP_STATE_DIR_PREFIX;
+}
+
+/*
+ * Initiatializer for state routines.
+ * Sets variables. Generates filename. Returns np_state_key. die with
+ * UNKNOWN if exception
+ */
+void np_enable_state(char *keyname, int expected_data_version) {
+ state_key *this_state = NULL;
+ char *temp_filename = NULL;
+ char *temp_keyname = NULL;
+ char *p=NULL;
+ int ret;
+
+ if(this_monitoring_plugin==NULL)
+ die(STATE_UNKNOWN, _("This requires np_init to be called"));
+
+ this_state = (state_key *) calloc(1, sizeof(state_key));
+ if(this_state==NULL)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+
+ if(keyname==NULL) {
+ temp_keyname = _np_state_generate_key();
+ } else {
+ temp_keyname = strdup(keyname);
+ if(temp_keyname==NULL)
+ die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno));
+ }
+ /* Die if invalid characters used for keyname */
+ p = temp_keyname;
+ while(*p!='\0') {
+ if(! (isalnum(*p) || *p == '_')) {
+ die(STATE_UNKNOWN, _("Invalid character for keyname - only alphanumerics or '_'"));
+ }
+ p++;
+ }
+ this_state->name=temp_keyname;
+ this_state->plugin_name=this_monitoring_plugin->plugin_name;
+ this_state->data_version=expected_data_version;
+ this_state->state_data=NULL;
+
+ /* Calculate filename */
+ ret = asprintf(&temp_filename, "%s/%lu/%s/%s",
+ _np_state_calculate_location_prefix(), (unsigned long)geteuid(),
+ this_monitoring_plugin->plugin_name, this_state->name);
+ if (ret < 0)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+
+ this_state->_filename=temp_filename;
+
+ this_monitoring_plugin->state = this_state;
+}
+
+/*
+ * Will return NULL if no data is available (first run). If key currently
+ * exists, read data. If state file format version is not expected, return
+ * as if no data. Get state data version number and compares to expected.
+ * If numerically lower, then return as no previous state. die with UNKNOWN
+ * if exceptional error.
+ */
+state_data *np_state_read() {
+ state_data *this_state_data=NULL;
+ FILE *statefile;
+ bool rc = false;
+
+ if(this_monitoring_plugin==NULL)
+ die(STATE_UNKNOWN, _("This requires np_init to be called"));
+
+ /* Open file. If this fails, no previous state found */
+ statefile = fopen( this_monitoring_plugin->state->_filename, "r" );
+ if(statefile!=NULL) {
+
+ this_state_data = (state_data *) calloc(1, sizeof(state_data));
+ if(this_state_data==NULL)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+
+ this_state_data->data=NULL;
+ this_monitoring_plugin->state->state_data = this_state_data;
+
+ rc = _np_state_read_file(statefile);
+
+ fclose(statefile);
+ }
+
+ if(!rc) {
+ _cleanup_state_data();
+ }
+
+ return this_monitoring_plugin->state->state_data;
+}
+
+/*
+ * Read the state file
+ */
+bool _np_state_read_file(FILE *f) {
+ bool status = false;
+ size_t pos;
+ char *line;
+ int i;
+ int failure=0;
+ time_t current_time, data_time;
+ enum { STATE_FILE_VERSION, STATE_DATA_VERSION, STATE_DATA_TIME, STATE_DATA_TEXT, STATE_DATA_END } expected=STATE_FILE_VERSION;
+
+ time(&current_time);
+
+ /* Note: This introduces a limit of 1024 bytes in the string data */
+ line = (char *) calloc(1, 1024);
+ if(line==NULL)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+
+ while(!failure && (fgets(line,1024,f))!=NULL){
+ pos=strlen(line);
+ if(line[pos-1]=='\n') {
+ line[pos-1]='\0';
+ }
+
+ if(line[0] == '#') continue;
+
+ switch(expected) {
+ case STATE_FILE_VERSION:
+ i=atoi(line);
+ if(i!=NP_STATE_FORMAT_VERSION)
+ failure++;
+ else
+ expected=STATE_DATA_VERSION;
+ break;
+ case STATE_DATA_VERSION:
+ i=atoi(line);
+ if(i != this_monitoring_plugin->state->data_version)
+ failure++;
+ else
+ expected=STATE_DATA_TIME;
+ break;
+ case STATE_DATA_TIME:
+ /* If time > now, error */
+ data_time=strtoul(line,NULL,10);
+ if(data_time > current_time)
+ failure++;
+ else {
+ this_monitoring_plugin->state->state_data->time = data_time;
+ expected=STATE_DATA_TEXT;
+ }
+ break;
+ case STATE_DATA_TEXT:
+ this_monitoring_plugin->state->state_data->data = strdup(line);
+ if(this_monitoring_plugin->state->state_data->data==NULL)
+ die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno));
+ expected=STATE_DATA_END;
+ status=true;
+ break;
+ case STATE_DATA_END:
+ ;
+ }
+ }
+
+ np_free(line);
+ return status;
+}
+
+/*
+ * If time=NULL, use current time. Create state file, with state format
+ * version, default text. Writes version, time, and data. Avoid locking
+ * problems - use mv to write and then swap. Possible loss of state data if
+ * two things writing to same key at same time.
+ * Will die with UNKNOWN if errors
+ */
+void np_state_write_string(time_t data_time, char *data_string) {
+ FILE *fp;
+ char *temp_file=NULL;
+ int fd=0, result=0;
+ time_t current_time;
+ char *directories=NULL;
+ char *p=NULL;
+
+ if(data_time==0)
+ time(&current_time);
+ else
+ current_time=data_time;
+
+ /* If file doesn't currently exist, create directories */
+ if(access(this_monitoring_plugin->state->_filename,F_OK)!=0) {
+ result = asprintf(&directories, "%s", this_monitoring_plugin->state->_filename);
+ if(result < 0)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+
+ for(p=directories+1; *p; p++) {
+ if(*p=='/') {
+ *p='\0';
+ if((access(directories,F_OK)!=0) && (mkdir(directories, S_IRWXU)!=0)) {
+ /* Can't free this! Otherwise error message is wrong! */
+ /* np_free(directories); */
+ die(STATE_UNKNOWN, _("Cannot create directory: %s"), directories);
+ }
+ *p='/';
+ }
+ }
+ np_free(directories);
+ }
+
+ result = asprintf(&temp_file,"%s.XXXXXX",this_monitoring_plugin->state->_filename);
+ if(result < 0)
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+
+ if((fd=mkstemp(temp_file))==-1) {
+ np_free(temp_file);
+ die(STATE_UNKNOWN, _("Cannot create temporary filename"));
+ }
+
+ fp=(FILE *)fdopen(fd,"w");
+ if(fp==NULL) {
+ close(fd);
+ unlink(temp_file);
+ np_free(temp_file);
+ die(STATE_UNKNOWN, _("Unable to open temporary state file"));
+ }
+
+ fprintf(fp,"# NP State file\n");
+ fprintf(fp,"%d\n",NP_STATE_FORMAT_VERSION);
+ fprintf(fp,"%d\n",this_monitoring_plugin->state->data_version);
+ fprintf(fp,"%lu\n",current_time);
+ fprintf(fp,"%s\n",data_string);
+
+ fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP);
+
+ fflush(fp);
+
+ result=fclose(fp);
+
+ fsync(fd);
+
+ if(result!=0) {
+ unlink(temp_file);
+ np_free(temp_file);
+ die(STATE_UNKNOWN, _("Error writing temp file"));
+ }
+
+ if(rename(temp_file, this_monitoring_plugin->state->_filename)!=0) {
+ unlink(temp_file);
+ np_free(temp_file);
+ die(STATE_UNKNOWN, _("Cannot rename state temp file"));
+ }
+
+ np_free(temp_file);
+}
diff --git a/lib/utils_base.h b/lib/utils_base.h
new file mode 100644
index 0000000..80b8743
--- /dev/null
+++ b/lib/utils_base.h
@@ -0,0 +1,119 @@
+#ifndef _UTILS_BASE_
+#define _UTILS_BASE_
+/* Header file for Monitoring Plugins utils_base.c */
+
+#ifndef USE_OPENSSL
+# include "sha256.h"
+#endif
+
+/* This file holds header information for thresholds - use this in preference to
+ individual plugin logic */
+
+/* This has not been merged with utils.h because of problems with
+ timeout_interval when other utils_*.h files use utils.h */
+
+/* Long term, add new functions to utils_base.h for common routines
+ and utils_*.h for specific to plugin routines. If routines are
+ placed in utils_*.h, then these can be tested with libtap */
+
+#define OUTSIDE 0
+#define INSIDE 1
+
+typedef struct range_struct {
+ double start;
+ bool start_infinity;
+ double end;
+ int end_infinity;
+ int alert_on; /* OUTSIDE (default) or INSIDE */
+ char* text; /* original unparsed text input */
+ } range;
+
+typedef struct thresholds_struct {
+ range *warning;
+ range *critical;
+ } thresholds;
+
+#define NP_STATE_FORMAT_VERSION 1
+
+typedef struct state_data_struct {
+ time_t time;
+ void *data;
+ int length; /* Of binary data */
+ } state_data;
+
+
+typedef struct state_key_struct {
+ char *name;
+ char *plugin_name;
+ int data_version;
+ char *_filename;
+ state_data *state_data;
+ } state_key;
+
+typedef struct np_struct {
+ char *plugin_name;
+ state_key *state;
+ int argc;
+ char **argv;
+ } monitoring_plugin;
+
+range *parse_range_string (char *);
+int _set_thresholds(thresholds **, char *, char *);
+void set_thresholds(thresholds **, char *, char *);
+void print_thresholds(const char *, thresholds *);
+bool check_range(double, range *);
+int get_status(double, thresholds *);
+
+/* Handle timeouts */
+extern unsigned int timeout_state;
+extern unsigned int timeout_interval;
+
+/* All possible characters in a threshold range */
+#define NP_THRESHOLDS_CHARS "-0123456789.:@~"
+
+char *np_escaped_string (const char *);
+
+void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));
+
+/* Return codes for _set_thresholds */
+#define NP_RANGE_UNPARSEABLE 1
+#define NP_WARN_WITHIN_CRIT 2
+
+/* a simple check to see if we're running as root.
+ * returns zero on failure, nonzero on success */
+int np_check_if_root(void);
+
+/* mp_suid() returns true if the real and effective uids differs, such as when
+ * running a suid plugin */
+#define mp_suid() (getuid() != geteuid())
+
+/*
+ * Extract the value from key/value pairs, or return NULL. The value returned
+ * can be free()ed.
+ * This function can be used to parse NTP control packet data and performance
+ * data strings.
+ */
+char *np_extract_value(const char*, const char*, char);
+
+/*
+ * Same as np_extract_value with separator suitable for NTP control packet
+ * payloads (comma)
+ */
+#define np_extract_ntpvar(l, n) np_extract_value(l, n, ',')
+
+/*
+ * Read a string representing a state (ok, warning... or numeric: 0, 1) and
+ * return the corresponding NP_STATE or ERROR)
+ */
+int mp_translate_state (char *);
+
+void np_enable_state(char *, int);
+state_data *np_state_read();
+void np_state_write_string(time_t, char *);
+
+void np_init(char *, int argc, char **argv);
+void np_set_args(int argc, char **argv);
+void np_cleanup();
+const char *state_text (int);
+
+#endif /* _UTILS_BASE_ */
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c
new file mode 100644
index 0000000..cfb2073
--- /dev/null
+++ b/lib/utils_cmd.c
@@ -0,0 +1,405 @@
+/*****************************************************************************
+*
+* Monitoring run command utilities
+*
+* License: GPL
+* Copyright (c) 2005-2006 Monitoring Plugins Development Team
+*
+* Description :
+*
+* A simple interface to executing programs from other programs, using an
+* optimized and safe popen()-like implementation. It is considered safe
+* in that no shell needs to be spawned and the environment passed to the
+* execve()'d program is essentially empty.
+*
+* The code in this file is a derivative of popen.c which in turn was taken
+* from "Advanced Programming for the Unix Environment" by W. Richard Stevens.
+*
+* Care has been taken to make sure the functions are async-safe. The one
+* function which isn't is cmd_init() which it doesn't make sense to
+* call twice anyway, so the api as a whole should be considered async-safe.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#define NAGIOSPLUG_API_C 1
+
+/** includes **/
+#include "common.h"
+#include "utils.h"
+#include "utils_cmd.h"
+/* This variable must be global, since there's no way the caller
+ * can forcibly slay a dead or ungainly running program otherwise.
+ * Multithreading apps and plugins can initialize it (via CMD_INIT)
+ * in an async safe manner PRIOR to calling cmd_run() or cmd_run_array()
+ * for the first time.
+ *
+ * The check for initialized values is atomic and can
+ * occur in any number of threads simultaneously. */
+static pid_t *_cmd_pids = NULL;
+
+#include "utils_base.h"
+
+#include "./maxfd.h"
+
+#include <fcntl.h>
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+/* used in _cmd_open to pass the environment to commands */
+extern char **environ;
+
+/** macros **/
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+/* 4.3BSD Reno <signal.h> doesn't define SIG_ERR */
+#if defined(SIG_IGN) && !defined(SIG_ERR)
+# define SIG_ERR ((Sigfunc *)-1)
+#endif
+
+/** prototypes **/
+static int _cmd_open (char *const *, int *, int *)
+ __attribute__ ((__nonnull__ (1, 2, 3)));
+
+static int _cmd_fetch_output (int, output *, int)
+ __attribute__ ((__nonnull__ (2)));
+
+static int _cmd_close (int);
+
+/* prototype imported from utils.h */
+extern void die (int, const char *, ...)
+ __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
+
+
+/* this function is NOT async-safe. It is exported so multithreaded
+ * plugins (or other apps) can call it prior to running any commands
+ * through this api and thus achieve async-safeness throughout the api */
+void
+cmd_init (void)
+{
+ long maxfd = mp_open_max();
+
+ /* if maxfd is unnaturally high, we force it to a lower value
+ * ( e.g. on SunOS, when ulimit is set to unlimited: 2147483647 this would cause
+ * a segfault when following calloc is called ... ) */
+
+ if ( maxfd > MAXFD_LIMIT ) {
+ maxfd = MAXFD_LIMIT;
+ }
+
+ if (!_cmd_pids)
+ _cmd_pids = calloc (maxfd, sizeof (pid_t));
+}
+
+
+/* Start running a command, array style */
+static int
+_cmd_open (char *const *argv, int *pfd, int *pfderr)
+{
+ pid_t pid;
+#ifdef RLIMIT_CORE
+ struct rlimit limit;
+#endif
+
+ int i = 0;
+
+ if (!_cmd_pids)
+ CMD_INIT;
+
+ setenv("LC_ALL", "C", 1);
+
+ if (pipe (pfd) < 0 || pipe (pfderr) < 0 || (pid = fork ()) < 0)
+ return -1; /* errno set by the failing function */
+
+ /* child runs exceve() and _exit. */
+ if (pid == 0) {
+#ifdef RLIMIT_CORE
+ /* the program we execve shouldn't leave core files */
+ getrlimit (RLIMIT_CORE, &limit);
+ limit.rlim_cur = 0;
+ setrlimit (RLIMIT_CORE, &limit);
+#endif
+ close (pfd[0]);
+ if (pfd[1] != STDOUT_FILENO) {
+ dup2 (pfd[1], STDOUT_FILENO);
+ close (pfd[1]);
+ }
+ close (pfderr[0]);
+ if (pfderr[1] != STDERR_FILENO) {
+ dup2 (pfderr[1], STDERR_FILENO);
+ close (pfderr[1]);
+ }
+
+ /* close all descriptors in _cmd_pids[]
+ * This is executed in a separate address space (pure child),
+ * so we don't have to worry about async safety */
+ long maxfd = mp_open_max();
+ for (i = 0; i < maxfd; i++)
+ if (_cmd_pids[i] > 0)
+ close (i);
+
+ execve (argv[0], argv, environ);
+ _exit (STATE_UNKNOWN);
+ }
+
+ /* parent picks up execution here */
+ /* close children descriptors in our address space */
+ close (pfd[1]);
+ close (pfderr[1]);
+
+ /* tag our file's entry in the pid-list and return it */
+ _cmd_pids[pfd[0]] = pid;
+
+ return pfd[0];
+}
+
+static int
+_cmd_close (int fd)
+{
+ int status;
+ pid_t pid;
+
+ /* make sure the provided fd was opened */
+ long maxfd = mp_open_max();
+ if (fd < 0 || fd > maxfd || !_cmd_pids || (pid = _cmd_pids[fd]) == 0)
+ return -1;
+
+ _cmd_pids[fd] = 0;
+ if (close (fd) == -1)
+ return -1;
+
+ /* EINTR is ok (sort of), everything else is bad */
+ while (waitpid (pid, &status, 0) < 0)
+ if (errno != EINTR)
+ return -1;
+
+ /* return child's termination status */
+ return (WIFEXITED (status)) ? WEXITSTATUS (status) : -1;
+}
+
+
+static int
+_cmd_fetch_output (int fd, output * op, int flags)
+{
+ size_t len = 0, i = 0, lineno = 0;
+ size_t rsf = 6, ary_size = 0; /* rsf = right shift factor, dec'ed uncond once */
+ char *buf = NULL;
+ int ret;
+ char tmpbuf[4096];
+
+ op->buf = NULL;
+ op->buflen = 0;
+ while ((ret = read (fd, tmpbuf, sizeof (tmpbuf))) > 0) {
+ len = (size_t) ret;
+ op->buf = realloc (op->buf, op->buflen + len + 1);
+ memcpy (op->buf + op->buflen, tmpbuf, len);
+ op->buflen += len;
+ i++;
+ }
+
+ if (ret < 0) {
+ printf ("read() returned %d: %s\n", ret, strerror (errno));
+ return ret;
+ }
+
+ /* some plugins may want to keep output unbroken, and some commands
+ * will yield no output, so return here for those */
+ if (flags & CMD_NO_ARRAYS || !op->buf || !op->buflen)
+ return op->buflen;
+
+ /* and some may want both */
+ if (flags & CMD_NO_ASSOC) {
+ buf = malloc (op->buflen);
+ memcpy (buf, op->buf, op->buflen);
+ }
+ else
+ buf = op->buf;
+
+ op->line = NULL;
+ op->lens = NULL;
+ i = 0;
+ while (i < op->buflen) {
+ /* make sure we have enough memory */
+ if (lineno >= ary_size) {
+ /* ary_size must never be zero */
+ do {
+ ary_size = op->buflen >> --rsf;
+ } while (!ary_size);
+
+ op->line = realloc (op->line, ary_size * sizeof (char *));
+ op->lens = realloc (op->lens, ary_size * sizeof (size_t));
+ }
+
+ /* set the pointer to the string */
+ op->line[lineno] = &buf[i];
+
+ /* hop to next newline or end of buffer */
+ while (buf[i] != '\n' && i < op->buflen)
+ i++;
+ buf[i] = '\0';
+
+ /* calculate the string length using pointer difference */
+ op->lens[lineno] = (size_t) & buf[i] - (size_t) op->line[lineno];
+
+ lineno++;
+ i++;
+ }
+
+ return lineno;
+}
+
+
+int
+cmd_run (const char *cmdstring, output * out, output * err, int flags)
+{
+ int i = 0, argc;
+ size_t cmdlen;
+ char **argv = NULL;
+ char *cmd = NULL;
+ char *str = NULL;
+
+ if (cmdstring == NULL)
+ return -1;
+
+ /* initialize the structs */
+ if (out)
+ memset (out, 0, sizeof (output));
+ if (err)
+ memset (err, 0, sizeof (output));
+
+ /* make copy of command string so strtok() doesn't silently modify it */
+ /* (the calling program may want to access it later) */
+ cmdlen = strlen (cmdstring);
+ if ((cmd = malloc (cmdlen + 1)) == NULL)
+ return -1;
+ memcpy (cmd, cmdstring, cmdlen);
+ cmd[cmdlen] = '\0';
+
+ /* This is not a shell, so we don't handle "???" */
+ if (strstr (cmdstring, "\"")) return -1;
+
+ /* allow single quotes, but only if non-whitesapce doesn't occur on both sides */
+ if (strstr (cmdstring, " ' ") || strstr (cmdstring, "'''"))
+ return -1;
+
+ /* each arg must be whitespace-separated, so args can be a maximum
+ * of (len / 2) + 1. We add 1 extra to the mix for NULL termination */
+ argc = (cmdlen >> 1) + 2;
+ argv = calloc (sizeof (char *), argc);
+
+ if (argv == NULL) {
+ printf ("%s\n", _("Could not malloc argv array in popen()"));
+ return -1;
+ }
+
+ /* get command arguments (stupidly, but fairly quickly) */
+ while (cmd) {
+ str = cmd;
+ str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
+
+ if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */
+ str++;
+ if (!strstr (str, "'"))
+ return -1; /* balanced? */
+ cmd = 1 + strstr (str, "'");
+ str[strcspn (str, "'")] = 0;
+ }
+ else {
+ if (strpbrk (str, " \t\r\n")) {
+ cmd = 1 + strpbrk (str, " \t\r\n");
+ str[strcspn (str, " \t\r\n")] = 0;
+ }
+ else {
+ cmd = NULL;
+ }
+ }
+
+ if (cmd && strlen (cmd) == strspn (cmd, " \t\r\n"))
+ cmd = NULL;
+
+ argv[i++] = str;
+ }
+
+ return cmd_run_array (argv, out, err, flags);
+}
+
+int
+cmd_run_array (char *const *argv, output * out, output * err, int flags)
+{
+ int fd, pfd_out[2], pfd_err[2];
+
+ /* initialize the structs */
+ if (out)
+ memset (out, 0, sizeof (output));
+ if (err)
+ memset (err, 0, sizeof (output));
+
+ if ((fd = _cmd_open (argv, pfd_out, pfd_err)) == -1)
+ die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), argv[0]);
+
+ if (out)
+ out->lines = _cmd_fetch_output (pfd_out[0], out, flags);
+ if (err)
+ err->lines = _cmd_fetch_output (pfd_err[0], err, flags);
+
+ return _cmd_close (fd);
+}
+
+int
+cmd_file_read ( char *filename, output *out, int flags)
+{
+ int fd;
+ if(out)
+ memset (out, 0, sizeof(output));
+
+ if ((fd = open(filename, O_RDONLY)) == -1) {
+ die( STATE_UNKNOWN, _("Error opening %s: %s"), filename, strerror(errno) );
+ }
+
+ if(out)
+ out->lines = _cmd_fetch_output (fd, out, flags);
+
+ if (close(fd) == -1)
+ die( STATE_UNKNOWN, _("Error closing %s: %s"), filename, strerror(errno) );
+
+ return 0;
+}
+
+void
+timeout_alarm_handler (int signo)
+{
+ size_t i;
+ if (signo == SIGALRM) {
+ printf (_("%s - Plugin timed out after %d seconds\n"),
+ state_text(timeout_state), timeout_interval);
+
+ long maxfd = mp_open_max();
+ if(_cmd_pids) for(i = 0; i < maxfd; i++) {
+ if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL);
+ }
+
+ exit (timeout_state);
+ }
+}
diff --git a/lib/utils_cmd.h b/lib/utils_cmd.h
new file mode 100644
index 0000000..061f5d4
--- /dev/null
+++ b/lib/utils_cmd.h
@@ -0,0 +1,39 @@
+#ifndef _UTILS_CMD_
+#define _UTILS_CMD_
+
+/*
+ * Header file for Monitoring Plugins utils_cmd.c
+ *
+ *
+ */
+
+/** types **/
+struct output
+{
+ char *buf; /* output buffer */
+ size_t buflen; /* output buffer content length */
+ char **line; /* array of lines (points to buf) */
+ size_t *lens; /* string lengths */
+ size_t lines; /* lines of output */
+};
+
+typedef struct output output;
+
+/** prototypes **/
+int cmd_run (const char *, output *, output *, int);
+int cmd_run_array (char *const *, output *, output *, int);
+int cmd_file_read (char *, output *, int);
+
+/* only multi-threaded plugins need to bother with this */
+void cmd_init (void);
+#define CMD_INIT cmd_init()
+
+/* possible flags for cmd_run()'s fourth argument */
+#define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */
+#define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */
+
+
+void timeout_alarm_handler (int);
+
+
+#endif /* _UTILS_CMD_ */
diff --git a/lib/utils_disk.c b/lib/utils_disk.c
new file mode 100644
index 0000000..483be06
--- /dev/null
+++ b/lib/utils_disk.c
@@ -0,0 +1,270 @@
+/*****************************************************************************
+*
+* Library for check_disk
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains utilities for check_disk. These are tested by libtap
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_disk.h"
+#include "gl/fsusage.h"
+#include <string.h>
+
+void
+np_add_name (struct name_list **list, const char *name)
+{
+ struct name_list *new_entry;
+ new_entry = (struct name_list *) malloc (sizeof *new_entry);
+ new_entry->name = (char *) name;
+ new_entry->next = *list;
+ *list = new_entry;
+}
+
+/* @brief Initialises a new regex at the begin of list via regcomp(3)
+ *
+ * @details if the regex fails to compile the error code of regcomp(3) is returned
+ * and list is not modified, otherwise list is modified to point to the new
+ * element
+ * @param list Pointer to a linked list of regex_list elements
+ * @param regex the string containing the regex which should be inserted into the list
+ * @param clags the cflags parameter for regcomp(3)
+ */
+int
+np_add_regex (struct regex_list **list, const char *regex, int cflags)
+{
+ struct regex_list *new_entry = (struct regex_list *) malloc (sizeof *new_entry);
+
+ if (new_entry == NULL) {
+ die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
+ strerror(errno));
+ }
+
+ int regcomp_result = regcomp(&new_entry->regex, regex, cflags);
+
+ if (!regcomp_result) {
+ // regcomp succeeded
+ new_entry->next = *list;
+ *list = new_entry;
+
+ return 0;
+ } else {
+ // regcomp failed
+ free(new_entry);
+
+ return regcomp_result;
+ }
+
+}
+
+/* Initialises a new parameter at the end of list */
+struct parameter_list *
+np_add_parameter(struct parameter_list **list, const char *name)
+{
+ struct parameter_list *current = *list;
+ struct parameter_list *new_path;
+ new_path = (struct parameter_list *) malloc (sizeof *new_path);
+ new_path->name = (char *) malloc(strlen(name) + 1);
+ new_path->best_match = NULL;
+ new_path->name_next = NULL;
+ new_path->name_prev = NULL;
+ new_path->freespace_bytes = NULL;
+ new_path->freespace_units = NULL;
+ new_path->freespace_percent = NULL;
+ new_path->usedspace_bytes = NULL;
+ new_path->usedspace_units = NULL;
+ new_path->usedspace_percent = NULL;
+ new_path->usedinodes_percent = NULL;
+ new_path->freeinodes_percent = NULL;
+ new_path->group = NULL;
+ new_path->dfree_pct = -1;
+ new_path->dused_pct = -1;
+ new_path->total = 0;
+ new_path->available = 0;
+ new_path->available_to_root = 0;
+ new_path->used = 0;
+ new_path->dused_units = 0;
+ new_path->dfree_units = 0;
+ new_path->dtotal_units = 0;
+ new_path->inodes_total = 0;
+ new_path->inodes_free = 0;
+ new_path->inodes_free_to_root = 0;
+ new_path->inodes_used = 0;
+ new_path->dused_inodes_percent = 0;
+ new_path->dfree_inodes_percent = 0;
+
+ strcpy(new_path->name, name);
+
+ if (current == NULL) {
+ *list = new_path;
+ new_path->name_prev = NULL;
+ } else {
+ while (current->name_next) {
+ current = current->name_next;
+ }
+ current->name_next = new_path;
+ new_path->name_prev = current;
+ }
+ return new_path;
+}
+
+/* Delete a given parameter from list and return pointer to next element*/
+struct parameter_list *
+np_del_parameter(struct parameter_list *item, struct parameter_list *prev)
+{
+ if (item == NULL) {
+ return NULL;
+ }
+ struct parameter_list *next;
+
+ if (item->name_next)
+ next = item->name_next;
+ else
+ next = NULL;
+
+ if (next)
+ next->name_prev = prev;
+
+ if (prev)
+ prev->name_next = next;
+
+ if (item->name) {
+ free(item->name);
+ }
+ free(item);
+
+ return next;
+}
+
+
+/* returns a pointer to the struct found in the list */
+struct parameter_list *
+np_find_parameter(struct parameter_list *list, const char *name)
+{
+ struct parameter_list *temp_list;
+ for (temp_list = list; temp_list; temp_list = temp_list->name_next) {
+ if (! strcmp(temp_list->name, name))
+ return temp_list;
+ }
+
+ return NULL;
+}
+
+void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, bool exact) {
+ struct parameter_list *d;
+ for (d = desired; d; d= d->name_next) {
+ if (! d->best_match) {
+ struct mount_entry *me;
+ size_t name_len = strlen(d->name);
+ size_t best_match_len = 0;
+ struct mount_entry *best_match = NULL;
+ struct fs_usage fsp;
+
+ /* set best match if path name exactly matches a mounted device name */
+ for (me = mount_list; me; me = me->me_next) {
+ if (strcmp(me->me_devname, d->name)==0) {
+ if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) >= 0) {
+ best_match = me;
+ }
+ }
+ }
+
+ /* set best match by directory name if no match was found by devname */
+ if (! best_match) {
+ for (me = mount_list; me; me = me->me_next) {
+ size_t len = strlen (me->me_mountdir);
+ if ((!exact && (best_match_len <= len && len <= name_len &&
+ (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0)))
+ || (exact && strcmp(me->me_mountdir, d->name)==0))
+ {
+ if (get_fs_usage(me->me_mountdir, me->me_devname, &fsp) >= 0) {
+ best_match = me;
+ best_match_len = len;
+ }
+ }
+ }
+ }
+
+ if (best_match) {
+ d->best_match = best_match;
+ } else {
+ d->best_match = NULL; /* Not sure why this is needed as it should be null on initialisation */
+ }
+ }
+ }
+}
+
+/* Returns true if name is in list */
+bool np_find_name (struct name_list *list, const char *name) {
+ const struct name_list *n;
+
+ if (list == NULL || name == NULL) {
+ return false;
+ }
+ for (n = list; n; n = n->next) {
+ if (!strcmp(name, n->name)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/* Returns true if name is in list */
+bool np_find_regmatch (struct regex_list *list, const char *name) {
+ int len;
+ regmatch_t m;
+
+ if (name == NULL) {
+ return false;
+ }
+
+ len = strlen(name);
+
+ for (; list; list = list->next) {
+ /* Emulate a full match as if surrounded with ^( )$
+ by checking whether the match spans the whole name */
+ if (!regexec(&list->regex, name, 1, &m, 0) && m.rm_so == 0 && m.rm_eo == len) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool np_seen_name(struct name_list *list, const char *name) {
+ const struct name_list *s;
+ for (s = list; s; s=s->next) {
+ if (!strcmp(s->name, name)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) {
+ if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 ||
+ regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) {
+ return true;
+ }
+ return false;
+}
diff --git a/lib/utils_disk.h b/lib/utils_disk.h
new file mode 100644
index 0000000..5b2caf2
--- /dev/null
+++ b/lib/utils_disk.h
@@ -0,0 +1,52 @@
+/* Header file for utils_disk */
+
+#include "mountlist.h"
+#include "utils_base.h"
+#include "regex.h"
+
+struct name_list
+{
+ char *name;
+ struct name_list *next;
+};
+
+struct regex_list
+{
+ regex_t regex;
+ struct regex_list *next;
+};
+
+struct parameter_list
+{
+ char *name;
+ thresholds *freespace_bytes;
+ thresholds *freespace_units;
+ thresholds *freespace_percent;
+ thresholds *usedspace_bytes;
+ thresholds *usedspace_units;
+ thresholds *usedspace_percent;
+ thresholds *usedinodes_percent;
+ thresholds *freeinodes_percent;
+ char *group;
+ struct mount_entry *best_match;
+ struct parameter_list *name_next;
+ struct parameter_list *name_prev;
+ uintmax_t total, available, available_to_root, used,
+ inodes_free, inodes_free_to_root, inodes_used, inodes_total;
+ double dfree_pct, dused_pct;
+ uint64_t dused_units, dfree_units, dtotal_units;
+ double dused_inodes_percent, dfree_inodes_percent;
+};
+
+void np_add_name (struct name_list **list, const char *name);
+bool np_find_name (struct name_list *list, const char *name);
+bool np_seen_name (struct name_list *list, const char *name);
+int np_add_regex (struct regex_list **list, const char *regex, int cflags);
+bool np_find_regmatch (struct regex_list *list, const char *name);
+struct parameter_list *np_add_parameter(struct parameter_list **list, const char *name);
+struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name);
+struct parameter_list *np_del_parameter(struct parameter_list *item, struct parameter_list *prev);
+
+int search_parameter_list (struct parameter_list *list, const char *name);
+void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, bool exact);
+bool np_regex_match_mount_entry (struct mount_entry* me, regex_t* re);
diff --git a/lib/utils_tcp.c b/lib/utils_tcp.c
new file mode 100644
index 0000000..23ee4a9
--- /dev/null
+++ b/lib/utils_tcp.c
@@ -0,0 +1,75 @@
+/*****************************************************************************
+*
+* Library for check_tcp
+*
+* License: GPL
+* Copyright (c) 1999-2013 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains utilities for check_tcp. These are tested by libtap
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils_tcp.h"
+
+#define VERBOSE(message) \
+ do { \
+ if (flags & NP_MATCH_VERBOSE) \
+ puts(message); \
+ } while (0)
+
+enum np_match_result
+np_expect_match(char *status, char **server_expect, int expect_count, int flags)
+{
+ int i, match = 0, partial = 0;
+
+ for (i = 0; i < expect_count; i++) {
+ if (flags & NP_MATCH_VERBOSE)
+ printf("looking for [%s] %s [%s]\n", server_expect[i],
+ (flags & NP_MATCH_EXACT) ?
+ "in beginning of" : "anywhere in",
+ status);
+
+ if (flags & NP_MATCH_EXACT) {
+ if (strncmp(status, server_expect[i], strlen(server_expect[i])) == 0) {
+ VERBOSE("found it");
+ match++;
+ continue;
+ } else if (strncmp(status, server_expect[i], strlen(status)) == 0) {
+ VERBOSE("found a substring");
+ partial++;
+ continue;
+ }
+ } else if (strstr(status, server_expect[i]) != NULL) {
+ VERBOSE("found it");
+ match++;
+ continue;
+ }
+ VERBOSE("couldn't find it");
+ }
+
+ if ((flags & NP_MATCH_ALL && match == expect_count) ||
+ (!(flags & NP_MATCH_ALL) && match >= 1))
+ return NP_MATCH_SUCCESS;
+ else if (partial > 0 || !(flags & NP_MATCH_EXACT))
+ return NP_MATCH_RETRY;
+ else
+ return NP_MATCH_FAILURE;
+}
diff --git a/lib/utils_tcp.h b/lib/utils_tcp.h
new file mode 100644
index 0000000..0328a9c
--- /dev/null
+++ b/lib/utils_tcp.h
@@ -0,0 +1,22 @@
+/* Header file for utils_tcp */
+
+#define NP_MATCH_ALL 0x1
+#define NP_MATCH_EXACT 0x2
+#define NP_MATCH_VERBOSE 0x4
+
+/*
+ * The NP_MATCH_RETRY state indicates that matching might succeed if
+ * np_expect_match() is called with a longer input string. This allows the
+ * caller to decide whether it makes sense to wait for additional data from the
+ * server.
+ */
+enum np_match_result {
+ NP_MATCH_FAILURE,
+ NP_MATCH_SUCCESS,
+ NP_MATCH_RETRY
+};
+
+enum np_match_result np_expect_match(char *status,
+ char **server_expect,
+ int server_expect_count,
+ int flags);
diff --git a/m4/libcurl.m4 b/m4/libcurl.m4
new file mode 100644
index 0000000..53d694d
--- /dev/null
+++ b/m4/libcurl.m4
@@ -0,0 +1,272 @@
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 2006, David Shaw <dshaw@jabberwocky.com>
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at https://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+###########################################################################
+# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
+# [ACTION-IF-YES], [ACTION-IF-NO])
+# ----------------------------------------------------------
+# David Shaw <dshaw@jabberwocky.com> May-09-2006
+#
+# Checks for libcurl. DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-libcurl or --without-libcurl.
+# If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the
+# minimum version of libcurl to accept. Pass the version as a regular
+# version number like 7.10.1. If not supplied, any version is
+# accepted. ACTION-IF-YES is a list of shell commands to run if
+# libcurl was successfully found and passed the various tests.
+# ACTION-IF-NO is a list of shell commands that are run otherwise.
+# Note that using --without-libcurl does run ACTION-IF-NO.
+#
+# This macro #defines HAVE_LIBCURL if a working libcurl setup is
+# found, and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary
+# values. Other useful defines are LIBCURL_FEATURE_xxx where xxx are
+# the various features supported by libcurl, and LIBCURL_PROTOCOL_yyy
+# where yyy are the various protocols supported by libcurl. Both xxx
+# and yyy are capitalized. See the list of AH_TEMPLATEs at the top of
+# the macro for the complete list of possible defines. Shell
+# variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also
+# defined to 'yes' for those features and protocols that were found.
+# Note that xxx and yyy keep the same capitalization as in the
+# curl-config list (e.g. it's "HTTP" and not "http").
+#
+# Users may override the detected values by doing something like:
+# LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+# For the sake of sanity, this macro assumes that any libcurl that is
+# found is after version 7.7.2, the first version that included the
+# curl-config script. Note that it is very important for people
+# packaging binary versions of libcurl to include this script!
+# Without curl-config, we can only guess what protocols are available,
+# or use curl_version_info to figure it out at runtime.
+
+AC_DEFUN([LIBCURL_CHECK_CONFIG],
+[
+ AH_TEMPLATE([LIBCURL_FEATURE_SSL],[Defined if libcurl supports SSL])
+ AH_TEMPLATE([LIBCURL_FEATURE_KRB4],[Defined if libcurl supports KRB4])
+ AH_TEMPLATE([LIBCURL_FEATURE_IPV6],[Defined if libcurl supports IPv6])
+ AH_TEMPLATE([LIBCURL_FEATURE_LIBZ],[Defined if libcurl supports libz])
+ AH_TEMPLATE([LIBCURL_FEATURE_ASYNCHDNS],[Defined if libcurl supports AsynchDNS])
+ AH_TEMPLATE([LIBCURL_FEATURE_IDN],[Defined if libcurl supports IDN])
+ AH_TEMPLATE([LIBCURL_FEATURE_SSPI],[Defined if libcurl supports SSPI])
+ AH_TEMPLATE([LIBCURL_FEATURE_NTLM],[Defined if libcurl supports NTLM])
+
+ AH_TEMPLATE([LIBCURL_PROTOCOL_HTTP],[Defined if libcurl supports HTTP])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_HTTPS],[Defined if libcurl supports HTTPS])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_FTP],[Defined if libcurl supports FTP])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_FTPS],[Defined if libcurl supports FTPS])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_FILE],[Defined if libcurl supports FILE])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_TELNET],[Defined if libcurl supports TELNET])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_RTSP],[Defined if libcurl supports RTSP])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_POP3],[Defined if libcurl supports POP3])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_IMAP],[Defined if libcurl supports IMAP])
+ AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP])
+
+ AC_ARG_WITH(libcurl,
+ AS_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]),
+ [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
+
+ if test "$_libcurl_with" != "no" ; then
+
+ AC_PROG_AWK
+
+ _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
+
+ _libcurl_try_link=yes
+
+ if test -d "$_libcurl_with" ; then
+ LIBCURL_CPPFLAGS="-I$withval/include"
+ _libcurl_ldflags="-L$withval/lib"
+ AC_PATH_PROG([_libcurl_config],[curl-config],[],
+ ["$withval/bin"])
+ else
+ AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH])
+ fi
+
+ if test x$_libcurl_config != "x" ; then
+ AC_CACHE_CHECK([for the version of libcurl],
+ [libcurl_cv_lib_curl_version],
+ [libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $[]2}'`])
+
+ _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
+ _libcurl_wanted=`echo ifelse([$2],,[0],[$2]) | $_libcurl_version_parse`
+
+ if test $_libcurl_wanted -gt 0 ; then
+ AC_CACHE_CHECK([for libcurl >= version $2],
+ [libcurl_cv_lib_version_ok],
+ [
+ if test $_libcurl_version -ge $_libcurl_wanted ; then
+ libcurl_cv_lib_version_ok=yes
+ else
+ libcurl_cv_lib_version_ok=no
+ fi
+ ])
+ fi
+
+ if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
+ if test x"$LIBCURL_CPPFLAGS" = "x" ; then
+ LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
+ fi
+ if test x"$LIBCURL" = "x" ; then
+ LIBCURL=`$_libcurl_config --libs`
+
+ # This is so silly, but Apple actually has a bug in their
+ # curl-config script. Fixed in Tiger, but there are still
+ # lots of Panther installs around.
+ case "${host}" in
+ powerpc-apple-darwin7*)
+ LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
+ ;;
+ esac
+ fi
+
+ # All curl-config scripts support --feature
+ _libcurl_features=`$_libcurl_config --feature`
+
+ # Is it modern enough to have --protocols? (7.12.4)
+ if test $_libcurl_version -ge 461828 ; then
+ _libcurl_protocols=`$_libcurl_config --protocols`
+ fi
+ else
+ _libcurl_try_link=no
+ fi
+
+ unset _libcurl_wanted
+ fi
+
+ if test $_libcurl_try_link = yes ; then
+
+ # we didn't find curl-config, so let's see if the user-supplied
+ # link line (or failing that, "-lcurl") is enough.
+ LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
+
+ AC_CACHE_CHECK([whether libcurl is usable],
+ [libcurl_cv_lib_curl_usable],
+ [
+ _libcurl_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+ _libcurl_save_libs=$LIBS
+ LIBS="$LIBCURL $LIBS"
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curl/curl.h>]],[[
+/* Try and use a few common options to force a failure if we are
+ missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_WRITEDATA;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+if (x) {;}
+]])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
+
+ CPPFLAGS=$_libcurl_save_cppflags
+ LIBS=$_libcurl_save_libs
+ unset _libcurl_save_cppflags
+ unset _libcurl_save_libs
+ ])
+
+ if test $libcurl_cv_lib_curl_usable = yes ; then
+
+ # Does curl_free() exist in this version of libcurl?
+ # If not, fake it with free()
+
+ _libcurl_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+ _libcurl_save_libs=$LIBS
+ LIBS="$LIBS $LIBCURL"
+
+ AC_CHECK_FUNC(curl_free,,
+ AC_DEFINE(curl_free,free,
+ [Define curl_free() as free() if our version of curl lacks curl_free.]))
+
+ CPPFLAGS=$_libcurl_save_cppflags
+ LIBS=$_libcurl_save_libs
+ unset _libcurl_save_cppflags
+ unset _libcurl_save_libs
+
+ AC_DEFINE(HAVE_LIBCURL,1,
+ [Define to 1 if you have a functional curl library.])
+ AC_SUBST(LIBCURL_CPPFLAGS)
+ AC_SUBST(LIBCURL)
+
+ for _libcurl_feature in $_libcurl_features ; do
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_feature_$_libcurl_feature),[1])
+ eval AS_TR_SH(libcurl_feature_$_libcurl_feature)=yes
+ done
+
+ if test "x$_libcurl_protocols" = "x" ; then
+
+ # We don't have --protocols, so just assume that all
+ # protocols are available
+ _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT TFTP"
+
+ if test x$libcurl_feature_SSL = xyes ; then
+ _libcurl_protocols="$_libcurl_protocols HTTPS"
+
+ # FTPS wasn't standards-compliant until version
+ # 7.11.0 (0x070b00 == 461568)
+ if test $_libcurl_version -ge 461568; then
+ _libcurl_protocols="$_libcurl_protocols FTPS"
+ fi
+ fi
+
+ # RTSP, IMAP, POP3 and SMTP were added in
+ # 7.20.0 (0x071400 == 463872)
+ if test $_libcurl_version -ge 463872; then
+ _libcurl_protocols="$_libcurl_protocols RTSP IMAP POP3 SMTP"
+ fi
+ fi
+
+ for _libcurl_protocol in $_libcurl_protocols ; do
+ AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
+ eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
+ done
+ else
+ unset LIBCURL
+ unset LIBCURL_CPPFLAGS
+ fi
+ fi
+
+ unset _libcurl_try_link
+ unset _libcurl_version_parse
+ unset _libcurl_config
+ unset _libcurl_feature
+ unset _libcurl_features
+ unset _libcurl_protocol
+ unset _libcurl_protocols
+ unset _libcurl_version
+ unset _libcurl_ldflags
+ fi
+
+ if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
+ # This is the IF-NO path
+ ifelse([$4],,:,[$4])
+ else
+ # This is the IF-YES path
+ ifelse([$3],,:,[$3])
+ fi
+
+ unset _libcurl_with
+])dnl
diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4
new file mode 100644
index 0000000..9fe38ac
--- /dev/null
+++ b/m4/np_mysqlclient.m4
@@ -0,0 +1,93 @@
+# np_mysqlclient.m4
+dnl Copyright (C) 2007 Monitoring Plugins Team
+dnl This file is free software; the Monitoring Plugins Team
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test for mysql availability using mysql_config
+dnl Uses --with-mysql= yes(autodetection - default) | no | path
+dnl Sets 4 variables:
+dnl with_mysql = path/to/mysql_config (if found and can compile mysqlclient) or "no"
+dnl np_mysql_include = flags for include, from mysql_config --include (will be guessed as $with_mysql/include if --include not found)
+dnl np_mysql_libs = flags for libs, from mysql_config --libs
+dnl np_mysql_cflags = flags for cflags, from mysql_config --cflags
+dnl Also sets in config.h:
+dnl HAVE_MYSQLCLIENT
+dnl Compile your code with:
+dnl $(CC) $(np_mysql_include) code.c $(np_mysql_libs)
+
+AC_DEFUN([np_mysqlclient],
+[
+ AC_ARG_WITH(mysql,
+ AS_HELP_STRING([--with-mysql=DIR],
+ [Locates mysql libraries. Expects DIR/bin/mysql_config. Default to search for mysql_config in PATH]),
+ with_mysql=$withval,
+ with_mysql=yes)
+
+ if test "x$with_mysql" != "xno" ; then
+ if test "x$with_mysql" = "xyes" ; then
+ AC_PATH_PROG(np_mysql_config, mysql_config)
+ else
+ if test -x $with_mysql/bin/mysql_config ; then
+ np_mysql_config="$with_mysql/bin/mysql_config"
+ fi
+ fi
+ if test -z "$np_mysql_config"; then
+ with_mysql="no"
+ else
+ np_mysql_include="`$np_mysql_config --include`"
+ # Mysql 3 does not support --include. --cflags should be sufficient
+ if test $? -ne 0; then
+ np_mysql_include="-I$with_mysql/include" # Guessed location
+ fi
+ np_mysql_libs="`$np_mysql_config --libs`"
+ np_mysql_cflags="`$np_mysql_config --cflags`"
+ # On Solaris, cflags may contain -xstrconst, which is not acceptable to the
+ # gcc compiler. In this case, use the include flags as the cflags
+ echo $np_mysql_cflags | grep -- -xstrconst > /dev/null 2> /dev/null
+ if test $? -eq 0 -a "$CC" = "gcc" ; then
+ np_mysql_cflags="`$np_mysql_config --include`"
+ fi
+
+ dnl Test a mysql_init. Some systems have mysql_config, but no headers
+ _savedcppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $np_mysql_include"
+
+ np_check_lib_mysqlclient
+
+ CPPFLAGS=$_savedcppflags
+
+ fi
+ fi
+])
+
+dnl Test mysql_init using mysqlclient
+AC_DEFUN([np_check_lib_mysqlclient],
+[
+ dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in
+ dnl Although -lmysqlclient is duplicated, it is not a problem
+ AC_CHECK_LIB([mysqlclient], [mysql_init], [
+ with_mysql=$np_mysql_config
+ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile])
+ ], [np_check_lib_mariadbclient], [$np_mysql_libs])
+])
+
+dnl Test mysql_init using mariadbclient
+AC_DEFUN([np_check_lib_mariadbclient],
+[
+ AC_CHECK_LIB([mariadbclient], [mysql_init], [
+ with_mysql=$np_mysql_config
+ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mariadbclient is found and can compile])
+ ], [with_mysql=no], [$np_mysql_libs])
+])
+
+dnl Will take $1, find last occurrence of -LDIR and add DIR to LD_RUN_PATH
+AC_DEFUN([np_add_to_runpath],
+[
+ dnl Need [[ ]] so autoconf gives us just one set
+ np_libdir=`echo "$1" | sed -e 's/.*-L\([[^ ]]*\) .*/\1/'`
+ if test "x$np_libdir" != x ; then
+ LD_RUN_PATH="${np_libdir}${LD_RUN_PATH:+:}${LD_RUN_PATH}"
+ fi
+])
+
diff --git a/m4/uriparser.m4 b/m4/uriparser.m4
new file mode 100644
index 0000000..5113638
--- /dev/null
+++ b/m4/uriparser.m4
@@ -0,0 +1,140 @@
+# (this check is roughly based on and inspired libcurl.m4)
+# URIPARSER_CHECK ([DEFAULT-ACTION], [MINIMUM-VERSION],
+# [ACTION-IF-YES], [ACTION-IF-NO])
+# Checks for uriparser library. DEFAULT-ACTION is the string yes or no to
+# specify whether to default to --with-uriparser or --without-liburiparser.
+# If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the
+# minimum version of uriparser to accept. Pass the version as a regular
+# version number like 0.8.5. If not supplied, any version is
+# accepted. ACTION-IF-YES is a list of shell commands to run if
+# uriparser was successfully found and passed the various tests.
+# ACTION-IF-NO is a list of shell commands that are run otherwise.
+# Note that using --without-uriparser does run ACTION-IF-NO.
+#
+# This macro #defines HAVE_URIPARSER if a working uriparser setup is
+# found, and sets @URIPARSER@ and @URIPARSER_CPPFLAGS@ to the necessary
+# values.
+#
+# Users may override the detected values by doing something like:
+# URIPARSER="-luriparser" URIPARSER_CPPFLAGS="-I/usr/myinclude" ./configure
+#
+
+AC_DEFUN([URIPARSER_CHECK],
+[
+ AC_ARG_WITH(uriparser,
+ AS_HELP_STRING([--with-uriparser=PREFIX],[look for the uriparser library in PREFIX/lib and headers in PREFIX/include]),
+ [_uriparser_with=$withval],[_uriparser_with=ifelse([$1],,[yes],[$1])])
+
+ if test "$_uriparser_with" != "no" ; then
+
+ _uriparser_try_link=yes
+
+ AC_CHECK_PROG(PKGCONFIG,pkg-config,pkg-config,no)
+
+ if test "x$URIPARSER" != "x" || test "x$URIPARSER_CPPFLAGS" != "x"; then
+ :
+ elif test -d "$_uriparser_with" ; then
+ URIPARSER_CPPFLAGS="-I$withval/include"
+ _uriparser_ldflags="-L$withval/lib"
+
+ elif test x$PKGCONFIG != xno; then
+
+ AC_CACHE_CHECK([for the version of uriparser],
+ [uriparser_cv_uriparser_version],
+ [uriparser_cv_uriparser_version=`$PKGCONFIG liburiparser --modversion`])
+
+ AC_PROG_AWK
+
+ _uriparser_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'"
+
+ _uriparser_version=`echo $uriparser_cv_uriparser_version | $_uriparser_version_parse`
+ _uriparser_wanted=`echo ifelse([$2],,[0],[$2]) | $_uriparser_version_parse`
+
+ if test $_uriparser_wanted -gt 0 ; then
+ AC_CACHE_CHECK([for uriparser >= version $2],
+ [uriparser_cv_lib_version_ok],
+ [
+ if test $_uriparser_version -ge $_uriparser_wanted ; then
+ uriparser_cv_lib_version_ok=yes
+ else
+ uriparser_cv_lib_version_ok=no
+ fi
+ ])
+ fi
+
+ if test $_uriparser_wanted -eq 0 || test x$uriparser_cv_lib_version_ok = xyes ; then
+ if test x"$URIPARSER_CPPFLAGS" = "x" ; then
+ URIPARSER_CPPFLAGS=`$PKGCONFIG liburiparser --cflags`
+ fi
+ if test x"$URIPARSER" = "x" ; then
+ URIPARSER=`$PKGCONFIG liburiparser --libs`
+ fi
+ else
+ _uriparser_try_link=no
+ fi
+
+ unset _uriparser_wanted
+ else
+ dnl no pkg-config, ok, do our best and set some defaults
+ URIPARSER_CPPFLAGS="-I/usr/include"
+ URIPARSER="-luriparser -L/usr/lib -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/i686-linux-gnu"
+ fi
+
+ if test $_uriparser_try_link = yes ; then
+
+ # let's see if the user-supplied
+ # link line (or failing that, "-luriparser") is enough.
+ URIPARSER=${URIPARSER-"$_uriparser_ldflags -luriparser"}
+
+ AC_CACHE_CHECK([whether uriparser is usable],
+ [uriparser_cv_lib_uriparser_usable],
+ [
+ _liburiparser_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS"
+ _liburiparser_save_libs=$LIBS
+ LIBS="$URIPARSER $LIBS"
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <uriparser/Uri.h>]],[[
+/* Try and use a few common options to force a failure if we are
+ missing symbols or cannot link. */
+UriParserStateA state;
+UriUriA uri;
+state.uri = &uri;
+char *location = "http://test.dom/dir/file.ext";
+int x = uriParseUriA (&state, location);
+if (x == URI_SUCCESS) {;}
+]])],uriparser_cv_lib_uriparser_usable=yes,uriparser_cv_lib_uriparser_usable=no)
+
+ CPPFLAGS=$_liburiparser_save_cppflags
+ LIBS=$_liburiparser_save_libs
+ unset _liburiparser_save_cppflags
+ unset _liburiparser_save_libs
+ ])
+
+ if test $uriparser_cv_lib_uriparser_usable = yes ; then
+ AC_DEFINE(HAVE_URIPARSER,1,
+ [Define to 1 if you have a functional uriparser library.])
+ AC_SUBST(URIPARSER_CPPFLAGS)
+ AC_SUBST(URIPARSER)
+ else
+ unset URIPARSER
+ unset URIPARSER_CPPFLAGS
+ fi
+ fi
+
+ unset _uriparser_try_link
+ unset _uriparser_version_parse
+ unset _uriparser_version
+ unset _uriparser_ldflags
+ fi
+
+ if test x$_uriparser_with = xno || test x$uriparser_cv_lib_uriparser_usable != xyes ; then
+ # This is the IF-NO path
+ ifelse([$4],,:,[$4])
+ else
+ # This is the IF-YES path
+ ifelse([$3],,:,[$3])
+ fi
+
+ unset _uriparser_with
+])dnl
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..259dbfc
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp=$pathcomp/
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/pkg/fedora/requires b/pkg/fedora/requires
new file mode 100644
index 0000000..03919f1
--- /dev/null
+++ b/pkg/fedora/requires
@@ -0,0 +1,33 @@
+Requires: bind-utils
+Requires: coreutils
+Requires: gawk
+Requires: grep
+Requires: iputils
+Requires: openldap
+Requires: mysql
+Requires: openssl
+Requires: postgresql-libs
+Requires: net-snmp-utils
+Requires: ntp
+Requires: openssh-clients
+Requires: perl
+Requires: procps
+Requires: python
+Requires: samba-client
+Requires: shadow-utils
+Requires: traceroute
+Requires: /usr/bin/mailq
+BuildRequires: bind-utils
+BuildRequires: coreutils
+BuildRequires: iputils
+BuildRequires: mysql-devel
+BuildRequires: net-snmp-utils
+BuildRequires: net-tools
+BuildRequires: ntp
+BuildRequires: openldap-devel
+BuildRequires: openssh-clients
+BuildRequires: openssl-devel
+BuildRequires: postgresql-devel
+BuildRequires: procps
+BuildRequires: samba-client
+BuildRequires: /usr/bin/mailq
diff --git a/pkg/redhat/requires b/pkg/redhat/requires
new file mode 100644
index 0000000..67126a8
--- /dev/null
+++ b/pkg/redhat/requires
@@ -0,0 +1,35 @@
+Requires: bind-utils
+Requires: fileutils
+Requires: gawk
+Requires: grep
+Requires: iputils
+Requires: openldap
+Requires: mysql
+Requires: openssl
+Requires: postgresql-libs
+Requires: net-snmp-utils
+Requires: ntp
+Requires: openssh-clients
+Requires: perl
+Requires: procps
+Requires: python
+Requires: samba-client
+Requires: sh-utils
+Requires: shadow-utils
+Requires: textutils
+Requires: traceroute
+Requires: /usr/bin/mailq
+BuildRequires: bind-utils
+BuildRequires: iputils
+BuildRequires: mysql-devel
+BuildRequires: net-snmp-utils
+BuildRequires: net-tools
+BuildRequires: ntp
+BuildRequires: openldap-devel
+BuildRequires: openssh-clients
+BuildRequires: openssl-devel
+BuildRequires: postgresql-devel
+BuildRequires: procps
+BuildRequires: samba-client
+BuildRequires: sh-utils
+BuildRequires: /usr/bin/mailq
diff --git a/pkg/solaris/pkginfo b/pkg/solaris/pkginfo
new file mode 100644
index 0000000..75f7b70
--- /dev/null
+++ b/pkg/solaris/pkginfo
@@ -0,0 +1,12 @@
+PKG="NGOSplugin"
+NAME="monitoring-plugins"
+DESC="Network Monitoring Plugins for Nagios and compatible"
+ARCH="unknown"
+VERSION="2.3.5,REV=2023.10.18.09.15"
+CATEGORY="application"
+VENDOR="Monitoring Plugins Development Team"
+EMAIL="devel@monitoring-plugins.org"
+PSTAMP="nag20231018091518"
+BASEDIR="/"
+CLASSES="none"
+
diff --git a/pkg/solaris/pkginfo.in b/pkg/solaris/pkginfo.in
new file mode 100644
index 0000000..835ce6d
--- /dev/null
+++ b/pkg/solaris/pkginfo.in
@@ -0,0 +1,12 @@
+PKG="NGOSplugin"
+NAME="monitoring-plugins"
+DESC="Network Monitoring Plugins for Nagios and compatible"
+ARCH="@PKG_ARCH@"
+VERSION="@PACKAGE_VERSION@,REV=@REV_DATESTAMP@"
+CATEGORY="application"
+VENDOR="Monitoring Plugins Development Team"
+EMAIL="devel@monitoring-plugins.org"
+PSTAMP="nag@REV_TIMESTAMP@"
+BASEDIR="/"
+CLASSES="none"
+
diff --git a/pkg/solaris/preinstall b/pkg/solaris/preinstall
new file mode 100755
index 0000000..c4cc269
--- /dev/null
+++ b/pkg/solaris/preinstall
@@ -0,0 +1,35 @@
+#!/usr/bin/sh
+
+user="nagios"
+uid=-1
+group="nagios"
+gid=-1
+
+/usr/bin/getent group $group > /dev/null 2> /dev/null
+result=$?
+if [ $result -eq 2 ] ; then
+ echo "Group $group does not exist. Creating..."
+ if [ $gid -ne -1 ] ; then
+ /usr/sbin/groupadd -g $gid $group
+ else
+ /usr/sbin/groupadd $group
+ fi
+elif [ $result -ne 0 ] ; then
+ echo "An error occurred determining the existence of the groug $group. Terminating."
+ exit 1;
+fi
+
+/usr/bin/getent passwd $user > /dev/null 2> /dev/null
+result=$?
+if [ $result -eq 2 ] ; then
+ echo "User $user does not exist. Creating..."
+ if [ $uid -ne -1 ] ; then
+ /usr/sbin/useradd -u $uid -g $group $user
+ else
+ /usr/sbin/useradd -g $group $user
+ fi
+elif [ $result -ne 0 ] ; then
+ echo "An error occurred determining the existence of the user $user. Terminating."
+ exit 1;
+fi
+
diff --git a/pkg/solaris/solpkg b/pkg/solaris/solpkg
new file mode 100755
index 0000000..73b3c64
--- /dev/null
+++ b/pkg/solaris/solpkg
@@ -0,0 +1,90 @@
+#!/usr/bin/perl
+
+$pkgdevice = $ARGV[0] || die "Unable to determine device ($!)\n";
+
+$find = "/usr/bin/find";
+$pkgproto = "/usr/bin/pkgproto";
+$pkgmk = "/usr/bin/pkgmk";
+$pkgtrans = "/usr/bin/pkgtrans";
+$prototype = "prototype";
+$pkginfo = "pkginfo";
+$preinstall = "preinstall";
+$egrep = "/usr/bin/grep -E";
+
+# Sanity check
+
+$pwd = `pwd`;
+if ($pwd =~ '\/usr\/local') {
+ $pwd = $`;
+}
+die "Wrong location, please cd to <PKGBASE>/usr/local/ and run again.\n"
+ if ($pwd eq "");
+
+open (PREPROTO,"$find . -print |$egrep -v \"^\.(/usr(/local)?|/opt)?\$\" | $pkgproto |") ||
+ die "Unable to read prototype information ($!)\n";
+open (PROTO,">$prototype") ||
+ die "Unable to write file prototype ($!)\n";
+print PROTO "i pkginfo=./$pkginfo\n";
+print PROTO "i preinstall=./$preinstall\n";
+while (<PREPROTO>) {
+ # Read in the prototype information
+ chomp;
+ $thisline = $_;
+ if ($thisline =~ " prototype "
+ or $thisline =~ " pkginfo "
+ or $thisline =~ " preinstall ") {
+ # Don't do anything as they aren't important
+ } elsif ($thisline =~ "pst3") {
+ # Needs to be installed SUID root
+ ($dir, $none, $file, $mode, $user, $group) = split / /,$thisline;
+ print PROTO "$dir $none $file 4755 root bin\n";
+
+ } elsif ($thisline =~ "^[fd] ") {
+ # Change the ownership of files and directories
+ ($dir, $none, $file, $mode, $user, $group) = split / /,$thisline;
+ print PROTO "$dir $none $file $mode $user bin\n";
+ } else {
+ # Symlinks and other stuff should be printed also
+ print PROTO "$thisline\n";
+ }
+}
+close PROTO;
+close PREPROTO;
+
+# Now we can start building the package
+
+$os = `uname -r`;
+$os =~ '\.';
+$os = "sol$'";
+chomp $os;
+
+open (PKGINFO,"<$pkginfo") ||
+ die "Unable to read package information ($!)\n";
+while (<PKGINFO>) {
+ # Read in the package information
+ chomp;
+ $thisline = $_;
+ ($var,$value) = split /=/,$thisline;
+ if ("$var" eq "NAME"
+ or "$var" eq "PKG"
+ or "$var" eq "VERSION"
+ or "$var" eq "ARCH") {
+ $tmp = lc($var);
+ $value =~ s/\"//g;
+ if ("$tmp" eq "version"
+ and $value =~ ",REV") {
+ ($value,$var) = split /\,/,$value;
+ $$tmp = $value;
+ } else {
+ $$tmp = $value;
+ }
+ }
+}
+close PKGINFO;
+
+$packagename = "$name-$version-$os-$arch-local";
+
+print "Building package\n";
+system ("$pkgmk -o -r `pwd` -d $pkgdevice");
+system ("(cd $pkgdevice && $pkgtrans -s `pwd` ../$packagename $pkg)");
+print "Done. ($packagename)\n";
diff --git a/plugins-root/Makefile.am b/plugins-root/Makefile.am
new file mode 100644
index 0000000..40aa020
--- /dev/null
+++ b/plugins-root/Makefile.am
@@ -0,0 +1,97 @@
+## Process this file with automake to produce Makefile.in
+
+if RELEASE_PRESENT
+NP_VERSION = @NP_RELEASE@
+else
+NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
+ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
+.FORCE-NP-VERSION-FILE:
+-include NP-VERSION-FILE
+endif
+
+AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
+
+VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir)
+
+AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
+
+localedir = $(datadir)/locale
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+# Don't add LTLIBINTL to all, as pst3 doesn't need it
+#LIBS = @LTLIBINTL@ @LIBS@
+
+noinst_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@
+
+EXTRA_PROGRAMS = pst3
+
+EXTRA_DIST = t pst3.c
+
+BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO)
+NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
+NETLIBS = $(NETOBJS) $(SOCKETLIBS)
+
+TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
+
+TESTS = @PLUGIN_TEST@
+
+test:
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+test-debug:
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+setuid_root_mode = ug=rx,u+s
+
+# /* Author Coreutils team - see ACKNOWLEDGEMENTS */
+
+INSTALL_SUID = \
+ for f in $(noinst_PROGRAMS) ; do \
+ p=$$f; \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
+ echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
+ chown root $(DESTDIR)$(libexecdir)/$$p; \
+ echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
+ chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
+ done
+
+install-root: $(noinst_PROGRAMS)
+ @$(INSTALL_SUID)
+
+install-exec-local: $(noinst_PROGRAMS)
+ @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
+ rm -f $$TMPFILE; \
+ echo > $$TMPFILE; \
+ ## See if we can create a setuid root executable in $(libexecdir).
+ ## If not, then don't even try to install setuid plugins.
+ can_create_suid_root_executable=no; \
+ chown root $$TMPFILE > /dev/null 2>&1 \
+ && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
+ && can_create_suid_root_executable=yes; \
+ rm -f $$TMPFILE; \
+ if test $$can_create_suid_root_executable = yes; then \
+ $(INSTALL_SUID); \
+ else \
+ echo "WARNING: insufficient access; not installing setuid plugins"; \
+ echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
+ fi
+
+# /* Author Coreutils team sub-citation */
+
+##############################################################################
+# the actual targets
+check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS)
+check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS)
+
+# -m64 needed at compiler and linker phase
+pst3_CFLAGS = @PST3CFLAGS@
+pst3_LDFLAGS = @PST3CFLAGS@
+# pst3 must not use monitoringplug/gnulib includes!
+pst3_CPPFLAGS =
+
+check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
+check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS)
+
+clean-local:
+ rm -f NP-VERSION-FILE
+
diff --git a/plugins-root/Makefile.in b/plugins-root/Makefile.in
new file mode 100644
index 0000000..5991e82
--- /dev/null
+++ b/plugins-root/Makefile.in
@@ -0,0 +1,2504 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = check_dhcp$(EXEEXT) check_icmp$(EXEEXT) \
+ @EXTRAS_ROOT@ $(am__empty)
+EXTRA_PROGRAMS = pst3$(EXEEXT)
+subdir = plugins-root
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+check_dhcp_SOURCES = check_dhcp.c
+check_dhcp_OBJECTS = check_dhcp.$(OBJEXT)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = ../plugins/utils.o ../lib/libmonitoringplug.a \
+ ../gl/libgnu.a $(am__DEPENDENCIES_1)
+am__DEPENDENCIES_3 = ../plugins/netutils.o $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_1)
+am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+check_icmp_SOURCES = check_icmp.c
+check_icmp_OBJECTS = check_icmp.$(OBJEXT)
+pst3_SOURCES = pst3.c
+pst3_OBJECTS = pst3-pst3.$(OBJEXT)
+pst3_LDADD = $(LDADD)
+pst3_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pst3_CFLAGS) $(CFLAGS) \
+ $(pst3_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/check_dhcp.Po \
+ ./$(DEPDIR)/check_icmp.Po ./$(DEPDIR)/pst3-pst3.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = check_dhcp.c check_icmp.c pst3.c
+DIST_SOURCES = check_dhcp.c check_icmp.c pst3.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/mkinstalldirs \
+ $(top_srcdir)/build-aux/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = $(datadir)/locale
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+@RELEASE_PRESENT_TRUE@NP_VERSION = @NP_RELEASE@
+AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
+AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
+EXTRA_DIST = t pst3.c
+BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO)
+NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
+NETLIBS = $(NETOBJS) $(SOCKETLIBS)
+TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
+TESTS = @PLUGIN_TEST@
+setuid_root_mode = ug=rx,u+s
+
+# /* Author Coreutils team - see ACKNOWLEDGEMENTS */
+INSTALL_SUID = \
+ for f in $(noinst_PROGRAMS) ; do \
+ p=$$f; \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
+ echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
+ chown root $(DESTDIR)$(libexecdir)/$$p; \
+ echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
+ chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
+ done
+
+
+# /* Author Coreutils team sub-citation */
+
+##############################################################################
+# the actual targets
+check_dhcp_LDADD = @LTLIBINTL@ $(NETLIBS)
+check_icmp_LDADD = @LTLIBINTL@ $(NETLIBS) $(SOCKETLIBS)
+
+# -m64 needed at compiler and linker phase
+pst3_CFLAGS = @PST3CFLAGS@
+pst3_LDFLAGS = @PST3CFLAGS@
+# pst3 must not use monitoringplug/gnulib includes!
+pst3_CPPFLAGS =
+check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
+check_icmp_DEPENDENCIES = check_icmp.c $(NETOBJS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins-root/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu plugins-root/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+check_dhcp$(EXEEXT): $(check_dhcp_OBJECTS) $(check_dhcp_DEPENDENCIES) $(EXTRA_check_dhcp_DEPENDENCIES)
+ @rm -f check_dhcp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_dhcp_OBJECTS) $(check_dhcp_LDADD) $(LIBS)
+
+check_icmp$(EXEEXT): $(check_icmp_OBJECTS) $(check_icmp_DEPENDENCIES) $(EXTRA_check_icmp_DEPENDENCIES)
+ @rm -f check_icmp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_icmp_OBJECTS) $(check_icmp_LDADD) $(LIBS)
+
+pst3$(EXEEXT): $(pst3_OBJECTS) $(pst3_DEPENDENCIES) $(EXTRA_pst3_DEPENDENCIES)
+ @rm -f pst3$(EXEEXT)
+ $(AM_V_CCLD)$(pst3_LINK) $(pst3_OBJECTS) $(pst3_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_dhcp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_icmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pst3-pst3.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+pst3-pst3.o: pst3.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -MT pst3-pst3.o -MD -MP -MF $(DEPDIR)/pst3-pst3.Tpo -c -o pst3-pst3.o `test -f 'pst3.c' || echo '$(srcdir)/'`pst3.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pst3-pst3.Tpo $(DEPDIR)/pst3-pst3.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pst3.c' object='pst3-pst3.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -c -o pst3-pst3.o `test -f 'pst3.c' || echo '$(srcdir)/'`pst3.c
+
+pst3-pst3.obj: pst3.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -MT pst3-pst3.obj -MD -MP -MF $(DEPDIR)/pst3-pst3.Tpo -c -o pst3-pst3.obj `if test -f 'pst3.c'; then $(CYGPATH_W) 'pst3.c'; else $(CYGPATH_W) '$(srcdir)/pst3.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pst3-pst3.Tpo $(DEPDIR)/pst3-pst3.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pst3.c' object='pst3-pst3.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pst3_CPPFLAGS) $(CPPFLAGS) $(pst3_CFLAGS) $(CFLAGS) -c -o pst3-pst3.obj `if test -f 'pst3.c'; then $(CYGPATH_W) 'pst3.c'; else $(CYGPATH_W) '$(srcdir)/pst3.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/check_dhcp.Po
+ -rm -f ./$(DEPDIR)/check_icmp.Po
+ -rm -f ./$(DEPDIR)/pst3-pst3.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-exec-local
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/check_dhcp.Po
+ -rm -f ./$(DEPDIR)/check_icmp.Po
+ -rm -f ./$(DEPDIR)/pst3-pst3.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+ check-am clean clean-generic clean-libtool clean-local \
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-local \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \
+ uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+@RELEASE_PRESENT_FALSE@NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
+@RELEASE_PRESENT_FALSE@ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
+@RELEASE_PRESENT_FALSE@.FORCE-NP-VERSION-FILE:
+@RELEASE_PRESENT_FALSE@-include NP-VERSION-FILE
+
+test:
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+test-debug:
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+install-root: $(noinst_PROGRAMS)
+ @$(INSTALL_SUID)
+
+install-exec-local: $(noinst_PROGRAMS)
+ @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
+ rm -f $$TMPFILE; \
+ echo > $$TMPFILE; \
+ can_create_suid_root_executable=no; \
+ chown root $$TMPFILE > /dev/null 2>&1 \
+ && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
+ && can_create_suid_root_executable=yes; \
+ rm -f $$TMPFILE; \
+ if test $$can_create_suid_root_executable = yes; then \
+ $(INSTALL_SUID); \
+ else \
+ echo "WARNING: insufficient access; not installing setuid plugins"; \
+ echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
+ fi
+
+clean-local:
+ rm -f NP-VERSION-FILE
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c
new file mode 100644
index 0000000..6b07df5
--- /dev/null
+++ b/plugins-root/check_dhcp.c
@@ -0,0 +1,1412 @@
+/*****************************************************************************
+ *
+ * Monitoring check_dhcp plugin
+ *
+ * License: GPL
+ * Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)
+ * Copyright (c) 2001-2007 Monitoring Plugins Development Team
+ *
+ * Description:
+ *
+ * This file contains the check_dhcp plugin
+ *
+ * This plugin tests the availability of DHCP servers on a network.
+ *
+ * Unicast mode was originally implemented by Heiti of Boras Kommun with
+ * general improvements as well as usability fixes and "forward"-porting by
+ * Andreas Ericsson of OP5 AB.
+ *
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *****************************************************************************/
+
+const char *progname = "check_dhcp";
+const char *copyright = "2001-2023";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif // HAVE_SYS_SOCKIO_H
+
+#if defined( __linux__ )
+
+#include <linux/if_ether.h>
+#include <features.h>
+
+#elif defined (__bsd__)
+
+#include <netinet/if_ether.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <net/if_dl.h>
+
+#elif defined(__sun__) || defined(__solaris__) || defined(__hpux__)
+
+#define INSAP 22
+#define OUTSAP 24
+
+#include <signal.h>
+#include <ctype.h>
+#include <sys/stropts.h>
+#include <sys/poll.h>
+#include <sys/dlpi.h>
+
+#define bcopy(source, destination, length) memcpy(destination, source, length)
+
+#define AREA_SZ 5000 /* buffer length in bytes */
+static u_long ctl_area[AREA_SZ];
+static u_long dat_area[AREA_SZ];
+static struct strbuf ctl = {AREA_SZ, 0, (char *)ctl_area};
+static struct strbuf dat = {AREA_SZ, 0, (char *)dat_area};
+
+#define GOT_CTRL 1
+#define GOT_DATA 2
+#define GOT_BOTH 3
+#define GOT_INTR 4
+#define GOT_ERR 128
+
+static int get_msg(int);
+static int check_ctrl(int);
+static int put_ctrl(int, int, int);
+static int put_both(int, int, int, int);
+static int dl_open(const char *, int, int *);
+static int dl_bind(int, int, u_char *);
+long mac_addr_dlpi( const char *, int, u_char *);
+
+#endif // __sun__ || __solaris__ || __hpux
+
+
+
+/**** Common definitions ****/
+
+#define OK 0
+#define ERROR -1
+
+
+/**** DHCP definitions ****/
+
+#define MAX_DHCP_CHADDR_LENGTH 16
+#define MAX_DHCP_SNAME_LENGTH 64
+#define MAX_DHCP_FILE_LENGTH 128
+#define MAX_DHCP_OPTIONS_LENGTH 312
+
+
+typedef struct dhcp_packet_struct{
+ uint8_t op; /* packet type */
+ uint8_t htype; /* type of hardware address for this machine (Ethernet, etc) */
+ uint8_t hlen; /* length of hardware address (of this machine) */
+ uint8_t hops; /* hops */
+ uint32_t xid; /* random transaction id number - chosen by this machine */
+ uint16_t secs; /* seconds used in timing */
+ uint16_t flags; /* flags */
+ struct in_addr ciaddr; /* IP address of this machine (if we already have one) */
+ struct in_addr yiaddr; /* IP address of this machine (offered by the DHCP server) */
+ struct in_addr siaddr; /* IP address of next server */
+ struct in_addr giaddr; /* IP address of DHCP relay */
+ unsigned char chaddr [MAX_DHCP_CHADDR_LENGTH]; /* hardware address of this machine */
+ char sname [MAX_DHCP_SNAME_LENGTH]; /* name of DHCP server */
+ char file [MAX_DHCP_FILE_LENGTH]; /* boot file name (used for diskless booting?) */
+ char options[MAX_DHCP_OPTIONS_LENGTH]; /* options */
+}dhcp_packet;
+
+
+typedef struct dhcp_offer_struct{
+ struct in_addr server_address; /* address of DHCP server that sent this offer */
+ struct in_addr offered_address; /* the IP address that was offered to us */
+ uint32_t lease_time; /* lease time in seconds */
+ uint32_t renewal_time; /* renewal time in seconds */
+ uint32_t rebinding_time; /* rebinding time in seconds */
+ bool desired; /* is this offer desired (necessary in exclusive mode) */
+ struct dhcp_offer_struct *next;
+}dhcp_offer;
+
+
+typedef struct requested_server_struct{
+ struct in_addr server_address;
+ bool answered;
+ struct requested_server_struct *next;
+}requested_server;
+
+
+#define BOOTREQUEST 1
+#define BOOTREPLY 2
+
+#define DHCPDISCOVER 1
+#define DHCPOFFER 2
+#define DHCPREQUEST 3
+#define DHCPDECLINE 4
+#define DHCPACK 5
+#define DHCPNACK 6
+#define DHCPRELEASE 7
+
+#define DHCP_OPTION_MESSAGE_TYPE 53
+#define DHCP_OPTION_HOST_NAME 12
+#define DHCP_OPTION_BROADCAST_ADDRESS 28
+#define DHCP_OPTION_REQUESTED_ADDRESS 50
+#define DHCP_OPTION_LEASE_TIME 51
+#define DHCP_OPTION_SERVER_IDENTIFIER 54
+#define DHCP_OPTION_RENEWAL_TIME 58
+#define DHCP_OPTION_REBINDING_TIME 59
+#define DHCP_OPTION_END 255
+
+#define DHCP_INFINITE_TIME 0xFFFFFFFF
+
+#define DHCP_BROADCAST_FLAG 32768
+
+#define DHCP_SERVER_PORT 67
+#define DHCP_CLIENT_PORT 68
+
+#define ETHERNET_HARDWARE_ADDRESS 1 /* used in htype field of dhcp packet */
+#define ETHERNET_HARDWARE_ADDRESS_LENGTH 6 /* length of Ethernet hardware addresses */
+
+bool unicast = false; /* unicast mode: mimic a DHCP relay */
+bool exclusive = false; /* exclusive mode aka "rogue DHCP server detection" */
+struct in_addr my_ip; /* our address (required for relay) */
+struct in_addr dhcp_ip; /* server to query (if in unicast mode) */
+unsigned char client_hardware_address[MAX_DHCP_CHADDR_LENGTH]="";
+unsigned char *user_specified_mac=NULL;
+
+char network_interface_name[IFNAMSIZ]="eth0";
+
+uint32_t packet_xid=0;
+
+uint32_t dhcp_lease_time=0;
+uint32_t dhcp_renewal_time=0;
+uint32_t dhcp_rebinding_time=0;
+
+int dhcpoffer_timeout=2;
+
+dhcp_offer *dhcp_offer_list=NULL;
+requested_server *requested_server_list=NULL;
+
+int valid_responses=0; /* number of valid DHCPOFFERs we received */
+int requested_servers=0;
+int requested_responses=0;
+
+bool request_specific_address=false;
+bool received_requested_address=false;
+int verbose=0;
+struct in_addr requested_address;
+
+
+int process_arguments(int, char **);
+int call_getopt(int, char **);
+int validate_arguments(int);
+void print_usage(void);
+void print_help(void);
+
+void resolve_host(const char *in,struct in_addr *out);
+unsigned char *mac_aton(const char *);
+void print_hardware_address(const unsigned char *);
+int get_hardware_address(int,char *);
+int get_ip_address(int,char *);
+
+int send_dhcp_discover(int);
+int get_dhcp_offer(int);
+
+int get_results(void);
+
+int add_dhcp_offer(struct in_addr,dhcp_packet *);
+int free_dhcp_offer_list(void);
+int free_requested_server_list(void);
+
+int create_dhcp_socket(void);
+int close_dhcp_socket(int);
+int send_dhcp_packet(void *,int,int,struct sockaddr_in *);
+int receive_dhcp_packet(void *,int,int,int,struct sockaddr_in *);
+
+
+
+int main(int argc, char **argv){
+ int dhcp_socket;
+ int result = STATE_UNKNOWN;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts(&argc, argv, progname);
+
+ if(process_arguments(argc,argv)!=OK){
+ usage4 (_("Could not parse arguments"));
+ }
+
+ /* create socket for DHCP communications */
+ dhcp_socket=create_dhcp_socket();
+
+ /* get hardware address of client machine */
+ if(user_specified_mac!=NULL)
+ memcpy(client_hardware_address,user_specified_mac,6);
+ else
+ get_hardware_address(dhcp_socket,network_interface_name);
+
+ if(unicast) /* get IP address of client machine */
+ get_ip_address(dhcp_socket,network_interface_name);
+
+ /* send DHCPDISCOVER packet */
+ send_dhcp_discover(dhcp_socket);
+
+ /* wait for a DHCPOFFER packet */
+ get_dhcp_offer(dhcp_socket);
+
+ /* close socket we created */
+ close_dhcp_socket(dhcp_socket);
+
+ /* determine state/plugin output to return */
+ result=get_results();
+
+ /* free allocated memory */
+ free_dhcp_offer_list();
+ free_requested_server_list();
+
+ return result;
+}
+
+
+
+/* determines hardware address on client machine */
+int get_hardware_address(int sock,char *interface_name){
+
+#if defined(__linux__)
+ struct ifreq ifr;
+
+ strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name)-1);
+ ifr.ifr_name[sizeof(ifr.ifr_name)-1]='\0';
+
+ /* try and grab hardware address of requested interface */
+ if(ioctl(sock,SIOCGIFHWADDR,&ifr)<0){
+ printf(_("Error: Could not get hardware address of interface '%s'\n"),interface_name);
+ exit(STATE_UNKNOWN);
+ }
+
+ memcpy(&client_hardware_address[0],&ifr.ifr_hwaddr.sa_data,6);
+
+#elif defined(__bsd__)
+ /* King 2004 see ACKNOWLEDGEMENTS */
+
+ size_t len;
+ int mib[6];
+ char *buf;
+ unsigned char *ptr;
+ struct if_msghdr *ifm;
+ struct sockaddr_dl *sdl;
+
+ mib[0] = CTL_NET;
+ mib[1] = AF_ROUTE;
+ mib[2] = 0;
+ mib[3] = AF_LINK;
+ mib[4] = NET_RT_IFLIST;
+
+ if((mib[5] = if_nametoindex(interface_name)) == 0){
+ printf(_("Error: if_nametoindex error - %s.\n"), strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+
+ if(sysctl(mib, 6, NULL, &len, NULL, 0) < 0){
+ printf(_("Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"), interface_name, strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+
+ if((buf = malloc(len)) == NULL){
+ printf(_("Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"), interface_name, strerror(errno));
+ exit(4);
+ }
+
+ if(sysctl(mib, 6, buf, &len, NULL, 0) < 0){
+ printf(_("Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"), interface_name, strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+
+ ifm = (struct if_msghdr *)buf;
+ sdl = (struct sockaddr_dl *)(ifm + 1);
+ ptr = (unsigned char *)LLADDR(sdl);
+ memcpy(&client_hardware_address[0], ptr, 6) ;
+ /* King 2004 */
+
+#elif defined(__sun__) || defined(__solaris__)
+
+ /* Kompf 2000-2003 see ACKNOWLEDGEMENTS */
+ long stat;
+ char dev[20] = "/dev/";
+ char *p;
+ int unit;
+
+ /* get last number from interfacename, eg lnc0, e1000g0*/
+ int i;
+ p = interface_name + strlen(interface_name) -1;
+ for(i = strlen(interface_name) -1; i > 0; p--) {
+ if(isalpha(*p))
+ break;
+ }
+ p++;
+ if( p != interface_name ){
+ unit = atoi(p) ;
+ strncat(dev, interface_name, 6) ;
+ }
+ else{
+ printf(_("Error: can't find unit number in interface_name (%s) - expecting TypeNumber eg lnc0.\n"), interface_name);
+ exit(STATE_UNKNOWN);
+ }
+ stat = mac_addr_dlpi(dev, unit, client_hardware_address);
+ if(stat != 0){
+ printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit);
+ exit(STATE_UNKNOWN);
+ }
+
+#elif defined(__hpux__)
+
+ long stat;
+ char dev[20] = "/dev/dlpi" ;
+ int unit = 0;
+
+ stat = mac_addr_dlpi(dev, unit, client_hardware_address);
+ if(stat != 0){
+ printf(_("Error: can't read MAC address from DLPI streams interface for device %s unit %d.\n"), dev, unit);
+ exit(STATE_UNKNOWN);
+ }
+ /* Kompf 2000-2003 */
+
+#else
+ printf(_("Error: can't get MAC address for this architecture. Use the --mac option.\n"));
+ exit(STATE_UNKNOWN);
+#endif
+
+ if(verbose)
+ print_hardware_address(client_hardware_address);
+
+ return OK;
+}
+
+/* determines IP address of the client interface */
+int get_ip_address(int sock,char *interface_name){
+#if defined(SIOCGIFADDR)
+ struct ifreq ifr;
+
+ strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name)-1);
+ ifr.ifr_name[sizeof(ifr.ifr_name)-1]='\0';
+
+ if(ioctl(sock,SIOCGIFADDR,&ifr)<0){
+ printf(_("Error: Cannot determine IP address of interface %s\n"),
+ interface_name);
+ exit(STATE_UNKNOWN);
+ }
+
+ my_ip=((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr;
+
+#else
+ printf(_("Error: Cannot get interface IP address on this platform.\n"));
+ exit(STATE_UNKNOWN);
+#endif
+
+ if(verbose)
+ printf(_("Pretending to be relay client %s\n"),inet_ntoa(my_ip));
+
+ return OK;
+}
+
+/* sends a DHCPDISCOVER broadcast message in an attempt to find DHCP servers */
+int send_dhcp_discover(int sock){
+ dhcp_packet discover_packet;
+ struct sockaddr_in sockaddr_broadcast;
+ unsigned short opts;
+
+
+ /* clear the packet data structure */
+ bzero(&discover_packet,sizeof(discover_packet));
+
+
+ /* boot request flag (backward compatible with BOOTP servers) */
+ discover_packet.op=BOOTREQUEST;
+
+ /* hardware address type */
+ discover_packet.htype=ETHERNET_HARDWARE_ADDRESS;
+
+ /* length of our hardware address */
+ discover_packet.hlen=ETHERNET_HARDWARE_ADDRESS_LENGTH;
+
+ /*
+ * transaction ID is supposed to be random.
+ */
+ srand(time(NULL)^getpid());
+ packet_xid=random();
+ discover_packet.xid=htonl(packet_xid);
+
+ /*discover_packet.secs=htons(65535);*/
+ discover_packet.secs=0xFF;
+
+ /*
+ * server needs to know if it should broadcast or unicast its response:
+ * 0x8000L == 32768 == 1 << 15 == broadcast, 0 == unicast
+ */
+ discover_packet.flags = unicast ? 0 : htons(DHCP_BROADCAST_FLAG);
+
+ /* our hardware address */
+ memcpy(discover_packet.chaddr,client_hardware_address,ETHERNET_HARDWARE_ADDRESS_LENGTH);
+
+ /* first four bytes of options field is magic cookie (as per RFC 2132) */
+ discover_packet.options[0]='\x63';
+ discover_packet.options[1]='\x82';
+ discover_packet.options[2]='\x53';
+ discover_packet.options[3]='\x63';
+
+ opts = 4;
+ /* DHCP message type is embedded in options field */
+ discover_packet.options[opts++]=DHCP_OPTION_MESSAGE_TYPE; /* DHCP message type option identifier */
+ discover_packet.options[opts++]='\x01'; /* DHCP message option length in bytes */
+ discover_packet.options[opts++]=DHCPDISCOVER;
+
+ /* the IP address we're requesting */
+ if(request_specific_address){
+ discover_packet.options[opts++]=DHCP_OPTION_REQUESTED_ADDRESS;
+ discover_packet.options[opts++]='\x04';
+ memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address));
+ opts += sizeof(requested_address);
+ }
+ discover_packet.options[opts++]=DHCP_OPTION_END;
+
+ /* unicast fields */
+ if(unicast)
+ discover_packet.giaddr.s_addr = my_ip.s_addr;
+
+ /* see RFC 1542, 4.1.1 */
+ discover_packet.hops = unicast ? 1 : 0;
+
+ /* send the DHCPDISCOVER packet to broadcast address */
+ sockaddr_broadcast.sin_family=AF_INET;
+ sockaddr_broadcast.sin_port=htons(DHCP_SERVER_PORT);
+ sockaddr_broadcast.sin_addr.s_addr = unicast ? dhcp_ip.s_addr : INADDR_BROADCAST;
+ bzero(&sockaddr_broadcast.sin_zero,sizeof(sockaddr_broadcast.sin_zero));
+
+
+ if(verbose){
+ printf(_("DHCPDISCOVER to %s port %d\n"),inet_ntoa(sockaddr_broadcast.sin_addr),ntohs(sockaddr_broadcast.sin_port));
+ printf("DHCPDISCOVER XID: %u (0x%X)\n",ntohl(discover_packet.xid),ntohl(discover_packet.xid));
+ printf("DHCDISCOVER ciaddr: %s\n",inet_ntoa(discover_packet.ciaddr));
+ printf("DHCDISCOVER yiaddr: %s\n",inet_ntoa(discover_packet.yiaddr));
+ printf("DHCDISCOVER siaddr: %s\n",inet_ntoa(discover_packet.siaddr));
+ printf("DHCDISCOVER giaddr: %s\n",inet_ntoa(discover_packet.giaddr));
+ }
+
+ /* send the DHCPDISCOVER packet out */
+ send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast);
+
+ if(verbose)
+ printf("\n\n");
+
+ return OK;
+}
+
+
+
+
+/* waits for a DHCPOFFER message from one or more DHCP servers */
+int get_dhcp_offer(int sock){
+ dhcp_packet offer_packet;
+ struct sockaddr_in source;
+ struct sockaddr_in via;
+ int result=OK;
+ int responses=0;
+ int x;
+ time_t start_time;
+ time_t current_time;
+
+ time(&start_time);
+
+ /* receive as many responses as we can */
+ for(responses=0,valid_responses=0;;){
+
+ time(&current_time);
+ if((current_time-start_time)>=dhcpoffer_timeout)
+ break;
+
+ if(verbose)
+ printf("\n\n");
+
+ bzero(&source,sizeof(source));
+ bzero(&via,sizeof(via));
+ bzero(&offer_packet,sizeof(offer_packet));
+
+ result=OK;
+ result=receive_dhcp_packet(&offer_packet,sizeof(offer_packet),sock,dhcpoffer_timeout,&source);
+
+ if(result!=OK){
+ if(verbose)
+ printf(_("Result=ERROR\n"));
+
+ continue;
+ }
+ else{
+ if(verbose)
+ printf(_("Result=OK\n"));
+
+ responses++;
+ }
+
+ /* The "source" is either a server or a relay. */
+ /* Save a copy of "source" into "via" even if it's via itself */
+ memcpy(&via,&source,sizeof(source)) ;
+
+ if(verbose){
+ printf(_("DHCPOFFER from IP address %s"),inet_ntoa(source.sin_addr));
+ printf(_(" via %s\n"),inet_ntoa(via.sin_addr));
+ printf("DHCPOFFER XID: %u (0x%X)\n",ntohl(offer_packet.xid),ntohl(offer_packet.xid));
+ }
+
+ /* check packet xid to see if its the same as the one we used in the discover packet */
+ if(ntohl(offer_packet.xid)!=packet_xid){
+ if(verbose)
+ printf(_("DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"),ntohl(offer_packet.xid),packet_xid);
+
+ continue;
+ }
+
+ /* check hardware address */
+ result=OK;
+ if(verbose)
+ printf("DHCPOFFER chaddr: ");
+
+ for(x=0;x<ETHERNET_HARDWARE_ADDRESS_LENGTH;x++){
+ if(verbose)
+ printf("%02X",(unsigned char)offer_packet.chaddr[x]);
+
+ if(offer_packet.chaddr[x]!=client_hardware_address[x])
+ result=ERROR;
+ }
+ if(verbose)
+ printf("\n");
+
+ if(result==ERROR){
+ if(verbose)
+ printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n"));
+
+ continue;
+ }
+
+ if(verbose){
+ printf("DHCPOFFER ciaddr: %s\n",inet_ntoa(offer_packet.ciaddr));
+ printf("DHCPOFFER yiaddr: %s\n",inet_ntoa(offer_packet.yiaddr));
+ printf("DHCPOFFER siaddr: %s\n",inet_ntoa(offer_packet.siaddr));
+ printf("DHCPOFFER giaddr: %s\n",inet_ntoa(offer_packet.giaddr));
+ }
+
+ add_dhcp_offer(source.sin_addr,&offer_packet);
+
+ valid_responses++;
+ }
+
+ if(verbose){
+ printf(_("Total responses seen on the wire: %d\n"),responses);
+ printf(_("Valid responses for this machine: %d\n"),valid_responses);
+ }
+
+ return OK;
+}
+
+
+
+/* sends a DHCP packet */
+int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in *dest){
+ int result;
+
+ result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest));
+
+ if(verbose)
+ printf(_("send_dhcp_packet result: %d\n"),result);
+
+ if(result<0)
+ return ERROR;
+
+ return OK;
+}
+
+
+
+/* receives a DHCP packet */
+int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, struct sockaddr_in *address){
+ struct timeval tv;
+ fd_set readfds;
+ fd_set oobfds;
+ int recv_result;
+ socklen_t address_size;
+ struct sockaddr_in source_address;
+ int nfound;
+
+
+ /* wait for data to arrive (up time timeout) */
+ tv.tv_sec=timeout;
+ tv.tv_usec=0;
+ FD_ZERO(&readfds);
+ FD_ZERO(&oobfds);
+ FD_SET(sock,&readfds);
+ FD_SET(sock,&oobfds);
+ nfound = select(sock+1,&readfds,NULL,&oobfds,&tv);
+
+ /* make sure some data has arrived */
+ if(!FD_ISSET(sock,&readfds)){
+ if(verbose)
+ printf(_("No (more) data received (nfound: %d)\n"), nfound);
+ return ERROR;
+ }
+
+ else{
+ bzero(&source_address,sizeof(source_address));
+ address_size=sizeof(source_address);
+ recv_result=recvfrom(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)&source_address,&address_size);
+ if(verbose)
+ printf("recv_result: %d\n",recv_result);
+
+ if(recv_result==-1){
+ if(verbose){
+ printf(_("recvfrom() failed, "));
+ printf("errno: (%d) -> %s\n",errno,strerror(errno));
+ }
+ return ERROR;
+ }
+ else{
+ if(verbose){
+ printf(_("receive_dhcp_packet() result: %d\n"),recv_result);
+ printf(_("receive_dhcp_packet() source: %s\n"),inet_ntoa(source_address.sin_addr));
+ }
+
+ memcpy(address,&source_address,sizeof(source_address));
+ return OK;
+ }
+ }
+
+ return OK;
+}
+
+
+/* creates a socket for DHCP communication */
+int create_dhcp_socket(void){
+ struct sockaddr_in myname;
+ struct ifreq interface;
+ int sock;
+ int flag=1;
+
+ /* Set up the address we're going to bind to. */
+ bzero(&myname,sizeof(myname));
+ myname.sin_family=AF_INET;
+ /* listen to DHCP server port if we're in unicast mode */
+ myname.sin_port = htons(unicast ? DHCP_SERVER_PORT : DHCP_CLIENT_PORT);
+ myname.sin_addr.s_addr = unicast ? my_ip.s_addr : INADDR_ANY;
+ bzero(&myname.sin_zero,sizeof(myname.sin_zero));
+
+ /* create a socket for DHCP communications */
+ sock=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
+ if(sock<0){
+ printf(_("Error: Could not create socket!\n"));
+ exit(STATE_UNKNOWN);
+ }
+
+ if(verbose)
+ printf("DHCP socket: %d\n",sock);
+
+ /* set the reuse address flag so we don't get errors when restarting */
+ flag=1;
+ if(setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,(char *)&flag,sizeof(flag))<0){
+ printf(_("Error: Could not set reuse address option on DHCP socket!\n"));
+ exit(STATE_UNKNOWN);
+ }
+
+ /* set the broadcast option - we need this to listen to DHCP broadcast messages */
+ if(!unicast && setsockopt(sock,SOL_SOCKET,SO_BROADCAST,(char *)&flag,sizeof flag)<0){
+ printf(_("Error: Could not set broadcast option on DHCP socket!\n"));
+ exit(STATE_UNKNOWN);
+ }
+
+ /* bind socket to interface */
+#if defined(__linux__)
+ strncpy(interface.ifr_ifrn.ifrn_name,network_interface_name,IFNAMSIZ-1);
+ interface.ifr_ifrn.ifrn_name[IFNAMSIZ-1]='\0';
+ if(setsockopt(sock,SOL_SOCKET,SO_BINDTODEVICE,(char *)&interface,sizeof(interface))<0){
+ printf(_("Error: Could not bind socket to interface %s. Check your privileges...\n"),network_interface_name);
+ exit(STATE_UNKNOWN);
+ }
+
+#else
+ strncpy(interface.ifr_name,network_interface_name,IFNAMSIZ-1);
+ interface.ifr_name[IFNAMSIZ-1]='\0';
+#endif
+
+ /* bind the socket */
+ if(bind(sock,(struct sockaddr *)&myname,sizeof(myname))<0){
+ printf(_("Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"),DHCP_CLIENT_PORT);
+ exit(STATE_UNKNOWN);
+ }
+
+ return sock;
+}
+
+
+/* closes DHCP socket */
+int close_dhcp_socket(int sock){
+
+ close(sock);
+
+ return OK;
+}
+
+
+/* adds a requested server address to list in memory */
+int add_requested_server(struct in_addr server_address){
+ requested_server *new_server;
+
+ new_server=(requested_server *)malloc(sizeof(requested_server));
+ if(new_server==NULL)
+ return ERROR;
+
+ new_server->server_address=server_address;
+ new_server->answered=false;
+
+ new_server->next=requested_server_list;
+ requested_server_list=new_server;
+
+ requested_servers++;
+
+ if(verbose)
+ printf(_("Requested server address: %s\n"),inet_ntoa(new_server->server_address));
+
+ return OK;
+}
+
+
+
+
+/* adds a DHCP OFFER to list in memory */
+int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
+ dhcp_offer *new_offer;
+ int x;
+ unsigned option_type;
+ unsigned option_length;
+ struct in_addr serv_ident = {0};
+
+ if(offer_packet==NULL)
+ return ERROR;
+
+ /* process all DHCP options present in the packet */
+ for(x=4;x<MAX_DHCP_OPTIONS_LENGTH-1;){
+
+ if((int)offer_packet->options[x]==-1)
+ break;
+
+ /* get option type */
+ option_type=offer_packet->options[x++];
+
+ /* get option length */
+ option_length=offer_packet->options[x++];
+
+ if(verbose)
+ printf("Option: %d (0x%02X)\n",option_type,option_length);
+
+ /* get option data */
+ switch(option_type){
+ case DHCP_OPTION_LEASE_TIME:
+ memcpy(&dhcp_lease_time, &offer_packet->options[x],sizeof(dhcp_lease_time));
+ dhcp_lease_time = ntohl(dhcp_lease_time);
+ break;
+ case DHCP_OPTION_RENEWAL_TIME:
+ memcpy(&dhcp_renewal_time, &offer_packet->options[x],sizeof(dhcp_renewal_time));
+ dhcp_renewal_time = ntohl(dhcp_renewal_time);
+ break;
+ case DHCP_OPTION_REBINDING_TIME:
+ memcpy(&dhcp_rebinding_time, &offer_packet->options[x],sizeof(dhcp_rebinding_time));
+ dhcp_rebinding_time = ntohl(dhcp_rebinding_time);
+ break;
+ case DHCP_OPTION_SERVER_IDENTIFIER:
+ memcpy(&serv_ident.s_addr, &offer_packet->options[x],sizeof(serv_ident.s_addr));
+ break;
+ }
+
+ /* skip option data we're ignoring */
+ if(option_type==0) /* "pad" option, see RFC 2132 (3.1) */
+ x+=1;
+ else
+ x+=option_length;
+ }
+
+ if(verbose){
+ if(dhcp_lease_time==DHCP_INFINITE_TIME)
+ printf(_("Lease Time: Infinite\n"));
+ else
+ printf(_("Lease Time: %lu seconds\n"),(unsigned long)dhcp_lease_time);
+ if(dhcp_renewal_time==DHCP_INFINITE_TIME)
+ printf(_("Renewal Time: Infinite\n"));
+ else
+ printf(_("Renewal Time: %lu seconds\n"),(unsigned long)dhcp_renewal_time);
+ if(dhcp_rebinding_time==DHCP_INFINITE_TIME)
+ printf(_("Rebinding Time: Infinite\n"));
+ printf(_("Rebinding Time: %lu seconds\n"),(unsigned long)dhcp_rebinding_time);
+ }
+
+ new_offer=(dhcp_offer *)malloc(sizeof(dhcp_offer));
+
+ if(new_offer==NULL)
+ return ERROR;
+
+ /*
+ * RFC 2131 (2.) says: "DHCP clarifies the interpretation of the
+ * 'siaddr' field as the address of the server to use in the next step
+ * of the client's bootstrap process. A DHCP server may return its own
+ * address in the 'siaddr' field, if the server is prepared to supply
+ * the next bootstrap service (e.g., delivery of an operating system
+ * executable image). A DHCP server always returns its own address in
+ * the 'server identifier' option." 'serv_ident' is the 'server
+ * identifier' option, 'source' is the IP address we received the
+ * DHCPOFFER from. If 'serv_ident' isn't available for some reason, we
+ * use 'source'.
+ */
+ new_offer->server_address=serv_ident.s_addr?serv_ident:source;
+ new_offer->offered_address=offer_packet->yiaddr;
+ new_offer->lease_time=dhcp_lease_time;
+ new_offer->renewal_time=dhcp_renewal_time;
+ new_offer->rebinding_time=dhcp_rebinding_time;
+ new_offer->desired=false; /* exclusive mode: we'll check that in get_results */
+
+
+ if(verbose){
+ printf(_("Added offer from server @ %s"),inet_ntoa(new_offer->server_address));
+ printf(_(" of IP address %s\n"),inet_ntoa(new_offer->offered_address));
+ }
+
+ /* add new offer to head of list */
+ new_offer->next=dhcp_offer_list;
+ dhcp_offer_list=new_offer;
+
+ return OK;
+}
+
+
+/* frees memory allocated to DHCP OFFER list */
+int free_dhcp_offer_list(void){
+ dhcp_offer *this_offer;
+ dhcp_offer *next_offer;
+
+ for(this_offer=dhcp_offer_list;this_offer!=NULL;this_offer=next_offer){
+ next_offer=this_offer->next;
+ free(this_offer);
+ }
+
+ return OK;
+}
+
+
+/* frees memory allocated to requested server list */
+int free_requested_server_list(void){
+ requested_server *this_server;
+ requested_server *next_server;
+
+ for(this_server=requested_server_list;this_server!=NULL;this_server=next_server){
+ next_server=this_server->next;
+ free(this_server);
+ }
+
+ return OK;
+}
+
+
+/* gets state and plugin output to return */
+int get_results(void){
+ dhcp_offer *temp_offer, *undesired_offer=NULL;
+ requested_server *temp_server;
+ int result;
+ uint32_t max_lease_time=0;
+
+ received_requested_address=false;
+
+ /* checks responses from requested servers */
+ requested_responses=0;
+ if(requested_servers>0){
+
+ for(temp_server=requested_server_list;temp_server!=NULL;temp_server=temp_server->next){
+
+ for(temp_offer=dhcp_offer_list;temp_offer!=NULL;temp_offer=temp_offer->next){
+
+ /* get max lease time we were offered */
+ if(temp_offer->lease_time>max_lease_time || temp_offer->lease_time==DHCP_INFINITE_TIME)
+ max_lease_time=temp_offer->lease_time;
+
+ /* see if we got the address we requested */
+ if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address)))
+ received_requested_address=true;
+
+ /* see if the servers we wanted a response from talked to us or not */
+ if(!memcmp(&temp_offer->server_address,&temp_server->server_address,sizeof(temp_server->server_address))){
+ if(verbose){
+ printf(_("DHCP Server Match: Offerer=%s"),inet_ntoa(temp_offer->server_address));
+ printf(_(" Requested=%s"),inet_ntoa(temp_server->server_address));
+ if(temp_server->answered)
+ printf(_(" (duplicate)"));
+ printf(_("\n"));
+ }
+ if(!temp_server->answered){
+ requested_responses++;
+ temp_server->answered=true;
+ temp_offer->desired=true;
+ }
+ }
+ }
+ }
+
+ /* exclusive mode: check for undesired offers */
+ for(temp_offer=dhcp_offer_list;temp_offer!=NULL;temp_offer=temp_offer->next) {
+ if (!temp_offer->desired) {
+ undesired_offer=temp_offer; /* Checks only for the first undesired offer */
+ break; /* no further checks needed */
+ }
+ }
+ }
+
+ /* else check and see if we got our requested address from any server */
+ else{
+
+ for(temp_offer=dhcp_offer_list;temp_offer!=NULL;temp_offer=temp_offer->next){
+
+ /* get max lease time we were offered */
+ if(temp_offer->lease_time>max_lease_time || temp_offer->lease_time==DHCP_INFINITE_TIME)
+ max_lease_time=temp_offer->lease_time;
+
+ /* see if we got the address we requested */
+ if(!memcmp(&requested_address,&temp_offer->offered_address,sizeof(requested_address)))
+ received_requested_address=true;
+ }
+ }
+
+ result=STATE_OK;
+ if(valid_responses==0)
+ result=STATE_CRITICAL;
+ else if(requested_servers>0 && requested_responses==0)
+ result=STATE_CRITICAL;
+ else if(requested_responses<requested_servers)
+ result=STATE_WARNING;
+ else if(request_specific_address && !received_requested_address)
+ result=STATE_WARNING;
+
+ if(exclusive && undesired_offer)
+ result=STATE_CRITICAL;
+
+ if(result==0) /* garrett honeycutt 2005 */
+ printf("OK: ");
+ else if(result==1)
+ printf("WARNING: ");
+ else if(result==2)
+ printf("CRITICAL: ");
+ else if(result==3)
+ printf("UNKNOWN: ");
+
+ /* we didn't receive any DHCPOFFERs */
+ if(dhcp_offer_list==NULL){
+ printf(_("No DHCPOFFERs were received.\n"));
+ return result;
+ }
+
+ printf(_("Received %d DHCPOFFER(s)"),valid_responses);
+
+
+ if(exclusive && undesired_offer){
+ printf(_(", Rogue DHCP Server detected! Server %s"),inet_ntoa(undesired_offer->server_address));
+ printf(_(" offered %s \n"),inet_ntoa(undesired_offer->offered_address));
+ return result;
+ }
+
+ if(requested_servers>0)
+ printf(_(", %s%d of %d requested servers responded"),((requested_responses<requested_servers) && requested_responses>0)?"only ":"",requested_responses,requested_servers);
+
+ if(request_specific_address)
+ printf(_(", requested address (%s) was %soffered"),inet_ntoa(requested_address),(received_requested_address)?"":_("not "));
+
+ printf(_(", max lease time = "));
+ if(max_lease_time==DHCP_INFINITE_TIME)
+ printf(_("Infinity"));
+ else
+ printf("%lu sec",(unsigned long)max_lease_time);
+
+ printf(".\n");
+
+ return result;
+}
+
+
+/* process command-line arguments */
+int process_arguments(int argc, char **argv){
+ if(argc<1)
+ return ERROR;
+
+ call_getopt(argc,argv);
+ return validate_arguments(argc);
+}
+
+
+
+int call_getopt(int argc, char **argv){
+ extern int optind;
+ int option_index = 0;
+ static struct option long_options[] =
+ {
+ {"serverip", required_argument,0,'s'},
+ {"requestedip", required_argument,0,'r'},
+ {"timeout", required_argument,0,'t'},
+ {"interface", required_argument,0,'i'},
+ {"mac", required_argument,0,'m'},
+ {"unicast", no_argument, 0,'u'},
+ {"exclusive", no_argument, 0,'x'},
+ {"verbose", no_argument, 0,'v'},
+ {"version", no_argument, 0,'V'},
+ {"help", no_argument, 0,'h'},
+ {0,0,0,0}
+ };
+
+ int c=0;
+ while(true){
+ c=getopt_long(argc,argv,"+hVvxt:s:r:t:i:m:u",long_options,&option_index);
+
+ if(c==-1||c==EOF||c==1)
+ break;
+
+ switch(c){
+
+ case 's': /* DHCP server address */
+ resolve_host(optarg,&dhcp_ip);
+ add_requested_server(dhcp_ip);
+ break;
+
+ case 'r': /* address we are requested from DHCP servers */
+ resolve_host(optarg,&requested_address);
+ request_specific_address=true;
+ break;
+
+ case 't': /* timeout */
+
+ /*
+ if(is_intnonneg(optarg))
+ */
+ if(atoi(optarg)>0)
+ dhcpoffer_timeout=atoi(optarg);
+ /*
+ else
+ usage("Time interval must be a nonnegative integer\n");
+ */
+ break;
+
+ case 'm': /* MAC address */
+
+ if((user_specified_mac=mac_aton(optarg)) == NULL)
+ usage("Cannot parse MAC address.\n");
+ if(verbose)
+ print_hardware_address(user_specified_mac);
+
+ break;
+
+ case 'i': /* interface name */
+
+ strncpy(network_interface_name,optarg,sizeof(network_interface_name)-1);
+ network_interface_name[sizeof(network_interface_name)-1]='\x0';
+
+ break;
+
+ case 'u': /* unicast testing */
+ unicast=true;
+ break;
+ case 'x': /* exclusive testing aka "rogue DHCP server detection" */
+ exclusive=true;
+ break;
+
+ case 'V': /* version */
+ print_revision(progname, NP_VERSION);
+ exit(STATE_UNKNOWN);
+
+ case 'h': /* help */
+ print_help();
+ exit(STATE_UNKNOWN);
+
+ case 'v': /* verbose */
+ verbose=1;
+ break;
+ case '?': /* help */
+ usage5 ();
+ break;
+
+ default:
+ break;
+ }
+ }
+ return optind;
+}
+
+
+int validate_arguments(int argc){
+
+ if(argc - optind > 0)
+ usage(_("Got unexpected non-option argument"));
+
+ return OK;
+}
+
+
+#if defined(__sun__) || defined(__solaris__) || defined(__hpux__)
+/* Kompf 2000-2003 see ACKNOWLEDGEMENTS */
+
+/* get a message from a stream; return type of message */
+static int get_msg(int fd){
+ int flags = 0;
+ int res, ret;
+ ctl_area[0] = 0;
+ dat_area[0] = 0;
+ ret = 0;
+ res = getmsg(fd, &ctl, &dat, &flags);
+
+ if(res < 0){
+ if(errno == EINTR){
+ return(GOT_INTR);
+ }
+ else{
+ printf("%s\n", "get_msg FAILED.");
+ return(GOT_ERR);
+ }
+ }
+ if(ctl.len > 0){
+ ret |= GOT_CTRL;
+ }
+ if(dat.len > 0){
+ ret |= GOT_DATA;
+ }
+
+ return(ret);
+}
+
+/* verify that dl_primitive in ctl_area = prim */
+static int check_ctrl(int prim){
+ dl_error_ack_t *err_ack = (dl_error_ack_t *)ctl_area;
+
+ if(err_ack->dl_primitive != prim){
+ printf(_("Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"), strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+
+ return 0;
+}
+
+/* put a control message on a stream */
+static int put_ctrl(int fd, int len, int pri){
+
+ ctl.len = len;
+ if(putmsg(fd, &ctl, 0, pri) < 0){
+ printf(_("Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"), strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+
+ return 0;
+}
+
+/* put a control + data message on a stream */
+static int put_both(int fd, int clen, int dlen, int pri){
+
+ ctl.len = clen;
+ dat.len = dlen;
+ if(putmsg(fd, &ctl, &dat, pri) < 0){
+ printf(_("Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"), strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+
+ return 0;
+}
+
+/* open file descriptor and attach */
+static int dl_open(const char *dev, int unit, int *fd){
+ dl_attach_req_t *attach_req = (dl_attach_req_t *)ctl_area;
+
+ if((*fd = open(dev, O_RDWR)) == -1){
+ printf(_("Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"), dev, strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+ attach_req->dl_primitive = DL_ATTACH_REQ;
+ attach_req->dl_ppa = unit;
+ put_ctrl(*fd, sizeof(dl_attach_req_t), 0);
+ get_msg(*fd);
+ return check_ctrl(DL_OK_ACK);
+}
+
+/* send DL_BIND_REQ */
+static int dl_bind(int fd, int sap, u_char *addr){
+ dl_bind_req_t *bind_req = (dl_bind_req_t *)ctl_area;
+ dl_bind_ack_t *bind_ack = (dl_bind_ack_t *)ctl_area;
+
+ bind_req->dl_primitive = DL_BIND_REQ;
+ bind_req->dl_sap = sap;
+ bind_req->dl_max_conind = 1;
+ bind_req->dl_service_mode = DL_CLDLS;
+ bind_req->dl_conn_mgmt = 0;
+ bind_req->dl_xidtest_flg = 0;
+ put_ctrl(fd, sizeof(dl_bind_req_t), 0);
+ get_msg(fd);
+ if (GOT_ERR == check_ctrl(DL_BIND_ACK)){
+ printf(_("Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"), strerror(errno));
+ exit(STATE_UNKNOWN);
+ }
+ bcopy((u_char *)bind_ack + bind_ack->dl_addr_offset, addr,
+ bind_ack->dl_addr_length);
+
+ return 0;
+}
+
+/***********************************************************************
+ * interface:
+ * function mac_addr_dlpi - get the mac address of the interface with
+ * type dev (eg lnc, hme) and unit (0, 1 ..)
+ *
+ * parameter: addr: an array of six bytes, has to be allocated by the caller
+ *
+ * return: 0 if OK, -1 if the address could not be determined
+ *
+ *
+ ***********************************************************************/
+
+long mac_addr_dlpi( const char *dev, int unit, u_char *addr){
+ int fd;
+ u_char mac_addr[25];
+
+ if(GOT_ERR != dl_open(dev, unit, &fd)){
+ if(GOT_ERR != dl_bind(fd, INSAP, mac_addr)){
+ bcopy( mac_addr, addr, 6);
+ return 0;
+ }
+ }
+ close(fd);
+
+ return -1;
+}
+
+/* Kompf 2000-2003 */
+#endif
+
+
+/* resolve host name or die (TODO: move this to netutils.c!) */
+void resolve_host(const char *in,struct in_addr *out){
+ struct addrinfo hints, *ai;
+
+ memset(&hints,0,sizeof(hints));
+ hints.ai_family=PF_INET;
+ if (getaddrinfo(in,NULL,&hints,&ai) != 0)
+ usage_va(_("Invalid hostname/address - %s"),optarg);
+
+ memcpy(out,&((struct sockaddr_in *)ai->ai_addr)->sin_addr,sizeof(*out));
+ freeaddrinfo(ai);
+}
+
+
+/* parse MAC address string, return 6 bytes (unterminated) or NULL */
+unsigned char *mac_aton(const char *string){
+ static unsigned char result[6];
+ char tmp[3];
+ unsigned i, j;
+
+ for(i=0, j=0; string[i] != '\0' && j < sizeof(result); i++){
+ /* ignore ':' and any other non-hex character */
+ if(!isxdigit(string[i]) || !isxdigit(string[i+1]))
+ continue;
+ tmp[0]=string[i];
+ tmp[1]=string[i+1];
+ tmp[2]='\0';
+ result[j]=strtol(tmp,(char **)NULL,16);
+ i++;
+ j++;
+ }
+
+ return (j==6) ? result : NULL;
+}
+
+
+void print_hardware_address(const unsigned char *address){
+ int i;
+
+ printf(_("Hardware address: "));
+ for (i=0; i<5; i++)
+ printf("%2.2x:", address[i]);
+ printf("%2.2x", address[i]);
+ putchar('\n');
+}
+
+
+/* print usage help */
+void print_help(void){
+
+ print_revision(progname, NP_VERSION);
+
+ printf("Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf("%s\n", _("This plugin tests the availability of DHCP servers on a network."));
+
+ printf ("\n\n");
+
+ print_usage();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_VERBOSE);
+
+ printf (" %s\n", "-s, --serverip=IPADDRESS");
+ printf (" %s\n", _("IP address of DHCP server that we must hear from"));
+ printf (" %s\n", "-r, --requestedip=IPADDRESS");
+ printf (" %s\n", _("IP address that should be offered by at least one DHCP server"));
+ printf (" %s\n", "-t, --timeout=INTEGER");
+ printf (" %s\n", _("Seconds to wait for DHCPOFFER before timeout occurs"));
+ printf (" %s\n", "-i, --interface=STRING");
+ printf (" %s\n", _("Interface to to use for listening (i.e. eth0)"));
+ printf (" %s\n", "-m, --mac=STRING");
+ printf (" %s\n", _("MAC address to use in the DHCP request"));
+ printf (" %s\n", "-u, --unicast");
+ printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s"));
+ printf (" %s\n", "-x, --exclusive");
+ printf (" %s\n", _("Only requested DHCP server may response (rogue DHCP server detection), requires -s"));
+
+ printf (UT_SUPPORT);
+ return;
+}
+
+
+void
+print_usage(void){
+
+ printf ("%s\n", _("Usage:"));
+ printf (" %s [-v] [-u] [-x] [-s serverip] [-r requestedip] [-t timeout]\n",progname);
+ printf (" [-i interface] [-m mac]\n");
+
+ return;
+}
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
new file mode 100644
index 0000000..303241d
--- /dev/null
+++ b/plugins-root/check_icmp.c
@@ -0,0 +1,2109 @@
+/*****************************************************************************
+*
+* Monitoring check_icmp plugin
+*
+* License: GPL
+* Copyright (c) 2005-2008 Monitoring Plugins Development Team
+* Original Author : Andreas Ericsson <ae@op5.se>
+*
+* Description:
+*
+* This file contains the check_icmp plugin
+*
+* Relevant RFC's: 792 (ICMP), 791 (IP)
+*
+* This program was modeled somewhat after the check_icmp program,
+* which was in turn a hack of fping (www.fping.org) but has been
+* completely rewritten since to generate higher precision rta values,
+* and support several different modes as well as setting ttl to control.
+* redundant routes. The only remainders of fping is currently a few
+* function names.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+/* progname may change */
+/* char *progname = "check_icmp"; */
+char *progname;
+const char *copyright = "2005-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+/** Monitoring Plugins basic includes */
+#include "../plugins/common.h"
+#include "netutils.h"
+#include "utils.h"
+
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+
+#include <sys/time.h>
+#include <errno.h>
+#include <signal.h>
+#include <ctype.h>
+#include <float.h>
+#include <net/if.h>
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/icmp6.h>
+#include <arpa/inet.h>
+
+
+/** sometimes undefined system macros (quite a few, actually) **/
+#ifndef MAXTTL
+# define MAXTTL 255
+#endif
+#ifndef INADDR_NONE
+# define INADDR_NONE (in_addr_t)(-1)
+#endif
+
+#ifndef SOL_IP
+#define SOL_IP 0
+#endif
+
+/* we bundle these in one #ifndef, since they're all from BSD
+ * Put individual #ifndef's around those that bother you */
+#ifndef ICMP_UNREACH_NET_UNKNOWN
+# define ICMP_UNREACH_NET_UNKNOWN 6
+# define ICMP_UNREACH_HOST_UNKNOWN 7
+# define ICMP_UNREACH_ISOLATED 8
+# define ICMP_UNREACH_NET_PROHIB 9
+# define ICMP_UNREACH_HOST_PROHIB 10
+# define ICMP_UNREACH_TOSNET 11
+# define ICMP_UNREACH_TOSHOST 12
+#endif
+/* tru64 has the ones above, but not these */
+#ifndef ICMP_UNREACH_FILTER_PROHIB
+# define ICMP_UNREACH_FILTER_PROHIB 13
+# define ICMP_UNREACH_HOST_PRECEDENCE 14
+# define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
+#endif
+
+typedef unsigned short range_t; /* type for get_range() -- unimplemented */
+
+typedef struct rta_host {
+ unsigned short id; /* id in **table, and icmp pkts */
+ char *name; /* arg used for adding this host */
+ char *msg; /* icmp error message, if any */
+ struct sockaddr_storage saddr_in; /* the address of this host */
+ struct sockaddr_storage error_addr; /* stores address of error replies */
+ unsigned long long time_waited; /* total time waited, in usecs */
+ unsigned int icmp_sent, icmp_recv, icmp_lost; /* counters */
+ unsigned char icmp_type, icmp_code; /* type and code from errors */
+ unsigned short flags; /* control/status flags */
+ double rta; /* measured RTA */
+ int rta_status; // check result for RTA checks
+ double rtmax; /* max rtt */
+ double rtmin; /* min rtt */
+ double jitter; /* measured jitter */
+ int jitter_status; // check result for Jitter checks
+ double jitter_max; /* jitter rtt maximum */
+ double jitter_min; /* jitter rtt minimum */
+ double EffectiveLatency;
+ double mos; /* Mean opnion score */
+ int mos_status; // check result for MOS checks
+ double score; /* score */
+ int score_status; // check result for score checks
+ u_int last_tdiff;
+ u_int last_icmp_seq; /* Last ICMP_SEQ to check out of order pkts */
+ unsigned char pl; /* measured packet loss */
+ int pl_status; // check result for packet loss checks
+ struct rta_host *next; /* linked list */
+ int order_status; // check result for packet order checks
+} rta_host;
+
+#define FLAG_LOST_CAUSE 0x01 /* decidedly dead target. */
+
+/* threshold structure. all values are maximum allowed, exclusive */
+typedef struct threshold {
+ unsigned char pl; /* max allowed packet loss in percent */
+ unsigned int rta; /* roundtrip time average, microseconds */
+ double jitter; /* jitter time average, microseconds */
+ double mos; /* MOS */
+ double score; /* Score */
+} threshold;
+
+/* the data structure */
+typedef struct icmp_ping_data {
+ struct timeval stime; /* timestamp (saved in protocol struct as well) */
+ unsigned short ping_id;
+} icmp_ping_data;
+
+typedef union ip_hdr {
+ struct ip ip;
+ struct ip6_hdr ip6;
+} ip_hdr;
+
+typedef union icmp_packet {
+ void *buf;
+ struct icmp *icp;
+ struct icmp6_hdr *icp6;
+ u_short *cksum_in;
+} icmp_packet;
+
+/* the different modes of this program are as follows:
+ * MODE_RTA: send all packets no matter what (mimic check_icmp and check_ping)
+ * MODE_HOSTCHECK: Return immediately upon any sign of life
+ * In addition, sends packets to ALL addresses assigned
+ * to this host (as returned by gethostbyname() or
+ * gethostbyaddr() and expects one host only to be checked at
+ * a time. Therefore, any packet response what so ever will
+ * count as a sign of life, even when received outside
+ * crit.rta limit. Do not misspell any additional IP's.
+ * MODE_ALL: Requires packets from ALL requested IP to return OK (default).
+ * MODE_ICMP: implement something similar to check_icmp (MODE_RTA without
+ * tcp and udp args does this)
+ */
+#define MODE_RTA 0
+#define MODE_HOSTCHECK 1
+#define MODE_ALL 2
+#define MODE_ICMP 3
+
+enum enum_threshold_mode {
+ const_rta_mode,
+ const_packet_loss_mode,
+ const_jitter_mode,
+ const_mos_mode,
+ const_score_mode
+};
+
+typedef enum enum_threshold_mode threshold_mode;
+
+/* the different ping types we can do
+ * TODO: investigate ARP ping as well */
+#define HAVE_ICMP 1
+#define HAVE_UDP 2
+#define HAVE_TCP 4
+#define HAVE_ARP 8
+
+#define MIN_PING_DATA_SIZE sizeof(struct icmp_ping_data)
+#define MAX_IP_PKT_SIZE 65536 /* (theoretical) max IP packet size */
+#define IP_HDR_SIZE 20
+#define MAX_PING_DATA (MAX_IP_PKT_SIZE - IP_HDR_SIZE - ICMP_MINLEN)
+#define DEFAULT_PING_DATA_SIZE (MIN_PING_DATA_SIZE + 44)
+
+/* various target states */
+#define TSTATE_INACTIVE 0x01 /* don't ping this host anymore */
+#define TSTATE_WAITING 0x02 /* unanswered packets on the wire */
+#define TSTATE_ALIVE 0x04 /* target is alive (has answered something) */
+#define TSTATE_UNREACH 0x08
+
+/** prototypes **/
+void print_help (void);
+void print_usage (void);
+static u_int get_timevar(const char *);
+static u_int get_timevaldiff(struct timeval *, struct timeval *);
+static in_addr_t get_ip_address(const char *);
+static int wait_for_reply(int, u_int);
+static int recvfrom_wto(int, void *, unsigned int, struct sockaddr *, u_int *, struct timeval*);
+static int send_icmp_ping(int, struct rta_host *);
+static int get_threshold(char *str, threshold *th);
+static bool get_threshold2(char *str, size_t length, threshold *, threshold *, threshold_mode mode);
+static bool parse_threshold2_helper(char *s, size_t length, threshold *thr, threshold_mode mode);
+static void run_checks(void);
+static void set_source_ip(char *);
+static int add_target(char *);
+static int add_target_ip(char *, struct sockaddr_storage *);
+static int handle_random_icmp(unsigned char *, struct sockaddr_storage *);
+static void parse_address(struct sockaddr_storage *, char *, int);
+static unsigned short icmp_checksum(uint16_t *, size_t);
+static void finish(int);
+static void crash(const char *, ...);
+
+/** external **/
+extern int optind;
+extern char *optarg;
+extern char **environ;
+
+/** global variables **/
+static struct rta_host **table, *cursor, *list;
+
+static threshold crit = {
+ .pl = 80,
+ .rta = 500000,
+ .jitter = 0.0,
+ .mos = 0.0,
+ .score = 0.0
+};
+static threshold warn = {
+ .pl = 40,
+ .rta = 200000,
+ .jitter = 0.0,
+ .mos = 0.0,
+ .score = 0.0
+};
+
+static int mode, protocols, sockets, debug = 0, timeout = 10;
+static unsigned short icmp_data_size = DEFAULT_PING_DATA_SIZE;
+static unsigned short icmp_pkt_size = DEFAULT_PING_DATA_SIZE + ICMP_MINLEN;
+
+static unsigned int icmp_sent = 0, icmp_recv = 0, icmp_lost = 0, ttl = 0;
+#define icmp_pkts_en_route (icmp_sent - (icmp_recv + icmp_lost))
+static unsigned short targets_down = 0, targets = 0, packets = 0;
+#define targets_alive (targets - targets_down)
+static unsigned int retry_interval, pkt_interval, target_interval;
+static int icmp_sock, tcp_sock, udp_sock, status = STATE_OK;
+static pid_t pid;
+static struct timezone tz;
+static struct timeval prog_start;
+static unsigned long long max_completion_time = 0;
+static unsigned int warn_down = 1, crit_down = 1; /* host down threshold values */
+static int min_hosts_alive = -1;
+float pkt_backoff_factor = 1.5;
+float target_backoff_factor = 1.5;
+bool rta_mode=false;
+bool pl_mode=false;
+bool jitter_mode=false;
+bool score_mode=false;
+bool mos_mode=false;
+bool order_mode=false;
+
+/** code start **/
+static void
+crash(const char *fmt, ...)
+{
+ va_list ap;
+
+ printf("%s: ", progname);
+
+ va_start(ap, fmt);
+ vprintf(fmt, ap);
+ va_end(ap);
+
+ if(errno) printf(": %s", strerror(errno));
+ puts("");
+
+ exit(3);
+}
+
+
+static const char *
+get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code)
+{
+ const char *msg = "unreachable";
+
+ if(debug > 1) printf("get_icmp_error_msg(%u, %u)\n", icmp_type, icmp_code);
+ switch(icmp_type) {
+ case ICMP_UNREACH:
+ switch(icmp_code) {
+ case ICMP_UNREACH_NET: msg = "Net unreachable"; break;
+ case ICMP_UNREACH_HOST: msg = "Host unreachable"; break;
+ case ICMP_UNREACH_PROTOCOL: msg = "Protocol unreachable (firewall?)"; break;
+ case ICMP_UNREACH_PORT: msg = "Port unreachable (firewall?)"; break;
+ case ICMP_UNREACH_NEEDFRAG: msg = "Fragmentation needed"; break;
+ case ICMP_UNREACH_SRCFAIL: msg = "Source route failed"; break;
+ case ICMP_UNREACH_ISOLATED: msg = "Source host isolated"; break;
+ case ICMP_UNREACH_NET_UNKNOWN: msg = "Unknown network"; break;
+ case ICMP_UNREACH_HOST_UNKNOWN: msg = "Unknown host"; break;
+ case ICMP_UNREACH_NET_PROHIB: msg = "Network denied (firewall?)"; break;
+ case ICMP_UNREACH_HOST_PROHIB: msg = "Host denied (firewall?)"; break;
+ case ICMP_UNREACH_TOSNET: msg = "Bad TOS for network (firewall?)"; break;
+ case ICMP_UNREACH_TOSHOST: msg = "Bad TOS for host (firewall?)"; break;
+ case ICMP_UNREACH_FILTER_PROHIB: msg = "Prohibited by filter (firewall)"; break;
+ case ICMP_UNREACH_HOST_PRECEDENCE: msg = "Host precedence violation"; break;
+ case ICMP_UNREACH_PRECEDENCE_CUTOFF: msg = "Precedence cutoff"; break;
+ default: msg = "Invalid code"; break;
+ }
+ break;
+
+ case ICMP_TIMXCEED:
+ /* really 'out of reach', or non-existent host behind a router serving
+ * two different subnets */
+ switch(icmp_code) {
+ case ICMP_TIMXCEED_INTRANS: msg = "Time to live exceeded in transit"; break;
+ case ICMP_TIMXCEED_REASS: msg = "Fragment reassembly time exceeded"; break;
+ default: msg = "Invalid code"; break;
+ }
+ break;
+
+ case ICMP_SOURCEQUENCH: msg = "Transmitting too fast"; break;
+ case ICMP_REDIRECT: msg = "Redirect (change route)"; break;
+ case ICMP_PARAMPROB: msg = "Bad IP header (required option absent)"; break;
+
+ /* the following aren't error messages, so ignore */
+ case ICMP_TSTAMP:
+ case ICMP_TSTAMPREPLY:
+ case ICMP_IREQ:
+ case ICMP_IREQREPLY:
+ case ICMP_MASKREQ:
+ case ICMP_MASKREPLY:
+ default: msg = ""; break;
+ }
+
+ return msg;
+}
+
+static int
+handle_random_icmp(unsigned char *packet, struct sockaddr_storage *addr)
+{
+ struct icmp p, sent_icmp;
+ struct rta_host *host = NULL;
+
+ memcpy(&p, packet, sizeof(p));
+ if(p.icmp_type == ICMP_ECHO && ntohs(p.icmp_id) == pid) {
+ /* echo request from us to us (pinging localhost) */
+ return 0;
+ }
+
+ if(debug) printf("handle_random_icmp(%p, %p)\n", (void *)&p, (void *)addr);
+
+ /* only handle a few types, since others can't possibly be replies to
+ * us in a sane network (if it is anyway, it will be counted as lost
+ * at summary time, but not as quickly as a proper response */
+ /* TIMXCEED can be an unreach from a router with multiple IP's which
+ * serves two different subnets on the same interface and a dead host
+ * on one net is pinged from the other. The router will respond to
+ * itself and thus set TTL=0 so as to not loop forever. Even when
+ * TIMXCEED actually sends a proper icmp response we will have passed
+ * too many hops to have a hope of reaching it later, in which case it
+ * indicates overconfidence in the network, poor routing or both. */
+ if(p.icmp_type != ICMP_UNREACH && p.icmp_type != ICMP_TIMXCEED &&
+ p.icmp_type != ICMP_SOURCEQUENCH && p.icmp_type != ICMP_PARAMPROB)
+ {
+ return 0;
+ }
+
+ /* might be for us. At least it holds the original package (according
+ * to RFC 792). If it isn't, just ignore it */
+ memcpy(&sent_icmp, packet + 28, sizeof(sent_icmp));
+ if(sent_icmp.icmp_type != ICMP_ECHO || ntohs(sent_icmp.icmp_id) != pid ||
+ ntohs(sent_icmp.icmp_seq) >= targets*packets)
+ {
+ if(debug) printf("Packet is no response to a packet we sent\n");
+ return 0;
+ }
+
+ /* it is indeed a response for us */
+ host = table[ntohs(sent_icmp.icmp_seq)/packets];
+ if(debug) {
+ char address[INET6_ADDRSTRLEN];
+ parse_address(addr, address, sizeof(address));
+ printf("Received \"%s\" from %s for ICMP ECHO sent to %s.\n",
+ get_icmp_error_msg(p.icmp_type, p.icmp_code),
+ address, host->name);
+ }
+
+ icmp_lost++;
+ host->icmp_lost++;
+ /* don't spend time on lost hosts any more */
+ if(host->flags & FLAG_LOST_CAUSE) return 0;
+
+ /* source quench means we're sending too fast, so increase the
+ * interval and mark this packet lost */
+ if(p.icmp_type == ICMP_SOURCEQUENCH) {
+ pkt_interval *= pkt_backoff_factor;
+ target_interval *= target_backoff_factor;
+ }
+ else {
+ targets_down++;
+ host->flags |= FLAG_LOST_CAUSE;
+ }
+ host->icmp_type = p.icmp_type;
+ host->icmp_code = p.icmp_code;
+ host->error_addr = *addr;
+
+ return 0;
+}
+
+void parse_address(struct sockaddr_storage *addr, char *address, int size)
+{
+ switch (address_family) {
+ case AF_INET:
+ inet_ntop(address_family, &((struct sockaddr_in *)addr)->sin_addr, address, size);
+ break;
+ case AF_INET6:
+ inet_ntop(address_family, &((struct sockaddr_in6 *)addr)->sin6_addr, address, size);
+ break;
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ int i;
+ char *ptr;
+ long int arg;
+ int icmp_sockerrno, udp_sockerrno, tcp_sockerrno;
+ int result;
+ struct rta_host *host;
+#ifdef HAVE_SIGACTION
+ struct sigaction sig_action;
+#endif
+#ifdef SO_TIMESTAMP
+ int on = 1;
+#endif
+ char *source_ip = NULL;
+ char * opts_str = "vhVw:c:n:p:t:H:s:i:b:I:l:m:P:R:J:S:M:O64";
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* we only need to be setsuid when we get the sockets, so do
+ * that before pointer magic (esp. on network data) */
+ icmp_sockerrno = udp_sockerrno = tcp_sockerrno = sockets = 0;
+
+ address_family = -1;
+ int icmp_proto = IPPROTO_ICMP;
+
+ /* get calling name the old-fashioned way for portability instead
+ * of relying on the glibc-ism __progname */
+ ptr = strrchr(argv[0], '/');
+ if(ptr) progname = &ptr[1];
+ else progname = argv[0];
+
+ /* now set defaults. Use progname to set them initially (allows for
+ * superfast check_host program when target host is up */
+ cursor = list = NULL;
+ table = NULL;
+
+ mode = MODE_RTA;
+ /* Default critical thresholds */
+ crit.rta = 500000;
+ crit.pl = 80;
+ crit.jitter = 50;
+ crit.mos= 3;
+ crit.score=70;
+ /* Default warning thresholds */
+ warn.rta = 200000;
+ warn.pl = 40;
+ warn.jitter = 40;
+ warn.mos= 3.5;
+ warn.score=80;
+
+ protocols = HAVE_ICMP | HAVE_UDP | HAVE_TCP;
+ pkt_interval = 80000; /* 80 msec packet interval by default */
+ packets = 5;
+
+ if(!strcmp(progname, "check_icmp") || !strcmp(progname, "check_ping")) {
+ mode = MODE_ICMP;
+ protocols = HAVE_ICMP;
+ }
+ else if(!strcmp(progname, "check_host")) {
+ mode = MODE_HOSTCHECK;
+ pkt_interval = 1000000;
+ packets = 5;
+ crit.rta = warn.rta = 1000000;
+ crit.pl = warn.pl = 100;
+ }
+ else if(!strcmp(progname, "check_rta_multi")) {
+ mode = MODE_ALL;
+ target_interval = 0;
+ pkt_interval = 50000;
+ packets = 5;
+ }
+
+ /* support "--help" and "--version" */
+ if(argc == 2) {
+ if(!strcmp(argv[1], "--help"))
+ strcpy(argv[1], "-h");
+ if(!strcmp(argv[1], "--version"))
+ strcpy(argv[1], "-V");
+ }
+
+ /* Parse protocol arguments first */
+ for(i = 1; i < argc; i++) {
+ while((arg = getopt(argc, argv, opts_str)) != EOF) {
+ switch(arg) {
+ case '4':
+ if (address_family != -1)
+ crash("Multiple protocol versions not supported");
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ if (address_family != -1)
+ crash("Multiple protocol versions not supported");
+ address_family = AF_INET6;
+#else
+ usage (_("IPv6 support not available\n"));
+#endif
+ break;
+ }
+ }
+ }
+
+ /* Reset argument scanning */
+ optind = 1;
+
+ unsigned long size;
+ bool err;
+ /* parse the arguments */
+ for(i = 1; i < argc; i++) {
+ while((arg = getopt(argc, argv, opts_str)) != EOF) {
+ switch(arg) {
+ case 'v':
+ debug++;
+ break;
+ case 'b':
+ size = strtol(optarg,NULL,0);
+ if (size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) &&
+ size < MAX_PING_DATA) {
+ icmp_data_size = size;
+ icmp_pkt_size = size + ICMP_MINLEN;
+ } else
+ usage_va("ICMP data length must be between: %lu and %lu",
+ sizeof(struct icmp) + sizeof(struct icmp_ping_data),
+ MAX_PING_DATA - 1);
+ break;
+ case 'i':
+ pkt_interval = get_timevar(optarg);
+ break;
+ case 'I':
+ target_interval = get_timevar(optarg);
+ break;
+ case 'w':
+ get_threshold(optarg, &warn);
+ break;
+ case 'c':
+ get_threshold(optarg, &crit);
+ break;
+ case 'n':
+ case 'p':
+ packets = strtoul(optarg, NULL, 0);
+ break;
+ case 't':
+ timeout = strtoul(optarg, NULL, 0);
+ if(!timeout) timeout = 10;
+ break;
+ case 'H':
+ add_target(optarg);
+ break;
+ case 'l':
+ ttl = (int)strtoul(optarg, NULL, 0);
+ break;
+ case 'm':
+ min_hosts_alive = (int)strtoul(optarg, NULL, 0);
+ break;
+ case 'd': /* implement later, for cluster checks */
+ warn_down = (unsigned char)strtoul(optarg, &ptr, 0);
+ if(ptr) {
+ crit_down = (unsigned char)strtoul(ptr + 1, NULL, 0);
+ }
+ break;
+ case 's': /* specify source IP address */
+ source_ip = optarg;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ break;
+ case 'R': /* RTA mode */
+ err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_rta_mode);
+ if (!err) {
+ crash("Failed to parse RTA threshold");
+ }
+
+ rta_mode=true;
+ break;
+ case 'P': /* packet loss mode */
+ err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_packet_loss_mode);
+ if (!err) {
+ crash("Failed to parse packet loss threshold");
+ }
+
+ pl_mode=true;
+ break;
+ case 'J': /* jitter mode */
+ err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_jitter_mode);
+ if (!err) {
+ crash("Failed to parse jitter threshold");
+ }
+
+ jitter_mode=true;
+ break;
+ case 'M': /* MOS mode */
+ err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_mos_mode);
+ if (!err) {
+ crash("Failed to parse MOS threshold");
+ }
+
+ mos_mode=true;
+ break;
+ case 'S': /* score mode */
+ err = get_threshold2(optarg, strlen(optarg), &warn, &crit, const_score_mode);
+ if (!err) {
+ crash("Failed to parse score threshold");
+ }
+
+ score_mode=true;
+ break;
+ case 'O': /* out of order mode */
+ order_mode=true;
+ break;
+ }
+ }
+ }
+
+ /* POSIXLY_CORRECT might break things, so unset it (the portable way) */
+ environ = NULL;
+
+ /* use the pid to mark packets as ours */
+ /* Some systems have 32-bit pid_t so mask off only 16 bits */
+ pid = getpid() & 0xffff;
+ /* printf("pid = %u\n", pid); */
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts(&argc, argv, progname);
+
+ argv = &argv[optind];
+ while(*argv) {
+ add_target(*argv);
+ argv++;
+ }
+
+ if(!targets) {
+ errno = 0;
+ crash("No hosts to check");
+ }
+
+ // add_target might change address_family
+ switch ( address_family ){
+ case AF_INET: icmp_proto = IPPROTO_ICMP;
+ break;
+ case AF_INET6: icmp_proto = IPPROTO_ICMPV6;
+ break;
+ default: crash("Address family not supported");
+ }
+ if((icmp_sock = socket(address_family, SOCK_RAW, icmp_proto)) != -1)
+ sockets |= HAVE_ICMP;
+ else icmp_sockerrno = errno;
+
+ if( source_ip )
+ set_source_ip(source_ip);
+
+#ifdef SO_TIMESTAMP
+ if(setsockopt(icmp_sock, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on)))
+ if(debug) printf("Warning: no SO_TIMESTAMP support\n");
+#endif // SO_TIMESTAMP
+
+ /* now drop privileges (no effect if not setsuid or geteuid() == 0) */
+ if (setuid(getuid()) == -1) {
+ printf("ERROR: Failed to drop privileges\n");
+ return 1;
+ }
+
+ if(!sockets) {
+ if(icmp_sock == -1) {
+ errno = icmp_sockerrno;
+ crash("Failed to obtain ICMP socket");
+ return -1;
+ }
+ /* if(udp_sock == -1) { */
+ /* errno = icmp_sockerrno; */
+ /* crash("Failed to obtain UDP socket"); */
+ /* return -1; */
+ /* } */
+ /* if(tcp_sock == -1) { */
+ /* errno = icmp_sockerrno; */
+ /* crash("Failed to obtain TCP socker"); */
+ /* return -1; */
+ /* } */
+ }
+ if(!ttl) ttl = 64;
+
+ if(icmp_sock) {
+ result = setsockopt(icmp_sock, SOL_IP, IP_TTL, &ttl, sizeof(ttl));
+ if(debug) {
+ if(result == -1) printf("setsockopt failed\n");
+ else printf("ttl set to %u\n", ttl);
+ }
+ }
+
+ /* stupid users should be able to give whatever thresholds they want
+ * (nothing will break if they do), but some anal plugin maintainer
+ * will probably add some printf() thing here later, so it might be
+ * best to at least show them where to do it. ;) */
+ if(warn.pl > crit.pl) warn.pl = crit.pl;
+ if(warn.rta > crit.rta) warn.rta = crit.rta;
+ if(warn_down > crit_down) crit_down = warn_down;
+ if(warn.jitter > crit.jitter) crit.jitter = warn.jitter;
+ if(warn.mos < crit.mos) warn.mos = crit.mos;
+ if(warn.score < crit.score) warn.score = crit.score;
+
+#ifdef HAVE_SIGACTION
+ sig_action.sa_sigaction = NULL;
+ sig_action.sa_handler = finish;
+ sigfillset(&sig_action.sa_mask);
+ sig_action.sa_flags = SA_NODEFER|SA_RESTART;
+ sigaction(SIGINT, &sig_action, NULL);
+ sigaction(SIGHUP, &sig_action, NULL);
+ sigaction(SIGTERM, &sig_action, NULL);
+ sigaction(SIGALRM, &sig_action, NULL);
+#else /* HAVE_SIGACTION */
+ signal(SIGINT, finish);
+ signal(SIGHUP, finish);
+ signal(SIGTERM, finish);
+ signal(SIGALRM, finish);
+#endif /* HAVE_SIGACTION */
+ if(debug) printf("Setting alarm timeout to %u seconds\n", timeout);
+ alarm(timeout);
+
+ /* make sure we don't wait any longer than necessary */
+ gettimeofday(&prog_start, &tz);
+ max_completion_time =
+ ((targets * packets * pkt_interval) + (targets * target_interval)) +
+ (targets * packets * crit.rta) + crit.rta;
+
+ if(debug) {
+ printf("packets: %u, targets: %u\n"
+ "target_interval: %0.3f, pkt_interval %0.3f\n"
+ "crit.rta: %0.3f\n"
+ "max_completion_time: %0.3f\n",
+ packets, targets,
+ (float)target_interval / 1000, (float)pkt_interval / 1000,
+ (float)crit.rta / 1000,
+ (float)max_completion_time / 1000);
+ }
+
+ if(debug) {
+ if(max_completion_time > (u_int)timeout * 1000000) {
+ printf("max_completion_time: %llu timeout: %u\n",
+ max_completion_time, timeout);
+ printf("Timeout must be at least %llu\n",
+ max_completion_time / 1000000 + 1);
+ }
+ }
+
+ if(debug) {
+ printf("crit = {%u, %u%%}, warn = {%u, %u%%}\n",
+ crit.rta, crit.pl, warn.rta, warn.pl);
+ printf("pkt_interval: %u target_interval: %u retry_interval: %u\n",
+ pkt_interval, target_interval, retry_interval);
+ printf("icmp_pkt_size: %u timeout: %u\n",
+ icmp_pkt_size, timeout);
+ }
+
+ if(packets > 20) {
+ errno = 0;
+ crash("packets is > 20 (%d)", packets);
+ }
+
+ if(min_hosts_alive < -1) {
+ errno = 0;
+ crash("minimum alive hosts is negative (%i)", min_hosts_alive);
+ }
+
+ host = list;
+ table = malloc(sizeof(struct rta_host *) * targets);
+ if(!table) {
+ crash("main(): malloc failed for host table");
+ }
+
+ i = 0;
+ while(host) {
+ host->id = i*packets;
+ table[i] = host;
+ host = host->next;
+ i++;
+ }
+
+ run_checks();
+
+ errno = 0;
+ finish(0);
+
+ return(0);
+}
+
+static void
+run_checks()
+{
+ u_int i, t;
+ u_int final_wait, time_passed;
+
+ /* this loop might actually violate the pkt_interval or target_interval
+ * settings, but only if there aren't any packets on the wire which
+ * indicates that the target can handle an increased packet rate */
+ for(i = 0; i < packets; i++) {
+ for(t = 0; t < targets; t++) {
+ /* don't send useless packets */
+ if(!targets_alive) finish(0);
+ if(table[t]->flags & FLAG_LOST_CAUSE) {
+ if(debug) printf("%s is a lost cause. not sending any more\n",
+ table[t]->name);
+ continue;
+ }
+
+ /* we're still in the game, so send next packet */
+ (void)send_icmp_ping(icmp_sock, table[t]);
+ wait_for_reply(icmp_sock, target_interval);
+ }
+ wait_for_reply(icmp_sock, pkt_interval * targets);
+ }
+
+ if(icmp_pkts_en_route && targets_alive) {
+ time_passed = get_timevaldiff(NULL, NULL);
+ final_wait = max_completion_time - time_passed;
+
+ if(debug) {
+ printf("time_passed: %u final_wait: %u max_completion_time: %llu\n",
+ time_passed, final_wait, max_completion_time);
+ }
+ if(time_passed > max_completion_time) {
+ if(debug) printf("Time passed. Finishing up\n");
+ finish(0);
+ }
+
+ /* catch the packets that might come in within the timeframe, but
+ * haven't yet */
+ if(debug) printf("Waiting for %u micro-seconds (%0.3f msecs)\n",
+ final_wait, (float)final_wait / 1000);
+ wait_for_reply(icmp_sock, final_wait);
+ }
+}
+
+
+/* response structure:
+ * IPv4:
+ * ip header : 20 bytes
+ * icmp header : 28 bytes
+ * IPv6:
+ * ip header : 40 bytes
+ * icmp header : 28 bytes
+ * both:
+ * icmp echo reply : the rest
+ */
+static int
+wait_for_reply(int sock, u_int t)
+{
+ int n, hlen;
+ static unsigned char buf[65536];
+ struct sockaddr_storage resp_addr;
+ union ip_hdr *ip;
+ union icmp_packet packet;
+ struct rta_host *host;
+ struct icmp_ping_data data;
+ struct timeval wait_start, now;
+ u_int tdiff, i, per_pkt_wait;
+ double jitter_tmp;
+
+ if (!(packet.buf = malloc(icmp_pkt_size))) {
+ crash("send_icmp_ping(): failed to malloc %d bytes for send buffer",
+ icmp_pkt_size);
+ return -1; /* might be reached if we're in debug mode */
+ }
+
+ memset(packet.buf, 0, icmp_pkt_size);
+
+ /* if we can't listen or don't have anything to listen to, just return */
+ if(!t || !icmp_pkts_en_route) {
+ free(packet.buf);
+ return 0;
+ }
+
+ gettimeofday(&wait_start, &tz);
+
+ i = t;
+ per_pkt_wait = t / icmp_pkts_en_route;
+ while(icmp_pkts_en_route && get_timevaldiff(&wait_start, NULL) < i) {
+ t = per_pkt_wait;
+
+ /* wrap up if all targets are declared dead */
+ if(!targets_alive ||
+ get_timevaldiff(&prog_start, NULL) >= max_completion_time ||
+ (mode == MODE_HOSTCHECK && targets_down))
+ {
+ finish(0);
+ }
+
+ /* reap responses until we hit a timeout */
+ n = recvfrom_wto(sock, buf, sizeof(buf),
+ (struct sockaddr *)&resp_addr, &t, &now);
+ if(!n) {
+ if(debug > 1) {
+ printf("recvfrom_wto() timed out during a %u usecs wait\n",
+ per_pkt_wait);
+ }
+ continue; /* timeout for this one, so keep trying */
+ }
+ if(n < 0) {
+ if(debug) printf("recvfrom_wto() returned errors\n");
+ free(packet.buf);
+ return n;
+ }
+
+ // FIXME: with ipv6 we don't have an ip header here
+ if (address_family != AF_INET6) {
+ ip = (union ip_hdr *)buf;
+
+ if(debug > 1) {
+ char address[INET6_ADDRSTRLEN];
+ parse_address(&resp_addr, address, sizeof(address));
+ printf("received %u bytes from %s\n",
+ address_family == AF_INET6 ? ntohs(ip->ip6.ip6_plen)
+ : ntohs(ip->ip.ip_len),
+ address);
+ }
+ }
+
+/* obsolete. alpha on tru64 provides the necessary defines, but isn't broken */
+/* #if defined( __alpha__ ) && __STDC__ && !defined( __GLIBC__ ) */
+ /* alpha headers are decidedly broken. Using an ansi compiler,
+ * they provide ip_vhl instead of ip_hl and ip_v, so we mask
+ * off the bottom 4 bits */
+/* hlen = (ip->ip_vhl & 0x0f) << 2; */
+/* #else */
+ hlen = (address_family == AF_INET6) ? 0 : ip->ip.ip_hl << 2;
+/* #endif */
+
+ if(n < (hlen + ICMP_MINLEN)) {
+ char address[INET6_ADDRSTRLEN];
+ parse_address(&resp_addr, address, sizeof(address));
+ crash("received packet too short for ICMP (%d bytes, expected %d) from %s\n",
+ n, hlen + icmp_pkt_size, address);
+ }
+ /* else if(debug) { */
+ /* printf("ip header size: %u, packet size: %u (expected %u, %u)\n", */
+ /* hlen, ntohs(ip->ip_len) - hlen, */
+ /* sizeof(struct ip), icmp_pkt_size); */
+ /* } */
+
+ /* check the response */
+
+ memcpy(packet.buf, buf + hlen, icmp_pkt_size);
+/* address_family == AF_INET6 ? sizeof(struct icmp6_hdr)
+ : sizeof(struct icmp));*/
+
+ if( (address_family == PF_INET &&
+ (ntohs(packet.icp->icmp_id) != pid || packet.icp->icmp_type != ICMP_ECHOREPLY
+ || ntohs(packet.icp->icmp_seq) >= targets * packets))
+ || (address_family == PF_INET6 &&
+ (ntohs(packet.icp6->icmp6_id) != pid || packet.icp6->icmp6_type != ICMP6_ECHO_REPLY
+ || ntohs(packet.icp6->icmp6_seq) >= targets * packets))) {
+ if(debug > 2) printf("not a proper ICMP_ECHOREPLY\n");
+ handle_random_icmp(buf + hlen, &resp_addr);
+ continue;
+ }
+
+ /* this is indeed a valid response */
+ if (address_family == PF_INET) {
+ memcpy(&data, packet.icp->icmp_data, sizeof(data));
+ if (debug > 2)
+ printf("ICMP echo-reply of len %lu, id %u, seq %u, cksum 0x%X\n",
+ (unsigned long)sizeof(data), ntohs(packet.icp->icmp_id),
+ ntohs(packet.icp->icmp_seq), packet.icp->icmp_cksum);
+ host = table[ntohs(packet.icp->icmp_seq)/packets];
+ } else {
+ memcpy(&data, &packet.icp6->icmp6_dataun.icmp6_un_data8[4], sizeof(data));
+ if (debug > 2)
+ printf("ICMP echo-reply of len %lu, id %u, seq %u, cksum 0x%X\n",
+ (unsigned long)sizeof(data), ntohs(packet.icp6->icmp6_id),
+ ntohs(packet.icp6->icmp6_seq), packet.icp6->icmp6_cksum);
+ host = table[ntohs(packet.icp6->icmp6_seq)/packets];
+ }
+
+ tdiff = get_timevaldiff(&data.stime, &now);
+
+ if (host->last_tdiff>0) {
+ /* Calculate jitter */
+ if (host->last_tdiff > tdiff) {
+ jitter_tmp = host->last_tdiff - tdiff;
+ } else {
+ jitter_tmp = tdiff - host->last_tdiff;
+ }
+
+ if (host->jitter==0) {
+ host->jitter=jitter_tmp;
+ host->jitter_max=jitter_tmp;
+ host->jitter_min=jitter_tmp;
+ } else {
+ host->jitter+=jitter_tmp;
+
+ if (jitter_tmp < host->jitter_min) {
+ host->jitter_min=jitter_tmp;
+ }
+
+ if (jitter_tmp > host->jitter_max) {
+ host->jitter_max=jitter_tmp;
+ }
+ }
+
+ /* Check if packets in order */
+ if (host->last_icmp_seq >= packet.icp->icmp_seq)
+ host->order_status=STATE_CRITICAL;
+ }
+ host->last_tdiff=tdiff;
+
+ host->last_icmp_seq=packet.icp->icmp_seq;
+
+ host->time_waited += tdiff;
+ host->icmp_recv++;
+ icmp_recv++;
+ if (tdiff > (unsigned int)host->rtmax)
+ host->rtmax = tdiff;
+ if (tdiff < (unsigned int)host->rtmin)
+ host->rtmin = tdiff;
+
+ if(debug) {
+ char address[INET6_ADDRSTRLEN];
+ parse_address(&resp_addr, address, sizeof(address));
+
+ switch(address_family) {
+ case AF_INET: {
+ printf("%0.3f ms rtt from %s, outgoing ttl: %u, incoming ttl: %u, max: %0.3f, min: %0.3f\n",
+ (float)tdiff / 1000,
+ address,
+ ttl,
+ ip->ip.ip_ttl,
+ (float)host->rtmax / 1000,
+ (float)host->rtmin / 1000);
+ break;
+ };
+ case AF_INET6: {
+ printf("%0.3f ms rtt from %s, outgoing ttl: %u, max: %0.3f, min: %0.3f\n",
+ (float)tdiff / 1000,
+ address,
+ ttl,
+ (float)host->rtmax / 1000,
+ (float)host->rtmin / 1000);
+ };
+ }
+ }
+
+ /* if we're in hostcheck mode, exit with limited printouts */
+ if(mode == MODE_HOSTCHECK) {
+ printf("OK - %s responds to ICMP. Packet %u, rta %0.3fms|"
+ "pkt=%u;;;0;%u rta=%0.3f;%0.3f;%0.3f;;\n",
+ host->name, icmp_recv, (float)tdiff / 1000,
+ icmp_recv, packets, (float)tdiff / 1000,
+ (float)warn.rta / 1000, (float)crit.rta / 1000);
+ exit(STATE_OK);
+ }
+ }
+
+ free(packet.buf);
+ return 0;
+}
+
+/* the ping functions */
+static int
+send_icmp_ping(int sock, struct rta_host *host)
+{
+ long int len;
+ size_t addrlen;
+ struct icmp_ping_data data;
+ struct msghdr hdr;
+ struct iovec iov;
+ struct timeval tv;
+ void *buf = NULL;
+
+ if(sock == -1) {
+ errno = 0;
+ crash("Attempt to send on bogus socket");
+ return -1;
+ }
+
+ if(!buf) {
+ if (!(buf = malloc(icmp_pkt_size))) {
+ crash("send_icmp_ping(): failed to malloc %d bytes for send buffer",
+ icmp_pkt_size);
+ return -1; /* might be reached if we're in debug mode */
+ }
+ }
+ memset(buf, 0, icmp_pkt_size);
+
+ if((gettimeofday(&tv, &tz)) == -1) {
+ free(buf);
+ return -1;
+ }
+
+ data.ping_id = 10; /* host->icmp.icmp_sent; */
+ memcpy(&data.stime, &tv, sizeof(tv));
+
+ if (address_family == AF_INET) {
+ struct icmp *icp = (struct icmp*)buf;
+ addrlen = sizeof(struct sockaddr_in);
+
+ memcpy(&icp->icmp_data, &data, sizeof(data));
+
+ icp->icmp_type = ICMP_ECHO;
+ icp->icmp_code = 0;
+ icp->icmp_cksum = 0;
+ icp->icmp_id = htons(pid);
+ icp->icmp_seq = htons(host->id++);
+ icp->icmp_cksum = icmp_checksum((uint16_t*)buf, (size_t)icmp_pkt_size);
+
+ if (debug > 2)
+ printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n",
+ (unsigned long)sizeof(data), ntohs(icp->icmp_id), ntohs(icp->icmp_seq), icp->icmp_cksum, host->name);
+ }
+ else {
+ struct icmp6_hdr *icp6 = (struct icmp6_hdr*)buf;
+ addrlen = sizeof(struct sockaddr_in6);
+
+ memcpy(&icp6->icmp6_dataun.icmp6_un_data8[4], &data, sizeof(data));
+
+ icp6->icmp6_type = ICMP6_ECHO_REQUEST;
+ icp6->icmp6_code = 0;
+ icp6->icmp6_cksum = 0;
+ icp6->icmp6_id = htons(pid);
+ icp6->icmp6_seq = htons(host->id++);
+ // let checksum be calculated automatically
+
+ if (debug > 2) {
+ printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n",
+ (unsigned long)sizeof(data), ntohs(icp6->icmp6_id),
+ ntohs(icp6->icmp6_seq), icp6->icmp6_cksum, host->name);
+ }
+ }
+
+ memset(&iov, 0, sizeof(iov));
+ iov.iov_base = buf;
+ iov.iov_len = icmp_pkt_size;
+
+ memset(&hdr, 0, sizeof(hdr));
+ hdr.msg_name = (struct sockaddr *)&host->saddr_in;
+ hdr.msg_namelen = addrlen;
+ hdr.msg_iov = &iov;
+ hdr.msg_iovlen = 1;
+
+ errno = 0;
+
+/* MSG_CONFIRM is a linux thing and only available on linux kernels >= 2.3.15, see send(2) */
+#ifdef MSG_CONFIRM
+ len = sendmsg(sock, &hdr, MSG_CONFIRM);
+#else
+ len = sendmsg(sock, &hdr, 0);
+#endif
+
+ free(buf);
+
+ if(len < 0 || (unsigned int)len != icmp_pkt_size) {
+ if(debug) {
+ char address[INET6_ADDRSTRLEN];
+ parse_address((struct sockaddr_storage *)&host->saddr_in, address, sizeof(address));
+ printf("Failed to send ping to %s: %s\n", address, strerror(errno));
+ }
+ errno = 0;
+ return -1;
+ }
+
+ icmp_sent++;
+ host->icmp_sent++;
+
+ return 0;
+}
+
+static int
+recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr,
+ u_int *timo, struct timeval* tv)
+{
+ u_int slen;
+ int n, ret;
+ struct timeval to, then, now;
+ fd_set rd, wr;
+#ifdef HAVE_MSGHDR_MSG_CONTROL
+ char ans_data[4096];
+#endif // HAVE_MSGHDR_MSG_CONTROL
+ struct msghdr hdr;
+ struct iovec iov;
+#ifdef SO_TIMESTAMP
+ struct cmsghdr* chdr;
+#endif
+
+ if(!*timo) {
+ if(debug) printf("*timo is not\n");
+ return 0;
+ }
+
+ to.tv_sec = *timo / 1000000;
+ to.tv_usec = (*timo - (to.tv_sec * 1000000));
+
+ FD_ZERO(&rd);
+ FD_ZERO(&wr);
+ FD_SET(sock, &rd);
+ errno = 0;
+ gettimeofday(&then, &tz);
+ n = select(sock + 1, &rd, &wr, NULL, &to);
+ if(n < 0) crash("select() in recvfrom_wto");
+ gettimeofday(&now, &tz);
+ *timo = get_timevaldiff(&then, &now);
+
+ if(!n) return 0; /* timeout */
+
+ slen = sizeof(struct sockaddr_storage);
+
+ memset(&iov, 0, sizeof(iov));
+ iov.iov_base = buf;
+ iov.iov_len = len;
+
+ memset(&hdr, 0, sizeof(hdr));
+ hdr.msg_name = saddr;
+ hdr.msg_namelen = slen;
+ hdr.msg_iov = &iov;
+ hdr.msg_iovlen = 1;
+#ifdef HAVE_MSGHDR_MSG_CONTROL
+ hdr.msg_control = ans_data;
+ hdr.msg_controllen = sizeof(ans_data);
+#endif
+
+ ret = recvmsg(sock, &hdr, 0);
+#ifdef SO_TIMESTAMP
+ for(chdr = CMSG_FIRSTHDR(&hdr); chdr; chdr = CMSG_NXTHDR(&hdr, chdr)) {
+ if(chdr->cmsg_level == SOL_SOCKET
+ && chdr->cmsg_type == SO_TIMESTAMP
+ && chdr->cmsg_len >= CMSG_LEN(sizeof(struct timeval))) {
+ memcpy(tv, CMSG_DATA(chdr), sizeof(*tv));
+ break ;
+ }
+ }
+
+ if (!chdr)
+#endif // SO_TIMESTAMP
+ gettimeofday(tv, &tz);
+ return (ret);
+}
+
+static void
+finish(int sig)
+{
+ u_int i = 0;
+ unsigned char pl;
+ double rta;
+ struct rta_host *host;
+ const char *status_string[] =
+ {"OK", "WARNING", "CRITICAL", "UNKNOWN", "DEPENDENT"};
+ int hosts_ok = 0;
+ int hosts_warn = 0;
+ int this_status;
+ double R;
+
+ alarm(0);
+ if(debug > 1) printf("finish(%d) called\n", sig);
+
+ if(icmp_sock != -1) close(icmp_sock);
+ if(udp_sock != -1) close(udp_sock);
+ if(tcp_sock != -1) close(tcp_sock);
+
+ if(debug) {
+ printf("icmp_sent: %u icmp_recv: %u icmp_lost: %u\n",
+ icmp_sent, icmp_recv, icmp_lost);
+ printf("targets: %u targets_alive: %u\n", targets, targets_alive);
+ }
+
+ /* iterate thrice to calculate values, give output, and print perfparse */
+ status=STATE_OK;
+ host = list;
+
+ while(host) {
+ this_status = STATE_OK;
+
+ if(!host->icmp_recv) {
+ /* rta 0 is ofcourse not entirely correct, but will still show up
+ * conspicuously as missing entries in perfparse and cacti */
+ pl = 100;
+ rta = 0;
+ status = STATE_CRITICAL;
+ /* up the down counter if not already counted */
+ if(!(host->flags & FLAG_LOST_CAUSE) && targets_alive) targets_down++;
+ } else {
+ pl = ((host->icmp_sent - host->icmp_recv) * 100) / host->icmp_sent;
+ rta = (double)host->time_waited / host->icmp_recv;
+ }
+
+ if (host->icmp_recv>1) {
+ /*
+ * This algorithm is probably pretty much blindly copied from
+ * locations like this one: https://www.slac.stanford.edu/comp/net/wan-mon/tutorial.html#mos
+ * It calculates a MOS value (range of 1 to 5, where 1 is bad and 5 really good).
+ * According to some quick research MOS originates from the Audio/Video transport network area.
+ * Whether it can and should be computed from ICMP data, I can not say.
+ *
+ * Anyway the basic idea is to map a value "R" with a range of 0-100 to the MOS value
+ *
+ * MOS stands likely for Mean Opinion Score ( https://en.wikipedia.org/wiki/Mean_Opinion_Score )
+ *
+ * More links:
+ * - https://confluence.slac.stanford.edu/display/IEPM/MOS
+ */
+ host->jitter=(host->jitter / (host->icmp_recv - 1)/1000);
+
+ /*
+ * Take the average round trip latency (in milliseconds), add
+ * round trip jitter, but double the impact to latency
+ * then add 10 for protocol latencies (in milliseconds).
+ */
+ host->EffectiveLatency = (rta/1000) + host->jitter * 2 + 10;
+
+ if (host->EffectiveLatency < 160) {
+ R = 93.2 - (host->EffectiveLatency / 40);
+ } else {
+ R = 93.2 - ((host->EffectiveLatency - 120) / 10);
+ }
+
+ // Now, let us deduct 2.5 R values per percentage of packet loss (i.e. a
+ // loss of 5% will be entered as 5).
+ R = R - (pl * 2.5);
+
+ if (R < 0) {
+ R = 0;
+ }
+
+ host->score = R;
+ host->mos= 1 + ((0.035) * R) + ((.000007) * R * (R-60) * (100-R));
+ } else {
+ host->jitter=0;
+ host->jitter_min=0;
+ host->jitter_max=0;
+ host->mos=0;
+ }
+
+ host->pl = pl;
+ host->rta = rta;
+
+ /* if no new mode selected, use old schema */
+ if (!rta_mode && !pl_mode && !jitter_mode && !score_mode && !mos_mode && !order_mode) {
+ rta_mode = true;
+ pl_mode = true;
+ }
+
+ /* Check which mode is on and do the warn / Crit stuff */
+ if (rta_mode) {
+ if(rta >= crit.rta) {
+ this_status = STATE_CRITICAL;
+ status = STATE_CRITICAL;
+ host->rta_status=STATE_CRITICAL;
+ } else if(status!=STATE_CRITICAL && (rta >= warn.rta)) {
+ this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
+ status = STATE_WARNING;
+ host->rta_status=STATE_WARNING;
+ }
+ }
+
+ if (pl_mode) {
+ if(pl >= crit.pl) {
+ this_status = STATE_CRITICAL;
+ status = STATE_CRITICAL;
+ host->pl_status=STATE_CRITICAL;
+ } else if(status!=STATE_CRITICAL && (pl >= warn.pl)) {
+ this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
+ status = STATE_WARNING;
+ host->pl_status=STATE_WARNING;
+ }
+ }
+
+ if (jitter_mode) {
+ if(host->jitter >= crit.jitter) {
+ this_status = STATE_CRITICAL;
+ status = STATE_CRITICAL;
+ host->jitter_status=STATE_CRITICAL;
+ } else if(status!=STATE_CRITICAL && (host->jitter >= warn.jitter)) {
+ this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
+ status = STATE_WARNING;
+ host->jitter_status=STATE_WARNING;
+ }
+ }
+
+ if (mos_mode) {
+ if(host->mos <= crit.mos) {
+ this_status = STATE_CRITICAL;
+ status = STATE_CRITICAL;
+ host->mos_status=STATE_CRITICAL;
+ } else if(status!=STATE_CRITICAL && (host->mos <= warn.mos)) {
+ this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
+ status = STATE_WARNING;
+ host->mos_status=STATE_WARNING;
+ }
+ }
+
+ if (score_mode) {
+ if(host->score <= crit.score) {
+ this_status = STATE_CRITICAL;
+ status = STATE_CRITICAL;
+ host->score_status=STATE_CRITICAL;
+ } else if(status!=STATE_CRITICAL && (host->score <= warn.score)) {
+ this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status);
+ status = STATE_WARNING;
+ host->score_status=STATE_WARNING;
+ }
+ }
+
+ if (this_status == STATE_WARNING) {
+ hosts_warn++;
+ } else if (this_status == STATE_OK) {
+ hosts_ok++;
+ }
+
+ host = host->next;
+ }
+
+
+ /* this is inevitable */
+ if(!targets_alive) status = STATE_CRITICAL;
+ if(min_hosts_alive > -1) {
+ if(hosts_ok >= min_hosts_alive) status = STATE_OK;
+ else if((hosts_ok + hosts_warn) >= min_hosts_alive) status = STATE_WARNING;
+ }
+ printf("%s - ", status_string[status]);
+
+ host = list;
+ while(host) {
+
+ if(debug) puts("");
+ if(i) {
+ if(i < targets) printf(" :: ");
+ else printf("\n");
+ }
+ i++;
+ if(!host->icmp_recv) {
+ status = STATE_CRITICAL;
+ host->rtmin=0;
+ host->jitter_min=0;
+ if(host->flags & FLAG_LOST_CAUSE) {
+ char address[INET6_ADDRSTRLEN];
+ parse_address(&host->error_addr, address, sizeof(address));
+ printf("%s: %s @ %s. rta nan, lost %d%%",
+ host->name,
+ get_icmp_error_msg(host->icmp_type, host->icmp_code),
+ address,
+ 100);
+ } else { /* not marked as lost cause, so we have no flags for it */
+ printf("%s: rta nan, lost 100%%", host->name);
+ }
+ } else { /* !icmp_recv */
+ printf("%s", host->name);
+ /* rta text output */
+ if (rta_mode) {
+ if (status == STATE_OK)
+ printf(" rta %0.3fms", host->rta / 1000);
+ else if (status==STATE_WARNING && host->rta_status==status)
+ printf(" rta %0.3fms > %0.3fms", (float)host->rta / 1000, (float)warn.rta/1000);
+ else if (status==STATE_CRITICAL && host->rta_status==status)
+ printf(" rta %0.3fms > %0.3fms", (float)host->rta / 1000, (float)crit.rta/1000);
+ }
+ /* pl text output */
+ if (pl_mode) {
+ if (status == STATE_OK)
+ printf(" lost %u%%", host->pl);
+ else if (status==STATE_WARNING && host->pl_status==status)
+ printf(" lost %u%% > %u%%", host->pl, warn.pl);
+ else if (status==STATE_CRITICAL && host->pl_status==status)
+ printf(" lost %u%% > %u%%", host->pl, crit.pl);
+ }
+ /* jitter text output */
+ if (jitter_mode) {
+ if (status == STATE_OK)
+ printf(" jitter %0.3fms", (float)host->jitter);
+ else if (status==STATE_WARNING && host->jitter_status==status)
+ printf(" jitter %0.3fms > %0.3fms", (float)host->jitter, warn.jitter);
+ else if (status==STATE_CRITICAL && host->jitter_status==status)
+ printf(" jitter %0.3fms > %0.3fms", (float)host->jitter, crit.jitter);
+ }
+ /* mos text output */
+ if (mos_mode) {
+ if (status == STATE_OK)
+ printf(" MOS %0.1f", (float)host->mos);
+ else if (status==STATE_WARNING && host->mos_status==status)
+ printf(" MOS %0.1f < %0.1f", (float)host->mos, (float)warn.mos);
+ else if (status==STATE_CRITICAL && host->mos_status==status)
+ printf(" MOS %0.1f < %0.1f", (float)host->mos, (float)crit.mos);
+ }
+ /* score text output */
+ if (score_mode) {
+ if (status == STATE_OK)
+ printf(" Score %u", (int)host->score);
+ else if (status==STATE_WARNING && host->score_status==status )
+ printf(" Score %u < %u", (int)host->score, (int)warn.score);
+ else if (status==STATE_CRITICAL && host->score_status==status )
+ printf(" Score %u < %u", (int)host->score, (int)crit.score);
+ }
+ /* order statis text output */
+ if (order_mode) {
+ if (status == STATE_OK)
+ printf(" Packets in order");
+ else if (status==STATE_CRITICAL && host->order_status==status)
+ printf(" Packets out of order");
+ }
+ }
+ host = host->next;
+ }
+
+ /* iterate once more for pretty perfparse output */
+ if (!(!rta_mode && !pl_mode && !jitter_mode && !score_mode && !mos_mode && order_mode)) {
+ printf("|");
+ }
+ i = 0;
+ host = list;
+ while(host) {
+ if(debug) puts("");
+
+ if (rta_mode && host->pl<100) {
+ printf("%srta=%0.3fms;%0.3f;%0.3f;0; %srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ",
+ (targets > 1) ? host->name : "",
+ host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000,
+ (targets > 1) ? host->name : "", (float)host->rtmax / 1000,
+ (targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0);
+ }
+
+ if (pl_mode) {
+ printf("%spl=%u%%;%u;%u;0;100 ", (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl);
+ }
+
+ if (jitter_mode && host->pl<100) {
+ printf("%sjitter_avg=%0.3fms;%0.3f;%0.3f;0; %sjitter_max=%0.3fms;;;; %sjitter_min=%0.3fms;;;; ",
+ (targets > 1) ? host->name : "",
+ (float)host->jitter,
+ (float)warn.jitter,
+ (float)crit.jitter,
+ (targets > 1) ? host->name : "",
+ (float)host->jitter_max / 1000, (targets > 1) ? host->name : "",
+ (float)host->jitter_min / 1000
+ );
+ }
+
+ if (mos_mode && host->pl<100) {
+ printf("%smos=%0.1f;%0.1f;%0.1f;0;5 ",
+ (targets > 1) ? host->name : "",
+ (float)host->mos,
+ (float)warn.mos,
+ (float)crit.mos
+ );
+ }
+
+ if (score_mode && host->pl<100) {
+ printf("%sscore=%u;%u;%u;0;100 ",
+ (targets > 1) ? host->name : "",
+ (int)host->score,
+ (int)warn.score,
+ (int)crit.score
+ );
+ }
+
+ host = host->next;
+ }
+
+ if(min_hosts_alive > -1) {
+ if(hosts_ok >= min_hosts_alive) status = STATE_OK;
+ else if((hosts_ok + hosts_warn) >= min_hosts_alive) status = STATE_WARNING;
+ }
+
+ /* finish with an empty line */
+ puts("");
+ if(debug) printf("targets: %u, targets_alive: %u, hosts_ok: %u, hosts_warn: %u, min_hosts_alive: %i\n",
+ targets, targets_alive, hosts_ok, hosts_warn, min_hosts_alive);
+
+ exit(status);
+}
+
+static u_int
+get_timevaldiff(struct timeval *early, struct timeval *later)
+{
+ u_int ret;
+ struct timeval now;
+
+ if(!later) {
+ gettimeofday(&now, &tz);
+ later = &now;
+ }
+ if(!early) early = &prog_start;
+
+ /* if early > later we return 0 so as to indicate a timeout */
+ if(early->tv_sec > later->tv_sec ||
+ (early->tv_sec == later->tv_sec && early->tv_usec > later->tv_usec))
+ {
+ return 0;
+ }
+ ret = (later->tv_sec - early->tv_sec) * 1000000;
+ ret += later->tv_usec - early->tv_usec;
+
+ return ret;
+}
+
+static int
+add_target_ip(char *arg, struct sockaddr_storage *in)
+{
+ struct rta_host *host;
+ struct sockaddr_in *sin, *host_sin;
+ struct sockaddr_in6 *sin6, *host_sin6;
+
+ if (address_family == AF_INET)
+ sin = (struct sockaddr_in *)in;
+ else
+ sin6 = (struct sockaddr_in6 *)in;
+
+
+
+ /* disregard obviously stupid addresses
+ * (I didn't find an ipv6 equivalent to INADDR_NONE) */
+ if (((address_family == AF_INET && (sin->sin_addr.s_addr == INADDR_NONE
+ || sin->sin_addr.s_addr == INADDR_ANY)))
+ || (address_family == AF_INET6 && (sin6->sin6_addr.s6_addr == in6addr_any.s6_addr))) {
+ return -1;
+ }
+
+ /* no point in adding two identical IP's, so don't. ;) */
+ host = list;
+ while(host) {
+ host_sin = (struct sockaddr_in *)&host->saddr_in;
+ host_sin6 = (struct sockaddr_in6 *)&host->saddr_in;
+
+ if( (address_family == AF_INET && host_sin->sin_addr.s_addr == sin->sin_addr.s_addr)
+ || (address_family == AF_INET6 && host_sin6->sin6_addr.s6_addr == sin6->sin6_addr.s6_addr)) {
+ if(debug) printf("Identical IP already exists. Not adding %s\n", arg);
+ return -1;
+ }
+ host = host->next;
+ }
+
+ /* add the fresh ip */
+ host = (struct rta_host*)malloc(sizeof(struct rta_host));
+ if(!host) {
+ char straddr[INET6_ADDRSTRLEN];
+ parse_address((struct sockaddr_storage*)&in, straddr, sizeof(straddr));
+ crash("add_target_ip(%s, %s): malloc(%lu) failed",
+ arg, straddr, sizeof(struct rta_host));
+ }
+ memset(host, 0, sizeof(struct rta_host));
+
+ /* set the values. use calling name for output */
+ host->name = strdup(arg);
+
+
+ /* fill out the sockaddr_storage struct */
+ if(address_family == AF_INET) {
+ host_sin = (struct sockaddr_in *)&host->saddr_in;
+ host_sin->sin_family = AF_INET;
+ host_sin->sin_addr.s_addr = sin->sin_addr.s_addr;
+ }
+ else {
+ host_sin6 = (struct sockaddr_in6 *)&host->saddr_in;
+ host_sin6->sin6_family = AF_INET6;
+ memcpy(host_sin6->sin6_addr.s6_addr, sin6->sin6_addr.s6_addr, sizeof host_sin6->sin6_addr.s6_addr);
+ }
+
+ /* fill out the sockaddr_in struct */
+ host->rtmin = INFINITY;
+ host->rtmax = 0;
+ host->jitter=0;
+ host->jitter_max=0;
+ host->jitter_min=INFINITY;
+ host->last_tdiff=0;
+ host->order_status=STATE_OK;
+ host->last_icmp_seq=0;
+ host->rta_status=0;
+ host->pl_status=0;
+ host->jitter_status=0;
+ host->mos_status=0;
+ host->score_status=0;
+ host->pl_status=0;
+
+
+ if(!list) list = cursor = host;
+ else cursor->next = host;
+
+ cursor = host;
+ targets++;
+
+ return 0;
+}
+
+/* wrapper for add_target_ip */
+static int
+add_target(char *arg)
+{
+ int error, result = -1;
+ struct sockaddr_storage ip;
+ struct addrinfo hints, *res, *p;
+ struct sockaddr_in *sin;
+ struct sockaddr_in6 *sin6;
+
+ switch (address_family) {
+ case -1:
+ /* -4 and -6 are not specified on cmdline */
+ address_family = AF_INET;
+ sin = (struct sockaddr_in *)&ip;
+ result = inet_pton(address_family, arg, &sin->sin_addr);
+#ifdef USE_IPV6
+ if( result != 1 ){
+ address_family = AF_INET6;
+ sin6 = (struct sockaddr_in6 *)&ip;
+ result = inet_pton(address_family, arg, &sin6->sin6_addr);
+ }
+#endif
+ /* If we don't find any valid addresses, we still don't know the address_family */
+ if ( result != 1) {
+ address_family = -1;
+ }
+ break;
+ case AF_INET:
+ sin = (struct sockaddr_in *)&ip;
+ result = inet_pton(address_family, arg, &sin->sin_addr);
+ break;
+ case AF_INET6:
+ sin6 = (struct sockaddr_in6 *)&ip;
+ result = inet_pton(address_family, arg, &sin6->sin6_addr);
+ break;
+ default: crash("Address family not supported");
+ }
+
+ /* don't resolve if we don't have to */
+ if(result == 1) {
+ /* don't add all ip's if we were given a specific one */
+ return add_target_ip(arg, &ip);
+ }
+ else {
+ errno = 0;
+ memset(&hints, 0, sizeof(hints));
+ if (address_family == -1) {
+ hints.ai_family = AF_UNSPEC;
+ } else {
+ hints.ai_family = address_family == AF_INET ? PF_INET : PF_INET6;
+ }
+ hints.ai_socktype = SOCK_RAW;
+ if((error = getaddrinfo(arg, NULL, &hints, &res)) != 0) {
+ errno = 0;
+ crash("Failed to resolve %s: %s", arg, gai_strerror(error));
+ return -1;
+ }
+ address_family = res->ai_family;
+ }
+
+ /* possibly add all the IP's as targets */
+ for(p = res; p != NULL; p = p->ai_next) {
+ memcpy(&ip, p->ai_addr, p->ai_addrlen);
+ add_target_ip(arg, &ip);
+
+ /* this is silly, but it works */
+ if(mode == MODE_HOSTCHECK || mode == MODE_ALL) {
+ if(debug > 2) printf("mode: %d\n", mode);
+ continue;
+ }
+ break;
+ }
+ freeaddrinfo(res);
+
+ return 0;
+}
+
+static void
+set_source_ip(char *arg)
+{
+ struct sockaddr_in src;
+
+ memset(&src, 0, sizeof(src));
+ src.sin_family = address_family;
+ if((src.sin_addr.s_addr = inet_addr(arg)) == INADDR_NONE)
+ src.sin_addr.s_addr = get_ip_address(arg);
+ if(bind(icmp_sock, (struct sockaddr *)&src, sizeof(src)) == -1)
+ crash("Cannot bind to IP address %s", arg);
+}
+
+/* TODO: Move this to netutils.c and also change check_dhcp to use that. */
+static in_addr_t
+get_ip_address(const char *ifname)
+{
+ // TODO: Rewrite this so the function return an error and we exit somewhere else
+ struct sockaddr_in ip;
+ ip.sin_addr.s_addr = 0; // Fake initialization to make compiler happy
+#if defined(SIOCGIFADDR)
+ struct ifreq ifr;
+
+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1);
+
+ ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0';
+
+ if(ioctl(icmp_sock, SIOCGIFADDR, &ifr) == -1)
+ crash("Cannot determine IP address of interface %s", ifname);
+
+ memcpy(&ip, &ifr.ifr_addr, sizeof(ip));
+#else
+ (void) ifname;
+ errno = 0;
+ crash("Cannot get interface IP address on this platform.");
+#endif
+ return ip.sin_addr.s_addr;
+}
+
+/*
+ * u = micro
+ * m = milli
+ * s = seconds
+ * return value is in microseconds
+ */
+static u_int
+get_timevar(const char *str)
+{
+ char p, u, *ptr;
+ size_t len;
+ u_int i, d; /* integer and decimal, respectively */
+ u_int factor = 1000; /* default to milliseconds */
+
+ if(!str) return 0;
+ len = strlen(str);
+ if(!len) return 0;
+
+ /* unit might be given as ms|m (millisec),
+ * us|u (microsec) or just plain s, for seconds */
+ p = '\0';
+ u = str[len - 1];
+ if(len >= 2 && !isdigit((int)str[len - 2])) p = str[len - 2];
+ if(p && u == 's') u = p;
+ else if(!p) p = u;
+ if(debug > 2) printf("evaluating %s, u: %c, p: %c\n", str, u, p);
+
+ if(u == 'u') factor = 1; /* microseconds */
+ else if(u == 'm') factor = 1000; /* milliseconds */
+ else if(u == 's') factor = 1000000; /* seconds */
+ if(debug > 2) printf("factor is %u\n", factor);
+
+ i = strtoul(str, &ptr, 0);
+ if(!ptr || *ptr != '.' || strlen(ptr) < 2 || factor == 1)
+ return i * factor;
+
+ /* time specified in usecs can't have decimal points, so ignore them */
+ if(factor == 1) return i;
+
+ d = strtoul(ptr + 1, NULL, 0);
+
+ /* d is decimal, so get rid of excess digits */
+ while(d >= factor) d /= 10;
+
+ /* the last parenthesis avoids floating point exceptions. */
+ return ((i * factor) + (d * (factor / 10)));
+}
+
+/* not too good at checking errors, but it'll do (main() should barfe on -1) */
+static int
+get_threshold(char *str, threshold *th)
+{
+ char *p = NULL, i = 0;
+
+ if(!str || !strlen(str) || !th) return -1;
+
+ /* pointer magic slims code by 10 lines. i is bof-stop on stupid libc's */
+ p = &str[strlen(str) - 1];
+ while(p != &str[1]) {
+ if(*p == '%') *p = '\0';
+ else if(*p == ',' && i) {
+ *p = '\0'; /* reset it so get_timevar(str) works nicely later */
+ th->pl = (unsigned char)strtoul(p+1, NULL, 0);
+ break;
+ }
+ i = 1;
+ p--;
+ }
+ th->rta = get_timevar(str);
+
+ if(!th->rta) return -1;
+
+ if(th->rta > MAXTTL * 1000000) th->rta = MAXTTL * 1000000;
+ if(th->pl > 100) th->pl = 100;
+
+ return 0;
+}
+
+/*
+ * This functions receives a pointer to a string which should contain a threshold for the
+ * rta, packet_loss, jitter, mos or score mode in the form number,number[m|%]* assigns the
+ * parsed number to the corresponding threshold variable.
+ * @param[in,out] str String containing the given threshold values
+ * @param[in] length strlen(str)
+ * @param[out] warn Pointer to the warn threshold struct to which the values should be assigned
+ * @param[out] crit Pointer to the crit threshold struct to which the values should be assigned
+ * @param[in] mode Determines whether this a threshold for rta, packet_loss, jitter, mos or score (exclusively)
+ */
+static bool get_threshold2(char *str, size_t length, threshold *warn, threshold *crit, threshold_mode mode) {
+ if (!str || !length || !warn || !crit) return false;
+
+
+ // p points to the last char in str
+ char *p = &str[length - 1];
+
+ // first_iteration is bof-stop on stupid libc's
+ bool first_iteration = true;
+
+ while(p != &str[0]) {
+ if( (*p == 'm') || (*p == '%') ) {
+ *p = '\0';
+ } else if(*p == ',' && !first_iteration) {
+ *p = '\0'; /* reset it so get_timevar(str) works nicely later */
+
+ char *start_of_value = p + 1;
+
+ if (!parse_threshold2_helper(start_of_value, strlen(start_of_value), crit, mode)){
+ return false;
+ }
+
+ }
+ first_iteration = false;
+ p--;
+ }
+
+ return parse_threshold2_helper(p, strlen(p), warn, mode);
+}
+
+static bool parse_threshold2_helper(char *s, size_t length, threshold *thr, threshold_mode mode) {
+ char *resultChecker = {0};
+
+ switch (mode) {
+ case const_rta_mode:
+ thr->rta = strtod(s, &resultChecker) * 1000;
+ break;
+ case const_packet_loss_mode:
+ thr->pl = (unsigned char)strtoul(s, &resultChecker, 0);
+ break;
+ case const_jitter_mode:
+ thr->jitter = strtod(s, &resultChecker);
+
+ break;
+ case const_mos_mode:
+ thr->mos = strtod(s, &resultChecker);
+ break;
+ case const_score_mode:
+ thr->score = strtod(s, &resultChecker);
+ break;
+ }
+
+ if (resultChecker == s) {
+ // Failed to parse
+ return false;
+ }
+
+ if (resultChecker != (s + length)) {
+ // Trailing symbols
+ return false;
+ }
+
+ return true;
+}
+
+unsigned short
+icmp_checksum(uint16_t *p, size_t n)
+{
+ unsigned short cksum;
+ long sum = 0;
+
+ /* sizeof(uint16_t) == 2 */
+ while(n >= 2) {
+ sum += *(p++);
+ n -= 2;
+ }
+
+ /* mop up the occasional odd byte */
+ if(n == 1) sum += *((uint8_t *)p -1);
+
+ sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */
+ sum += (sum >> 16); /* add carry */
+ cksum = ~sum; /* ones-complement, trunc to 16 bits */
+
+ return cksum;
+}
+
+void
+print_help(void)
+{
+ /*print_revision (progname);*/ /* FIXME: Why? */
+ printf ("Copyright (c) 2005 Andreas Ericsson <ae@op5.se>\n");
+
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-H");
+ printf (" %s\n", _("specify a target"));
+ printf (" %s\n", "[-4|-6]");
+ printf (" %s\n", _("Use IPv4 (default) or IPv6 to communicate with the targets"));
+ printf (" %s\n", "-w");
+ printf (" %s", _("warning threshold (currently "));
+ printf ("%0.3fms,%u%%)\n", (float)warn.rta / 1000, warn.pl);
+ printf (" %s\n", "-c");
+ printf (" %s", _("critical threshold (currently "));
+ printf ("%0.3fms,%u%%)\n", (float)crit.rta / 1000, crit.pl);
+
+ printf (" %s\n", "-R");
+ printf (" %s\n", _("RTA, round trip average, mode warning,critical, ex. 100ms,200ms unit in ms"));
+ printf (" %s\n", "-P");
+ printf (" %s\n", _("packet loss mode, ex. 40%,50% , unit in %"));
+ printf (" %s\n", "-J");
+ printf (" %s\n", _("jitter mode warning,critical, ex. 40.000ms,50.000ms , unit in ms "));
+ printf (" %s\n", "-M");
+ printf (" %s\n", _("MOS mode, between 0 and 4.4 warning,critical, ex. 3.5,3.0"));
+ printf (" %s\n", "-S");
+ printf (" %s\n", _("score mode, max value 100 warning,critical, ex. 80,70 "));
+ printf (" %s\n", "-O");
+ printf (" %s\n", _("detect out of order ICMP packts "));
+ printf (" %s\n", "-H");
+ printf (" %s\n", _("specify a target"));
+ printf (" %s\n", "-s");
+ printf (" %s\n", _("specify a source IP address or device name"));
+ printf (" %s\n", "-n");
+ printf (" %s", _("number of packets to send (currently "));
+ printf ("%u)\n",packets);
+ printf (" %s\n", "-p");
+ printf (" %s", _("number of packets to send (currently "));
+ printf ("%u)\n",packets);
+ printf (" %s\n", "-i");
+ printf (" %s", _("max packet interval (currently "));
+ printf ("%0.3fms)\n",(float)pkt_interval / 1000);
+ printf (" %s\n", "-I");
+ printf (" %s", _("max target interval (currently "));
+ printf ("%0.3fms)\n", (float)target_interval / 1000);
+ printf (" %s\n", "-m");
+ printf (" %s",_("number of alive hosts required for success"));
+ printf ("\n");
+ printf (" %s\n", "-l");
+ printf (" %s", _("TTL on outgoing packets (currently "));
+ printf ("%u)\n", ttl);
+ printf (" %s\n", "-t");
+ printf (" %s",_("timeout value (seconds, currently "));
+ printf ("%u)\n", timeout);
+ printf (" %s\n", "-b");
+ printf (" %s\n", _("Number of icmp data bytes to send"));
+ printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN);
+ printf (" %s\n", "-v");
+ printf (" %s\n", _("verbose"));
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("If none of R,P,J,M,S or O is specified, default behavior is -R -P"));
+ printf (" %s\n", _("The -H switch is optional. Naming a host (or several) to check is not."));
+ printf ("\n");
+ printf (" %s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"));
+ printf (" %s\n", _("packet loss. The default values should work well for most users."));
+ printf (" %s\n", _("You can specify different RTA factors using the standardized abbreviations"));
+ printf (" %s\n", _("us (microseconds), ms (milliseconds, default) or just plain s for seconds."));
+ /* -d not yet implemented */
+ /* printf ("%s\n", _("Threshold format for -d is warn,crit. 12,14 means WARNING if >= 12 hops"));
+ printf ("%s\n", _("are spent and CRITICAL if >= 14 hops are spent."));
+ printf ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do not."));*/
+ printf ("\n");
+ printf (" %s\n", _("The -v switch can be specified several times for increased verbosity."));
+ /* printf ("%s\n", _("Long options are currently unsupported."));
+ printf ("%s\n", _("Options marked with * require an argument"));
+ */
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf(" %s [options] [-H] host1 host2 hostN\n", progname);
+}
diff --git a/plugins-root/pst3.c b/plugins-root/pst3.c
new file mode 100644
index 0000000..1f69f3a
--- /dev/null
+++ b/plugins-root/pst3.c
@@ -0,0 +1,262 @@
+/*****************************************************************************
+*
+* pst3
+*
+* License: GPL
+* Copyright (c) 2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the pst3 executable. This is a replacement ps command
+* for Solaris to get output which provides a long argument listing, which
+* is not possible with the standard ps command (due to truncation). /usr/ucb/ps
+* also has issues where some fields run into each other.
+*
+* This executable works by reading process address structures, so needs
+* to be executed as root
+*
+* Originally written by R.W.Ingraham
+* Rewritten by Duncan Ferguson (Altinity Ltd, June 2008)
+* The rewrite was necessary as /dev/kmem is not available within
+* non-global zones on Solaris 10
+*
+* Details for rewrite came from
+* source of /usr/ucb/ps on Solaris:
+* http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/ucbcmd/ps/ps.c#argvoff
+* usenet group posting
+* http://groups.google.com/group/comp.unix.solaris/tree/browse_frm/month/2001-09/bfa40c08bac819a2?rnum=141&_done=%2Fgroup%2Fcomp.unix.solaris%2Fbrowse_frm%2Fmonth%2F2001-09%3F
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*****************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <procfs.h>
+#include <sys/types32.h>
+
+/*
+ * Constants
+ */
+
+#define PROC_DIR "/proc"
+#define ARGS 30
+
+/*
+ * Globals
+ */
+
+static char * szProg;
+
+/*
+ * Prototypes
+ */
+void usage();
+
+/*----------------------------------------------------------------------------*/
+
+int main (int argc, char **argv)
+{
+ DIR *procdir;
+ struct dirent *proc;
+ char ps_name[ARGS];
+ char as_name[ARGS];
+ psinfo_t psinfo;
+
+ /* Set our program name global */
+ if ((szProg = strrchr(argv[0], '/')) != NULL)
+ szProg++;
+ else
+ szProg = argv[0];
+
+ /* if given any parameters, print out help */
+ if(argc > 1) {
+ (void)usage();
+ exit(1);
+ }
+
+ /* Make sure that our euid is root */
+ if (geteuid() != 0)
+ {
+ fprintf(stderr, "%s: This program can only be run by the root user!\n", szProg);
+ exit(1);
+ }
+
+ if ((procdir = opendir(PROC_DIR)) == NULL) {
+ fprintf(stderr, "%s: cannot open PROC directory %s\n", szProg, PROC_DIR);
+ exit(1);
+ }
+
+ /* Display column headings */
+ printf("%c %5s %5s %5s %6s %6s %4s %s %s\n",
+ 'S',
+ "UID",
+ "PID",
+ "PPID",
+ "VSZ",
+ "RSS",
+ "%CPU",
+ "COMMAND",
+ "ARGS"
+ );
+
+ /* Zip through all of the process entries */
+ while((proc = readdir(procdir))) {
+ int ps_fd;
+ int as_fd;
+ off_t argoff;
+ int i;
+ char *args;
+ char *procname;
+ char *ptr;
+ int argslen;
+ uintptr_t args_addr;;
+ uintptr_t *args_vecs;;
+ int args_count;
+
+ if(proc->d_name[0] == '.')
+ continue;
+
+ sprintf(ps_name,"%s/%s/%s",PROC_DIR,proc->d_name,"psinfo");
+ sprintf(as_name,"%s/%s/%s",PROC_DIR,proc->d_name,"as");
+try_again:
+ if((ps_fd = open(ps_name, O_RDONLY)) == -1)
+ continue;
+
+ if((as_fd = open(as_name, O_RDONLY)) == -1) {
+ close(ps_fd);
+ continue;
+ }
+
+ if(read(ps_fd, &psinfo, sizeof(psinfo)) != sizeof(psinfo)) {
+ int err = errno;
+ close(ps_fd);
+ close(as_fd);
+ if(err == EAGAIN) goto try_again;
+ if(err != ENOENT)
+ fprintf(stderr, "%s: read() on %s: %s\n", szProg,
+ ps_name, strerror(err));
+ continue;
+ }
+ close(ps_fd);
+
+ /* system process, ignore since the previous version did */
+ if(
+ psinfo.pr_nlwp == 0 ||
+ strcmp(psinfo.pr_lwp.pr_clname, "SYS") == 0
+ ) {
+ continue;
+ }
+
+ /* get the procname to match previous versions */
+ procname = strdup(psinfo.pr_psargs);
+ if((ptr = strchr(procname, ' ')) != NULL)
+ *ptr = '\0';
+ if((ptr = strrchr(procname, '/')) != NULL)
+ ptr++;
+ else
+ ptr = procname;
+
+ /*
+ * print out what we currently know
+ */
+ printf("%c %5d %5d %5d %6lu %6lu %4.1f %s ",
+ psinfo.pr_lwp.pr_sname,
+ psinfo.pr_euid,
+ psinfo.pr_pid,
+ psinfo.pr_ppid,
+ psinfo.pr_size,
+ psinfo.pr_rssize,
+ ((float)(psinfo.pr_pctcpu) / 0x8000 * 100.0),
+ ptr
+ );
+ free(procname);
+
+ /*
+ * and now for the command line stuff
+ */
+
+ args_addr = psinfo.pr_argv;
+ args_count = psinfo.pr_argc;
+ args_vecs = malloc(args_count * sizeof(uintptr_t));
+
+ if(psinfo.pr_dmodel == PR_MODEL_NATIVE) {
+ /* this process matches target process */
+ pread(as_fd,args_vecs, args_count * sizeof(uintptr_t),
+ args_addr);
+ } else {
+ /* this process is 64bit, target process is 32 bit*/
+ caddr32_t *args_vecs32 = (caddr32_t *)args_vecs;
+ pread(as_fd,args_vecs32,args_count * sizeof(caddr32_t),
+ args_addr);
+ for (i=args_count-1;i>=0;--i)
+ args_vecs[i]=args_vecs32[i];
+ }
+
+ /*
+ * now read in the args - if what we read in fills buffer
+ * resize buffer and reread that bit again
+ */
+ argslen=ARGS;
+ args=malloc(argslen+1);
+ for(i=0;i<args_count;i++) {
+ memset(args,'\0',argslen+1);
+ if(pread(as_fd, args, argslen, args_vecs[i]) <= 0) {
+ break;
+ }
+ args[argslen]='\0';
+ if(strlen(args) == argslen){
+ argslen += ARGS;
+ args = realloc(args, argslen + 1);
+ i--;
+ continue;
+ }
+ printf(" %s", args);
+ }
+ free(args_vecs);
+ free(args);
+ close(as_fd);
+ printf("\n");
+ }
+
+ (void) closedir(procdir);
+
+ return (0);
+}
+
+/*----------------------------------------------------------------------------*/
+
+void usage() {
+ printf("%s: Help output\n\n", szProg);
+ printf("If this program is given any arguments, this help is displayed.\n");
+ printf("This command is used to print out the full command line for all\n");
+ printf("running processes because /usr/bin/ps is limited to 80 chars and\n");
+ printf("/usr/ucb/ps can merge columns together.\n\n");
+ printf("Columns are:\n");
+ printf("\tS - State of process - see 'ps' man page\n");
+ printf("\tUID - UID of the process owner\n");
+ printf("\tPID - PID of the process\n");
+ printf("\tPPID - PID of the parent process\n");
+ printf("\tVSZ - Virtual memory usage (kilobytes)\n");
+ printf("\tRSS - Real memory usage (kilobytes)\n");
+ printf("\t%%CPU - CPU usage\n");
+ printf("\tCOMMAND - Command being run\n");
+ printf("\tARGS - Full command line with arguments\n");
+ return;
+}
diff --git a/plugins-root/t/check_dhcp.t b/plugins-root/t/check_dhcp.t
new file mode 100644
index 0000000..ce62773
--- /dev/null
+++ b/plugins-root/t/check_dhcp.t
@@ -0,0 +1,74 @@
+#! /usr/bin/perl -w -I ..
+#
+# DHCP Tests via check_dhcp
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO",
+ "If sudo is setup for this user to run any command as root ('yes' to allow)",
+ "no" );
+
+if ($allow_sudo eq "yes" or $> == 0) {
+ plan tests => 6;
+} else {
+ plan skip_all => "Need sudo to test check_dhcp";
+}
+my $sudo = $> == 0 ? '' : 'sudo';
+
+my $successOutput = '/OK: Received \d+ DHCPOFFER\(s\), \d+ of 1 requested servers responded, max lease time = \d+ sec\./';
+my $failureOutput = '/CRITICAL: (No DHCPOFFERs were received|Received \d+ DHCPOFFER\(s\), 0 of 1 requested servers responded, max lease time = \d+ sec\.)/';
+my $invalidOutput = '/Invalid hostname/';
+
+my $host_responsive = getTestParameter( "NP_HOST_DHCP_RESPONSIVE",
+ "The hostname of system responsive to dhcp requests",
+ "localhost" );
+
+my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to dhcp requests",
+ "10.0.0.1" );
+
+my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost" );
+
+# try to determince interface
+my $interface = '';
+
+# find interface used for default route
+if (-x '/usr/sbin/ip' and `/usr/sbin/ip route get 1.1.1.1 2>/dev/null` =~ m/\sdev\s(\S+)/) {
+ $interface = "-i $1";
+}
+elsif (`ifconfig -a 2>/dev/null` =~ m/^(e\w*\d+)/mx and $1 ne 'eth0') {
+ $interface = ' -i '.$1;
+}
+
+my $res;
+SKIP: {
+ skip('need responsive test host', 2) unless $host_responsive;
+ $res = NPTest->testCmd(
+ "$sudo ./check_dhcp $interface -u -s $host_responsive"
+ );
+ is( $res->return_code, 0, "Syntax ok" );
+ like( $res->output, $successOutput, "Output OK" );
+};
+
+SKIP: {
+ skip('need nonresponsive test host', 2) unless $host_nonresponsive;
+ $res = NPTest->testCmd(
+ "$sudo ./check_dhcp $interface -u -s $host_nonresponsive"
+ );
+ is( $res->return_code, 2, "Exit code - host nonresponsive" );
+ like( $res->output, $failureOutput, "Output OK" );
+};
+
+SKIP: {
+ skip('need invalid test host', 2) unless $hostname_invalid;
+ $res = NPTest->testCmd(
+ "$sudo ./check_dhcp $interface -u -s $hostname_invalid"
+ );
+ is( $res->return_code, 3, "Exit code - host invalid" );
+ like( $res->output, $invalidOutput, "Output OK" );
+};
diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t
new file mode 100644
index 0000000..4f9db86
--- /dev/null
+++ b/plugins-root/t/check_icmp.t
@@ -0,0 +1,142 @@
+#! /usr/bin/perl -w -I ..
+#
+# Ping Response Tests via check_icmp
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO",
+ "If sudo is setup for this user to run any command as root ('yes' to allow)",
+ "no" );
+
+if ($allow_sudo eq "yes" or $> == 0) {
+ plan tests => 39;
+} else {
+ plan skip_all => "Need sudo to test check_icmp";
+}
+my $sudo = $> == 0 ? '' : 'sudo';
+
+my $successOutput = '/OK - .*? rta (?:[\d\.]+ms)|(?:nan), lost \d+%/';
+my $failureOutput = '/(WARNING|CRITICAL) - .*? rta (?:[\d\.]+ms > [\d\.]+ms|nan)/';
+
+my $host_responsive = getTestParameter( "NP_HOST_RESPONSIVE",
+ "The hostname of system responsive to network requests",
+ "localhost" );
+
+my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests",
+ "10.0.0.1" );
+
+my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost" );
+
+my $res;
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -w 10000ms,100% -c 10000ms,100%"
+ );
+is( $res->return_code, 0, "Syntax ok" );
+like( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -w 0ms,0% -c 10000ms,100%"
+ );
+is( $res->return_code, 1, "Syntax ok, with forced warning" );
+like( $res->output, $failureOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -w 0,0% -c 0,0%"
+ );
+is( $res->return_code, 2, "Syntax ok, with forced critical" );
+like( $res->output, $failureOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -t 2"
+ );
+is( $res->return_code, 2, "Timeout - host nonresponsive" );
+like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%"
+ );
+is( $res->return_code, 3, "No hostname" );
+like( $res->output, '/No hosts to check/', "Output with appropriate error message");
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 0 -t 2"
+ );
+is( $res->return_code, 0, "One host nonresponsive - zero required" );
+like( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 1 -t 2"
+ );
+is( $res->return_code, 0, "One of two host nonresponsive - one required" );
+like( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -n 1 -m 2"
+ );
+is( $res->return_code, 2, "One of two host nonresponsive - two required" );
+like( $res->output, $failureOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -s 127.0.15.15 -w 10000ms,100% -c 10000ms,100% -n 1 -m 2"
+ );
+is( $res->return_code, 0, "IPv4 source_ip accepted" );
+like( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -b 65507"
+ );
+is( $res->return_code, 0, "Try max packet size" );
+like( $res->output, $successOutput, "Output OK - Didn't overflow" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -R 100,100 -n 1 -t 2"
+ );
+is( $res->return_code, 0, "rta works" );
+like( $res->output, $successOutput, "Output OK" );
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -P 80,90 -n 1 -t 2"
+ );
+is( $res->return_code, 0, "pl works" );
+like( $res->output, '/lost 0%/', "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -J 80,90 -t 2"
+ );
+is( $res->return_code, 0, "jitter works" );
+like( $res->output, '/jitter \d/', "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -M 4,3 -t 2"
+ );
+is( $res->return_code, 0, "mos works" );
+like( $res->output, '/MOS \d/', "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -S 80,70 -t 2"
+ );
+is( $res->return_code, 0, "score works" );
+like( $res->output, '/Score \d/', "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -O -t 2"
+ );
+is( $res->return_code, 0, "order works" );
+like( $res->output, '/Packets in order/', "Output OK" );
+
+$res = NPTest->testCmd(
+ "$sudo ./check_icmp -H $host_responsive -O -S 80,70 -M 4,3 -J 80,90 -P 80,90 -R 100,100 -t 2"
+ );
+is( $res->return_code, 0, "order works" );
+like( $res->output, '/Packets in order/', "Output OK" );
+like( $res->output, '/Score \d/', "Output OK" );
+like( $res->output, '/MOS \d/', "Output OK" );
+like( $res->output, '/jitter \d/', "Output OK" );
+like( $res->output, '/lost 0%/', "Output OK" );
+like( $res->output, $successOutput, "Output OK" );
diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am
new file mode 100644
index 0000000..7879791
--- /dev/null
+++ b/plugins-scripts/Makefile.am
@@ -0,0 +1,60 @@
+## Process this file with automake to produce Makefile.in
+
+if RELEASE_PRESENT
+NP_VERSION = @NP_RELEASE@
+else
+NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
+ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
+.FORCE-NP-VERSION-FILE:
+-include NP-VERSION-FILE
+endif
+
+SUFFIXES = .pl .sh
+
+VPATH=$(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t
+
+libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \
+ check_log check_oracle check_rpc check_sensors check_wave \
+ check_ifstatus check_ifoperstatus check_mailq check_file_age \
+ check_uptime check_mssql \
+ utils.sh utils.pm
+
+EXTRA_DIST=check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \
+ check_log.sh check_oracle.sh check_rpc.pl check_sensors.sh \
+ check_ifstatus.pl check_ifoperstatus.pl check_wave.pl check_mailq.pl check_file_age.pl \
+ check_uptime.pl check_mssql.pl \
+ utils.sh.in utils.pm.in t
+
+EDIT = sed \
+ -e 's|[@]NP_VERSION[@]|$(NP_VERSION)|g' \
+ -e 's|[@]TRUSTED_PATH[@]|$(with_trusted_path)|g' \
+ -e 's|[@]PERL[@]|$(PERL)|g' \
+ -e 's|[@]libexecdir[@]|$(libexecdir)|g'
+
+TESTS_ENVIRONMENT=perl -I $(top_builddir) -I $(top_srcdir)
+
+TESTS = @SCRIPT_TEST@
+
+test:
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test
+ for SCRIPT in *.pl; do perl -wc $$SCRIPT || exit 1; done
+ set -e; for SCRIPT in *.sh; do sh -n $$SCRIPT || exit 1; done
+
+test-debug:
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test
+
+CLEANFILES=$(libexec_SCRIPTS)
+
+.pl :
+ $(EDIT) $< > $@
+ chmod +x $@
+
+.sh :
+ $(EDIT) $< > $@
+ chmod +x $@
+
+clean-local:
+ rm -f NP-VERSION-FILE
+
diff --git a/plugins-scripts/Makefile.in b/plugins-scripts/Makefile.in
new file mode 100644
index 0000000..f22ee03
--- /dev/null
+++ b/plugins-scripts/Makefile.in
@@ -0,0 +1,2331 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = plugins-scripts
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = utils.pm utils.sh
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(libexecdir)"
+SCRIPTS = $(libexec_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/utils.pm.in \
+ $(srcdir)/utils.sh.in $(top_srcdir)/build-aux/mkinstalldirs \
+ $(top_srcdir)/build-aux/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+VPATH = $(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+@RELEASE_PRESENT_TRUE@NP_VERSION = @NP_RELEASE@
+SUFFIXES = .pl .sh
+libexec_SCRIPTS = check_breeze check_disk_smb check_flexlm check_ircd \
+ check_log check_oracle check_rpc check_sensors check_wave \
+ check_ifstatus check_ifoperstatus check_mailq check_file_age \
+ check_uptime check_mssql \
+ utils.sh utils.pm
+
+EXTRA_DIST = check_breeze.pl check_disk_smb.pl check_flexlm.pl check_ircd.pl \
+ check_log.sh check_oracle.sh check_rpc.pl check_sensors.sh \
+ check_ifstatus.pl check_ifoperstatus.pl check_wave.pl check_mailq.pl check_file_age.pl \
+ check_uptime.pl check_mssql.pl \
+ utils.sh.in utils.pm.in t
+
+EDIT = sed \
+ -e 's|[@]NP_VERSION[@]|$(NP_VERSION)|g' \
+ -e 's|[@]TRUSTED_PATH[@]|$(with_trusted_path)|g' \
+ -e 's|[@]PERL[@]|$(PERL)|g' \
+ -e 's|[@]libexecdir[@]|$(libexecdir)|g'
+
+TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
+TESTS = @SCRIPT_TEST@
+CLEANFILES = $(libexec_SCRIPTS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .pl .sh .log .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins-scripts/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu plugins-scripts/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+utils.pm: $(top_builddir)/config.status $(srcdir)/utils.pm.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+utils.sh: $(top_builddir)/config.status $(srcdir)/utils.sh.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-libexecSCRIPTS: $(libexec_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_SCRIPTS)'; test -n "$(libexecdir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ dir='$(DESTDIR)$(libexecdir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+ for dir in "$(DESTDIR)$(libexecdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libexecSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libexecSCRIPTS
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+ clean-libtool clean-local cscopelist-am ctags-am distclean \
+ distclean-generic distclean-libtool distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-libexecSCRIPTS install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \
+ uninstall uninstall-am uninstall-libexecSCRIPTS
+
+.PRECIOUS: Makefile
+
+@RELEASE_PRESENT_FALSE@NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
+@RELEASE_PRESENT_FALSE@ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
+@RELEASE_PRESENT_FALSE@.FORCE-NP-VERSION-FILE:
+@RELEASE_PRESENT_FALSE@-include NP-VERSION-FILE
+
+test:
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test
+ for SCRIPT in *.pl; do perl -wc $$SCRIPT || exit 1; done
+ set -e; for SCRIPT in *.sh; do sh -n $$SCRIPT || exit 1; done
+
+test-debug:
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test
+
+.pl :
+ $(EDIT) $< > $@
+ chmod +x $@
+
+.sh :
+ $(EDIT) $< > $@
+ chmod +x $@
+
+clean-local:
+ rm -f NP-VERSION-FILE
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl
new file mode 100755
index 0000000..531625c
--- /dev/null
+++ b/plugins-scripts/check_breeze.pl
@@ -0,0 +1,89 @@
+#!@PERL@ -w
+
+
+use strict;
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_w $opt_c $opt_H $opt_C $PROGNAME);
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw(%ERRORS &print_revision &support &usage);
+
+$PROGNAME = "check_breeze";
+
+sub print_help ();
+sub print_usage ();
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+$ENV{'CDPATH'}='';
+
+Getopt::Long::Configure('bundling');
+GetOptions
+ ("V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "w=s" => \$opt_w, "warning=s" => \$opt_w,
+ "c=s" => \$opt_c, "critical=s" => \$opt_c,
+ "H=s" => \$opt_H, "hostname=s" => \$opt_H,
+ "C=s" => \$opt_C, "community=s" => \$opt_C);
+
+if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
+
+($opt_H) || usage("Host name/address not specified\n");
+my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
+($host) || usage("Invalid host: $opt_H\n");
+
+($opt_w) || usage("Warning threshold not specified\n");
+my $warning = $1 if ($opt_w =~ /([0-9]{1,2}|100)+/);
+($warning) || usage("Invalid warning threshold: $opt_w\n");
+
+($opt_c) || usage("Critical threshold not specified\n");
+my $critical = $1 if ($opt_c =~ /([0-9]{1,2}|100)/);
+($critical) || usage("Invalid critical threshold: $opt_c\n");
+
+($opt_C) || ($opt_C = "public") ;
+
+my $sig=0;
+$sig = `/usr/bin/snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`;
+my @test=split(/ /,$sig);
+$sig=$test[2];
+$sig=int($sig);
+if ($sig>100){$sig=100}
+
+print "Signal Strength at: $sig%\n";
+
+exit $ERRORS{'CRITICAL'} if ($sig<$critical);
+exit $ERRORS{'WARNING'} if ($sig<$warning);
+exit $ERRORS{'OK'};
+
+
+sub print_usage () {
+ print "Usage: $PROGNAME -H <host> [-C community] -w <warn> -c <crit>\n";
+}
+
+sub print_help () {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop
+
+This plugin reports the signal strength of a Breezecom wireless equipment
+
+";
+ print_usage();
+ print "
+-H, --hostname=HOST
+ Name or IP address of host to check
+-C, --community=community
+ SNMPv1 community (default public)
+-w, --warning=INTEGER
+ Percentage strength below which a WARNING status will result
+-c, --critical=INTEGER
+ Percentage strength below which a CRITICAL status will result
+
+";
+ support();
+}
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl
new file mode 100644
index 0000000..eda8dd4
--- /dev/null
+++ b/plugins-scripts/check_disk_smb.pl
@@ -0,0 +1,349 @@
+#!@PERL@ -w
+#
+#
+# check_disk.pl <host> <share> <user> <pass> [warn] [critical] [port]
+#
+# Monitoring host script to get the disk usage from a SMB share
+#
+# Changes and Modifications
+# =========================
+# 7-Aug-1999 - Michael Anthon
+# Created from check_disk.pl script provided with netsaint_statd (basically
+# cause I was too lazy (or is that smart?) to write it from scratch)
+# 8-Aug-1999 - Michael Anthon
+# Modified [warn] and [critical] parameters to accept format of nnn[M|G] to
+# allow setting of limits in MBytes or GBytes. Percentage settings for large
+# drives is a pain in the butt
+# 2-May-2002 - SGhosh fix for embedded perl
+#
+#
+
+require 5.004;
+use POSIX qw(setsid);
+use strict;
+use Getopt::Long;
+use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $opt_C $opt_t $verbose);
+use vars qw($PROGNAME);
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
+
+# make us session leader which makes all children exit if we do
+setsid;
+
+sub print_help ();
+sub print_usage ();
+
+$PROGNAME = "check_disk_smb";
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+
+Getopt::Long::Configure('bundling');
+GetOptions
+ ("v" => \$verbose, "verbose" => \$verbose,
+ "t=i" => \$opt_t, "timeout=i" => \$opt_t,
+ "P=s" => \$opt_P, "port=s" => \$opt_P,
+ "V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "w=s" => \$opt_w, "warning=s" => \$opt_w,
+ "c=s" => \$opt_c, "critical=s" => \$opt_c,
+ "p=s" => \$opt_p, "password=s" => \$opt_p,
+ "u=s" => \$opt_u, "username=s" => \$opt_u,
+ "s=s" => \$opt_s, "share=s" => \$opt_s,
+ "W=s" => \$opt_W, "workgroup=s" => \$opt_W,
+ "H=s" => \$opt_H, "hostname=s" => \$opt_H,
+ "a=s" => \$opt_a, "address=s" => \$opt_a,
+ "C=s" => \$opt_C, "configfile=s" => \$opt_C);
+
+if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@'); #'
+ exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
+
+my $smbclient = $utils::PATH_TO_SMBCLIENT;
+$smbclient || usage("check requires smbclient, smbclient not set\n");
+-x $smbclient || usage("check requires smbclient, $smbclient: $!\n");
+
+# Options checking
+
+($opt_H) || ($opt_H = shift @ARGV) || usage("Host name not specified\n");
+my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9 ]+\$?)$/);
+($host) || usage("Invalid host: $opt_H\n");
+
+($opt_s) || ($opt_s = shift @ARGV) || usage("Share volume not specified\n");
+my $share = $1 if ($opt_s =~ /^([-_.A-Za-z0-9 ]+\$?)$/);
+($share) || usage("Invalid share: $opt_s\n");
+
+defined($opt_u) || ($opt_u = shift @ARGV) || ($opt_u = "guest");
+my $user = $1 if ($opt_u =~ /^([-_.A-Za-z0-9\\]*)$/);
+defined($user) || usage("Invalid user: $opt_u\n");
+
+defined($opt_p) || ($opt_p = shift @ARGV) || ($opt_p = "");
+my $pass = $1 if ($opt_p =~ /(.*)/);
+
+($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 85);
+my $warn = $1 if ($opt_w =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/);
+($warn) || usage("Invalid warning threshold: $opt_w\n");
+
+($opt_c) || ($opt_c = shift @ARGV) || ($opt_c = 95);
+my $crit = $1 if ($opt_c =~ /^([0-9]{1,2}\%?|100\%?|[0-9]+[kMG])$/);
+($crit) || usage("Invalid critical threshold: $opt_c\n");
+
+($opt_C) || ($opt_C = shift @ARGV) || ($opt_C = "");
+my $configfile = $opt_C if ($opt_C);
+usage("Unable to read config file $configfile\n") if ($configfile) && (! -r $configfile);
+
+if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; }
+
+# Execute the given command line and return anything it writes to STDOUT and/or
+# STDERR. (This might be useful for other plugins, too, so it should possibly
+# be moved to utils.pm.)
+sub output_and_error_of {
+ local *CMD;
+ local $/ = undef;
+ my $pid = open CMD, "-|";
+ if (defined($pid)) {
+ if ($pid) {
+ return <CMD>;
+ } else {
+ open STDERR, ">&STDOUT" and exec @_;
+ exit(1);
+ }
+ }
+ return undef;
+}
+
+# split the type from the unit value
+#Check $warn and $crit for type (%/M/G) and set up for tests
+#P = Percent, K = KBytes
+my $warn_type;
+my $crit_type;
+
+if ($opt_w =~ /^([0-9]+)\%?$/) {
+ $warn = "$1";
+ $warn_type = "P";
+} elsif ($opt_w =~ /^([0-9]+)k$/) {
+ $warn_type = "K";
+ $warn = $1;
+} elsif ($opt_w =~ /^([0-9]+)M$/) {
+ $warn_type = "K";
+ $warn = $1 * 1024;
+} elsif ($opt_w =~ /^([0-9]+)G$/) {
+ $warn_type = "K";
+ $warn = $1 * 1048576;
+}
+if ($opt_c =~ /^([0-9]+)\%?$/) {
+ $crit = "$1";
+ $crit_type = "P";
+} elsif ($opt_c =~ /^([0-9]+)k$/) {
+ $crit_type = "K";
+ $crit = $1;
+} elsif ($opt_c =~ /^([0-9]+)M$/) {
+ $crit_type = "K";
+ $crit = $1 * 1024;
+} elsif ($opt_c =~ /^([0-9]+)G$/) {
+ $crit_type = "K";
+ $crit = $1 * 1048576;
+}
+
+# check if both warning and critical are percentage or size
+unless( ( $warn_type eq "P" && $crit_type eq "P" ) || ( $warn_type ne "P" && $crit_type ne "P" ) ){
+ $opt_w =~ s/\%/\%\%/g;
+ $opt_c =~ s/\%/\%\%/g;
+ usage("Both warning and critical should be same type- warning: $opt_w critical: $opt_c \n");
+}
+
+# verify warning is less than critical
+if ( $warn_type eq "K") {
+ unless ( $warn > $crit) {
+ usage("Disk size: warning ($opt_w) should be greater than critical ($opt_c) \n");
+ }
+}else{
+ unless ( $warn < $crit) {
+ $opt_w =~ s/\%/\%\%/g;
+ $opt_c =~ s/\%/\%\%/g;
+ usage("Percentage: warning ($opt_w) should be less than critical ($opt_c) \n");
+ }
+}
+
+my $workgroup = $1 if (defined($opt_W) && $opt_W =~ /(.*)/);
+
+my $address = $1 if (defined($opt_a) && $opt_a =~ /(.*)/);
+
+# end of options checking
+
+
+my $state = "OK";
+my $answer = undef;
+my $res = undef;
+my $perfdata = "";
+my @lines = undef;
+
+# Just in case of problems, let's not hang the monitoring system
+$SIG{'ALRM'} = sub {
+ print "No Answer from Client\n";
+ $SIG{'INT'} = 'IGNORE';
+ kill(-2, $$);
+ exit $ERRORS{"UNKNOWN"};
+};
+alarm($TIMEOUT);
+
+# Execute a "du" on the share using smbclient program
+# get the results into $res
+my @cmd = (
+ $smbclient,
+ "//$host/$share",
+ "-U", "$user%$pass",
+ defined($workgroup) ? ("-W", $workgroup) : (),
+ defined($address) ? ("-I", $address) : (),
+ defined($opt_P) ? ("-p", $opt_P) : (),
+ defined($configfile) ? ("-s", $configfile) : (),
+ "-c", "du"
+);
+
+print join(" ", @cmd) . "\n" if ($verbose);
+$res = output_and_error_of(@cmd) or exit $ERRORS{"UNKNOWN"};
+
+#Turn off alarm
+alarm(0);
+
+#Split $res into an array of lines
+@lines = split /\n/, $res;
+
+#Get the last line into $_
+$_ = $lines[$#lines-1];
+#print "$_\n";
+
+#Process the last line to get free space.
+#If line does not match required regexp, return an UNKNOWN error
+if (/\s*(\d*) blocks of size (\d*)\. (\d*) blocks available/) {
+
+ my ($avail_bytes) = $3 * $2;
+ my ($total_bytes) = $1 * $2;
+ my ($occupied_bytes) = $1 * $2 - $avail_bytes;
+ my ($avail) = $avail_bytes/1024;
+ my ($capper);
+ if ($1!=0) { $capper = int(($3/$1)*100) } else { $capper=100 };
+ my ($mountpt) = "\\\\$host\\$share";
+
+ # TODO : why is the kB the standard unit for args ?
+ my ($warn_bytes) = $total_bytes - $warn * 1024;
+ if ($warn_type eq "P") {
+ $warn_bytes = $warn * $1 * $2 / 100;
+ }
+ my ($crit_bytes) = $total_bytes - $crit * 1024;
+ if ($crit_type eq "P") {
+ $crit_bytes = $crit * $1 * $2 / 100;
+ }
+
+
+ if (int($avail / 1024) > 0) {
+ $avail = int($avail / 1024);
+ if (int($avail /1024) > 0) {
+ $avail = (int(($avail / 1024)*100))/100;
+ $avail = $avail ."G";
+ } else {
+ $avail = $avail ."M";
+ }
+ } else {
+ $avail = $avail ."K";
+ }
+
+#print ":$warn:$warn_type:\n";
+#print ":$crit:$crit_type:\n";
+#print ":$avail:$avail_bytes:$capper:$mountpt:\n";
+ $perfdata = "'" . $share . "'=" . $occupied_bytes . 'B;'
+ . $warn_bytes . ';'
+ . $crit_bytes . ';'
+ . '0;'
+ . $total_bytes;
+
+ if ($occupied_bytes > $crit_bytes) {
+ $state = "CRITICAL";
+ $answer = "CRITICAL: Only $avail ($capper%) free on $mountpt";
+ } elsif ( $occupied_bytes > $warn_bytes ) {
+ $state = "WARNING";
+ $answer = "WARNING: Only $avail ($capper%) free on $mountpt";
+ } else {
+ $answer = "Disk ok - $avail ($capper%) free on $mountpt";
+ }
+} else {
+ $answer = "Result from smbclient not suitable";
+ $state = "UNKNOWN";
+ foreach (@lines) {
+ if (/(Access denied|NT_STATUS_LOGON_FAILURE|NT_STATUS_ACCESS_DENIED)/) {
+ $answer = "Access Denied";
+ $state = "CRITICAL";
+ last;
+ }
+ if (/(Unknown host \w*|Connection.*failed)/) {
+ $answer = "$1";
+ $state = "CRITICAL";
+ last;
+ }
+ if (/(You specified an invalid share name|NT_STATUS_BAD_NETWORK_NAME)/) {
+ $answer = "Invalid share name \\\\$host\\$share";
+ $state = "CRITICAL";
+ last;
+ }
+ }
+}
+
+
+print $answer;
+print " | " . $perfdata if ($perfdata);
+print "\n";
+print "$state\n" if ($verbose);
+exit $ERRORS{$state};
+
+sub print_usage () {
+ print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password>
+ -w <warn> -c <crit> [-W <workgroup>] [-P <port>] [-a <IP>] [-t timeout]
+ [-C <configfile>]\n";
+}
+
+sub print_help () {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop
+
+Perl Check SMB Disk plugin for monitoring
+
+";
+ print_usage();
+ print "
+-H, --hostname=HOST
+ NetBIOS name of the server
+-s, --share=STRING
+ Share name to be tested
+-W, --workgroup=STRING
+ Workgroup or Domain used (Defaults to \"WORKGROUP\")
+-a, --address=IP
+ IP-address of HOST (only necessary if HOST is in another network)
+-u, --user=STRING
+ Username to log in to server. (Defaults to \"guest\")
+-p, --password=STRING
+ Password to log in to server. (Defaults to an empty password)
+-w, --warning=INTEGER or INTEGER[kMG]
+ Percent of used space at which a warning will be generated (Default: 85%)
+-c, --critical=INTEGER or INTEGER[kMG]
+ Percent of used space at which a critical will be generated (Defaults: 95%)
+-t, --timeout=INTEGER
+ Seconds before connection times out (Default: 15)
+-P, --port=INTEGER
+ Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default)
+-C, --configfile=STRING
+ Path to configfile which should be used by smbclient (Defaults to smb.conf of your smb installation)
+
+ If thresholds are followed by either a k, M, or G then check to see if that
+ much disk space is available (kilobytes, Megabytes, Gigabytes)
+
+ Warning percentage should be less than critical
+ Warning (remaining) disk space should be greater than critical.
+
+";
+ support();
+}
diff --git a/plugins-scripts/check_file_age.pl b/plugins-scripts/check_file_age.pl
new file mode 100755
index 0000000..26281dd
--- /dev/null
+++ b/plugins-scripts/check_file_age.pl
@@ -0,0 +1,161 @@
+#!@PERL@ -w
+
+# check_file_age.pl Copyright (C) 2003 Steven Grimm <koreth-nagios@midwinter.com>
+#
+# Checks a file's size and modification time to make sure it's not empty
+# and that it's sufficiently recent.
+#
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# you should have received a copy of the GNU General Public License
+# along with this program if not, write to the Free Software Foundation,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+use strict;
+use English;
+use Getopt::Long;
+use File::stat;
+use vars qw($PROGNAME);
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw (%ERRORS &print_revision &support);
+
+sub print_help ();
+sub print_usage ();
+
+my ($opt_c, $opt_f, $opt_w, $opt_C, $opt_W, $opt_h, $opt_V, $opt_i);
+my ($result, $message, $age, $size, $st, $perfdata);
+
+$PROGNAME="check_file_age";
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+
+$opt_w = 240;
+$opt_c = 600;
+$opt_f = "";
+
+Getopt::Long::Configure('bundling');
+GetOptions(
+ "V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "i" => \$opt_i, "ignore-missing" => \$opt_i,
+ "f=s" => \$opt_f, "file" => \$opt_f,
+ "w=s" => \$opt_w, "warning-age=s" => \$opt_w,
+ "W=s" => \$opt_W, "warning-size=s" => \$opt_W,
+ "c=s" => \$opt_c, "critical-age=s" => \$opt_c,
+ "C=s" => \$opt_C, "critical-size=s" => \$opt_C);
+
+if ($opt_V) {
+ print_revision($PROGNAME, '@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_h) {
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+}
+
+$opt_f = shift unless ($opt_f);
+
+if (! $opt_f) {
+ print "FILE_AGE UNKNOWN: No file specified\n";
+ exit $ERRORS{'UNKNOWN'};
+}
+
+# Check that file exists (can be directory or link)
+unless (-e $opt_f) {
+ if ($opt_i) {
+ $result = 'OK';
+ print "FILE_AGE $result: $opt_f doesn't exist, but ignore-missing was set\n";
+ exit $ERRORS{$result};
+
+ } else {
+ print "FILE_AGE CRITICAL: File not found - $opt_f\n";
+ exit $ERRORS{'CRITICAL'};
+ }
+}
+
+$st = File::stat::stat($opt_f);
+$age = time - $st->mtime;
+$size = $st->size;
+
+$result = 'OK';
+
+if ($opt_c !~ m/^\d+$/ or ($opt_C and $opt_C !~ m/^\d+$/)
+ or $opt_w !~ m/^\d+$/ or ($opt_W and $opt_W !~ m/^\d+$/)) {
+ # range has been specified so use M::P::R to process
+ require Monitoring::Plugin::Range;
+ # use permissive range defaults for size when none specified
+ $opt_W = "0:" unless ($opt_W);
+ $opt_C = "0:" unless ($opt_C);
+
+ if (Monitoring::Plugin::Range->parse_range_string($opt_c)
+ ->check_range($age) == 1) { # 1 means it raises an alert because it's OUTSIDE the range
+ $result = 'CRITICAL';
+ }
+ elsif (Monitoring::Plugin::Range->parse_range_string($opt_C)
+ ->check_range($size) == 1) {
+ $result = 'CRITICAL';
+ }
+ elsif (Monitoring::Plugin::Range->parse_range_string($opt_w)
+ ->check_range($age) == 1) {
+ $result = 'WARNING';
+ }
+ elsif (Monitoring::Plugin::Range->parse_range_string($opt_W)
+ ->check_range($size) == 1) {
+ $result = 'WARNING';
+ }
+}
+else {
+ # use permissive defaults for size when none specified
+ $opt_W = 0 unless ($opt_W);
+ $opt_C = 0 unless ($opt_C);
+ if ($age > $opt_c or $size < $opt_C) {
+ $result = 'CRITICAL';
+ }
+ elsif ($age > $opt_w or $size < $opt_W) {
+ $result = 'WARNING';
+ }
+}
+
+$perfdata = "age=${age}s;${opt_w};${opt_c} size=${size}B;${opt_W};${opt_C};0";
+print "FILE_AGE $result: $opt_f is $age seconds old and $size bytes | $perfdata\n";
+exit $ERRORS{$result};
+
+sub print_usage () {
+ print "Usage:\n";
+ print " $PROGNAME [-w <secs>] [-c <secs>] [-W <size>] [-C <size>] [-i] -f <file>\n";
+ print " $PROGNAME [-h | --help]\n";
+ print " $PROGNAME [-V | --version]\n";
+}
+
+sub print_help () {
+ print_revision($PROGNAME, '@NP_VERSION@');
+ print "Copyright (c) 2003 Steven Grimm\n\n";
+ print_usage();
+ print "\n";
+ print " -i | --ignore-missing : return OK if the file does not exist\n";
+ print " <secs> File must be no more than this many seconds old (default: warn 240 secs, crit 600)\n";
+ print " <size> File must be at least this many bytes long (default: file size is ignored (0 bytes))\n\n";
+ print " Both <secs> and <size> can specify a range using the standard plugin syntax\n";
+ print " If any of the warning and critical arguments are in range syntax (not just bare numbers)\n";
+ print " then all warning and critical arguments will be interpreted as ranges.\n";
+ print " To use range processing the perl module Monitoring::Plugin must be installed\n";
+ print " For range syntax see https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n";
+ print " It is strongly recommended when using range syntax that all four of -w, -W, -c and -C are specified\n";
+ print " otherwise it is unlikely that the size test will be doing what is desired\n";
+ print "\n";
+ support();
+}
+
diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl
new file mode 100755
index 0000000..e3fe296
--- /dev/null
+++ b/plugins-scripts/check_flexlm.pl
@@ -0,0 +1,245 @@
+#!@PERL@ -w
+#
+# usage:
+# check_flexlm.pl license_file
+#
+# Check available flexlm license managers.
+# Use lmstat to check the status of the license server
+# described by the license file given as argument.
+# Check and interpret the output of lmstat
+# and create returncodes and output.
+#
+# Contrary to most other plugins, this script takes
+# a file, not a hostname as an argument and returns
+# the status of hosts and services described in that
+# file. Use these hosts.cfg entries as an example
+#
+#host[anchor]=any host will do;some.address.com;;check-host-alive;3;120;24x7;1;1;1;
+#service[anchor]=yodel;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_flexlm!/opt/lic/licfiles/yodel_lic
+#service[anchor]=yeehaw;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_flexlm!/opt/lic/licfiles/yeehaw_lic
+#command[check_flexlm]=/some/path/libexec/check_flexlm.pl $ARG1$
+#
+# Notes:
+# - you need the lmstat utility which comes with flexlm.
+# - set the correct path in the variable $lmstat.
+#
+# initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com
+#
+# License: GPL
+#
+# lmstat output patches from Steve Rigler/Cliff Rice 13-Apr-2002
+# srigler@marathonoil.com,cerice@marathonoil.com
+
+
+
+use strict;
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_F $opt_t $verbose $PROGNAME);
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw(%ERRORS &print_revision &support &usage);
+
+$PROGNAME="check_flexlm";
+
+sub print_help ();
+sub print_usage ();
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+
+Getopt::Long::Configure('bundling');
+GetOptions
+ ("V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "v" => \$verbose, "verbose" => \$verbose,
+ "F=s" => \$opt_F, "filename=s" => \$opt_F,
+ "t=i" => \$opt_t, "timeout=i" => \$opt_t);
+
+if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+}
+
+unless (defined $opt_t) {
+ $opt_t = $utils::TIMEOUT ; # default timeout
+}
+
+
+if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
+
+unless (defined $opt_F) {
+ print "Missing license.dat file\n";
+ print_usage();
+ exit $ERRORS{'UNKNOWN'};
+}
+# Just in case of problems, let's not hang the monitoring system
+$SIG{'ALRM'} = sub {
+ print "Timeout: No Answer from Client\n";
+ exit $ERRORS{'UNKNOWN'};
+};
+alarm($opt_t);
+
+my $lmstat = $utils::PATH_TO_LMSTAT ;
+unless (-x $lmstat ) {
+ print "Cannot find \"lmstat\"\n";
+ exit $ERRORS{'UNKNOWN'};
+}
+
+($opt_F) || ($opt_F = shift) || usage("License file not specified\n");
+my $licfile = $1 if ($opt_F =~ /^(.*)$/);
+($licfile) || usage("Invalid filename: $opt_F\n");
+
+print "$licfile\n" if $verbose;
+
+if ( ! open(CMD,"$lmstat -c $licfile |") ) {
+ print "ERROR: Could not open \"$lmstat -c $licfile\" ($!)\n";
+ exit exit $ERRORS{'UNKNOWN'};
+}
+
+my $serverup = 0;
+my @upsrv;
+my @downsrv; # list of servers up and down
+
+#my ($ls1,$ls2,$ls3,$lf1,$lf2,$lf3,$servers);
+
+# key off of the term "license server" and
+# grab the status. Keep going until "Vendor" is found
+#
+
+#
+# Collect list of license servers by their status
+# Vendor daemon status is ignored for the moment.
+
+while ( <CMD> ) {
+ next if (/^lmstat/); # ignore 1st line - copyright
+ next if (/^Flexible/); # ignore 2nd line - timestamp
+ (/^Vendor/) && last; # ignore Vendor daemon status
+ print $_ if $verbose;
+
+ if ($_ =~ /license server /) { # matched 1 (of possibly 3) license server
+ s/^\s*//; #some servers start at col 1, other have whitespace
+ # strip staring whitespace if any
+ if ( $_ =~ /UP/) {
+ $_ =~ /^(.*):/ ;
+ push(@upsrv, $1);
+ print "up:$1:\n" if $verbose;
+ } else {
+ $_ =~ /^(.*):/;
+ push(@downsrv, $1);
+ print "down:$1:\n" if $verbose;
+ }
+
+ }
+
+
+# if ( /^License server status: [0-9]*@([-0-9a-zA-Z_]*),[0-9]*@([-0-9a-zA-Z_]*),[0-9]*@([-0-9a-zA-Z_]*)/ ) {
+# $ls1 = $1;
+# $ls2 = $2;
+# $ls3 = $3;
+# $lf1 = $lf2 = $lf3 = 0;
+# $servers = 3;
+# } elsif ( /^License server status: [0-9]*@([-0-9a-zA-Z_]*)/ ) {
+# $ls1 = $1;
+# $ls2 = $ls3 = "";
+# $lf1 = $lf2 = $lf3 = 0;
+# $servers = 1;
+# } elsif ( / *$ls1: license server UP/ ) {
+# print "$ls1 UP, ";
+# $lf1 = 1
+# } elsif ( / *$ls2: license server UP/ ) {
+# print "$ls2 UP, ";
+# $lf2 = 1
+# } elsif ( / *$ls3: license server UP/ ) {
+# print "$ls3 UP, ";
+# $lf3 = 1
+# } elsif ( / *([^:]*: UP .*)/ ) {
+# print " license server for $1\n";
+# $serverup = 1;
+# }
+
+}
+
+#if ( $serverup == 0 ) {
+# print " license server not running\n";
+# exit 2;
+#}
+
+close CMD;
+
+if ($verbose) {
+ print "License Servers running: ".scalar(@upsrv) ."\n";
+ foreach my $upserver (@upsrv) {
+ print "$upserver\n";
+ }
+ print "License servers not running: ".scalar(@downsrv)."\n";
+ foreach my $downserver (@downsrv) {
+ print "$downserver\n";
+ }
+}
+
+#
+# print list of servers which are up.
+#
+if (scalar(@upsrv) > 0) {
+ print "License Servers running:";
+ foreach my $upserver (@upsrv) {
+ print "$upserver,";
+ }
+}
+#
+# Ditto for those which are down.
+#
+if (scalar(@downsrv) > 0) {
+ print "License servers NOT running:";
+ foreach my $downserver (@downsrv) {
+ print "$downserver,";
+ }
+}
+
+# perfdata
+print "\n|flexlm::up:".scalar(@upsrv).";down:".scalar(@downsrv)."\n";
+
+exit $ERRORS{'OK'} if ( scalar(@downsrv) == 0 );
+exit $ERRORS{'WARNING'} if ( (scalar(@upsrv) > 0) && (scalar(@downsrv) > 0));
+
+#exit $ERRORS{'OK'} if ( $servers == $lf1 + $lf2 + $lf3 );
+#exit $ERRORS{'WARNING'} if ( $servers == 3 && $lf1 + $lf2 + $lf3 == 2 );
+exit $ERRORS{'CRITICAL'};
+
+
+sub print_usage () {
+ print "Usage:
+ $PROGNAME -F <filename> [-v] [-t] [-V] [-h]
+ $PROGNAME --help
+ $PROGNAME --version
+";
+}
+
+sub print_help () {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2000 Ernst-Dieter Martin/Karl DeBisschop
+
+Check available flexlm license managers
+
+";
+ print_usage();
+ print "
+-F, --filename=FILE
+ Name of license file (usually \"license.dat\")
+-v, --verbose
+ Print some extra debugging information (not advised for normal operation)
+-t, --timeout
+ Plugin time out in seconds (default = $utils::TIMEOUT )
+-V, --version
+ Show version and license information
+-h, --help
+ Show this help screen
+
+Flexlm license managers usually run as a single server or three servers and a
+quorum is needed. The plugin return OK if 1 (single) or 3 (triple) servers
+are running, CRITICAL if 1(single) or 3 (triple) servers are down, and WARNING
+if 1 or 2 of 3 servers are running\n
+";
+ support();
+}
diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl
new file mode 100755
index 0000000..e335cda
--- /dev/null
+++ b/plugins-scripts/check_ifoperstatus.pl
@@ -0,0 +1,478 @@
+#!@PERL@ -w
+#
+# check_ifoperstatus.pl - monitoring plugin
+#
+# Copyright (C) 2000 Christoph Kron,
+# Modified 5/2002 to conform to updated Monitoring Plugins Guidelines
+# Added support for named interfaces per Valdimir Ivaschenko (S. Ghosh)
+# Added SNMPv3 support (10/2003)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA
+#
+#
+# Report bugs to: help@monitoring-plugins.org
+#
+# 11.01.2000 Version 1.0
+#
+# Patches from Guy Van Den Bergh to warn on ifadminstatus down interfaces
+# instead of critical.
+#
+# Primary MIB reference - RFC 2863
+
+
+use POSIX;
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+use Net::SNMP;
+use Getopt::Long;
+&Getopt::Long::config('bundling');
+
+my $PROGNAME = "check_ifoperstatus";
+sub print_help ();
+sub usage ($);
+sub print_usage ();
+sub process_arguments ();
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+
+my $timeout;
+my $status;
+my %ifOperStatus = ('1','up',
+ '2','down',
+ '3','testing',
+ '4','unknown',
+ '5','dormant',
+ '6','notPresent',
+ '7','lowerLayerDown'); # down due to the state of lower layer interface(s)
+
+my $state = "UNKNOWN";
+my $answer = "";
+my $snmpkey = 0;
+my $community = "public";
+my $maxmsgsize = 1472 ; # Net::SNMP default is 1472
+my ($seclevel, $authproto, $secname, $authpass, $privpass, $privproto, $auth, $priv, $context);
+my $port = 161;
+my @snmpoids;
+my $sysUptime = '1.3.6.1.2.1.1.3.0';
+my $snmpIfDescr = '1.3.6.1.2.1.2.2.1.2';
+my $snmpIfType = '1.3.6.1.2.1.2.2.1.3';
+my $snmpIfAdminStatus = '1.3.6.1.2.1.2.2.1.7';
+my $snmpIfOperStatus = '1.3.6.1.2.1.2.2.1.8';
+my $snmpIfName = '1.3.6.1.2.1.31.1.1.1.1';
+my $snmpIfLastChange = '1.3.6.1.2.1.2.2.1.9';
+my $snmpIfAlias = '1.3.6.1.2.1.31.1.1.1.18';
+my $snmpLocIfDescr = '1.3.6.1.4.1.9.2.2.1.1.28';
+my $hostname;
+my $ifName;
+my $session;
+my $error;
+my $response;
+my $snmp_version = 1 ;
+my $ifXTable;
+my $opt_h ;
+my $opt_V ;
+my $ifdescr;
+my $iftype;
+my $key;
+my $lastc;
+my $dormantWarn;
+my $adminWarn;
+my $name;
+my %session_opts;
+
+### Validate Arguments
+
+$status = process_arguments();
+
+
+# Just in case of problems, let's not hang the monitoring system
+$SIG{'ALRM'} = sub {
+ print ("ERROR: No snmp response from $hostname (alarm)\n");
+ exit $ERRORS{"UNKNOWN"};
+};
+
+alarm($timeout);
+
+($session, $error) = Net::SNMP->session(%session_opts);
+
+
+if (!defined($session)) {
+ $state='UNKNOWN';
+ $answer=$error;
+ print ("$state: $answer\n");
+ exit $ERRORS{$state};
+}
+
+## map ifdescr to ifindex - should look at being able to cache this value
+
+if (defined $ifdescr || defined $iftype) {
+ if (defined $iftype) {
+ $status=fetch_ifindex($snmpIfType, $iftype);
+ } else {
+ # escape "/" in ifdescr - very common in the Cisco world
+ $ifdescr =~ s/\//\\\//g;
+ $status=fetch_ifindex($snmpIfDescr, $ifdescr); # if using on device with large number of interfaces
+ # recommend use of SNMP v2 (get-bulk)
+ }
+ if ($status==0) {
+ $state = "UNKNOWN";
+ printf "$state: could not retrieve ifdescr/iftype snmpkey - $status-$snmpkey\n";
+ $session->close;
+ exit $ERRORS{$state};
+ }
+}
+
+
+## Main function
+
+$snmpIfAdminStatus = $snmpIfAdminStatus . "." . $snmpkey;
+$snmpIfOperStatus = $snmpIfOperStatus . "." . $snmpkey;
+$snmpIfDescr = $snmpIfDescr . "." . $snmpkey;
+$snmpIfName = $snmpIfName . "." . $snmpkey ;
+$snmpIfAlias = $snmpIfAlias . "." . $snmpkey ;
+
+push(@snmpoids,$snmpIfAdminStatus);
+push(@snmpoids,$snmpIfOperStatus);
+push(@snmpoids,$snmpIfDescr);
+push(@snmpoids,$snmpIfName) if (defined $ifXTable) ;
+push(@snmpoids,$snmpIfAlias) if (defined $ifXTable) ;
+
+if (!defined($response = $session->get_request(@snmpoids))) {
+ $answer=$session->error;
+ $session->close;
+ $state = 'WARNING';
+ print ("$state: SNMP error: $answer\n");
+ exit $ERRORS{$state};
+}
+
+$answer = sprintf("host '%s', %s(%s) is %s\n",
+ $hostname,
+ $response->{$snmpIfDescr},
+ $snmpkey,
+ $ifOperStatus{$response->{$snmpIfOperStatus}}
+);
+
+
+## Check to see if ifName match is requested and it matches - exit if no match
+## not the interface we want to monitor
+if ( defined $ifName && not ($response->{$snmpIfName} eq $ifName) ) {
+ $state = 'UNKNOWN';
+ $answer = "Interface name ($ifName) doesn't match snmp value ($response->{$snmpIfName}) (index $snmpkey)";
+ print ("$state: $answer\n");
+ exit $ERRORS{$state};
+}
+
+## define the interface name
+if (defined $ifXTable) {
+ $name = $response->{$snmpIfName} ." - " .$response->{$snmpIfAlias} ;
+}else{
+ $name = $response->{$snmpIfDescr} ;
+}
+
+## if AdminStatus is down - some one made a conscious effort to change config
+##
+if ( not ($response->{$snmpIfAdminStatus} == 1) ) {
+ $answer = "Interface $name (index $snmpkey) is administratively down.";
+ if ( not defined $adminWarn or $adminWarn eq "w" ) {
+ $state = 'WARNING';
+ } elsif ( $adminWarn eq "i" ) {
+ $state = 'OK';
+ } elsif ( $adminWarn eq "c" ) {
+ $state = 'CRITICAL';
+ } else { # If wrong value for -a, say warning
+ $state = 'WARNING';
+ }
+}
+## Check operational status
+elsif ( $response->{$snmpIfOperStatus} == 2 ) {
+ $state = 'CRITICAL';
+ $answer = "Interface $name (index $snmpkey) is down.";
+} elsif ( $response->{$snmpIfOperStatus} == 5 ) {
+ if (defined $dormantWarn ) {
+ if ($dormantWarn eq "w") {
+ $state = 'WARNING';
+ $answer = "Interface $name (index $snmpkey) is dormant.";
+ }elsif($dormantWarn eq "c") {
+ $state = 'CRITICAL';
+ $answer = "Interface $name (index $snmpkey) is dormant.";
+ }elsif($dormantWarn eq "i") {
+ $state = 'OK';
+ $answer = "Interface $name (index $snmpkey) is dormant.";
+ }
+ }else{
+ # dormant interface - but warning/critical/ignore not requested
+ $state = 'CRITICAL';
+ $answer = "Interface $name (index $snmpkey) is dormant.";
+ }
+} elsif ( $response->{$snmpIfOperStatus} == 6 ) {
+ $state = 'CRITICAL';
+ $answer = "Interface $name (index $snmpkey) notPresent - possible hotswap in progress.";
+} elsif ( $response->{$snmpIfOperStatus} == 7 ) {
+ $state = 'CRITICAL';
+ $answer = "Interface $name (index $snmpkey) down due to lower layer being down.";
+} elsif ( $response->{$snmpIfOperStatus} == 3 || $response->{$snmpIfOperStatus} == 4 ) {
+ $state = 'CRITICAL';
+ $answer = "Interface $name (index $snmpkey) down (testing/unknown).";
+} else {
+ $state = 'OK';
+ $answer = "Interface $name (index $snmpkey) is up.";
+}
+
+
+
+print ("$state: $answer\n");
+exit $ERRORS{$state};
+
+
+### subroutines
+
+sub fetch_ifindex {
+ my $oid = shift;
+ my $lookup = shift;
+
+ if (!defined ($response = $session->get_table($oid))) {
+ $answer=$session->error;
+ $session->close;
+ $state = 'CRITICAL';
+ printf ("$state: SNMP error with snmp version $snmp_version ($answer)\n");
+ $session->close;
+ exit $ERRORS{$state};
+ }
+
+ foreach $key ( keys %{$response}) {
+ if ($response->{$key} =~ /^$lookup$/) {
+ $key =~ /.*\.(\d+)$/;
+ $snmpkey = $1;
+ #print "$lookup = $key / $snmpkey \n"; #debug
+ }
+ }
+ unless (defined $snmpkey) {
+ $session->close;
+ $state = 'CRITICAL';
+ printf "$state: Could not match $ifdescr on $hostname\n";
+ exit $ERRORS{$state};
+ }
+
+ return $snmpkey;
+}
+
+sub usage($) {
+ print "$_[0]\n";
+ print_usage();
+ exit $ERRORS{"UNKNOWN"};
+}
+
+sub print_usage() {
+ printf "\n";
+ printf "usage: \n";
+ printf "check_ifoperstatus -k <IF_KEY> -H <HOSTNAME> [-C <community>]\n";
+ printf "Copyright (C) 2000 Christoph Kron\n";
+ printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n";
+ printf "This program is licensed under the terms of the ";
+ printf "GNU General Public License\n(check source code for details)\n";
+ printf "\n\n";
+}
+
+sub print_help() {
+ print_revision($PROGNAME, '@NP_VERSION@');
+ print_usage();
+ printf "check_ifoperstatus plugin for monitoring operational \n";
+ printf "status of a particular network interface on the target host\n";
+ printf "\nUsage:\n";
+ printf " -H (--hostname) Hostname to query - (required)\n";
+ printf " -C (--community) SNMP read community (defaults to public,\n";
+ printf " used with SNMP v1 and v2c\n";
+ printf " -v (--snmp_version) 1 for SNMP v1 (default)\n";
+ printf " 2 for SNMP v2c\n";
+ printf " SNMP v2c will use get_bulk for less overhead\n";
+ printf " if monitoring with -d\n";
+ printf " -L (--seclevel) choice of \"noAuthNoPriv\", \"authNoPriv\", or \"authPriv\"\n";
+ printf " -U (--secname) username for SNMPv3 context\n";
+ printf " -c (--context) SNMPv3 context name (default is empty string)\n";
+ printf " -A (--authpass) authentication password (cleartext ascii or localized key\n";
+ printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n";
+ printf " auth password and authEngineID\n";
+ printf " -a (--authproto) Authentication protocol (MD5 or SHA1)\n";
+ printf " -X (--privpass) privacy password (cleartext ascii or localized key\n";
+ printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n";
+ printf " privacy password and authEngineID\n";
+ printf " -P (--privproto) privacy protocol (DES or AES; default: DES)\n";
+ printf " -k (--key) SNMP IfIndex value\n";
+ printf " -d (--descr) SNMP ifDescr value\n";
+ printf " -T (--type) SNMP ifType integer value (see http://www.iana.org/assignments/ianaiftype-mib)\n";
+ printf " -p (--port) SNMP port (default 161)\n";
+ printf " -I (--ifmib) Agent supports IFMIB ifXTable. Do not use if\n";
+ printf " you don't know what this is. \n";
+ printf " -n (--name) the value should match the returned ifName\n";
+ printf " (Implies the use of -I)\n";
+ printf " -w (--warn =i|w|c) ignore|warn|crit if the interface is dormant (default critical)\n";
+ printf " -D (--admin-down =i|w|c) same for administratively down interfaces (default warning)\n";
+ printf " -M (--maxmsgsize) Max message size - useful only for v1 or v2c\n";
+ printf " -t (--timeout) seconds before the plugin times out (default=$TIMEOUT)\n";
+ printf " -V (--version) Plugin version\n";
+ printf " -h (--help) usage help \n\n";
+ printf " -k or -d or -T must be specified\n\n";
+ printf "Note: either -k or -d or -T must be specified and -d and -T are much more network \n";
+ printf "intensive. Use it sparingly or not at all. -n is used to match against\n";
+ printf "a much more descriptive ifName value in the IfXTable to verify that the\n";
+ printf "snmpkey has not changed to some other network interface after a reboot.\n\n";
+
+}
+
+sub process_arguments() {
+ $status = GetOptions(
+ "V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "v=i" => \$snmp_version, "snmp_version=i" => \$snmp_version,
+ "C=s" => \$community, "community=s" => \$community,
+ "L=s" => \$seclevel, "seclevel=s" => \$seclevel,
+ "a=s" => \$authproto, "authproto=s" => \$authproto,
+ "U=s" => \$secname, "secname=s" => \$secname,
+ "A=s" => \$authpass, "authpass=s" => \$authpass,
+ "X=s" => \$privpass, "privpass=s" => \$privpass,
+ "P=s" => \$privproto, "privproto=s" => \$privproto,
+ "c=s" => \$context, "context=s" => \$context,
+ "k=i" => \$snmpkey, "key=i",\$snmpkey,
+ "d=s" => \$ifdescr, "descr=s" => \$ifdescr,
+ "l=s" => \$lastc, "lastchange=s" => \$lastc,
+ "p=i" => \$port, "port=i" =>\$port,
+ "H=s" => \$hostname, "hostname=s" => \$hostname,
+ "I" => \$ifXTable, "ifmib" => \$ifXTable,
+ "n=s" => \$ifName, "name=s" => \$ifName,
+ "w=s" => \$dormantWarn, "warn=s" => \$dormantWarn,
+ "D=s" => \$adminWarn, "admin-down=s" => \$adminWarn,
+ "M=i" => \$maxmsgsize, "maxmsgsize=i" => \$maxmsgsize,
+ "t=i" => \$timeout, "timeout=i" => \$timeout,
+ "T=i" => \$iftype, "type=i" => \$iftype,
+ );
+
+
+ if ($status == 0){
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ($opt_h) {
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if (! utils::is_hostname($hostname)){
+ usage("Hostname invalid or not given");
+ }
+
+ unless ($snmpkey > 0 || defined $ifdescr || defined $iftype){
+ usage("Either a valid snmp key (-k) or a ifDescr (-d) must be provided");
+ }
+
+ if (defined $ifName) {
+ $ifXTable=1;
+ }
+
+ if (defined $dormantWarn) {
+ unless ($dormantWarn =~ /^(w|c|i)$/ ) {
+ printf "Dormant alerts must be one of w|c|i \n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }
+
+ unless (defined $timeout) {
+ $timeout = $TIMEOUT;
+ }
+
+ if ($snmp_version !~ /[123]/){
+ $state='UNKNOWN';
+ print ("$state: No support for SNMP v$snmp_version yet\n");
+ exit $ERRORS{$state};
+ }
+
+ %session_opts = (
+ -hostname => $hostname,
+ -port => $port,
+ -version => $snmp_version,
+ -maxmsgsize => $maxmsgsize
+ );
+
+ $session_opts{'-community'} = $community if (defined $community && $snmp_version =~ /[12]/);
+
+ if ($snmp_version =~ /3/ ) {
+ # Must define a security level even though default is noAuthNoPriv
+ # v3 requires a security username
+ if (defined $seclevel && defined $secname) {
+ $session_opts{'-username'} = $secname;
+
+ # Must define a security level even though default is noAuthNoPriv
+ unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) {
+ usage("Must define a valid security level even though default is noAuthNoPriv");
+ }
+
+ # Authentication wanted
+ if ( $seclevel eq 'authNoPriv' || $seclevel eq 'authPriv' ) {
+ if (defined $authproto && $authproto ne 'MD5' && $authproto ne 'SHA1') {
+ usage("Auth protocol can be either MD5 or SHA1");
+ }
+ $session_opts{'-authprotocol'} = $authproto if(defined $authproto);
+
+ if ( !defined $authpass) {
+ usage("Auth password/key is not defined");
+ }else{
+ if ($authpass =~ /^0x/ ) {
+ $session_opts{'-authkey'} = $authpass ;
+ }else{
+ $session_opts{'-authpassword'} = $authpass ;
+ }
+ }
+ }
+
+ # Privacy (DES encryption) wanted
+ if ($seclevel eq 'authPriv' ) {
+ if (! defined $privpass) {
+ usage("Privacy passphrase/key is not defined");
+ }else{
+ if ($privpass =~ /^0x/){
+ $session_opts{'-privkey'} = $privpass;
+ }else{
+ $session_opts{'-privpassword'} = $privpass;
+ }
+ }
+
+ $session_opts{'-privprotocol'} = $privproto if(defined $privproto);
+ }
+
+ # Context name defined or default
+ unless ( defined $context) {
+ $context = "";
+ }
+
+ }else {
+ usage("Security level or name is not defined");
+ }
+ } # end snmpv3
+
+
+}
+## End validation
+
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl
new file mode 100755
index 0000000..38b87fc
--- /dev/null
+++ b/plugins-scripts/check_ifstatus.pl
@@ -0,0 +1,448 @@
+#!@PERL@ -w
+#
+# check_ifstatus.pl - monitoring plugin
+#
+#
+# Copyright (C) 2000 Christoph Kron
+# Modified 5/2002 to conform to updated Monitoring Plugins Guidelines (S. Ghosh)
+# Added -x option (4/2003)
+# Added -u option (4/2003)
+# Added -M option (10/2003)
+# Added SNMPv3 support (10/2003)
+# Added -n option (07/2014)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+#
+# Report bugs to: ck@zet.net, help@monitoring-plugins.org
+#
+# 11.01.2000 Version 1.0
+#
+
+use POSIX;
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+use Net::SNMP;
+use Getopt::Long;
+Getopt::Long::Configure('bundling');
+
+my $PROGNAME = "check_ifstatus";
+
+sub print_help ();
+sub usage ($);
+sub print_usage ();
+sub process_arguments ();
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+
+my $status;
+my %ifOperStatus = ('1','up',
+ '2','down',
+ '3','testing',
+ '4','unknown',
+ '5','dormant',
+ '6','notPresent',
+ '7','lowerLayerDown'); # down due to the state of lower layer interface(s));
+
+my $timeout ;
+my $state = "UNKNOWN";
+my $answer = "";
+my $snmpkey=0;
+my $snmpoid=0;
+my $key=0;
+my $community = "public";
+my $maxmsgsize = 1472 ; # Net::SNMP default is 1472
+my ($seclevel, $authproto, $secname, $authpass, $privpass, $privproto, $auth, $priv, $context);
+my $port = 161;
+my @snmpoids;
+my $snmpIfAdminStatus = '1.3.6.1.2.1.2.2.1.7';
+my $snmpIfDescr = '1.3.6.1.2.1.2.2.1.2';
+my $snmpIfOperStatus = '1.3.6.1.2.1.2.2.1.8';
+my $snmpIfName = '1.3.6.1.2.1.31.1.1.1.1';
+my $snmpIfAlias = '1.3.6.1.2.1.31.1.1.1.18';
+my $snmpLocIfDescr = '1.3.6.1.4.1.9.2.2.1.1.28';
+my $snmpIfType = '1.3.6.1.2.1.2.2.1.3';
+my $hostname;
+my $session;
+my $error;
+my $response;
+my %ifStatus;
+my $ifup =0 ;
+my $ifdown =0;
+my $ifdormant = 0;
+my $ifexclude = 0 ;
+my $ifunused = 0;
+my $ifmessage = "";
+my $snmp_version = 1;
+my $ifXTable;
+my $opt_h ;
+my $opt_V ;
+my $opt_u;
+my $opt_n;
+my $opt_x ;
+my %excluded ;
+my %unused_names ;
+my @unused_ports ;
+my %session_opts;
+
+
+
+
+
+# Just in case of problems, let's not hang the monitoring system
+$SIG{'ALRM'} = sub {
+ print ("ERROR: No snmp response from $hostname (alarm timeout)\n");
+ exit $ERRORS{"UNKNOWN"};
+};
+
+
+#Option checking
+$status = process_arguments();
+
+if ($status != 0)
+{
+ print_help() ;
+ exit $ERRORS{'UNKNOWN'};
+}
+
+
+alarm($timeout);
+($session, $error) = Net::SNMP->session(%session_opts);
+
+if (!defined($session)) {
+ $state='UNKNOWN';
+ $answer=$error;
+ print ("$state: $answer\n");
+ exit $ERRORS{$state};
+}
+
+
+push(@snmpoids,$snmpIfOperStatus);
+push(@snmpoids,$snmpIfAdminStatus);
+push(@snmpoids,$snmpIfDescr);
+push(@snmpoids,$snmpIfType);
+push(@snmpoids,$snmpIfName) if ( defined $ifXTable);
+push(@snmpoids,$snmpIfAlias) if ( defined $ifXTable);
+
+
+
+
+foreach $snmpoid (@snmpoids) {
+
+ if (!defined($response = $session->get_table($snmpoid))) {
+ $answer=$session->error;
+ $session->close;
+ $state = 'CRITICAL';
+ if ( ( $snmpoid =~ $snmpIfName ) && defined $ifXTable ) {
+ print ("$state: Device does not support ifTable - try without -I option\n");
+ }else{
+ print ("$state: $answer for $snmpoid with snmp version $snmp_version\n");
+ }
+ exit $ERRORS{$state};
+ }
+
+ foreach $snmpkey (keys %{$response}) {
+ $snmpkey =~ /.*\.(\d+)$/;
+ $key = $1;
+ $ifStatus{$key}{$snmpoid} = $response->{$snmpkey};
+ }
+}
+
+
+$session->close;
+
+alarm(0);
+
+foreach $key (keys %ifStatus) {
+
+ # skip unused interfaces
+ my $ifName = $ifStatus{$key}{$snmpIfDescr};
+
+ if (!defined($ifStatus{$key}{'notInUse'}) && !grep(/^${ifName}/, @unused_ports )) {
+ # check only if interface is administratively up
+ if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) {
+ #check only if interface is not excluded
+ if (!defined $unused_names{$ifStatus{$key}{$snmpIfDescr}} ) {
+ # check only if interface type is not listed in %excluded
+ if (!defined $excluded{$ifStatus{$key}{$snmpIfType}} ) {
+ if ($ifStatus{$key}{$snmpIfOperStatus} == 1 ) { $ifup++ ; }
+ if ($ifStatus{$key}{$snmpIfOperStatus} == 2 ) {
+ $ifdown++ ;
+ if (defined $ifXTable) {
+ $ifmessage .= sprintf("%s: down -> %s<BR>\n", $ifStatus{$key}{$snmpIfName}, $ifStatus{$key}{$snmpIfAlias});
+ }else{
+ $ifmessage .= sprintf("%s: down <BR>\n",$ifStatus{$key}{$snmpIfDescr});
+ }
+ }
+ if ($ifStatus{$key}{$snmpIfOperStatus} == 5 ) { $ifdormant++ ;}
+ } else {
+ $ifexclude++;
+ }
+ } else {
+ $ifunused++;
+ }
+
+ }
+ }else{
+ $ifunused++;
+ }
+}
+
+ if ($ifdown > 0) {
+ $state = 'CRITICAL';
+ $answer = sprintf("host '%s', interfaces up: %d, down: %d, dormant: %d, excluded: %d, unused: %d<BR>",
+ $hostname,
+ $ifup,
+ $ifdown,
+ $ifdormant,
+ $ifexclude,
+ $ifunused);
+ $answer = $answer . $ifmessage . "\n";
+ }
+ else {
+ $state = 'OK';
+ $answer = sprintf("host '%s', interfaces up: %d, down: %d, dormant: %d, excluded: %d, unused: %d",
+ $hostname,
+ $ifup,
+ $ifdown,
+ $ifdormant,
+ $ifexclude,
+ $ifunused);
+ }
+my $perfdata = sprintf("up=%d down=%d dormant=%d excluded=%d unused=%d",$ifup,$ifdown,$ifdormant,$ifexclude,$ifunused);
+print ("$state: $answer |$perfdata\n");
+exit $ERRORS{$state};
+
+sub usage($) {
+ print "$_[0]\n";
+ print_usage();
+ exit $ERRORS{"UNKNOWN"};
+}
+
+sub print_usage() {
+ printf "\n";
+ printf "usage: \n";
+ printf "check_ifstatus -C <READCOMMUNITY> -p <PORT> -H <HOSTNAME>\n";
+ printf "Copyright (C) 2000 Christoph Kron\n";
+ printf "Updates 5/2002 Subhendu Ghosh\n";
+ support();
+ printf "\n\n";
+}
+
+sub print_help() {
+ print_revision($PROGNAME, '@NP_VERSION@');
+ print_usage();
+ printf "check_ifstatus plugin for monitoring operational \n";
+ printf "status of each network interface on the target host\n";
+ printf "\nUsage:\n";
+ printf " -H (--hostname) Hostname to query - (required)\n";
+ printf " -C (--community) SNMP read community (defaults to public,\n";
+ printf " used with SNMP v1 and v2c\n";
+ printf " -v (--snmp_version) 1 for SNMP v1 (default)\n";
+ printf " 2 for SNMP v2c\n";
+ printf " SNMP v2c will use get_bulk for less overhead\n";
+ printf " 3 for SNMPv3 (requires -U option)";
+ printf " -p (--port) SNMP port (default 161)\n";
+ printf " -I (--ifmib) Agent supports IFMIB ifXTable. For Cisco - this will provide\n";
+ printf " the descriptive name. Do not use if you don't know what this is. \n";
+ printf " -x (--exclude) A comma separated list of ifType values that should be excluded \n";
+ printf " from the report (default for an empty list is PPP(23).\n";
+ printf " -n (--unused_ports_by_name) A comma separated list of ifDescr values that should be excluded \n";
+ printf " from the report (default is an empty exclusion list).\n";
+ printf " -u (--unused_ports) A comma separated list of ifIndex values that should be excluded \n";
+ printf " from the report (default is an empty exclusion list).\n";
+ printf " See the IANAifType-MIB for a list of interface types.\n";
+ printf " -L (--seclevel) choice of \"noAuthNoPriv\", \"authNoPriv\", or \"authPriv\"\n";
+ printf " -U (--secname) username for SNMPv3 context\n";
+ printf " -c (--context) SNMPv3 context name (default is empty string)\n";
+ printf " -A (--authpass) authentication password (cleartext ascii or localized key\n";
+ printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n";
+ printf " auth password and authEngineID\n";
+ printf " -a (--authproto) Authentication protocol (MD5 or SHA1)\n";
+ printf " -X (--privpass) privacy password (cleartext ascii or localized key\n";
+ printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n";
+ printf " privacy password and authEngineID\n";
+ printf " -P (--privproto) privacy protocol (DES or AES; default: DES)\n";
+ printf " -M (--maxmsgsize) Max message size - useful only for v1 or v2c\n";
+ printf " -t (--timeout) seconds before the plugin times out (default=$TIMEOUT)\n";
+ printf " -V (--version) Plugin version\n";
+ printf " -h (--help) usage help \n\n";
+ print_revision($PROGNAME, '@NP_VERSION@');
+
+}
+
+sub process_arguments() {
+ $status = GetOptions(
+ "V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "v=s" => \$snmp_version, "snmp_version=s" => \$snmp_version,
+ "C=s" => \$community,"community=s" => \$community,
+ "L=s" => \$seclevel, "seclevel=s" => \$seclevel,
+ "a=s" => \$authproto, "authproto=s" => \$authproto,
+ "U=s" => \$secname, "secname=s" => \$secname,
+ "A=s" => \$authpass, "authpass=s" => \$authpass,
+ "X=s" => \$privpass, "privpass=s" => \$privpass,
+ "P=s" => \$privproto, "privproto=s" => \$privproto,
+ "c=s" => \$context, "context=s" => \$context,
+ "p=i" =>\$port, "port=i" => \$port,
+ "H=s" => \$hostname, "hostname=s" => \$hostname,
+ "I" => \$ifXTable, "ifmib" => \$ifXTable,
+ "x:s" => \$opt_x, "exclude:s" => \$opt_x,
+ "u=s" => \$opt_u, "unused_ports=s" => \$opt_u,
+ "n=s" => \$opt_n, "unused_ports_by_name=s" => \$opt_n,
+ "M=i" => \$maxmsgsize, "maxmsgsize=i" => \$maxmsgsize,
+ "t=i" => \$timeout, "timeout=i" => \$timeout,
+ );
+
+ if ($status == 0){
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ($opt_h) {
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ unless (defined $timeout) {
+ $timeout = $TIMEOUT;
+ }
+
+ # Net::SNMP wants an integer
+ $snmp_version = 2 if $snmp_version eq "2c";
+
+ if ($snmp_version !~ /^[123]$/){
+ $state='UNKNOWN';
+ print ("$state: No support for SNMP v$snmp_version yet\n");
+ exit $ERRORS{$state};
+ }
+
+ %session_opts = (
+ -hostname => $hostname,
+ -port => $port,
+ -version => $snmp_version,
+ -maxmsgsize => $maxmsgsize
+ );
+
+ $session_opts{'-community'} = $community if (defined $community && $snmp_version =~ /[12]/);
+
+ if ($snmp_version =~ /3/ ) {
+ # Must define a security level even though default is noAuthNoPriv
+ # v3 requires a security username
+ if (defined $seclevel && defined $secname) {
+ $session_opts{'-username'} = $secname;
+
+ # Must define a security level even though default is noAuthNoPriv
+ unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) {
+ usage("Must define a valid security level even though default is noAuthNoPriv");
+ }
+
+ # Authentication wanted
+ if ( $seclevel eq 'authNoPriv' || $seclevel eq 'authPriv' ) {
+ if (defined $authproto && $authproto ne 'MD5' && $authproto ne 'SHA1') {
+ usage("Auth protocol can be either MD5 or SHA1");
+ }
+ $session_opts{'-authprotocol'} = $authproto if(defined $authproto);
+
+ if ( !defined $authpass) {
+ usage("Auth password/key is not defined");
+ }else{
+ if ($authpass =~ /^0x/ ) {
+ $session_opts{'-authkey'} = $authpass ;
+ }else{
+ $session_opts{'-authpassword'} = $authpass ;
+ }
+ }
+ }
+
+ # Privacy (DES encryption) wanted
+ if ($seclevel eq 'authPriv' ) {
+ if (! defined $privpass) {
+ usage("Privacy passphrase/key is not defined");
+ }else{
+ if ($privpass =~ /^0x/){
+ $session_opts{'-privkey'} = $privpass;
+ }else{
+ $session_opts{'-privpassword'} = $privpass;
+ }
+ }
+
+ $session_opts{'-privprotocol'} = $privproto if(defined $privproto);
+ }
+
+ # Context name defined or default
+ unless ( defined $context) {
+ $context = "";
+ }
+
+ }else {
+ usage("Security level or name is not defined");
+ }
+ } # end snmpv3
+
+ # Excluded interfaces types (ifType) (backup interfaces, dial-on demand interfaces, PPP interfaces
+ if (defined $opt_x) {
+ my @x = split(/,/, $opt_x);
+ if ( @x) {
+ foreach $key (@x){
+ $excluded{$key} = 1;
+ }
+ }else{
+ $excluded{23} = 1; # default PPP(23) if empty list - note (AIX seems to think PPP is 22 according to a post)
+ }
+ }
+
+ # Excluded interface descriptors
+ if (defined $opt_n) {
+ my @unused = split(/,/,$opt_n);
+ if ( @unused ) {
+ foreach $key (@unused) {
+ $unused_names{$key} = 1;
+ }
+ }
+ }
+
+ # Excluded interface ports (ifIndex) - management reasons
+ if ($opt_u) {
+ @unused_ports = split(/,/,$opt_u);
+ foreach $key (@unused_ports) {
+ $ifStatus{$key}{'notInUse'}++ ;
+ }
+ }
+
+ if (! utils::is_hostname($hostname)){
+ usage("Hostname invalid or not given");
+ exit $ERRORS{"UNKNOWN"};
+ }
+
+
+ if ($snmp_version !~ /[123]/) {
+ $state='UNKNOWN';
+ print ("$state: No support for SNMP v$snmp_version yet\n");
+ exit $ERRORS{$state};
+ }
+
+return $ERRORS{"OK"};
+}
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl
new file mode 100755
index 0000000..4822fe6
--- /dev/null
+++ b/plugins-scripts/check_ircd.pl
@@ -0,0 +1,238 @@
+#!@PERL@ -w
+
+# -----------------------------------------------------------------------------
+# File Name: check_ircd.pl
+#
+# Author: Richard Mayhew - South Africa
+#
+# Date: 1999/09/20
+#
+#
+# Description: This script will check to see if an IRCD is running
+# about how many users it has
+#
+# Email: netsaint@splash.co.za
+#
+# -----------------------------------------------------------------------------
+# Copyright 1999 (c) Richard Mayhew
+#
+# If any changes are made to this script, please mail me a copy of the
+# changes :)
+#
+# Some code taken from Charlie Cook (check_disk.pl)
+#
+# License GPL
+#
+# -----------------------------------------------------------------------------
+# Date Author Reason
+# ---- ------ ------
+#
+# 1999/09/20 RM Creation
+#
+# 1999/09/20 TP Changed script to use strict, more secure by
+# specifying $ENV variables. The bind command is
+# still insecure through. Did most of my work
+# with perl -wT and 'use strict'
+#
+# test using check_ircd.pl (irc-2.mit.edu|irc.erols.com|irc.core.com)
+# 2002/05/02 SG Fixed for Embedded Perl
+#
+
+# ----------------------------------------------------------------[ Require ]--
+
+require 5.004;
+
+# -------------------------------------------------------------------[ Uses ]--
+
+use Socket;
+use strict;
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_t $opt_p $opt_H $opt_w $opt_c $verbose);
+use vars qw($PROGNAME);
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw($TIMEOUT %ERRORS &print_revision &support &usage);
+
+# ----------------------------------------------------[ Function Prototypes ]--
+
+sub print_help ();
+sub print_usage ();
+sub connection ($$$$);
+sub bindRemote ($$);
+
+# -------------------------------------------------------------[ Environment ]--
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+
+# -----------------------------------------------------------------[ Global ]--
+
+$PROGNAME = "check_ircd";
+# nickname shouldn't be longer than 9 chars, this might happen with large PIDs
+# To prevent this, we cut of the part over 10000
+my $NICK="ircd" . $$ % 10000;
+my $USER_INFO="monitor localhost localhost : ";
+
+# -------------------------------------------------------------[ connection ]--
+sub connection ($$$$)
+{
+ my ($in_remotehost,$in_users,$in_warn,$in_crit) = @_;
+ my $state;
+ my $answer;
+
+ print "connection(debug): users = $in_users\n" if $verbose;
+ $in_users =~ s/\ //g;
+
+ if ($in_users >= 0) {
+
+ if ($in_users > $in_crit) {
+ $state = "CRITICAL";
+ $answer = "Critical Number Of Clients Connected : $in_users (Limit = $in_crit)\n";
+
+ } elsif ($in_users > $in_warn) {
+ $state = "WARNING";
+ $answer = "Warning Number Of Clients Connected : $in_users (Limit = $in_warn)\n";
+
+ } else {
+ $state = "OK";
+ $answer = "IRCD ok - Current Local Users: $in_users\n";
+ }
+
+ } else {
+ $state = "UNKNOWN";
+ $answer = "Server $in_remotehost has less than 0 users! Something is Really WRONG!\n";
+ }
+
+ print ClientSocket "quit\n";
+ print $answer;
+ exit $ERRORS{$state};
+}
+
+# ------------------------------------------------------------[ print_usage ]--
+
+sub print_usage () {
+ print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>] [-p <port>]\n";
+}
+
+# -------------------------------------------------------------[ print_help ]--
+
+sub print_help ()
+{
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop
+
+Perl Check IRCD plugin for monitoring
+
+";
+ print_usage();
+ print "
+-H, --hostname=HOST
+ Name or IP address of host to check
+-w, --warning=INTEGER
+ Number of connected users which generates a warning state (Default: 50)
+-c, --critical=INTEGER
+ Number of connected users which generates a critical state (Default: 100)
+-p, --port=INTEGER
+ Port that the ircd daemon is running on <host> (Default: 6667)
+-v, --verbose
+ Print extra debugging information
+";
+}
+
+# -------------------------------------------------------------[ bindRemote ]--
+
+sub bindRemote ($$)
+{
+ my ($in_remotehost, $in_remoteport) = @_;
+ my $proto = getprotobyname('tcp');
+ my $that;
+ my ($name, $aliases,$type,$len,$thataddr) = gethostbyname($in_remotehost);
+
+ if (!socket(ClientSocket,AF_INET, SOCK_STREAM, $proto)) {
+ print "IRCD UNKNOWN: Could not start socket ($!)\n";
+ exit $ERRORS{"UNKNOWN"};
+ }
+ $that = pack_sockaddr_in ($in_remoteport, $thataddr);
+ if (!connect(ClientSocket, $that)) {
+ print "IRCD UNKNOWN: Could not connect socket ($!)\n";
+ exit $ERRORS{"UNKNOWN"};
+ }
+ select(ClientSocket); $| = 1; select(STDOUT);
+ return \*ClientSocket;
+}
+
+# ===================================================================[ MAIN ]==
+
+MAIN:
+{
+ my $hostname;
+
+ Getopt::Long::Configure('bundling');
+ GetOptions
+ ("V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "v" => \$verbose,"verbose" => \$verbose,
+ "t=i" => \$opt_t, "timeout=i" => \$opt_t,
+ "w=i" => \$opt_w, "warning=i" => \$opt_w,
+ "c=i" => \$opt_c, "critical=i" => \$opt_c,
+ "p=i" => \$opt_p, "port=i" => \$opt_p,
+ "H=s" => \$opt_H, "hostname=s" => \$opt_H);
+
+ if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
+
+ ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
+ my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
+ ($remotehost) || usage("Invalid host: $opt_H\n");
+
+ ($opt_w) || ($opt_w = shift @ARGV) || ($opt_w = 50);
+ my $warn = $1 if ($opt_w =~ /^([0-9]+)$/);
+ ($warn) || usage("Invalid warning threshold: $opt_w\n");
+
+ ($opt_c) || ($opt_c = shift @ARGV) || ($opt_c = 100);
+ my $crit = $1 if ($opt_c =~ /^([0-9]+)$/);
+ ($crit) || usage("Invalid critical threshold: $opt_c\n");
+
+ ($opt_p) || ($opt_p = shift @ARGV) || ($opt_p = 6667);
+ my $remoteport = $1 if ($opt_p =~ /^([0-9]+)$/);
+ ($remoteport) || usage("Invalid port: $opt_p\n");
+
+ if ($opt_t && $opt_t =~ /^([0-9]+)$/) { $TIMEOUT = $1; }
+
+ # Just in case of problems, let's not hang the monitoring system
+ $SIG{'ALRM'} = sub {
+ print "Something is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n";
+ exit $ERRORS{"UNKNOWN"};
+ };
+
+ alarm($TIMEOUT);
+
+ my ($name, $alias, $proto) = getprotobyname('tcp');
+
+ print "MAIN(debug): binding to remote host: $remotehost -> $remoteport\n" if $verbose;
+ my $ClientSocket = &bindRemote($remotehost,$remoteport);
+
+ print ClientSocket "NICK $NICK\nUSER $USER_INFO\n";
+
+ while (<ClientSocket>) {
+ print "MAIN(debug): default var = $_\n" if $verbose;
+
+ # DALnet,LagNet,UnderNet etc. Require this!
+ # Replies with a PONG when presented with a PING query.
+ # If a server doesn't require it, it will be ignored.
+
+ if (m/^PING (.*)/) {print ClientSocket "PONG $1\n";}
+
+ alarm(0);
+
+ # Look for pattern in IRCD Output to gather Client Connections total.
+ connection($remotehost,$1,$warn,$crit) if (m/:I have\s+(\d+)/);
+ }
+ print "IRCD UNKNOWN: Unknown error - maybe could not authenticate\n";
+ exit $ERRORS{"UNKNOWN"};
+}
diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh
new file mode 100755
index 0000000..8ecdd31
--- /dev/null
+++ b/plugins-scripts/check_log.sh
@@ -0,0 +1,244 @@
+#!/bin/sh
+#
+# Log file pattern detector plugin for monitoring
+# Written originally by Ethan Galstad (nagios@nagios.org)
+#
+# Usage: ./check_log <log_file> <old_log_file> <pattern>
+#
+# Description:
+#
+# This plugin will scan a log file (specified by the <log_file> option)
+# for a specific pattern (specified by the <pattern> option). Successive
+# calls to the plugin script will only report *new* pattern matches in the
+# log file, since an copy of the log file from the previous run is saved
+# to <old_log_file>.
+#
+# Output:
+#
+# On the first run of the plugin, it will return an OK state with a message
+# of "Log check data initialized". On successive runs, it will return an OK
+# state if *no* pattern matches have been found in the *difference* between the
+# log file and the older copy of the log file. If the plugin detects any
+# pattern matches in the log diff, it will return a CRITICAL state and print
+# out a message is the following format: "(x) last_match", where "x" is the
+# total number of pattern matches found in the file and "last_match" is the
+# last entry in the log file which matches the pattern.
+#
+# Notes:
+#
+# If you use this plugin make sure to keep the following in mind:
+#
+# 1. The "max_attempts" value for the service should be 1, as this will
+# prevent the monitoring system from retrying the service check (the
+# next time the check is run it will not produce the same results).
+#
+# 2. The "notify_recovery" value for the service should be 0, so that the
+# monitoring system does not notify you of "recoveries" for the check.
+# Since pattern matches in the log file will only be reported once and
+# not the next time, there will always be "recoveries" for the service,
+# even though recoveries really don't apply to this type of check.
+#
+# 3. You *must* supply a different <old_file_log> for each service that
+# you define to use this plugin script - even if the different services
+# check the same <log_file> for pattern matches. This is necessary
+# because of the way the script operates.
+#
+# 4. This plugin does NOT have an understanding of logrotation or similar
+# mechanisms. Therefore bad timing could lead to missing events
+#
+#
+# Examples:
+#
+# Check for login failures in the syslog...
+#
+# check_log /var/log/messages ./check_log.badlogins.old "LOGIN FAILURE"
+#
+# Check for port scan alerts generated by Psionic's PortSentry software...
+#
+# check_log /var/log/message ./check_log.portscan.old "attackalert"
+#
+
+# Paths to commands used in this script. These
+# may have to be modified to match your system setup.
+
+PATH="@TRUSTED_PATH@"
+export PATH
+PROGNAME=$(basename "$0")
+PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,')
+REVISION="@NP_VERSION@"
+
+. "$PROGPATH"/utils.sh
+
+print_usage() {
+ echo "Usage: $PROGNAME -F logfile -O oldlog -q query"
+ echo "Usage: $PROGNAME --help"
+ echo "Usage: $PROGNAME --version"
+ echo ""
+ echo "Other parameters:"
+ echo " -a|--all : Print all matching lines"
+ echo " --exclude: Exclude a pattern (-p or -e also applies here when used)"
+ echo " -p|--perl-regex : Use perl style regular expressions in the query"
+ echo " -e|--extended-regex : Use extended style regular expressions in the query (not necessary for GNU grep)"
+}
+
+print_help() {
+ print_revision "$PROGNAME" "$REVISION"
+ echo ""
+ print_usage
+ echo ""
+ echo "Log file pattern detector plugin for monitoring"
+ echo ""
+ support
+}
+
+# Make sure the correct number of command line
+# arguments have been supplied
+
+if [ $# -lt 1 ]; then
+ print_usage
+ exit "$STATE_UNKNOWN"
+fi
+
+# Grab the command line arguments
+exitstatus=$STATE_WARNING #default
+while test -n "$1"; do
+ case "$1" in
+ -h | --help)
+ print_help
+ exit "$STATE_UNKNOWN"
+ ;;
+ -V | --version)
+ print_revision "$PROGNAME" "$REVISION"
+ exit "$STATE_UNKNOWN"
+ ;;
+ -F | --filename)
+ logfile=$2
+ shift 2
+ ;;
+ -O | --oldlog)
+ oldlog=$2
+ shift 2
+ ;;
+ -q | --query)
+ query=$2
+ shift 2
+ ;;
+ --exclude)
+ exclude=$2
+ shift 2
+ ;;
+ -x | --exitstatus)
+ exitstatus=$2
+ shift 2
+ ;;
+ -e | --extended-regex)
+ ERE=1
+ shift
+ ;;
+ -p | --perl-regex)
+ PRE=1
+ shift
+ ;;
+ -a | --all)
+ ALL=1
+ shift
+ ;;
+ *)
+ echo "Unknown argument: $1"
+ print_usage
+ exit "$STATE_UNKNOWN"
+ ;;
+ esac
+done
+
+# Parameter sanity check
+if [ $ERE ] && [ $PRE ] ; then
+ echo "Can not use extended and perl regex at the same time"
+ exit "$STATE_UNKNOWN"
+fi
+
+GREP="grep"
+
+if [ $ERE ]; then
+ GREP="grep -E"
+fi
+
+if [ $PRE ]; then
+ GREP="grep -P"
+fi
+
+# If the source log file doesn't exist, exit
+
+if [ ! -e "$logfile" ]; then
+ echo "Log check error: Log file $logfile does not exist!"
+ exit "$STATE_UNKNOWN"
+elif [ ! -r "$logfile" ] ; then
+ echo "Log check error: Log file $logfile is not readable!"
+ exit "$STATE_UNKNOWN"
+fi
+# If no oldlog was given this can not work properly, abort then
+if [ -z "$oldlog" ]; then
+ echo "Oldlog parameter is needed"
+ exit $STATE_UNKNOWN
+fi
+
+# If the old log file doesn't exist, this must be the first time
+# we're running this test, so copy the original log file over to
+# the old diff file and exit
+
+if [ ! -e "$oldlog" ]; then
+ cat "$logfile" > "$oldlog"
+ echo "Log check data initialized..."
+ exit "$STATE_OK"
+fi
+
+# The old log file exists, so compare it to the original log now
+
+# The temporary file that the script should use while
+# processing the log file.
+if [ -x /bin/mktemp ]; then
+
+ tempdiff=$(/bin/mktemp /tmp/check_log.XXXXXXXXXX)
+else
+ tempdiff=$(/bin/date '+%H%M%S')
+ tempdiff="/tmp/check_log.${tempdiff}"
+ touch "$tempdiff"
+ chmod 600 "$tempdiff"
+fi
+
+diff "$logfile" "$oldlog" | grep -v "^>" > "$tempdiff"
+
+
+if [ $ALL ]; then
+ # Get all matching entries in the diff file
+ if [ -n "$exclude" ]; then
+ entry=$($GREP "$query" "$tempdiff" | $GREP -v "$exclude")
+ count=$($GREP "$query" "$tempdiff" | $GREP -vc "$exclude")
+ else
+ entry=$($GREP "$query" "$tempdiff")
+ count=$($GREP -c "$query" "$tempdiff")
+ fi
+
+else
+ # Get the last matching entry in the diff file
+ if [ -n "$exclude" ]; then
+ entry=$($GREP "$query" "$tempdiff" | $GREP -v "$exclude" | tail -1)
+ count=$($GREP "$query" "$tempdiff" | $GREP -vc "$exclude")
+ else
+ entry=$($GREP "$query" "$tempdiff" | tail -1)
+ count=$($GREP -c "$query" "$tempdiff")
+ fi
+fi
+
+rm -f "$tempdiff"
+cat "$logfile" > "$oldlog"
+
+if [ "$count" = "0" ]; then # no matches, exit with no error
+ echo "Log check ok - 0 pattern matches found"
+ exitstatus=$STATE_OK
+else # Print total match count and the last entry we found
+ echo "($count) $entry"
+ exitstatus=$STATE_CRITICAL
+fi
+
+exit "$exitstatus"
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
new file mode 100755
index 0000000..49156af
--- /dev/null
+++ b/plugins-scripts/check_mailq.pl
@@ -0,0 +1,719 @@
+#!@PERL@ -w
+
+# check_mailq - check to see how many messages are in the smtp queue awating
+# transmittal.
+#
+# Initial version support sendmail's mailq command
+# Support for multiple sendmail queues (Carlos Canau)
+# Support for qmail (Benjamin Schmid)
+
+# License Information:
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+############################################################################
+
+use POSIX;
+use strict;
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c $opt_t $opt_s $opt_d
+ $opt_M $mailq $status $state $msg $msg_q $msg_p $opt_W $opt_C $mailq $mailq_args
+ @lines %srcdomains %dstdomains);
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw(%ERRORS &print_revision &support &usage );
+
+my ($sudo);
+
+sub print_help ();
+sub print_usage ();
+sub process_arguments ();
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+$PROGNAME = "check_mailq";
+$mailq = 'sendmail'; # default
+$msg_q = 0 ;
+$msg_p = 0 ;
+# If appended, must start with a space
+$mailq_args = '' ;
+$state = $ERRORS{'UNKNOWN'};
+
+Getopt::Long::Configure('bundling');
+$status = process_arguments();
+if ($status){
+ print "ERROR: processing arguments\n";
+ exit $ERRORS{"UNKNOWN"};
+}
+
+if ($opt_s) {
+ if (defined $utils::PATH_TO_SUDO && -x $utils::PATH_TO_SUDO) {
+ $sudo = $utils::PATH_TO_SUDO;
+ } else {
+ print "ERROR: Cannot execute sudo\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+} else {
+ $sudo = "";
+}
+
+if ($opt_d) {
+ $mailq_args = $mailq_args . ' -C ' . $opt_d;
+}
+
+$SIG{'ALRM'} = sub {
+ print ("ERROR: timed out waiting for $utils::PATH_TO_MAILQ \n");
+ exit $ERRORS{"WARNING"};
+};
+alarm($opt_t);
+
+# switch based on MTA
+
+if ($mailq eq "sendmail") {
+
+ ## open mailq
+ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) {
+ if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) {
+ print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }elsif( defined $utils::PATH_TO_MAILQ){
+ unless (-x $utils::PATH_TO_MAILQ) {
+ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ } else {
+ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+# single queue empty
+##/var/spool/mqueue is empty
+# single queue: 1
+## /var/spool/mqueue (1 request)
+##----Q-ID---- --Size-- -----Q-Time----- ------------Sender/Recipient------------
+##h32E30p01763 2782 Wed Apr 2 15:03 <silvaATkpnqwest.pt>
+## 8BITMIME
+## <silvaATeunet.pt>
+
+# multi queue empty
+##/var/spool/mqueue/q0/df is empty
+##/var/spool/mqueue/q1/df is empty
+##/var/spool/mqueue/q2/df is empty
+##/var/spool/mqueue/q3/df is empty
+##/var/spool/mqueue/q4/df is empty
+##/var/spool/mqueue/q5/df is empty
+##/var/spool/mqueue/q6/df is empty
+##/var/spool/mqueue/q7/df is empty
+##/var/spool/mqueue/q8/df is empty
+##/var/spool/mqueue/q9/df is empty
+##/var/spool/mqueue/qA/df is empty
+##/var/spool/mqueue/qB/df is empty
+##/var/spool/mqueue/qC/df is empty
+##/var/spool/mqueue/qD/df is empty
+##/var/spool/mqueue/qE/df is empty
+##/var/spool/mqueue/qF/df is empty
+## Total Requests: 0
+# multi queue: 1
+##/var/spool/mqueue/q0/df is empty
+##/var/spool/mqueue/q1/df is empty
+##/var/spool/mqueue/q2/df is empty
+## /var/spool/mqueue/q3/df (1 request)
+##----Q-ID---- --Size-- -----Q-Time----- ------------Sender/Recipient------------
+##h32De2f23534* 48 Wed Apr 2 14:40 nocol
+## nouserATEUnet.pt
+## canau
+##/var/spool/mqueue/q4/df is empty
+##/var/spool/mqueue/q5/df is empty
+##/var/spool/mqueue/q6/df is empty
+##/var/spool/mqueue/q7/df is empty
+##/var/spool/mqueue/q8/df is empty
+##/var/spool/mqueue/q9/df is empty
+##/var/spool/mqueue/qA/df is empty
+##/var/spool/mqueue/qB/df is empty
+##/var/spool/mqueue/qC/df is empty
+##/var/spool/mqueue/qD/df is empty
+##/var/spool/mqueue/qE/df is empty
+##/var/spool/mqueue/qF/df is empty
+## Total Requests: 1
+
+# separate submission/transport queues, empty
+## MSP Queue status...
+## /var/spool/mqueue-client is empty
+## Total requests: 0
+## MTA Queue status...
+## /var/spool/mqueue is empty
+## Total requests: 0
+# separate submission/transport queues: 1
+## MSP Queue status...
+## /var/spool/mqueue-client (1 request)
+## -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
+## oAJEfhdW014123 5 Fri Nov 19 14:41 jwm
+## (Deferred: Connection refused by [127.0.0.1])
+## root
+## Total requests: 1
+## MTA Queue status...
+## /var/spool/mqueue is empty
+## Total requests: 0
+
+ my $this_msg_q = 0;
+ while (<MAILQ>) {
+
+ # match email addr on queue listing
+ if ( (/<.*@.*\.(\w+\.\w+)>/) || (/<.*@(\w+\.\w+)>/) ) {
+ my $domain = $1;
+ if (/^\w+/) {
+ print "$utils::PATH_TO_MAILQ = srcdomain = $domain \n" if $verbose ;
+ $srcdomains{$domain} ++;
+ }
+ next;
+ }
+
+ #
+ # ...
+ # sendmail considers a message with more than one destiny, say N, to the same MX
+ # to have N messages in queue.
+ # we will only consider one in this code
+ if (( /\s\(reply:\sread\serror\sfrom\s.*\.(\w+\.\w+)\.$/ ) || ( /\s\(reply:\sread\serror\sfrom\s(\w+\.\w+)\.$/ ) ||
+ ( /\s\(timeout\swriting\smessage\sto\s.*\.(\w+\.\w+)\.:/ ) || ( /\s\(timeout\swriting\smessage\sto\s(\w+\.\w+)\.:/ ) ||
+ ( /\s\(host\smap:\slookup\s\(.*\.(\w+\.\w+)\):/ ) || ( /\s\(host\smap:\slookup\s\((\w+\.\w+)\):/ ) ||
+ ( /\s\(Deferred:\s.*\s.*\.(\w+\.\w+)\.\)/ ) || ( /\s\(Deferred:\s.*\s(\w+\.\w+)\.\)/ ) ) {
+
+ print "$utils::PATH_TO_MAILQ = dstdomain = $1 \n" if $verbose ;
+ $dstdomains{$1} ++;
+ }
+
+ if (/\s+\(I\/O\serror\)/) {
+ print "$utils::PATH_TO_MAILQ = dstdomain = UNKNOWN \n" if $verbose ;
+ $dstdomains{'UNKNOWN'} ++;
+ }
+
+ # Finally look at the overall queue length
+ #
+ if (/mqueue/) {
+ print "$utils::PATH_TO_MAILQ = $_ "if $verbose ;
+ if (/ \((\d+) request/) {
+ #
+ # single queue: first line
+ # multi queue: one for each queue. overwrite on multi queue below
+ $this_msg_q = $1 ;
+ $msg_q += $1 ;
+ }
+ } elsif (/^\s+Total\sRequests:\s(\d+)$/i) {
+ if ($this_msg_q) {
+ $this_msg_q = 0 ;
+ } else {
+ print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ;
+ #
+ # multi queue: last line
+ $msg_q += $1 ;
+ }
+ }
+
+ }
+
+
+ ## close mailq
+
+ close (MAILQ);
+
+ if ( $? ) {
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+ exit $ERRORS{CRITICAL};
+ }
+
+ ## shut off the alarm
+ alarm(0);
+
+
+
+ ## now check the queue length(s)
+
+ if ($msg_q == 0) {
+ $msg = "OK: $mailq mailq is empty";
+ $state = $ERRORS{'OK'};
+ } else {
+ print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
+
+ # overall queue length
+ if ($msg_q < $opt_w) {
+ $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ $state = $ERRORS{'OK'};
+ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
+ $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ $state = $ERRORS{'WARNING'};
+ }else {
+ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+
+ # check for domain specific queue lengths if requested
+ if (defined $opt_W) {
+
+ # Apply threshold to queue lengths FROM domain
+ my @srckeys = sort { $srcdomains{$b} <=> $srcdomains{$a} } keys %srcdomains;
+ my $srcmaxkey = $srckeys[0];
+ print "src max is $srcmaxkey with $srcdomains{$srcmaxkey} messages\n" if $verbose;
+
+ if ($srcdomains{$srcmaxkey} >= $opt_W && $srcdomains{$srcmaxkey} < $opt_C) {
+ if ($state == $ERRORS{'OK'}) {
+ $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
+ $state = $ERRORS{'WARNING'};
+ } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){
+ $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
+ } else {
+ $msg = "WARNING: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
+ $state = $ERRORS{'WARNING'};
+ }
+ } elsif ($srcdomains{$srcmaxkey} >= $opt_C) {
+ if ($state == $ERRORS{'OK'}) {
+ $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C)";
+ $state = $ERRORS{'CRITICAL'};
+ } elsif ($state == $ERRORS{'WARNING'}) {
+ $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold C = $opt_C) -and- " . $msg;
+ $msg =~ s/WARNING: //;
+ } elsif ($state == $ERRORS{'CRITICAL'}) {
+ $msg .= " -and- $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
+ } else {
+ $msg = "CRITICAL: $srcdomains{$srcmaxkey} messages in queue FROM $srcmaxkey (threshold W = $opt_W)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+ } else {
+ if ($srcdomains{$srcmaxkey} > 0) {
+ $msg .= " $srcdomains{$srcmaxkey} msgs. FROM $srcmaxkey is below threshold ($opt_W/$opt_C)";
+ }
+ }
+
+ # Apply threshold to queue lengths TO domain
+ my @dstkeys = sort { $dstdomains{$b} <=> $dstdomains{$a} } keys %dstdomains;
+ my $dstmaxkey = $dstkeys[0];
+ print "dst max is $dstmaxkey with $dstdomains{$dstmaxkey} messages\n" if $verbose;
+
+ if ($dstdomains{$dstmaxkey} >= $opt_W && $dstdomains{$dstmaxkey} < $opt_C) {
+ if ($state == $ERRORS{'OK'}) {
+ $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
+ $state = $ERRORS{'WARNING'};
+ } elsif (($state == $ERRORS{'WARNING'}) || ($state == $ERRORS{'CRITICAL'})){
+ $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
+ } else {
+ $msg = "WARNING: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
+ $state = $ERRORS{'WARNING'};
+ }
+ } elsif ($dstdomains{$dstmaxkey} >= $opt_C) {
+ if ($state == $ERRORS{'OK'}) {
+ $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C)";
+ $state = $ERRORS{'CRITICAL'};
+ } elsif ($state == $ERRORS{'WARNING'}) {
+ $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold C = $opt_C) -and- " . $msg;
+ $msg =~ s/WARNING: //;
+ } elsif ($state == $ERRORS{'CRITICAL'}) {
+ $msg .= " -and- $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
+ } else {
+ $msg = "CRITICAL: $dstdomains{$dstmaxkey} messages in queue TO $dstmaxkey (threshold W = $opt_W)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+ } else {
+ if ($dstdomains{$dstmaxkey} > 0) {
+ $msg .= " $dstdomains{$dstmaxkey} msgs. TO $dstmaxkey is below threshold ($opt_W/$opt_C)";
+ }
+ }
+
+ } # End of queue length thresholds
+
+ }
+
+} # end of ($mailq eq "sendmail")
+elsif ( $mailq eq "postfix" ) {
+
+ ## open mailq
+ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) {
+ if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ$mailq_args | " ) ) {
+ print "ERROR: could not open $utils::PATH_TO_MAILQ$mailq_args \n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }elsif( defined $utils::PATH_TO_MAILQ){
+ unless (-x $utils::PATH_TO_MAILQ) {
+ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ } else {
+ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+
+ @lines = reverse <MAILQ>;
+
+ # close qmail-qstat
+ close MAILQ;
+
+ if ( $? ) {
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ$mailq_args",$/;
+ exit $ERRORS{CRITICAL};
+ }
+
+ ## shut off the alarm
+ alarm(0);
+
+ # check queue length
+ if ($lines[0]=~/Kbytes in (\d+)/) {
+ $msg_q = $1 ;
+ }elsif ($lines[0]=~/Mail queue is empty/) {
+ $msg_q = 0;
+ }else{
+ print "Couldn't match $utils::PATH_TO_MAILQ$mailq_args output\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ # check messages not processed
+ #if ($lines[1]=~/^messages in queue but not yet preprocessed: (\d+)/) {
+ # my $msg_p = $1;
+ #}else{
+ # print "Couldn't match $utils::PATH_TO_MAILQ output\n";
+ # exit $ERRORS{'UNKNOWN'};
+ #}
+
+ # check queue length(s)
+ if ($msg_q == 0){
+ $msg = "OK: $mailq mailq reports queue is empty";
+ $state = $ERRORS{'OK'};
+ } else {
+ print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
+
+ # overall queue length
+ if ($msg_q < $opt_w) {
+ $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ $state = $ERRORS{'OK'};
+ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
+ $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ $state = $ERRORS{'WARNING'};
+ }else {
+ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+
+ # check messages not yet preprocessed (only compare is $opt_W and $opt_C
+ # are defined)
+
+ #if (defined $opt_W) {
+ # $msg .= "[Preprocessed = $msg_p]";
+ # if ($msg_p >= $opt_W && $msg_p < $opt_C ) {
+ # $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
+ # }elsif ($msg_p >= $opt_C ) {
+ # $state = $ERRORS{"CRITICAL"} ;
+ # }
+ #}
+ }
+} # end of ($mailq eq "postfix")
+elsif ( $mailq eq "qmail" ) {
+
+ # open qmail-qstat
+ if ( defined $utils::PATH_TO_QMAIL_QSTAT && -x $utils::PATH_TO_QMAIL_QSTAT ) {
+ if (! open (MAILQ, "$sudo $utils::PATH_TO_QMAIL_QSTAT | " ) ) {
+ print "ERROR: could not open $utils::PATH_TO_QMAIL_QSTAT \n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }elsif( defined $utils::PATH_TO_QMAIL_QSTAT){
+ unless (-x $utils::PATH_TO_QMAIL_QSTAT) {
+ print "ERROR: $utils::PATH_TO_QMAIL_QSTAT is not executable by (uid $>:gid($)))\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ } else {
+ print "ERROR: \$utils::PATH_TO_QMAIL_QSTAT is not defined\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ @lines = <MAILQ>;
+
+ # close qmail-qstat
+ close MAILQ;
+
+ if ( $? ) {
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+ exit $ERRORS{CRITICAL};
+ }
+
+ ## shut off the alarm
+ alarm(0);
+
+ # check queue length
+ if ($lines[0]=~/^messages in queue: (\d+)/) {
+ $msg_q = $1 ;
+ }else{
+ print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ # check messages not processed
+ if ($lines[1]=~/^messages in queue but not yet preprocessed: (\d+)/) {
+ my $msg_p = $1;
+ }else{
+ print "Couldn't match $utils::PATH_TO_QMAIL_QSTAT output\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+
+ # check queue length(s)
+ if ($msg_q == 0){
+ $msg = "OK: qmail-qstat reports queue is empty";
+ $state = $ERRORS{'OK'};
+ } else {
+ print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
+
+ # overall queue length
+ if ($msg_q < $opt_w) {
+ $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ $state = $ERRORS{'OK'};
+ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
+ $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ $state = $ERRORS{'WARNING'};
+ }else {
+ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+
+ # check messages not yet preprocessed (only compare is $opt_W and $opt_C
+ # are defined)
+
+ if (defined $opt_W) {
+ $msg .= "[Preprocessed = $msg_p]";
+ if ($msg_p >= $opt_W && $msg_p < $opt_C ) {
+ $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
+ }elsif ($msg_p >= $opt_C ) {
+ $state = $ERRORS{"CRITICAL"} ;
+ }
+ }
+ }
+
+
+
+} # end of ($mailq eq "qmail")
+elsif ( $mailq eq "exim" ) {
+ ## open mailq
+ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) {
+ if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) {
+ print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }elsif( defined $utils::PATH_TO_MAILQ){
+ unless (-x $utils::PATH_TO_MAILQ) {
+ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ } else {
+ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ while (<MAILQ>) {
+ #22m 1.7K 19aEEr-0007hx-Dy <> *** frozen ***
+ #root@exlixams.glups.fr
+
+ if (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) { # message id 19aEEr-0007hx-Dy
+ $msg_q++ ;
+ }
+ }
+ close(MAILQ) ;
+
+ if ( $? ) {
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+ exit $ERRORS{CRITICAL};
+ }
+ if ($msg_q < $opt_w) {
+ $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ $state = $ERRORS{'OK'};
+ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
+ $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ $state = $ERRORS{'WARNING'};
+ }else {
+ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+} # end of ($mailq eq "exim")
+
+elsif ( $mailq eq "nullmailer" ) {
+ ## open mailq
+ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) {
+ if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) {
+ print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }elsif( defined $utils::PATH_TO_MAILQ){
+ unless (-x $utils::PATH_TO_MAILQ) {
+ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ } else {
+ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ while (<MAILQ>) {
+ #2022-08-25 01:30:40 502 bytes from <user@example.com>
+
+ if (/^\d{4}-\d{2}-\d{2}\s+\d{2}\:\d{2}\:\d{2}\s+\d+\sbytes/) {
+ $msg_q++ ;
+ }
+ }
+ close(MAILQ) ;
+ if ($msg_q < $opt_w) {
+ $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ $state = $ERRORS{'OK'};
+ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
+ $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ $state = $ERRORS{'WARNING'};
+ }else {
+ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+} # end of ($mailq eq "nullmailer")
+
+# Perfdata support
+print "$msg|unsent=$msg_q;$opt_w;$opt_c;0\n";
+exit $state;
+
+
+#####################################
+#### subs
+
+
+sub process_arguments(){
+ GetOptions
+ ("V" => \$opt_V, "version" => \$opt_V,
+ "v" => \$opt_v, "verbose" => \$opt_v,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "M:s" => \$opt_M, "mailserver:s" => \$opt_M, # mailserver (default sendmail)
+ "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number
+ "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number
+ "W=i" => \$opt_W, "warning-domain=i" => \$opt_W, # Warning if above this number
+ "C=i" => \$opt_C, "critical-domain=i" => \$opt_C, # Critical if above this number
+ "t=i" => \$opt_t, "timeout=i" => \$opt_t,
+ "s" => \$opt_s, "sudo" => \$opt_s,
+ "d:s" => \$opt_d, "configdir:s" => \$opt_d,
+ );
+
+ if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ($opt_h) {
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if (defined $opt_v ){
+ $verbose = $opt_v;
+ }
+
+ unless (defined $opt_t) {
+ $opt_t = $utils::TIMEOUT ; # default timeout
+ }
+
+ unless ( defined $opt_w && defined $opt_c ) {
+ print_usage();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ( $opt_w >= $opt_c) {
+ print "Warning (-w) cannot be greater than Critical (-c)!\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if (defined $opt_W && ! defined !$opt_C) {
+ print "Need -C if using -W\n";
+ exit $ERRORS{'UNKNOWN'};
+ }elsif(defined $opt_W && defined $opt_C) {
+ if ($opt_W >= $opt_C) {
+ print "Warning (-W) cannot be greater than Critical (-C)!\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }
+
+ if (defined $opt_M) {
+ if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer)$/) {
+ $mailq = $opt_M ;
+ }elsif( $opt_M eq ''){
+ $mailq = 'sendmail';
+ }else{
+ print "-M: $opt_M is not supported\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }else{
+ if (defined $utils::PATH_TO_QMAIL_QSTAT
+ && -x $utils::PATH_TO_QMAIL_QSTAT)
+ {
+ $mailq = 'qmail';
+ }
+ elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
+ || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
+ {
+ $mailq = 'postfix';
+ }
+ elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
+ || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
+ {
+ $mailq = 'exim';
+ }
+ elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
+ || -e '/usr/sbin/nullmailer-send'
+ || -e '/usr/local/sbin/nullmailer-send')
+ {
+ $mailq = 'nullmailer';
+ }
+ else {
+ $mailq = 'sendmail';
+ }
+ }
+
+ return $ERRORS{'OK'};
+}
+
+sub print_usage () {
+ print "Usage: $PROGNAME -w <warn> -c <crit> [-W <warn>] [-C <crit>] [-M <MTA>] [-t <timeout>] [-s] [-d <CONFIGDIR>] [-v]\n";
+}
+
+sub print_help () {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n";
+ print "\n";
+ print_usage();
+ print "\n";
+ print " Checks the number of messages in the mail queue (supports multiple sendmail queues, qmail)\n";
+ print " Feedback/patches to support non-sendmail mailqueue welcome\n\n";
+ print "-w (--warning) = Min. number of messages in queue to generate warning\n";
+ print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n";
+ print "-W (--warning-domain) = Min. number of messages for same domain in queue to generate warning\n";
+ print "-C (--critical-domain) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n";
+ print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n";
+ print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n";
+ print "-s (--sudo) = Use sudo to call the mailq command\n";
+ print "-d (--configdir) = Config file or directory\n";
+ print "-h (--help)\n";
+ print "-V (--version)\n";
+ print "-v (--verbose) = debugging output\n";
+ print "\n\n";
+ print "Note: -w and -c are required arguments. -W and -C are optional.\n";
+ print " -W and -C are applied to domains listed on the queues - both FROM and TO. (sendmail)\n";
+ print " -W and -C are applied message not yet preproccessed. (qmail)\n";
+ print " This plugin tries to autodetect which mailserver you are running,\n";
+ print " you can override the autodetection with -M.\n";
+ print " This plugin uses the system mailq command (sendmail) or qmail-stat (qmail)\n";
+ print " to look at the queues. Mailq can usually only be accessed by root or \n";
+ print " a TrustedUser. You will have to set appropriate permissions for the plugin to work.\n";
+ print "";
+ print "\n\n";
+ support();
+}
diff --git a/plugins-scripts/check_mssql.pl b/plugins-scripts/check_mssql.pl
new file mode 100755
index 0000000..bf3a651
--- /dev/null
+++ b/plugins-scripts/check_mssql.pl
@@ -0,0 +1,145 @@
+#!@PERL@ -w
+
+#
+# Copyright 2003 Roy Sigurd Karlsbakk
+#
+# Requires freetds and DBD::Sybase
+# http://www.freetds.org
+# http://www.mbay.net/~mpeppler/
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
+#
+# Report bugs to: help@monitoring-plugins.org
+#
+#
+
+
+use DBI;
+use DBD::Sybase;
+use Getopt::Long;
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+use strict;
+
+my $PROGNAME = "check_mssql";
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+
+my (
+ $server,$database,$username,$password,$query,$help,$verbose,$timeout,
+ $dbh,$sth,$row,
+ $s,$opt_V,$regex
+);
+my $exitcode = $ERRORS{'OK'};
+
+process_arguments();
+
+# Just in case of problems, let's not hang the monitoring system
+$SIG{'ALRM'} = sub {
+ print ("SQL UNKNOWN: ERROR connection $server (alarm timeout)\n");
+ exit $ERRORS{"UNKNOWN"};
+};
+alarm($timeout);
+
+unless ($dbh = DBI->connect("dbi:Sybase:server=".uc($server), "$username", "$password")) {
+ printf "SQL CRITICAL: Can't connect to mssql server $DBI::errstr\n";
+ exit($ERRORS{'CRITICAL'});
+}
+
+if (defined $database) { # otherwise use default database
+ unless ($dbh->do("use $database")) {
+ printf ("SQL CRITICAL: Can't 'use $database': $dbh->errstr");
+ exit($ERRORS{'CRITICAL'});
+ }
+}
+$sth = $dbh->prepare($query);
+unless ($sth->execute()) {
+ printf("SQL CRITICAL: Error in query: $dbh->errstr\n");
+ exit($ERRORS{'CRITICAL'});
+}
+
+$row = join(";",$sth->fetchrow_array);
+
+$sth->finish;
+$dbh->disconnect;
+
+alarm(0);
+if (defined $regex) {
+ if ($row =~ /$regex/) {
+ printf "SQL CRITICAL: - $row|$row\n";
+ exit $ERRORS{'CRITICAL'};
+ }else{
+ print "SQL OK: $row|$row\n";
+ exit $ERRORS{'OK'};
+ }
+}
+
+print "SQL OK: $row|$row\n";
+exit $ERRORS{'OK'};
+
+##################################################
+
+sub syntax {
+ $s = shift or $s = 'Unknown';
+ printf("Error: ($s)\n") unless ($help);
+ printf("Runs a query against a MS-SQL server or Sybase server and returns the first row\n");
+ printf("Returns an error if no responses are running. Row is passed to perfdata in\n");
+ printf("semicolon delimited format\n");
+ printf("A simple sql statement like \"select getdate()\" verifies server responsiveness\n\n");
+ printf("Syntax: %s -s <server> -d <database> -u <username> -p <password> -q <query> [-v]\n", $PROGNAME);
+ printf(" --database -d Database name\n");
+ printf(" --Hostname -H Server name\n");
+ printf(" --username -u Username\n");
+ printf(" --password -p Password\n");
+ printf(" --query -q SQL query to run\n");
+ printf(" --timeout -t Plugin timeout (default:$TIMEOUT)\n");
+ printf(" --regex -r regex against SQL response(CRIT if MATCH)\n");
+ printf(" --verbose -v verbose\n");
+ printf("\nThe SQL response is concatenated into a string with a \";\" demarkation\n\n");
+ exit($ERRORS{'UNKNOWN'});
+}
+
+sub process_arguments {
+ Getopt::Long::Configure('bundling');
+ my $status = GetOptions
+ ("p=s" => \$password, "password=s" => \$password,
+ "u=s" => \$username, "username=s" => \$username,
+ "H=s" => \$server, "Hostname=s" => \$server,
+ "d=s" => \$database, "database=s" => \$database,
+ "q=s" => \$query, "query=s" => \$query,
+ "t=i" => \$timeout, "timeout=i" => \$timeout,
+ "r=s" => \$regex, "regex=s" => \$regex,
+ "h" => \$help, "help" => \$help,
+ "v" => \$verbose, "verbose" => \$verbose,
+ "V" => \$opt_V, "version" => \$opt_V);
+
+ if (defined $opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ syntax("Help:") if ($help);
+ syntax("Missing username") unless (defined($username));
+ syntax("Missing password") unless (defined($password));
+ syntax("Missing server") unless (defined($server));
+ syntax("Missing query string") unless (defined($query));
+ $timeout = $TIMEOUT unless (defined($timeout));
+
+ return;
+
+}
diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh
new file mode 100755
index 0000000..5998138
--- /dev/null
+++ b/plugins-scripts/check_oracle.sh
@@ -0,0 +1,304 @@
+#!/bin/sh
+#
+# latigid010@yahoo.com
+# 01/06/2000
+#
+# This Monitoring plugin was created to check Oracle status
+#
+
+PATH="@TRUSTED_PATH@"
+export PATH
+PROGNAME=$(basename "$0")
+PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,')
+REVISION="@NP_VERSION@"
+
+. "$PROGPATH"/utils.sh
+
+
+print_usage() {
+ echo "Usage:"
+ echo " $PROGNAME --tns <Oracle Sid or Hostname/IP address>"
+ echo " $PROGNAME --db <ORACLE_SID>"
+ echo " $PROGNAME --login <ORACLE_SID>"
+ echo " $PROGNAME --connect <ORACLE_SID>"
+ echo " $PROGNAME --cache <ORACLE_SID> <USER> <PASS> <CRITICAL> <WARNING>"
+ echo " $PROGNAME --tablespace <ORACLE_SID> <USER> <PASS> <TABLESPACE> <CRITICAL> <WARNING>"
+ echo " $PROGNAME --oranames <Hostname>"
+ echo " $PROGNAME --help"
+ echo " $PROGNAME --version"
+}
+
+print_help() {
+ print_revision "$PROGNAME" "$REVISION"
+ echo ""
+ print_usage
+ echo ""
+ echo "Check Oracle status"
+ echo ""
+ echo "--tns SID/IP Address"
+ echo " Check remote TNS server"
+ echo "--db SID"
+ echo " Check local database (search /bin/ps for PMON process) and check"
+ echo " filesystem for sgadefORACLE_SID.dbf"
+ echo "--login SID"
+ echo " Attempt a dummy login and alert if not ORA-01017: invalid username/password"
+ echo "--connect SID"
+ echo " Attempt a login and alert if an ORA- error is returned"
+ echo "--cache"
+ echo " Check local database for library and buffer cache hit ratios"
+ echo " ---> Requires Oracle user/password and SID specified."
+ echo " ---> Requires select on v_$sysstat and v_$librarycache"
+ echo "--tablespace"
+ echo " Check local database for tablespace capacity in ORACLE_SID"
+ echo " ---> Requires Oracle user/password specified."
+ echo " ---> Requires select on dba_data_files and dba_free_space"
+ echo "--oranames Hostname"
+ echo " Check remote Oracle Names server"
+ echo "--help"
+ echo " Print this help screen"
+ echo "--version"
+ echo " Print version and license information"
+ echo ""
+ echo "If the plugin doesn't work, check that the ORACLE_HOME environment"
+ echo "variable is set, that ORACLE_HOME/bin is in your PATH, and the"
+ echo "tnsnames.ora file is locatable and is properly configured."
+ echo ""
+ echo "When checking local database status your ORACLE_SID is case sensitive."
+ echo ""
+ echo "If you want to use a default Oracle home, add in your oratab file:"
+ echo "*:/opt/app/oracle/product/7.3.4:N"
+ echo ""
+ support
+}
+
+case "$1" in
+1)
+ cmd='--tns'
+ ;;
+2)
+ cmd='--db'
+ ;;
+*)
+ cmd="$1"
+ ;;
+esac
+
+# Information options
+case "$cmd" in
+--help)
+ print_help
+ exit "$STATE_UNKNOWN"
+ ;;
+-h)
+ print_help
+ exit "$STATE_UNKNOWN"
+ ;;
+--version)
+ print_revision "$PROGNAME" "$REVISION"
+ exit "$STATE_UNKNOWN"
+ ;;
+-V)
+ print_revision "$PROGNAME" "$REVISION"
+ exit "$STATE_UNKNOWN"
+ ;;
+esac
+
+# Hunt down a reasonable ORACLE_HOME
+if [ -z "$ORACLE_HOME" ] ; then
+ # Adjust to taste
+ for oratab in /var/opt/oracle/oratab /etc/oratab
+ do
+ [ ! -f $oratab ] && continue
+ ORACLE_HOME=`IFS=:
+ while read -r SID ORACLE_HOME junk;
+ do
+ if [ "$SID" = "$2" ] || [ "$SID" = "*" ] ; then
+ echo "$ORACLE_HOME";
+ exit;
+ fi;
+ done < $oratab`
+ [ -n "$ORACLE_HOME" ] && break
+ done
+fi
+# Last resort
+[ -z "$ORACLE_HOME" ] && [ -d "$PROGPATH"/oracle ] && ORACLE_HOME=$PROGPATH/oracle
+
+if [ "$cmd" != "--db" ]; then
+ if [ -z "$ORACLE_HOME" ] || [ ! -d "$ORACLE_HOME" ] ; then
+ echo "Cannot determine ORACLE_HOME for sid $2"
+ exit "$STATE_UNKNOWN"
+ fi
+fi
+PATH=$PATH:$ORACLE_HOME/bin
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
+export ORACLE_HOME PATH LD_LIBRARY_PATH
+
+case "$cmd" in
+--tns)
+ tnschk=$(tnsping "$2")
+ tnschk2=$(echo "$tnschk" | grep -c OK)
+ if [ "${tnschk2}" -eq 1 ] ; then
+ tnschk3=${tnschk##*(}; tnschk3=${tnschk3%)*}
+ echo "OK - reply time ${tnschk3} from $2"
+ exit "$STATE_OK"
+ else
+ echo "No TNS Listener on $2"
+ exit "$STATE_CRITICAL"
+ fi
+ ;;
+--oranames)
+ namesctl status "$2" | awk '
+ /Server has been running for:/ {
+ msg = "OK: Up"
+ for (i = 6; i <= NF; i++) {
+ msg = msg " " $i
+ }
+ status = '"$STATE_OK"'
+ }
+ /error/ {
+ msg = "CRITICAL: " $0
+ status = '"$STATE_CRITICAL"'
+ }
+ END {
+ print msg
+ exit status
+ }'
+ ;;
+--db)
+ pmonchk=$(pgrep -f "(asm|ora)_pmon_${2}$")
+ if [ "${pmonchk}" -ge 1 ] ; then
+ echo "${2} OK - ${pmonchk} PMON process(es) running"
+ exit "$STATE_OK"
+ #if [ -f $ORACLE_HOME/dbs/sga*${2}* ] ; then
+ #if [ ${pmonchk} -eq 1 ] ; then
+ #utime=`ls -la $ORACLE_HOME/dbs/sga*$2* | cut -c 43-55`
+ #echo "${2} OK - running since ${utime}"
+ #exit $STATE_OK
+ #fi
+ else
+ echo "${2} Database is DOWN"
+ exit "$STATE_CRITICAL"
+ fi
+ ;;
+--login)
+ loginchk=$(sqlplus dummy/user@"$2" < /dev/null)
+ loginchk2=$(echo "$loginchk" | grep -c ORA-01017)
+ if [ "${loginchk2}" -eq 1 ] ; then
+ echo "OK - dummy login connected"
+ exit "$STATE_OK"
+ else
+ loginchk3=$(echo "$loginchk" | grep "ORA-" | head -1)
+ echo "CRITICAL - $loginchk3"
+ exit "$STATE_CRITICAL"
+ fi
+ ;;
+--connect)
+ connectchk=$(sqlplus "$2" < /dev/null)
+ connectchk2=$(echo "$connectchk" | grep -c ORA-)
+ if [ "${connectchk2}" -eq 0 ] ; then
+ echo "OK - login successful"
+ exit "$STATE_OK"
+ else
+ connectchk3=$(echo "$connectchk" | grep "ORA-" | head -1)
+ echo "CRITICAL - $connectchk3"
+ exit "$STATE_CRITICAL"
+ fi
+ ;;
+--cache)
+ if [ "${5}" -gt "${6}" ] ; then
+ echo "UNKNOWN - Warning level is less then Crit"
+ exit "$STATE_UNKNOWN"
+ fi
+ result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
+set pagesize 0
+set numf '9999999.99'
+select (1-(pr.value/(dbg.value+cg.value)))*100
+from v\\$sysstat pr, v\\$sysstat dbg, v\\$sysstat cg
+where pr.name='physical reads'
+and dbg.name='db block gets'
+and cg.name='consistent gets';
+EOF`
+
+ if echo "$result" | grep -q 'ORA-' ; then
+ error=$(echo "$result" | grep "ORA-" | head -1)
+ echo "CRITICAL - $error"
+ exit "$STATE_CRITICAL"
+ fi
+
+ buf_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}')
+ buf_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}')
+ result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
+set pagesize 0
+set numf '9999999.99'
+select sum(lc.pins)/(sum(lc.pins)+sum(lc.reloads))*100
+from v\\$librarycache lc;
+EOF`
+
+ if echo "$result" | grep -q 'ORA-' ; then
+ error=$(echo "$result" | grep "ORA-" | head -1)
+ echo "CRITICAL - $error"
+ exit "$STATE_CRITICAL"
+ fi
+
+ lib_hr=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print int($1)}')
+ lib_hrx=$(echo "$result" | awk '/^[0-9\. \t]+$/ {print $1}')
+
+ if [ "$buf_hr" -le "${5}" ] || [ "$lib_hr" -le "${5}" ] ; then
+ echo "${2} CRITICAL - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
+ exit "$STATE_CRITICAL"
+ fi
+ if [ "$buf_hr" -le "${6}" ] || [ "$lib_hr" -le "${6}" ] ; then
+ echo "${2} WARNING - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
+ exit "$STATE_WARNING"
+ fi
+ echo "${2} OK - Cache Hit Rates: $lib_hrx% Lib -- $buf_hrx% Buff|lib=$lib_hrx%;${6};${5};0;100 buffer=$buf_hrx%;${6};${5};0;100"
+
+ exit "$STATE_OK"
+ ;;
+--tablespace)
+ if [ "${6}" -lt "${7}" ] ; then
+ echo "UNKNOWN - Warning level is more then Crit"
+ exit "$STATE_UNKNOWN"
+ fi
+ result=`sqlplus -s "${3}"/"${4}"@"${2}" << EOF
+set pagesize 0
+set numf '9999999.99'
+select NVL(b.free,0.0),a.total,100 - trunc(NVL(b.free,0.0)/a.total * 1000) / 10 prc
+from (
+select tablespace_name,sum(bytes)/1024/1024 total
+from dba_data_files group by tablespace_name) A
+LEFT OUTER JOIN
+( select tablespace_name,sum(bytes)/1024/1024 free
+from dba_free_space group by tablespace_name) B
+ON a.tablespace_name=b.tablespace_name WHERE a.tablespace_name='${5}';
+EOF`
+
+ if echo "$result" | grep -q 'ORA-' ; then
+ error=$(echo "$result" | grep "ORA-" | head -1)
+ echo "CRITICAL - $error"
+ exit "$STATE_CRITICAL"
+ fi
+
+ ts_free=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($1)}')
+ ts_total=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($2)}')
+ ts_pct=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print int($3)}')
+ ts_pctx=$(echo "$result" | awk '/^[ 0-9\.\t ]+$/ {print $3}')
+ if [ "$ts_free" -eq 0 ] && [ "$ts_total" -eq 0 ] && [ "$ts_pct" -eq 0 ] ; then
+ echo "No data returned by Oracle - tablespace $5 not found?"
+ exit "$STATE_UNKNOWN"
+ fi
+ if [ "$ts_pct" -ge "${6}" ] ; then
+ echo "${2} : ${5} CRITICAL - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
+ exit "$STATE_CRITICAL"
+ fi
+ if [ "$ts_pct" -ge "${7}" ] ; then
+ echo "${2} : ${5} WARNING - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
+ exit "$STATE_WARNING"
+ fi
+ echo "${2} : ${5} OK - $ts_pctx% used [ $ts_free / $ts_total MB available ]|${5}=$ts_pctx%;${7};${6};0;100"
+ exit "$STATE_OK"
+ ;;
+*)
+ print_usage
+ exit "$STATE_UNKNOWN"
+esac
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl
new file mode 100755
index 0000000..8a56b9f
--- /dev/null
+++ b/plugins-scripts/check_rpc.pl
@@ -0,0 +1,376 @@
+#!@PERL@ -w
+#
+# check_rpc plugin for monitoring
+#
+# usage:
+# check_rpc host service
+#
+# Check if an rpc service is registered and running
+# using rpcinfo - $proto $host $prognum 2>&1 |";
+#
+# Use these hosts.cfg entries as examples
+#
+# command[check_nfs]=/some/path/libexec/check_rpc $HOSTADDRESS$ nfs
+# service[check_nfs]=NFS;24x7;3;5;5;unix-admin;60;24x7;1;1;1;;check_rpc
+#
+# initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop
+# Modified May 2002 Subhendu Ghosh - support for ePN and patches
+#
+# Copyright Notice: GPL
+#
+
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+use vars qw($PROGNAME);
+my ($verbose,@proto,%prognum,$host,$response,$prognum,$port,$cmd,$progver,$state);
+my ($array_ref,$test,$element,@progkeys,$proto,$a,$b);
+my ($opt_V,$opt_h,$opt_C,$opt_p,$opt_H,$opt_c,$opt_u,$opt_t);
+my ($line, @progvers, $response2,$response3);
+$opt_V = $opt_h = $opt_C = $opt_p = $opt_H = $opt_u = $opt_t ='';
+$state = 'UNKNOWN';
+$progver = $response=$response2= $response3 ='';
+
+$PROGNAME = "check_rpc";
+sub print_help ();
+sub print_usage ();
+sub in ($$);
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+$ENV{'LC_ALL'}='C';
+
+#Initialise protocol for each progname number
+# 'u' for UDP, 't' for TCP
+$proto[10003]='u';
+$proto[10004]='u';
+$proto[10007]='u';
+
+use Getopt::Long;
+Getopt::Long::Configure('bundling');
+GetOptions(
+ "V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "C=s" => \$opt_C, "command=s" => \$opt_C,
+ "p=i" => \$opt_p, "port=i" => \$opt_p,
+ "H=s" => \$opt_H, "hostname=s" => \$opt_H,
+ "c=s" => \$opt_c, "progver=s" => \$opt_c,
+ "v+" => \$verbose, "verbose+" => \$verbose,
+ "u" => \$opt_u, "udp" => \$opt_u,
+ "t" => \$opt_t, "tcp" => \$opt_t
+);
+
+# -h means display verbose help screen
+if ($opt_h) { print_help(); exit $ERRORS{'UNKNOWN'}; }
+
+# -V means display version number
+if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+}
+
+# Hash containing all RPC program names and numbers
+# Add to the hash if support for new RPC program is required
+
+%prognum = (
+ "portmapper" => 100000 ,
+ "portmap" => 100000 ,
+ "sunrpc" => 100000 ,
+ "rpcbind" => 100000 ,
+ "rstatd" => 100001 ,
+ "rstat" => 100001 ,
+ "rup" => 100001 ,
+ "perfmeter" => 100001 ,
+ "rstat_svc" => 100001 ,
+ "rusersd" => 100002 ,
+ "rusers" => 100002 ,
+ "nfs" => 100003 ,
+ "nfsprog" => 100003 ,
+ "ypserv" => 100004 ,
+ "ypprog" => 100004 ,
+ "mountd" => 100005 ,
+ "mount" => 100005 ,
+ "showmount" => 100005 ,
+ "ypbind" => 100007 ,
+ "walld" => 100008 ,
+ "rwall" => 100008 ,
+ "shutdown" => 100008 ,
+ "yppasswdd" => 100009 ,
+ "yppasswd" => 100009 ,
+ "etherstatd" => 100010 ,
+ "etherstat" => 100010 ,
+ "rquotad" => 100011 ,
+ "rquotaprog" => 100011 ,
+ "quota" => 100011 ,
+ "rquota" => 100011 ,
+ "sprayd" => 100012 ,
+ "spray" => 100012 ,
+ "3270_mapper" => 100013 ,
+ "rje_mapper" => 100014 ,
+ "selection_svc" => 100015 ,
+ "selnsvc" => 100015 ,
+ "database_svc" => 100016 ,
+ "rexd" => 100017 ,
+ "rex" => 100017 ,
+ "alis" => 100018 ,
+ "sched" => 100019 ,
+ "llockmgr" => 100020 ,
+ "nlockmgr" => 100021 ,
+ "x25_inr" => 100022 ,
+ "statmon" => 100023 ,
+ "status" => 100024 ,
+ "bootparam" => 100026 ,
+ "ypupdated" => 100028 ,
+ "ypupdate" => 100028 ,
+ "keyserv" => 100029 ,
+ "keyserver" => 100029 ,
+ "sunlink_mapper" => 100033 ,
+ "tfsd" => 100037 ,
+ "nsed" => 100038 ,
+ "nsemntd" => 100039 ,
+ "showfhd" => 100043 ,
+ "showfh" => 100043 ,
+ "ioadmd" => 100055 ,
+ "rpc.ioadmd" => 100055 ,
+ "NETlicense" => 100062 ,
+ "sunisamd" => 100065 ,
+ "debug_svc" => 100066 ,
+ "dbsrv" => 100066 ,
+ "ypxfrd" => 100069 ,
+ "rpc.ypxfrd" => 100069 ,
+ "bugtraqd" => 100071 ,
+ "kerbd" => 100078 ,
+ "event" => 100101 ,
+ "na.event" => 100101 ,
+ "logger" => 100102 ,
+ "na.logger" => 100102 ,
+ "sync" => 100104 ,
+ "na.sync" => 100104 ,
+ "hostperf" => 100107 ,
+ "na.hostperf" => 100107 ,
+ "activity" => 100109 ,
+ "na.activity" => 100109 ,
+ "hostmem" => 100112 ,
+ "na.hostmem" => 100112 ,
+ "sample" => 100113 ,
+ "na.sample" => 100113 ,
+ "x25" => 100114 ,
+ "na.x25" => 100114 ,
+ "ping" => 100115 ,
+ "na.ping" => 100115 ,
+ "rpcnfs" => 100116 ,
+ "na.rpcnfs" => 100116 ,
+ "hostif" => 100117 ,
+ "na.hostif" => 100117 ,
+ "etherif" => 100118 ,
+ "na.etherif" => 100118 ,
+ "iproutes" => 100120 ,
+ "na.iproutes" => 100120 ,
+ "layers" => 100121 ,
+ "na.layers" => 100121 ,
+ "snmp" => 100122 ,
+ "na.snmp" => 100122 ,
+ "snmp-cmc" => 100122 ,
+ "snmp-synoptics" => 100122 ,
+ "snmp-unisys" => 100122 ,
+ "snmp-utk" => 100122 ,
+ "traffic" => 100123 ,
+ "na.traffic" => 100123 ,
+ "nfs_acl" => 100227 ,
+ "sadmind" => 100232 ,
+ "nisd" => 100300 ,
+ "rpc.nisd" => 100300 ,
+ "nispasswd" => 100303 ,
+ "rpc.nispasswdd" => 100303 ,
+ "ufsd" => 100233 ,
+ "ufsd" => 100233 ,
+ "pcnfsd" => 150001 ,
+ "pcnfs" => 150001 ,
+ "amd" => 300019 ,
+ "amq" => 300019 ,
+ "bwnfsd" => 545580417 ,
+ "fypxfrd" => 600100069 ,
+ "freebsd-ypxfrd" => 600100069 ,
+);
+
+# -v means verbose, -v-v means verbose twice = print above hash
+if (defined $verbose && ($verbose > 1) ){
+ my $key;
+ print "Supported programs:\n";
+ print " name\t=>\tnumber\n";
+ print " ===============================\n";
+ foreach $key (sort keys %prognum) {
+ print " $key \t=>\t$prognum{$key} \n";
+ }
+ print "\n\n";
+ print_usage();
+ exit $ERRORS{'OK'};
+}
+
+# -H means host name
+unless ($opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; }
+
+if (! utils::is_hostname($opt_H)){
+ print "$opt_H is not a valid host name\n";
+ print_usage();
+ exit $ERRORS{"UNKNOWN"};
+}else{
+ $host = $opt_H;
+}
+
+if ($opt_t && $opt_u) {
+ print "Cannot define tcp AND udp\n";
+ print_usage();
+ exit $ERRORS{'UNKNOWN'};
+}
+
+
+# -C means command name or number
+$opt_C = shift unless ($opt_C);
+unless ($opt_C) { print_usage(); exit -1; }
+@progkeys = keys %prognum;
+if ($opt_C =~ m/^([0-9]+)$/){
+# $response = "RPC ok: program $opt_C (version ";
+ $prognum = $1;
+} elsif ( in( \@progkeys, $opt_C)) {
+# $response = "RPC ok: $opt_C (version ";
+ $prognum = $prognum{$opt_C};
+} else {
+ print "Program $opt_C is not defined\n";
+ exit $ERRORS{'UNKNOWN'};
+}
+
+# -p means port number
+if($opt_p =~ /^([0-9]+)$/){
+ $port = "-n $1";
+} else {
+ $port = "";
+}
+
+$proto = 'u';
+$proto = $proto[$prognum] if ($proto[$prognum]);
+$proto = 't' if ($opt_t);
+$proto = 'u' if ($opt_u);
+
+
+# Just in case of problems, let's not hang the monitoring system
+$SIG{'ALRM'} = sub {
+ print ("ERROR: No response from RPC server (alarm)\n");
+ exit $ERRORS{"UNKNOWN"};
+};
+alarm($TIMEOUT);
+
+# -c is progver - if we need to check multiple specified versions.
+if (defined $opt_c ) {
+ my $vers;
+ @progvers = split(/,/ ,$opt_c );
+ foreach $vers (sort @progvers) {
+ if($vers =~ /^([0-9]+)$/){
+ $progver = "$1";
+ print "Checking $opt_C version $progver proto $proto\n" if $verbose;
+ get_rpcinfo();
+ }else{
+ print "Version $vers is not an integer\n" if $verbose;
+ }
+
+ }
+}else{
+ get_rpcinfo();
+}
+
+
+## translate proto for output
+if ($proto eq "u" ){
+ $proto = "udp";
+}else{
+ $proto = "tcp";
+}
+
+if ($state eq 'OK') {
+ print "$state: RPC program $opt_C".$response." $proto running\n";
+}else{
+ if($response){
+ print "$state: RPC program $opt_C".$response2." $proto is not running,".$response." $proto is running\n";
+ }else{
+ print "$state: RPC program $opt_C $response2 $proto is not running\n";
+ }
+}
+exit $ERRORS{$state};
+
+
+######## Subroutines ==========================
+
+sub get_rpcinfo {
+ $cmd = "$utils::PATH_TO_RPCINFO $port -" . "$proto $host $prognum $progver 2>&1 |";
+ print "$cmd\n" if ($verbose);
+ open CMD, $cmd or die "Can't fork for rpcinfo: $!\n" ;
+
+ while ( $line = <CMD> ) {
+ printf "$line " if $verbose;
+ chomp $line;
+
+ if ( $line =~ /program $prognum version ([0-9]*) ready and waiting/ ) {
+ $response .= " version $1";
+ $state = 'OK' unless $state ne 'UNKNOWN';
+ print "1:$response \n" if $verbose;
+ }
+
+ if ( $line =~ /program $prognum version ([0-9]*) is not available/ ) {
+ $response2 .= " version $1";
+ $state = 'CRITICAL';
+ print "2:$response2 \n" if $verbose;
+ }
+ if ( $line =~ /program $prognum is not available/ ) {
+ $response3 = "";
+ $response3 = "tcp" if $opt_t;
+ $response3 = "udp" if $opt_u;
+ $state = 'CRITICAL';
+ print "3:$response3 \n" if $verbose;
+ }
+ }
+ close CMD;
+}
+
+
+sub print_help() {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2002 Karl DeBisschop/Truongchinh Nguyen/Subhendu Ghosh\n";
+ print "\n";
+ print "Check if a rpc service is registered and running using\n";
+ print " rpcinfo -H host -C rpc_command \n";
+ print "\n";
+ print_usage();
+ print "\n";
+ print " <host> The server providing the rpc service\n";
+ print " <rpc_command> The program name (or number).\n";
+ print " <program_version> The version you want to check for (one or more)\n";
+ print " Should prevent checks of unknown versions being syslogged\n";
+ print " e.g. 2,3,6 to check v2, v3, and v6\n";
+ print " [-u | -t] Test UDP or TCP\n";
+ print " [-v] Verbose \n";
+ print " [-v -v] Verbose - will print supported programs and numbers \n";
+ print "\n";
+ support();
+}
+
+sub print_usage () {
+ print "Usage: \n";
+ print " $PROGNAME -H host -C rpc_command [-p port] [-c program_version] [-u|-t] [-v]\n";
+ print " $PROGNAME [-h | --help]\n";
+ print " $PROGNAME [-V | --version]\n";
+}
+
+sub in ($$) {
+ $array_ref = shift;
+ $test = shift;
+
+ while ( $element = shift @{$array_ref} ) {
+ if ($test eq $element) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh
new file mode 100755
index 0000000..866e0e0
--- /dev/null
+++ b/plugins-scripts/check_sensors.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+PATH="@TRUSTED_PATH@"
+export PATH
+PROGNAME=$(basename "$0")
+PROGPATH=$(echo "$0" | sed -e 's,[\\/][^\\/][^\\/]*$,,')
+REVISION="@NP_VERSION@"
+
+. "$PROGPATH"/utils.sh
+
+print_usage() {
+ echo "Usage: $PROGNAME" [--ignore-fault]
+}
+
+print_help() {
+ print_revision "$PROGNAME" "$REVISION"
+ echo ""
+ print_usage
+ echo ""
+ echo "This plugin checks hardware status using the lm_sensors package."
+ echo ""
+ support
+ exit "$STATE_OK"
+}
+
+case "$1" in
+ --help)
+ print_help
+ exit "$STATE_UNKNOWN"
+ ;;
+ -h)
+ print_help
+ exit "$STATE_UNKNOWN"
+ ;;
+ --version)
+ print_revision "$PROGNAME" "$REVISION"
+ exit "$STATE_UNKNOWN"
+ ;;
+ -V)
+ print_revision "$PROGNAME" "$REVISION"
+ exit "$STATE_UNKNOWN"
+ ;;
+ *)
+ sensordata=$(sensors 2>&1)
+ status=$?
+ if test ${status} -eq 127; then
+ text="SENSORS UNKNOWN - command not found (did you install lmsensors?)"
+ exit=$STATE_UNKNOWN
+ elif test "${status}" -ne 0; then
+ text="WARNING - sensors returned state $status"
+ exit=$STATE_WARNING
+ elif echo "${sensordata}" | grep -E ALARM > /dev/null; then
+ text="SENSOR CRITICAL - Sensor alarm detected!"
+ exit=$STATE_CRITICAL
+ elif echo "${sensordata}" | grep -E FAULT > /dev/null \
+ && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+ text="SENSOR UNKNOWN - Sensor reported fault"
+ exit=$STATE_UNKNOWN
+ else
+ text="SENSORS OK"
+ exit=$STATE_OK
+ fi
+
+ echo "$text"
+ if test "$1" = "-v" -o "$1" = "--verbose"; then
+ echo "${sensordata}"
+ fi
+ exit "$exit"
+ ;;
+esac
diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl
new file mode 100755
index 0000000..d73e40e
--- /dev/null
+++ b/plugins-scripts/check_uptime.pl
@@ -0,0 +1,328 @@
+#!@PERL@ -w
+
+# check_uptime - check uptime to see how long the system is running.
+#
+
+# License Information:
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+############################################################################
+
+use POSIX;
+use strict;
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_v $verbose $PROGNAME $opt_w $opt_c
+ $opt_f $opt_s $opt_d
+ $lower_warn_threshold $upper_warn_threshold
+ $lower_crit_threshold $upper_crit_threshold
+ $status $state $msg);
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw(%ERRORS &print_revision &support &usage );
+
+sub print_help ();
+sub print_usage ();
+sub process_arguments ();
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+$PROGNAME = "check_uptime";
+$state = $ERRORS{'UNKNOWN'};
+
+my $uptime_file = "/proc/uptime";
+
+
+# Process arguments
+
+Getopt::Long::Configure('bundling');
+$status = process_arguments();
+if ($status){
+ print "ERROR: processing arguments\n";
+ exit $ERRORS{"UNKNOWN"};
+}
+
+
+# Get uptime info from file
+
+if ( ! -r $uptime_file ) {
+ print "ERROR: file '$uptime_file' is not readable\n";
+ exit $ERRORS{"UNKNOWN"};
+}
+
+if ( ! open FILE, "<", $uptime_file ) {
+ print "ERROR: cannot read from file '$uptime_file'\n";
+ exit $ERRORS{"UNKNOWN"};
+}
+
+chomp( my $file_content = <FILE> );
+close FILE;
+
+print "$uptime_file: $file_content\n" if $verbose;
+
+# Get first digit value (without fraction)
+my ( $uptime_seconds ) = $file_content =~ /^([\d]+)/;
+
+# Bail out if value is not numeric
+if ( $uptime_seconds !~ /^\d+$/ ) {
+ print "ERROR: no numeric value: $uptime_seconds\n";
+ exit $ERRORS{"UNKNOWN"};
+}
+
+
+# Do calculations for a "pretty" format (2 weeks, 5 days, ...)
+
+my ( $secs, $mins, $hours, $days, $weeks );
+$secs = $uptime_seconds;
+$mins = $hours = $days = $weeks = 0;
+if ( $secs > 100 ) {
+ $mins = int( $secs / 60 );
+ $secs -= $mins * 60;
+}
+if ( $mins > 100 ) {
+ $hours = int( $mins / 60 );
+ $mins -= $hours * 60;
+}
+if ( $hours > 48 ) {
+ $days = int( $hours / 24 );
+ $hours -= $days * 24;
+}
+if ( $days > 14 ) {
+ $weeks = int( $days / 7 );
+ $days -= $weeks * 7;
+}
+
+my $pretty_uptime = "";
+$pretty_uptime .= sprintf( "%d week%s, ", $weeks, $weeks == 1 ? "" : "s" ) if $weeks;
+$pretty_uptime .= sprintf( "%d day%s, ", $days, $days == 1 ? "" : "s" ) if $days;
+$pretty_uptime .= sprintf( "%d hour%s, ", $hours, $hours == 1 ? "" : "s" ) if $hours;
+$pretty_uptime .= sprintf( "%d minute%s, ", $mins, $mins == 1 ? "" : "s" ) if $mins;
+# Replace last occurrence of comma with "and"
+$pretty_uptime =~ s/, $/ and /;
+# Always print the seconds (though it may be 0 seconds)
+$pretty_uptime .= sprintf( "%d second%s", $secs, $secs == 1 ? "" : "s" );
+
+
+# Default to catch errors in program
+my $state_str = "UNKNOWN";
+
+# Check values
+my $out_of_bounds_text = "";
+if ( $uptime_seconds > $upper_crit_threshold ) {
+ $state_str = "CRITICAL";
+ $out_of_bounds_text = "upper crit";
+} elsif ( $uptime_seconds < $lower_crit_threshold ) {
+ $state_str = "CRITICAL";
+ $out_of_bounds_text = "lower crit";
+} elsif ( $uptime_seconds > $upper_warn_threshold ) {
+ $state_str = "WARNING";
+ $out_of_bounds_text = "upper warn";
+} elsif ( $uptime_seconds < $lower_warn_threshold ) {
+ $state_str = "WARNING";
+ $out_of_bounds_text = "lower warn";
+} else {
+ $state_str = "OK";
+}
+
+# Prepare uptime value (seconds or days)
+my $uptime_text = "";
+my $uptime_unit = "";
+if ( $opt_d ) {
+ $uptime_text = floor($uptime_seconds / 60 / 60 / 24);
+ $uptime_unit = "days";
+} else {
+ $uptime_text = $uptime_seconds;
+ $uptime_unit = "seconds";
+}
+
+$msg = "$state_str: ";
+
+$msg .= "Uptime is $uptime_text $uptime_unit. ";
+$msg .= "Exceeds $out_of_bounds_text threshold. " if $out_of_bounds_text;
+$msg .= "Running for $pretty_uptime. " if $opt_f;
+if ( $opt_s ) {
+ my $up_since = strftime( "%Y-%m-%d %H:%M:%S", localtime( time - $uptime_seconds ) );
+ $msg .= "Running since $up_since. ";
+}
+
+$state = $ERRORS{$state_str};
+
+# Perfdata support
+print "$msg|uptime=${uptime_seconds}s;$upper_warn_threshold;$upper_crit_threshold;0\n";
+exit $state;
+
+
+#####################################
+#### subs
+
+
+sub process_arguments(){
+ GetOptions
+ ("V" => \$opt_V, "version" => \$opt_V,
+ "v" => \$opt_v, "verbose" => \$opt_v,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "w=s" => \$opt_w, "warning=s" => \$opt_w, # warning if above this number
+ "c=s" => \$opt_c, "critical=s" => \$opt_c, # critical if above this number
+ "f" => \$opt_f, "for" => \$opt_f, # show "running for ..."
+ "s" => \$opt_s, "since" => \$opt_s, # show "running since ..."
+ "d" => \$opt_d, "days" => \$opt_d, # report uptime in days
+ );
+
+ if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if ($opt_h) {
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ if (defined $opt_v) {
+ $verbose = $opt_v;
+ }
+
+ unless ( defined $opt_w && defined $opt_c ) {
+ print_usage();
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ # Check if a range was supplied ("lowvalue:highvalue") for warning and critical
+ # Otherwise, set 0 as the lower threshold and the parameter value as upper threshold
+ # (the uptime should always be positive, so there should be no issue)
+ if ( $opt_w =~ /^(.+):(.+)$/ ) {
+ $lower_warn_threshold = $1;
+ $upper_warn_threshold = $2;
+ } else {
+ $lower_warn_threshold = 0;
+ $upper_warn_threshold = $opt_w;
+ }
+ if ( $opt_c =~ /^(.+):(.+)$/ ) {
+ $lower_crit_threshold = $1;
+ $upper_crit_threshold = $2;
+ } else {
+ $lower_crit_threshold = 0;
+ $upper_crit_threshold = $opt_c;
+ }
+
+ # Set as seconds (calculate if suffix present)
+ $lower_warn_threshold = calc_as_seconds( $lower_warn_threshold );
+ $lower_crit_threshold = calc_as_seconds( $lower_crit_threshold );
+ $upper_warn_threshold = calc_as_seconds( $upper_warn_threshold );
+ $upper_crit_threshold = calc_as_seconds( $upper_crit_threshold );
+
+ # Check for numeric value of warning parameter
+ if ( $lower_warn_threshold !~ /^\d+$/ ) {
+ print "Lower warning (-w) is not numeric\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ if ( $upper_warn_threshold !~ /^\d+$/ ) {
+ print "Upper warning (-w) is not numeric\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ # Check for numeric value of critical parameter
+ if ( $lower_crit_threshold !~ /^\d+$/ ) {
+ print "Lower critical (-c) is not numeric\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ if ( $upper_crit_threshold !~ /^\d+$/ ) {
+ print "Upper critical (-c) is not numeric\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ # Check boundaries
+ if ( $upper_warn_threshold >= $upper_crit_threshold ) {
+ print "Upper Warning (-w) cannot be greater than Critical (-c)!\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ # No "<=" since both values are zero if no range (only upper threshold values) is given
+ if ( $lower_warn_threshold < $lower_crit_threshold ) {
+ print "Lower Warning (-w) cannot be less than Critical (-c)!\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+
+ return $ERRORS{'OK'};
+}
+
+sub print_usage () {
+ print "Usage: $PROGNAME -w <warn> -c <crit> [-v]\n";
+}
+
+sub print_help () {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n";
+ print "Copyright (c) 2018 Bernd Arnold\n";
+ print "\n";
+ print_usage();
+ print "\n";
+ print " Checks the uptime of the system using $uptime_file\n";
+ print "\n";
+ print "-w (--warning) = Min. number of uptime to generate warning\n";
+ print "-c (--critical) = Min. number of uptime to generate critical alert ( w < c )\n";
+ print "-f (--for) = Show uptime in a pretty format (Running for x weeks, x days, ...)\n";
+ print "-s (--since) = Show last boot in yyyy-mm-dd HH:MM:SS format (output from 'uptime -s')\n";
+ print "-d (--days) = Show uptime in days\n";
+ print "-h (--help)\n";
+ print "-V (--version)\n";
+ print "-v (--verbose) = debugging output\n";
+ print "\n\n";
+ print "Note: -w and -c are required arguments.\n";
+ print " You can suffix both values with s for seconds (default), m (minutes), h (hours), d (days) or w (weeks).\n";
+ print "\n";
+ print "Range support: You may specify a range for both warning and critical thresholds.\n";
+ print " This works without additional Perl modules.\n";
+ print "Example: ./check_uptime -w 10m:4w -c 1m:8w\n";
+ print " Results in a critical state when uptime is below 60 seconds or higher than 8 weeks,\n";
+ print " and in a warning state when uptime is below 10 minutes or above 4 weeks.\n";
+ print "\n\n";
+ support();
+}
+
+sub calc_as_seconds () {
+
+ my $parameter = shift;
+
+ # Check if suffix is present
+ # Calculate parameter to seconds (to get an integer value finally)
+ # If no suffix is present, just return the value
+
+ # Possible suffixes:
+ # s = seconds
+ # m = minutes
+ # h = hours
+ # d = days
+ # w = weeks
+ my %factor = ( "s" => 1,
+ "m" => 60,
+ "h" => 60 * 60,
+ "d" => 60 * 60 * 24,
+ "w" => 60 * 60 * 24 * 7,
+ );
+
+ if ( $parameter =~ /^(\d+)([a-z])$/ ) {
+ my $value = $1;
+ my $suffix = $2;
+ print "detected: value=$value, suffix=$suffix\n" if $verbose;
+ if ( ! defined $factor{$suffix} ) {
+ print "Error: wrong suffix ($suffix) for value '$parameter'";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ $parameter = $value * $factor{$suffix};
+ }
+
+ return $parameter;
+
+}
diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl
new file mode 100755
index 0000000..c24015c
--- /dev/null
+++ b/plugins-scripts/check_wave.pl
@@ -0,0 +1,124 @@
+#!@PERL@ -w
+#
+
+
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_h $verbose $opt_w $opt_c $opt_H);
+my (@test, $low1, $med1, $high1, $snr, $low2, $med2, $high2);
+my ($low, $med, $high, $lowavg, $medavg, $highavg, $tot, $ss);
+
+$PROGNAME = "check_wave";
+sub print_help ();
+sub print_usage ();
+
+$ENV{'PATH'}='@TRUSTED_PATH@';
+$ENV{'BASH_ENV'}='';
+$ENV{'ENV'}='';
+$ENV{'CDPATH'}='';
+
+Getopt::Long::Configure('bundling');
+GetOptions
+ ("V" => \$opt_V, "version" => \$opt_V,
+ "h" => \$opt_h, "help" => \$opt_h,
+ "v" => \$verbose, "verbose" => \$verbose,
+ "w=s" => \$opt_w, "warning=s" => \$opt_w,
+ "c=s" => \$opt_c, "critical=s" => \$opt_c,
+ "H=s" => \$opt_H, "hostname=s" => \$opt_H);
+
+if ($opt_V) {
+ print_revision($PROGNAME,'@NP_VERSION@'); #'
+ exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_h) {
+ print_help();
+ exit $ERRORS{'UNKNOWN'};
+}
+
+$opt_H = shift unless ($opt_H);
+print_usage() unless ($opt_H);
+my $host = $1 if ($opt_H =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z][-a-zA-Z0]+(\.[a-zA-Z][-a-zA-Z0]+)*)$/);
+print_usage() unless ($host);
+
+($opt_c) || ($opt_c = shift) || ($opt_c = 120);
+my $critical = $1 if ($opt_c =~ /([0-9]+)/);
+
+($opt_w) || ($opt_w = shift) || ($opt_w = 60);
+my $warning = $1 if ($opt_w =~ /([0-9]+)/);
+
+$low1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
+@test = split(/ /,$low1);
+$low1 = $test[2];
+
+$med1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
+@test = split(/ /,$med1);
+$med1 = $test[2];
+
+$high1 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
+@test = split(/ /,$high1);
+$high1 = $test[2];
+
+sleep(2);
+
+$snr = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.762.2.5.2.1.17.1`;
+@test = split(/ /,$snr);
+$snr = $test[2];
+$snr = int($snr*25);
+
+$low2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
+@test = split(/ /,$low2);
+$low2 = $test[2];
+
+$med2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
+@test = split(/ /,$med2);
+$med2 = $test[2];
+
+$high2 = `$utils::PATH_TO_SNMPGET $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
+@test = split(/ /,$high2);
+$high2 = $test[2];
+
+$low = $low2 - $low1;
+$med = $med2 - $med1;
+$high = $high2 - $high1;
+
+$tot = $low + $med + $high;
+
+if ($tot==0) {
+ $ss = 0;
+} else {
+ $lowavg = $low / $tot;
+ $medavg = $med / $tot;
+ $highavg = $high / $tot;
+ $ss = ($medavg*50) + ($highavg*100);
+}
+
+printf("Signal Strength at: %3.0f%, SNR at $snr%",$ss);
+
+if ($ss<$critical) {
+ exit(2);
+} elsif ($ss<$warning) {
+ exit(1);
+} else {
+ exit(0);
+}
+
+
+sub print_usage () {
+ print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>]\n";
+}
+
+sub print_help () {
+ print_revision($PROGNAME,'@NP_VERSION@');
+ print "Copyright (c) 2000 Jeffery Blank/Karl DeBisschop\n";
+ print "\n";
+ print_usage();
+ print "\n";
+ print "<warn> = Signal strength at which a warning message will be generated.\n";
+ print "<crit> = Signal strength at which a critical message will be generated.\n\n";
+ support();
+}
diff --git a/plugins-scripts/t/check_disk_smb.t b/plugins-scripts/t/check_disk_smb.t
new file mode 100644
index 0000000..c2e8bbb
--- /dev/null
+++ b/plugins-scripts/t/check_disk_smb.t
@@ -0,0 +1,96 @@
+#! /usr/bin/perl -w -I ..
+#
+# test cases for check_disk_smb
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $tests = 14;
+plan tests => $tests;
+my $res;
+
+my $plugin = "check_disk_smb";
+SKIP: {
+ skip "$plugin is not created", $tests if ( ! -x $plugin );
+ my $auth = "";
+
+ my $host = getTestParameter("NP_HOST_SMB", "A host providing an SMB Service",
+ "localhost");
+
+ my $smb_share = getTestParameter("NP_SMB_SHARE",
+ "An SMB share name the host provides",
+ "public");
+
+ my $smb_share_spc = getTestParameter("NP_SMB_SHARE_SPC",
+ "An SMB share name containing one or more spaces the host provides",
+ "pub lic");
+
+ my $smb_share_deny = getTestParameter("NP_SMB_SHARE_DENY",
+ "An access denying SMB share name the host provides",
+ "private");
+
+ my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests", "10.0.0.1" );
+
+ my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost" );
+ my $user = getTestParameter( "NP_SMB_VALID_USER", "A valid smb user", "" );
+ my $pass = getTestParameter( "NP_SMB_VALID_USER_PASS", "A valid password for valid smb user", "" );
+ $auth .= "-u $user " if ($user);
+ $auth .= "-p $pass " if ($pass);
+
+
+
+ $res = NPTest->testCmd( "./$plugin" );
+ is( $res->return_code, 3, "No arguments" );
+
+ $res = NPTest->testCmd( "./$plugin -H fakehostname" );
+ is( $res->return_code, 3, "No share specified" );
+
+ $res = NPTest->testCmd( "./$plugin -H fakehostname -s share -w 100G -c 101G" );
+ is( $res->return_code, 3, "warn is less than critical" );
+
+ SKIP: {
+ skip "no smb host defined", 10 if ( ! $host );
+
+ SKIP: {
+ skip "no share name defined", 2 if ( ! $smb_share );
+ $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 2k -c 1k" );
+ cmp_ok( $res->return_code, '==', 0, "Exit OK if $smb_share has > 1k free space");
+ like($res->output, '/free/i', "String contains the word 'free'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 10001G -c 10000G" );
+ cmp_ok( $res->return_code, '==', 2, "Exit CRIT if $smb_share has < 10000G free space");
+ like($res->output, '/free/i', "String contains the word 'free'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share -w 10000G -c 1k" );
+ cmp_ok( $res->return_code, '==', 1, "Exit WARN if $smb_share has > 10000G and <1k free space");
+ like($res->output, '/free/i', "String contains the word 'free'");
+ }
+
+ SKIP: {
+ skip "no share name containing spaces defined", 2 if ( ! $smb_share_spc );
+ $res = NPTest->testCmd( "./$plugin -H $host $auth -s '$smb_share_spc' -w 2k -c 1k" );
+ cmp_ok( $res->return_code, '==', 0, "Exit OK if '$smb_share_spc' has > 1k free space");
+ like($res->output, '/free/i', "String contains the word 'free'");
+
+ }
+ SKIP: {
+ skip "no share name without permissions ", 2 if ( ! $smb_share_deny );
+ $res = NPTest->testCmd( "./$plugin -H $host $auth -s $smb_share_deny -w 2k -c 1k" );
+ cmp_ok( $res->return_code, '==', 2, "Exit CRIT if $smb_share_deny has > 1k free space");
+ unlike($res->output, '/free/i', "String does not contain the word 'free'");
+
+ }
+ }
+
+ SKIP: {
+ skip "no non responsive host defined", 1 if ( ! $host_nonresponsive );
+ $res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -s np_foobar ");
+ cmp_ok( $res->return_code, '>=', 2, "Exit CRITICAL/UNKNOWN with non responsive host" );
+ }
+
+}
diff --git a/plugins-scripts/t/check_file_age.t b/plugins-scripts/t/check_file_age.t
new file mode 100644
index 0000000..8b87670
--- /dev/null
+++ b/plugins-scripts/t/check_file_age.t
@@ -0,0 +1,109 @@
+#!/usr/bin/perl -w -I ..
+#
+# check_file_age tests
+#
+#
+
+use strict;
+use Test::More tests => 27;
+use NPTest;
+
+my $successOutput = '/^FILE_AGE OK: /';
+my $warningOutput = '/^FILE_AGE WARNING: /';
+my $criticalOutput = '/^FILE_AGE CRITICAL: /';
+my $unknownOutput = '/^FILE_AGE UNKNOWN: /';
+my $performanceOutput = '/ \| age=[0-9]+s;[0-9:]+;[0-9:]+ size=[0-9]+B;[0-9:]+;[0-9:]+;0$/';
+
+my $result;
+my $temp_file = "/tmp/check_file_age.tmp";
+my $temp_link = "/tmp/check_file_age.link.tmp";
+
+unlink $temp_file, $temp_link;
+
+$result = NPTest->testCmd("./check_file_age");
+cmp_ok( $result->return_code, '==', 3, "Missing parameters" );
+like ( $result->output, $unknownOutput, "Output for unknown correct" );
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file");
+cmp_ok( $result->return_code, '==', 2, "File not exists" );
+like ( $result->output, $criticalOutput, "Output for file missing correct" );
+
+write_chars(100);
+$result = NPTest->testCmd("./check_file_age -f $temp_file");
+cmp_ok( $result->return_code, '==', 0, "File is new enough" );
+like ( $result->output, $successOutput, "Output for success correct" );
+
+sleep 2;
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file -w 1");
+cmp_ok( $result->return_code, '==', 1, "Warning for file over 1 second old" );
+like ( $result->output, $warningOutput, "Output for warning correct" );
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1");
+cmp_ok( $result->return_code, '==', 2, "Critical for file over 1 second old" );
+like ( $result->output, $criticalOutput, "Output for critical correct" );
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 100");
+cmp_ok( $result->return_code, '==', 0, "Checking file size" );
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 100");
+like( $result->output, $performanceOutput, "Checking for performance Output" );
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 100");
+like( $result->output, $performanceOutput, "Checking for performance Output from range" );
+
+$result = NPTest->testCmd("./check_file_age -f /non/existent --ignore-missing");
+cmp_ok( $result->return_code, '==', 0, "Honours --ignore-missing" );
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 101");
+cmp_ok( $result->return_code, '==', 1, "One byte too short" );
+
+$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -C 101");
+cmp_ok( $result->return_code, '==', 2, "One byte too short - critical" );
+
+SKIP: {
+ eval 'use Monitoring::Plugin::Range';
+ skip "Monitoring::Plugin::Range module require", 9 if $@;
+
+ $result = NPTest->testCmd("./check_file_age -f $temp_file -w 0:1");
+ cmp_ok( $result->return_code, '==', 1, "Warning for file over 1 second old by range" );
+ like ( $result->output, $warningOutput, "Output for warning by range correct" );
+
+ $result = NPTest->testCmd("./check_file_age -f $temp_file -c 0:1");
+ cmp_ok( $result->return_code, '==', 2, "Critical for file over 1 second old by range" );
+ like ( $result->output, $criticalOutput, "Output for critical by range correct" );
+
+ $result = NPTest->testCmd("./check_file_age -f $temp_file -c 0:1000 -W 0:100");
+ cmp_ok( $result->return_code, '==', 0, "Checking file size by range" );
+
+ $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 101:");
+ cmp_ok( $result->return_code, '==', 1, "One byte too short by range" );
+
+ $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -W 0:99");
+ cmp_ok( $result->return_code, '==', 1, "One byte too long by range" );
+
+ $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -C 101:");
+ cmp_ok( $result->return_code, '==', 2, "One byte too short by range - critical" );
+
+ $result = NPTest->testCmd("./check_file_age -f $temp_file -c 1000 -C 0:99");
+ cmp_ok( $result->return_code, '==', 2, "One byte too long by range - critical" );
+};
+
+symlink $temp_file, $temp_link or die "Cannot create symlink";
+$result = NPTest->testCmd("./check_file_age -f $temp_link -c 10");
+cmp_ok( $result->return_code, '==', 0, "Works for symlinks" );
+unlink $temp_link;
+
+unlink $temp_file;
+mkdir $temp_file or die "Cannot create directory";
+$result = NPTest->testCmd("./check_file_age -f $temp_file -c 1");
+cmp_ok( $result->return_code, '==', 0, "Works for directories" );
+rmdir $temp_file;
+
+
+sub write_chars {
+ my $size = shift;
+ open F, "> $temp_file" or die "Cannot write to $temp_file";
+ print F "A" x $size;
+ close F;
+}
diff --git a/plugins-scripts/t/check_ifoperstatus.t b/plugins-scripts/t/check_ifoperstatus.t
new file mode 100644
index 0000000..2feb364
--- /dev/null
+++ b/plugins-scripts/t/check_ifoperstatus.t
@@ -0,0 +1,93 @@
+#! /usr/bin/perl -w -I ..
+#
+# SNMP Test via check_ifoperstatus
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $tests = 15;
+plan tests => $tests;
+my $res;
+
+my $plugin = "check_ifoperstatus";
+SKIP: {
+ skip "$plugin is not created", $tests if ( ! -x $plugin );
+
+ my $host_snmp = getTestParameter( "NP_HOST_SNMP", "A host providing an SNMP Service", "localhost");
+
+ my $snmp_community = getTestParameter( "NP_SNMP_COMMUNITY",
+ "The SNMP Community string for SNMP Testing",
+ "public");
+
+ my ($snmp_interface, $snmp_ifxtable);
+ if ($host_snmp) {
+ $snmp_interface = getTestParameter( "NP_SNMP_INTERFACE", "Name of an active network interface on SNMP server", "lo" );
+
+ $snmp_ifxtable = getTestParameter( "NP_SNMP_IFXTABLE",
+ "Is IFXTABLE activated in SNMP server (1: yes, 0: no)? snmpwalk -v1 -c $snmp_community $host_snmp ifxtable",
+ "1" );
+ }
+
+ my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests", "10.0.0.1" );
+
+ my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost" );
+
+
+
+ $res = NPTest->testCmd( "./$plugin" );
+ is( $res->return_code, 3, "No arguments" );
+ like( $res->output, '/usage/', "Output contains usage" );
+
+ $res = NPTest->testCmd( "./$plugin -H fakehostname" );
+ is( $res->return_code, 3, "No key/descr specified" );
+ like( $res->output, '/Either a valid snmp key/', "Output contains 'Either a valid snmp key'" );
+
+ $res = NPTest->testCmd( "./$plugin -H fakehost -k 1 -v 3 --seclevel rubbish --secname foobar" );
+ is( $res->return_code, 3, "invalid seclevel" );
+ like( $res->output, "/Must define a valid security level/", "Output contains 'Must define a valid security level'" );
+
+ SKIP: {
+ skip "no snmp host defined", 6 if ( ! $host_snmp );
+
+ $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community -k 1");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK for ifindex 1" );
+ like($res->output, '/^OK.*Interface.*is up/', "String contains OK Interface is up");
+
+ SKIP: {
+ skip "no snmp interface defined", 2 if ( ! $snmp_interface );
+ $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community -d $snmp_interface");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK for ifdescr $snmp_interface" );
+ like($res->output, '/^OK.*Interface.*is up/', "String contains OK Interface is up");
+ }
+
+ SKIP: {
+ skip "ifxtable not available", 2 if ( ! $snmp_ifxtable );
+ $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community -k 1 -n rubbish");
+ cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN if interface name doesn't match" );
+ like($res->output, '/doesn\'t match snmp value/', "String contains 'doesn't match snmp value'");
+ }
+
+ }
+
+ # These checks need a complete command line. An invalid community is used so
+ # the tests can run on hosts w/o snmp host/community in NPTest.cache. Execution will fail anyway
+ SKIP: {
+ skip "no non responsive host defined", 1 if ( ! $host_nonresponsive );
+ $res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -C np_foobar -k 1");
+ cmp_ok( $res->return_code, '==', 1, "Exit WARNING with non responsive host" );
+ }
+
+ SKIP: {
+ skip "no invalid host defined", 2 if ( ! $hostname_invalid );
+ $res = NPTest->testCmd( "./$plugin -H $hostname_invalid -C np_foobar -k 1");
+ cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with invalid host" );
+ like($res->output, "/Unable to resolve.*$hostname_invalid/", "String matches unable to resolve.*$hostname_invalid");
+ }
+
+}
diff --git a/plugins-scripts/t/check_ifstatus.t b/plugins-scripts/t/check_ifstatus.t
new file mode 100644
index 0000000..7d0220a
--- /dev/null
+++ b/plugins-scripts/t/check_ifstatus.t
@@ -0,0 +1,67 @@
+#! /usr/bin/perl -w -I ..
+#
+# SNMP Test via check_ifoperstatus
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $tests = 9;
+plan tests => $tests;
+my $res;
+
+my $plugin = "check_ifstatus";
+SKIP: {
+ skip "$plugin is not created", $tests if ( ! -x $plugin );
+
+ my $host_snmp = getTestParameter( "NP_HOST_SNMP", "A host providing an SNMP Service", "localhost");
+
+ my $snmp_community = getTestParameter( "NP_SNMP_COMMUNITY",
+ "The SNMP Community string for SNMP Testing",
+ "public");
+
+ my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests", "10.0.0.1" );
+
+ my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost" );
+
+
+ $res = NPTest->testCmd( "./$plugin" );
+ is( $res->return_code, 3, "No arguments" );
+ like( $res->output, '/usage/', "Output contains usage" );
+
+ $res = NPTest->testCmd( "./$plugin -H fakehost -v 3 --seclevel rubbish --secname foobar" );
+ is( $res->return_code, 3, "invalid seclevel" );
+ like( $res->output, "/Must define a valid security level/", "Output contains 'Must define a valid security level'" );
+
+ SKIP: {
+ skip "no snmp host defined", 2 if ( ! $host_snmp );
+
+ $res = NPTest->testCmd( "./$plugin -H $host_snmp -C $snmp_community ");
+ like($res->output, '/^.*host.*interfaces up/', "String contains host.*interfaces up");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_snmp -C rubbish");
+ cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL for community 'rubbish'" );
+
+ }
+
+ # These checks need a complete command line. An invalid community is used so
+ # the tests can run on hosts w/o snmp host/community in NPTest.cache. Execution will fail anyway
+ SKIP: {
+ skip "no non responsive host defined", 1 if ( ! $host_nonresponsive );
+ $res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -C np_foobar");
+ cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL with non responsive host" );
+ }
+
+ SKIP: {
+ skip "no invalid host defined", 2 if ( ! $hostname_invalid );
+ $res = NPTest->testCmd( "./$plugin -H $hostname_invalid -C np_foobar");
+ cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with invalid host" );
+ like($res->output, "/Unable to resolve.*$hostname_invalid/", "String matches unable to resolve.*$hostname_invalid");
+ }
+
+}
diff --git a/plugins-scripts/t/check_log.t b/plugins-scripts/t/check_log.t
new file mode 100644
index 0000000..b66e0fd
--- /dev/null
+++ b/plugins-scripts/t/check_log.t
@@ -0,0 +1,82 @@
+#!/usr/bin/perl -w -I ..
+#
+# check_log tests
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $tests = 18;
+plan tests => $tests;
+
+my $firstTimeOutput ='/^Log check data initialized/';
+my $okOutput = '/^Log check ok - 0 pattern matches found/';
+my $criticalOutput = '/^\(\d+\) < /';
+my $multilineOutput = '/\(3\) <.*\n.*\n.*$/';
+my $unknownOutput = '/^Usage: /';
+my $unknownArgOutput = '/^Unknown argument: /';
+my $bothRegexOutput = '/^Can not use extended and perl regex/';
+
+my $result;
+my $temp_file = "/tmp/check_log.tmp";
+my $oldlog = "/tmp/oldlog.tmp";
+
+open(FH, '>', $temp_file) or die $!;
+close(FH);
+
+$result = NPTest->testCmd("./check_log");
+cmp_ok( $result->return_code, '==', 3, "Missing parameters" );
+like ( $result->output, $unknownOutput, "Output for unknown correct" );
+
+$result = NPTest->testCmd("./check_log -f");
+cmp_ok( $result->return_code, '==', 3, "Wrong parameters" );
+like ( $result->output, $unknownArgOutput, "Output for unknown correct" );
+
+$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'Simple match' -e -p");
+cmp_ok( $result->return_code, '==', 3, "Both regex parameters" );
+like ( $result->output, $bothRegexOutput, "Output for unknown correct" );
+
+$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'Simple match'");
+cmp_ok( $result->return_code, '==', 0, "First time executing" );
+like ( $result->output, $firstTimeOutput, "Output for first time executing correct" );
+
+open(FH, '>>', $temp_file) or die $!;
+print FH "This is some text, that should not match\n";
+close(FH);
+
+$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'No match'");
+cmp_ok( $result->return_code, '==', 0, "No match" );
+like ( $result->output, $okOutput, "Output for no match correct" );
+
+open(FH, '>>', $temp_file) or die $!;
+print FH "This text should match\n";
+close(FH);
+
+$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'should match'");
+cmp_ok( $result->return_code, '==', 2, "Pattern match" );
+like ( $result->output, $criticalOutput, "Output for match correct" );
+
+open(FH, '>>', $temp_file) or die $!;
+print FH "This text should not match, because it is excluded\n";
+close(FH);
+
+$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'match' --exclude 'because'");
+cmp_ok( $result->return_code, '==', 0, "Exclude a pattern" );
+like ( $result->output, $okOutput, "Output for no match correct" );
+
+open(FH, '>>', $temp_file) or die $!;
+print FH "Trying\nwith\nmultiline\nignore me\n";
+close(FH);
+
+$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'Trying\\|with\\|multiline\\|ignore' --exclude 'me' --all");
+cmp_ok( $result->return_code, '==', 2, "Multiline pattern match with --all" );
+like ( $result->output, $multilineOutput, "Output for multiline match correct" );
+
+$result = NPTest->testCmd("./check_log -F ".$temp_file." -O ".$oldlog." -q 'match' -a");
+cmp_ok( $result->return_code, '==', 0, "Non matching --all" );
+like ( $result->output, $okOutput, "Output for no match correct" );
+
+unlink($oldlog);
+unlink($temp_file);
diff --git a/plugins-scripts/t/check_rpc.t b/plugins-scripts/t/check_rpc.t
new file mode 100644
index 0000000..c58f7bf
--- /dev/null
+++ b/plugins-scripts/t/check_rpc.t
@@ -0,0 +1,21 @@
+#! /usr/bin/perl -w -I ..
+#
+# Remote Procedure Call (RPC) Tests via check_rpc
+#
+#
+
+use strict;
+use Test;
+use NPTest;
+
+use vars qw($tests);
+BEGIN {$tests = 2; plan tests => $tests}
+
+my $successOutput = '/^check_rpc/';
+
+my $t;
+
+$t += checkCmd( "./check_rpc -V", 3, $successOutput );
+
+exit(0) if defined($Test::Harness::VERSION);
+exit($tests - $t);
diff --git a/plugins-scripts/t/check_uptime.t b/plugins-scripts/t/check_uptime.t
new file mode 100644
index 0000000..6e81db3
--- /dev/null
+++ b/plugins-scripts/t/check_uptime.t
@@ -0,0 +1,135 @@
+#!/usr/bin/perl -w -I ..
+#
+# check_uptime tests
+#
+#
+
+use strict;
+use Test::More tests => 42;
+use NPTest;
+
+my $result;
+
+$result = NPTest->testCmd(
+ "./check_uptime"
+ );
+cmp_ok( $result->return_code, '==', 3, "Missing parameters" );
+like ( $result->output, '/^Usage: check_uptime -w/', "Output for missing parameters correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime --help"
+ );
+cmp_ok( $result->return_code, '==', 3, "Help output requested" );
+like ( $result->output, '/ABSOLUTELY NO WARRANTY/', "Output for help correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 5 -c 2"
+ );
+cmp_ok( $result->return_code, '==', 3, "Warning greater than critical" );
+like ( $result->output, '/^Upper Warning .*cannot be greater than Critical/', "Output for warning greater than critical correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -c 1000 -W 100 2>&1"
+ );
+like ( $result->output, '/^Unknown option: W/', "Output with wrong parameter is correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -f -w 1 -c 2"
+ );
+cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" );
+like ( $result->output, '/Running for \d+/', "Output for the f parameter correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -s -w 1 -c 2"
+ );
+cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" );
+like ( $result->output, '/Running since \d+/', "Output for the s parameter correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -d -w 1 -c 2"
+ );
+cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" );
+like ( $result->output, '/CRITICAL: Uptime is \d+ days/', "Output for the d parameter correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 1 -c 2"
+ );
+cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" );
+like ( $result->output, '/^CRITICAL: Uptime is \d+ seconds/', "Output for uptime higher than 2 seconds correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 1 -c 9999w"
+ );
+cmp_ok( $result->return_code, '==', 1, "Uptime lower than 9999 weeks" );
+like ( $result->output, '/^WARNING: Uptime is \d+ seconds/', "Output for uptime lower than 9999 weeks correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 9998w -c 9999w"
+ );
+cmp_ok( $result->return_code, '==', 0, "Uptime lower than 9998 weeks" );
+like ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 9998 weeks correct" );
+like ( $result->output, '/\|uptime=[0-9]+s;6046790400;6047395200;/', "Checking for performance output" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 111222d -c 222333d"
+ );
+cmp_ok( $result->return_code, '==', 0, "Uptime lower than 111222 days" );
+like ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 111222 days correct" );
+like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
+
+# Same as before, hopefully uptime is higher than 2 seconds so no warning
+$result = NPTest->testCmd(
+ "./check_uptime -w 2:111222d -c 1:222333d"
+ );
+cmp_ok( $result->return_code, '==', 0, "Uptime lower than 111222 days, and higher 2 seconds" );
+like ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 111222 days, and higher 2 seconds correct" );
+like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
+
+# Same as before, now the low warning should trigger
+$result = NPTest->testCmd(
+ "./check_uptime -w 111221d:111222d -c 1:222333d"
+ );
+cmp_ok( $result->return_code, '==', 1, "Uptime lower than 111221 days raises warning" );
+like ( $result->output, '/^WARNING: Uptime is \d+ seconds/', "Output for uptime lower than 111221 days correct" );
+like ( $result->output, '/Exceeds lower warn threshold/', "Exceeds text correct" );
+like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
+
+# Same as before, now the low critical should trigger
+$result = NPTest->testCmd(
+ "./check_uptime -w 111221d:111222d -c 111220d:222333d"
+ );
+cmp_ok( $result->return_code, '==', 2, "Uptime lower than 111220 days raises critical" );
+like ( $result->output, '/^CRITICAL: Uptime is \d+ seconds/', "Output for uptime lower than 111220 days correct" );
+like ( $result->output, '/Exceeds lower crit threshold/', "Exceeds text correct" );
+like ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
+
+
+#
+# Range values using ":" without two parts ("a:b") is invalid
+# Strings without two parts are always considered as upper threshold
+#
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 2: -c 1:4"
+ );
+cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" );
+like ( $result->output, '/^Upper warning .* is not numeric/', "Output for wrong parameter format correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 2:3 -c 1:"
+ );
+cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" );
+like ( $result->output, '/^Upper critical .* is not numeric/', "Output for wrong parameter format correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w :3 -c 1:4"
+ );
+cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" );
+like ( $result->output, '/^Upper warning .* is not numeric/', "Output for wrong parameter format correct" );
+
+$result = NPTest->testCmd(
+ "./check_uptime -w 2:3 -c :4"
+ );
+cmp_ok( $result->return_code, '==', 3, "Wrong parameter format raises unknown" );
+like ( $result->output, '/^Upper critical .* is not numeric/', "Output for wrong parameter format correct" );
+
diff --git a/plugins-scripts/t/utils.t b/plugins-scripts/t/utils.t
new file mode 100644
index 0000000..5c23179
--- /dev/null
+++ b/plugins-scripts/t/utils.t
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w -I ..
+#
+# utils.pm tests
+#
+#
+# Run with perl t/utils.t
+
+use warnings;
+use strict;
+use Test::More;
+use NPTest;
+
+use lib ".";
+use lib "..";
+use utils;
+
+my $hostname_checks = {
+ "www.altinity.com" => 1,
+ "www.888.com" => 1,
+ "888.com" => 1,
+ "host-hyphened.com" => 1,
+ "rubbish" => 1,
+ "-start.com" => 0,
+ "nonfqdn-but-endsindot." => 1,
+ "fqdn.and.endsindot." => 1,
+ "lots.of.dots.dot.org" => 1,
+ "endingwithdoubledots.." => 0,
+ "toomany..dots" => 0,
+ ".start.with.dot" => 0,
+ "10.20.30.40" => 1,
+ "10.20.30.40.50" => 0,
+ "10.20.30" => 0,
+ "10.20.30.40." => 1, # This is considered a hostname because of trailing dot. It probably won't exist though...
+ "888." => 1, # This is because it could be a domain
+ "host.888." => 1,
+ "where.did.that.!.come.from." => 0,
+ "no.underscores_.com" => 0,
+ "a.somecompany.com" => 1,
+ "host.a.com" => 1,
+ };
+
+plan tests => ((scalar keys %$hostname_checks) + 4);
+
+foreach my $h (sort keys %$hostname_checks) {
+ is (utils::is_hostname($h), $hostname_checks->{$h}, "$h should return ".$hostname_checks->{$h});
+}
+
+is(utils::is_hostname(), 0, "No parameter errors");
+is(utils::is_hostname(""), 0, "Empty string errors");
+is(utils::is_hostname(0), 0, "0 also errors");
+is(utils::is_hostname(1), 0, "1 also errors");
diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in
new file mode 100644
index 0000000..c84769f
--- /dev/null
+++ b/plugins-scripts/utils.pm.in
@@ -0,0 +1,69 @@
+# Utility drawer for Monitoring Plugins.
+#
+# This will be deprecated soon. Please use Monitoring::Plugin from CPAN
+# for new plugins
+
+package utils;
+
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw($TIMEOUT %ERRORS &print_revision &support &usage);
+
+#use strict;
+#use vars($TIMEOUT %ERRORS);
+sub print_revision ($$);
+sub usage;
+sub support();
+sub is_hostname;
+
+## updated by autoconf
+$PATH_TO_SUDO = "@PATH_TO_SUDO@";
+$PATH_TO_RPCINFO = "@PATH_TO_RPCINFO@" ;
+$PATH_TO_LMSTAT = "@PATH_TO_LMSTAT@" ;
+$PATH_TO_SMBCLIENT = "@PATH_TO_SMBCLIENT@" ;
+$PATH_TO_MAILQ = "@PATH_TO_MAILQ@";
+$PATH_TO_QMAIL_QSTAT = "@PATH_TO_QMAIL_QSTAT@";
+$PATH_TO_SNMPGET = "@PATH_TO_SNMPGET@";
+
+## common variables
+$TIMEOUT = 15;
+%ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+## utility subroutines
+sub print_revision ($$) {
+ my $commandName = shift;
+ my $pluginRevision = shift;
+ print "$commandName v$pluginRevision (@PACKAGE@ @VERSION@)\n";
+ print "@WARRANTY@";
+}
+
+sub support () {
+ my $support='@SUPPORT@';
+ $support =~ s/@/\@/g;
+ $support =~ s/\\n/\n/g;
+ print $support;
+}
+
+sub usage {
+ my $format=shift;
+ printf($format,@_);
+ exit $ERRORS{'UNKNOWN'};
+}
+
+sub is_hostname {
+ my $host1 = shift;
+ return 0 unless defined $host1;
+ if ($host1 =~ m/^[\d\.]+$/ && $host1 !~ /\.$/) {
+ if ($host1 =~ m/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/) {
+ return 1;
+ } else {
+ return 0;
+ }
+ } elsif ($host1 =~ m/^[a-zA-Z0-9][-a-zA-Z0-9]*(\.[a-zA-Z0-9][-a-zA-Z0-9]*)*\.?$/) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+1;
diff --git a/plugins-scripts/utils.sh.in b/plugins-scripts/utils.sh.in
new file mode 100644
index 0000000..031c035
--- /dev/null
+++ b/plugins-scripts/utils.sh.in
@@ -0,0 +1,111 @@
+#! /bin/sh
+
+STATE_OK=0
+STATE_WARNING=1
+STATE_CRITICAL=2
+STATE_UNKNOWN=3
+STATE_DEPENDENT=4
+
+print_revision() {
+ echo "$1 v$2 (@PACKAGE@ @VERSION@)"
+ printf '%b' "@WARRANTY@"
+}
+
+support() {
+ printf '%b' "@SUPPORT@"
+}
+
+#
+# check_range takes a value and a range string, returning successfully if an
+# alert should be raised based on the range. Range values are inclusive.
+# Values may be integers or floats.
+#
+# Example usage:
+#
+# Generating an exit code of 1:
+# check_range 5 2:8
+#
+# Generating an exit code of 0:
+# check_range 1 2:8
+#
+check_range() {
+ local v range yes no err decimal start end cmp match
+ v="$1"
+ range="$2"
+
+ # whether to raise an alert or not
+ yes=0
+ no=1
+ err=2
+
+ # regex to match a decimal number
+ decimal="-?([0-9]+\.?[0-9]*|[0-9]*\.[0-9]+)"
+
+ # compare numbers (including decimals), returning true/false
+ cmp() { awk "BEGIN{ if ($1) exit(0); exit(1)}"; }
+
+ # returns successfully if the string in the first argument matches the
+ # regex in the second
+ match() { echo "$1" | grep -E -q -- "$2"; }
+
+ # make sure value is valid
+ if ! match "$v" "^$decimal$"; then
+ echo "${0##*/}: check_range: invalid value" >&2
+ unset -f cmp match
+ return "$err"
+ fi
+
+ # make sure range is valid
+ if ! match "$range" "^@?(~|$decimal)(:($decimal)?)?$"; then
+ echo "${0##*/}: check_range: invalid range" >&2
+ unset -f cmp match
+ return "$err"
+ fi
+
+ # check for leading @ char, which negates the range
+ if match $range '^@'; then
+ range=${range#@}
+ yes=1
+ no=0
+ fi
+
+ # parse the range string
+ if ! match "$range" ':'; then
+ start=0
+ end="$range"
+ else
+ start="${range%%:*}"
+ end="${range#*:}"
+ fi
+
+ # do the comparison, taking positive ("") and negative infinity ("~")
+ # into account
+ if [ "$start" != "~" ] && [ "$end" != "" ]; then
+ if cmp "$start <= $v" && cmp "$v <= $end"; then
+ unset -f cmp match
+ return "$no"
+ else
+ unset -f cmp match
+ return "$yes"
+ fi
+ elif [ "$start" != "~" ] && [ "$end" = "" ]; then
+ if cmp "$start <= $v"; then
+ unset -f cmp match
+ return "$no"
+ else
+ unset -f cmp match
+ return "$yes"
+ fi
+ elif [ "$start" = "~" ] && [ "$end" != "" ]; then
+ if cmp "$v <= $end"; then
+ unset -f cmp match
+ return "$no"
+ else
+ unset -f cmp match
+ return "$yes"
+ fi
+ else
+ unset -f cmp match
+ return "$no"
+ fi
+}
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
new file mode 100644
index 0000000..49086b7
--- /dev/null
+++ b/plugins/Makefile.am
@@ -0,0 +1,144 @@
+## Process this file with automake to produce Makefile.in
+
+if RELEASE_PRESENT
+NP_VERSION = @NP_RELEASE@
+else
+NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
+ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
+.FORCE-NP-VERSION-FILE:
+-include NP-VERSION-FILE
+endif
+
+AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
+
+VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t
+
+AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl \
+ @LDAPINCLUDE@ @PGINCLUDE@ @SSLINCLUDE@
+
+localedir = $(datadir)/locale
+# gettext docs say to use AM_CPPFLAGS, but per module_CPPFLAGS override this
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+# gettext docs say to use LDADD, but per module_LDADD override
+LIBS = @LTLIBINTL@ @LIBS@
+MATHLIBS = @MATHLIBS@
+
+# This is not portable. Run ". tools/devmode" to get development compile flags
+#AM_CFLAGS = -Wall
+
+libexec_PROGRAMS = check_apt check_cluster check_disk check_dummy check_http check_load \
+ check_mrtg check_mrtgtraf check_ntp check_ntp_peer check_nwstat check_overcr check_ping \
+ check_real check_smtp check_ssh check_tcp check_time check_ntp_time \
+ check_ups check_users negate \
+ urlize @EXTRAS@
+
+check_tcp_programs = check_ftp check_imap check_nntp check_pop \
+ check_udp check_clamd @check_tcp_ssl@
+
+EXTRA_PROGRAMS = check_mysql check_radius check_pgsql check_snmp check_hpjd \
+ check_swap check_fping check_ldap check_game check_dig \
+ check_nagios check_by_ssh check_dns check_nt check_ide_smart \
+ check_procs check_mysql_query check_apt check_dbi check_curl
+
+SUBDIRS = picohttpparser
+
+EXTRA_DIST = t tests
+
+PLUGINHDRS = common.h
+
+noinst_LIBRARIES = libnpcommon.a
+
+libnpcommon_a_SOURCES = utils.c netutils.c sslutils.c runcmd.c \
+ popen.c utils.h netutils.h popen.h common.h runcmd.c runcmd.h
+
+BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO)
+NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS)
+NETLIBS = $(NETOBJS) $(SOCKETLIBS)
+SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) $(LIB_CRYPTO)
+
+TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
+
+TESTS = @PLUGIN_TEST@
+
+test:
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+test-debug:
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+##############################################################################
+# the actual targets
+
+check_apt_LDADD = $(BASEOBJS)
+check_cluster_LDADD = $(BASEOBJS)
+check_curl_CFLAGS = $(AM_CFLAGS) $(LIBCURLCFLAGS) $(URIPARSERCFLAGS) $(LIBCURLINCLUDE) $(URIPARSERINCLUDE) -Ipicohttpparser
+check_curl_CPPFLAGS = $(AM_CPPFLAGS) $(LIBCURLCFLAGS) $(URIPARSERCFLAGS) $(LIBCURLINCLUDE) $(URIPARSERINCLUDE) -Ipicohttpparser
+check_curl_LDADD = $(NETLIBS) $(LIBCURLLIBS) $(SSLOBJS) $(URIPARSERLIBS) picohttpparser/libpicohttpparser.a
+check_dbi_LDADD = $(NETLIBS) $(DBILIBS)
+check_dig_LDADD = $(NETLIBS)
+check_disk_LDADD = $(BASEOBJS)
+check_dns_LDADD = $(NETLIBS)
+check_dummy_LDADD = $(BASEOBJS)
+check_fping_LDADD = $(NETLIBS)
+check_game_LDADD = $(BASEOBJS)
+check_http_LDADD = $(SSLOBJS)
+check_hpjd_LDADD = $(NETLIBS)
+check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS)
+check_load_LDADD = $(BASEOBJS)
+check_mrtg_LDADD = $(BASEOBJS)
+check_mrtgtraf_LDADD = $(BASEOBJS)
+check_mysql_CFLAGS = $(AM_CFLAGS) $(MYSQLCFLAGS)
+check_mysql_CPPFLAGS = $(AM_CPPFLAGS) $(MYSQLINCLUDE)
+check_mysql_LDADD = $(NETLIBS) $(MYSQLLIBS)
+check_mysql_query_CFLAGS = $(AM_CFLAGS) $(MYSQLCFLAGS)
+check_mysql_query_CPPFLAGS = $(AM_CPPFLAGS) $(MYSQLINCLUDE)
+check_mysql_query_LDADD = $(NETLIBS) $(MYSQLLIBS)
+check_nagios_LDADD = $(BASEOBJS)
+check_nt_LDADD = $(NETLIBS)
+check_ntp_LDADD = $(NETLIBS) $(MATHLIBS)
+check_ntp_peer_LDADD = $(NETLIBS) $(MATHLIBS)
+check_nwstat_LDADD = $(NETLIBS)
+check_overcr_LDADD = $(NETLIBS)
+check_pgsql_LDADD = $(NETLIBS) $(PGLIBS)
+check_ping_LDADD = $(NETLIBS)
+check_procs_LDADD = $(BASEOBJS)
+check_radius_LDADD = $(NETLIBS) $(RADIUSLIBS)
+check_real_LDADD = $(NETLIBS)
+check_snmp_LDADD = $(BASEOBJS)
+check_smtp_LDADD = $(SSLOBJS)
+check_ssh_LDADD = $(NETLIBS)
+check_swap_LDADD = $(MATHLIBS) $(BASEOBJS)
+check_tcp_LDADD = $(SSLOBJS)
+check_time_LDADD = $(NETLIBS)
+check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS)
+check_ups_LDADD = $(NETLIBS)
+check_users_LDADD = $(BASEOBJS) $(WTSAPI32LIBS) $(SYSTEMDLIBS)
+check_by_ssh_LDADD = $(NETLIBS)
+check_ide_smart_LDADD = $(BASEOBJS)
+negate_LDADD = $(BASEOBJS)
+urlize_LDADD = $(BASEOBJS)
+
+if !HAVE_UTMPX
+check_users_LDADD += popen.o
+endif
+
+##############################################################################
+# secondary dependencies
+
+all-local: $(check_tcp_programs)
+
+$(check_tcp_programs): check_tcp
+ rm -f $@
+ ln -s check_tcp $@
+
+install-exec-hook:
+ cd $(DESTDIR)$(libexecdir) && \
+ for i in $(check_tcp_programs) ; do rm -f $$i; ln -s check_tcp $$i ; done ;\
+ if [ -x check_ldap ] ; then rm -f check_ldaps ; ln -s check_ldap check_ldaps ; fi
+
+clean-local:
+ rm -f $(check_tcp_programs)
+ rm -f NP-VERSION-FILE
+
+uninstall-local:
+ cd $(DESTDIR)$(libexecdir) && rm -f $(check_tcp_programs)
diff --git a/plugins/Makefile.in b/plugins/Makefile.in
new file mode 100644
index 0000000..dc5f6cf
--- /dev/null
+++ b/plugins/Makefile.in
@@ -0,0 +1,3232 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+libexec_PROGRAMS = check_apt$(EXEEXT) check_cluster$(EXEEXT) \
+ check_disk$(EXEEXT) check_dummy$(EXEEXT) check_http$(EXEEXT) \
+ check_load$(EXEEXT) check_mrtg$(EXEEXT) \
+ check_mrtgtraf$(EXEEXT) check_ntp$(EXEEXT) \
+ check_ntp_peer$(EXEEXT) check_nwstat$(EXEEXT) \
+ check_overcr$(EXEEXT) check_ping$(EXEEXT) check_real$(EXEEXT) \
+ check_smtp$(EXEEXT) check_ssh$(EXEEXT) check_tcp$(EXEEXT) \
+ check_time$(EXEEXT) check_ntp_time$(EXEEXT) check_ups$(EXEEXT) \
+ check_users$(EXEEXT) negate$(EXEEXT) urlize$(EXEEXT) @EXTRAS@
+EXTRA_PROGRAMS = check_mysql$(EXEEXT) check_radius$(EXEEXT) \
+ check_pgsql$(EXEEXT) check_snmp$(EXEEXT) check_hpjd$(EXEEXT) \
+ check_swap$(EXEEXT) check_fping$(EXEEXT) check_ldap$(EXEEXT) \
+ check_game$(EXEEXT) check_dig$(EXEEXT) check_nagios$(EXEEXT) \
+ check_by_ssh$(EXEEXT) check_dns$(EXEEXT) check_nt$(EXEEXT) \
+ check_ide_smart$(EXEEXT) check_procs$(EXEEXT) \
+ check_mysql_query$(EXEEXT) check_apt$(EXEEXT) \
+ check_dbi$(EXEEXT) check_curl$(EXEEXT)
+@HAVE_UTMPX_FALSE@am__append_1 = popen.o
+subdir = plugins
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(libexecdir)"
+PROGRAMS = $(libexec_PROGRAMS)
+LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libnpcommon_a_AR = $(AR) $(ARFLAGS)
+libnpcommon_a_LIBADD =
+am_libnpcommon_a_OBJECTS = utils.$(OBJEXT) netutils.$(OBJEXT) \
+ sslutils.$(OBJEXT) runcmd.$(OBJEXT) popen.$(OBJEXT) \
+ runcmd.$(OBJEXT)
+libnpcommon_a_OBJECTS = $(am_libnpcommon_a_OBJECTS)
+check_apt_SOURCES = check_apt.c
+check_apt_OBJECTS = check_apt.$(OBJEXT)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = libnpcommon.a ../lib/libmonitoringplug.a \
+ ../gl/libgnu.a $(am__DEPENDENCIES_1)
+check_apt_DEPENDENCIES = $(am__DEPENDENCIES_2)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+check_by_ssh_SOURCES = check_by_ssh.c
+check_by_ssh_OBJECTS = check_by_ssh.$(OBJEXT)
+am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2)
+am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
+check_by_ssh_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_cluster_SOURCES = check_cluster.c
+check_cluster_OBJECTS = check_cluster.$(OBJEXT)
+check_cluster_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_curl_SOURCES = check_curl.c
+check_curl_OBJECTS = check_curl-check_curl.$(OBJEXT)
+am__DEPENDENCIES_5 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_4) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+check_curl_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_1) \
+ picohttpparser/libpicohttpparser.a
+check_curl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(check_curl_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+check_dbi_SOURCES = check_dbi.c
+check_dbi_OBJECTS = check_dbi.$(OBJEXT)
+check_dbi_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+check_dig_SOURCES = check_dig.c
+check_dig_OBJECTS = check_dig.$(OBJEXT)
+check_dig_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_disk_SOURCES = check_disk.c
+check_disk_OBJECTS = check_disk.$(OBJEXT)
+check_disk_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_dns_SOURCES = check_dns.c
+check_dns_OBJECTS = check_dns.$(OBJEXT)
+check_dns_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_dummy_SOURCES = check_dummy.c
+check_dummy_OBJECTS = check_dummy.$(OBJEXT)
+check_dummy_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_fping_SOURCES = check_fping.c
+check_fping_OBJECTS = check_fping.$(OBJEXT)
+check_fping_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_game_SOURCES = check_game.c
+check_game_OBJECTS = check_game.$(OBJEXT)
+check_game_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_hpjd_SOURCES = check_hpjd.c
+check_hpjd_OBJECTS = check_hpjd.$(OBJEXT)
+check_hpjd_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_http_SOURCES = check_http.c
+check_http_OBJECTS = check_http.$(OBJEXT)
+check_http_DEPENDENCIES = $(am__DEPENDENCIES_5)
+check_ide_smart_SOURCES = check_ide_smart.c
+check_ide_smart_OBJECTS = check_ide_smart.$(OBJEXT)
+check_ide_smart_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_ldap_SOURCES = check_ldap.c
+check_ldap_OBJECTS = check_ldap.$(OBJEXT)
+check_ldap_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+check_load_SOURCES = check_load.c
+check_load_OBJECTS = check_load.$(OBJEXT)
+check_load_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_mrtg_SOURCES = check_mrtg.c
+check_mrtg_OBJECTS = check_mrtg.$(OBJEXT)
+check_mrtg_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_mrtgtraf_SOURCES = check_mrtgtraf.c
+check_mrtgtraf_OBJECTS = check_mrtgtraf.$(OBJEXT)
+check_mrtgtraf_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_mysql_SOURCES = check_mysql.c
+check_mysql_OBJECTS = check_mysql-check_mysql.$(OBJEXT)
+check_mysql_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+check_mysql_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(check_mysql_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+check_mysql_query_SOURCES = check_mysql_query.c
+check_mysql_query_OBJECTS = \
+ check_mysql_query-check_mysql_query.$(OBJEXT)
+check_mysql_query_DEPENDENCIES = $(am__DEPENDENCIES_4) \
+ $(am__DEPENDENCIES_1)
+check_mysql_query_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(check_mysql_query_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
+check_nagios_SOURCES = check_nagios.c
+check_nagios_OBJECTS = check_nagios.$(OBJEXT)
+check_nagios_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_nt_SOURCES = check_nt.c
+check_nt_OBJECTS = check_nt.$(OBJEXT)
+check_nt_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_ntp_SOURCES = check_ntp.c
+check_ntp_OBJECTS = check_ntp.$(OBJEXT)
+check_ntp_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+check_ntp_peer_SOURCES = check_ntp_peer.c
+check_ntp_peer_OBJECTS = check_ntp_peer.$(OBJEXT)
+check_ntp_peer_DEPENDENCIES = $(am__DEPENDENCIES_4) \
+ $(am__DEPENDENCIES_1)
+check_ntp_time_SOURCES = check_ntp_time.c
+check_ntp_time_OBJECTS = check_ntp_time.$(OBJEXT)
+check_ntp_time_DEPENDENCIES = $(am__DEPENDENCIES_4) \
+ $(am__DEPENDENCIES_1)
+check_nwstat_SOURCES = check_nwstat.c
+check_nwstat_OBJECTS = check_nwstat.$(OBJEXT)
+check_nwstat_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_overcr_SOURCES = check_overcr.c
+check_overcr_OBJECTS = check_overcr.$(OBJEXT)
+check_overcr_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_pgsql_SOURCES = check_pgsql.c
+check_pgsql_OBJECTS = check_pgsql.$(OBJEXT)
+check_pgsql_DEPENDENCIES = $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
+check_ping_SOURCES = check_ping.c
+check_ping_OBJECTS = check_ping.$(OBJEXT)
+check_ping_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_procs_SOURCES = check_procs.c
+check_procs_OBJECTS = check_procs.$(OBJEXT)
+check_procs_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_radius_SOURCES = check_radius.c
+check_radius_OBJECTS = check_radius.$(OBJEXT)
+check_radius_DEPENDENCIES = $(am__DEPENDENCIES_4) \
+ $(am__DEPENDENCIES_1)
+check_real_SOURCES = check_real.c
+check_real_OBJECTS = check_real.$(OBJEXT)
+check_real_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_smtp_SOURCES = check_smtp.c
+check_smtp_OBJECTS = check_smtp.$(OBJEXT)
+check_smtp_DEPENDENCIES = $(am__DEPENDENCIES_5)
+check_snmp_SOURCES = check_snmp.c
+check_snmp_OBJECTS = check_snmp.$(OBJEXT)
+check_snmp_DEPENDENCIES = $(am__DEPENDENCIES_2)
+check_ssh_SOURCES = check_ssh.c
+check_ssh_OBJECTS = check_ssh.$(OBJEXT)
+check_ssh_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_swap_SOURCES = check_swap.c
+check_swap_OBJECTS = check_swap.$(OBJEXT)
+check_swap_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+check_tcp_SOURCES = check_tcp.c
+check_tcp_OBJECTS = check_tcp.$(OBJEXT)
+check_tcp_DEPENDENCIES = $(am__DEPENDENCIES_5)
+check_time_SOURCES = check_time.c
+check_time_OBJECTS = check_time.$(OBJEXT)
+check_time_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_ups_SOURCES = check_ups.c
+check_ups_OBJECTS = check_ups.$(OBJEXT)
+check_ups_DEPENDENCIES = $(am__DEPENDENCIES_4)
+check_users_SOURCES = check_users.c
+check_users_OBJECTS = check_users.$(OBJEXT)
+check_users_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__append_1)
+negate_SOURCES = negate.c
+negate_OBJECTS = negate.$(OBJEXT)
+negate_DEPENDENCIES = $(am__DEPENDENCIES_2)
+urlize_SOURCES = urlize.c
+urlize_OBJECTS = urlize.$(OBJEXT)
+urlize_DEPENDENCIES = $(am__DEPENDENCIES_2)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/check_apt.Po \
+ ./$(DEPDIR)/check_by_ssh.Po ./$(DEPDIR)/check_cluster.Po \
+ ./$(DEPDIR)/check_curl-check_curl.Po ./$(DEPDIR)/check_dbi.Po \
+ ./$(DEPDIR)/check_dig.Po ./$(DEPDIR)/check_disk.Po \
+ ./$(DEPDIR)/check_dns.Po ./$(DEPDIR)/check_dummy.Po \
+ ./$(DEPDIR)/check_fping.Po ./$(DEPDIR)/check_game.Po \
+ ./$(DEPDIR)/check_hpjd.Po ./$(DEPDIR)/check_http.Po \
+ ./$(DEPDIR)/check_ide_smart.Po ./$(DEPDIR)/check_ldap.Po \
+ ./$(DEPDIR)/check_load.Po ./$(DEPDIR)/check_mrtg.Po \
+ ./$(DEPDIR)/check_mrtgtraf.Po \
+ ./$(DEPDIR)/check_mysql-check_mysql.Po \
+ ./$(DEPDIR)/check_mysql_query-check_mysql_query.Po \
+ ./$(DEPDIR)/check_nagios.Po ./$(DEPDIR)/check_nt.Po \
+ ./$(DEPDIR)/check_ntp.Po ./$(DEPDIR)/check_ntp_peer.Po \
+ ./$(DEPDIR)/check_ntp_time.Po ./$(DEPDIR)/check_nwstat.Po \
+ ./$(DEPDIR)/check_overcr.Po ./$(DEPDIR)/check_pgsql.Po \
+ ./$(DEPDIR)/check_ping.Po ./$(DEPDIR)/check_procs.Po \
+ ./$(DEPDIR)/check_radius.Po ./$(DEPDIR)/check_real.Po \
+ ./$(DEPDIR)/check_smtp.Po ./$(DEPDIR)/check_snmp.Po \
+ ./$(DEPDIR)/check_ssh.Po ./$(DEPDIR)/check_swap.Po \
+ ./$(DEPDIR)/check_tcp.Po ./$(DEPDIR)/check_time.Po \
+ ./$(DEPDIR)/check_ups.Po ./$(DEPDIR)/check_users.Po \
+ ./$(DEPDIR)/negate.Po ./$(DEPDIR)/netutils.Po \
+ ./$(DEPDIR)/popen.Po ./$(DEPDIR)/runcmd.Po \
+ ./$(DEPDIR)/sslutils.Po ./$(DEPDIR)/urlize.Po \
+ ./$(DEPDIR)/utils.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libnpcommon_a_SOURCES) check_apt.c check_by_ssh.c \
+ check_cluster.c check_curl.c check_dbi.c check_dig.c \
+ check_disk.c check_dns.c check_dummy.c check_fping.c \
+ check_game.c check_hpjd.c check_http.c check_ide_smart.c \
+ check_ldap.c check_load.c check_mrtg.c check_mrtgtraf.c \
+ check_mysql.c check_mysql_query.c check_nagios.c check_nt.c \
+ check_ntp.c check_ntp_peer.c check_ntp_time.c check_nwstat.c \
+ check_overcr.c check_pgsql.c check_ping.c check_procs.c \
+ check_radius.c check_real.c check_smtp.c check_snmp.c \
+ check_ssh.c check_swap.c check_tcp.c check_time.c check_ups.c \
+ check_users.c negate.c urlize.c
+DIST_SOURCES = $(libnpcommon_a_SOURCES) check_apt.c check_by_ssh.c \
+ check_cluster.c check_curl.c check_dbi.c check_dig.c \
+ check_disk.c check_dns.c check_dummy.c check_fping.c \
+ check_game.c check_hpjd.c check_http.c check_ide_smart.c \
+ check_ldap.c check_load.c check_mrtg.c check_mrtgtraf.c \
+ check_mysql.c check_mysql_query.c check_nagios.c check_nt.c \
+ check_ntp.c check_ntp_peer.c check_ntp_time.c check_nwstat.c \
+ check_overcr.c check_pgsql.c check_ping.c check_procs.c \
+ check_radius.c check_real.c check_smtp.c check_snmp.c \
+ check_ssh.c check_swap.c check_tcp.c check_time.c check_ups.c \
+ check_users.c negate.c urlize.c
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ check recheck distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/mkinstalldirs \
+ $(top_srcdir)/build-aux/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+# gettext docs say to use AM_CPPFLAGS, but per module_CPPFLAGS override this
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+# gettext docs say to use LDADD, but per module_LDADD override
+LIBS = @LTLIBINTL@ @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = $(datadir)/locale
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+@RELEASE_PRESENT_TRUE@NP_VERSION = @NP_RELEASE@
+AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
+AM_CPPFLAGS = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl \
+ @LDAPINCLUDE@ @PGINCLUDE@ @SSLINCLUDE@
+
+check_tcp_programs = check_ftp check_imap check_nntp check_pop \
+ check_udp check_clamd @check_tcp_ssl@
+
+SUBDIRS = picohttpparser
+EXTRA_DIST = t tests
+PLUGINHDRS = common.h
+noinst_LIBRARIES = libnpcommon.a
+libnpcommon_a_SOURCES = utils.c netutils.c sslutils.c runcmd.c \
+ popen.c utils.h netutils.h popen.h common.h runcmd.c runcmd.h
+
+BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO)
+NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS)
+NETLIBS = $(NETOBJS) $(SOCKETLIBS)
+SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) $(LIB_CRYPTO)
+TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
+TESTS = @PLUGIN_TEST@
+
+##############################################################################
+# the actual targets
+check_apt_LDADD = $(BASEOBJS)
+check_cluster_LDADD = $(BASEOBJS)
+check_curl_CFLAGS = $(AM_CFLAGS) $(LIBCURLCFLAGS) $(URIPARSERCFLAGS) $(LIBCURLINCLUDE) $(URIPARSERINCLUDE) -Ipicohttpparser
+check_curl_CPPFLAGS = $(AM_CPPFLAGS) $(LIBCURLCFLAGS) $(URIPARSERCFLAGS) $(LIBCURLINCLUDE) $(URIPARSERINCLUDE) -Ipicohttpparser
+check_curl_LDADD = $(NETLIBS) $(LIBCURLLIBS) $(SSLOBJS) $(URIPARSERLIBS) picohttpparser/libpicohttpparser.a
+check_dbi_LDADD = $(NETLIBS) $(DBILIBS)
+check_dig_LDADD = $(NETLIBS)
+check_disk_LDADD = $(BASEOBJS)
+check_dns_LDADD = $(NETLIBS)
+check_dummy_LDADD = $(BASEOBJS)
+check_fping_LDADD = $(NETLIBS)
+check_game_LDADD = $(BASEOBJS)
+check_http_LDADD = $(SSLOBJS)
+check_hpjd_LDADD = $(NETLIBS)
+check_ldap_LDADD = $(NETLIBS) $(LDAPLIBS)
+check_load_LDADD = $(BASEOBJS)
+check_mrtg_LDADD = $(BASEOBJS)
+check_mrtgtraf_LDADD = $(BASEOBJS)
+check_mysql_CFLAGS = $(AM_CFLAGS) $(MYSQLCFLAGS)
+check_mysql_CPPFLAGS = $(AM_CPPFLAGS) $(MYSQLINCLUDE)
+check_mysql_LDADD = $(NETLIBS) $(MYSQLLIBS)
+check_mysql_query_CFLAGS = $(AM_CFLAGS) $(MYSQLCFLAGS)
+check_mysql_query_CPPFLAGS = $(AM_CPPFLAGS) $(MYSQLINCLUDE)
+check_mysql_query_LDADD = $(NETLIBS) $(MYSQLLIBS)
+check_nagios_LDADD = $(BASEOBJS)
+check_nt_LDADD = $(NETLIBS)
+check_ntp_LDADD = $(NETLIBS) $(MATHLIBS)
+check_ntp_peer_LDADD = $(NETLIBS) $(MATHLIBS)
+check_nwstat_LDADD = $(NETLIBS)
+check_overcr_LDADD = $(NETLIBS)
+check_pgsql_LDADD = $(NETLIBS) $(PGLIBS)
+check_ping_LDADD = $(NETLIBS)
+check_procs_LDADD = $(BASEOBJS)
+check_radius_LDADD = $(NETLIBS) $(RADIUSLIBS)
+check_real_LDADD = $(NETLIBS)
+check_snmp_LDADD = $(BASEOBJS)
+check_smtp_LDADD = $(SSLOBJS)
+check_ssh_LDADD = $(NETLIBS)
+check_swap_LDADD = $(MATHLIBS) $(BASEOBJS)
+check_tcp_LDADD = $(SSLOBJS)
+check_time_LDADD = $(NETLIBS)
+check_ntp_time_LDADD = $(NETLIBS) $(MATHLIBS)
+check_ups_LDADD = $(NETLIBS)
+check_users_LDADD = $(BASEOBJS) $(WTSAPI32LIBS) $(SYSTEMDLIBS) \
+ $(am__append_1)
+check_by_ssh_LDADD = $(NETLIBS)
+check_ide_smart_LDADD = $(BASEOBJS)
+negate_LDADD = $(BASEOBJS)
+urlize_LDADD = $(BASEOBJS)
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu plugins/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+libnpcommon.a: $(libnpcommon_a_OBJECTS) $(libnpcommon_a_DEPENDENCIES) $(EXTRA_libnpcommon_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libnpcommon.a
+ $(AM_V_AR)$(libnpcommon_a_AR) libnpcommon.a $(libnpcommon_a_OBJECTS) $(libnpcommon_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libnpcommon.a
+
+check_apt$(EXEEXT): $(check_apt_OBJECTS) $(check_apt_DEPENDENCIES) $(EXTRA_check_apt_DEPENDENCIES)
+ @rm -f check_apt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_apt_OBJECTS) $(check_apt_LDADD) $(LIBS)
+
+check_by_ssh$(EXEEXT): $(check_by_ssh_OBJECTS) $(check_by_ssh_DEPENDENCIES) $(EXTRA_check_by_ssh_DEPENDENCIES)
+ @rm -f check_by_ssh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_by_ssh_OBJECTS) $(check_by_ssh_LDADD) $(LIBS)
+
+check_cluster$(EXEEXT): $(check_cluster_OBJECTS) $(check_cluster_DEPENDENCIES) $(EXTRA_check_cluster_DEPENDENCIES)
+ @rm -f check_cluster$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_cluster_OBJECTS) $(check_cluster_LDADD) $(LIBS)
+
+check_curl$(EXEEXT): $(check_curl_OBJECTS) $(check_curl_DEPENDENCIES) $(EXTRA_check_curl_DEPENDENCIES)
+ @rm -f check_curl$(EXEEXT)
+ $(AM_V_CCLD)$(check_curl_LINK) $(check_curl_OBJECTS) $(check_curl_LDADD) $(LIBS)
+
+check_dbi$(EXEEXT): $(check_dbi_OBJECTS) $(check_dbi_DEPENDENCIES) $(EXTRA_check_dbi_DEPENDENCIES)
+ @rm -f check_dbi$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_dbi_OBJECTS) $(check_dbi_LDADD) $(LIBS)
+
+check_dig$(EXEEXT): $(check_dig_OBJECTS) $(check_dig_DEPENDENCIES) $(EXTRA_check_dig_DEPENDENCIES)
+ @rm -f check_dig$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_dig_OBJECTS) $(check_dig_LDADD) $(LIBS)
+
+check_disk$(EXEEXT): $(check_disk_OBJECTS) $(check_disk_DEPENDENCIES) $(EXTRA_check_disk_DEPENDENCIES)
+ @rm -f check_disk$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_disk_OBJECTS) $(check_disk_LDADD) $(LIBS)
+
+check_dns$(EXEEXT): $(check_dns_OBJECTS) $(check_dns_DEPENDENCIES) $(EXTRA_check_dns_DEPENDENCIES)
+ @rm -f check_dns$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_dns_OBJECTS) $(check_dns_LDADD) $(LIBS)
+
+check_dummy$(EXEEXT): $(check_dummy_OBJECTS) $(check_dummy_DEPENDENCIES) $(EXTRA_check_dummy_DEPENDENCIES)
+ @rm -f check_dummy$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_dummy_OBJECTS) $(check_dummy_LDADD) $(LIBS)
+
+check_fping$(EXEEXT): $(check_fping_OBJECTS) $(check_fping_DEPENDENCIES) $(EXTRA_check_fping_DEPENDENCIES)
+ @rm -f check_fping$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_fping_OBJECTS) $(check_fping_LDADD) $(LIBS)
+
+check_game$(EXEEXT): $(check_game_OBJECTS) $(check_game_DEPENDENCIES) $(EXTRA_check_game_DEPENDENCIES)
+ @rm -f check_game$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_game_OBJECTS) $(check_game_LDADD) $(LIBS)
+
+check_hpjd$(EXEEXT): $(check_hpjd_OBJECTS) $(check_hpjd_DEPENDENCIES) $(EXTRA_check_hpjd_DEPENDENCIES)
+ @rm -f check_hpjd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_hpjd_OBJECTS) $(check_hpjd_LDADD) $(LIBS)
+
+check_http$(EXEEXT): $(check_http_OBJECTS) $(check_http_DEPENDENCIES) $(EXTRA_check_http_DEPENDENCIES)
+ @rm -f check_http$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_http_OBJECTS) $(check_http_LDADD) $(LIBS)
+
+check_ide_smart$(EXEEXT): $(check_ide_smart_OBJECTS) $(check_ide_smart_DEPENDENCIES) $(EXTRA_check_ide_smart_DEPENDENCIES)
+ @rm -f check_ide_smart$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ide_smart_OBJECTS) $(check_ide_smart_LDADD) $(LIBS)
+
+check_ldap$(EXEEXT): $(check_ldap_OBJECTS) $(check_ldap_DEPENDENCIES) $(EXTRA_check_ldap_DEPENDENCIES)
+ @rm -f check_ldap$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ldap_OBJECTS) $(check_ldap_LDADD) $(LIBS)
+
+check_load$(EXEEXT): $(check_load_OBJECTS) $(check_load_DEPENDENCIES) $(EXTRA_check_load_DEPENDENCIES)
+ @rm -f check_load$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_load_OBJECTS) $(check_load_LDADD) $(LIBS)
+
+check_mrtg$(EXEEXT): $(check_mrtg_OBJECTS) $(check_mrtg_DEPENDENCIES) $(EXTRA_check_mrtg_DEPENDENCIES)
+ @rm -f check_mrtg$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_mrtg_OBJECTS) $(check_mrtg_LDADD) $(LIBS)
+
+check_mrtgtraf$(EXEEXT): $(check_mrtgtraf_OBJECTS) $(check_mrtgtraf_DEPENDENCIES) $(EXTRA_check_mrtgtraf_DEPENDENCIES)
+ @rm -f check_mrtgtraf$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_mrtgtraf_OBJECTS) $(check_mrtgtraf_LDADD) $(LIBS)
+
+check_mysql$(EXEEXT): $(check_mysql_OBJECTS) $(check_mysql_DEPENDENCIES) $(EXTRA_check_mysql_DEPENDENCIES)
+ @rm -f check_mysql$(EXEEXT)
+ $(AM_V_CCLD)$(check_mysql_LINK) $(check_mysql_OBJECTS) $(check_mysql_LDADD) $(LIBS)
+
+check_mysql_query$(EXEEXT): $(check_mysql_query_OBJECTS) $(check_mysql_query_DEPENDENCIES) $(EXTRA_check_mysql_query_DEPENDENCIES)
+ @rm -f check_mysql_query$(EXEEXT)
+ $(AM_V_CCLD)$(check_mysql_query_LINK) $(check_mysql_query_OBJECTS) $(check_mysql_query_LDADD) $(LIBS)
+
+check_nagios$(EXEEXT): $(check_nagios_OBJECTS) $(check_nagios_DEPENDENCIES) $(EXTRA_check_nagios_DEPENDENCIES)
+ @rm -f check_nagios$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_nagios_OBJECTS) $(check_nagios_LDADD) $(LIBS)
+
+check_nt$(EXEEXT): $(check_nt_OBJECTS) $(check_nt_DEPENDENCIES) $(EXTRA_check_nt_DEPENDENCIES)
+ @rm -f check_nt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_nt_OBJECTS) $(check_nt_LDADD) $(LIBS)
+
+check_ntp$(EXEEXT): $(check_ntp_OBJECTS) $(check_ntp_DEPENDENCIES) $(EXTRA_check_ntp_DEPENDENCIES)
+ @rm -f check_ntp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ntp_OBJECTS) $(check_ntp_LDADD) $(LIBS)
+
+check_ntp_peer$(EXEEXT): $(check_ntp_peer_OBJECTS) $(check_ntp_peer_DEPENDENCIES) $(EXTRA_check_ntp_peer_DEPENDENCIES)
+ @rm -f check_ntp_peer$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ntp_peer_OBJECTS) $(check_ntp_peer_LDADD) $(LIBS)
+
+check_ntp_time$(EXEEXT): $(check_ntp_time_OBJECTS) $(check_ntp_time_DEPENDENCIES) $(EXTRA_check_ntp_time_DEPENDENCIES)
+ @rm -f check_ntp_time$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ntp_time_OBJECTS) $(check_ntp_time_LDADD) $(LIBS)
+
+check_nwstat$(EXEEXT): $(check_nwstat_OBJECTS) $(check_nwstat_DEPENDENCIES) $(EXTRA_check_nwstat_DEPENDENCIES)
+ @rm -f check_nwstat$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_nwstat_OBJECTS) $(check_nwstat_LDADD) $(LIBS)
+
+check_overcr$(EXEEXT): $(check_overcr_OBJECTS) $(check_overcr_DEPENDENCIES) $(EXTRA_check_overcr_DEPENDENCIES)
+ @rm -f check_overcr$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_overcr_OBJECTS) $(check_overcr_LDADD) $(LIBS)
+
+check_pgsql$(EXEEXT): $(check_pgsql_OBJECTS) $(check_pgsql_DEPENDENCIES) $(EXTRA_check_pgsql_DEPENDENCIES)
+ @rm -f check_pgsql$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_pgsql_OBJECTS) $(check_pgsql_LDADD) $(LIBS)
+
+check_ping$(EXEEXT): $(check_ping_OBJECTS) $(check_ping_DEPENDENCIES) $(EXTRA_check_ping_DEPENDENCIES)
+ @rm -f check_ping$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ping_OBJECTS) $(check_ping_LDADD) $(LIBS)
+
+check_procs$(EXEEXT): $(check_procs_OBJECTS) $(check_procs_DEPENDENCIES) $(EXTRA_check_procs_DEPENDENCIES)
+ @rm -f check_procs$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_procs_OBJECTS) $(check_procs_LDADD) $(LIBS)
+
+check_radius$(EXEEXT): $(check_radius_OBJECTS) $(check_radius_DEPENDENCIES) $(EXTRA_check_radius_DEPENDENCIES)
+ @rm -f check_radius$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_radius_OBJECTS) $(check_radius_LDADD) $(LIBS)
+
+check_real$(EXEEXT): $(check_real_OBJECTS) $(check_real_DEPENDENCIES) $(EXTRA_check_real_DEPENDENCIES)
+ @rm -f check_real$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_real_OBJECTS) $(check_real_LDADD) $(LIBS)
+
+check_smtp$(EXEEXT): $(check_smtp_OBJECTS) $(check_smtp_DEPENDENCIES) $(EXTRA_check_smtp_DEPENDENCIES)
+ @rm -f check_smtp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_smtp_OBJECTS) $(check_smtp_LDADD) $(LIBS)
+
+check_snmp$(EXEEXT): $(check_snmp_OBJECTS) $(check_snmp_DEPENDENCIES) $(EXTRA_check_snmp_DEPENDENCIES)
+ @rm -f check_snmp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_snmp_OBJECTS) $(check_snmp_LDADD) $(LIBS)
+
+check_ssh$(EXEEXT): $(check_ssh_OBJECTS) $(check_ssh_DEPENDENCIES) $(EXTRA_check_ssh_DEPENDENCIES)
+ @rm -f check_ssh$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ssh_OBJECTS) $(check_ssh_LDADD) $(LIBS)
+
+check_swap$(EXEEXT): $(check_swap_OBJECTS) $(check_swap_DEPENDENCIES) $(EXTRA_check_swap_DEPENDENCIES)
+ @rm -f check_swap$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_swap_OBJECTS) $(check_swap_LDADD) $(LIBS)
+
+check_tcp$(EXEEXT): $(check_tcp_OBJECTS) $(check_tcp_DEPENDENCIES) $(EXTRA_check_tcp_DEPENDENCIES)
+ @rm -f check_tcp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_tcp_OBJECTS) $(check_tcp_LDADD) $(LIBS)
+
+check_time$(EXEEXT): $(check_time_OBJECTS) $(check_time_DEPENDENCIES) $(EXTRA_check_time_DEPENDENCIES)
+ @rm -f check_time$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_time_OBJECTS) $(check_time_LDADD) $(LIBS)
+
+check_ups$(EXEEXT): $(check_ups_OBJECTS) $(check_ups_DEPENDENCIES) $(EXTRA_check_ups_DEPENDENCIES)
+ @rm -f check_ups$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_ups_OBJECTS) $(check_ups_LDADD) $(LIBS)
+
+check_users$(EXEEXT): $(check_users_OBJECTS) $(check_users_DEPENDENCIES) $(EXTRA_check_users_DEPENDENCIES)
+ @rm -f check_users$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_users_OBJECTS) $(check_users_LDADD) $(LIBS)
+
+negate$(EXEEXT): $(negate_OBJECTS) $(negate_DEPENDENCIES) $(EXTRA_negate_DEPENDENCIES)
+ @rm -f negate$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(negate_OBJECTS) $(negate_LDADD) $(LIBS)
+
+urlize$(EXEEXT): $(urlize_OBJECTS) $(urlize_DEPENDENCIES) $(EXTRA_urlize_DEPENDENCIES)
+ @rm -f urlize$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(urlize_OBJECTS) $(urlize_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_apt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_by_ssh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_cluster.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_curl-check_curl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_dbi.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_dig.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_disk.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_dns.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_dummy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_fping.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_game.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_hpjd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_http.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ide_smart.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ldap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_load.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_mrtg.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_mrtgtraf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_mysql-check_mysql.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_mysql_query-check_mysql_query.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_nagios.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_nt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ntp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ntp_peer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ntp_time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_nwstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_overcr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_pgsql.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ping.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_procs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_radius.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_real.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_smtp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_snmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ssh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_swap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_tcp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_ups.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_users.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/negate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netutils.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runcmd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sslutils.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urlize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+check_curl-check_curl.o: check_curl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_curl_CPPFLAGS) $(CPPFLAGS) $(check_curl_CFLAGS) $(CFLAGS) -MT check_curl-check_curl.o -MD -MP -MF $(DEPDIR)/check_curl-check_curl.Tpo -c -o check_curl-check_curl.o `test -f 'check_curl.c' || echo '$(srcdir)/'`check_curl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_curl-check_curl.Tpo $(DEPDIR)/check_curl-check_curl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_curl.c' object='check_curl-check_curl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_curl_CPPFLAGS) $(CPPFLAGS) $(check_curl_CFLAGS) $(CFLAGS) -c -o check_curl-check_curl.o `test -f 'check_curl.c' || echo '$(srcdir)/'`check_curl.c
+
+check_curl-check_curl.obj: check_curl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_curl_CPPFLAGS) $(CPPFLAGS) $(check_curl_CFLAGS) $(CFLAGS) -MT check_curl-check_curl.obj -MD -MP -MF $(DEPDIR)/check_curl-check_curl.Tpo -c -o check_curl-check_curl.obj `if test -f 'check_curl.c'; then $(CYGPATH_W) 'check_curl.c'; else $(CYGPATH_W) '$(srcdir)/check_curl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_curl-check_curl.Tpo $(DEPDIR)/check_curl-check_curl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_curl.c' object='check_curl-check_curl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_curl_CPPFLAGS) $(CPPFLAGS) $(check_curl_CFLAGS) $(CFLAGS) -c -o check_curl-check_curl.obj `if test -f 'check_curl.c'; then $(CYGPATH_W) 'check_curl.c'; else $(CYGPATH_W) '$(srcdir)/check_curl.c'; fi`
+
+check_mysql-check_mysql.o: check_mysql.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_CPPFLAGS) $(CPPFLAGS) $(check_mysql_CFLAGS) $(CFLAGS) -MT check_mysql-check_mysql.o -MD -MP -MF $(DEPDIR)/check_mysql-check_mysql.Tpo -c -o check_mysql-check_mysql.o `test -f 'check_mysql.c' || echo '$(srcdir)/'`check_mysql.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_mysql-check_mysql.Tpo $(DEPDIR)/check_mysql-check_mysql.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_mysql.c' object='check_mysql-check_mysql.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_CPPFLAGS) $(CPPFLAGS) $(check_mysql_CFLAGS) $(CFLAGS) -c -o check_mysql-check_mysql.o `test -f 'check_mysql.c' || echo '$(srcdir)/'`check_mysql.c
+
+check_mysql-check_mysql.obj: check_mysql.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_CPPFLAGS) $(CPPFLAGS) $(check_mysql_CFLAGS) $(CFLAGS) -MT check_mysql-check_mysql.obj -MD -MP -MF $(DEPDIR)/check_mysql-check_mysql.Tpo -c -o check_mysql-check_mysql.obj `if test -f 'check_mysql.c'; then $(CYGPATH_W) 'check_mysql.c'; else $(CYGPATH_W) '$(srcdir)/check_mysql.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_mysql-check_mysql.Tpo $(DEPDIR)/check_mysql-check_mysql.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_mysql.c' object='check_mysql-check_mysql.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_CPPFLAGS) $(CPPFLAGS) $(check_mysql_CFLAGS) $(CFLAGS) -c -o check_mysql-check_mysql.obj `if test -f 'check_mysql.c'; then $(CYGPATH_W) 'check_mysql.c'; else $(CYGPATH_W) '$(srcdir)/check_mysql.c'; fi`
+
+check_mysql_query-check_mysql_query.o: check_mysql_query.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_query_CPPFLAGS) $(CPPFLAGS) $(check_mysql_query_CFLAGS) $(CFLAGS) -MT check_mysql_query-check_mysql_query.o -MD -MP -MF $(DEPDIR)/check_mysql_query-check_mysql_query.Tpo -c -o check_mysql_query-check_mysql_query.o `test -f 'check_mysql_query.c' || echo '$(srcdir)/'`check_mysql_query.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_mysql_query-check_mysql_query.Tpo $(DEPDIR)/check_mysql_query-check_mysql_query.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_mysql_query.c' object='check_mysql_query-check_mysql_query.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_query_CPPFLAGS) $(CPPFLAGS) $(check_mysql_query_CFLAGS) $(CFLAGS) -c -o check_mysql_query-check_mysql_query.o `test -f 'check_mysql_query.c' || echo '$(srcdir)/'`check_mysql_query.c
+
+check_mysql_query-check_mysql_query.obj: check_mysql_query.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_query_CPPFLAGS) $(CPPFLAGS) $(check_mysql_query_CFLAGS) $(CFLAGS) -MT check_mysql_query-check_mysql_query.obj -MD -MP -MF $(DEPDIR)/check_mysql_query-check_mysql_query.Tpo -c -o check_mysql_query-check_mysql_query.obj `if test -f 'check_mysql_query.c'; then $(CYGPATH_W) 'check_mysql_query.c'; else $(CYGPATH_W) '$(srcdir)/check_mysql_query.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_mysql_query-check_mysql_query.Tpo $(DEPDIR)/check_mysql_query-check_mysql_query.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='check_mysql_query.c' object='check_mysql_query-check_mysql_query.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_mysql_query_CPPFLAGS) $(CPPFLAGS) $(check_mysql_query_CFLAGS) $(CFLAGS) -c -o check_mysql_query-check_mysql_query.obj `if test -f 'check_mysql_query.c'; then $(CYGPATH_W) 'check_mysql_query.c'; else $(CYGPATH_W) '$(srcdir)/check_mysql_query.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-recursive
+all-am: Makefile $(PROGRAMS) $(LIBRARIES) all-local
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(libexecdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-local clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f ./$(DEPDIR)/check_apt.Po
+ -rm -f ./$(DEPDIR)/check_by_ssh.Po
+ -rm -f ./$(DEPDIR)/check_cluster.Po
+ -rm -f ./$(DEPDIR)/check_curl-check_curl.Po
+ -rm -f ./$(DEPDIR)/check_dbi.Po
+ -rm -f ./$(DEPDIR)/check_dig.Po
+ -rm -f ./$(DEPDIR)/check_disk.Po
+ -rm -f ./$(DEPDIR)/check_dns.Po
+ -rm -f ./$(DEPDIR)/check_dummy.Po
+ -rm -f ./$(DEPDIR)/check_fping.Po
+ -rm -f ./$(DEPDIR)/check_game.Po
+ -rm -f ./$(DEPDIR)/check_hpjd.Po
+ -rm -f ./$(DEPDIR)/check_http.Po
+ -rm -f ./$(DEPDIR)/check_ide_smart.Po
+ -rm -f ./$(DEPDIR)/check_ldap.Po
+ -rm -f ./$(DEPDIR)/check_load.Po
+ -rm -f ./$(DEPDIR)/check_mrtg.Po
+ -rm -f ./$(DEPDIR)/check_mrtgtraf.Po
+ -rm -f ./$(DEPDIR)/check_mysql-check_mysql.Po
+ -rm -f ./$(DEPDIR)/check_mysql_query-check_mysql_query.Po
+ -rm -f ./$(DEPDIR)/check_nagios.Po
+ -rm -f ./$(DEPDIR)/check_nt.Po
+ -rm -f ./$(DEPDIR)/check_ntp.Po
+ -rm -f ./$(DEPDIR)/check_ntp_peer.Po
+ -rm -f ./$(DEPDIR)/check_ntp_time.Po
+ -rm -f ./$(DEPDIR)/check_nwstat.Po
+ -rm -f ./$(DEPDIR)/check_overcr.Po
+ -rm -f ./$(DEPDIR)/check_pgsql.Po
+ -rm -f ./$(DEPDIR)/check_ping.Po
+ -rm -f ./$(DEPDIR)/check_procs.Po
+ -rm -f ./$(DEPDIR)/check_radius.Po
+ -rm -f ./$(DEPDIR)/check_real.Po
+ -rm -f ./$(DEPDIR)/check_smtp.Po
+ -rm -f ./$(DEPDIR)/check_snmp.Po
+ -rm -f ./$(DEPDIR)/check_ssh.Po
+ -rm -f ./$(DEPDIR)/check_swap.Po
+ -rm -f ./$(DEPDIR)/check_tcp.Po
+ -rm -f ./$(DEPDIR)/check_time.Po
+ -rm -f ./$(DEPDIR)/check_ups.Po
+ -rm -f ./$(DEPDIR)/check_users.Po
+ -rm -f ./$(DEPDIR)/negate.Po
+ -rm -f ./$(DEPDIR)/netutils.Po
+ -rm -f ./$(DEPDIR)/popen.Po
+ -rm -f ./$(DEPDIR)/runcmd.Po
+ -rm -f ./$(DEPDIR)/sslutils.Po
+ -rm -f ./$(DEPDIR)/urlize.Po
+ -rm -f ./$(DEPDIR)/utils.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-libexecPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f ./$(DEPDIR)/check_apt.Po
+ -rm -f ./$(DEPDIR)/check_by_ssh.Po
+ -rm -f ./$(DEPDIR)/check_cluster.Po
+ -rm -f ./$(DEPDIR)/check_curl-check_curl.Po
+ -rm -f ./$(DEPDIR)/check_dbi.Po
+ -rm -f ./$(DEPDIR)/check_dig.Po
+ -rm -f ./$(DEPDIR)/check_disk.Po
+ -rm -f ./$(DEPDIR)/check_dns.Po
+ -rm -f ./$(DEPDIR)/check_dummy.Po
+ -rm -f ./$(DEPDIR)/check_fping.Po
+ -rm -f ./$(DEPDIR)/check_game.Po
+ -rm -f ./$(DEPDIR)/check_hpjd.Po
+ -rm -f ./$(DEPDIR)/check_http.Po
+ -rm -f ./$(DEPDIR)/check_ide_smart.Po
+ -rm -f ./$(DEPDIR)/check_ldap.Po
+ -rm -f ./$(DEPDIR)/check_load.Po
+ -rm -f ./$(DEPDIR)/check_mrtg.Po
+ -rm -f ./$(DEPDIR)/check_mrtgtraf.Po
+ -rm -f ./$(DEPDIR)/check_mysql-check_mysql.Po
+ -rm -f ./$(DEPDIR)/check_mysql_query-check_mysql_query.Po
+ -rm -f ./$(DEPDIR)/check_nagios.Po
+ -rm -f ./$(DEPDIR)/check_nt.Po
+ -rm -f ./$(DEPDIR)/check_ntp.Po
+ -rm -f ./$(DEPDIR)/check_ntp_peer.Po
+ -rm -f ./$(DEPDIR)/check_ntp_time.Po
+ -rm -f ./$(DEPDIR)/check_nwstat.Po
+ -rm -f ./$(DEPDIR)/check_overcr.Po
+ -rm -f ./$(DEPDIR)/check_pgsql.Po
+ -rm -f ./$(DEPDIR)/check_ping.Po
+ -rm -f ./$(DEPDIR)/check_procs.Po
+ -rm -f ./$(DEPDIR)/check_radius.Po
+ -rm -f ./$(DEPDIR)/check_real.Po
+ -rm -f ./$(DEPDIR)/check_smtp.Po
+ -rm -f ./$(DEPDIR)/check_snmp.Po
+ -rm -f ./$(DEPDIR)/check_ssh.Po
+ -rm -f ./$(DEPDIR)/check_swap.Po
+ -rm -f ./$(DEPDIR)/check_tcp.Po
+ -rm -f ./$(DEPDIR)/check_time.Po
+ -rm -f ./$(DEPDIR)/check_ups.Po
+ -rm -f ./$(DEPDIR)/check_users.Po
+ -rm -f ./$(DEPDIR)/negate.Po
+ -rm -f ./$(DEPDIR)/netutils.Po
+ -rm -f ./$(DEPDIR)/popen.Po
+ -rm -f ./$(DEPDIR)/runcmd.Po
+ -rm -f ./$(DEPDIR)/sslutils.Po
+ -rm -f ./$(DEPDIR)/urlize.Po
+ -rm -f ./$(DEPDIR)/utils.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-libexecPROGRAMS uninstall-local
+
+.MAKE: $(am__recursive_targets) check-am install-am install-exec-am \
+ install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
+ am--depfiles check check-TESTS check-am clean clean-generic \
+ clean-libexecPROGRAMS clean-libtool clean-local \
+ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-hook \
+ install-html install-html-am install-info install-info-am \
+ install-libexecPROGRAMS install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am \
+ uninstall-libexecPROGRAMS uninstall-local
+
+.PRECIOUS: Makefile
+
+@RELEASE_PRESENT_FALSE@NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
+@RELEASE_PRESENT_FALSE@ @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
+@RELEASE_PRESENT_FALSE@.FORCE-NP-VERSION-FILE:
+@RELEASE_PRESENT_FALSE@-include NP-VERSION-FILE
+
+test:
+ perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+test-debug:
+ NPTEST_DEBUG=1 HARNESS_VERBOSE=1 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
+
+##############################################################################
+# secondary dependencies
+
+all-local: $(check_tcp_programs)
+
+$(check_tcp_programs): check_tcp
+ rm -f $@
+ ln -s check_tcp $@
+
+install-exec-hook:
+ cd $(DESTDIR)$(libexecdir) && \
+ for i in $(check_tcp_programs) ; do rm -f $$i; ln -s check_tcp $$i ; done ;\
+ if [ -x check_ldap ] ; then rm -f check_ldaps ; ln -s check_ldap check_ldaps ; fi
+
+clean-local:
+ rm -f $(check_tcp_programs)
+ rm -f NP-VERSION-FILE
+
+uninstall-local:
+ cd $(DESTDIR)$(libexecdir) && rm -f $(check_tcp_programs)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/plugins/check_apt.c b/plugins/check_apt.c
new file mode 100644
index 0000000..fa982ae
--- /dev/null
+++ b/plugins/check_apt.c
@@ -0,0 +1,561 @@
+/*****************************************************************************
+*
+* Monitoring check_apt plugin
+*
+* License: GPL
+* Copyright (c) 2006-2008 Monitoring Plugins Development Team
+*
+* Original author: Sean Finney
+*
+* Description:
+*
+* This file contains the check_apt plugin
+*
+* Check for available updates in apt package management systems
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*****************************************************************************/
+
+const char *progname = "check_apt";
+const char *copyright = "2006-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "runcmd.h"
+#include "utils.h"
+#include "regex.h"
+
+/* some constants */
+typedef enum { UPGRADE, DIST_UPGRADE, NO_UPGRADE } upgrade_type;
+
+/* Character for hidden input file option (for testing). */
+#define INPUT_FILE_OPT CHAR_MAX+1
+/* the default opts can be overridden via the cmdline */
+#define UPGRADE_DEFAULT_OPTS "-o 'Debug::NoLocking=true' -s -qq"
+#define UPDATE_DEFAULT_OPTS "-q"
+/* until i commit the configure.in patch which gets this, i'll define
+ * it here as well */
+#ifndef PATH_TO_APTGET
+# define PATH_TO_APTGET "/usr/bin/apt-get"
+#endif /* PATH_TO_APTGET */
+/* String found at the beginning of the apt output lines we're interested in */
+#define PKGINST_PREFIX "Inst "
+/* the RE that catches security updates */
+#define SECURITY_RE "^[^\\(]*\\(.* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security)"
+
+/* some standard functions */
+int process_arguments(int, char **);
+void print_help(void);
+void print_usage(void);
+
+/* construct the appropriate apt-get cmdline */
+char* construct_cmdline(upgrade_type u, const char *opts);
+/* run an apt-get update */
+int run_update(void);
+/* run an apt-get upgrade */
+int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkglist);
+/* add another clause to a regexp */
+char* add_to_regexp(char *expr, const char *next);
+/* extract package name from Inst line */
+char* pkg_name(char *line);
+/* string comparison function for qsort */
+int cmpstringp(const void *p1, const void *p2);
+
+/* configuration variables */
+static int verbose = 0; /* -v */
+static bool list = false; /* list packages available for upgrade */
+static bool do_update = false; /* whether to call apt-get update */
+static bool only_critical = false; /* whether to warn about non-critical updates */
+static upgrade_type upgrade = UPGRADE; /* which type of upgrade to do */
+static char *upgrade_opts = NULL; /* options to override defaults for upgrade */
+static char *update_opts = NULL; /* options to override defaults for update */
+static char *do_include = NULL; /* regexp to only include certain packages */
+static char *do_exclude = NULL; /* regexp to only exclude certain packages */
+static char *do_critical = NULL; /* regexp specifying critical packages */
+static char *input_filename = NULL; /* input filename for testing */
+/* number of packages available for upgrade to return WARNING status */
+static int packages_warning = 1;
+
+/* other global variables */
+static int stderr_warning = 0; /* if a cmd issued output on stderr */
+static int exec_warning = 0; /* if a cmd exited non-zero */
+
+int main (int argc, char **argv) {
+ int result=STATE_UNKNOWN, packages_available=0, sec_count=0, i=0;
+ char **packages_list=NULL, **secpackages_list=NULL;
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts(&argc, argv, progname);
+
+ if (process_arguments(argc, argv) == ERROR)
+ usage_va(_("Could not parse arguments"));
+
+ /* Set signal handling and alarm timeout */
+ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
+ usage_va(_("Cannot catch SIGALRM"));
+ }
+
+ /* handle timeouts gracefully... */
+ alarm (timeout_interval);
+
+ /* if they want to run apt-get update first... */
+ if(do_update) result = run_update();
+
+ /* apt-get upgrade */
+ result = max_state(result, run_upgrade(&packages_available, &sec_count, &packages_list, &secpackages_list));
+
+ if(sec_count > 0){
+ result = max_state(result, STATE_CRITICAL);
+ } else if(packages_available >= packages_warning && only_critical == false){
+ result = max_state(result, STATE_WARNING);
+ } else if(result > STATE_UNKNOWN){
+ result = STATE_UNKNOWN;
+ }
+
+ printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s|available_upgrades=%d;;;0 critical_updates=%d;;;0\n"),
+ state_text(result),
+ packages_available,
+ (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade",
+ sec_count,
+ (stderr_warning)?" warnings detected":"",
+ (stderr_warning && exec_warning)?",":"",
+ (exec_warning)?" errors detected":"",
+ (stderr_warning||exec_warning)?".":"",
+ packages_available,
+ sec_count
+ );
+
+ if(list) {
+ qsort(secpackages_list, sec_count, sizeof(char*), cmpstringp);
+ qsort(packages_list, packages_available-sec_count, sizeof(char*), cmpstringp);
+
+ for(i = 0; i < sec_count; i++)
+ printf("%s (security)\n", secpackages_list[i]);
+ if (only_critical == false) {
+ for(i = 0; i < packages_available - sec_count; i++)
+ printf("%s\n", packages_list[i]);
+ }
+ }
+
+ return result;
+}
+
+/* process command-line arguments */
+int process_arguments (int argc, char **argv) {
+ int c;
+
+ static struct option longopts[] = {
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"verbose", no_argument, 0, 'v'},
+ {"timeout", required_argument, 0, 't'},
+ {"update", optional_argument, 0, 'u'},
+ {"upgrade", optional_argument, 0, 'U'},
+ {"no-upgrade", no_argument, 0, 'n'},
+ {"dist-upgrade", optional_argument, 0, 'd'},
+ {"list", no_argument, false, 'l'},
+ {"include", required_argument, 0, 'i'},
+ {"exclude", required_argument, 0, 'e'},
+ {"critical", required_argument, 0, 'c'},
+ {"only-critical", no_argument, 0, 'o'},
+ {"input-file", required_argument, 0, INPUT_FILE_OPT},
+ {"packages-warning", required_argument, 0, 'w'},
+ {0, 0, 0, 0}
+ };
+
+ while(1) {
+ c = getopt_long(argc, argv, "hVvt:u::U::d::nli:e:c:ow:", longopts, NULL);
+
+ if(c == -1 || c == EOF || c == 1) break;
+
+ switch(c) {
+ case 'h':
+ print_help();
+ exit(STATE_UNKNOWN);
+ case 'V':
+ print_revision(progname, NP_VERSION);
+ exit(STATE_UNKNOWN);
+ case 'v':
+ verbose++;
+ break;
+ case 't':
+ timeout_interval=atoi(optarg);
+ break;
+ case 'd':
+ upgrade=DIST_UPGRADE;
+ if(optarg!=NULL){
+ upgrade_opts=strdup(optarg);
+ if(upgrade_opts==NULL) die(STATE_UNKNOWN, "strdup failed");
+ }
+ break;
+ case 'U':
+ upgrade=UPGRADE;
+ if(optarg!=NULL){
+ upgrade_opts=strdup(optarg);
+ if(upgrade_opts==NULL) die(STATE_UNKNOWN, "strdup failed");
+ }
+ break;
+ case 'n':
+ upgrade=NO_UPGRADE;
+ break;
+ case 'u':
+ do_update=true;
+ if(optarg!=NULL){
+ update_opts=strdup(optarg);
+ if(update_opts==NULL) die(STATE_UNKNOWN, "strdup failed");
+ }
+ break;
+ case 'l':
+ list=true;
+ break;
+ case 'i':
+ do_include=add_to_regexp(do_include, optarg);
+ break;
+ case 'e':
+ do_exclude=add_to_regexp(do_exclude, optarg);
+ break;
+ case 'c':
+ do_critical=add_to_regexp(do_critical, optarg);
+ break;
+ case 'o':
+ only_critical=true;
+ break;
+ case INPUT_FILE_OPT:
+ input_filename = optarg;
+ break;
+ case 'w':
+ packages_warning = atoi(optarg);
+ break;
+ default:
+ /* print short usage statement if args not parsable */
+ usage5();
+ }
+ }
+
+ return OK;
+}
+
+
+/* run an apt-get upgrade */
+int run_upgrade(int *pkgcount, int *secpkgcount, char ***pkglist, char ***secpkglist){
+ int i=0, result=STATE_UNKNOWN, regres=0, pc=0, spc=0;
+ struct output chld_out, chld_err;
+ regex_t ireg, ereg, sreg;
+ char *cmdline=NULL, rerrbuf[64];
+
+ /* initialize ereg as it is possible it is printed while uninitialized */
+ memset(&ereg, '\0', sizeof(ereg.buffer));
+
+ if(upgrade==NO_UPGRADE) return STATE_OK;
+
+ /* compile the regexps */
+ if (do_include != NULL) {
+ regres=regcomp(&ireg, do_include, REG_EXTENDED);
+ if (regres!=0) {
+ regerror(regres, &ireg, rerrbuf, 64);
+ die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"), progname, rerrbuf);
+ }
+ }
+
+ if(do_exclude!=NULL){
+ regres=regcomp(&ereg, do_exclude, REG_EXTENDED);
+ if(regres!=0) {
+ regerror(regres, &ereg, rerrbuf, 64);
+ die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"),
+ progname, rerrbuf);
+ }
+ }
+
+ const char *crit_ptr = (do_critical != NULL) ? do_critical : SECURITY_RE;
+ regres=regcomp(&sreg, crit_ptr, REG_EXTENDED);
+ if(regres!=0) {
+ regerror(regres, &ereg, rerrbuf, 64);
+ die(STATE_UNKNOWN, _("%s: Error compiling regexp: %s"),
+ progname, rerrbuf);
+ }
+
+ cmdline=construct_cmdline(upgrade, upgrade_opts);
+ if (input_filename != NULL) {
+ /* read input from a file for testing */
+ result = cmd_file_read(input_filename, &chld_out, 0);
+ } else {
+ /* run the upgrade */
+ result = np_runcmd(cmdline, &chld_out, &chld_err, 0);
+ }
+
+ /* apt-get upgrade only changes exit status if there is an
+ * internal error when run in dry-run mode. therefore we will
+ * treat such an error as UNKNOWN */
+ if(result != 0){
+ exec_warning=1;
+ result = STATE_UNKNOWN;
+ fprintf(stderr, _("'%s' exited with non-zero status.\n"),
+ cmdline);
+ }
+
+ *pkglist=malloc(sizeof(char *) * chld_out.lines);
+ if(!pkglist) die(STATE_UNKNOWN, "malloc failed!\n");
+ *secpkglist=malloc(sizeof(char *) * chld_out.lines);
+ if(!secpkglist) die(STATE_UNKNOWN, "malloc failed!\n");
+
+ /* parse the output, which should only consist of lines like
+ *
+ * Inst package ....
+ * Conf package ....
+ *
+ * so we'll filter based on "Inst" for the time being. later
+ * we may need to switch to the --print-uris output format,
+ * in which case the logic here will slightly change.
+ */
+ for(i = 0; i < chld_out.lines; i++) {
+ if(verbose){
+ printf("%s\n", chld_out.line[i]);
+ }
+ /* if it is a package we care about */
+ if (strncmp(PKGINST_PREFIX, chld_out.line[i], strlen(PKGINST_PREFIX)) == 0 &&
+ (do_include == NULL || regexec(&ireg, chld_out.line[i], 0, NULL, 0) == 0)) {
+ /* if we're not excluding, or it's not in the
+ * list of stuff to exclude */
+ if(do_exclude==NULL ||
+ regexec(&ereg, chld_out.line[i], 0, NULL, 0)!=0){
+ pc++;
+ if(regexec(&sreg, chld_out.line[i], 0, NULL, 0)==0){
+ spc++;
+ if(verbose) printf("*");
+ (*secpkglist)[spc-1] = pkg_name(chld_out.line[i]);
+ } else {
+ (*pkglist)[pc-spc-1] = pkg_name(chld_out.line[i]);
+ }
+ if(verbose){
+ printf("*%s\n", chld_out.line[i]);
+ }
+ }
+ }
+ }
+ *pkgcount=pc;
+ *secpkgcount=spc;
+
+ /* If we get anything on stderr, at least set warning */
+ if (input_filename == NULL && chld_err.buflen) {
+ stderr_warning=1;
+ result = max_state(result, STATE_WARNING);
+ if(verbose){
+ for(i = 0; i < chld_err.lines; i++) {
+ fprintf(stderr, "%s\n", chld_err.line[i]);
+ }
+ }
+ }
+ if (do_include != NULL) regfree(&ireg);
+ regfree(&sreg);
+ if(do_exclude!=NULL) regfree(&ereg);
+ free(cmdline);
+ return result;
+}
+
+/* run an apt-get update (needs root) */
+int run_update(void){
+ int i=0, result=STATE_UNKNOWN;
+ struct output chld_out, chld_err;
+ char *cmdline;
+
+ /* run the update */
+ cmdline = construct_cmdline(NO_UPGRADE, update_opts);
+ result = np_runcmd(cmdline, &chld_out, &chld_err, 0);
+ /* apt-get update changes exit status if it can't fetch packages.
+ * since we were explicitly asked to do so, this is treated as
+ * a critical error. */
+ if(result != 0){
+ exec_warning=1;
+ result = STATE_CRITICAL;
+ fprintf(stderr, _("'%s' exited with non-zero status.\n"),
+ cmdline);
+ }
+
+ if(verbose){
+ for(i = 0; i < chld_out.lines; i++) {
+ printf("%s\n", chld_out.line[i]);
+ }
+ }
+
+ /* If we get anything on stderr, at least set warning */
+ if(chld_err.buflen){
+ stderr_warning=1;
+ result = max_state(result, STATE_WARNING);
+ if(verbose){
+ for(i = 0; i < chld_err.lines; i++) {
+ fprintf(stderr, "%s\n", chld_err.line[i]);
+ }
+ }
+ }
+ free(cmdline);
+ return result;
+}
+
+char* pkg_name(char *line){
+ char *start=NULL, *space=NULL, *pkg=NULL;
+ int len=0;
+
+ start = line + strlen(PKGINST_PREFIX);
+ len = strlen(start);
+
+ space = index(start, ' ');
+ if(space!=NULL){
+ len = space - start;
+ }
+
+ pkg=malloc(sizeof(char)*(len+1));
+ if(!pkg) die(STATE_UNKNOWN, "malloc failed!\n");
+
+ strncpy(pkg, start, len);
+ pkg[len]='\0';
+
+ return pkg;
+}
+
+int cmpstringp(const void *p1, const void *p2){
+ return strcmp(* (char * const *) p1, * (char * const *) p2);
+}
+
+char* add_to_regexp(char *expr, const char *next){
+ char *re=NULL;
+
+ if(expr==NULL){
+ re=malloc(sizeof(char)*(strlen("()")+strlen(next)+1));
+ if(!re) die(STATE_UNKNOWN, "malloc failed!\n");
+ sprintf(re, "(%s)", next);
+ } else {
+ /* resize it, adding an extra char for the new '|' separator */
+ re=realloc(expr, sizeof(char)*(strlen(expr)+1+strlen(next)+1));
+ if(!re) die(STATE_UNKNOWN, "realloc failed!\n");
+ /* append it starting at ')' in the old re */
+ sprintf((char*)(re+strlen(re)-1), "|%s)", next);
+ }
+
+ return re;
+}
+
+char* construct_cmdline(upgrade_type u, const char *opts){
+ int len=0;
+ const char *opts_ptr=NULL, *aptcmd=NULL;
+ char *cmd=NULL;
+
+ switch(u){
+ case UPGRADE:
+ if(opts==NULL) opts_ptr=UPGRADE_DEFAULT_OPTS;
+ else opts_ptr=opts;
+ aptcmd="upgrade";
+ break;
+ case DIST_UPGRADE:
+ if(opts==NULL) opts_ptr=UPGRADE_DEFAULT_OPTS;
+ else opts_ptr=opts;
+ aptcmd="dist-upgrade";
+ break;
+ case NO_UPGRADE:
+ if(opts==NULL) opts_ptr=UPDATE_DEFAULT_OPTS;
+ else opts_ptr=opts;
+ aptcmd="update";
+ break;
+ }
+
+ len+=strlen(PATH_TO_APTGET)+1; /* "/usr/bin/apt-get " */
+ len+=strlen(opts_ptr)+1; /* "opts " */
+ len+=strlen(aptcmd)+1; /* "upgrade\0" */
+
+ cmd=(char*)malloc(sizeof(char)*len);
+ if(cmd==NULL) die(STATE_UNKNOWN, "malloc failed");
+ sprintf(cmd, "%s %s %s", PATH_TO_APTGET, opts_ptr, aptcmd);
+ return cmd;
+}
+
+/* informative help message */
+void
+print_help (void)
+{
+ print_revision(progname, NP_VERSION);
+
+ printf(_(COPYRIGHT), copyright, email);
+
+ printf("%s\n", _("This plugin checks for software updates on systems that use"));
+ printf("%s\n", _("package management systems based on the apt-get(8) command"));
+ printf("%s\n", _("found in Debian GNU/Linux"));
+
+ printf ("\n\n");
+
+ print_usage();
+
+ printf(UT_HELP_VRSN);
+ printf(UT_EXTRA_OPTS);
+
+ printf(UT_PLUG_TIMEOUT, timeout_interval);
+
+ printf (" %s\n", "-n, --no-upgrade");
+ printf (" %s\n", _("Do not run the upgrade. Probably not useful (without -u at least)."));
+ printf (" %s\n", "-l, --list");
+ printf (" %s\n", _("List packages available for upgrade. Packages are printed sorted by"));
+ printf (" %s\n", _("name with security packages listed first."));
+ printf (" %s\n", "-i, --include=REGEXP");
+ printf (" %s\n", _("Include only packages matching REGEXP. Can be specified multiple times"));
+ printf (" %s\n", _("the values will be combined together. Any packages matching this list"));
+ printf (" %s\n", _("cause the plugin to return WARNING status. Others will be ignored."));
+ printf (" %s\n", _("Default is to include all packages."));
+ printf (" %s\n", "-e, --exclude=REGEXP");
+ printf (" %s\n", _("Exclude packages matching REGEXP from the list of packages that would"));
+ printf (" %s\n", _("otherwise be included. Can be specified multiple times; the values"));
+ printf (" %s\n", _("will be combined together. Default is to exclude no packages."));
+ printf (" %s\n", "-c, --critical=REGEXP");
+ printf (" %s\n", _("If the full package information of any of the upgradable packages match"));
+ printf (" %s\n", _("this REGEXP, the plugin will return CRITICAL status. Can be specified"));
+ printf (" %s\n", _("multiple times like above. Default is a regexp matching security"));
+ printf (" %s\n", _("upgrades for Debian and Ubuntu:"));
+ printf (" \t%s\n", SECURITY_RE);
+ printf (" %s\n", _("Note that the package must first match the include list before its"));
+ printf (" %s\n", _("information is compared against the critical list."));
+ printf (" %s\n", "-o, --only-critical");
+ printf (" %s\n", _("Only warn about upgrades matching the critical list. The total number"));
+ printf (" %s\n", _("of upgrades will be printed, but any non-critical upgrades will not cause"));
+ printf (" %s\n", _("the plugin to return WARNING status."));
+ printf (" %s\n", "-w, --packages-warning");
+ printf (" %s\n", _("Minimum number of packages available for upgrade to return WARNING status."));
+ printf (" %s\n\n", _("Default is 1 package."));
+
+ printf ("%s\n\n", _("The following options require root privileges and should be used with care:"));
+ printf (" %s\n", "-u, --update=OPTS");
+ printf (" %s\n", _("First perform an 'apt-get update'. An optional OPTS parameter overrides"));
+ printf (" %s\n", _("the default options. Note: you may also need to adjust the global"));
+ printf (" %s\n", _("timeout (with -t) to prevent the plugin from timing out if apt-get"));
+ printf (" %s\n", _("upgrade is expected to take longer than the default timeout."));
+ printf (" %s\n", "-U, --upgrade=OPTS");
+ printf (" %s\n", _("Perform an upgrade. If an optional OPTS argument is provided,"));
+ printf (" %s\n", _("apt-get will be run with these command line options instead of the"));
+ printf (" %s", _("default "));
+ printf ("(%s).\n", UPGRADE_DEFAULT_OPTS);
+ printf (" %s\n", _("Note that you may be required to have root privileges if you do not use"));
+ printf (" %s\n", _("the default options, which will only run a simulation and NOT perform the upgrade"));
+ printf (" %s\n", "-d, --dist-upgrade=OPTS");
+ printf (" %s\n", _("Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS"));
+ printf (" %s\n", _("can be provided to override the default options."));
+
+ printf(UT_SUPPORT);
+}
+
+
+/* simple usage heading */
+void
+print_usage(void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s [[-d|-u|-U]opts] [-n] [-l] [-t timeout] [-w packages-warning]\n", progname);
+}
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
new file mode 100644
index 0000000..1ad547e
--- /dev/null
+++ b/plugins/check_by_ssh.c
@@ -0,0 +1,496 @@
+/*****************************************************************************
+*
+* Monitoring check_by_ssh plugin
+*
+* License: GPL
+* Copyright (c) 2000-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_by_ssh plugin
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_by_ssh";
+const char *copyright = "2000-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "netutils.h"
+#include "utils_cmd.h"
+
+#ifndef NP_MAXARGS
+#define NP_MAXARGS 1024
+#endif
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void comm_append (const char *);
+void print_help (void);
+void print_usage (void);
+
+unsigned int commands = 0;
+unsigned int services = 0;
+int skip_stdout = 0;
+int skip_stderr = 0;
+int warn_on_stderr = 0;
+bool unknown_timeout = FALSE;
+char *remotecmd = NULL;
+char **commargv = NULL;
+int commargc = 0;
+char *hostname = NULL;
+char *outputfile = NULL;
+char *host_shortname = NULL;
+char **service;
+int passive = FALSE;
+int verbose = FALSE;
+
+int
+main (int argc, char **argv)
+{
+
+ char *status_text;
+ int cresult;
+ int result = STATE_UNKNOWN;
+ int i;
+ time_t local_time;
+ FILE *fp = NULL;
+ output chld_out, chld_err;
+
+ remotecmd = "";
+ comm_append(SSH_COMMAND);
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ /* process arguments */
+ if (process_arguments (argc, argv) == ERROR)
+ usage_va(_("Could not parse arguments"));
+
+ /* Set signal handling and alarm timeout */
+ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
+ usage_va(_("Cannot catch SIGALRM"));
+ }
+ alarm (timeout_interval);
+
+ /* run the command */
+ if (verbose) {
+ printf ("Command: %s\n", commargv[0]);
+ for (i=1; i<commargc; i++)
+ printf ("Argument %i: %s\n", i, commargv[i]);
+ }
+
+ result = cmd_run_array (commargv, &chld_out, &chld_err, 0);
+
+ /* SSH returns 255 if connection attempt fails; include the first line of error output */
+ if (result == 255 && unknown_timeout) {
+ printf (_("SSH connection failed: %s\n"),
+ chld_err.lines > 0 ? chld_err.line[0] : "(no error output)");
+ return STATE_UNKNOWN;
+ }
+
+ if (verbose) {
+ for(i = 0; i < chld_out.lines; i++)
+ printf("stdout: %s\n", chld_out.line[i]);
+ for(i = 0; i < chld_err.lines; i++)
+ printf("stderr: %s\n", chld_err.line[i]);
+ }
+
+ if (skip_stdout == -1) /* --skip-stdout specified without argument */
+ skip_stdout = chld_out.lines;
+ if (skip_stderr == -1) /* --skip-stderr specified without argument */
+ skip_stderr = chld_err.lines;
+
+ /* UNKNOWN or worse if (non-skipped) output found on stderr */
+ if(chld_err.lines > skip_stderr) {
+ printf (_("Remote command execution failed: %s\n"),
+ chld_err.line[skip_stderr]);
+ if ( warn_on_stderr )
+ return max_state_alt(result, STATE_WARNING);
+ else
+ return max_state_alt(result, STATE_UNKNOWN);
+ }
+
+ /* this is simple if we're not supposed to be passive.
+ * Wrap up quickly and keep the tricks below */
+ if(!passive) {
+ if (chld_out.lines > skip_stdout)
+ for (i = skip_stdout; i < chld_out.lines; i++)
+ puts (chld_out.line[i]);
+ else
+ printf (_("%s - check_by_ssh: Remote command '%s' returned status %d\n"),
+ state_text(result), remotecmd, result);
+ return result; /* return error status from remote command */
+ }
+
+
+ /*
+ * Passive mode
+ */
+
+ /* process output */
+ if (!(fp = fopen (outputfile, "a"))) {
+ printf (_("SSH WARNING: could not open %s\n"), outputfile);
+ exit (STATE_UNKNOWN);
+ }
+
+ local_time = time (NULL);
+ commands = 0;
+ for(i = skip_stdout; i < chld_out.lines; i++) {
+ status_text = chld_out.line[i++];
+ if (i == chld_out.lines || strstr (chld_out.line[i], "STATUS CODE: ") == NULL)
+ die (STATE_UNKNOWN, _("%s: Error parsing output\n"), progname);
+
+ if (service[commands] && status_text
+ && sscanf (chld_out.line[i], "STATUS CODE: %d", &cresult) == 1)
+ {
+ fprintf (fp, "[%d] PROCESS_SERVICE_CHECK_RESULT;%s;%s;%d;%s\n",
+ (int) local_time, host_shortname, service[commands++],
+ cresult, status_text);
+ }
+ }
+
+ /* Multiple commands and passive checking should always return OK */
+ return result;
+}
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ char *p1, *p2;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"verbose", no_argument, 0, 'v'},
+ {"fork", no_argument, 0, 'f'},
+ {"timeout", required_argument, 0, 't'},
+ {"unknown-timeout", no_argument, 0, 'U'},
+ {"host", required_argument, 0, 'H'}, /* backward compatibility */
+ {"hostname", required_argument, 0, 'H'},
+ {"port", required_argument,0,'p'},
+ {"output", required_argument, 0, 'O'},
+ {"name", required_argument, 0, 'n'},
+ {"services", required_argument, 0, 's'},
+ {"identity", required_argument, 0, 'i'},
+ {"user", required_argument, 0, 'u'},
+ {"logname", required_argument, 0, 'l'},
+ {"command", required_argument, 0, 'C'},
+ {"skip", optional_argument, 0, 'S'}, /* backwards compatibility */
+ {"skip-stdout", optional_argument, 0, 'S'},
+ {"skip-stderr", optional_argument, 0, 'E'},
+ {"warn-on-stderr", no_argument, 0, 'W'},
+ {"proto1", no_argument, 0, '1'},
+ {"proto2", no_argument, 0, '2'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"ssh-option", required_argument, 0, 'o'},
+ {"quiet", no_argument, 0, 'q'},
+ {"configfile", optional_argument, 0, 'F'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++)
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vvh1246fqt:UH:O:p:i:u:l:C:S::E::n:s:o:F:", longopts,
+ &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'v': /* help */
+ verbose = TRUE;
+ break;
+ case 't': /* timeout period */
+ if (!is_integer (optarg))
+ usage_va(_("Timeout interval must be a positive integer"));
+ else
+ timeout_interval = atoi (optarg);
+ break;
+ case 'U':
+ unknown_timeout = TRUE;
+ break;
+ case 'H': /* host */
+ hostname = optarg;
+ break;
+ case 'p': /* port number */
+ if (!is_integer (optarg))
+ usage_va(_("Port must be a positive integer"));
+ comm_append("-p");
+ comm_append(optarg);
+ break;
+ case 'O': /* output file */
+ outputfile = optarg;
+ passive = TRUE;
+ break;
+ case 's': /* description of service to check */
+ p1 = optarg;
+ service = realloc (service, (++services) * sizeof(char *));
+ while ((p2 = index (p1, ':'))) {
+ *p2 = '\0';
+ service[services - 1] = p1;
+ service = realloc (service, (++services) * sizeof(char *));
+ p1 = p2 + 1;
+ }
+ service[services - 1] = p1;
+ break;
+ case 'n': /* short name of host in the monitoring configuration */
+ host_shortname = optarg;
+ break;
+
+ case 'u':
+ comm_append("-l");
+ comm_append(optarg);
+ break;
+ case 'l': /* login name */
+ comm_append("-l");
+ comm_append(optarg);
+ break;
+ case 'i': /* identity */
+ comm_append("-i");
+ comm_append(optarg);
+ break;
+
+ case '1': /* Pass these switches directly to ssh */
+ comm_append("-1");
+ break;
+ case '2': /* 1 to force version 1, 2 to force version 2 */
+ comm_append("-2");
+ break;
+ case '4': /* -4 for IPv4 */
+ comm_append("-4");
+ break;
+ case '6': /* -6 for IPv6 */
+ comm_append("-6");
+ break;
+ case 'f': /* fork to background */
+ comm_append("-f");
+ break;
+ case 'C': /* Command for remote machine */
+ commands++;
+ if (commands > 1)
+ xasprintf (&remotecmd, "%s;echo STATUS CODE: $?;", remotecmd);
+ xasprintf (&remotecmd, "%s%s", remotecmd, optarg);
+ break;
+ case 'S': /* skip n (or all) lines on stdout */
+ if (optarg == NULL)
+ skip_stdout = -1; /* skip all output on stdout */
+ else if (!is_integer (optarg))
+ usage_va(_("skip-stdout argument must be an integer"));
+ else
+ skip_stdout = atoi (optarg);
+ break;
+ case 'E': /* skip n (or all) lines on stderr */
+ if (optarg == NULL)
+ skip_stderr = -1; /* skip all output on stderr */
+ else if (!is_integer (optarg))
+ usage_va(_("skip-stderr argument must be an integer"));
+ else
+ skip_stderr = atoi (optarg);
+ break;
+ case 'W': /* exit with warning if there is an output on stderr */
+ warn_on_stderr = 1;
+ break;
+ case 'o': /* Extra options for the ssh command */
+ comm_append("-o");
+ comm_append(optarg);
+ break;
+ case 'q': /* Tell the ssh command to be quiet */
+ comm_append("-q");
+ break;
+ case 'F': /* ssh configfile */
+ comm_append("-F");
+ comm_append(optarg);
+ break;
+ default: /* help */
+ usage5();
+ }
+ }
+
+ c = optind;
+ if (hostname == NULL) {
+ if (c <= argc) {
+ die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname);
+ }
+ hostname = argv[c++];
+ }
+
+ if (strlen(remotecmd) == 0) {
+ for (; c < argc; c++)
+ if (strlen(remotecmd) > 0)
+ xasprintf (&remotecmd, "%s %s", remotecmd, argv[c]);
+ else
+ xasprintf (&remotecmd, "%s", argv[c]);
+ }
+
+ if (commands > 1 || passive)
+ xasprintf (&remotecmd, "%s;echo STATUS CODE: $?;", remotecmd);
+
+ if (remotecmd == NULL || strlen (remotecmd) <= 1)
+ usage_va(_("No remotecmd"));
+
+ comm_append(hostname);
+ comm_append(remotecmd);
+
+ return validate_arguments ();
+}
+
+
+void
+comm_append (const char *str)
+{
+
+ if (++commargc > NP_MAXARGS)
+ die(STATE_UNKNOWN, _("%s: Argument limit of %d exceeded\n"), progname, NP_MAXARGS);
+
+ if ((commargv = (char **)realloc(commargv, (commargc+1) * sizeof(char *))) == NULL)
+ die(STATE_UNKNOWN, _("Can not (re)allocate 'commargv' buffer\n"));
+
+ commargv[commargc-1] = strdup(str);
+ commargv[commargc] = NULL;
+
+}
+
+int
+validate_arguments (void)
+{
+ if (remotecmd == NULL || hostname == NULL)
+ return ERROR;
+
+ if (passive && commands != services)
+ die (STATE_UNKNOWN, _("%s: In passive mode, you must provide a service name for each command.\n"), progname);
+
+ if (passive && host_shortname == NULL)
+ die (STATE_UNKNOWN, _("%s: In passive mode, you must provide the host short name from the monitoring configs.\n"), progname);
+
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("This plugin uses SSH to execute commands on a remote host"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', "none");
+
+ printf (UT_IPv46);
+
+ printf (" %s\n", "-1, --proto1");
+ printf (" %s\n", _("tell ssh to use Protocol 1 [optional]"));
+ printf (" %s\n", "-2, --proto2");
+ printf (" %s\n", _("tell ssh to use Protocol 2 [optional]"));
+ printf (" %s\n", "-S, --skip-stdout[=n]");
+ printf (" %s\n", _("Ignore all or (if specified) first n lines on STDOUT [optional]"));
+ printf (" %s\n", "-E, --skip-stderr[=n]");
+ printf (" %s\n", _("Ignore all or (if specified) first n lines on STDERR [optional]"));
+ printf (" %s\n", "-W, --warn-on-stderr]");
+ printf (" %s\n", _("Exit with an warning, if there is an output on STDERR"));
+ printf (" %s\n", "-f");
+ printf (" %s\n", _("tells ssh to fork rather than create a tty [optional]. This will always return OK if ssh is executed"));
+ printf (" %s\n","-C, --command='COMMAND STRING'");
+ printf (" %s\n", _("command to execute on the remote machine"));
+ printf (" %s\n","-l, --logname=USERNAME");
+ printf (" %s\n", _("SSH user name on remote host [optional]"));
+ printf (" %s\n","-i, --identity=KEYFILE");
+ printf (" %s\n", _("identity of an authorized key [optional]"));
+ printf (" %s\n","-O, --output=FILE");
+ printf (" %s\n", _("external command file for monitoring [optional]"));
+ printf (" %s\n","-s, --services=LIST");
+ printf (" %s\n", _("list of monitoring service names, separated by ':' [optional]"));
+ printf (" %s\n","-n, --name=NAME");
+ printf (" %s\n", _("short name of host in the monitoring configuration [optional]"));
+ printf (" %s\n","-o, --ssh-option=OPTION");
+ printf (" %s\n", _("Call ssh with '-o OPTION' (may be used multiple times) [optional]"));
+ printf (" %s\n","-F, --configfile");
+ printf (" %s\n", _("Tell ssh to use this configfile [optional]"));
+ printf (" %s\n","-q, --quiet");
+ printf (" %s\n", _("Tell ssh to suppress warning and diagnostic messages [optional]"));
+ printf (UT_WARN_CRIT);
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (" %s\n","-U, --unknown-timeout");
+ printf (" %s\n", _("Make connection problems return UNKNOWN instead of CRITICAL"));
+ printf (UT_VERBOSE);
+ printf("\n");
+ printf (" %s\n", _("The most common mode of use is to refer to a local identity file with"));
+ printf (" %s\n", _("the '-i' option. In this mode, the identity pair should have a null"));
+ printf (" %s\n", _("passphrase and the public key should be listed in the authorized_keys"));
+ printf (" %s\n", _("file of the remote host. Usually the key will be restricted to running"));
+ printf (" %s\n", _("only one command on the remote server. If the remote SSH server tracks"));
+ printf (" %s\n", _("invocation arguments, the one remote program may be an agent that can"));
+ printf (" %s\n", _("execute additional commands as proxy"));
+ printf("\n");
+ printf (" %s\n", _("To use passive mode, provide multiple '-C' options, and provide"));
+ printf (" %s\n", _("all of -O, -s, and -n options (servicelist order must match '-C'options)"));
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "$ check_by_ssh -H localhost -n lh -s c1:c2:c3 -C uptime -C uptime -C uptime -O /tmp/foo");
+ printf (" %s\n", "$ cat /tmp/foo");
+ printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c1;0; up 2 days");
+ printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days");
+ printf (" %s\n", "[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days");
+
+ printf(UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s -H <host> -C <command> [-fqvU] [-1|-2] [-4|-6]\n"
+ " [-S [lines]] [-E [lines]] [-W] [-t timeout] [-i identity]\n"
+ " [-l user] [-n name] [-s servicelist] [-O outputfile]\n"
+ " [-p port] [-o ssh-option] [-F configfile]\n",
+ progname);
+}
diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c
new file mode 100644
index 0000000..e1ede9f
--- /dev/null
+++ b/plugins/check_cluster.c
@@ -0,0 +1,289 @@
+/*****************************************************************************
+*
+* check_cluster.c - Host and Service Cluster Plugin for Monitoring
+*
+* License: GPL
+* Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org)
+* Copyright (c) 2007 Monitoring Plugins Development Team
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_cluster";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "utils_base.h"
+
+#define CHECK_SERVICES 1
+#define CHECK_HOSTS 2
+
+void print_help (void);
+void print_usage (void);
+
+int total_services_ok=0;
+int total_services_warning=0;
+int total_services_unknown=0;
+int total_services_critical=0;
+
+int total_hosts_up=0;
+int total_hosts_down=0;
+int total_hosts_unreachable=0;
+
+char *warn_threshold;
+char *crit_threshold;
+
+int check_type=CHECK_SERVICES;
+
+char *data_vals=NULL;
+char *label=NULL;
+
+int verbose=0;
+
+int process_arguments(int,char **);
+
+
+
+int main(int argc, char **argv){
+ char *ptr;
+ int data_val;
+ int return_code=STATE_OK;
+ thresholds *thresholds = NULL;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts(&argc, argv, progname);
+
+ if(process_arguments(argc,argv)==ERROR)
+ usage(_("Could not parse arguments"));
+
+ /* Initialize the thresholds */
+ set_thresholds(&thresholds, warn_threshold, crit_threshold);
+ if(verbose)
+ print_thresholds("check_cluster", thresholds);
+
+ /* check the data values */
+ for(ptr=strtok(data_vals,",");ptr!=NULL;ptr=strtok(NULL,",")){
+
+ data_val=atoi(ptr);
+
+ if(check_type==CHECK_SERVICES){
+ switch(data_val){
+ case 0:
+ total_services_ok++;
+ break;
+ case 1:
+ total_services_warning++;
+ break;
+ case 2:
+ total_services_critical++;
+ break;
+ case 3:
+ total_services_unknown++;
+ break;
+ default:
+ break;
+ }
+ }
+ else{
+ switch(data_val){
+ case 0:
+ total_hosts_up++;
+ break;
+ case 1:
+ total_hosts_down++;
+ break;
+ case 2:
+ total_hosts_unreachable++;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+
+ /* return the status of the cluster */
+ if(check_type==CHECK_SERVICES){
+ return_code=get_status(total_services_warning+total_services_unknown+total_services_critical, thresholds);
+ printf("CLUSTER %s: %s: %d ok, %d warning, %d unknown, %d critical\n",
+ state_text(return_code), (label==NULL)?"Service cluster":label,
+ total_services_ok,total_services_warning,
+ total_services_unknown,total_services_critical);
+ }
+ else{
+ return_code=get_status(total_hosts_down+total_hosts_unreachable, thresholds);
+ printf("CLUSTER %s: %s: %d up, %d down, %d unreachable\n",
+ state_text(return_code), (label==NULL)?"Host cluster":label,
+ total_hosts_up,total_hosts_down,total_hosts_unreachable);
+ }
+
+ return return_code;
+}
+
+
+
+int process_arguments(int argc, char **argv){
+ int c;
+ char *ptr;
+ int option=0;
+ static struct option longopts[]={
+ {"data", required_argument,0,'d'},
+ {"warning", required_argument,0,'w'},
+ {"critical", required_argument,0,'c'},
+ {"label", required_argument,0,'l'},
+ {"host", no_argument, 0,'h'},
+ {"service", no_argument, 0,'s'},
+ {"verbose", no_argument, 0,'v'},
+ {"version", no_argument, 0,'V'},
+ {"help", no_argument, 0,'H'},
+ {0,0,0,0}
+ };
+
+ /* no options were supplied */
+ if(argc<2)
+ return ERROR;
+
+ while(1){
+
+ c=getopt_long(argc,argv,"hHsvVw:c:d:l:",longopts,&option);
+
+ if(c==-1 || c==EOF || c==1)
+ break;
+
+ switch(c){
+
+ case 'h': /* host cluster */
+ check_type=CHECK_HOSTS;
+ break;
+
+ case 's': /* service cluster */
+ check_type=CHECK_SERVICES;
+ break;
+
+ case 'w': /* warning threshold */
+ warn_threshold = strdup(optarg);
+ break;
+
+ case 'c': /* warning threshold */
+ crit_threshold = strdup(optarg);
+ break;
+
+ case 'd': /* data values */
+ data_vals=(char *)strdup(optarg);
+ /* validate data */
+ for (ptr=data_vals;ptr!=NULL;ptr+=2){
+ if (ptr[0]<'0' || ptr[0]>'3')
+ return ERROR;
+ if (ptr[1]=='\0')
+ break;
+ if (ptr[1]!=',')
+ return ERROR;
+ }
+ break;
+
+ case 'l': /* text label */
+ label=(char *)strdup(optarg);
+ break;
+
+ case 'v': /* verbose */
+ verbose++;
+ break;
+
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ break;
+
+ case 'H': /* help */
+ print_help();
+ exit(STATE_UNKNOWN);
+ break;
+
+ default:
+ return ERROR;
+ break;
+ }
+ }
+
+ if(data_vals==NULL)
+ return ERROR;
+
+ return OK;
+}
+
+void
+print_help(void)
+{
+ print_revision(progname, NP_VERSION);
+ printf ("Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org)\n");
+ printf(COPYRIGHT, copyright, email);
+
+ printf(_("Host/Service Cluster Plugin for Monitoring"));
+ printf("\n\n");
+
+ print_usage();
+
+ printf("\n");
+ printf("%s\n", _("Options:"));
+ printf(UT_EXTRA_OPTS);
+ printf (" %s\n", "-s, --service");
+ printf (" %s\n", _("Check service cluster status"));
+ printf (" %s\n", "-h, --host");
+ printf (" %s\n", _("Check host cluster status"));
+ printf (" %s\n", "-l, --label=STRING");
+ printf (" %s\n", _("Optional prepended text output (i.e. \"Host cluster\")"));
+ printf (" %s\n", "-w, --warning=THRESHOLD");
+ printf (" %s\n", _("Specifies the range of hosts or services in cluster that must be in a"));
+ printf (" %s\n", _("non-OK state in order to return a WARNING status level"));
+ printf (" %s\n", "-c, --critical=THRESHOLD");
+ printf (" %s\n", _("Specifies the range of hosts or services in cluster that must be in a"));
+ printf (" %s\n", _("non-OK state in order to return a CRITICAL status level"));
+ printf (" %s\n", "-d, --data=LIST");
+ printf (" %s\n", _("The status codes of the hosts or services in the cluster, separated by"));
+ printf (" %s\n", _("commas"));
+
+ printf(UT_VERBOSE);
+
+ printf("\n");
+ printf("%s\n", _("Notes:"));
+ printf(UT_THRESHOLDS_NOTES);
+
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "check_cluster -s -d 2,0,2,0 -c @3:");
+ printf (" %s\n", _("Will alert critical if there are 3 or more service data points in a non-OK") );
+ printf (" %s\n", _("state.") );
+
+ printf(UT_SUPPORT);
+}
+
+
+void
+print_usage(void)
+{
+
+ printf("%s\n", _("Usage:"));
+ printf(" %s (-s | -h) -d val1[,val2,...,valn] [-l label]\n", progname);
+ printf("[-w threshold] [-c threshold] [-v] [--help]\n");
+
+}
+
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
new file mode 100644
index 0000000..153e492
--- /dev/null
+++ b/plugins/check_curl.c
@@ -0,0 +1,2704 @@
+/*****************************************************************************
+*
+* Monitoring check_curl plugin
+*
+* License: GPL
+* Copyright (c) 1999-2019 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_curl plugin
+*
+* This plugin tests the HTTP service on the specified host. It can test
+* normal (http) and secure (https) servers, follow redirects, search for
+* strings and regular expressions, check connection times, and report on
+* certificate expiration times.
+*
+* This plugin uses functions from the curl library, see
+* http://curl.haxx.se
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+const char *progname = "check_curl";
+
+const char *copyright = "2006-2019";
+const char *email = "devel@monitoring-plugins.org";
+
+#include <stdbool.h>
+#include <ctype.h>
+
+#include "common.h"
+#include "utils.h"
+
+#ifndef LIBCURL_PROTOCOL_HTTP
+#error libcurl compiled without HTTP support, compiling check_curl plugin does not makes a lot of sense
+#endif
+
+#include "curl/curl.h"
+#include "curl/easy.h"
+
+#include "picohttpparser.h"
+
+#include "uriparser/Uri.h"
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+#if defined(HAVE_SSL) && defined(USE_OPENSSL)
+#include <openssl/opensslv.h>
+#endif
+
+#include <netdb.h>
+
+#define MAKE_LIBCURL_VERSION(major, minor, patch) ((major)*0x10000 + (minor)*0x100 + (patch))
+
+#define DEFAULT_BUFFER_SIZE 2048
+#define DEFAULT_SERVER_URL "/"
+#define HTTP_EXPECT "HTTP/"
+#define INET_ADDR_MAX_SIZE INET6_ADDRSTRLEN
+enum {
+ MAX_IPV4_HOSTLENGTH = 255,
+ HTTP_PORT = 80,
+ HTTPS_PORT = 443,
+ MAX_PORT = 65535,
+ DEFAULT_MAX_REDIRS = 15
+};
+
+enum {
+ STICKY_NONE = 0,
+ STICKY_HOST = 1,
+ STICKY_PORT = 2
+};
+
+enum {
+ FOLLOW_HTTP_CURL = 0,
+ FOLLOW_LIBCURL = 1
+};
+
+/* for buffers for header and body */
+typedef struct {
+ char *buf;
+ size_t buflen;
+ size_t bufsize;
+} curlhelp_write_curlbuf;
+
+/* for buffering the data sent in PUT */
+typedef struct {
+ char *buf;
+ size_t buflen;
+ off_t pos;
+} curlhelp_read_curlbuf;
+
+/* for parsing the HTTP status line */
+typedef struct {
+ int http_major; /* major version of the protocol, always 1 (HTTP/0.9
+ * never reached the big internet most likely) */
+ int http_minor; /* minor version of the protocol, usually 0 or 1 */
+ int http_code; /* HTTP return code as in RFC 2145 */
+ int http_subcode; /* Microsoft IIS extension, HTTP subcodes, see
+ * http://support.microsoft.com/kb/318380/en-us */
+ const char *msg; /* the human readable message */
+ char *first_line; /* a copy of the first line */
+} curlhelp_statusline;
+
+/* to know the underlying SSL library used by libcurl */
+typedef enum curlhelp_ssl_library {
+ CURLHELP_SSL_LIBRARY_UNKNOWN,
+ CURLHELP_SSL_LIBRARY_OPENSSL,
+ CURLHELP_SSL_LIBRARY_LIBRESSL,
+ CURLHELP_SSL_LIBRARY_GNUTLS,
+ CURLHELP_SSL_LIBRARY_NSS
+} curlhelp_ssl_library;
+
+enum {
+ REGS = 2,
+ MAX_RE_SIZE = 1024
+};
+#include "regex.h"
+regex_t preg;
+regmatch_t pmatch[REGS];
+char regexp[MAX_RE_SIZE];
+int cflags = REG_NOSUB | REG_EXTENDED | REG_NEWLINE;
+int errcode;
+bool invert_regex = false;
+
+char *server_address = NULL;
+char *host_name = NULL;
+char *server_url = 0;
+char server_ip[DEFAULT_BUFFER_SIZE];
+struct curl_slist *server_ips = NULL;
+bool specify_port = false;
+unsigned short server_port = HTTP_PORT;
+unsigned short virtual_port = 0;
+int host_name_length;
+char output_header_search[30] = "";
+char output_string_search[30] = "";
+char *warning_thresholds = NULL;
+char *critical_thresholds = NULL;
+int days_till_exp_warn, days_till_exp_crit;
+thresholds *thlds;
+char user_agent[DEFAULT_BUFFER_SIZE];
+int verbose = 0;
+bool show_extended_perfdata = false;
+bool show_body = false;
+int min_page_len = 0;
+int max_page_len = 0;
+int redir_depth = 0;
+int max_depth = DEFAULT_MAX_REDIRS;
+char *http_method = NULL;
+char *http_post_data = NULL;
+char *http_content_type = NULL;
+CURL *curl;
+bool curl_global_initialized = false;
+bool curl_easy_initialized = false;
+struct curl_slist *header_list = NULL;
+bool body_buf_initialized = false;
+curlhelp_write_curlbuf body_buf;
+bool header_buf_initialized = false;
+curlhelp_write_curlbuf header_buf;
+bool status_line_initialized = false;
+curlhelp_statusline status_line;
+bool put_buf_initialized = false;
+curlhelp_read_curlbuf put_buf;
+char http_header[DEFAULT_BUFFER_SIZE];
+long code;
+long socket_timeout = DEFAULT_SOCKET_TIMEOUT;
+double total_time;
+double time_connect;
+double time_appconnect;
+double time_headers;
+double time_firstbyte;
+char errbuf[MAX_INPUT_BUFFER];
+CURLcode res;
+char url[DEFAULT_BUFFER_SIZE];
+char msg[DEFAULT_BUFFER_SIZE];
+char perfstring[DEFAULT_BUFFER_SIZE];
+char header_expect[MAX_INPUT_BUFFER] = "";
+char string_expect[MAX_INPUT_BUFFER] = "";
+char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT;
+int server_expect_yn = 0;
+char user_auth[MAX_INPUT_BUFFER] = "";
+char proxy_auth[MAX_INPUT_BUFFER] = "";
+char **http_opt_headers;
+int http_opt_headers_count = 0;
+bool display_html = false;
+int onredirect = STATE_OK;
+int followmethod = FOLLOW_HTTP_CURL;
+int followsticky = STICKY_NONE;
+bool use_ssl = false;
+bool use_sni = true;
+bool check_cert = false;
+bool continue_after_check_cert = false;
+typedef union {
+ struct curl_slist* to_info;
+ struct curl_certinfo* to_certinfo;
+} cert_ptr_union;
+cert_ptr_union cert_ptr;
+int ssl_version = CURL_SSLVERSION_DEFAULT;
+char *client_cert = NULL;
+char *client_privkey = NULL;
+char *ca_cert = NULL;
+bool verify_peer_and_host = false;
+bool is_openssl_callback = false;
+#if defined(HAVE_SSL) && defined(USE_OPENSSL)
+X509 *cert = NULL;
+#endif /* defined(HAVE_SSL) && defined(USE_OPENSSL) */
+bool no_body = false;
+int maximum_age = -1;
+int address_family = AF_UNSPEC;
+curlhelp_ssl_library ssl_library = CURLHELP_SSL_LIBRARY_UNKNOWN;
+int curl_http_version = CURL_HTTP_VERSION_NONE;
+bool automatic_decompression = false;
+char *cookie_jar_file = NULL;
+
+bool process_arguments (int, char**);
+void handle_curl_option_return_code (CURLcode res, const char* option);
+int check_http (void);
+void redir (curlhelp_write_curlbuf*);
+char *perfd_time (double microsec);
+char *perfd_time_connect (double microsec);
+char *perfd_time_ssl (double microsec);
+char *perfd_time_firstbyte (double microsec);
+char *perfd_time_headers (double microsec);
+char *perfd_time_transfer (double microsec);
+char *perfd_size (int page_len);
+void print_help (void);
+void print_usage (void);
+void print_curl_version (void);
+int curlhelp_initwritebuffer (curlhelp_write_curlbuf*);
+size_t curlhelp_buffer_write_callback(void*, size_t , size_t , void*);
+void curlhelp_freewritebuffer (curlhelp_write_curlbuf*);
+int curlhelp_initreadbuffer (curlhelp_read_curlbuf *, const char *, size_t);
+size_t curlhelp_buffer_read_callback(void *, size_t , size_t , void *);
+void curlhelp_freereadbuffer (curlhelp_read_curlbuf *);
+curlhelp_ssl_library curlhelp_get_ssl_library ();
+const char* curlhelp_get_ssl_library_string (curlhelp_ssl_library);
+int net_noopenssl_check_certificate (cert_ptr_union*, int, int);
+
+int curlhelp_parse_statusline (const char*, curlhelp_statusline *);
+void curlhelp_free_statusline (curlhelp_statusline *);
+char *get_header_value (const struct phr_header* headers, const size_t nof_headers, const char* header);
+int check_document_dates (const curlhelp_write_curlbuf *, char (*msg)[DEFAULT_BUFFER_SIZE]);
+int get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf);
+
+#if defined(HAVE_SSL) && defined(USE_OPENSSL)
+int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit);
+#endif /* defined(HAVE_SSL) && defined(USE_OPENSSL) */
+
+void remove_newlines (char *);
+void test_file (char *);
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv = np_extra_opts (&argc, argv, progname);
+
+ /* set defaults */
+ snprintf( user_agent, DEFAULT_BUFFER_SIZE, "%s/v%s (monitoring-plugins %s, %s)",
+ progname, NP_VERSION, VERSION, curl_version());
+
+ /* parse arguments */
+ if (process_arguments (argc, argv) == false)
+ usage4 (_("Could not parse arguments"));
+
+ if (display_html)
+ printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">",
+ use_ssl ? "https" : "http",
+ host_name ? host_name : server_address,
+ virtual_port ? virtual_port : server_port,
+ server_url);
+
+ result = check_http ();
+ return result;
+}
+
+#ifdef HAVE_SSL
+#ifdef USE_OPENSSL
+
+int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
+{
+ (void) preverify_ok;
+ /* TODO: we get all certificates of the chain, so which ones
+ * should we test?
+ * TODO: is the last certificate always the server certificate?
+ */
+ cert = X509_STORE_CTX_get_current_cert(x509_ctx);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ X509_up_ref(cert);
+#endif
+ if (verbose>=2) {
+ puts("* SSL verify callback with certificate:");
+ X509_NAME *subject, *issuer;
+ printf("* issuer:\n");
+ issuer = X509_get_issuer_name( cert );
+ X509_NAME_print_ex_fp(stdout, issuer, 5, XN_FLAG_MULTILINE);
+ printf("* curl verify_callback:\n* subject:\n");
+ subject = X509_get_subject_name( cert );
+ X509_NAME_print_ex_fp(stdout, subject, 5, XN_FLAG_MULTILINE);
+ puts("");
+ }
+ return 1;
+}
+
+CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm)
+{
+ (void) curl; // ignore unused parameter
+ (void) parm; // ignore unused parameter
+ SSL_CTX_set_verify(sslctx, SSL_VERIFY_PEER, verify_callback);
+
+ return CURLE_OK;
+}
+
+#endif /* USE_OPENSSL */
+#endif /* HAVE_SSL */
+
+/* returns a string "HTTP/1.x" or "HTTP/2" */
+static char *string_statuscode (int major, int minor)
+{
+ static char buf[10];
+
+ switch (major) {
+ case 1:
+ snprintf (buf, sizeof (buf), "HTTP/%d.%d", major, minor);
+ break;
+ case 2:
+ case 3:
+ snprintf (buf, sizeof (buf), "HTTP/%d", major);
+ break;
+ default:
+ /* assuming here HTTP/N with N>=4 */
+ snprintf (buf, sizeof (buf), "HTTP/%d", major);
+ break;
+ }
+
+ return buf;
+}
+
+/* Checks if the server 'reply' is one of the expected 'statuscodes' */
+static int
+expected_statuscode (const char *reply, const char *statuscodes)
+{
+ char *expected, *code;
+ int result = 0;
+
+ if ((expected = strdup (statuscodes)) == NULL)
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Memory allocation error\n"));
+
+ for (code = strtok (expected, ","); code != NULL; code = strtok (NULL, ","))
+ if (strstr (reply, code) != NULL) {
+ result = 1;
+ break;
+ }
+
+ free (expected);
+ return result;
+}
+
+void
+handle_curl_option_return_code (CURLcode res, const char* option)
+{
+ if (res != CURLE_OK) {
+ snprintf (msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Error while setting cURL option '%s': cURL returned %d - %s"),
+ option,
+ res,
+ curl_easy_strerror(res));
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
+ }
+}
+
+int
+lookup_host (const char *host, char *buf, size_t buflen)
+{
+ struct addrinfo hints, *res, *result;
+ char addrstr[100];
+ size_t addrstr_len;
+ int errcode;
+ void *ptr;
+ size_t buflen_remaining = buflen - 1;
+
+ memset (&hints, 0, sizeof (hints));
+ hints.ai_family = address_family;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags |= AI_CANONNAME;
+
+ errcode = getaddrinfo (host, NULL, &hints, &result);
+ if (errcode != 0)
+ return errcode;
+
+ strcpy(buf, "");
+ res = result;
+
+ while (res) {
+ switch (res->ai_family) {
+ case AF_INET:
+ ptr = &((struct sockaddr_in *) res->ai_addr)->sin_addr;
+ break;
+ case AF_INET6:
+ ptr = &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr;
+ break;
+ }
+
+ inet_ntop (res->ai_family, ptr, addrstr, 100);
+ if (verbose >= 1) {
+ printf ("* getaddrinfo IPv%d address: %s\n",
+ res->ai_family == PF_INET6 ? 6 : 4, addrstr);
+ }
+
+ // Append all IPs to buf as a comma-separated string
+ addrstr_len = strlen(addrstr);
+ if (buflen_remaining > addrstr_len + 1) {
+ if (buf[0] != '\0') {
+ strncat(buf, ",", buflen_remaining);
+ buflen_remaining -= 1;
+ }
+ strncat(buf, addrstr, buflen_remaining);
+ buflen_remaining -= addrstr_len;
+ }
+
+ res = res->ai_next;
+ }
+
+ freeaddrinfo(result);
+
+ return 0;
+}
+
+static void
+cleanup (void)
+{
+ if (status_line_initialized) curlhelp_free_statusline(&status_line);
+ status_line_initialized = false;
+ if (curl_easy_initialized) curl_easy_cleanup (curl);
+ curl_easy_initialized = false;
+ if (curl_global_initialized) curl_global_cleanup ();
+ curl_global_initialized = false;
+ if (body_buf_initialized) curlhelp_freewritebuffer (&body_buf);
+ body_buf_initialized = false;
+ if (header_buf_initialized) curlhelp_freewritebuffer (&header_buf);
+ header_buf_initialized = false;
+ if (put_buf_initialized) curlhelp_freereadbuffer (&put_buf);
+ put_buf_initialized = false;
+}
+
+int
+check_http (void)
+{
+ int result = STATE_OK;
+ int page_len = 0;
+ int i;
+ char *force_host_header = NULL;
+ struct curl_slist *host = NULL;
+ char addrstr[DEFAULT_BUFFER_SIZE/2];
+ char dnscache[DEFAULT_BUFFER_SIZE];
+
+ /* initialize curl */
+ if (curl_global_init (CURL_GLOBAL_DEFAULT) != CURLE_OK)
+ die (STATE_UNKNOWN, "HTTP UNKNOWN - curl_global_init failed\n");
+ curl_global_initialized = true;
+
+ if ((curl = curl_easy_init()) == NULL) {
+ die (STATE_UNKNOWN, "HTTP UNKNOWN - curl_easy_init failed\n");
+ }
+ curl_easy_initialized = true;
+
+ /* register cleanup function to shut down libcurl properly */
+ atexit (cleanup);
+
+ if (verbose >= 1)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_VERBOSE, 1), "CURLOPT_VERBOSE");
+
+ /* print everything on stdout like check_http would do */
+ handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_STDERR, stdout), "CURLOPT_STDERR");
+
+ if (automatic_decompression)
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 21, 6)
+ handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""), "CURLOPT_ACCEPT_ENCODING");
+#else
+ handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_ENCODING, ""), "CURLOPT_ENCODING");
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 21, 6) */
+
+ /* initialize buffer for body of the answer */
+ if (curlhelp_initwritebuffer(&body_buf) < 0)
+ die (STATE_UNKNOWN, "HTTP CRITICAL - out of memory allocating buffer for body\n");
+ body_buf_initialized = true;
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, (curl_write_callback)curlhelp_buffer_write_callback), "CURLOPT_WRITEFUNCTION");
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_WRITEDATA, (void *)&body_buf), "CURLOPT_WRITEDATA");
+
+ /* initialize buffer for header of the answer */
+ if (curlhelp_initwritebuffer( &header_buf ) < 0)
+ die (STATE_UNKNOWN, "HTTP CRITICAL - out of memory allocating buffer for header\n" );
+ header_buf_initialized = true;
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_HEADERFUNCTION, (curl_write_callback)curlhelp_buffer_write_callback), "CURLOPT_HEADERFUNCTION");
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_WRITEHEADER, (void *)&header_buf), "CURLOPT_WRITEHEADER");
+
+ /* set the error buffer */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, errbuf), "CURLOPT_ERRORBUFFER");
+
+ /* set timeouts */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT, socket_timeout), "CURLOPT_CONNECTTIMEOUT");
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_TIMEOUT, socket_timeout), "CURLOPT_TIMEOUT");
+
+ // fill dns resolve cache to make curl connect to the given server_address instead of the host_name, only required for ssl, because we use the host_name later on to make SNI happy
+ if(use_ssl && host_name != NULL) {
+ if ( (res=lookup_host (server_address, addrstr, DEFAULT_BUFFER_SIZE/2)) != 0) {
+ snprintf (msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Unable to lookup IP address for '%s': getaddrinfo returned %d - %s"),
+ server_address,
+ res,
+ gai_strerror (res));
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
+ }
+ snprintf (dnscache, DEFAULT_BUFFER_SIZE, "%s:%d:%s", host_name, server_port, addrstr);
+ host = curl_slist_append(NULL, dnscache);
+ curl_easy_setopt(curl, CURLOPT_RESOLVE, host);
+ if (verbose>=1)
+ printf ("* curl CURLOPT_RESOLVE: %s\n", dnscache);
+ }
+
+ // If server_address is an IPv6 address it must be surround by square brackets
+ struct in6_addr tmp_in_addr;
+ if (inet_pton(AF_INET6, server_address, &tmp_in_addr) == 1) {
+ char *new_server_address = malloc(strlen(server_address) + 3);
+ if (new_server_address == NULL) {
+ die(STATE_UNKNOWN, "HTTP UNKNOWN - Unable to allocate memory\n");
+ }
+ snprintf(new_server_address, strlen(server_address)+3, "[%s]", server_address);
+ free(server_address);
+ server_address = new_server_address;
+ }
+
+ /* compose URL: use the address we want to connect to, set Host: header later */
+ snprintf (url, DEFAULT_BUFFER_SIZE, "%s://%s:%d%s",
+ use_ssl ? "https" : "http",
+ ( use_ssl & ( host_name != NULL ) ) ? host_name : server_address,
+ server_port,
+ server_url
+ );
+
+ if (verbose>=1)
+ printf ("* curl CURLOPT_URL: %s\n", url);
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_URL, url), "CURLOPT_URL");
+
+ /* extract proxy information for legacy proxy https requests */
+ if (!strcmp(http_method, "CONNECT") || strstr(server_url, "http") == server_url) {
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXY, server_address), "CURLOPT_PROXY");
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXYPORT, (long)server_port), "CURLOPT_PROXYPORT");
+ if (verbose>=2)
+ printf ("* curl CURLOPT_PROXY: %s:%d\n", server_address, server_port);
+ http_method = "GET";
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_URL, server_url), "CURLOPT_URL");
+ }
+
+ /* disable body for HEAD request */
+ if (http_method && !strcmp (http_method, "HEAD" )) {
+ no_body = true;
+ }
+
+ /* set HTTP protocol version */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_HTTP_VERSION, curl_http_version), "CURLOPT_HTTP_VERSION");
+
+ /* set HTTP method */
+ if (http_method) {
+ if (!strcmp(http_method, "POST"))
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_POST, 1), "CURLOPT_POST");
+ else if (!strcmp(http_method, "PUT"))
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_UPLOAD, 1), "CURLOPT_UPLOAD");
+ else
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CUSTOMREQUEST, http_method), "CURLOPT_CUSTOMREQUEST");
+ }
+
+ /* check if Host header is explicitly set in options */
+ if (http_opt_headers_count) {
+ for (i = 0; i < http_opt_headers_count ; i++) {
+ if (strncmp(http_opt_headers[i], "Host:", 5) == 0) {
+ force_host_header = http_opt_headers[i];
+ }
+ }
+ }
+
+ /* set hostname (virtual hosts), not needed if CURLOPT_CONNECT_TO is used, but left in anyway */
+ if(host_name != NULL && force_host_header == NULL) {
+ if((virtual_port != HTTP_PORT && !use_ssl) || (virtual_port != HTTPS_PORT && use_ssl)) {
+ snprintf(http_header, DEFAULT_BUFFER_SIZE, "Host: %s:%d", host_name, virtual_port);
+ } else {
+ snprintf(http_header, DEFAULT_BUFFER_SIZE, "Host: %s", host_name);
+ }
+ header_list = curl_slist_append (header_list, http_header);
+ }
+
+ /* always close connection, be nice to servers */
+ snprintf (http_header, DEFAULT_BUFFER_SIZE, "Connection: close");
+ header_list = curl_slist_append (header_list, http_header);
+
+ /* attach additional headers supplied by the user */
+ /* optionally send any other header tag */
+ if (http_opt_headers_count) {
+ for (i = 0; i < http_opt_headers_count ; i++) {
+ header_list = curl_slist_append (header_list, http_opt_headers[i]);
+ }
+ /* This cannot be free'd here because a redirection will then try to access this and segfault */
+ /* Covered in a testcase in tests/check_http.t */
+ /* free(http_opt_headers); */
+ }
+
+ /* set HTTP headers */
+ handle_curl_option_return_code (curl_easy_setopt( curl, CURLOPT_HTTPHEADER, header_list ), "CURLOPT_HTTPHEADER");
+
+#ifdef LIBCURL_FEATURE_SSL
+
+ /* set SSL version, warn about insecure or unsupported versions */
+ if (use_ssl) {
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_SSLVERSION, ssl_version), "CURLOPT_SSLVERSION");
+ }
+
+ /* client certificate and key to present to server (SSL) */
+ if (client_cert)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_SSLCERT, client_cert), "CURLOPT_SSLCERT");
+ if (client_privkey)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_SSLKEY, client_privkey), "CURLOPT_SSLKEY");
+ if (ca_cert) {
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CAINFO, ca_cert), "CURLOPT_CAINFO");
+ }
+ if (ca_cert || verify_peer_and_host) {
+ /* per default if we have a CA verify both the peer and the
+ * hostname in the certificate, can be switched off later */
+ handle_curl_option_return_code (curl_easy_setopt( curl, CURLOPT_SSL_VERIFYPEER, 1), "CURLOPT_SSL_VERIFYPEER");
+ handle_curl_option_return_code (curl_easy_setopt( curl, CURLOPT_SSL_VERIFYHOST, 2), "CURLOPT_SSL_VERIFYHOST");
+ } else {
+ /* backward-compatible behaviour, be tolerant in checks
+ * TODO: depending on more options have aspects we want
+ * to be less tolerant about ssl verfications
+ */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0), "CURLOPT_SSL_VERIFYPEER");
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0), "CURLOPT_SSL_VERIFYHOST");
+ }
+
+ /* detect SSL library used by libcurl */
+ ssl_library = curlhelp_get_ssl_library ();
+
+ /* try hard to get a stack of certificates to verify against */
+ if (check_cert) {
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 1)
+ /* inform curl to report back certificates */
+ switch (ssl_library) {
+ case CURLHELP_SSL_LIBRARY_OPENSSL:
+ case CURLHELP_SSL_LIBRARY_LIBRESSL:
+ /* set callback to extract certificate with OpenSSL context function (works with
+ * OpenSSL-style libraries only!) */
+#ifdef USE_OPENSSL
+ /* libcurl and monitoring plugins built with OpenSSL, good */
+ handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun), "CURLOPT_SSL_CTX_FUNCTION");
+ is_openssl_callback = true;
+#else /* USE_OPENSSL */
+#endif /* USE_OPENSSL */
+ /* libcurl is built with OpenSSL, monitoring plugins, so falling
+ * back to manually extracting certificate information */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CERTINFO, 1L), "CURLOPT_CERTINFO");
+ break;
+
+ case CURLHELP_SSL_LIBRARY_NSS:
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0)
+ /* NSS: support for CERTINFO is implemented since 7.34.0 */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CERTINFO, 1L), "CURLOPT_CERTINFO");
+#else /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0) */
+ die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates (libcurl linked with SSL library '%s' is too old)\n", curlhelp_get_ssl_library_string (ssl_library));
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0) */
+ break;
+
+ case CURLHELP_SSL_LIBRARY_GNUTLS:
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 42, 0)
+ /* GnuTLS: support for CERTINFO is implemented since 7.42.0 */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_CERTINFO, 1L), "CURLOPT_CERTINFO");
+#else /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 42, 0) */
+ die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates (libcurl linked with SSL library '%s' is too old)\n", curlhelp_get_ssl_library_string (ssl_library));
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 42, 0) */
+ break;
+
+ case CURLHELP_SSL_LIBRARY_UNKNOWN:
+ default:
+ die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates (unknown SSL library '%s', must implement first)\n", curlhelp_get_ssl_library_string (ssl_library));
+ break;
+ }
+#else /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 1) */
+ /* old libcurl, our only hope is OpenSSL, otherwise we are out of luck */
+ if (ssl_library == CURLHELP_SSL_LIBRARY_OPENSSL || ssl_library == CURLHELP_SSL_LIBRARY_LIBRESSL)
+ handle_curl_option_return_code (curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun), "CURLOPT_SSL_CTX_FUNCTION");
+ else
+ die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates (no CURLOPT_SSL_CTX_FUNCTION, no OpenSSL library or libcurl too old and has no CURLOPT_CERTINFO)\n");
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 1) */
+ }
+
+#endif /* LIBCURL_FEATURE_SSL */
+
+ /* set default or user-given user agent identification */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_USERAGENT, user_agent), "CURLOPT_USERAGENT");
+
+ /* proxy-authentication */
+ if (strcmp(proxy_auth, ""))
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXYUSERPWD, proxy_auth), "CURLOPT_PROXYUSERPWD");
+
+ /* authentication */
+ if (strcmp(user_auth, ""))
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_USERPWD, user_auth), "CURLOPT_USERPWD");
+
+ /* TODO: parameter auth method, bitfield of following methods:
+ * CURLAUTH_BASIC (default)
+ * CURLAUTH_DIGEST
+ * CURLAUTH_DIGEST_IE
+ * CURLAUTH_NEGOTIATE
+ * CURLAUTH_NTLM
+ * CURLAUTH_NTLM_WB
+ *
+ * convenience tokens for typical sets of methods:
+ * CURLAUTH_ANYSAFE: most secure, without BASIC
+ * or CURLAUTH_ANY: most secure, even BASIC if necessary
+ *
+ * handle_curl_option_return_code (curl_easy_setopt( curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST ), "CURLOPT_HTTPAUTH");
+ */
+
+ /* handle redirections */
+ if (onredirect == STATE_DEPENDENT) {
+ if( followmethod == FOLLOW_LIBCURL ) {
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1), "CURLOPT_FOLLOWLOCATION");
+
+ /* default -1 is infinite, not good, could lead to zombie plugins!
+ Setting it to one bigger than maximal limit to handle errors nicely below
+ */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_MAXREDIRS, max_depth+1), "CURLOPT_MAXREDIRS");
+
+ /* for now allow only http and https (we are a http(s) check plugin in the end) */
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 85, 0)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https"), "CURLOPT_REDIR_PROTOCOLS_STR");
+#elif LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 19, 4)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS), "CURLOPT_REDIRECT_PROTOCOLS");
+#endif
+
+ /* TODO: handle the following aspects of redirection, make them
+ * command line options too later:
+ CURLOPT_POSTREDIR: method switch
+ CURLINFO_REDIRECT_URL: custom redirect option
+ CURLOPT_REDIRECT_PROTOCOLS: allow people to step outside safe protocols
+ CURLINFO_REDIRECT_COUNT: get the number of redirects, print it, maybe a range option here is nice like for expected page size?
+ */
+ } else {
+ /* old style redirection is handled below */
+ }
+ }
+
+ /* no-body */
+ if (no_body)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_NOBODY, 1), "CURLOPT_NOBODY");
+
+ /* IPv4 or IPv6 forced DNS resolution */
+ if (address_family == AF_UNSPEC)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER), "CURLOPT_IPRESOLVE(CURL_IPRESOLVE_WHATEVER)");
+ else if (address_family == AF_INET)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4), "CURLOPT_IPRESOLVE(CURL_IPRESOLVE_V4)");
+#if defined (USE_IPV6) && defined (LIBCURL_FEATURE_IPV6)
+ else if (address_family == AF_INET6)
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6), "CURLOPT_IPRESOLVE(CURL_IPRESOLVE_V6)");
+#endif
+
+ /* either send http POST data (any data, not only POST)*/
+ if (!strcmp(http_method, "POST") ||!strcmp(http_method, "PUT")) {
+ /* set content of payload for POST and PUT */
+ if (http_content_type) {
+ snprintf (http_header, DEFAULT_BUFFER_SIZE, "Content-Type: %s", http_content_type);
+ header_list = curl_slist_append (header_list, http_header);
+ }
+ /* NULL indicates "HTTP Continue" in libcurl, provide an empty string
+ * in case of no POST/PUT data */
+ if (!http_post_data)
+ http_post_data = "";
+ if (!strcmp(http_method, "POST")) {
+ /* POST method, set payload with CURLOPT_POSTFIELDS */
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_POSTFIELDS, http_post_data), "CURLOPT_POSTFIELDS");
+ } else if (!strcmp(http_method, "PUT")) {
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_READFUNCTION, (curl_read_callback)curlhelp_buffer_read_callback), "CURLOPT_READFUNCTION");
+ if (curlhelp_initreadbuffer (&put_buf, http_post_data, strlen (http_post_data)) < 0)
+ die (STATE_UNKNOWN, "HTTP CRITICAL - out of memory allocating read buffer for PUT\n");
+ put_buf_initialized = true;
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_READDATA, (void *)&put_buf), "CURLOPT_READDATA");
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_INFILESIZE, (curl_off_t)strlen (http_post_data)), "CURLOPT_INFILESIZE");
+ }
+ }
+
+ /* cookie handling */
+ if (cookie_jar_file != NULL) {
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_COOKIEJAR, cookie_jar_file), "CURLOPT_COOKIEJAR");
+ handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_COOKIEFILE, cookie_jar_file), "CURLOPT_COOKIEFILE");
+ }
+
+ /* do the request */
+ res = curl_easy_perform(curl);
+
+ if (verbose>=2 && http_post_data)
+ printf ("**** REQUEST CONTENT ****\n%s\n", http_post_data);
+
+ /* free header and server IP resolve lists, we don't need it anymore */
+ curl_slist_free_all (header_list); header_list = NULL;
+ curl_slist_free_all (server_ips); server_ips = NULL;
+ if (host) {
+ curl_slist_free_all (host); host = NULL;
+ }
+
+ /* Curl errors, result in critical Nagios state */
+ if (res != CURLE_OK) {
+ snprintf (msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Invalid HTTP response received from host on port %d: cURL returned %d - %s"),
+ server_port,
+ res,
+ errbuf[0] ? errbuf : curl_easy_strerror(res));
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
+ }
+
+ /* certificate checks */
+#ifdef LIBCURL_FEATURE_SSL
+ if (use_ssl) {
+ if (check_cert) {
+ if (is_openssl_callback) {
+#ifdef USE_OPENSSL
+ /* check certificate with OpenSSL functions, curl has been built against OpenSSL
+ * and we actually have OpenSSL in the monitoring tools
+ */
+ result = np_net_ssl_check_certificate(cert, days_till_exp_warn, days_till_exp_crit);
+ if (!continue_after_check_cert) {
+ return result;
+ }
+#else /* USE_OPENSSL */
+ die (STATE_CRITICAL, "HTTP CRITICAL - Cannot retrieve certificates - OpenSSL callback used and not linked against OpenSSL\n");
+#endif /* USE_OPENSSL */
+ } else {
+ int i;
+ struct curl_slist *slist;
+
+ cert_ptr.to_info = NULL;
+ res = curl_easy_getinfo (curl, CURLINFO_CERTINFO, &cert_ptr.to_info);
+ if (!res && cert_ptr.to_info) {
+#ifdef USE_OPENSSL
+ /* We have no OpenSSL in libcurl, but we can use OpenSSL for X509 cert parsing
+ * We only check the first certificate and assume it's the one of the server
+ */
+ const char* raw_cert = NULL;
+ for (i = 0; i < cert_ptr.to_certinfo->num_of_certs; i++) {
+ for (slist = cert_ptr.to_certinfo->certinfo[i]; slist; slist = slist->next) {
+ if (verbose >= 2)
+ printf ("%d ** %s\n", i, slist->data);
+ if (strncmp (slist->data, "Cert:", 5) == 0) {
+ raw_cert = &slist->data[5];
+ goto GOT_FIRST_CERT;
+ }
+ }
+ }
+GOT_FIRST_CERT:
+ if (!raw_cert) {
+ snprintf (msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Cannot retrieve certificates from CERTINFO information - certificate data was empty"));
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
+ }
+ BIO* cert_BIO = BIO_new (BIO_s_mem());
+ BIO_write (cert_BIO, raw_cert, strlen(raw_cert));
+ cert = PEM_read_bio_X509 (cert_BIO, NULL, NULL, NULL);
+ if (!cert) {
+ snprintf (msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Cannot read certificate from CERTINFO information - BIO error"));
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
+ }
+ BIO_free (cert_BIO);
+ result = np_net_ssl_check_certificate(cert, days_till_exp_warn, days_till_exp_crit);
+ if (!continue_after_check_cert) {
+ return result;
+ }
+#else /* USE_OPENSSL */
+ /* We assume we don't have OpenSSL and np_net_ssl_check_certificate at our disposal,
+ * so we use the libcurl CURLINFO data
+ */
+ result = net_noopenssl_check_certificate(&cert_ptr, days_till_exp_warn, days_till_exp_crit);
+ if (!continue_after_check_cert) {
+ return result;
+ }
+#endif /* USE_OPENSSL */
+ } else {
+ snprintf (msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Cannot retrieve certificates - cURL returned %d - %s"),
+ res,
+ curl_easy_strerror(res));
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
+ }
+ }
+ }
+ }
+#endif /* LIBCURL_FEATURE_SSL */
+
+ /* we got the data and we executed the request in a given time, so we can append
+ * performance data to the answer always
+ */
+ handle_curl_option_return_code (curl_easy_getinfo (curl, CURLINFO_TOTAL_TIME, &total_time), "CURLINFO_TOTAL_TIME");
+ page_len = get_content_length(&header_buf, &body_buf);
+ if(show_extended_perfdata) {
+ handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &time_connect), "CURLINFO_CONNECT_TIME");
+ handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &time_appconnect), "CURLINFO_APPCONNECT_TIME");
+ handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, &time_headers), "CURLINFO_PRETRANSFER_TIME");
+ handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &time_firstbyte), "CURLINFO_STARTTRANSFER_TIME");
+ snprintf(perfstring, DEFAULT_BUFFER_SIZE, "%s %s %s %s %s %s %s",
+ perfd_time(total_time),
+ perfd_size(page_len),
+ perfd_time_connect(time_connect),
+ use_ssl ? perfd_time_ssl (time_appconnect-time_connect) : "",
+ perfd_time_headers(time_headers - time_appconnect),
+ perfd_time_firstbyte(time_firstbyte - time_headers),
+ perfd_time_transfer(total_time-time_firstbyte)
+ );
+ } else {
+ snprintf(perfstring, DEFAULT_BUFFER_SIZE, "%s %s",
+ perfd_time(total_time),
+ perfd_size(page_len)
+ );
+ }
+
+ /* return a CRITICAL status if we couldn't read any data */
+ if (strlen(header_buf.buf) == 0 && strlen(body_buf.buf) == 0)
+ die (STATE_CRITICAL, _("HTTP CRITICAL - No header received from host\n"));
+
+ /* get status line of answer, check sanity of HTTP code */
+ if (curlhelp_parse_statusline (header_buf.buf, &status_line) < 0) {
+ snprintf (msg,
+ DEFAULT_BUFFER_SIZE,
+ "Unparsable status line in %.3g seconds response time|%s\n",
+ total_time,
+ perfstring);
+ /* we cannot know the major/minor version here for sure as we cannot parse the first line */
+ die (STATE_CRITICAL, "HTTP CRITICAL HTTP/x.x %ld unknown - %s", code, msg);
+ }
+ status_line_initialized = true;
+
+ /* get result code from cURL */
+ handle_curl_option_return_code (curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &code), "CURLINFO_RESPONSE_CODE");
+ if (verbose>=2)
+ printf ("* curl CURLINFO_RESPONSE_CODE is %ld\n", code);
+
+ /* print status line, header, body if verbose */
+ if (verbose >= 2) {
+ printf ("**** HEADER ****\n%s\n**** CONTENT ****\n%s\n", header_buf.buf,
+ (no_body ? " [[ skipped ]]" : body_buf.buf));
+ }
+
+ /* make sure the status line matches the response we are looking for */
+ if (!expected_statuscode(status_line.first_line, server_expect)) {
+ if (server_port == HTTP_PORT)
+ snprintf(msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Invalid HTTP response received from host: %s\n"),
+ status_line.first_line);
+ else
+ snprintf(msg,
+ DEFAULT_BUFFER_SIZE,
+ _("Invalid HTTP response received from host on port %d: %s\n"),
+ server_port,
+ status_line.first_line);
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s%s%s", msg,
+ show_body ? "\n" : "",
+ show_body ? body_buf.buf : "");
+ }
+
+ if( server_expect_yn ) {
+ snprintf(msg, DEFAULT_BUFFER_SIZE, _("Status line output matched \"%s\" - "), server_expect);
+ if (verbose)
+ printf ("%s\n",msg);
+ result = STATE_OK;
+ }
+ else {
+ /* illegal return codes result in a critical state */
+ if (code >= 600 || code < 100) {
+ die (STATE_CRITICAL, _("HTTP CRITICAL: Invalid Status (%d, %.40s)\n"), status_line.http_code, status_line.msg);
+ /* server errors result in a critical state */
+ } else if (code >= 500) {
+ result = STATE_CRITICAL;
+ /* client errors result in a warning state */
+ } else if (code >= 400) {
+ result = STATE_WARNING;
+ /* check redirected page if specified */
+ } else if (code >= 300) {
+ if (onredirect == STATE_DEPENDENT) {
+ if( followmethod == FOLLOW_LIBCURL ) {
+ code = status_line.http_code;
+ } else {
+ /* old check_http style redirection, if we come
+ * back here, we are in the same status as with
+ * the libcurl method
+ */
+ redir (&header_buf);
+ }
+ } else {
+ /* this is a specific code in the command line to
+ * be returned when a redirection is encountered
+ */
+ }
+ result = max_state_alt (onredirect, result);
+ /* all other codes are considered ok */
+ } else {
+ result = STATE_OK;
+ }
+ }
+
+ /* libcurl redirection internally, handle error states here */
+ if( followmethod == FOLLOW_LIBCURL ) {
+ handle_curl_option_return_code (curl_easy_getinfo (curl, CURLINFO_REDIRECT_COUNT, &redir_depth), "CURLINFO_REDIRECT_COUNT");
+ if (verbose >= 2)
+ printf(_("* curl LIBINFO_REDIRECT_COUNT is %d\n"), redir_depth);
+ if (redir_depth > max_depth) {
+ snprintf (msg, DEFAULT_BUFFER_SIZE, "maximum redirection depth %d exceeded in libcurl",
+ max_depth);
+ die (STATE_WARNING, "HTTP WARNING - %s", msg);
+ }
+ }
+
+ /* check status codes, set exit status accordingly */
+ if( status_line.http_code != code ) {
+ die (STATE_CRITICAL, _("HTTP CRITICAL %s %d %s - different HTTP codes (cUrl has %ld)\n"),
+ string_statuscode (status_line.http_major, status_line.http_minor),
+ status_line.http_code, status_line.msg, code);
+ }
+
+ if (maximum_age >= 0) {
+ result = max_state_alt(check_document_dates(&header_buf, &msg), result);
+ }
+
+ /* Page and Header content checks go here */
+
+ if (strlen (header_expect)) {
+ if (!strstr (header_buf.buf, header_expect)) {
+
+ strncpy(&output_header_search[0],header_expect,sizeof(output_header_search));
+
+ if(output_header_search[sizeof(output_header_search)-1]!='\0') {
+ bcopy("...",&output_header_search[sizeof(output_header_search)-4],4);
+ }
+
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp,
+ DEFAULT_BUFFER_SIZE,
+ _("%sheader '%s' not found on '%s://%s:%d%s', "),
+ msg,
+ output_header_search,
+ use_ssl ? "https" : "http",
+ host_name ? host_name : server_address,
+ server_port,
+ server_url);
+
+ strcpy(msg, tmp);
+
+ result = STATE_CRITICAL;
+ }
+ }
+
+ if (strlen (string_expect)) {
+ if (!strstr (body_buf.buf, string_expect)) {
+
+ strncpy(&output_string_search[0],string_expect,sizeof(output_string_search));
+
+ if(output_string_search[sizeof(output_string_search)-1]!='\0') {
+ bcopy("...",&output_string_search[sizeof(output_string_search)-4],4);
+ }
+
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp,
+ DEFAULT_BUFFER_SIZE,
+ _("%sstring '%s' not found on '%s://%s:%d%s', "),
+ msg,
+ output_string_search,
+ use_ssl ? "https" : "http",
+ host_name ? host_name : server_address,
+ server_port,
+ server_url);
+
+ strcpy(msg, tmp);
+
+ result = STATE_CRITICAL;
+ }
+ }
+
+ if (strlen (regexp)) {
+ errcode = regexec (&preg, body_buf.buf, REGS, pmatch, 0);
+ if ((errcode == 0 && !invert_regex) || (errcode == REG_NOMATCH && invert_regex)) {
+ /* OK - No-op to avoid changing the logic around it */
+ result = max_state_alt(STATE_OK, result);
+ }
+ else if ((errcode == REG_NOMATCH && !invert_regex) || (errcode == 0 && invert_regex)) {
+ if (!invert_regex) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%spattern not found, "), msg);
+ strcpy(msg, tmp);
+
+ } else {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%spattern found, "), msg);
+ strcpy(msg, tmp);
+
+ }
+ result = STATE_CRITICAL;
+ } else {
+ regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
+
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sExecute Error: %s, "), msg, errbuf);
+ strcpy(msg, tmp);
+ result = STATE_UNKNOWN;
+ }
+ }
+
+ /* make sure the page is of an appropriate size */
+ if ((max_page_len > 0) && (page_len > max_page_len)) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%spage size %d too large, "), msg, page_len);
+
+ strcpy(msg, tmp);
+
+ result = max_state_alt(STATE_WARNING, result);
+
+ } else if ((min_page_len > 0) && (page_len < min_page_len)) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%spage size %d too small, "), msg, page_len);
+ strcpy(msg, tmp);
+ result = max_state_alt(STATE_WARNING, result);
+ }
+
+ /* -w, -c: check warning and critical level */
+ result = max_state_alt(get_status(total_time, thlds), result);
+
+ /* Cut-off trailing characters */
+ if (strlen(msg) >= 2) {
+ if(msg[strlen(msg)-2] == ',')
+ msg[strlen(msg)-2] = '\0';
+ else
+ msg[strlen(msg)-3] = '\0';
+ }
+
+ /* TODO: separate _() msg and status code: die (result, "HTTP %s: %s\n", state_text(result), msg); */
+ die (result, "HTTP %s: %s %d %s%s%s - %d bytes in %.3f second response time %s|%s\n%s%s",
+ state_text(result), string_statuscode (status_line.http_major, status_line.http_minor),
+ status_line.http_code, status_line.msg,
+ strlen(msg) > 0 ? " - " : "",
+ msg, page_len, total_time,
+ (display_html ? "</A>" : ""),
+ perfstring,
+ (show_body ? body_buf.buf : ""),
+ (show_body ? "\n" : "") );
+
+ return result;
+}
+
+int
+uri_strcmp (const UriTextRangeA range, const char* s)
+{
+ if (!range.first) return -1;
+ if (range.afterLast - range.first < strlen (s)) return -1;
+ return strncmp (s, range.first, min( range.afterLast - range.first, strlen (s)));
+}
+
+char*
+uri_string (const UriTextRangeA range, char* buf, size_t buflen)
+{
+ if (!range.first) return "(null)";
+ strncpy (buf, range.first, max (buflen-1, range.afterLast - range.first));
+ buf[max (buflen-1, range.afterLast - range.first)] = '\0';
+ buf[range.afterLast - range.first] = '\0';
+ return buf;
+}
+
+void
+redir (curlhelp_write_curlbuf* header_buf)
+{
+ char *location = NULL;
+ curlhelp_statusline status_line;
+ struct phr_header headers[255];
+ size_t nof_headers = 255;
+ size_t msglen;
+ char buf[DEFAULT_BUFFER_SIZE];
+ char ipstr[INET_ADDR_MAX_SIZE];
+ int new_port;
+ char *new_host;
+ char *new_url;
+
+ int res = phr_parse_response (header_buf->buf, header_buf->buflen,
+ &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
+ headers, &nof_headers, 0);
+
+ if (res == -1) {
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
+ }
+
+ location = get_header_value (headers, nof_headers, "location");
+
+ if (verbose >= 2)
+ printf(_("* Seen redirect location %s\n"), location);
+
+ if (++redir_depth > max_depth)
+ die (STATE_WARNING,
+ _("HTTP WARNING - maximum redirection depth %d exceeded - %s%s\n"),
+ max_depth, location, (display_html ? "</A>" : ""));
+
+ UriParserStateA state;
+ UriUriA uri;
+ state.uri = &uri;
+ if (uriParseUriA (&state, location) != URI_SUCCESS) {
+ if (state.errorCode == URI_ERROR_SYNTAX) {
+ die (STATE_UNKNOWN,
+ _("HTTP UNKNOWN - Could not parse redirect location '%s'%s\n"),
+ location, (display_html ? "</A>" : ""));
+ } else if (state.errorCode == URI_ERROR_MALLOC) {
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate URL\n"));
+ }
+ }
+
+ if (verbose >= 2) {
+ printf (_("** scheme: %s\n"),
+ uri_string (uri.scheme, buf, DEFAULT_BUFFER_SIZE));
+ printf (_("** host: %s\n"),
+ uri_string (uri.hostText, buf, DEFAULT_BUFFER_SIZE));
+ printf (_("** port: %s\n"),
+ uri_string (uri.portText, buf, DEFAULT_BUFFER_SIZE));
+ if (uri.hostData.ip4) {
+ inet_ntop (AF_INET, uri.hostData.ip4->data, ipstr, sizeof (ipstr));
+ printf (_("** IPv4: %s\n"), ipstr);
+ }
+ if (uri.hostData.ip6) {
+ inet_ntop (AF_INET, uri.hostData.ip6->data, ipstr, sizeof (ipstr));
+ printf (_("** IPv6: %s\n"), ipstr);
+ }
+ if (uri.pathHead) {
+ printf (_("** path: "));
+ const UriPathSegmentA* p = uri.pathHead;
+ for (; p; p = p->next) {
+ printf ("/%s", uri_string (p->text, buf, DEFAULT_BUFFER_SIZE));
+ }
+ puts ("");
+ }
+ if (uri.query.first) {
+ printf (_("** query: %s\n"),
+ uri_string (uri.query, buf, DEFAULT_BUFFER_SIZE));
+ }
+ if (uri.fragment.first) {
+ printf (_("** fragment: %s\n"),
+ uri_string (uri.fragment, buf, DEFAULT_BUFFER_SIZE));
+ }
+ }
+
+ if (!uri_strcmp (uri.scheme, "https"))
+ use_ssl = true;
+ else
+ use_ssl = false;
+
+ /* we do a sloppy test here only, because uriparser would have failed
+ * above, if the port would be invalid, we just check for MAX_PORT
+ */
+ if (uri.portText.first) {
+ new_port = atoi (uri_string (uri.portText, buf, DEFAULT_BUFFER_SIZE));
+ } else {
+ new_port = HTTP_PORT;
+ if (use_ssl)
+ new_port = HTTPS_PORT;
+ }
+ if (new_port > MAX_PORT)
+ die (STATE_UNKNOWN,
+ _("HTTP UNKNOWN - Redirection to port above %d - %s%s\n"),
+ MAX_PORT, location, display_html ? "</A>" : "");
+
+ /* by RFC 7231 relative URLs in Location should be taken relative to
+ * the original URL, so wy try to form a new absolute URL here
+ */
+ if (!uri.scheme.first && !uri.hostText.first) {
+ new_host = strdup (host_name ? host_name : server_address);
+ } else {
+ new_host = strdup (uri_string (uri.hostText, buf, DEFAULT_BUFFER_SIZE));
+ }
+
+ /* compose new path */
+ /* TODO: handle fragments and query part of URL */
+ new_url = (char *)calloc( 1, DEFAULT_BUFFER_SIZE);
+ if (uri.pathHead) {
+ const UriPathSegmentA* p = uri.pathHead;
+ for (; p; p = p->next) {
+ strncat (new_url, "/", DEFAULT_BUFFER_SIZE);
+ strncat (new_url, uri_string (p->text, buf, DEFAULT_BUFFER_SIZE), DEFAULT_BUFFER_SIZE-1);
+ }
+ }
+
+ if (server_port==new_port &&
+ !strncmp(server_address, new_host, MAX_IPV4_HOSTLENGTH) &&
+ (host_name && !strncmp(host_name, new_host, MAX_IPV4_HOSTLENGTH)) &&
+ !strcmp(server_url, new_url))
+ die (STATE_CRITICAL,
+ _("HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"),
+ use_ssl ? "https" : "http", new_host, new_port, new_url, (display_html ? "</A>" : ""));
+
+ /* set new values for redirected request */
+
+ if (!(followsticky & STICKY_HOST)) {
+ free (server_address);
+ server_address = strndup (new_host, MAX_IPV4_HOSTLENGTH);
+ }
+ if (!(followsticky & STICKY_PORT)) {
+ server_port = (unsigned short)new_port;
+ }
+
+ free (host_name);
+ host_name = strndup (new_host, MAX_IPV4_HOSTLENGTH);
+
+ /* reset virtual port */
+ virtual_port = server_port;
+
+ free(new_host);
+ free (server_url);
+ server_url = new_url;
+
+ uriFreeUriMembersA (&uri);
+
+ if (verbose)
+ printf (_("Redirection to %s://%s:%d%s\n"), use_ssl ? "https" : "http",
+ host_name ? host_name : server_address, server_port, server_url);
+
+ /* TODO: the hash component MUST be taken from the original URL and
+ * attached to the URL in Location
+ */
+
+ cleanup ();
+ check_http ();
+}
+
+/* check whether a file exists */
+void
+test_file (char *path)
+{
+ if (access(path, R_OK) == 0)
+ return;
+ usage2 (_("file does not exist or is not readable"), path);
+}
+
+bool
+process_arguments (int argc, char **argv)
+{
+ char *p;
+ int c = 1;
+ char *temp;
+
+ enum {
+ INVERT_REGEX = CHAR_MAX + 1,
+ SNI_OPTION,
+ MAX_REDIRS_OPTION,
+ CONTINUE_AFTER_CHECK_CERT,
+ CA_CERT_OPTION,
+ HTTP_VERSION_OPTION,
+ AUTOMATIC_DECOMPRESSION,
+ COOKIE_JAR
+ };
+
+ int option = 0;
+ int got_plus = 0;
+ static struct option longopts[] = {
+ STD_LONG_OPTS,
+ {"link", no_argument, 0, 'L'},
+ {"nohtml", no_argument, 0, 'n'},
+ {"ssl", optional_argument, 0, 'S'},
+ {"sni", no_argument, 0, SNI_OPTION},
+ {"post", required_argument, 0, 'P'},
+ {"method", required_argument, 0, 'j'},
+ {"IP-address", required_argument, 0, 'I'},
+ {"url", required_argument, 0, 'u'},
+ {"port", required_argument, 0, 'p'},
+ {"authorization", required_argument, 0, 'a'},
+ {"proxy-authorization", required_argument, 0, 'b'},
+ {"header-string", required_argument, 0, 'd'},
+ {"string", required_argument, 0, 's'},
+ {"expect", required_argument, 0, 'e'},
+ {"regex", required_argument, 0, 'r'},
+ {"ereg", required_argument, 0, 'r'},
+ {"eregi", required_argument, 0, 'R'},
+ {"linespan", no_argument, 0, 'l'},
+ {"onredirect", required_argument, 0, 'f'},
+ {"certificate", required_argument, 0, 'C'},
+ {"client-cert", required_argument, 0, 'J'},
+ {"private-key", required_argument, 0, 'K'},
+ {"ca-cert", required_argument, 0, CA_CERT_OPTION},
+ {"verify-cert", no_argument, 0, 'D'},
+ {"continue-after-certificate", no_argument, 0, CONTINUE_AFTER_CHECK_CERT},
+ {"useragent", required_argument, 0, 'A'},
+ {"header", required_argument, 0, 'k'},
+ {"no-body", no_argument, 0, 'N'},
+ {"max-age", required_argument, 0, 'M'},
+ {"content-type", required_argument, 0, 'T'},
+ {"pagesize", required_argument, 0, 'm'},
+ {"invert-regex", no_argument, NULL, INVERT_REGEX},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"extended-perfdata", no_argument, 0, 'E'},
+ {"show-body", no_argument, 0, 'B'},
+ {"max-redirs", required_argument, 0, MAX_REDIRS_OPTION},
+ {"http-version", required_argument, 0, HTTP_VERSION_OPTION},
+ {"enable-automatic-decompression", no_argument, 0, AUTOMATIC_DECOMPRESSION},
+ {"cookie-jar", required_argument, 0, COOKIE_JAR},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return false;
+
+ /* support check_http compatible arguments */
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ if (strcmp ("-hn", argv[c]) == 0)
+ strcpy (argv[c], "-H");
+ if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ if (strcmp ("-nohtml", argv[c]) == 0)
+ strcpy (argv[c], "-n");
+ }
+
+ server_url = strdup(DEFAULT_SERVER_URL);
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:d:e:p:s:R:r:u:f:C:J:K:DnlLS::m:M:NEB", longopts, &option);
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case 'h':
+ print_help();
+ exit(STATE_UNKNOWN);
+ break;
+ case 'V':
+ print_revision(progname, NP_VERSION);
+ print_curl_version();
+ exit(STATE_UNKNOWN);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 't': /* timeout period */
+ if (!is_intnonneg (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ socket_timeout = (int)strtol (optarg, NULL, 10);
+ break;
+ case 'c': /* critical time threshold */
+ critical_thresholds = optarg;
+ break;
+ case 'w': /* warning time threshold */
+ warning_thresholds = optarg;
+ break;
+ case 'H': /* virtual host */
+ host_name = strdup (optarg);
+ if (host_name[0] == '[') {
+ if ((p = strstr (host_name, "]:")) != NULL) { /* [IPv6]:port */
+ virtual_port = atoi (p + 2);
+ /* cut off the port */
+ host_name_length = strlen (host_name) - strlen (p) - 1;
+ free (host_name);
+ host_name = strndup (optarg, host_name_length);
+ }
+ } else if ((p = strchr (host_name, ':')) != NULL
+ && strchr (++p, ':') == NULL) { /* IPv4:port or host:port */
+ virtual_port = atoi (p);
+ /* cut off the port */
+ host_name_length = strlen (host_name) - strlen (p) - 1;
+ free (host_name);
+ host_name = strndup (optarg, host_name_length);
+ }
+ break;
+ case 'I': /* internet address */
+ server_address = strdup (optarg);
+ break;
+ case 'u': /* URL path */
+ server_url = strdup (optarg);
+ break;
+ case 'p': /* Server port */
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid port number, expecting a non-negative number"), optarg);
+ else {
+ if( strtol(optarg, NULL, 10) > MAX_PORT)
+ usage2 (_("Invalid port number, supplied port number is too big"), optarg);
+ server_port = (unsigned short)strtol(optarg, NULL, 10);
+ specify_port = true;
+ }
+ break;
+ case 'a': /* authorization info */
+ strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1);
+ user_auth[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 'b': /* proxy-authorization info */
+ strncpy (proxy_auth, optarg, MAX_INPUT_BUFFER - 1);
+ proxy_auth[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 'P': /* HTTP POST data in URL encoded format; ignored if settings already */
+ if (! http_post_data)
+ http_post_data = strdup (optarg);
+ if (! http_method)
+ http_method = strdup("POST");
+ break;
+ case 'j': /* Set HTTP method */
+ if (http_method)
+ free(http_method);
+ http_method = strdup (optarg);
+ break;
+ case 'A': /* useragent */
+ strncpy (user_agent, optarg, DEFAULT_BUFFER_SIZE);
+ user_agent[DEFAULT_BUFFER_SIZE-1] = '\0';
+ break;
+ case 'k': /* Additional headers */
+ if (http_opt_headers_count == 0)
+ http_opt_headers = malloc (sizeof (char *) * (++http_opt_headers_count));
+ else
+ http_opt_headers = realloc (http_opt_headers, sizeof (char *) * (++http_opt_headers_count));
+ http_opt_headers[http_opt_headers_count - 1] = optarg;
+ break;
+ case 'L': /* show html link */
+ display_html = true;
+ break;
+ case 'n': /* do not show html link */
+ display_html = false;
+ break;
+ case 'C': /* Check SSL cert validity */
+#ifdef LIBCURL_FEATURE_SSL
+ if ((temp=strchr(optarg,','))!=NULL) {
+ *temp='\0';
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid certificate expiration period"), optarg);
+ days_till_exp_warn = atoi(optarg);
+ *temp=',';
+ temp++;
+ if (!is_intnonneg (temp))
+ usage2 (_("Invalid certificate expiration period"), temp);
+ days_till_exp_crit = atoi (temp);
+ }
+ else {
+ days_till_exp_crit=0;
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid certificate expiration period"), optarg);
+ days_till_exp_warn = atoi (optarg);
+ }
+ check_cert = true;
+ goto enable_ssl;
+#endif
+ case CONTINUE_AFTER_CHECK_CERT: /* don't stop after the certificate is checked */
+#ifdef HAVE_SSL
+ continue_after_check_cert = true;
+ break;
+#endif
+ case 'J': /* use client certificate */
+#ifdef LIBCURL_FEATURE_SSL
+ test_file(optarg);
+ client_cert = optarg;
+ goto enable_ssl;
+#endif
+ case 'K': /* use client private key */
+#ifdef LIBCURL_FEATURE_SSL
+ test_file(optarg);
+ client_privkey = optarg;
+ goto enable_ssl;
+#endif
+#ifdef LIBCURL_FEATURE_SSL
+ case CA_CERT_OPTION: /* use CA chain file */
+ test_file(optarg);
+ ca_cert = optarg;
+ goto enable_ssl;
+#endif
+#ifdef LIBCURL_FEATURE_SSL
+ case 'D': /* verify peer certificate & host */
+ verify_peer_and_host = true;
+ break;
+#endif
+ case 'S': /* use SSL */
+#ifdef LIBCURL_FEATURE_SSL
+ enable_ssl:
+ use_ssl = true;
+ /* ssl_version initialized to CURL_SSLVERSION_DEFAULT as a default.
+ * Only set if it's non-zero. This helps when we include multiple
+ * parameters, like -S and -C combinations */
+ ssl_version = CURL_SSLVERSION_DEFAULT;
+ if (c=='S' && optarg != NULL) {
+ char *plus_ptr = strchr(optarg, '+');
+ if (plus_ptr) {
+ got_plus = 1;
+ *plus_ptr = '\0';
+ }
+
+ if (optarg[0] == '2')
+ ssl_version = CURL_SSLVERSION_SSLv2;
+ else if (optarg[0] == '3')
+ ssl_version = CURL_SSLVERSION_SSLv3;
+ else if (!strcmp (optarg, "1") || !strcmp (optarg, "1.0"))
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0)
+ ssl_version = CURL_SSLVERSION_TLSv1_0;
+#else
+ ssl_version = CURL_SSLVERSION_DEFAULT;
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0) */
+ else if (!strcmp (optarg, "1.1"))
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0)
+ ssl_version = CURL_SSLVERSION_TLSv1_1;
+#else
+ ssl_version = CURL_SSLVERSION_DEFAULT;
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0) */
+ else if (!strcmp (optarg, "1.2"))
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0)
+ ssl_version = CURL_SSLVERSION_TLSv1_2;
+#else
+ ssl_version = CURL_SSLVERSION_DEFAULT;
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 34, 0) */
+ else if (!strcmp (optarg, "1.3"))
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 52, 0)
+ ssl_version = CURL_SSLVERSION_TLSv1_3;
+#else
+ ssl_version = CURL_SSLVERSION_DEFAULT;
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 52, 0) */
+ else
+ usage4 (_("Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2, 1.3 (with optional '+' suffix)"));
+ }
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 54, 0)
+ if (got_plus) {
+ switch (ssl_version) {
+ case CURL_SSLVERSION_TLSv1_3:
+ ssl_version |= CURL_SSLVERSION_MAX_TLSv1_3;
+ break;
+ case CURL_SSLVERSION_TLSv1_2:
+ case CURL_SSLVERSION_TLSv1_1:
+ case CURL_SSLVERSION_TLSv1_0:
+ ssl_version |= CURL_SSLVERSION_MAX_DEFAULT;
+ break;
+ }
+ } else {
+ switch (ssl_version) {
+ case CURL_SSLVERSION_TLSv1_3:
+ ssl_version |= CURL_SSLVERSION_MAX_TLSv1_3;
+ break;
+ case CURL_SSLVERSION_TLSv1_2:
+ ssl_version |= CURL_SSLVERSION_MAX_TLSv1_2;
+ break;
+ case CURL_SSLVERSION_TLSv1_1:
+ ssl_version |= CURL_SSLVERSION_MAX_TLSv1_1;
+ break;
+ case CURL_SSLVERSION_TLSv1_0:
+ ssl_version |= CURL_SSLVERSION_MAX_TLSv1_0;
+ break;
+ }
+ }
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 54, 0) */
+ if (verbose >= 2)
+ printf(_("* Set SSL/TLS version to %d\n"), ssl_version);
+ if (!specify_port)
+ server_port = HTTPS_PORT;
+ break;
+#else /* LIBCURL_FEATURE_SSL */
+ /* -C -J and -K fall through to here without SSL */
+ usage4 (_("Invalid option - SSL is not available"));
+ break;
+ case SNI_OPTION: /* --sni is parsed, but ignored, the default is true with libcurl */
+ use_sni = true;
+ break;
+#endif /* LIBCURL_FEATURE_SSL */
+ case MAX_REDIRS_OPTION:
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid max_redirs count"), optarg);
+ else {
+ max_depth = atoi (optarg);
+ }
+ break;
+ case 'f': /* onredirect */
+ if (!strcmp (optarg, "ok"))
+ onredirect = STATE_OK;
+ else if (!strcmp (optarg, "warning"))
+ onredirect = STATE_WARNING;
+ else if (!strcmp (optarg, "critical"))
+ onredirect = STATE_CRITICAL;
+ else if (!strcmp (optarg, "unknown"))
+ onredirect = STATE_UNKNOWN;
+ else if (!strcmp (optarg, "follow"))
+ onredirect = STATE_DEPENDENT;
+ else if (!strcmp (optarg, "stickyport"))
+ onredirect = STATE_DEPENDENT, followmethod = FOLLOW_HTTP_CURL, followsticky = STICKY_HOST|STICKY_PORT;
+ else if (!strcmp (optarg, "sticky"))
+ onredirect = STATE_DEPENDENT, followmethod = FOLLOW_HTTP_CURL, followsticky = STICKY_HOST;
+ else if (!strcmp (optarg, "follow"))
+ onredirect = STATE_DEPENDENT, followmethod = FOLLOW_HTTP_CURL, followsticky = STICKY_NONE;
+ else if (!strcmp (optarg, "curl"))
+ onredirect = STATE_DEPENDENT, followmethod = FOLLOW_LIBCURL;
+ else usage2 (_("Invalid onredirect option"), optarg);
+ if (verbose >= 2)
+ printf(_("* Following redirects set to %s\n"), state_text(onredirect));
+ break;
+ case 'd': /* string or substring */
+ strncpy (header_expect, optarg, MAX_INPUT_BUFFER - 1);
+ header_expect[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 's': /* string or substring */
+ strncpy (string_expect, optarg, MAX_INPUT_BUFFER - 1);
+ string_expect[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 'e': /* string or substring */
+ strncpy (server_expect, optarg, MAX_INPUT_BUFFER - 1);
+ server_expect[MAX_INPUT_BUFFER - 1] = 0;
+ server_expect_yn = 1;
+ break;
+ case 'T': /* Content-type */
+ http_content_type = strdup (optarg);
+ break;
+ case 'l': /* linespan */
+ cflags &= ~REG_NEWLINE;
+ break;
+ case 'R': /* regex */
+ cflags |= REG_ICASE;
+ // fall through
+ case 'r': /* regex */
+ strncpy (regexp, optarg, MAX_RE_SIZE - 1);
+ regexp[MAX_RE_SIZE - 1] = 0;
+ errcode = regcomp (&preg, regexp, cflags);
+ if (errcode != 0) {
+ (void) regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
+ printf (_("Could Not Compile Regular Expression: %s"), errbuf);
+ return false;
+ }
+ break;
+ case INVERT_REGEX:
+ invert_regex = true;
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#if defined (USE_IPV6) && defined (LIBCURL_FEATURE_IPV6)
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case 'm': /* min_page_length */
+ {
+ char *tmp;
+ if (strchr(optarg, ':') != (char *)NULL) {
+ /* range, so get two values, min:max */
+ tmp = strtok(optarg, ":");
+ if (tmp == NULL) {
+ printf("Bad format: try \"-m min:max\"\n");
+ exit (STATE_WARNING);
+ } else
+ min_page_len = atoi(tmp);
+
+ tmp = strtok(NULL, ":");
+ if (tmp == NULL) {
+ printf("Bad format: try \"-m min:max\"\n");
+ exit (STATE_WARNING);
+ } else
+ max_page_len = atoi(tmp);
+ } else
+ min_page_len = atoi (optarg);
+ break;
+ }
+ case 'N': /* no-body */
+ no_body = true;
+ break;
+ case 'M': /* max-age */
+ {
+ int L = strlen(optarg);
+ if (L && optarg[L-1] == 'm')
+ maximum_age = atoi (optarg) * 60;
+ else if (L && optarg[L-1] == 'h')
+ maximum_age = atoi (optarg) * 60 * 60;
+ else if (L && optarg[L-1] == 'd')
+ maximum_age = atoi (optarg) * 60 * 60 * 24;
+ else if (L && (optarg[L-1] == 's' ||
+ isdigit (optarg[L-1])))
+ maximum_age = atoi (optarg);
+ else {
+ fprintf (stderr, "unparsable max-age: %s\n", optarg);
+ exit (STATE_WARNING);
+ }
+ if (verbose >= 2)
+ printf ("* Maximal age of document set to %d seconds\n", maximum_age);
+ }
+ break;
+ case 'E': /* show extended perfdata */
+ show_extended_perfdata = true;
+ break;
+ case 'B': /* print body content after status line */
+ show_body = true;
+ break;
+ case HTTP_VERSION_OPTION:
+ curl_http_version = CURL_HTTP_VERSION_NONE;
+ if (strcmp (optarg, "1.0") == 0) {
+ curl_http_version = CURL_HTTP_VERSION_1_0;
+ } else if (strcmp (optarg, "1.1") == 0) {
+ curl_http_version = CURL_HTTP_VERSION_1_1;
+ } else if ((strcmp (optarg, "2.0") == 0) || (strcmp (optarg, "2") == 0)) {
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 33, 0)
+ curl_http_version = CURL_HTTP_VERSION_2_0;
+#else
+ curl_http_version = CURL_HTTP_VERSION_NONE;
+#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 33, 0) */
+ } else {
+ fprintf (stderr, "unknown http-version parameter: %s\n", optarg);
+ exit (STATE_WARNING);
+ }
+ break;
+ case AUTOMATIC_DECOMPRESSION:
+ automatic_decompression = true;
+ break;
+ case COOKIE_JAR:
+ cookie_jar_file = optarg;
+ break;
+ case '?':
+ /* print short usage statement if args not parsable */
+ usage5 ();
+ break;
+ }
+ }
+
+ c = optind;
+
+ if (server_address == NULL && c < argc)
+ server_address = strdup (argv[c++]);
+
+ if (host_name == NULL && c < argc)
+ host_name = strdup (argv[c++]);
+
+ if (server_address == NULL) {
+ if (host_name == NULL)
+ usage4 (_("You must specify a server address or host name"));
+ else
+ server_address = strdup (host_name);
+ }
+
+ set_thresholds(&thlds, warning_thresholds, critical_thresholds);
+
+ if (critical_thresholds && thlds->critical->end>(double)socket_timeout)
+ socket_timeout = (int)thlds->critical->end + 1;
+ if (verbose >= 2)
+ printf ("* Socket timeout set to %ld seconds\n", socket_timeout);
+
+ if (http_method == NULL)
+ http_method = strdup ("GET");
+
+ if (client_cert && !client_privkey)
+ usage4 (_("If you use a client certificate you must also specify a private key file"));
+
+ if (virtual_port == 0)
+ virtual_port = server_port;
+ else {
+ if ((use_ssl && server_port == HTTPS_PORT) || (!use_ssl && server_port == HTTP_PORT))
+ if(!specify_port)
+ server_port = virtual_port;
+ }
+
+ return true;
+}
+
+char *perfd_time (double elapsed_time)
+{
+ return fperfdata ("time", elapsed_time, "s",
+ thlds->warning?true:false, thlds->warning?thlds->warning->end:0,
+ thlds->critical?true:false, thlds->critical?thlds->critical->end:0,
+ true, 0, true, socket_timeout);
+}
+
+char *perfd_time_connect (double elapsed_time_connect)
+{
+ return fperfdata ("time_connect", elapsed_time_connect, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_ssl (double elapsed_time_ssl)
+{
+ return fperfdata ("time_ssl", elapsed_time_ssl, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_headers (double elapsed_time_headers)
+{
+ return fperfdata ("time_headers", elapsed_time_headers, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_firstbyte (double elapsed_time_firstbyte)
+{
+ return fperfdata ("time_firstbyte", elapsed_time_firstbyte, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_transfer (double elapsed_time_transfer)
+{
+ return fperfdata ("time_transfer", elapsed_time_transfer, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_size (int page_len)
+{
+ return perfdata ("size", page_len, "B",
+ (min_page_len>0?true:false), min_page_len,
+ (min_page_len>0?true:false), 0,
+ true, 0, false, 0);
+}
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin tests the HTTP service on the specified host. It can test"));
+ printf ("%s\n", _("normal (http) and secure (https) servers, follow redirects, search for"));
+ printf ("%s\n", _("strings and regular expressions, check connection times, and report on"));
+ printf ("%s\n", _("certificate expiration times."));
+ printf ("\n");
+ printf ("%s\n", _("It makes use of libcurl to do so. It tries to be as compatible to check_http"));
+ printf ("%s\n", _("as possible."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (_("NOTE: One or both of -H and -I must be specified"));
+
+ printf ("\n");
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-H, --hostname=ADDRESS");
+ printf (" %s\n", _("Host name argument for servers using host headers (virtual host)"));
+ printf (" %s\n", _("Append a port to include it in the header (eg: example.com:5000)"));
+ printf (" %s\n", "-I, --IP-address=ADDRESS");
+ printf (" %s\n", _("IP address or name (use numeric address if possible to bypass DNS lookup)."));
+ printf (" %s\n", "-p, --port=INTEGER");
+ printf (" %s", _("Port number (default: "));
+ printf ("%d)\n", HTTP_PORT);
+
+ printf (UT_IPv46);
+
+#ifdef LIBCURL_FEATURE_SSL
+ printf (" %s\n", "-S, --ssl=VERSION[+]");
+ printf (" %s\n", _("Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"));
+ printf (" %s\n", _("auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"));
+ printf (" %s\n", _("1.2 = TLSv1.2, 1.3 = TLSv1.3). With a '+' suffix, newer versions are also accepted."));
+ printf (" %s\n", _("Note: SSLv2 and SSLv3 are deprecated and are usually disabled in libcurl"));
+ printf (" %s\n", "--sni");
+ printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)"));
+#if LIBCURL_VERSION_NUM >= 0x071801
+ printf (" %s\n", _("Note: --sni is the default in libcurl as SSLv2 and SSLV3 are deprecated and"));
+ printf (" %s\n", _(" SNI only really works since TLSv1.0"));
+#else
+ printf (" %s\n", _("Note: SNI is not supported in libcurl before 7.18.1"));
+#endif
+ printf (" %s\n", "-C, --certificate=INTEGER[,INTEGER]");
+ printf (" %s\n", _("Minimum number of days a certificate has to be valid. Port defaults to 443"));
+ printf (" %s\n", _("(when this option is used the URL is not checked by default. You can use"));
+ printf (" %s\n", _(" --continue-after-certificate to override this behavior)"));
+ printf (" %s\n", "--continue-after-certificate");
+ printf (" %s\n", _("Allows the HTTP check to continue after performing the certificate check."));
+ printf (" %s\n", _("Does nothing unless -C is used."));
+ printf (" %s\n", "-J, --client-cert=FILE");
+ printf (" %s\n", _("Name of file that contains the client certificate (PEM format)"));
+ printf (" %s\n", _("to be used in establishing the SSL session"));
+ printf (" %s\n", "-K, --private-key=FILE");
+ printf (" %s\n", _("Name of file containing the private key (PEM format)"));
+ printf (" %s\n", _("matching the client certificate"));
+ printf (" %s\n", "--ca-cert=FILE");
+ printf (" %s\n", _("CA certificate file to verify peer against"));
+ printf (" %s\n", "-D, --verify-cert");
+ printf (" %s\n", _("Verify the peer's SSL certificate and hostname"));
+#endif
+
+ printf (" %s\n", "-e, --expect=STRING");
+ printf (" %s\n", _("Comma-delimited list of strings, at least one of them is expected in"));
+ printf (" %s", _("the first (status) line of the server response (default: "));
+ printf ("%s)\n", HTTP_EXPECT);
+ printf (" %s\n", _("If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"));
+ printf (" %s\n", "-d, --header-string=STRING");
+ printf (" %s\n", _("String to expect in the response headers"));
+ printf (" %s\n", "-s, --string=STRING");
+ printf (" %s\n", _("String to expect in the content"));
+ printf (" %s\n", "-u, --url=PATH");
+ printf (" %s\n", _("URL to GET or POST (default: /)"));
+ printf (" %s\n", "-P, --post=STRING");
+ printf (" %s\n", _("URL encoded http POST data"));
+ printf (" %s\n", "-j, --method=STRING (for example: HEAD, OPTIONS, TRACE, PUT, DELETE, CONNECT)");
+ printf (" %s\n", _("Set HTTP method."));
+ printf (" %s\n", "-N, --no-body");
+ printf (" %s\n", _("Don't wait for document body: stop reading after headers."));
+ printf (" %s\n", _("(Note that this still does an HTTP GET or POST, not a HEAD.)"));
+ printf (" %s\n", "-M, --max-age=SECONDS");
+ printf (" %s\n", _("Warn if document is more than SECONDS old. the number can also be of"));
+ printf (" %s\n", _("the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."));
+ printf (" %s\n", "-T, --content-type=STRING");
+ printf (" %s\n", _("specify Content-Type header media type when POSTing\n"));
+ printf (" %s\n", "-l, --linespan");
+ printf (" %s\n", _("Allow regex to span newlines (must precede -r or -R)"));
+ printf (" %s\n", "-r, --regex, --ereg=STRING");
+ printf (" %s\n", _("Search page for regex STRING"));
+ printf (" %s\n", "-R, --eregi=STRING");
+ printf (" %s\n", _("Search page for case-insensitive regex STRING"));
+ printf (" %s\n", "--invert-regex");
+ printf (" %s\n", _("Return CRITICAL if found, OK if not\n"));
+ printf (" %s\n", "-a, --authorization=AUTH_PAIR");
+ printf (" %s\n", _("Username:password on sites with basic authentication"));
+ printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");
+ printf (" %s\n", _("Username:password on proxy-servers with basic authentication"));
+ printf (" %s\n", "-A, --useragent=STRING");
+ printf (" %s\n", _("String to be sent in http header as \"User Agent\""));
+ printf (" %s\n", "-k, --header=STRING");
+ printf (" %s\n", _("Any other tags to be sent in http header. Use multiple times for additional headers"));
+ printf (" %s\n", "-E, --extended-perfdata");
+ printf (" %s\n", _("Print additional performance data"));
+ printf (" %s\n", "-B, --show-body");
+ printf (" %s\n", _("Print body content below status line"));
+ printf (" %s\n", "-L, --link");
+ printf (" %s\n", _("Wrap output in HTML link (obsoleted by urlize)"));
+ printf (" %s\n", "-f, --onredirect=<ok|warning|critical|follow|sticky|stickyport|curl>");
+ printf (" %s\n", _("How to handle redirected pages. sticky is like follow but stick to the"));
+ printf (" %s\n", _("specified IP address. stickyport also ensures port stays the same."));
+ printf (" %s\n", _("follow uses the old redirection algorithm of check_http."));
+ printf (" %s\n", _("curl uses CURL_FOLLOWLOCATION built into libcurl."));
+ printf (" %s\n", "--max-redirs=INTEGER");
+ printf (" %s", _("Maximal number of redirects (default: "));
+ printf ("%d)\n", DEFAULT_MAX_REDIRS);
+ printf (" %s\n", "-m, --pagesize=INTEGER<:INTEGER>");
+ printf (" %s\n", _("Minimum page size required (bytes) : Maximum page size required (bytes)"));
+ printf ("\n");
+ printf (" %s\n", "--http-version=VERSION");
+ printf (" %s\n", _("Connect via specific HTTP protocol."));
+ printf (" %s\n", _("1.0 = HTTP/1.0, 1.1 = HTTP/1.1, 2.0 = HTTP/2 (HTTP/2 will fail without -S)"));
+ printf (" %s\n", "--enable-automatic-decompression");
+ printf (" %s\n", _("Enable automatic decompression of body (CURLOPT_ACCEPT_ENCODING)."));
+ printf (" %s\n", "---cookie-jar=FILE");
+ printf (" %s\n", _("Store cookies in the cookie jar and send them out when requested."));
+ printf ("\n");
+
+ printf (UT_WARN_CRIT);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("This plugin will attempt to open an HTTP connection with the host."));
+ printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL"));
+ printf (" %s\n", _("other errors return STATE_UNKNOWN. Successful connects, but incorrect response"));
+ printf (" %s\n", _("messages from the host result in STATE_WARNING return values. If you are"));
+ printf (" %s\n", _("checking a virtual server that uses 'host headers' you must supply the FQDN"));
+ printf (" %s\n", _("(fully qualified domain name) as the [host_name] argument."));
+
+#ifdef LIBCURL_FEATURE_SSL
+ printf ("\n");
+ printf (" %s\n", _("This plugin can also check whether an SSL enabled web server is able to"));
+ printf (" %s\n", _("serve content (optionally within a specified time) or whether the X509 "));
+ printf (" %s\n", _("certificate is still valid for the specified number of days."));
+ printf ("\n");
+ printf (" %s\n", _("Please note that this plugin does not check if the presented server"));
+ printf (" %s\n", _("certificate matches the hostname of the server, or if the certificate"));
+ printf (" %s\n", _("has a valid chain of trust to one of the locally installed CAs."));
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n\n", "CHECK CONTENT: check_curl -w 5 -c 10 --ssl -H www.verisign.com");
+ printf (" %s\n", _("When the 'www.verisign.com' server returns its content within 5 seconds,"));
+ printf (" %s\n", _("a STATE_OK will be returned. When the server returns its content but exceeds"));
+ printf (" %s\n", _("the 5-second threshold, a STATE_WARNING will be returned. When an error occurs,"));
+ printf (" %s\n", _("a STATE_CRITICAL will be returned."));
+ printf ("\n");
+ printf (" %s\n\n", "CHECK CERTIFICATE: check_curl -H www.verisign.com -C 14");
+ printf (" %s\n", _("When the certificate of 'www.verisign.com' is valid for more than 14 days,"));
+ printf (" %s\n", _("a STATE_OK is returned. When the certificate is still valid, but for less than"));
+ printf (" %s\n", _("14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"));
+ printf (" %s\n\n", _("the certificate is expired."));
+ printf ("\n");
+ printf (" %s\n\n", "CHECK CERTIFICATE: check_curl -H www.verisign.com -C 30,14");
+ printf (" %s\n", _("When the certificate of 'www.verisign.com' is valid for more than 30 days,"));
+ printf (" %s\n", _("a STATE_OK is returned. When the certificate is still valid, but for less than"));
+ printf (" %s\n", _("30 days, but more than 14 days, a STATE_WARNING is returned."));
+ printf (" %s\n", _("A STATE_CRITICAL will be returned when certificate expires in less than 14 days"));
+#endif
+
+ printf ("\n %s\n", "CHECK WEBSERVER CONTENT VIA PROXY:");
+ printf (" %s\n", _("It is recommended to use an environment proxy like:"));
+ printf (" %s\n", _("http_proxy=http://192.168.100.35:3128 ./check_curl -H www.monitoring-plugins.org"));
+ printf (" %s\n", _("legacy proxy requests in check_http style still work:"));
+ printf (" %s\n", _("check_curl -I 192.168.100.35 -p 3128 -u http://www.monitoring-plugins.org/ -H www.monitoring-plugins.org"));
+
+#ifdef LIBCURL_FEATURE_SSL
+ printf ("\n %s\n", "CHECK SSL WEBSERVER CONTENT VIA PROXY USING HTTP 1.1 CONNECT: ");
+ printf (" %s\n", _("It is recommended to use an environment proxy like:"));
+ printf (" %s\n", _("https_proxy=http://192.168.100.35:3128 ./check_curl -H www.verisign.com -S"));
+ printf (" %s\n", _("legacy proxy requests in check_http style still work:"));
+ printf (" %s\n", _("check_curl -I 192.168.100.35 -p 3128 -u https://www.verisign.com/ -S -j CONNECT -H www.verisign.com "));
+ printf (" %s\n", _("all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -S(sl) -j CONNECT -H <webserver>"));
+ printf (" %s\n", _("a STATE_OK will be returned. When the server returns its content but exceeds"));
+ printf (" %s\n", _("the 5-second threshold, a STATE_WARNING will be returned. When an error occurs,"));
+ printf (" %s\n", _("a STATE_CRITICAL will be returned."));
+
+#endif
+
+ printf (UT_SUPPORT);
+
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]\n",progname);
+ printf (" [-J <client certificate file>] [-K <private key>] [--ca-cert <CA certificate file>] [-D]\n");
+ printf (" [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-E] [-a auth]\n");
+ printf (" [-b proxy_auth] [-f <ok|warning|critical|follow|sticky|stickyport|curl>]\n");
+ printf (" [-e <expect>] [-d string] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n");
+ printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n");
+ printf (" [-A string] [-k string] [-S <version>] [--sni]\n");
+ printf (" [-T <content-type>] [-j method]\n");
+ printf (" [--http-version=<version>] [--enable-automatic-decompression]\n");
+ printf (" [--cookie-jar=<cookie jar file>\n");
+ printf (" %s -H <vhost> | -I <IP-address> -C <warn_age>[,<crit_age>]\n",progname);
+ printf (" [-p <port>] [-t <timeout>] [-4|-6] [--sni]\n");
+ printf ("\n");
+#ifdef LIBCURL_FEATURE_SSL
+ printf ("%s\n", _("In the first form, make an HTTP request."));
+ printf ("%s\n\n", _("In the second form, connect to the server and check the TLS certificate."));
+#endif
+ printf ("%s\n", _("WARNING: check_curl is experimental. Please use"));
+ printf ("%s\n\n", _("check_http if you need a stable version."));
+}
+
+void
+print_curl_version (void)
+{
+ printf( "%s\n", curl_version());
+}
+
+int
+curlhelp_initwritebuffer (curlhelp_write_curlbuf *buf)
+{
+ buf->bufsize = DEFAULT_BUFFER_SIZE;
+ buf->buflen = 0;
+ buf->buf = (char *)malloc ((size_t)buf->bufsize);
+ if (buf->buf == NULL) return -1;
+ return 0;
+}
+
+size_t curlhelp_buffer_write_callback (void *buffer, size_t size, size_t nmemb, void *stream)
+{
+ curlhelp_write_curlbuf *buf = (curlhelp_write_curlbuf *)stream;
+
+ while (buf->bufsize < buf->buflen + size * nmemb + 1) {
+ buf->bufsize = buf->bufsize * 2;
+ buf->buf = (char *)realloc (buf->buf, buf->bufsize);
+ if (buf->buf == NULL) {
+ fprintf(stderr, "malloc failed (%d) %s\n", errno, strerror(errno));
+ return -1;
+ }
+ }
+
+ memcpy (buf->buf + buf->buflen, buffer, size * nmemb);
+ buf->buflen += size * nmemb;
+ buf->buf[buf->buflen] = '\0';
+
+ return (int)(size * nmemb);
+}
+
+size_t curlhelp_buffer_read_callback(void *buffer, size_t size, size_t nmemb, void *stream)
+{
+ curlhelp_read_curlbuf *buf = (curlhelp_read_curlbuf *)stream;
+
+ size_t n = min (nmemb * size, buf->buflen - buf->pos);
+
+ memcpy (buffer, buf->buf + buf->pos, n);
+ buf->pos += n;
+
+ return (int)n;
+}
+
+void
+curlhelp_freewritebuffer (curlhelp_write_curlbuf *buf)
+{
+ free (buf->buf);
+ buf->buf = NULL;
+}
+
+int
+curlhelp_initreadbuffer (curlhelp_read_curlbuf *buf, const char *data, size_t datalen)
+{
+ buf->buflen = datalen;
+ buf->buf = (char *)malloc ((size_t)buf->buflen);
+ if (buf->buf == NULL) return -1;
+ memcpy (buf->buf, data, datalen);
+ buf->pos = 0;
+ return 0;
+}
+
+void
+curlhelp_freereadbuffer (curlhelp_read_curlbuf *buf)
+{
+ free (buf->buf);
+ buf->buf = NULL;
+}
+
+/* TODO: where to put this, it's actually part of sstrings2 (logically)?
+ */
+const char*
+strrstr2(const char *haystack, const char *needle)
+{
+ int counter;
+ size_t len;
+ const char *prev_pos;
+ const char *pos;
+
+ if (haystack == NULL || needle == NULL)
+ return NULL;
+
+ if (haystack[0] == '\0' || needle[0] == '\0')
+ return NULL;
+
+ counter = 0;
+ prev_pos = NULL;
+ pos = haystack;
+ len = strlen (needle);
+ for (;;) {
+ pos = strstr (pos, needle);
+ if (pos == NULL) {
+ if (counter == 0)
+ return NULL;
+ else
+ return prev_pos;
+ }
+ counter++;
+ prev_pos = pos;
+ pos += len;
+ if (*pos == '\0') return prev_pos;
+ }
+}
+
+int
+curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line)
+{
+ char *first_line_end;
+ char *p;
+ size_t first_line_len;
+ char *pp;
+ const char *start;
+ char *first_line_buf;
+
+ /* find last start of a new header */
+ start = strrstr2 (buf, "\r\nHTTP/");
+ if (start != NULL) {
+ start += 2;
+ buf = start;
+ }
+
+ first_line_end = strstr(buf, "\r\n");
+ if (first_line_end == NULL) return -1;
+
+ first_line_len = (size_t)(first_line_end - buf);
+ status_line->first_line = (char *)malloc (first_line_len + 1);
+ if (status_line->first_line == NULL) return -1;
+ memcpy (status_line->first_line, buf, first_line_len);
+ status_line->first_line[first_line_len] = '\0';
+ first_line_buf = strdup( status_line->first_line );
+
+ /* protocol and version: "HTTP/x.x" SP or "HTTP/2" SP */
+
+ p = strtok(first_line_buf, "/");
+ if( p == NULL ) { free( first_line_buf ); return -1; }
+ if( strcmp( p, "HTTP" ) != 0 ) { free( first_line_buf ); return -1; }
+
+ p = strtok( NULL, " " );
+ if( p == NULL ) { free( first_line_buf ); return -1; }
+ if( strchr( p, '.' ) != NULL ) {
+
+ /* HTTP 1.x case */
+ strtok( p, "." );
+ status_line->http_major = (int)strtol( p, &pp, 10 );
+ if( *pp != '\0' ) { free( first_line_buf ); return -1; }
+ strtok( NULL, " " );
+ status_line->http_minor = (int)strtol( p, &pp, 10 );
+ if( *pp != '\0' ) { free( first_line_buf ); return -1; }
+ p += 4; /* 1.x SP */
+ } else {
+ /* HTTP 2 case */
+ status_line->http_major = (int)strtol( p, &pp, 10 );
+ status_line->http_minor = 0;
+ p += 2; /* 2 SP */
+ }
+
+ /* status code: "404" or "404.1", then SP */
+
+ p = strtok( p, " " );
+ if( p == NULL ) { free( first_line_buf ); return -1; }
+ if( strchr( p, '.' ) != NULL ) {
+ char *ppp;
+ ppp = strtok( p, "." );
+ status_line->http_code = (int)strtol( ppp, &pp, 10 );
+ if( *pp != '\0' ) { free( first_line_buf ); return -1; }
+ ppp = strtok( NULL, "" );
+ status_line->http_subcode = (int)strtol( ppp, &pp, 10 );
+ if( *pp != '\0' ) { free( first_line_buf ); return -1; }
+ p += 6; /* 400.1 SP */
+ } else {
+ status_line->http_code = (int)strtol( p, &pp, 10 );
+ status_line->http_subcode = -1;
+ if( *pp != '\0' ) { free( first_line_buf ); return -1; }
+ p += 4; /* 400 SP */
+ }
+
+ /* Human readable message: "Not Found" CRLF */
+
+ p = strtok( p, "" );
+ if( p == NULL ) { status_line->msg = ""; return 0; }
+ status_line->msg = status_line->first_line + ( p - first_line_buf );
+ free( first_line_buf );
+
+ return 0;
+}
+
+void
+curlhelp_free_statusline (curlhelp_statusline *status_line)
+{
+ free (status_line->first_line);
+}
+
+void
+remove_newlines (char *s)
+{
+ char *p;
+
+ for (p = s; *p != '\0'; p++)
+ if (*p == '\r' || *p == '\n')
+ *p = ' ';
+}
+
+char *
+get_header_value (const struct phr_header* headers, const size_t nof_headers, const char* header)
+{
+ int i;
+ for( i = 0; i < nof_headers; i++ ) {
+ if(headers[i].name != NULL && strncasecmp( header, headers[i].name, max( headers[i].name_len, 4 ) ) == 0 ) {
+ return strndup( headers[i].value, headers[i].value_len );
+ }
+ }
+ return NULL;
+}
+
+int
+check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFAULT_BUFFER_SIZE])
+{
+ char *server_date = NULL;
+ char *document_date = NULL;
+ int date_result = STATE_OK;
+ curlhelp_statusline status_line;
+ struct phr_header headers[255];
+ size_t nof_headers = 255;
+ size_t msglen;
+
+ int res = phr_parse_response (header_buf->buf, header_buf->buflen,
+ &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
+ headers, &nof_headers, 0);
+
+ if (res == -1) {
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
+ }
+
+ server_date = get_header_value (headers, nof_headers, "date");
+ document_date = get_header_value (headers, nof_headers, "last-modified");
+
+ if (!server_date || !*server_date) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sServer date unknown, "), *msg);
+ strcpy(*msg, tmp);
+
+ date_result = max_state_alt(STATE_UNKNOWN, date_result);
+
+ } else if (!document_date || !*document_date) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sDocument modification date unknown, "), *msg);
+ strcpy(*msg, tmp);
+
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+
+ } else {
+ time_t srv_data = curl_getdate (server_date, NULL);
+ time_t doc_data = curl_getdate (document_date, NULL);
+ if (verbose >= 2)
+ printf ("* server date: '%s' (%d), doc_date: '%s' (%d)\n", server_date, (int)srv_data, document_date, (int)doc_data);
+ if (srv_data <= 0) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sServer date \"%100s\" unparsable, "), *msg, server_date);
+ strcpy(*msg, tmp);
+
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else if (doc_data <= 0) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sDocument date \"%100s\" unparsable, "), *msg, document_date);
+ strcpy(*msg, tmp);
+
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else if (doc_data > srv_data + 30) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sDocument is %d seconds in the future, "), *msg, (int)doc_data - (int)srv_data);
+ strcpy(*msg, tmp);
+
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else if (doc_data < srv_data - maximum_age) {
+ int n = (srv_data - doc_data);
+ if (n > (60 * 60 * 24 * 2)) {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sLast modified %.1f days ago, "), *msg, ((float) n) / (60 * 60 * 24));
+ strcpy(*msg, tmp);
+
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else {
+ char tmp[DEFAULT_BUFFER_SIZE];
+
+ snprintf (tmp, DEFAULT_BUFFER_SIZE, _("%sLast modified %d:%02d:%02d ago, "), *msg, n / (60 * 60), (n / 60) % 60, n % 60);
+ strcpy(*msg, tmp);
+
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ }
+ }
+ }
+
+ if (server_date) free (server_date);
+ if (document_date) free (document_date);
+
+ return date_result;
+}
+
+
+int
+get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf)
+{
+ int content_length = 0;
+ struct phr_header headers[255];
+ size_t nof_headers = 255;
+ size_t msglen;
+ char *content_length_s = NULL;
+ curlhelp_statusline status_line;
+
+ int res = phr_parse_response (header_buf->buf, header_buf->buflen,
+ &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen,
+ headers, &nof_headers, 0);
+
+ if (res == -1) {
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n"));
+ }
+
+ content_length_s = get_header_value (headers, nof_headers, "content-length");
+ if (!content_length_s) {
+ return header_buf->buflen + body_buf->buflen;
+ }
+ content_length_s += strspn (content_length_s, " \t");
+ content_length = atoi (content_length_s);
+ if (content_length != body_buf->buflen) {
+ /* TODO: should we warn if the actual and the reported body length don't match? */
+ }
+
+ if (content_length_s) free (content_length_s);
+
+ return header_buf->buflen + body_buf->buflen;
+}
+
+/* TODO: is there a better way in libcurl to check for the SSL library? */
+curlhelp_ssl_library
+curlhelp_get_ssl_library ()
+{
+ curl_version_info_data* version_data;
+ char *ssl_version;
+ char *library;
+ curlhelp_ssl_library ssl_library = CURLHELP_SSL_LIBRARY_UNKNOWN;
+
+ version_data = curl_version_info (CURLVERSION_NOW);
+ if (version_data == NULL) return CURLHELP_SSL_LIBRARY_UNKNOWN;
+
+ ssl_version = strdup (version_data->ssl_version);
+ if (ssl_version == NULL ) return CURLHELP_SSL_LIBRARY_UNKNOWN;
+
+ library = strtok (ssl_version, "/");
+ if (library == NULL) return CURLHELP_SSL_LIBRARY_UNKNOWN;
+
+ if (strcmp (library, "OpenSSL") == 0)
+ ssl_library = CURLHELP_SSL_LIBRARY_OPENSSL;
+ else if (strcmp (library, "LibreSSL") == 0)
+ ssl_library = CURLHELP_SSL_LIBRARY_LIBRESSL;
+ else if (strcmp (library, "GnuTLS") == 0)
+ ssl_library = CURLHELP_SSL_LIBRARY_GNUTLS;
+ else if (strcmp (library, "NSS") == 0)
+ ssl_library = CURLHELP_SSL_LIBRARY_NSS;
+
+ if (verbose >= 2)
+ printf ("* SSL library string is : %s %s (%d)\n", version_data->ssl_version, library, ssl_library);
+
+ free (ssl_version);
+
+ return ssl_library;
+}
+
+const char*
+curlhelp_get_ssl_library_string (curlhelp_ssl_library ssl_library)
+{
+ switch (ssl_library) {
+ case CURLHELP_SSL_LIBRARY_OPENSSL:
+ return "OpenSSL";
+ case CURLHELP_SSL_LIBRARY_LIBRESSL:
+ return "LibreSSL";
+ case CURLHELP_SSL_LIBRARY_GNUTLS:
+ return "GnuTLS";
+ case CURLHELP_SSL_LIBRARY_NSS:
+ return "NSS";
+ case CURLHELP_SSL_LIBRARY_UNKNOWN:
+ default:
+ return "unknown";
+ }
+}
+
+#ifdef LIBCURL_FEATURE_SSL
+#ifndef USE_OPENSSL
+time_t
+parse_cert_date (const char *s)
+{
+ struct tm tm;
+ time_t date;
+ char *res;
+
+ if (!s) return -1;
+
+ /* Jan 17 14:25:12 2020 GMT */
+ res = strptime (s, "%Y-%m-%d %H:%M:%S GMT", &tm);
+ /* Sep 11 12:00:00 2020 GMT */
+ if (res == NULL) strptime (s, "%Y %m %d %H:%M:%S GMT", &tm);
+ date = mktime (&tm);
+
+ return date;
+}
+
+/* TODO: this needs cleanup in the sslutils.c, maybe we the #else case to
+ * OpenSSL could be this function
+ */
+int
+net_noopenssl_check_certificate (cert_ptr_union* cert_ptr, int days_till_exp_warn, int days_till_exp_crit)
+{
+ int i;
+ struct curl_slist* slist;
+ int cname_found = 0;
+ char* start_date_str = NULL;
+ char* end_date_str = NULL;
+ time_t start_date;
+ time_t end_date;
+ char *tz;
+ float time_left;
+ int days_left;
+ int time_remaining;
+ char timestamp[50] = "";
+ int status = STATE_UNKNOWN;
+
+ if (verbose >= 2)
+ printf ("**** REQUEST CERTIFICATES ****\n");
+
+ for (i = 0; i < cert_ptr->to_certinfo->num_of_certs; i++) {
+ for (slist = cert_ptr->to_certinfo->certinfo[i]; slist; slist = slist->next) {
+ /* find first common name in subject,
+ * TODO: check alternative subjects for
+ * TODO: have a decent parser here and not a hack
+ * multi-host certificate, check wildcards
+ */
+ if (strncasecmp (slist->data, "Subject:", 8) == 0) {
+ int d = 3;
+ char* p = strstr (slist->data, "CN=");
+ if (p == NULL) {
+ d = 5;
+ p = strstr (slist->data, "CN = ");
+ }
+ if (p != NULL) {
+ if (strncmp (host_name, p+d, strlen (host_name)) == 0) {
+ cname_found = 1;
+ }
+ }
+ } else if (strncasecmp (slist->data, "Start Date:", 11) == 0) {
+ start_date_str = &slist->data[11];
+ } else if (strncasecmp (slist->data, "Expire Date:", 12) == 0) {
+ end_date_str = &slist->data[12];
+ } else if (strncasecmp (slist->data, "Cert:", 5) == 0) {
+ goto HAVE_FIRST_CERT;
+ }
+ if (verbose >= 2)
+ printf ("%d ** %s\n", i, slist->data);
+ }
+ }
+HAVE_FIRST_CERT:
+
+ if (verbose >= 2)
+ printf ("**** REQUEST CERTIFICATES ****\n");
+
+ if (!cname_found) {
+ printf("%s\n",_("CRITICAL - Cannot retrieve certificate subject."));
+ return STATE_CRITICAL;
+ }
+
+ start_date = parse_cert_date (start_date_str);
+ if (start_date <= 0) {
+ snprintf (msg, DEFAULT_BUFFER_SIZE, _("WARNING - Unparsable 'Start Date' in certificate: '%s'"),
+ start_date_str);
+ puts (msg);
+ return STATE_WARNING;
+ }
+
+ end_date = parse_cert_date (end_date_str);
+ if (end_date <= 0) {
+ snprintf (msg, DEFAULT_BUFFER_SIZE, _("WARNING - Unparsable 'Expire Date' in certificate: '%s'"),
+ start_date_str);
+ puts (msg);
+ return STATE_WARNING;
+ }
+
+ time_left = difftime (end_date, time(NULL));
+ days_left = time_left / 86400;
+ tz = getenv("TZ");
+ setenv("TZ", "GMT", 1);
+ tzset();
+ strftime(timestamp, 50, "%c %z", localtime(&end_date));
+ if (tz)
+ setenv("TZ", tz, 1);
+ else
+ unsetenv("TZ");
+ tzset();
+
+ if (days_left > 0 && days_left <= days_till_exp_warn) {
+ printf (_("%s - Certificate '%s' expires in %d day(s) (%s).\n"), (days_left>days_till_exp_crit)?"WARNING":"CRITICAL", host_name, days_left, timestamp);
+ if (days_left > days_till_exp_crit)
+ status = STATE_WARNING;
+ else
+ status = STATE_CRITICAL;
+ } else if (days_left == 0 && time_left > 0) {
+ if (time_left >= 3600)
+ time_remaining = (int) time_left / 3600;
+ else
+ time_remaining = (int) time_left / 60;
+
+ printf (_("%s - Certificate '%s' expires in %u %s (%s)\n"),
+ (days_left>days_till_exp_crit) ? "WARNING" : "CRITICAL", host_name, time_remaining,
+ time_left >= 3600 ? "hours" : "minutes", timestamp);
+
+ if ( days_left > days_till_exp_crit)
+ status = STATE_WARNING;
+ else
+ status = STATE_CRITICAL;
+ } else if (time_left < 0) {
+ printf(_("CRITICAL - Certificate '%s' expired on %s.\n"), host_name, timestamp);
+ status=STATE_CRITICAL;
+ } else if (days_left == 0) {
+ printf (_("%s - Certificate '%s' just expired (%s).\n"), (days_left>days_till_exp_crit)?"WARNING":"CRITICAL", host_name, timestamp);
+ if (days_left > days_till_exp_crit)
+ status = STATE_WARNING;
+ else
+ status = STATE_CRITICAL;
+ } else {
+ printf(_("OK - Certificate '%s' will expire on %s.\n"), host_name, timestamp);
+ status = STATE_OK;
+ }
+ return status;
+}
+#endif /* USE_OPENSSL */
+#endif /* LIBCURL_FEATURE_SSL */
diff --git a/plugins/check_dbi.c b/plugins/check_dbi.c
new file mode 100644
index 0000000..c24ca24
--- /dev/null
+++ b/plugins/check_dbi.c
@@ -0,0 +1,826 @@
+/*****************************************************************************
+*
+* Monitoring check_dbi plugin
+*
+* License: GPL
+* Copyright (c) 2011 Monitoring Plugins Development Team
+* Author: Sebastian 'tokkee' Harl <sh@teamix.net>
+*
+* Description:
+*
+* This file contains the check_dbi plugin
+*
+* Runs an arbitrary (SQL) command and checks the result.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_dbi";
+const char *copyright = "2011";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "utils_cmd.h"
+
+#include "netutils.h"
+
+#include "regex.h"
+
+/* required for NAN */
+#ifndef _ISOC99_SOURCE
+#define _ISOC99_SOURCE
+#endif
+
+#include <assert.h>
+#include <math.h>
+
+#include <dbi/dbi.h>
+
+#include <stdarg.h>
+
+typedef enum {
+ METRIC_CONN_TIME,
+ METRIC_SERVER_VERSION,
+ METRIC_QUERY_RESULT,
+ METRIC_QUERY_TIME,
+} np_dbi_metric_t;
+
+typedef enum {
+ TYPE_NUMERIC,
+ TYPE_STRING,
+} np_dbi_type_t;
+
+typedef struct {
+ char *key;
+ char *value;
+} driver_option_t;
+
+char *host = NULL;
+int verbose = 0;
+
+char *warning_range = NULL;
+char *critical_range = NULL;
+thresholds *dbi_thresholds = NULL;
+
+char *expect = NULL;
+
+regex_t expect_re;
+char *expect_re_str = NULL;
+int expect_re_cflags = 0;
+
+np_dbi_metric_t metric = METRIC_QUERY_RESULT;
+np_dbi_type_t type = TYPE_NUMERIC;
+
+char *np_dbi_driver = NULL;
+driver_option_t *np_dbi_options = NULL;
+int np_dbi_options_num = 0;
+char *np_dbi_database = NULL;
+char *np_dbi_query = NULL;
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_usage (void);
+void print_help (void);
+
+double timediff (struct timeval, struct timeval);
+
+void np_dbi_print_error (dbi_conn, char *, ...);
+
+int do_query (dbi_conn, const char **, double *, double *);
+
+int
+main (int argc, char **argv)
+{
+ int status = STATE_UNKNOWN;
+
+ dbi_driver driver;
+ dbi_conn conn;
+
+ unsigned int server_version;
+
+ struct timeval start_timeval, end_timeval;
+ double conn_time = 0.0;
+ double query_time = 0.0;
+
+ const char *query_val_str = NULL;
+ double query_val = 0.0;
+
+ int i;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv = np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* Set signal handling and alarm */
+ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
+ usage4 (_("Cannot catch SIGALRM"));
+ }
+ alarm (timeout_interval);
+
+ if (verbose > 2)
+ printf ("Initializing DBI\n");
+
+ dbi_inst *instance_p;
+
+ if (dbi_initialize_r(NULL, instance_p) < 0) {
+ printf ("UNKNOWN - failed to initialize DBI; possibly you don't have any drivers installed.\n");
+ return STATE_UNKNOWN;
+ }
+
+ if (instance_p == NULL) {
+ printf ("UNKNOWN - failed to initialize DBI.\n");
+ return STATE_UNKNOWN;
+ }
+
+ if (verbose)
+ printf ("Opening DBI driver '%s'\n", np_dbi_driver);
+
+ driver = dbi_driver_open_r(np_dbi_driver, instance_p);
+ if (! driver) {
+ printf ("UNKNOWN - failed to open DBI driver '%s'; possibly it's not installed.\n",
+ np_dbi_driver);
+
+ printf ("Known drivers:\n");
+ for (driver = dbi_driver_list_r(NULL, instance_p); driver; driver = dbi_driver_list_r(driver, instance_p)) {
+ printf (" - %s\n", dbi_driver_get_name (driver));
+ }
+ return STATE_UNKNOWN;
+ }
+
+ /* make a connection to the database */
+ gettimeofday (&start_timeval, NULL);
+
+ conn = dbi_conn_open (driver);
+ if (! conn) {
+ printf ("UNKNOWN - failed top open connection object.\n");
+ dbi_conn_close (conn);
+ return STATE_UNKNOWN;
+ }
+
+ for (i = 0; i < np_dbi_options_num; ++i) {
+ const char *opt;
+
+ if (verbose > 1)
+ printf ("Setting DBI driver option '%s' to '%s'\n",
+ np_dbi_options[i].key, np_dbi_options[i].value);
+
+ if (! dbi_conn_set_option (conn, np_dbi_options[i].key, np_dbi_options[i].value))
+ continue;
+ /* else: status != 0 */
+
+ np_dbi_print_error (conn, "UNKNOWN - failed to set option '%s' to '%s'",
+ np_dbi_options[i].key, np_dbi_options[i].value);
+ printf ("Known driver options:\n");
+
+ for (opt = dbi_conn_get_option_list (conn, NULL); opt;
+ opt = dbi_conn_get_option_list (conn, opt)) {
+ printf (" - %s\n", opt);
+ }
+ dbi_conn_close (conn);
+ return STATE_UNKNOWN;
+ }
+
+ if (host) {
+ if (verbose > 1)
+ printf ("Setting DBI driver option 'host' to '%s'\n", host);
+ dbi_conn_set_option (conn, "host", host);
+ }
+
+ if (verbose) {
+ const char *dbname, *host;
+
+ dbname = dbi_conn_get_option (conn, "dbname");
+ host = dbi_conn_get_option (conn, "host");
+
+ if (! dbname)
+ dbname = "<unspecified>";
+ if (! host)
+ host = "<unspecified>";
+
+ printf ("Connecting to database '%s' at host '%s'\n",
+ dbname, host);
+ }
+
+ if (dbi_conn_connect (conn) < 0) {
+ np_dbi_print_error (conn, "UNKNOWN - failed to connect to database");
+ return STATE_UNKNOWN;
+ }
+
+ gettimeofday (&end_timeval, NULL);
+ conn_time = timediff (start_timeval, end_timeval);
+
+ server_version = dbi_conn_get_engine_version (conn);
+ if (verbose)
+ printf ("Connected to server version %u\n", server_version);
+
+ if (metric == METRIC_SERVER_VERSION)
+ status = get_status (server_version, dbi_thresholds);
+
+ if (verbose)
+ printf ("Time elapsed: %f\n", conn_time);
+
+ if (metric == METRIC_CONN_TIME)
+ status = get_status (conn_time, dbi_thresholds);
+
+ /* select a database */
+ if (np_dbi_database) {
+ if (verbose > 1)
+ printf ("Selecting database '%s'\n", np_dbi_database);
+
+ if (dbi_conn_select_db (conn, np_dbi_database)) {
+ np_dbi_print_error (conn, "UNKNOWN - failed to select database '%s'",
+ np_dbi_database);
+ return STATE_UNKNOWN;
+ }
+ }
+
+ if (np_dbi_query) {
+ /* execute query */
+ status = do_query (conn, &query_val_str, &query_val, &query_time);
+ if (status != STATE_OK)
+ /* do_query prints an error message in this case */
+ return status;
+
+ if (metric == METRIC_QUERY_RESULT) {
+ if (expect) {
+ if ((! query_val_str) || strcmp (query_val_str, expect))
+ status = STATE_CRITICAL;
+ else
+ status = STATE_OK;
+ }
+ else if (expect_re_str) {
+ int err;
+
+ err = regexec (&expect_re, query_val_str, 0, NULL, /* flags = */ 0);
+ if (! err)
+ status = STATE_OK;
+ else if (err == REG_NOMATCH)
+ status = STATE_CRITICAL;
+ else {
+ char errmsg[1024];
+ regerror (err, &expect_re, errmsg, sizeof (errmsg));
+ printf ("ERROR - failed to execute regular expression: %s\n",
+ errmsg);
+ status = STATE_CRITICAL;
+ }
+ }
+ else
+ status = get_status (query_val, dbi_thresholds);
+ }
+ else if (metric == METRIC_QUERY_TIME)
+ status = get_status (query_time, dbi_thresholds);
+ }
+
+ if (verbose)
+ printf("Closing connection\n");
+ dbi_conn_close (conn);
+
+ /* In case of METRIC_QUERY_RESULT, isnan(query_val) indicates an error
+ * which should have been reported and handled (abort) before
+ * ... unless we expected a string to be returned */
+ assert ((metric != METRIC_QUERY_RESULT) || (! isnan (query_val))
+ || (type == TYPE_STRING));
+
+ assert ((type != TYPE_STRING) || (expect || expect_re_str));
+
+ printf ("%s - connection time: %fs", state_text (status), conn_time);
+ if (np_dbi_query) {
+ if (type == TYPE_STRING) {
+ assert (expect || expect_re_str);
+ printf (", '%s' returned '%s' in %fs", np_dbi_query,
+ query_val_str ? query_val_str : "<nothing>", query_time);
+ if (status != STATE_OK) {
+ if (expect)
+ printf (" (expected '%s')", expect);
+ else if (expect_re_str)
+ printf (" (expected regex /%s/%s)", expect_re_str,
+ ((expect_re_cflags & REG_ICASE) ? "i" : ""));
+ }
+ }
+ else if (isnan (query_val))
+ printf (", '%s' query execution time: %fs", np_dbi_query, query_time);
+ else
+ printf (", '%s' returned %f in %fs", np_dbi_query, query_val, query_time);
+ }
+
+ printf (" | conntime=%fs;%s;%s;0; server_version=%u;%s;%s;0;", conn_time,
+ ((metric == METRIC_CONN_TIME) && warning_range) ? warning_range : "",
+ ((metric == METRIC_CONN_TIME) && critical_range) ? critical_range : "",
+ server_version,
+ ((metric == METRIC_SERVER_VERSION) && warning_range) ? warning_range : "",
+ ((metric == METRIC_SERVER_VERSION) && critical_range) ? critical_range : "");
+ if (np_dbi_query) {
+ if (! isnan (query_val)) /* this is also true when -e is used */
+ printf (" query=%f;%s;%s;;", query_val,
+ ((metric == METRIC_QUERY_RESULT) && warning_range) ? warning_range : "",
+ ((metric == METRIC_QUERY_RESULT) && critical_range) ? critical_range : "");
+ printf (" querytime=%fs;%s;%s;0;", query_time,
+ ((metric == METRIC_QUERY_TIME) && warning_range) ? warning_range : "",
+ ((metric == METRIC_QUERY_TIME) && critical_range) ? critical_range : "");
+ }
+ printf ("\n");
+ return status;
+}
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ STD_LONG_OPTS,
+
+ {"expect", required_argument, 0, 'e'},
+ {"regex", required_argument, 0, 'r'},
+ {"regexi", required_argument, 0, 'R'},
+ {"metric", required_argument, 0, 'm'},
+ {"driver", required_argument, 0, 'd'},
+ {"option", required_argument, 0, 'o'},
+ {"query", required_argument, 0, 'q'},
+ {"database", required_argument, 0, 'D'},
+ {0, 0, 0, 0}
+ };
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vvht:c:w:e:r:R:m:H:d:o:q:D:",
+ longopts, &option);
+
+ if (c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* usage */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+
+ case 'c': /* critical range */
+ critical_range = optarg;
+ type = TYPE_NUMERIC;
+ break;
+ case 'w': /* warning range */
+ warning_range = optarg;
+ type = TYPE_NUMERIC;
+ break;
+ case 'e':
+ expect = optarg;
+ type = TYPE_STRING;
+ break;
+ case 'R':
+ expect_re_cflags = REG_ICASE;
+ /* fall through */
+ case 'r':
+ {
+ int err;
+
+ expect_re_cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
+ expect_re_str = optarg;
+ type = TYPE_STRING;
+
+ err = regcomp (&expect_re, expect_re_str, expect_re_cflags);
+ if (err) {
+ char errmsg[1024];
+ regerror (err, &expect_re, errmsg, sizeof (errmsg));
+ printf ("ERROR - failed to compile regular expression: %s\n",
+ errmsg);
+ return ERROR;
+ }
+ break;
+ }
+
+ case 'm':
+ if (! strcasecmp (optarg, "CONN_TIME"))
+ metric = METRIC_CONN_TIME;
+ else if (! strcasecmp (optarg, "SERVER_VERSION"))
+ metric = METRIC_SERVER_VERSION;
+ else if (! strcasecmp (optarg, "QUERY_RESULT"))
+ metric = METRIC_QUERY_RESULT;
+ else if (! strcasecmp (optarg, "QUERY_TIME"))
+ metric = METRIC_QUERY_TIME;
+ else
+ usage2 (_("Invalid metric"), optarg);
+ break;
+ case 't': /* timeout */
+ if (!is_intnonneg (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ timeout_interval = atoi (optarg);
+
+ break;
+ case 'H': /* host */
+ if (!is_host (optarg))
+ usage2 (_("Invalid hostname/address"), optarg);
+ else
+ host = optarg;
+ break;
+ case 'v':
+ verbose++;
+ break;
+
+ case 'd':
+ np_dbi_driver = optarg;
+ break;
+ case 'o':
+ {
+ driver_option_t *new;
+
+ char *k, *v;
+
+ k = optarg;
+ v = strchr (k, (int)'=');
+
+ if (! v)
+ usage2 (_("Option must be '<key>=<value>'"), optarg);
+
+ *v = '\0';
+ ++v;
+
+ new = realloc (np_dbi_options,
+ (np_dbi_options_num + 1) * sizeof (*new));
+ if (! new) {
+ printf ("UNKNOWN - failed to reallocate memory\n");
+ exit (STATE_UNKNOWN);
+ }
+
+ np_dbi_options = new;
+ new = np_dbi_options + np_dbi_options_num;
+ ++np_dbi_options_num;
+
+ new->key = k;
+ new->value = v;
+ }
+ break;
+ case 'q':
+ np_dbi_query = optarg;
+ break;
+ case 'D':
+ np_dbi_database = optarg;
+ break;
+ }
+ }
+
+ set_thresholds (&dbi_thresholds, warning_range, critical_range);
+
+ return validate_arguments ();
+}
+
+int
+validate_arguments ()
+{
+ if (! np_dbi_driver)
+ usage ("Must specify a DBI driver");
+
+ if (((metric == METRIC_QUERY_RESULT) || (metric == METRIC_QUERY_TIME))
+ && (! np_dbi_query))
+ usage ("Must specify a query to execute (metric == QUERY_RESULT)");
+
+ if ((metric != METRIC_CONN_TIME)
+ && (metric != METRIC_SERVER_VERSION)
+ && (metric != METRIC_QUERY_RESULT)
+ && (metric != METRIC_QUERY_TIME))
+ usage ("Invalid metric specified");
+
+ if (expect && (warning_range || critical_range || expect_re_str))
+ usage ("Do not mix -e and -w/-c/-r/-R");
+
+ if (expect_re_str && (warning_range || critical_range || expect))
+ usage ("Do not mix -r/-R and -w/-c/-e");
+
+ if (expect && (metric != METRIC_QUERY_RESULT))
+ usage ("Option -e requires metric QUERY_RESULT");
+
+ if (expect_re_str && (metric != METRIC_QUERY_RESULT))
+ usage ("Options -r/-R require metric QUERY_RESULT");
+
+ return OK;
+}
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("This program connects to an (SQL) database using DBI and checks the\n"
+ "specified metric against threshold levels. The default metric is\n"
+ "the result of the specified query.\n"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+/* include this conditionally to avoid 'zero-length printf format string'
+ * compiler warnings */
+#ifdef NP_EXTRA_OPTS
+ printf (UT_EXTRA_OPTS);
+#endif
+ printf ("\n");
+
+ printf (" %s\n", "-d, --driver=STRING");
+ printf (" %s\n", _("DBI driver to use"));
+ printf (" %s\n", "-o, --option=STRING");
+ printf (" %s\n", _("DBI driver options"));
+ printf (" %s\n", "-q, --query=STRING");
+ printf (" %s\n", _("query to execute"));
+ printf ("\n");
+
+ printf (UT_WARN_CRIT_RANGE);
+ printf (" %s\n", "-e, --expect=STRING");
+ printf (" %s\n", _("String to expect as query result"));
+ printf (" %s\n", _("Do not mix with -w, -c, -r, or -R!"));
+ printf (" %s\n", "-r, --regex=REGEX");
+ printf (" %s\n", _("Extended POSIX regular expression to check query result against"));
+ printf (" %s\n", _("Do not mix with -w, -c, -e, or -R!"));
+ printf (" %s\n", "-R, --regexi=REGEX");
+ printf (" %s\n", _("Case-insensitive extended POSIX regex to check query result against"));
+ printf (" %s\n", _("Do not mix with -w, -c, -e, or -r!"));
+ printf (" %s\n", "-m, --metric=METRIC");
+ printf (" %s\n", _("Metric to check thresholds against. Available metrics:"));
+ printf (" CONN_TIME - %s\n", _("time used for setting up the database connection"));
+ printf (" QUERY_RESULT - %s\n", _("result (first column of first row) of the query"));
+ printf (" QUERY_TIME - %s\n", _("time used to execute the query"));
+ printf (" %s\n", _("(ignore the query result)"));
+ printf ("\n");
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf (" %s\n", _("A DBI driver (-d option) is required. If the specified metric operates"));
+ printf (" %s\n\n", _("on a query, one has to be specified (-q option)."));
+
+ printf (" %s\n", _("This plugin connects to an (SQL) database using libdbi and, optionally,"));
+ printf (" %s\n", _("executes the specified query. The first column of the first row of the"));
+ printf (" %s\n", _("result will be parsed and, in QUERY_RESULT mode, compared with the"));
+ printf (" %s\n", _("warning and critical ranges. The result from the query has to be numeric"));
+ printf (" %s\n\n", _("(strings representing numbers are fine)."));
+
+ printf (" %s\n", _("The number and type of required DBI driver options depends on the actual"));
+ printf (" %s\n", _("driver. See its documentation at http://libdbi-drivers.sourceforge.net/"));
+ printf (" %s\n\n", _("for details."));
+
+ printf (" %s\n", _("Examples:"));
+ printf (" check_dbi -d pgsql -o username=postgres -m QUERY_RESULT \\\n");
+ printf (" -q 'SELECT COUNT(*) FROM pg_stat_activity' -w 5 -c 10\n");
+ printf (" Warning if more than five connections; critical if more than ten.\n\n");
+
+ printf (" check_dbi -d mysql -H localhost -o username=user -o password=secret \\\n");
+ printf (" -q 'SELECT COUNT(*) FROM logged_in_users -w 5:20 -c 0:50\n");
+ printf (" Warning if less than 5 or more than 20 users are logged in; critical\n");
+ printf (" if more than 50 users.\n\n");
+
+ printf (" check_dbi -d firebird -o username=user -o password=secret -o dbname=foo \\\n");
+ printf (" -m CONN_TIME -w 0.5 -c 2\n");
+ printf (" Warning if connecting to the database takes more than half of a second;\n");
+ printf (" critical if it takes more than 2 seconds.\n\n");
+
+ printf (" check_dbi -d mysql -H localhost -o username=user \\\n");
+ printf (" -q 'SELECT concat(@@version, \" \", @@version_comment)' \\\n");
+ printf (" -r '^5\\.[01].*MySQL Enterprise Server'\n");
+ printf (" Critical if the database server is not a MySQL enterprise server in either\n");
+ printf (" version 5.0.x or 5.1.x.\n\n");
+
+ printf (" check_dbi -d pgsql -u username=user -m SERVER_VERSION \\\n");
+ printf (" -w 090000:090099 -c 090000:090199\n");
+ printf (" Warn if the PostgreSQL server version is not 9.0.x; critical if the version\n");
+ printf (" is less than 9.x or higher than 9.1.x.\n");
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -d <DBI driver> [-o <DBI driver option> [...]] [-q <query>]\n", progname);
+ printf (" [-H <host>] [-c <critical range>] [-w <warning range>] [-m <metric>]\n");
+ printf (" [-e <string>] [-r|-R <regex>]\n");
+}
+
+#define CHECK_IGNORE_ERROR(s) \
+ do { \
+ if (metric != METRIC_QUERY_RESULT) \
+ return (s); \
+ } while (0)
+
+const char *
+get_field_str (dbi_conn conn, dbi_result res, unsigned short field_type)
+{
+ const char *str;
+
+ if (field_type != DBI_TYPE_STRING) {
+ printf ("CRITICAL - result value is not a string\n");
+ return NULL;
+ }
+
+ str = dbi_result_get_string_idx (res, 1);
+ if ((! str) || (strcmp (str, "ERROR") == 0)) {
+ CHECK_IGNORE_ERROR (NULL);
+ np_dbi_print_error (conn, "CRITICAL - failed to fetch string value");
+ return NULL;
+ }
+
+ if ((verbose && (type == TYPE_STRING)) || (verbose > 2))
+ printf ("Query returned string '%s'\n", str);
+ return str;
+}
+
+double
+get_field (dbi_conn conn, dbi_result res, unsigned short *field_type)
+{
+ double val = NAN;
+
+ if (*field_type == DBI_TYPE_INTEGER) {
+ val = (double)dbi_result_get_longlong_idx (res, 1);
+ }
+ else if (*field_type == DBI_TYPE_DECIMAL) {
+ val = dbi_result_get_double_idx (res, 1);
+ }
+ else if (*field_type == DBI_TYPE_STRING) {
+ const char *val_str;
+ char *endptr = NULL;
+
+ val_str = get_field_str (conn, res, *field_type);
+ if (! val_str) {
+ CHECK_IGNORE_ERROR (NAN);
+ *field_type = DBI_TYPE_ERROR;
+ return NAN;
+ }
+
+ val = strtod (val_str, &endptr);
+ if (endptr == val_str) {
+ CHECK_IGNORE_ERROR (NAN);
+ printf ("CRITICAL - result value is not a numeric: %s\n", val_str);
+ *field_type = DBI_TYPE_ERROR;
+ return NAN;
+ }
+ else if ((endptr != NULL) && (*endptr != '\0')) {
+ if (verbose)
+ printf ("Garbage after value: %s\n", endptr);
+ }
+ }
+ else {
+ CHECK_IGNORE_ERROR (NAN);
+ printf ("CRITICAL - cannot parse value of type %s (%i)\n",
+ (*field_type == DBI_TYPE_BINARY)
+ ? "BINARY"
+ : (*field_type == DBI_TYPE_DATETIME)
+ ? "DATETIME"
+ : "<unknown>",
+ *field_type);
+ *field_type = DBI_TYPE_ERROR;
+ return NAN;
+ }
+ return val;
+}
+
+double
+get_query_result (dbi_conn conn, dbi_result res, const char **res_val_str, double *res_val)
+{
+ unsigned short field_type;
+ double val = NAN;
+
+ if (dbi_result_get_numrows (res) == DBI_ROW_ERROR) {
+ CHECK_IGNORE_ERROR (STATE_OK);
+ np_dbi_print_error (conn, "CRITICAL - failed to fetch rows");
+ return STATE_CRITICAL;
+ }
+
+ if (dbi_result_get_numrows (res) < 1) {
+ CHECK_IGNORE_ERROR (STATE_OK);
+ printf ("WARNING - no rows returned\n");
+ return STATE_WARNING;
+ }
+
+ if (dbi_result_get_numfields (res) == DBI_FIELD_ERROR) {
+ CHECK_IGNORE_ERROR (STATE_OK);
+ np_dbi_print_error (conn, "CRITICAL - failed to fetch fields");
+ return STATE_CRITICAL;
+ }
+
+ if (dbi_result_get_numfields (res) < 1) {
+ CHECK_IGNORE_ERROR (STATE_OK);
+ printf ("WARNING - no fields returned\n");
+ return STATE_WARNING;
+ }
+
+ if (dbi_result_first_row (res) != 1) {
+ CHECK_IGNORE_ERROR (STATE_OK);
+ np_dbi_print_error (conn, "CRITICAL - failed to fetch first row");
+ return STATE_CRITICAL;
+ }
+
+ field_type = dbi_result_get_field_type_idx (res, 1);
+ if (field_type != DBI_TYPE_ERROR) {
+ if (type == TYPE_STRING)
+ /* the value will be freed in dbi_result_free */
+ *res_val_str = strdup (get_field_str (conn, res, field_type));
+ else
+ val = get_field (conn, res, &field_type);
+ }
+
+ *res_val = val;
+
+ if (field_type == DBI_TYPE_ERROR) {
+ CHECK_IGNORE_ERROR (STATE_OK);
+ np_dbi_print_error (conn, "CRITICAL - failed to fetch data");
+ return STATE_CRITICAL;
+ }
+
+ dbi_result_free (res);
+ return STATE_OK;
+}
+
+#undef CHECK_IGNORE_ERROR
+
+int
+do_query (dbi_conn conn, const char **res_val_str, double *res_val, double *res_time)
+{
+ dbi_result res;
+
+ struct timeval timeval_start, timeval_end;
+ int status = STATE_OK;
+
+ assert (np_dbi_query);
+
+ if (verbose)
+ printf ("Executing query '%s'\n", np_dbi_query);
+
+ gettimeofday (&timeval_start, NULL);
+
+ res = dbi_conn_query (conn, np_dbi_query);
+ if (! res) {
+ np_dbi_print_error (conn, "CRITICAL - failed to execute query '%s'", np_dbi_query);
+ return STATE_CRITICAL;
+ }
+
+ status = get_query_result (conn, res, res_val_str, res_val);
+
+ gettimeofday (&timeval_end, NULL);
+ *res_time = timediff (timeval_start, timeval_end);
+
+ if (verbose)
+ printf ("Time elapsed: %f\n", *res_time);
+
+ return status;
+}
+
+double
+timediff (struct timeval start, struct timeval end)
+{
+ double diff;
+
+ while (start.tv_usec > end.tv_usec) {
+ --end.tv_sec;
+ end.tv_usec += 1000000;
+ }
+ diff = (double)(end.tv_sec - start.tv_sec)
+ + (double)(end.tv_usec - start.tv_usec) / 1000000.0;
+ return diff;
+}
+
+void
+np_dbi_print_error (dbi_conn conn, char *fmt, ...)
+{
+ const char *errmsg = NULL;
+ va_list ap;
+
+ va_start (ap, fmt);
+
+ dbi_conn_error (conn, &errmsg);
+ vprintf (fmt, ap);
+ printf (": %s\n", errmsg);
+
+ va_end (ap);
+}
+
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
new file mode 100644
index 0000000..5d85ae2
--- /dev/null
+++ b/plugins/check_dig.c
@@ -0,0 +1,380 @@
+/*****************************************************************************
+*
+* Monitoring check_dig plugin
+*
+* License: GPL
+* Copyright (c) 2002-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_dig plugin
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+/* Hackers note:
+ * There are typecasts to (char *) from _("foo bar") in this file.
+ * They prevent compiler warnings. Never (ever), permute strings obtained
+ * that are typecast from (const char *) (which happens when --disable-nls)
+ * because on some architectures those strings are in non-writable memory */
+
+const char *progname = "check_dig";
+const char *copyright = "2002-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+#include "runcmd.h"
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+#define UNDEFINED 0
+#define DEFAULT_PORT 53
+#define DEFAULT_TRIES 2
+
+char *query_address = NULL;
+char *record_type = "A";
+char *expected_address = NULL;
+char *dns_server = NULL;
+char *dig_args = "";
+char *query_transport = "";
+int verbose = FALSE;
+int server_port = DEFAULT_PORT;
+int number_tries = DEFAULT_TRIES;
+double warning_interval = UNDEFINED;
+double critical_interval = UNDEFINED;
+struct timeval tv;
+
+int
+main (int argc, char **argv)
+{
+ char *command_line;
+ output chld_out, chld_err;
+ char *msg = NULL;
+ size_t i;
+ char *t;
+ long microsec;
+ double elapsed_time;
+ int result = STATE_UNKNOWN;
+ int timeout_interval_dig;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Set signal handling and alarm */
+ if (signal (SIGALRM, runcmd_timeout_alarm_handler) == SIG_ERR)
+ usage_va(_("Cannot catch SIGALRM"));
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage_va(_("Could not parse arguments"));
+
+ /* dig applies the timeout to each try, so we need to work around this */
+ timeout_interval_dig = timeout_interval / number_tries + number_tries;
+
+ /* get the command to run */
+ xasprintf (&command_line, "%s %s %s -p %d @%s %s %s +retry=%d +time=%d",
+ PATH_TO_DIG, dig_args, query_transport, server_port, dns_server, query_address, record_type, number_tries, timeout_interval_dig);
+
+ alarm (timeout_interval);
+ gettimeofday (&tv, NULL);
+
+ if (verbose) {
+ printf ("%s\n", command_line);
+ if(expected_address != NULL) {
+ printf (_("Looking for: '%s'\n"), expected_address);
+ } else {
+ printf (_("Looking for: '%s'\n"), query_address);
+ }
+ }
+
+ /* run the command */
+ if(np_runcmd(command_line, &chld_out, &chld_err, 0) != 0) {
+ result = STATE_WARNING;
+ msg = (char *)_("dig returned an error status");
+ }
+
+ for(i = 0; i < chld_out.lines; i++) {
+ /* the server is responding, we just got the host name... */
+ if (strstr (chld_out.line[i], ";; ANSWER SECTION:")) {
+
+ /* loop through the whole 'ANSWER SECTION' */
+ for(; i < chld_out.lines; i++) {
+ /* get the host address */
+ if (verbose)
+ printf ("%s\n", chld_out.line[i]);
+
+ if (strcasestr (chld_out.line[i], (expected_address == NULL ? query_address : expected_address)) != NULL) {
+ msg = chld_out.line[i];
+ result = STATE_OK;
+
+ /* Translate output TAB -> SPACE */
+ t = msg;
+ while ((t = strchr(t, '\t')) != NULL) *t = ' ';
+ break;
+ }
+ }
+
+ if (result == STATE_UNKNOWN) {
+ msg = (char *)_("Server not found in ANSWER SECTION");
+ result = STATE_WARNING;
+ }
+
+ /* we found the answer section, so break out of the loop */
+ break;
+ }
+ }
+
+ if (result == STATE_UNKNOWN) {
+ msg = (char *)_("No ANSWER SECTION found");
+ result = STATE_CRITICAL;
+ }
+
+ /* If we get anything on STDERR, at least set warning */
+ if(chld_err.buflen > 0) {
+ result = max_state(result, STATE_WARNING);
+ if(!msg) for(i = 0; i < chld_err.lines; i++) {
+ msg = strchr(chld_err.line[0], ':');
+ if(msg) {
+ msg++;
+ break;
+ }
+ }
+ }
+
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
+
+ if (critical_interval > UNDEFINED && elapsed_time > critical_interval)
+ result = STATE_CRITICAL;
+
+ else if (warning_interval > UNDEFINED && elapsed_time > warning_interval)
+ result = STATE_WARNING;
+
+ printf ("DNS %s - %.3f seconds response time (%s)|%s\n",
+ state_text (result), elapsed_time,
+ msg ? msg : _("Probably a non-existent host/domain"),
+ fperfdata("time", elapsed_time, "s",
+ (warning_interval>UNDEFINED?TRUE:FALSE),
+ warning_interval,
+ (critical_interval>UNDEFINED?TRUE:FALSE),
+ critical_interval,
+ TRUE, 0, FALSE, 0));
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"query_address", required_argument, 0, 'l'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"timeout", required_argument, 0, 't'},
+ {"dig-arguments", required_argument, 0, 'A'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"record_type", required_argument, 0, 'T'},
+ {"expected_address", required_argument, 0, 'a'},
+ {"port", required_argument, 0, 'p'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVvt:l:H:w:c:T:p:a:A:46", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'H': /* hostname */
+ host_or_die(optarg);
+ dns_server = optarg;
+ break;
+ case 'p': /* server port */
+ if (is_intpos (optarg)) {
+ server_port = atoi (optarg);
+ }
+ else {
+ usage_va(_("Port must be a positive integer - %s"), optarg);
+ }
+ break;
+ case 'l': /* address to lookup */
+ query_address = optarg;
+ break;
+ case 'w': /* warning */
+ if (is_nonnegative (optarg)) {
+ warning_interval = strtod (optarg, NULL);
+ }
+ else {
+ usage_va(_("Warning interval must be a positive integer - %s"), optarg);
+ }
+ break;
+ case 'c': /* critical */
+ if (is_nonnegative (optarg)) {
+ critical_interval = strtod (optarg, NULL);
+ }
+ else {
+ usage_va(_("Critical interval must be a positive integer - %s"), optarg);
+ }
+ break;
+ case 't': /* timeout */
+ if (is_intnonneg (optarg)) {
+ timeout_interval = atoi (optarg);
+ }
+ else {
+ usage_va(_("Timeout interval must be a positive integer - %s"), optarg);
+ }
+ break;
+ case 'A': /* dig arguments */
+ dig_args = strdup(optarg);
+ break;
+ case 'v': /* verbose */
+ verbose = TRUE;
+ break;
+ case 'T':
+ record_type = optarg;
+ break;
+ case 'a':
+ expected_address = optarg;
+ break;
+ case '4':
+ query_transport = "-4";
+ break;
+ case '6':
+ query_transport = "-6";
+ break;
+ default: /* usage5 */
+ usage5();
+ }
+ }
+
+ c = optind;
+ if (dns_server == NULL) {
+ if (c < argc) {
+ host_or_die(argv[c]);
+ dns_server = argv[c];
+ }
+ else {
+ if (strcmp(query_transport,"-6") == 0)
+ dns_server = strdup("::1");
+ else
+ dns_server = strdup ("127.0.0.1");
+ }
+ }
+
+ return validate_arguments ();
+}
+
+
+
+int
+validate_arguments (void)
+{
+ if (query_address != NULL)
+ return OK;
+ else
+ return ERROR;
+}
+
+
+
+void
+print_help (void)
+{
+ char *myport;
+
+ xasprintf (&myport, "%d", DEFAULT_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("This plugin tests the DNS service on the specified host using dig"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (" %s\n","-4, --use-ipv4");
+ printf (" %s\n",_("Force dig to only use IPv4 query transport"));
+ printf (" %s\n","-6, --use-ipv6");
+ printf (" %s\n",_("Force dig to only use IPv6 query transport"));
+ printf (" %s\n","-l, --query_address=STRING");
+ printf (" %s\n",_("Machine name to lookup"));
+ printf (" %s\n","-T, --record_type=STRING");
+ printf (" %s\n",_("Record type to lookup (default: A)"));
+ printf (" %s\n","-a, --expected_address=STRING");
+ printf (" %s\n",_("An address expected to be in the answer section. If not set, uses whatever"));
+ printf (" %s\n",_("was in -l"));
+ printf (" %s\n","-A, --dig-arguments=STRING");
+ printf (" %s\n",_("Pass STRING as argument(s) to dig"));
+ printf (UT_WARN_CRIT);
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "check_dig -H DNSSERVER -l www.example.com -A \"+tcp\"");
+ printf (" %s\n", "This will send a tcp query to DNSSERVER for www.example.com");
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -l <query_address> [-H <host>] [-p <server port>]\n", progname);
+ printf (" [-T <query type>] [-w <warning interval>] [-c <critical interval>]\n");
+ printf (" [-t <timeout>] [-a <expected answer address>] [-v]\n");
+}
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
new file mode 100644
index 0000000..2f066c7
--- /dev/null
+++ b/plugins/check_disk.c
@@ -0,0 +1,1170 @@
+/*****************************************************************************
+*
+* Monitoring check_disk plugin
+*
+* License: GPL
+* Copyright (c) 1999-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_disk plugin
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_disk";
+const char *program_name = "check_disk"; /* Required for coreutils libs */
+const char *copyright = "1999-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+
+#include "common.h"
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#include <assert.h>
+#include "popen.h"
+#include "utils.h"
+#include "utils_disk.h"
+#include <stdarg.h>
+#include "fsusage.h"
+#include "mountlist.h"
+#include "intprops.h" /* necessary for TYPE_MAXIMUM */
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#include "regex.h"
+
+#ifdef __CYGWIN__
+# include <windows.h>
+# undef ERROR
+# define ERROR -1
+#endif
+
+/* If nonzero, show even filesystems with zero size or
+ uninteresting types. */
+static int show_all_fs = 1;
+
+/* If nonzero, show only local filesystems. */
+static int show_local_fs = 0;
+
+/* If nonzero, show only local filesystems but call stat() on remote ones. */
+static int stat_remote_fs = 0;
+
+/* If positive, the units to use when printing sizes;
+ if negative, the human-readable base. */
+/* static int output_block_size; */
+
+/* If nonzero, invoke the `sync' system call before getting any usage data.
+ Using this option can make df very slow, especially with many or very
+ busy disks. Note that this may make a difference on some systems --
+ SunOs4.1.3, for one. It is *not* necessary on Linux. */
+/* static int require_sync = 0; */
+
+/* Linked list of filesystem types to display.
+ If `fs_select_list' is NULL, list all types.
+ This table is generated dynamically from command-line options,
+ rather than hardcoding into the program what it thinks are the
+ valid filesystem types; let the user specify any filesystem type
+ they want to, and if there are any filesystems of that type, they
+ will be shown.
+
+ Some filesystem types:
+ 4.2 4.3 ufs nfs swap ignore io vm efs dbg */
+
+/* static struct parameter_list *fs_select_list; */
+
+/* Linked list of filesystem types to omit.
+ If the list is empty, don't exclude any types. */
+static struct regex_list *fs_exclude_list = NULL;
+
+/* Linked list of filesystem types to check.
+ If the list is empty, include all types. */
+static struct regex_list *fs_include_list;
+
+static struct name_list *dp_exclude_list;
+
+static struct parameter_list *path_select_list = NULL;
+
+/* Linked list of mounted filesystems. */
+static struct mount_entry *mount_list;
+
+/* For long options that have no equivalent short option, use a
+ non-character as a pseudo short option, starting with CHAR_MAX + 1. */
+enum
+{
+ SYNC_OPTION = CHAR_MAX + 1,
+ NO_SYNC_OPTION,
+ BLOCK_SIZE_OPTION,
+ IGNORE_MISSING
+};
+
+#ifdef _AIX
+#pragma alloca
+#endif
+
+int process_arguments (int, char **);
+void print_path (const char *mypath);
+void set_all_thresholds (struct parameter_list *path);
+int validate_arguments (uintmax_t, uintmax_t, double, double, double, double, char *);
+void print_help (void);
+void print_usage (void);
+double calculate_percent(uintmax_t, uintmax_t);
+bool stat_path (struct parameter_list *p);
+void get_stats (struct parameter_list *p, struct fs_usage *fsp);
+void get_path_stats (struct parameter_list *p, struct fs_usage *fsp);
+
+char *exclude_device;
+char *units;
+uintmax_t mult = 1024 * 1024;
+int verbose = 0;
+int erronly = FALSE;
+int display_mntp = FALSE;
+int exact_match = FALSE;
+bool ignore_missing = false;
+int freespace_ignore_reserved = FALSE;
+int display_inodes_perfdata = FALSE;
+char *warn_freespace_units = NULL;
+char *crit_freespace_units = NULL;
+char *warn_freespace_percent = NULL;
+char *crit_freespace_percent = NULL;
+char *warn_usedspace_units = NULL;
+char *crit_usedspace_units = NULL;
+char *warn_usedspace_percent = NULL;
+char *crit_usedspace_percent = NULL;
+char *warn_usedinodes_percent = NULL;
+char *crit_usedinodes_percent = NULL;
+char *warn_freeinodes_percent = NULL;
+char *crit_freeinodes_percent = NULL;
+int path_selected = FALSE;
+bool path_ignored = false;
+char *group = NULL;
+struct stat *stat_buf;
+struct name_list *seen = NULL;
+
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+ int disk_result = STATE_UNKNOWN;
+ char *output;
+ char *ignored;
+ char *details;
+ char *perf;
+ char *perf_ilabel;
+ char *preamble = " - free space:";
+ char *ignored_preamble = " - ignored paths:";
+ char *flag_header;
+ int temp_result;
+
+ struct mount_entry *me;
+ struct fs_usage fsp;
+ struct parameter_list *temp_list, *path;
+
+#ifdef __CYGWIN__
+ char mountdir[32];
+#endif
+
+ output = strdup ("");
+ ignored = strdup ("");
+ details = strdup ("");
+ perf = strdup ("");
+ perf_ilabel = strdup ("");
+ stat_buf = malloc(sizeof *stat_buf);
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ mount_list = read_file_system_list (0);
+
+ /* Parse extra opts if any */
+ argv = np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* If a list of paths has not been selected, find entire
+ mount list and create list of paths
+ */
+ if (path_selected == FALSE && path_ignored == false) {
+ for (me = mount_list; me; me = me->me_next) {
+ if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) {
+ path = np_add_parameter(&path_select_list, me->me_mountdir);
+ }
+ path->best_match = me;
+ path->group = group;
+ set_all_thresholds(path);
+ }
+ }
+
+ if (path_ignored == false) {
+ np_set_best_match(path_select_list, mount_list, exact_match);
+ }
+
+ /* Error if no match found for specified paths */
+ temp_list = path_select_list;
+
+ while (path_select_list) {
+ if (! path_select_list->best_match && ignore_missing == true) {
+ /* If the first element will be deleted, the temp_list must be updated with the new start address as well */
+ if (path_select_list == temp_list) {
+ temp_list = path_select_list->name_next;
+ }
+ /* Add path argument to list of ignored paths to inform about missing paths being ignored and not alerted */
+ xasprintf (&ignored, "%s %s;", ignored, path_select_list->name);
+ /* Delete the path from the list so that it is not stat-checked later in the code. */
+ path_select_list = np_del_parameter(path_select_list, path_select_list->name_prev);
+ } else if (! path_select_list->best_match) {
+ /* Without --ignore-missing option, exit with Critical state. */
+ die (STATE_CRITICAL, _("DISK %s: %s not found\n"), _("CRITICAL"), path_select_list->name);
+ } else {
+ /* Continue jumping through the list */
+ path_select_list = path_select_list->name_next;
+ }
+ }
+
+ path_select_list = temp_list;
+
+ if (! path_select_list && ignore_missing == true) {
+ result = STATE_OK;
+ if (verbose >= 2) {
+ printf ("None of the provided paths were found\n");
+ }
+ }
+
+ /* Process for every path in list */
+ for (path = path_select_list; path; path=path->name_next) {
+ if (verbose >= 3 && path->freespace_percent->warning != NULL && path->freespace_percent->critical != NULL)
+ printf("Thresholds(pct) for %s warn: %f crit %f\n",
+ path->name,
+ path->freespace_percent->warning->end,
+ path->freespace_percent->critical->end);
+
+ if (verbose >= 3 && path->group != NULL)
+ printf("Group of %s: %s\n",path->name,path->group);
+
+ /* reset disk result */
+ disk_result = STATE_UNKNOWN;
+
+ me = path->best_match;
+
+ if (!me) {
+ continue;
+ }
+
+#ifdef __CYGWIN__
+ if (strncmp(path->name, "/cygdrive/", 10) != 0 || strlen(path->name) > 11)
+ continue;
+ snprintf(mountdir, sizeof(mountdir), "%s:\\", me->me_mountdir + 10);
+ if (GetDriveType(mountdir) != DRIVE_FIXED)
+ me->me_remote = 1;
+#endif
+ /* Filters */
+
+ /* Remove filesystems already seen */
+ if (np_seen_name(seen, me->me_mountdir)) {
+ continue;
+ }
+ np_add_name(&seen, me->me_mountdir);
+
+ if (path->group == NULL) {
+ /* Skip remote filesystems if we're not interested in them */
+ if (me->me_remote && show_local_fs) {
+ if (stat_remote_fs) {
+ if (!stat_path(path) && ignore_missing == true) {
+ result = STATE_OK;
+ xasprintf (&ignored, "%s %s;", ignored, path->name);
+ }
+ }
+ continue;
+ /* Skip pseudo fs's if we haven't asked for all fs's */
+ } else if (me->me_dummy && !show_all_fs) {
+ continue;
+ /* Skip excluded fstypes */
+ } else if (fs_exclude_list && np_find_regmatch (fs_exclude_list, me->me_type)) {
+ continue;
+ /* Skip excluded fs's */
+ } else if (dp_exclude_list &&
+ (np_find_name (dp_exclude_list, me->me_devname) ||
+ np_find_name (dp_exclude_list, me->me_mountdir))) {
+ continue;
+ /* Skip not included fstypes */
+ } else if (fs_include_list && !np_find_regmatch(fs_include_list, me->me_type)) {
+ continue;
+ }
+ }
+
+ if (!stat_path(path)) {
+ if (ignore_missing == true) {
+ result = STATE_OK;
+ xasprintf (&ignored, "%s %s;", ignored, path->name);
+ }
+ continue;
+ }
+ get_fs_usage (me->me_mountdir, me->me_devname, &fsp);
+
+ if (fsp.fsu_blocks && strcmp ("none", me->me_mountdir)) {
+ get_stats (path, &fsp);
+
+ if (verbose >= 3) {
+ printf ("For %s, used_pct=%g free_pct=%g used_units=%lu free_units=%lu total_units=%lu used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%lu mult=%lu\n",
+ me->me_mountdir,
+ path->dused_pct,
+ path->dfree_pct,
+ path->dused_units,
+ path->dfree_units,
+ path->dtotal_units,
+ path->dused_inodes_percent,
+ path->dfree_inodes_percent,
+ fsp.fsu_blocksize,
+ mult);
+ }
+
+ /* Threshold comparisons */
+
+ temp_result = get_status(path->dfree_units, path->freespace_units);
+ if (verbose >=3) printf("Freespace_units result=%d\n", temp_result);
+ disk_result = max_state( disk_result, temp_result );
+
+ temp_result = get_status(path->dfree_pct, path->freespace_percent);
+ if (verbose >=3) printf("Freespace%% result=%d\n", temp_result);
+ disk_result = max_state( disk_result, temp_result );
+
+ temp_result = get_status(path->dused_units, path->usedspace_units);
+ if (verbose >=3) printf("Usedspace_units result=%d\n", temp_result);
+ disk_result = max_state( disk_result, temp_result );
+
+ temp_result = get_status(path->dused_pct, path->usedspace_percent);
+ if (verbose >=3) printf("Usedspace_percent result=%d\n", temp_result);
+ disk_result = max_state( disk_result, temp_result );
+
+ temp_result = get_status(path->dused_inodes_percent, path->usedinodes_percent);
+ if (verbose >=3) printf("Usedinodes_percent result=%d\n", temp_result);
+ disk_result = max_state( disk_result, temp_result );
+
+ temp_result = get_status(path->dfree_inodes_percent, path->freeinodes_percent);
+ if (verbose >=3) printf("Freeinodes_percent result=%d\n", temp_result);
+ disk_result = max_state( disk_result, temp_result );
+
+ result = max_state(result, disk_result);
+
+ /* What a mess of units. The output shows free space, the perf data shows used space. Yikes!
+ Hack here. Trying to get warn/crit levels from freespace_(units|percent) for perf
+ data. Assumption that start=0. Roll on new syntax...
+ */
+
+ /* *_high_tide must be reinitialized at each run */
+ uint64_t warning_high_tide = UINT64_MAX;
+
+ if (path->freespace_units->warning != NULL) {
+ warning_high_tide = (path->dtotal_units - path->freespace_units->warning->end) * mult;
+ }
+ if (path->freespace_percent->warning != NULL) {
+ warning_high_tide = min( warning_high_tide, (uint64_t)((1.0 - path->freespace_percent->warning->end/100) * (path->dtotal_units * mult)) );
+ }
+
+ uint64_t critical_high_tide = UINT64_MAX;
+
+ if (path->freespace_units->critical != NULL) {
+ critical_high_tide = (path->dtotal_units - path->freespace_units->critical->end) * mult;
+ }
+ if (path->freespace_percent->critical != NULL) {
+ critical_high_tide = min( critical_high_tide, (uint64_t)((1.0 - path->freespace_percent->critical->end/100) * (path->dtotal_units * mult)) );
+ }
+
+ /* Nb: *_high_tide are unset when == UINT64_MAX */
+ xasprintf (&perf, "%s %s", perf,
+ perfdata_uint64 (
+ (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
+ path->dused_units * mult, "B",
+ (warning_high_tide == UINT64_MAX ? FALSE : TRUE), warning_high_tide,
+ (critical_high_tide == UINT64_MAX ? FALSE : TRUE), critical_high_tide,
+ TRUE, 0,
+ TRUE, path->dtotal_units * mult));
+
+ if (display_inodes_perfdata) {
+ /* *_high_tide must be reinitialized at each run */
+ warning_high_tide = UINT64_MAX;
+ critical_high_tide = UINT64_MAX;
+
+ if (path->freeinodes_percent->warning != NULL) {
+ warning_high_tide = (uint64_t) fabs( min( (double) warning_high_tide, (double) (1.0 - path->freeinodes_percent->warning->end/100)*path->inodes_total ));
+ }
+ if (path->freeinodes_percent->critical != NULL) {
+ critical_high_tide = (uint64_t) fabs( min( (double) critical_high_tide, (double) (1.0 - path->freeinodes_percent->critical->end/100)*path->inodes_total ));
+ }
+
+ xasprintf (&perf_ilabel, "%s (inodes)", (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir);
+ /* Nb: *_high_tide are unset when == UINT64_MAX */
+ xasprintf (&perf, "%s %s", perf,
+ perfdata_uint64 (perf_ilabel,
+ path->inodes_used, "",
+ (warning_high_tide != UINT64_MAX ? TRUE : FALSE), warning_high_tide,
+ (critical_high_tide != UINT64_MAX ? TRUE : FALSE), critical_high_tide,
+ TRUE, 0,
+ TRUE, path->inodes_total));
+ }
+
+ if (disk_result==STATE_OK && erronly && !verbose)
+ continue;
+
+ if(disk_result && verbose >= 1) {
+ xasprintf(&flag_header, " %s [", state_text (disk_result));
+ } else {
+ xasprintf(&flag_header, "");
+ }
+ xasprintf (&output, "%s%s %s %llu%s (%.0f%%",
+ output, flag_header,
+ (!strcmp(me->me_mountdir, "none") || display_mntp) ? me->me_devname : me->me_mountdir,
+ path->dfree_units,
+ units,
+ path->dfree_pct);
+ if (path->dused_inodes_percent < 0) {
+ xasprintf(&output, "%s inode=-)%s;", output, (disk_result ? "]" : ""));
+ } else {
+ xasprintf(&output, "%s inode=%.0f%%)%s;", output, path->dfree_inodes_percent, ((disk_result && verbose >= 1) ? "]" : ""));
+ }
+ free(flag_header);
+ }
+ }
+
+ if (verbose >= 2)
+ xasprintf (&output, "%s%s", output, details);
+
+ if (strcmp(output, "") == 0 && ! erronly) {
+ preamble = "";
+ xasprintf (&output, " - No disks were found for provided parameters;");
+ }
+
+ printf ("DISK %s%s%s%s%s|%s\n", state_text (result), ((erronly && result==STATE_OK)) ? "" : preamble, output, (strcmp(ignored, "") == 0) ? "" : ignored_preamble, ignored, perf);
+ return result;
+}
+
+
+double calculate_percent(uintmax_t value, uintmax_t total) {
+ double pct = -1;
+ /* I don't understand the below, but it is taken from coreutils' df */
+ /* Seems to be calculating pct, in the best possible way */
+ if (value <= TYPE_MAXIMUM(uintmax_t) / 100
+ && total != 0) {
+ uintmax_t u100 = value * 100;
+ pct = u100 / total + (u100 % total != 0);
+ } else {
+ /* Possible rounding errors - see coreutils' df for more explanation */
+ double u = value;
+ double t = total;
+ if (t) {
+ long int lipct = pct = u * 100 / t;
+ double ipct = lipct;
+
+ /* Like 'pct = ceil (dpct);', but without ceil - from coreutils again */
+ if (ipct - 1 < pct && pct <= ipct + 1)
+ pct = ipct + (ipct < pct);
+ }
+ }
+ return pct;
+}
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c, err;
+ struct parameter_list *se;
+ struct parameter_list *temp_list = NULL, *previous = NULL;
+ struct mount_entry *me;
+ regex_t re;
+ int cflags = REG_NOSUB | REG_EXTENDED;
+ int default_cflags = cflags;
+ char errbuf[MAX_INPUT_BUFFER];
+ int fnd = 0;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"timeout", required_argument, 0, 't'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"iwarning", required_argument, 0, 'W'},
+ /* Dang, -C is taken. We might want to reshuffle this. */
+ {"icritical", required_argument, 0, 'K'},
+ {"kilobytes", no_argument, 0, 'k'},
+ {"megabytes", no_argument, 0, 'm'},
+ {"units", required_argument, 0, 'u'},
+ {"path", required_argument, 0, 'p'},
+ {"partition", required_argument, 0, 'p'},
+ {"exclude_device", required_argument, 0, 'x'},
+ {"exclude-type", required_argument, 0, 'X'},
+ {"include-type", required_argument, 0, 'N'},
+ {"group", required_argument, 0, 'g'},
+ {"eregi-path", required_argument, 0, 'R'},
+ {"eregi-partition", required_argument, 0, 'R'},
+ {"ereg-path", required_argument, 0, 'r'},
+ {"ereg-partition", required_argument, 0, 'r'},
+ {"freespace-ignore-reserved", no_argument, 0, 'f'},
+ {"ignore-ereg-path", required_argument, 0, 'i'},
+ {"ignore-ereg-partition", required_argument, 0, 'i'},
+ {"ignore-eregi-path", required_argument, 0, 'I'},
+ {"ignore-eregi-partition", required_argument, 0, 'I'},
+ {"ignore-missing", no_argument, 0, IGNORE_MISSING},
+ {"local", no_argument, 0, 'l'},
+ {"stat-remote-fs", no_argument, 0, 'L'},
+ {"iperfdata", no_argument, 0, 'P'},
+ {"mountpoint", no_argument, 0, 'M'},
+ {"errors-only", no_argument, 0, 'e'},
+ {"exact-match", no_argument, 0, 'E'},
+ {"all", no_argument, 0, 'A'},
+ {"verbose", no_argument, 0, 'v'},
+ {"quiet", no_argument, 0, 'q'},
+ {"clear", no_argument, 0, 'C'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ np_add_regex(&fs_exclude_list, "iso9660", REG_EXTENDED);
+
+ for (c = 1; c < argc; c++)
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+
+ while (1) {
+ c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:N:mklLPg:R:r:i:I:MEA", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 't': /* timeout period */
+ if (is_integer (optarg)) {
+ timeout_interval = atoi (optarg);
+ break;
+ }
+ else {
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ }
+
+ /* See comments for 'c' */
+ case 'w': /* warning threshold */
+ if (strstr(optarg, "%")) {
+ if (*optarg == '@') {
+ warn_freespace_percent = optarg;
+ } else {
+ xasprintf(&warn_freespace_percent, "@%s", optarg);
+ }
+ } else {
+ if (*optarg == '@') {
+ warn_freespace_units = optarg;
+ } else {
+ xasprintf(&warn_freespace_units, "@%s", optarg);
+ }
+ }
+ break;
+
+ /* Awful mistake where the range values do not make sense. Normally,
+ you alert if the value is within the range, but since we are using
+ freespace, we have to alert if outside the range. Thus we artificially
+ force @ at the beginning of the range, so that it is backwards compatible
+ */
+ case 'c': /* critical threshold */
+ if (strstr(optarg, "%")) {
+ if (*optarg == '@') {
+ crit_freespace_percent = optarg;
+ } else {
+ xasprintf(&crit_freespace_percent, "@%s", optarg);
+ }
+ } else {
+ if (*optarg == '@') {
+ crit_freespace_units = optarg;
+ } else {
+ xasprintf(&crit_freespace_units, "@%s", optarg);
+ }
+ }
+ break;
+
+ case 'W': /* warning inode threshold */
+ if (*optarg == '@') {
+ warn_freeinodes_percent = optarg;
+ } else {
+ xasprintf(&warn_freeinodes_percent, "@%s", optarg);
+ }
+ break;
+ case 'K': /* critical inode threshold */
+ if (*optarg == '@') {
+ crit_freeinodes_percent = optarg;
+ } else {
+ xasprintf(&crit_freeinodes_percent, "@%s", optarg);
+ }
+ break;
+ case 'u':
+ if (units)
+ free(units);
+ if (! strcasecmp (optarg, "bytes")) {
+ mult = (uintmax_t)1;
+ units = strdup ("B");
+ } else if (!strcmp(optarg, "KiB")) {
+ mult = (uintmax_t)1024;
+ units = strdup ("KiB");
+ } else if (! strcmp (optarg, "kB")) {
+ mult = (uintmax_t)1000;
+ units = strdup ("kB");
+ } else if (!strcmp(optarg, "MiB")) {
+ mult = (uintmax_t)1024 * 1024;
+ units = strdup ("MiB");
+ } else if (! strcmp (optarg, "MB")) {
+ mult = (uintmax_t)1000 * 1000;
+ units = strdup ("MB");
+ } else if (!strcmp(optarg, "GiB")) {
+ mult = (uintmax_t)1024 * 1024 * 1024;
+ units = strdup ("GiB");
+ } else if (! strcmp (optarg, "GB")){
+ mult = (uintmax_t)1000 * 1000 * 1000;
+ units = strdup ("GB");
+ } else if (!strcmp(optarg, "TiB")) {
+ mult = (uintmax_t)1024 * 1024 * 1024 * 1024;
+ units = strdup ("TiB");
+ } else if (! strcmp (optarg, "TB")) {
+ mult = (uintmax_t)1000 * 1000 * 1000 * 1000;
+ units = strdup ("TB");
+ } else if (!strcmp(optarg, "PiB")) {
+ mult = (uintmax_t)1024 * 1024 * 1024 * 1024 * 1024;
+ units = strdup ("PiB");
+ } else if (! strcmp (optarg, "PB")){
+ mult = (uintmax_t)1000 * 1000 * 1000 * 1000 * 1000;
+ units = strdup ("PB");
+ } else {
+ die (STATE_UNKNOWN, _("unit type %s not known\n"), optarg);
+ }
+ if (units == NULL)
+ die (STATE_UNKNOWN, _("failed allocating storage for '%s'\n"), "units");
+ break;
+ case 'k': /* display mountpoint */
+ mult = 1024;
+ if (units)
+ free(units);
+ units = strdup ("kiB");
+ break;
+ case 'm': /* display mountpoint */
+ mult = 1024 * 1024;
+ if (units)
+ free(units);
+ units = strdup ("MiB");
+ break;
+ case 'L':
+ stat_remote_fs = 1;
+ /* fallthrough */
+ case 'l':
+ show_local_fs = 1;
+ break;
+ case 'P':
+ display_inodes_perfdata = 1;
+ break;
+ case 'p': /* select path */
+ if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent ||
+ crit_freespace_percent || warn_usedspace_units || crit_usedspace_units ||
+ warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent ||
+ crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) {
+ die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set a threshold value before using -p\n"));
+ }
+
+ /* add parameter if not found. overwrite thresholds if path has already been added */
+ if (! (se = np_find_parameter(path_select_list, optarg))) {
+ se = np_add_parameter(&path_select_list, optarg);
+
+ if (stat(optarg, &stat_buf[0]) && ignore_missing == true) {
+ path_ignored = true;
+ break;
+ }
+ }
+ se->group = group;
+ set_all_thresholds(se);
+
+ /* With autofs, it is required to stat() the path before re-populating the mount_list */
+ if (!stat_path(se)) {
+ break;
+ }
+ /* NB: We can't free the old mount_list "just like that": both list pointers and struct
+ * pointers are copied around. One of the reason it wasn't done yet is that other parts
+ * of check_disk need the same kind of cleanup so it'd better be done as a whole */
+ mount_list = read_file_system_list (0);
+ np_set_best_match(se, mount_list, exact_match);
+
+ path_selected = TRUE;
+ break;
+ case 'x': /* exclude path or partition */
+ np_add_name(&dp_exclude_list, optarg);
+ break;
+ case 'X': /* exclude file system type */
+ err = np_add_regex(&fs_exclude_list, optarg, REG_EXTENDED);
+ if (err != 0) {
+ regerror (err, &fs_exclude_list->regex, errbuf, MAX_INPUT_BUFFER);
+ die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"), _("Could not compile regular expression"), errbuf);
+ }
+ break;
+ case 'N': /* include file system type */
+ err = np_add_regex(&fs_include_list, optarg, REG_EXTENDED);
+ if (err != 0) {
+ regerror (err, &fs_exclude_list->regex, errbuf, MAX_INPUT_BUFFER);
+ die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"), _("Could not compile regular expression"), errbuf);
+ }
+ break;
+ case 'v': /* verbose */
+ verbose++;
+ break;
+ case 'q': /* TODO: this function should eventually go away (removed 2007-09-20) */
+ /* verbose--; **replaced by line below**. -q was only a broken way of implementing -e */
+ erronly = TRUE;
+ break;
+ case 'e':
+ erronly = TRUE;
+ break;
+ case 'E':
+ if (path_selected)
+ die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set -E before selecting paths\n"));
+ exact_match = TRUE;
+ break;
+ case 'f':
+ freespace_ignore_reserved = TRUE;
+ break;
+ case 'g':
+ if (path_selected)
+ die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set group value before selecting paths\n"));
+ group = optarg;
+ break;
+ case 'I':
+ cflags |= REG_ICASE;
+ // Intentional fallthrough
+ case 'i':
+ if (!path_selected)
+ die (STATE_UNKNOWN, "DISK %s: %s\n", _("UNKNOWN"), _("Paths need to be selected before using -i/-I. Use -A to select all paths explicitly"));
+ err = regcomp(&re, optarg, cflags);
+ if (err != 0) {
+ regerror (err, &re, errbuf, MAX_INPUT_BUFFER);
+ die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"), _("Could not compile regular expression"), errbuf);
+ }
+
+ temp_list = path_select_list;
+
+ previous = NULL;
+ while (temp_list) {
+ if (temp_list->best_match) {
+ if (np_regex_match_mount_entry(temp_list->best_match, &re)) {
+
+ if (verbose >=3)
+ printf("ignoring %s matching regex\n", temp_list->name);
+
+ temp_list = np_del_parameter(temp_list, previous);
+ /* pointer to first element needs to be updated if first item gets deleted */
+ if (previous == NULL)
+ path_select_list = temp_list;
+ } else {
+ previous = temp_list;
+ temp_list = temp_list->name_next;
+ }
+ } else {
+ previous = temp_list;
+ temp_list = temp_list->name_next;
+ }
+ }
+
+
+ cflags = default_cflags;
+ break;
+
+ case IGNORE_MISSING:
+ ignore_missing = true;
+ break;
+ case 'A':
+ optarg = strdup(".*");
+ // Intentional fallthrough
+ case 'R':
+ cflags |= REG_ICASE;
+ // Intentional fallthrough
+ case 'r':
+ if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent ||
+ crit_freespace_percent || warn_usedspace_units || crit_usedspace_units ||
+ warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent ||
+ crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) {
+ die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set a threshold value before using -r/-R/-A (--ereg-path/--eregi-path/--all)\n"));
+ }
+
+ err = regcomp(&re, optarg, cflags);
+ if (err != 0) {
+ regerror (err, &re, errbuf, MAX_INPUT_BUFFER);
+ die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"), _("Could not compile regular expression"), errbuf);
+ }
+
+ for (me = mount_list; me; me = me->me_next) {
+ if (np_regex_match_mount_entry(me, &re)) {
+ fnd = TRUE;
+ if (verbose >= 3)
+ printf("%s %s matching expression %s\n", me->me_devname, me->me_mountdir, optarg);
+
+ /* add parameter if not found. overwrite thresholds if path has already been added */
+ if (! (se = np_find_parameter(path_select_list, me->me_mountdir))) {
+ se = np_add_parameter(&path_select_list, me->me_mountdir);
+ }
+ se->group = group;
+ set_all_thresholds(se);
+ }
+ }
+
+ if (!fnd && ignore_missing == true) {
+ path_ignored = true;
+ /* path_selected = TRUE;*/
+ break;
+ } else if (!fnd)
+ die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"),
+ _("Regular expression did not match any path or disk"), optarg);
+
+ fnd = FALSE;
+ path_selected = TRUE;
+ np_set_best_match(path_select_list, mount_list, exact_match);
+ cflags = default_cflags;
+
+ break;
+ case 'M': /* display mountpoint */
+ display_mntp = TRUE;
+ break;
+ case 'C':
+ /* add all mount entries to path_select list if no partitions have been explicitly defined using -p */
+ if (path_selected == FALSE) {
+ struct parameter_list *path;
+ for (me = mount_list; me; me = me->me_next) {
+ if (! (path = np_find_parameter(path_select_list, me->me_mountdir)))
+ path = np_add_parameter(&path_select_list, me->me_mountdir);
+ path->best_match = me;
+ path->group = group;
+ set_all_thresholds(path);
+ }
+ }
+ warn_freespace_units = NULL;
+ crit_freespace_units = NULL;
+ warn_usedspace_units = NULL;
+ crit_usedspace_units = NULL;
+ warn_freespace_percent = NULL;
+ crit_freespace_percent = NULL;
+ warn_usedspace_percent = NULL;
+ crit_usedspace_percent = NULL;
+ warn_usedinodes_percent = NULL;
+ crit_usedinodes_percent = NULL;
+ warn_freeinodes_percent = NULL;
+ crit_freeinodes_percent = NULL;
+
+ path_selected = FALSE;
+ group = NULL;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case '?': /* help */
+ usage (_("Unknown argument"));
+ }
+ }
+
+ /* Support for "check_disk warn crit [fs]" with thresholds at used% level */
+ c = optind;
+ if (warn_usedspace_percent == NULL && argc > c && is_intnonneg (argv[c]))
+ warn_usedspace_percent = argv[c++];
+
+ if (crit_usedspace_percent == NULL && argc > c && is_intnonneg (argv[c]))
+ crit_usedspace_percent = argv[c++];
+
+ if (argc > c) {
+ se = np_add_parameter(&path_select_list, strdup(argv[c++]));
+ path_selected = TRUE;
+ set_all_thresholds(se);
+ }
+
+ if (units == NULL) {
+ units = strdup ("MiB");
+ mult = (uintmax_t)1024 * 1024;
+ }
+
+ return TRUE;
+}
+
+
+
+void
+print_path (const char *mypath)
+{
+ if (mypath == NULL)
+ printf ("\n");
+ else
+ printf (_(" for %s\n"), mypath);
+}
+
+
+void
+set_all_thresholds (struct parameter_list *path)
+{
+ if (path->freespace_units != NULL) free(path->freespace_units);
+ set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units);
+ if (path->freespace_percent != NULL) free (path->freespace_percent);
+ set_thresholds(&path->freespace_percent, warn_freespace_percent, crit_freespace_percent);
+ if (path->usedspace_units != NULL) free (path->usedspace_units);
+ set_thresholds(&path->usedspace_units, warn_usedspace_units, crit_usedspace_units);
+ if (path->usedspace_percent != NULL) free (path->usedspace_percent);
+ set_thresholds(&path->usedspace_percent, warn_usedspace_percent, crit_usedspace_percent);
+ if (path->usedinodes_percent != NULL) free (path->usedinodes_percent);
+ set_thresholds(&path->usedinodes_percent, warn_usedinodes_percent, crit_usedinodes_percent);
+ if (path->freeinodes_percent != NULL) free (path->freeinodes_percent);
+ set_thresholds(&path->freeinodes_percent, warn_freeinodes_percent, crit_freeinodes_percent);
+}
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin checks the amount of used disk space on a mounted file system"));
+ printf ("%s\n", _("and generates an alert if free space is less than one of the threshold values"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Exit with WARNING status if less than INTEGER units of disk are free"));
+ printf (" %s\n", "-w, --warning=PERCENT%");
+ printf (" %s\n", _("Exit with WARNING status if less than PERCENT of disk space is free"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Exit with CRITICAL status if less than INTEGER units of disk are free"));
+ printf (" %s\n", "-c, --critical=PERCENT%");
+ printf (" %s\n", _("Exit with CRITICAL status if less than PERCENT of disk space is free"));
+ printf (" %s\n", "-W, --iwarning=PERCENT%");
+ printf (" %s\n", _("Exit with WARNING status if less than PERCENT of inode space is free"));
+ printf (" %s\n", "-K, --icritical=PERCENT%");
+ printf (" %s\n", _("Exit with CRITICAL status if less than PERCENT of inode space is free"));
+ printf (" %s\n", "-p, --path=PATH, --partition=PARTITION");
+ printf (" %s\n", _("Mount point or block device as emitted by the mount(8) command (may be repeated)"));
+ printf (" %s\n", "-x, --exclude_device=PATH <STRING>");
+ printf (" %s\n", _("Ignore device (only works if -p unspecified)"));
+ printf (" %s\n", "-C, --clear");
+ printf (" %s\n", _("Clear thresholds"));
+ printf (" %s\n", "-E, --exact-match");
+ printf (" %s\n", _("For paths or partitions specified with -p, only check for exact paths"));
+ printf (" %s\n", "-e, --errors-only");
+ printf (" %s\n", _("Display only devices/mountpoints with errors"));
+ printf (" %s\n", "-f, --freespace-ignore-reserved");
+ printf (" %s\n", _("Don't account root-reserved blocks into freespace in perfdata"));
+ printf (" %s\n", "-P, --iperfdata");
+ printf (" %s\n", _("Display inode usage in perfdata"));
+ printf (" %s\n", "-g, --group=NAME");
+ printf (" %s\n", _("Group paths. Thresholds apply to (free-)space of all partitions together"));
+ printf (" %s\n", "-k, --kilobytes");
+ printf (" %s\n", _("Same as '--units kB'"));
+ printf (" %s\n", "-l, --local");
+ printf (" %s\n", _("Only check local filesystems"));
+ printf (" %s\n", "-L, --stat-remote-fs");
+ printf (" %s\n", _("Only check local filesystems against thresholds. Yet call stat on remote filesystems"));
+ printf (" %s\n", _("to test if they are accessible (e.g. to detect Stale NFS Handles)"));
+ printf (" %s\n", "-M, --mountpoint");
+ printf (" %s\n", _("Display the (block) device instead of the mount point"));
+ printf (" %s\n", "-m, --megabytes");
+ printf (" %s\n", _("Same as '--units MB'"));
+ printf (" %s\n", "-A, --all");
+ printf (" %s\n", _("Explicitly select all paths. This is equivalent to -R '.*'"));
+ printf (" %s\n", "-R, --eregi-path=PATH, --eregi-partition=PARTITION");
+ printf (" %s\n", _("Case insensitive regular expression for path/partition (may be repeated)"));
+ printf (" %s\n", "-r, --ereg-path=PATH, --ereg-partition=PARTITION");
+ printf (" %s\n", _("Regular expression for path or partition (may be repeated)"));
+ printf (" %s\n", "-I, --ignore-eregi-path=PATH, --ignore-eregi-partition=PARTITION");
+ printf (" %s\n", _("Regular expression to ignore selected path/partition (case insensitive) (may be repeated)"));
+ printf (" %s\n", "-i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION");
+ printf (" %s\n", _("Regular expression to ignore selected path or partition (may be repeated)"));
+ printf (" %s\n", "--ignore-missing");
+ printf (" %s\n", _("Return OK if no filesystem matches, filesystem does not exist or is inaccessible."));
+ printf (" %s\n", _("(Provide this option before -p / -r / --ereg-path if used)"));
+ printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (" %s\n", "-u, --units=STRING");
+ printf (" %s\n", _("Choose bytes, kB, MB, GB, TB (default: MB)"));
+ printf (UT_VERBOSE);
+ printf (" %s\n", "-X, --exclude-type=TYPE_REGEX");
+ printf (" %s\n", _("Ignore all filesystems of types matching given regex(7) (may be repeated)"));
+ printf (" %s\n", "-N, --include-type=TYPE_REGEX");
+ printf (" %s\n", _("Check only filesystems where the type matches this given regex(7) (may be repeated)"));
+
+ printf ("\n");
+ printf ("%s\n", _("General usage hints:"));
+ printf (" %s\n", _("- Arguments are positional! \"-w 5 -c 1 -p /foo -w6 -c2 -p /bar\" is not the same as"));
+ printf (" %s\n", _("\"-w 5 -c 1 -p /bar w6 -c2 -p /foo\"."));
+ printf (" %s\n", _("- The syntax is broadly: \"{thresholds a} {paths a} -C {thresholds b} {thresholds b} ...\""));
+
+
+
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /");
+ printf (" %s\n\n", _("Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"));
+ printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -g sidDATA -r '^/oracle/SID/data.*$'");
+ printf (" %s\n", _("Checks all filesystems not matching -r at 100M and 50M. The fs matching the -r regex"));
+ printf (" %s\n\n", _("are grouped which means the freespace thresholds are applied to all disks together"));
+ printf (" %s\n", "check_disk -w 100 -c 50 -C -w 1000 -c 500 -p /foo -C -w 5% -c 3% -p /bar");
+ printf (" %s\n", _("Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use 100M/50M"));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s {-w absolute_limit |-w percentage_limit%% | -W inode_percentage_limit } {-c absolute_limit|-c percentage_limit%% | -K inode_percentage_limit } {-p path | -x device}\n", progname);
+ printf ("[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]\n");
+ printf ("[-t timeout] [-u unit] [-v] [-X type_regex] [-N type]\n");
+}
+
+bool
+stat_path (struct parameter_list *p)
+{
+ /* Stat entry to check that dir exists and is accessible */
+ if (verbose >= 3)
+ printf("calling stat on %s\n", p->name);
+ if (stat (p->name, &stat_buf[0])) {
+ if (verbose >= 3)
+ printf("stat failed on %s\n", p->name);
+ if (ignore_missing == true) {
+ return false;
+ } else {
+ printf("DISK %s - ", _("CRITICAL"));
+ die (STATE_CRITICAL, _("%s %s: %s\n"), p->name, _("is not accessible"), strerror(errno));
+ }
+ }
+ return true;
+}
+
+
+void
+get_stats (struct parameter_list *p, struct fs_usage *fsp) {
+ struct parameter_list *p_list;
+ struct fs_usage tmpfsp;
+ int first = 1;
+
+ if (p->group == NULL) {
+ get_path_stats(p,fsp);
+ } else {
+ /* find all group members */
+ for (p_list = path_select_list; p_list; p_list=p_list->name_next) {
+#ifdef __CYGWIN__
+ if (strncmp(p_list->name, "/cygdrive/", 10) != 0)
+ continue;
+#endif
+ if (p_list->group && ! (strcmp(p_list->group, p->group))) {
+ if (! stat_path(p_list))
+ continue;
+ get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp);
+ get_path_stats(p_list, &tmpfsp);
+ if (verbose >= 3)
+ printf("Group %s: adding %lu blocks sized %lu, (%s) used_units=%lu free_units=%lu total_units=%lu mult=%lu\n",
+ p_list->group,
+ tmpfsp.fsu_blocks,
+ tmpfsp.fsu_blocksize,
+ p_list->best_match->me_mountdir,
+ p_list->dused_units,
+ p_list->dfree_units,
+ p_list->dtotal_units,
+ mult);
+
+ /* prevent counting the first FS of a group twice since its parameter_list entry
+ * is used to carry the information of all file systems of the entire group */
+ if (! first) {
+ p->total += p_list->total;
+ p->available += p_list->available;
+ p->available_to_root += p_list->available_to_root;
+ p->used += p_list->used;
+
+ p->dused_units += p_list->dused_units;
+ p->dfree_units += p_list->dfree_units;
+ p->dtotal_units += p_list->dtotal_units;
+ p->inodes_total += p_list->inodes_total;
+ p->inodes_free += p_list->inodes_free;
+ p->inodes_free_to_root += p_list->inodes_free_to_root;
+ p->inodes_used += p_list->inodes_used;
+ }
+ first = 0;
+ }
+ if (verbose >= 3)
+ printf("Group %s now has: used_units=%lu free_units=%lu total_units=%lu fsu_blocksize=%lu mult=%lu\n",
+ p->group,
+ p->dused_units,
+ p->dfree_units,
+ p->dtotal_units,
+ tmpfsp.fsu_blocksize,
+ mult);
+ }
+ /* modify devname and mountdir for output */
+ p->best_match->me_mountdir = p->best_match->me_devname = p->group;
+ }
+ /* finally calculate percentages for either plain FS or summed up group */
+ p->dused_pct = calculate_percent( p->used, p->used + p->available ); /* used + available can never be > uintmax */
+ p->dfree_pct = 100 - p->dused_pct;
+ p->dused_inodes_percent = calculate_percent(p->inodes_total - p->inodes_free, p->inodes_total);
+ p->dfree_inodes_percent = 100 - p->dused_inodes_percent;
+
+}
+
+void
+get_path_stats (struct parameter_list *p, struct fs_usage *fsp) {
+ p->available = fsp->fsu_bavail;
+ p->available_to_root = fsp->fsu_bfree;
+ p->used = fsp->fsu_blocks - fsp->fsu_bfree;
+ if (freespace_ignore_reserved) {
+ /* option activated : we subtract the root-reserved space from the total */
+ p->total = fsp->fsu_blocks - p->available_to_root + p->available;
+ } else {
+ /* default behaviour : take all the blocks into account */
+ p->total = fsp->fsu_blocks;
+ }
+
+ p->dused_units = p->used*fsp->fsu_blocksize/mult;
+ p->dfree_units = p->available*fsp->fsu_blocksize/mult;
+ p->dtotal_units = p->total*fsp->fsu_blocksize/mult;
+ /* Free file nodes. Not sure the workaround is required, but in case...*/
+ p->inodes_free = fsp->fsu_ffree;
+ p->inodes_free_to_root = fsp->fsu_ffree; /* Free file nodes for root. */
+ p->inodes_used = fsp->fsu_files - fsp->fsu_ffree;
+ if (freespace_ignore_reserved) {
+ /* option activated : we subtract the root-reserved inodes from the total */
+ /* not all OS report fsp->fsu_favail, only the ones with statvfs syscall */
+ /* for others, fsp->fsu_ffree == fsp->fsu_favail */
+ p->inodes_total = fsp->fsu_files - p->inodes_free_to_root + p->inodes_free;
+ } else {
+ /* default behaviour : take all the inodes into account */
+ p->inodes_total = fsp->fsu_files;
+ }
+ np_add_name(&seen, p->best_match->me_mountdir);
+}
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
new file mode 100644
index 0000000..7ffce98
--- /dev/null
+++ b/plugins/check_dns.c
@@ -0,0 +1,619 @@
+/*****************************************************************************
+*
+* Monitoring check_dns plugin
+*
+* License: GPL
+* Copyright (c) 2000-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_dns plugin
+*
+* LIMITATION: nslookup on Solaris 7 can return output over 2 lines, which
+* will not be picked up by this plugin
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_dns";
+const char *copyright = "2000-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "utils_base.h"
+#include "netutils.h"
+#include "runcmd.h"
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+int error_scan (char *, int *);
+int ip_match_cidr(const char *, const char *);
+unsigned long ip2long(const char *);
+void print_help (void);
+void print_usage (void);
+
+#define ADDRESS_LENGTH 256
+char query_address[ADDRESS_LENGTH] = "";
+char dns_server[ADDRESS_LENGTH] = "";
+char ptr_server[ADDRESS_LENGTH] = "";
+int verbose = FALSE;
+char **expected_address = NULL;
+int expected_address_cnt = 0;
+int expect_nxdomain = FALSE;
+
+int expect_authority = FALSE;
+int all_match = FALSE;
+thresholds *time_thresholds = NULL;
+
+static int
+qstrcmp(const void *p1, const void *p2)
+{
+ /* The actual arguments to this function are "pointers to
+ pointers to char", but strcmp() arguments are "pointers
+ to char", hence the following cast plus dereference */
+ return strcmp(* (char * const *) p1, * (char * const *) p2);
+}
+
+
+int
+main (int argc, char **argv)
+{
+ char *command_line = NULL;
+ char input_buffer[MAX_INPUT_BUFFER];
+ char *address = NULL; /* comma separated str with addrs/ptrs (sorted) */
+ char **addresses = NULL;
+ int n_addresses = 0;
+ char *msg = NULL;
+ char *temp_buffer = NULL;
+ int non_authoritative = FALSE;
+ int result = STATE_UNKNOWN;
+ double elapsed_time;
+ long microsec;
+ struct timeval tv;
+ int parse_address = FALSE; /* This flag scans for Address: but only after Name: */
+ output chld_out, chld_err;
+ size_t i;
+ int is_nxdomain = FALSE;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Set signal handling and alarm */
+ if (signal (SIGALRM, runcmd_timeout_alarm_handler) == SIG_ERR) {
+ usage_va(_("Cannot catch SIGALRM"));
+ }
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR) {
+ usage_va(_("Could not parse arguments"));
+ }
+
+ /* get the command to run */
+ xasprintf (&command_line, "%s %s %s", NSLOOKUP_COMMAND, query_address, dns_server);
+
+ alarm (timeout_interval);
+ gettimeofday (&tv, NULL);
+
+ if (verbose)
+ printf ("%s\n", command_line);
+
+ /* run the command */
+ if((np_runcmd(command_line, &chld_out, &chld_err, 0)) != 0) {
+ msg = (char *)_("nslookup returned an error status");
+ result = STATE_WARNING;
+ }
+
+ /* scan stdout */
+ for(i = 0; i < chld_out.lines; i++) {
+ if (addresses == NULL)
+ addresses = malloc(sizeof(*addresses)*10);
+ else if (!(n_addresses % 10))
+ addresses = realloc(addresses,sizeof(*addresses) * (n_addresses + 10));
+
+ if (verbose)
+ puts(chld_out.line[i]);
+
+ if (strcasestr (chld_out.line[i], ".in-addr.arpa") || strcasestr (chld_out.line[i], ".ip6.arpa")) {
+ if ((temp_buffer = strstr (chld_out.line[i], "name = ")))
+ addresses[n_addresses++] = strdup (temp_buffer + 7);
+ else {
+ msg = (char *)_("Warning plugin error");
+ result = STATE_WARNING;
+ }
+ }
+
+ /* bug ID: 2946553 - Older versions of bind will use all available dns
+ servers, we have to match the one specified */
+ if (strstr (chld_out.line[i], "Server:") && strlen(dns_server) > 0) {
+ temp_buffer = strchr (chld_out.line[i], ':');
+ temp_buffer++;
+
+ /* Strip leading tabs */
+ for (; *temp_buffer != '\0' && *temp_buffer == '\t'; temp_buffer++)
+ /* NOOP */;
+
+ strip(temp_buffer);
+ if (temp_buffer==NULL || strlen(temp_buffer)==0) {
+ die (STATE_CRITICAL,
+ _("DNS CRITICAL - '%s' returned empty server string\n"),
+ NSLOOKUP_COMMAND);
+ }
+
+ if (strcmp(temp_buffer, dns_server) != 0) {
+ die (STATE_CRITICAL, _("DNS CRITICAL - No response from DNS %s\n"), dns_server);
+ }
+ }
+
+ /* the server is responding, we just got the host name... */
+ if (strstr (chld_out.line[i], "Name:"))
+ parse_address = TRUE;
+ else if (parse_address == TRUE && (strstr (chld_out.line[i], "Address:") ||
+ strstr (chld_out.line[i], "Addresses:"))) {
+ temp_buffer = index (chld_out.line[i], ':');
+ temp_buffer++;
+
+ /* Strip leading spaces */
+ while (*temp_buffer == ' ')
+ temp_buffer++;
+
+ strip(temp_buffer);
+ if (temp_buffer==NULL || strlen(temp_buffer)==0) {
+ die (STATE_CRITICAL,
+ _("DNS CRITICAL - '%s' returned empty host name string\n"),
+ NSLOOKUP_COMMAND);
+ }
+
+ addresses[n_addresses++] = strdup(temp_buffer);
+ }
+ else if (strstr (chld_out.line[i], _("Non-authoritative answer:"))) {
+ non_authoritative = TRUE;
+ }
+
+
+ result = error_scan (chld_out.line[i], &is_nxdomain);
+ if (result != STATE_OK) {
+ msg = strchr (chld_out.line[i], ':');
+ if(msg) msg++;
+ break;
+ }
+ }
+
+ /* scan stderr */
+ for(i = 0; i < chld_err.lines; i++) {
+ if (verbose)
+ puts(chld_err.line[i]);
+
+ if (error_scan (chld_err.line[i], &is_nxdomain) != STATE_OK) {
+ result = max_state (result, error_scan (chld_err.line[i], &is_nxdomain));
+ msg = strchr(input_buffer, ':');
+ if(msg)
+ msg++;
+ else
+ msg = input_buffer;
+ }
+ }
+
+ if (is_nxdomain && !expect_nxdomain) {
+ die (STATE_CRITICAL, _("Domain '%s' was not found by the server\n"), query_address);
+ }
+
+ if (addresses) {
+ int i,slen;
+ char *adrp;
+ qsort(addresses, n_addresses, sizeof(*addresses), qstrcmp);
+ for(i=0, slen=1; i < n_addresses; i++) {
+ slen += strlen(addresses[i])+1;
+ }
+ adrp = address = malloc(slen);
+ for(i=0; i < n_addresses; i++) {
+ if (i) *adrp++ = ',';
+ strcpy(adrp, addresses[i]);
+ adrp += strlen(addresses[i]);
+ }
+ *adrp = 0;
+ } else
+ die (STATE_CRITICAL,
+ _("DNS CRITICAL - '%s' msg parsing exited with no address\n"),
+ NSLOOKUP_COMMAND);
+
+ /* compare to expected address */
+ if (result == STATE_OK && expected_address_cnt > 0) {
+ result = STATE_CRITICAL;
+ temp_buffer = "";
+ unsigned long expect_match = (1 << expected_address_cnt) - 1;
+ unsigned long addr_match = (1 << n_addresses) - 1;
+
+ for (i=0; i<expected_address_cnt; i++) {
+ int j;
+ /* check if we get a match on 'raw' ip or cidr */
+ for (j=0; j<n_addresses; j++) {
+ if ( strcmp(addresses[j], expected_address[i]) == 0
+ || ip_match_cidr(addresses[j], expected_address[i]) ) {
+ result = STATE_OK;
+ addr_match &= ~(1 << j);
+ expect_match &= ~(1 << i);
+ }
+ }
+
+ /* prepare an error string */
+ xasprintf(&temp_buffer, "%s%s; ", temp_buffer, expected_address[i]);
+ }
+ /* check if expected_address must cover all in addresses and none may be missing */
+ if (all_match && (expect_match != 0 || addr_match != 0))
+ result = STATE_CRITICAL;
+ if (result == STATE_CRITICAL) {
+ /* Strip off last semicolon... */
+ temp_buffer[strlen(temp_buffer)-2] = '\0';
+ xasprintf(&msg, _("expected '%s' but got '%s'"), temp_buffer, address);
+ }
+ }
+
+ if (expect_nxdomain) {
+ if (!is_nxdomain) {
+ result = STATE_CRITICAL;
+ xasprintf(&msg, _("Domain '%s' was found by the server: '%s'\n"), query_address, address);
+ } else {
+ if (address != NULL) free(address);
+ address = "NXDOMAIN";
+ }
+ }
+
+ /* check if authoritative */
+ if (result == STATE_OK && expect_authority && non_authoritative) {
+ result = STATE_CRITICAL;
+ xasprintf(&msg, _("server %s is not authoritative for %s"), dns_server, query_address);
+ }
+
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
+
+ if (result == STATE_OK) {
+ result = get_status(elapsed_time, time_thresholds);
+ if (result == STATE_OK) {
+ printf ("DNS %s: ", _("OK"));
+ } else if (result == STATE_WARNING) {
+ printf ("DNS %s: ", _("WARNING"));
+ } else if (result == STATE_CRITICAL) {
+ printf ("DNS %s: ", _("CRITICAL"));
+ }
+ printf (ngettext("%.3f second response time", "%.3f seconds response time", elapsed_time), elapsed_time);
+ printf (_(". %s returns %s"), query_address, address);
+ if ((time_thresholds->warning != NULL) && (time_thresholds->critical != NULL)) {
+ printf ("|%s\n", fperfdata ("time", elapsed_time, "s",
+ TRUE, time_thresholds->warning->end,
+ TRUE, time_thresholds->critical->end,
+ TRUE, 0, FALSE, 0));
+ } else if ((time_thresholds->warning == NULL) && (time_thresholds->critical != NULL)) {
+ printf ("|%s\n", fperfdata ("time", elapsed_time, "s",
+ FALSE, 0,
+ TRUE, time_thresholds->critical->end,
+ TRUE, 0, FALSE, 0));
+ } else if ((time_thresholds->warning != NULL) && (time_thresholds->critical == NULL)) {
+ printf ("|%s\n", fperfdata ("time", elapsed_time, "s",
+ TRUE, time_thresholds->warning->end,
+ FALSE, 0,
+ TRUE, 0, FALSE, 0));
+ } else
+ printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+ }
+ else if (result == STATE_WARNING)
+ printf (_("DNS WARNING - %s\n"),
+ !strcmp (msg, "") ? _(" Probably a non-existent host/domain") : msg);
+ else if (result == STATE_CRITICAL)
+ printf (_("DNS CRITICAL - %s\n"),
+ !strcmp (msg, "") ? _(" Probably a non-existent host/domain") : msg);
+ else
+ printf (_("DNS UNKNOWN - %s\n"),
+ !strcmp (msg, "") ? _(" Probably a non-existent host/domain") : msg);
+
+ return result;
+}
+
+int
+ip_match_cidr(const char *addr, const char *cidr_ro)
+{
+ char *subnet, *mask_c, *cidr = strdup(cidr_ro);
+ int mask;
+ subnet = strtok(cidr, "/");
+ mask_c = strtok(NULL, "\0");
+ if (!subnet || !mask_c)
+ return FALSE;
+ mask = atoi(mask_c);
+
+ /* https://www.cryptobells.com/verifying-ips-in-a-subnet-in-php/ */
+ return (ip2long(addr) & ~((1 << (32 - mask)) - 1)) == (ip2long(subnet) >> (32 - mask)) << (32 - mask);
+}
+
+unsigned long
+ip2long(const char* src) {
+ unsigned long ip[4];
+ /* http://computer-programming-forum.com/47-c-language/1376ffb92a12c471.htm */
+ return (sscanf(src, "%3lu.%3lu.%3lu.%3lu",
+ &ip[0], &ip[1], &ip[2], &ip[3]) == 4 &&
+ ip[0] < 256 && ip[1] < 256 &&
+ ip[2] < 256 && ip[3] < 256)
+ ? ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3]
+ : 0;
+}
+
+int
+error_scan (char *input_buffer, int *is_nxdomain)
+{
+
+ const int nxdomain = strstr (input_buffer, "Non-existent") ||
+ strstr (input_buffer, "** server can't find") ||
+ strstr (input_buffer, "** Can't find") ||
+ strstr (input_buffer, "NXDOMAIN");
+ if (nxdomain) *is_nxdomain = TRUE;
+
+ /* the DNS lookup timed out */
+ if (strstr (input_buffer, _("Note: nslookup is deprecated and may be removed from future releases.")) ||
+ strstr (input_buffer, _("Consider using the `dig' or `host' programs instead. Run nslookup with")) ||
+ strstr (input_buffer, _("the `-sil[ent]' option to prevent this message from appearing.")))
+ return STATE_OK;
+
+ /* DNS server is not running... */
+ else if (strstr (input_buffer, "No response from server"))
+ die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server);
+ else if (strstr (input_buffer, "no servers could be reached"))
+ die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server);
+
+ /* Host name is valid, but server doesn't have records... */
+ else if (strstr (input_buffer, "No records"))
+ die (STATE_CRITICAL, _("DNS %s has no records\n"), dns_server);
+
+ /* Connection was refused */
+ else if (strstr (input_buffer, "Connection refused") ||
+ strstr (input_buffer, "Couldn't find server") ||
+ strstr (input_buffer, "Refused") ||
+ (strstr (input_buffer, "** server can't find") &&
+ strstr (input_buffer, ": REFUSED")))
+ die (STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server);
+
+ /* Query refused (usually by an ACL in the namserver) */
+ else if (strstr (input_buffer, "Query refused"))
+ die (STATE_CRITICAL, _("Query was refused by DNS server at %s\n"), dns_server);
+
+ /* No information (e.g. nameserver IP has two PTR records) */
+ else if (strstr (input_buffer, "No information"))
+ die (STATE_CRITICAL, _("No information returned by DNS server at %s\n"), dns_server);
+
+ /* Network is unreachable */
+ else if (strstr (input_buffer, "Network is unreachable"))
+ die (STATE_CRITICAL, _("Network is unreachable\n"));
+
+ /* Internal server failure */
+ else if (strstr (input_buffer, "Server failure"))
+ die (STATE_CRITICAL, _("DNS failure for %s\n"), dns_server);
+
+ /* Request error or the DNS lookup timed out */
+ else if (strstr (input_buffer, "Format error") ||
+ strstr (input_buffer, "Timed out"))
+ return STATE_WARNING;
+
+ return STATE_OK;
+
+}
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ char *warning = NULL;
+ char *critical = NULL;
+
+ int opt_index = 0;
+ static struct option long_opts[] = {
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"verbose", no_argument, 0, 'v'},
+ {"timeout", required_argument, 0, 't'},
+ {"hostname", required_argument, 0, 'H'},
+ {"server", required_argument, 0, 's'},
+ {"reverse-server", required_argument, 0, 'r'},
+ {"expected-address", required_argument, 0, 'a'},
+ {"expect-nxdomain", no_argument, 0, 'n'},
+ {"expect-authority", no_argument, 0, 'A'},
+ {"all", no_argument, 0, 'L'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++)
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVvALnt:H:s:r:a:w:c:", long_opts, &opt_index);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'v': /* version */
+ verbose = TRUE;
+ break;
+ case 't': /* timeout period */
+ timeout_interval = atoi (optarg);
+ break;
+ case 'H': /* hostname */
+ if (strlen (optarg) >= ADDRESS_LENGTH)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ strcpy (query_address, optarg);
+ break;
+ case 's': /* server name */
+ /* TODO: this host_or_die check is probably unnecessary.
+ * Better to confirm nslookup response matches */
+ host_or_die(optarg);
+ if (strlen (optarg) >= ADDRESS_LENGTH)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ strcpy (dns_server, optarg);
+ break;
+ case 'r': /* reverse server name */
+ /* TODO: Is this host_or_die necessary? */
+ host_or_die(optarg);
+ if (strlen (optarg) >= ADDRESS_LENGTH)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ strcpy (ptr_server, optarg);
+ break;
+ case 'a': /* expected address */
+ if (strlen (optarg) >= ADDRESS_LENGTH)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ if (strchr(optarg, ',') != NULL) {
+ char *comma = strchr(optarg, ',');
+ while (comma != NULL) {
+ expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**));
+ expected_address[expected_address_cnt] = strndup(optarg, comma - optarg);
+ expected_address_cnt++;
+ optarg = comma + 1;
+ comma = strchr(optarg, ',');
+ }
+ expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**));
+ expected_address[expected_address_cnt] = strdup(optarg);
+ expected_address_cnt++;
+ } else {
+ expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**));
+ expected_address[expected_address_cnt] = strdup(optarg);
+ expected_address_cnt++;
+ }
+ break;
+ case 'n': /* expect NXDOMAIN */
+ expect_nxdomain = TRUE;
+ break;
+ case 'A': /* expect authority */
+ expect_authority = TRUE;
+ break;
+ case 'L': /* all must match */
+ all_match = TRUE;
+ break;
+ case 'w':
+ warning = optarg;
+ break;
+ case 'c':
+ critical = optarg;
+ break;
+ default: /* args not parsable */
+ usage5();
+ }
+ }
+
+ c = optind;
+ if (strlen(query_address)==0 && c<argc) {
+ if (strlen(argv[c])>=ADDRESS_LENGTH)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ strcpy (query_address, argv[c++]);
+ }
+
+ if (strlen(dns_server)==0 && c<argc) {
+ /* TODO: See -s option */
+ host_or_die(argv[c]);
+ if (strlen(argv[c]) >= ADDRESS_LENGTH)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ strcpy (dns_server, argv[c++]);
+ }
+
+ set_thresholds(&time_thresholds, warning, critical);
+
+ return validate_arguments ();
+}
+
+
+int
+validate_arguments ()
+{
+ if (query_address[0] == 0) {
+ printf ("missing --host argument\n");
+ return ERROR;
+ }
+
+ if (expected_address_cnt > 0 && expect_nxdomain) {
+ printf ("--expected-address and --expect-nxdomain cannot be combined\n");
+ return ERROR;
+ }
+
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin uses the nslookup program to obtain the IP address for the given host/domain query."));
+ printf ("%s\n", _("An optional DNS server to use may be specified."));
+ printf ("%s\n", _("If no DNS server is specified, the default server(s) specified in /etc/resolv.conf will be used."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" -H, --hostname=HOST\n");
+ printf (" %s\n", _("The name or address you want to query"));
+ printf (" -s, --server=HOST\n");
+ printf (" %s\n", _("Optional DNS server you want to use for the lookup"));
+ printf (" -a, --expected-address=IP-ADDRESS|CIDR|HOST\n");
+ printf (" %s\n", _("Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end"));
+ printf (" %s\n", _("with a dot (.). This option can be repeated multiple times (Returns OK if any"));
+ printf (" %s\n", _("value matches)."));
+ printf (" -n, --expect-nxdomain\n");
+ printf (" %s\n", _("Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)"));
+ printf (" %s\n", _("Cannot be used together with -a"));
+ printf (" -A, --expect-authority\n");
+ printf (" %s\n", _("Optionally expect the DNS server to be authoritative for the lookup"));
+ printf (" -w, --warning=seconds\n");
+ printf (" %s\n", _("Return warning if elapsed time exceeds value. Default off"));
+ printf (" -c, --critical=seconds\n");
+ printf (" %s\n", _("Return critical if elapsed time exceeds value. Default off"));
+ printf (" -L, --all\n");
+ printf (" %s\n", _("Return critical if the list of expected addresses does not match all addresses"));
+ printf (" %s\n", _("returned. Default off"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host [-s server] [-a expected-address] [-n] [-A] [-t timeout] [-w warn] [-c crit] [-L]\n", progname);
+}
diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c
new file mode 100644
index 0000000..212a134
--- /dev/null
+++ b/plugins/check_dummy.c
@@ -0,0 +1,124 @@
+/*****************************************************************************
+*
+* Monitoring check_dummy plugin
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_dummy plugin
+*
+* This plugin will simply return the state corresponding to the numeric value
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_dummy";
+const char *copyright = "1999-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+
+void print_help (void);
+void print_usage (void);
+
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ if (argc < 2)
+ usage4 (_("Could not parse arguments"));
+ else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ }
+ else if (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) {
+ print_help ();
+ exit (STATE_UNKNOWN);
+ }
+ else if (!is_integer (argv[1]))
+ usage4 (_("Arguments to check_dummy must be an integer"));
+ else
+ result = atoi (argv[1]);
+
+ switch (result) {
+ case STATE_OK:
+ printf (_("OK"));
+ break;
+ case STATE_WARNING:
+ printf (_("WARNING"));
+ break;
+ case STATE_CRITICAL:
+ printf (_("CRITICAL"));
+ break;
+ case STATE_UNKNOWN:
+ printf (_("UNKNOWN"));
+ break;
+ default:
+ printf (_("UNKNOWN"));
+ printf (": ");
+ printf (_("Status %d is not a supported error state\n"), result);
+ return STATE_UNKNOWN;
+ }
+
+ if (argc >= 3)
+ printf (": %s", argv[2]);
+
+ printf("\n");
+
+ return result;
+}
+
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin will simply return the state corresponding to the numeric value"));
+
+ printf ("%s\n", _("of the <state> argument with optional text"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s <integer state> [optional text]\n", progname);
+}
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
new file mode 100644
index 0000000..23a9e99
--- /dev/null
+++ b/plugins/check_fping.c
@@ -0,0 +1,527 @@
+/*****************************************************************************
+*
+* Monitoring check_fping plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_disk plugin
+*
+* This plugin will use the fping command to ping the specified host for a
+* fast check
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_fping";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "popen.h"
+#include "netutils.h"
+#include "utils.h"
+#include <stdbool.h>
+
+enum {
+ PACKET_COUNT = 1,
+ PACKET_SIZE = 56,
+ PL = 0,
+ RTA = 1
+};
+
+int textscan (char *buf);
+int process_arguments (int, char **);
+int get_threshold (char *arg, char *rv[2]);
+void print_help (void);
+void print_usage (void);
+
+char *server_name = NULL;
+char *sourceip = NULL;
+char *sourceif = NULL;
+int packet_size = PACKET_SIZE;
+int packet_count = PACKET_COUNT;
+int target_timeout = 0;
+int packet_interval = 0;
+int verbose = FALSE;
+int cpl;
+int wpl;
+double crta;
+double wrta;
+int cpl_p = FALSE;
+int wpl_p = FALSE;
+bool alive_p = FALSE;
+int crta_p = FALSE;
+int wrta_p = FALSE;
+
+int
+main (int argc, char **argv)
+{
+/* normally should be int result = STATE_UNKNOWN; */
+
+ int status = STATE_UNKNOWN;
+ int result = 0;
+ char *fping_prog = NULL;
+ char *server = NULL;
+ char *command_line = NULL;
+ char *input_buffer = NULL;
+ char *option_string = "";
+ input_buffer = malloc (MAX_INPUT_BUFFER);
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ server = strscpy (server, server_name);
+
+ /* compose the command */
+ if (target_timeout)
+ xasprintf(&option_string, "%s-t %d ", option_string, target_timeout);
+ if (packet_interval)
+ xasprintf(&option_string, "%s-p %d ", option_string, packet_interval);
+ if (sourceip)
+ xasprintf(&option_string, "%s-S %s ", option_string, sourceip);
+ if (sourceif)
+ xasprintf(&option_string, "%s-I %s ", option_string, sourceif);
+
+#ifdef PATH_TO_FPING6
+ if (address_family != AF_INET && is_inet6_addr(server))
+ fping_prog = strdup(PATH_TO_FPING6);
+ else
+ fping_prog = strdup(PATH_TO_FPING);
+#else
+ fping_prog = strdup(PATH_TO_FPING);
+#endif
+
+ xasprintf (&command_line, "%s %s-b %d -c %d %s", fping_prog,
+ option_string, packet_size, packet_count, server);
+
+ if (verbose)
+ printf ("%s\n", command_line);
+
+ /* run the command */
+ child_process = spopen (command_line);
+ if (child_process == NULL) {
+ printf (_("Could not open pipe: %s\n"), command_line);
+ return STATE_UNKNOWN;
+ }
+
+ child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
+ if (child_stderr == NULL) {
+ printf (_("Could not open stderr for %s\n"), command_line);
+ }
+
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
+ if (verbose)
+ printf ("%s", input_buffer);
+ status = max_state (status, textscan (input_buffer));
+ }
+
+ /* If we get anything on STDERR, at least set warning */
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) {
+ status = max_state (status, STATE_WARNING);
+ if (verbose)
+ printf ("%s", input_buffer);
+ status = max_state (status, textscan (input_buffer));
+ }
+ (void) fclose (child_stderr);
+
+ /* close the pipe */
+ result = spclose (child_process);
+ if (result) {
+ /* need to use max_state not max */
+ status = max_state (status, STATE_WARNING);
+ }
+
+ if (result > 1 ) {
+ status = max_state (status, STATE_UNKNOWN);
+ if (result == 2) {
+ die (STATE_UNKNOWN, _("FPING UNKNOWN - IP address not found\n"));
+ }
+ if (result == 3) {
+ die (STATE_UNKNOWN, _("FPING UNKNOWN - invalid commandline argument\n"));
+ }
+ if (result == 4) {
+ die (STATE_UNKNOWN, _("FPING UNKNOWN - failed system call\n"));
+ }
+
+ }
+
+ printf ("FPING %s - %s\n", state_text (status), server_name);
+
+ return status;
+}
+
+
+int textscan (char *buf) {
+ char *rtastr = NULL;
+ char *losstr = NULL;
+ char *xmtstr = NULL;
+ double loss;
+ double rta;
+ double xmt;
+ int status = STATE_UNKNOWN;
+
+ /* stops testing after the first successful reply. */
+ if (alive_p && strstr(buf, "avg, 0% loss)")) {
+ rtastr = strstr (buf, "ms (");
+ rtastr = 1 + index(rtastr, '(');
+ rta = strtod(rtastr, NULL);
+ loss=strtod("0",NULL);
+ die (STATE_OK,
+ _("FPING %s - %s (rta=%f ms)|%s\n"),
+ state_text (STATE_OK), server_name,rta,
+ /* No loss since we only waited for the first reply
+ perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, TRUE, 0, TRUE, 100), */
+ fperfdata ("rta", rta/1.0e3, "s", wrta_p, wrta/1.0e3, crta_p, crta/1.0e3, TRUE, 0, FALSE, 0));
+ }
+
+ if (strstr (buf, "not found")) {
+ die (STATE_CRITICAL, _("FPING UNKNOWN - %s not found\n"), server_name);
+
+ }
+ else if (strstr (buf, "is unreachable") || strstr (buf, "Unreachable")) {
+ die (STATE_CRITICAL, _("FPING CRITICAL - %s is unreachable\n"),
+ "host");
+
+ }
+ else if (strstr (buf, "Operation not permitted") || strstr (buf, "No such device") ) {
+ die (STATE_UNKNOWN, _("FPING UNKNOWN - %s parameter error\n"),
+ "host");
+ }
+ else if (strstr (buf, "is down")) {
+ die (STATE_CRITICAL, _("FPING CRITICAL - %s is down\n"), server_name);
+
+ }
+ else if (strstr (buf, "is alive")) {
+ status = STATE_OK;
+
+ }
+ else if (strstr (buf, "xmt/rcv/%loss") && strstr (buf, "min/avg/max")) {
+ losstr = strstr (buf, "=");
+ losstr = 1 + strstr (losstr, "/");
+ losstr = 1 + strstr (losstr, "/");
+ rtastr = strstr (buf, "min/avg/max");
+ rtastr = strstr (rtastr, "=");
+ rtastr = 1 + index (rtastr, '/');
+ loss = strtod (losstr, NULL);
+ rta = strtod (rtastr, NULL);
+ if (cpl_p == TRUE && loss > cpl)
+ status = STATE_CRITICAL;
+ else if (crta_p == TRUE && rta > crta)
+ status = STATE_CRITICAL;
+ else if (wpl_p == TRUE && loss > wpl)
+ status = STATE_WARNING;
+ else if (wrta_p == TRUE && rta > wrta)
+ status = STATE_WARNING;
+ else
+ status = STATE_OK;
+ die (status,
+ _("FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"),
+ state_text (status), server_name, loss, rta,
+ perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, TRUE, 0, TRUE, 100),
+ fperfdata ("rta", rta/1.0e3, "s", wrta_p, wrta/1.0e3, crta_p, crta/1.0e3, TRUE, 0, FALSE, 0));
+
+ }
+ else if(strstr (buf, "xmt/rcv/%loss") ) {
+ /* no min/max/avg if host was unreachable in fping v2.2.b1 */
+ /* in v2.4b2: 10.99.0.1 : xmt/rcv/%loss = 0/0/0% */
+ losstr = strstr (buf, "=");
+ xmtstr = 1 + losstr;
+ xmt = strtod (xmtstr, NULL);
+ if(xmt == 0)
+ die (STATE_CRITICAL, _("FPING CRITICAL - %s is down\n"), server_name);
+ losstr = 1 + strstr (losstr, "/");
+ losstr = 1 + strstr (losstr, "/");
+ loss = strtod (losstr, NULL);
+ if (atoi(losstr) == 100)
+ status = STATE_CRITICAL;
+ else if (cpl_p == TRUE && loss > cpl)
+ status = STATE_CRITICAL;
+ else if (wpl_p == TRUE && loss > wpl)
+ status = STATE_WARNING;
+ else
+ status = STATE_OK;
+ /* loss=%.0f%%;%d;%d;0;100 */
+ die (status, _("FPING %s - %s (loss=%.0f%% )|%s\n"),
+ state_text (status), server_name, loss ,
+ perfdata ("loss", (long int)loss, "%", wpl_p, wpl, cpl_p, cpl, TRUE, 0, TRUE, 100));
+
+ }
+ else {
+ status = max_state (status, STATE_WARNING);
+ }
+
+ return status;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ char *rv[2];
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"sourceip", required_argument, 0, 'S'},
+ {"sourceif", required_argument, 0, 'I'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"alive", no_argument, 0, 'a'},
+ {"bytes", required_argument, 0, 'b'},
+ {"number", required_argument, 0, 'n'},
+ {"target-timeout", required_argument, 0, 'T'},
+ {"interval", required_argument, 0, 'i'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {0, 0, 0, 0}
+ };
+
+ rv[PL] = NULL;
+ rv[RTA] = NULL;
+
+ if (argc < 2)
+ return ERROR;
+
+ if (!is_option (argv[1])) {
+ server_name = argv[1];
+ argv[1] = argv[0];
+ argv = &argv[1];
+ argc--;
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVvaH:S:c:w:b:n:T:i:I:46", longopts, &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'a': /* host alive mode */
+ alive_p = TRUE;
+ break;
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'v': /* verbose mode */
+ verbose = TRUE;
+ break;
+ case 'H': /* hostname */
+ if (is_host (optarg) == FALSE) {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ server_name = strscpy (server_name, optarg);
+ break;
+ case 'S': /* sourceip */
+ if (is_host (optarg) == FALSE) {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ sourceip = strscpy (sourceip, optarg);
+ break;
+ case 'I': /* sourceip */
+ sourceif = strscpy (sourceif, optarg);
+ break;
+ case '4': /* IPv4 only */
+ address_family = AF_INET;
+ break;
+ case '6': /* IPv6 only */
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage (_("IPv6 support not available\n"));
+#endif
+ break;
+ case 'c':
+ get_threshold (optarg, rv);
+ if (rv[RTA]) {
+ crta = strtod (rv[RTA], NULL);
+ crta_p = TRUE;
+ rv[RTA] = NULL;
+ }
+ if (rv[PL]) {
+ cpl = atoi (rv[PL]);
+ cpl_p = TRUE;
+ rv[PL] = NULL;
+ }
+ break;
+ case 'w':
+ get_threshold (optarg, rv);
+ if (rv[RTA]) {
+ wrta = strtod (rv[RTA], NULL);
+ wrta_p = TRUE;
+ rv[RTA] = NULL;
+ }
+ if (rv[PL]) {
+ wpl = atoi (rv[PL]);
+ wpl_p = TRUE;
+ rv[PL] = NULL;
+ }
+ break;
+ case 'b': /* bytes per packet */
+ if (is_intpos (optarg))
+ packet_size = atoi (optarg);
+ else
+ usage (_("Packet size must be a positive integer"));
+ break;
+ case 'n': /* number of packets */
+ if (is_intpos (optarg))
+ packet_count = atoi (optarg);
+ else
+ usage (_("Packet count must be a positive integer"));
+ break;
+ case 'T': /* timeout in msec */
+ if (is_intpos (optarg))
+ target_timeout = atoi (optarg);
+ else
+ usage (_("Target timeout must be a positive integer"));
+ break;
+ case 'i': /* interval in msec */
+ if (is_intpos (optarg))
+ packet_interval = atoi (optarg);
+ else
+ usage (_("Interval must be a positive integer"));
+ break;
+ }
+ }
+
+ if (server_name == NULL)
+ usage4 (_("Hostname was not supplied"));
+
+ return OK;
+}
+
+
+int
+get_threshold (char *arg, char *rv[2])
+{
+ char *arg1 = NULL;
+ char *arg2 = NULL;
+
+ arg1 = strscpy (arg1, arg);
+ if (strpbrk (arg1, ",:"))
+ arg2 = 1 + strpbrk (arg1, ",:");
+
+ if (arg2) {
+ arg1[strcspn (arg1, ",:")] = 0;
+ if (strstr (arg1, "%") && strstr (arg2, "%"))
+ die (STATE_UNKNOWN,
+ _("%s: Only one threshold may be packet loss (%s)\n"), progname,
+ arg);
+ if (!strstr (arg1, "%") && !strstr (arg2, "%"))
+ die (STATE_UNKNOWN,
+ _("%s: Only one threshold must be packet loss (%s)\n"),
+ progname, arg);
+ }
+
+ if (arg2 && strstr (arg2, "%")) {
+ rv[PL] = arg2;
+ rv[RTA] = arg1;
+ }
+ else if (arg2) {
+ rv[PL] = arg1;
+ rv[RTA] = arg2;
+ }
+ else if (strstr (arg1, "%")) {
+ rv[PL] = arg1;
+ }
+ else {
+ rv[RTA] = arg1;
+ }
+
+ return OK;
+}
+
+
+void print_help (void) {
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Didi Rieder <adrieder@sbox.tu-graz.ac.at>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin will use the fping command to ping the specified host for a fast check"));
+
+ printf ("%s\n", _("Note that it is necessary to set the suid flag on fping."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_IPv46);
+
+ printf (" %s\n", "-H, --hostname=HOST");
+ printf (" %s\n", _("name or IP Address of host to ping (IP Address bypasses name lookup, reducing system load)"));
+ printf (" %s\n", "-w, --warning=THRESHOLD");
+ printf (" %s\n", _("warning threshold pair"));
+ printf (" %s\n", "-c, --critical=THRESHOLD");
+ printf (" %s\n", _("critical threshold pair"));
+ printf (" %s\n", "-a, --alive");
+ printf (" %s\n", _("Return OK after first successful reply"));
+ printf (" %s\n", "-b, --bytes=INTEGER");
+ printf (" %s (default: %d)\n", _("size of ICMP packet"),PACKET_SIZE);
+ printf (" %s\n", "-n, --number=INTEGER");
+ printf (" %s (default: %d)\n", _("number of ICMP packets to send"),PACKET_COUNT);
+ printf (" %s\n", "-T, --target-timeout=INTEGER");
+ printf (" %s (default: fping's default for -t)\n", _("Target timeout (ms)"));
+ printf (" %s\n", "-i, --interval=INTEGER");
+ printf (" %s (default: fping's default for -p)\n", _("Interval (ms) between sending packets"));
+ printf (" %s\n", "-S, --sourceip=HOST");
+ printf (" %s\n", _("name or IP Address of sourceip"));
+ printf (" %s\n", "-I, --sourceif=IF");
+ printf (" %s\n", _("source interface name"));
+ printf (UT_VERBOSE);
+ printf ("\n");
+ printf (" %s\n", _("THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time (ms)"));
+ printf (" %s\n", _("which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"));
+ printf (" %s\n", _("packet loss to trigger an alarm state."));
+
+ printf ("\n");
+ printf (" %s\n", _("IPv4 is used by default. Specify -6 to use IPv6."));
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s <host_address> -w limit -c limit [-b size] [-n number] [-T number] [-i number]\n", progname);
+}
diff --git a/plugins/check_game.c b/plugins/check_game.c
new file mode 100644
index 0000000..a534b69
--- /dev/null
+++ b/plugins/check_game.c
@@ -0,0 +1,348 @@
+/*****************************************************************************
+*
+* Monitoring check_game plugin
+*
+* License: GPL
+* Copyright (c) 2002-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_game plugin
+*
+* This plugin tests game server connections with the specified host.
+* using the qstat program
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_game";
+const char *copyright = "2002-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "runcmd.h"
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+#define QSTAT_DATA_DELIMITER ","
+
+#define QSTAT_HOST_ERROR "ERROR"
+#define QSTAT_HOST_DOWN "DOWN"
+#define QSTAT_HOST_TIMEOUT "TIMEOUT"
+#define QSTAT_MAX_RETURN_ARGS 12
+
+char *server_ip;
+char *game_type;
+int port = 0;
+
+int verbose;
+
+int qstat_game_players_max = -1;
+int qstat_game_players = -1;
+int qstat_game_field = -1;
+int qstat_map_field = -1;
+int qstat_ping_field = -1;
+
+
+int
+main (int argc, char **argv)
+{
+ char *command_line;
+ int result = STATE_UNKNOWN;
+ char *p, *ret[QSTAT_MAX_RETURN_ARGS];
+ size_t i = 0;
+ output chld_out;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage_va(_("Could not parse arguments"));
+
+ result = STATE_OK;
+
+ /* create the command line to execute */
+ xasprintf (&command_line, "%s -raw %s -%s %s",
+ PATH_TO_QSTAT, QSTAT_DATA_DELIMITER, game_type, server_ip);
+
+ if (port)
+ xasprintf (&command_line, "%s:%-d", command_line, port);
+
+ if (verbose > 0)
+ printf ("%s\n", command_line);
+
+ /* run the command. historically, this plugin ignores output on stderr,
+ * as well as return status of the qstat program */
+ (void)np_runcmd(command_line, &chld_out, NULL, 0);
+
+ /* sanity check */
+ /* was thinking about running qstat without any options, capturing the
+ -default line, parsing it & making an array of all know server types
+ but thought this would be too much hassle considering this is a tool
+ for intelligent sysadmins (ha). Could put a static array of known
+ server types in a header file but then we'd be limiting ourselves
+
+ In the end, I figured I'd simply let an error occur & then trap it
+ */
+
+ if (!strncmp (chld_out.line[0], "unknown option", 14)) {
+ printf (_("CRITICAL - Host type parameter incorrect!\n"));
+ result = STATE_CRITICAL;
+ return result;
+ }
+
+ p = (char *) strtok (chld_out.line[0], QSTAT_DATA_DELIMITER);
+ while (p != NULL) {
+ ret[i] = p;
+ p = (char *) strtok (NULL, QSTAT_DATA_DELIMITER);
+ i++;
+ if (i >= QSTAT_MAX_RETURN_ARGS)
+ break;
+ }
+
+ if (strstr (ret[2], QSTAT_HOST_ERROR)) {
+ printf (_("CRITICAL - Host not found\n"));
+ result = STATE_CRITICAL;
+ }
+ else if (strstr (ret[2], QSTAT_HOST_DOWN)) {
+ printf (_("CRITICAL - Game server down or unavailable\n"));
+ result = STATE_CRITICAL;
+ }
+ else if (strstr (ret[2], QSTAT_HOST_TIMEOUT)) {
+ printf (_("CRITICAL - Game server timeout\n"));
+ result = STATE_CRITICAL;
+ }
+ else {
+ printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n",
+ ret[qstat_game_players],
+ ret[qstat_game_players_max],
+ ret[qstat_game_field],
+ ret[qstat_map_field],
+ ret[qstat_ping_field],
+ perfdata ("players", atol(ret[qstat_game_players]), "",
+ FALSE, 0, FALSE, 0,
+ TRUE, 0, TRUE, atol(ret[qstat_game_players_max])),
+ fperfdata ("ping", strtod(ret[qstat_ping_field], NULL), "",
+ FALSE, 0, FALSE, 0,
+ TRUE, 0, FALSE, 0));
+ }
+
+ return result;
+}
+
+
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int opt_index = 0;
+ static struct option long_opts[] = {
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"verbose", no_argument, 0, 'v'},
+ {"timeout", required_argument, 0, 't'},
+ {"hostname", required_argument, 0, 'H'},
+ {"port", required_argument, 0, 'P'},
+ {"game-type", required_argument, 0, 'G'},
+ {"map-field", required_argument, 0, 'm'},
+ {"ping-field", required_argument, 0, 'p'},
+ {"game-field", required_argument, 0, 'g'},
+ {"players-field", required_argument, 0, 129},
+ {"max-players-field", required_argument, 0, 130},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-mf", argv[c]) == 0)
+ strcpy (argv[c], "-m");
+ else if (strcmp ("-pf", argv[c]) == 0)
+ strcpy (argv[c], "-p");
+ else if (strcmp ("-gf", argv[c]) == 0)
+ strcpy (argv[c], "-g");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVvt:H:P:G:g:p:m:", long_opts, &opt_index);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'v': /* version */
+ verbose = TRUE;
+ break;
+ case 't': /* timeout period */
+ timeout_interval = atoi (optarg);
+ break;
+ case 'H': /* hostname */
+ if (strlen (optarg) >= MAX_HOST_ADDRESS_LENGTH)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ server_ip = optarg;
+ break;
+ case 'P': /* port */
+ port = atoi (optarg);
+ break;
+ case 'G': /* hostname */
+ if (strlen (optarg) >= MAX_INPUT_BUFFER)
+ die (STATE_UNKNOWN, _("Input buffer overflow\n"));
+ game_type = optarg;
+ break;
+ case 'p': /* index of ping field */
+ qstat_ping_field = atoi (optarg);
+ if (qstat_ping_field < 0 || qstat_ping_field > QSTAT_MAX_RETURN_ARGS)
+ return ERROR;
+ break;
+ case 'm': /* index on map field */
+ qstat_map_field = atoi (optarg);
+ if (qstat_map_field < 0 || qstat_map_field > QSTAT_MAX_RETURN_ARGS)
+ return ERROR;
+ break;
+ case 'g': /* index of game field */
+ qstat_game_field = atoi (optarg);
+ if (qstat_game_field < 0 || qstat_game_field > QSTAT_MAX_RETURN_ARGS)
+ return ERROR;
+ break;
+ case 129: /* index of player count field */
+ qstat_game_players = atoi (optarg);
+ if (qstat_game_players_max == 0)
+ qstat_game_players_max = qstat_game_players - 1;
+ if (qstat_game_players < 0 || qstat_game_players > QSTAT_MAX_RETURN_ARGS)
+ return ERROR;
+ break;
+ case 130: /* index of max players field */
+ qstat_game_players_max = atoi (optarg);
+ if (qstat_game_players_max < 0 || qstat_game_players_max > QSTAT_MAX_RETURN_ARGS)
+ return ERROR;
+ break;
+ default: /* args not parsable */
+ usage5();
+ }
+ }
+
+ c = optind;
+ /* first option is the game type */
+ if (!game_type && c<argc)
+ game_type = strdup (argv[c++]);
+
+ /* Second option is the server name */
+ if (!server_ip && c<argc)
+ server_ip = strdup (argv[c++]);
+
+ return validate_arguments ();
+}
+
+
+int
+validate_arguments (void)
+{
+ if (qstat_game_players_max < 0)
+ qstat_game_players_max = 4;
+
+ if (qstat_game_players < 0)
+ qstat_game_players = 5;
+
+ if (qstat_game_field < 0)
+ qstat_game_field = 2;
+
+ if (qstat_map_field < 0)
+ qstat_map_field = 3;
+
+ if (qstat_ping_field < 0)
+ qstat_ping_field = 5;
+
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("This plugin tests game server connections with the specified host."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-p");
+ printf (" %s\n", _("Optional port of which to connect"));
+ printf (" %s\n", "gf");
+ printf (" %s\n", _("Field number in raw qstat output that contains game name"));
+ printf (" %s\n", "-mf");
+ printf (" %s\n", _("Field number in raw qstat output that contains map name"));
+ printf (" %s\n", "-pf");
+ printf (" %s\n", _("Field number in raw qstat output that contains ping time"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("This plugin uses the 'qstat' command, the popular game server status query tool."));
+ printf (" %s\n", _("If you don't have the package installed, you will need to download it from"));
+ printf (" %s\n", _("https://github.com/multiplay/qstat before you can use this plugin."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s [-hvV] [-P port] [-t timeout] [-g game_field] [-m map_field] [-p ping_field] [-G game-time] [-H hostname] <game> <ip_address>\n", progname);
+}
+
+/******************************************************************************
+ *
+ * Test Cases:
+ *
+ * ./check_game --players 7 -p 8 --map 5 qs 67.20.190.61 26000
+ *
+ * qstat -raw , -qs 67.20.190.61
+ * ==> QS,67.20.190.61,Nightmare.fintek.ca,67.20.190.61:26000,3,e2m1,6,0,83,0
+ *
+ * qstat -qs 67.20.190.61
+ * ==> ADDRESS PLAYERS MAP RESPONSE TIME NAME
+ * ==> 67.20.190.61 0/ 6 e2m1 79 / 0 Nightmare.fintek.ca
+ *
+ ******************************************************************************/
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
new file mode 100644
index 0000000..c34bb08
--- /dev/null
+++ b/plugins/check_hpjd.c
@@ -0,0 +1,442 @@
+/*****************************************************************************
+*
+* Monitoring check_hpjd plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_hpjd plugin
+*
+* This plugin tests the STATUS of an HP printer with a JetDirect card.
+* Net-SNMP must be installed on the computer running the plugin.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_hpjd";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "popen.h"
+#include "utils.h"
+#include "netutils.h"
+
+#define DEFAULT_COMMUNITY "public"
+#define DEFAULT_PORT "161"
+
+const char *option_summary = "-H host [-C community]\n";
+
+#define HPJD_LINE_STATUS ".1.3.6.1.4.1.11.2.3.9.1.1.2.1"
+#define HPJD_PAPER_STATUS ".1.3.6.1.4.1.11.2.3.9.1.1.2.2"
+#define HPJD_INTERVENTION_REQUIRED ".1.3.6.1.4.1.11.2.3.9.1.1.2.3"
+#define HPJD_GD_PERIPHERAL_ERROR ".1.3.6.1.4.1.11.2.3.9.1.1.2.6"
+#define HPJD_GD_PAPER_OUT ".1.3.6.1.4.1.11.2.3.9.1.1.2.8"
+#define HPJD_GD_PAPER_JAM ".1.3.6.1.4.1.11.2.3.9.1.1.2.9"
+#define HPJD_GD_TONER_LOW ".1.3.6.1.4.1.11.2.3.9.1.1.2.10"
+#define HPJD_GD_PAGE_PUNT ".1.3.6.1.4.1.11.2.3.9.1.1.2.11"
+#define HPJD_GD_MEMORY_OUT ".1.3.6.1.4.1.11.2.3.9.1.1.2.12"
+#define HPJD_GD_DOOR_OPEN ".1.3.6.1.4.1.11.2.3.9.1.1.2.17"
+#define HPJD_GD_PAPER_OUTPUT ".1.3.6.1.4.1.11.2.3.9.1.1.2.19"
+#define HPJD_GD_STATUS_DISPLAY ".1.3.6.1.4.1.11.2.3.9.1.1.3"
+
+#define ONLINE 0
+#define OFFLINE 1
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+char *community = NULL;
+char *address = NULL;
+unsigned int port = 0;
+int check_paper_out = 1;
+
+int
+main (int argc, char **argv)
+{
+ char command_line[1024];
+ int result = STATE_UNKNOWN;
+ int line;
+ char input_buffer[MAX_INPUT_BUFFER];
+ char query_string[512];
+ char *errmsg;
+ char *temp_buffer;
+ int line_status = ONLINE;
+ int paper_status = 0;
+ int intervention_required = 0;
+ int peripheral_error = 0;
+ int paper_jam = 0;
+ int paper_out = 0;
+ int toner_low = 0;
+ int page_punt = 0;
+ int memory_out = 0;
+ int door_open = 0;
+ int paper_output = 0;
+ char display_message[MAX_INPUT_BUFFER];
+
+ errmsg = malloc(MAX_INPUT_BUFFER);
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* removed ' 2>1' at end of command 10/27/1999 - EG */
+ /* create the query string */
+ sprintf
+ (query_string,
+ "%s.0 %s.0 %s.0 %s.0 %s.0 %s.0 %s.0 %s.0 %s.0 %s.0 %s.0 %s.0",
+ HPJD_LINE_STATUS,
+ HPJD_PAPER_STATUS,
+ HPJD_INTERVENTION_REQUIRED,
+ HPJD_GD_PERIPHERAL_ERROR,
+ HPJD_GD_PAPER_JAM,
+ HPJD_GD_PAPER_OUT,
+ HPJD_GD_TONER_LOW,
+ HPJD_GD_PAGE_PUNT,
+ HPJD_GD_MEMORY_OUT,
+ HPJD_GD_DOOR_OPEN, HPJD_GD_PAPER_OUTPUT, HPJD_GD_STATUS_DISPLAY);
+
+ /* get the command to run */
+ sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s:%u %s",
+ PATH_TO_SNMPGET,
+ community,
+ address,
+ port,
+ query_string);
+
+ /* run the command */
+ child_process = spopen (command_line);
+ if (child_process == NULL) {
+ printf (_("Could not open pipe: %s\n"), command_line);
+ return STATE_UNKNOWN;
+ }
+
+ child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
+ if (child_stderr == NULL) {
+ printf (_("Could not open stderr for %s\n"), command_line);
+ }
+
+ result = STATE_OK;
+
+ line = 0;
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
+
+ /* strip the newline character from the end of the input */
+ if (input_buffer[strlen (input_buffer) - 1] == '\n')
+ input_buffer[strlen (input_buffer) - 1] = 0;
+
+ line++;
+
+ temp_buffer = strtok (input_buffer, "=");
+ temp_buffer = strtok (NULL, "=");
+
+ if (temp_buffer == NULL && line < 13) {
+
+ result = STATE_UNKNOWN;
+ strcpy (errmsg, input_buffer);
+
+ } else {
+
+ switch (line) {
+
+ case 1: /* 1st line should contain the line status */
+ line_status = atoi (temp_buffer);
+ break;
+ case 2: /* 2nd line should contain the paper status */
+ paper_status = atoi (temp_buffer);
+ break;
+ case 3: /* 3rd line should be intervention required */
+ intervention_required = atoi (temp_buffer);
+ break;
+ case 4: /* 4th line should be peripheral error */
+ peripheral_error = atoi (temp_buffer);
+ break;
+ case 5: /* 5th line should contain the paper jam status */
+ paper_jam = atoi (temp_buffer);
+ break;
+ case 6: /* 6th line should contain the paper out status */
+ paper_out = atoi (temp_buffer);
+ break;
+ case 7: /* 7th line should contain the toner low status */
+ toner_low = atoi (temp_buffer);
+ break;
+ case 8: /* did data come too slow for engine */
+ page_punt = atoi (temp_buffer);
+ break;
+ case 9: /* did we run out of memory */
+ memory_out = atoi (temp_buffer);
+ break;
+ case 10: /* is there a door open */
+ door_open = atoi (temp_buffer);
+ break;
+ case 11: /* is output tray full */
+ paper_output = atoi (temp_buffer);
+ break;
+ case 12: /* display panel message */
+ strcpy (display_message, temp_buffer + 1);
+ break;
+ default: /* fold multiline message */
+ strncat (display_message, input_buffer,
+ sizeof (display_message) - strlen (display_message) - 1);
+ }
+
+ }
+
+ /* break out of the read loop if we encounter an error */
+ if (result != STATE_OK)
+ break;
+ }
+
+ /* WARNING if output found on stderr */
+ if (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) {
+ result = max_state (result, STATE_WARNING);
+ /* remove CRLF */
+ if (input_buffer[strlen (input_buffer) - 1] == '\n')
+ input_buffer[strlen (input_buffer) - 1] = 0;
+ sprintf (errmsg, "%s", input_buffer );
+
+ }
+
+ /* close stderr */
+ (void) fclose (child_stderr);
+
+ /* close the pipe */
+ if (spclose (child_process))
+ result = max_state (result, STATE_WARNING);
+
+ /* if there wasn't any output, display an error */
+ if (line == 0) {
+
+ /* might not be the problem, but most likely is. */
+ result = STATE_UNKNOWN ;
+ xasprintf (&errmsg, "%s : Timeout from host %s\n", errmsg, address );
+
+ }
+
+ /* if we had no read errors, check the printer status results... */
+ if (result == STATE_OK) {
+
+ if (paper_jam) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Paper Jam"));
+ }
+ else if (paper_out) {
+ if (check_paper_out)
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Out of Paper"));
+ }
+ else if (line_status == OFFLINE) {
+ if (strcmp (errmsg, "POWERSAVE ON") != 0) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Printer Offline"));
+ }
+ }
+ else if (peripheral_error) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Peripheral Error"));
+ }
+ else if (intervention_required) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Intervention Required"));
+ }
+ else if (toner_low) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Toner Low"));
+ }
+ else if (memory_out) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Insufficient Memory"));
+ }
+ else if (door_open) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("A Door is Open"));
+ }
+ else if (paper_output) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Output Tray is Full"));
+ }
+ else if (page_punt) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Data too Slow for Engine"));
+ }
+ else if (paper_status) {
+ result = STATE_WARNING;
+ strcpy (errmsg, _("Unknown Paper Error"));
+ }
+ }
+
+ if (result == STATE_OK)
+ printf (_("Printer ok - (%s)\n"), display_message);
+
+ else if (result == STATE_UNKNOWN) {
+
+ printf ("%s\n", errmsg);
+
+ /* if printer could not be reached, escalate to critical */
+ if (strstr (errmsg, "Timeout"))
+ result = STATE_CRITICAL;
+ }
+
+ else if (result == STATE_WARNING)
+ printf ("%s (%s)\n", errmsg, display_message);
+
+ return result;
+}
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"community", required_argument, 0, 'C'},
+/* {"critical", required_argument,0,'c'}, */
+/* {"warning", required_argument,0,'w'}, */
+ {"port", required_argument,0,'p'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVH:C:p:D", longopts, &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case 'H': /* hostname */
+ if (is_host (optarg)) {
+ address = strscpy(address, optarg) ;
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ break;
+ case 'C': /* community */
+ community = strscpy (community, optarg);
+ break;
+ case 'p':
+ if (!is_intpos(optarg))
+ usage2 (_("Port must be a positive short integer"), optarg);
+ else
+ port = atoi(optarg);
+ break;
+ case 'D': /* disable paper out check*/
+ check_paper_out = 0;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case '?': /* help */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (address == NULL) {
+ if (is_host (argv[c])) {
+ address = argv[c++];
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), argv[c]);
+ }
+ }
+
+ if (community == NULL) {
+ if (argv[c] != NULL )
+ community = argv[c];
+ else
+ community = strdup (DEFAULT_COMMUNITY);
+ }
+
+ if (port == 0) {
+ port = atoi(DEFAULT_PORT);
+ }
+
+ return validate_arguments ();
+}
+
+
+int
+validate_arguments (void)
+{
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin tests the STATUS of an HP printer with a JetDirect card."));
+ printf ("%s\n", _("Net-snmp must be installed on the computer running the plugin."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-C, --community=STRING");
+ printf (" %s", _("The SNMP community name "));
+ printf (_("(default=%s)"), DEFAULT_COMMUNITY);
+ printf ("\n");
+ printf (" %s\n", "-p, --port=STRING");
+ printf (" %s", _("Specify the port to check "));
+ printf (_("(default=%s)"), DEFAULT_PORT);
+ printf ("\n");
+ printf (" %s\n", "-D");
+ printf (" %s", _("Disable paper check "));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host [-C community] [-p port] [-D]\n", progname);
+}
diff --git a/plugins/check_http.c b/plugins/check_http.c
new file mode 100644
index 0000000..b9d8145
--- /dev/null
+++ b/plugins/check_http.c
@@ -0,0 +1,1895 @@
+/*****************************************************************************
+*
+* Monitoring check_http plugin
+*
+* License: GPL
+* Copyright (c) 1999-2013 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_http plugin
+*
+* This plugin tests the HTTP service on the specified host. It can test
+* normal (http) and secure (https) servers, follow redirects, search for
+* strings and regular expressions, check connection times, and report on
+* certificate expiration times.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_http";
+const char *copyright = "1999-2022";
+const char *email = "devel@monitoring-plugins.org";
+
+// Do NOT sort those headers, it will break the build
+// TODO: Fix this
+#include "common.h"
+#include "base64.h"
+#include "netutils.h"
+#include "utils.h"
+#include "base64.h"
+#include <ctype.h>
+
+#define STICKY_NONE 0
+#define STICKY_HOST 1
+#define STICKY_PORT 2
+
+#define HTTP_EXPECT "HTTP/1."
+enum {
+ MAX_IPV4_HOSTLENGTH = 255,
+ HTTP_PORT = 80,
+ HTTPS_PORT = 443,
+ MAX_PORT = 65535,
+ DEFAULT_MAX_REDIRS = 15
+};
+
+#ifdef HAVE_SSL
+bool check_cert = false;
+bool continue_after_check_cert = false;
+int ssl_version = 0;
+int days_till_exp_warn, days_till_exp_crit;
+char *randbuff;
+X509 *server_cert;
+# define my_recv(buf, len) ((use_ssl) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
+# define my_send(buf, len) ((use_ssl) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0))
+#else /* ifndef HAVE_SSL */
+# define my_recv(buf, len) read(sd, buf, len)
+# define my_send(buf, len) send(sd, buf, len, 0)
+#endif /* HAVE_SSL */
+bool no_body = false;
+int maximum_age = -1;
+
+enum {
+ REGS = 2,
+ MAX_RE_SIZE = 1024
+};
+#include "regex.h"
+regex_t preg;
+regmatch_t pmatch[REGS];
+char regexp[MAX_RE_SIZE];
+char errbuf[MAX_INPUT_BUFFER];
+int cflags = REG_NOSUB | REG_EXTENDED | REG_NEWLINE;
+int errcode;
+int invert_regex = 0;
+
+struct timeval tv;
+struct timeval tv_temp;
+
+#define HTTP_URL "/"
+#define CRLF "\r\n"
+
+bool specify_port = false;
+int server_port = HTTP_PORT;
+int virtual_port = 0;
+char server_port_text[6] = "";
+char server_type[6] = "http";
+char *server_address;
+char *host_name;
+int host_name_length;
+char *server_url;
+char *user_agent;
+int server_url_length;
+int server_expect_yn = 0;
+char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT;
+char header_expect[MAX_INPUT_BUFFER] = "";
+char string_expect[MAX_INPUT_BUFFER] = "";
+char *warning_thresholds = NULL;
+char *critical_thresholds = NULL;
+thresholds *thlds;
+char user_auth[MAX_INPUT_BUFFER] = "";
+char proxy_auth[MAX_INPUT_BUFFER] = "";
+bool display_html = false;
+char **http_opt_headers;
+int http_opt_headers_count = 0;
+int onredirect = STATE_OK;
+int followsticky = STICKY_NONE;
+bool use_ssl = false;
+bool use_sni = false;
+bool verbose = false;
+bool show_extended_perfdata = false;
+bool show_body = false;
+int sd;
+int min_page_len = 0;
+int max_page_len = 0;
+int redir_depth = 0;
+int max_depth = DEFAULT_MAX_REDIRS;
+char *http_method;
+char *http_method_proxy;
+char *http_post_data;
+char *http_content_type;
+char buffer[MAX_INPUT_BUFFER];
+char *client_cert = NULL;
+char *client_privkey = NULL;
+
+// Forward function declarations
+bool process_arguments (int, char **);
+int check_http (void);
+void redir (char *pos, char *status_line);
+bool server_type_check(const char *type);
+int server_port_check(int ssl_flag);
+char *perfd_time (double microsec);
+char *perfd_time_connect (double microsec);
+char *perfd_time_ssl (double microsec);
+char *perfd_time_firstbyte (double microsec);
+char *perfd_time_headers (double microsec);
+char *perfd_time_transfer (double microsec);
+char *perfd_size (int page_len);
+void print_help (void);
+void print_usage (void);
+char *unchunk_content(const char *content);
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Set default URL. Must be malloced for subsequent realloc if --onredirect=follow */
+ server_url = strdup(HTTP_URL);
+ server_url_length = strlen(server_url);
+ xasprintf (&user_agent, "User-Agent: check_http/v%s (monitoring-plugins %s)",
+ NP_VERSION, VERSION);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == false)
+ usage4 (_("Could not parse arguments"));
+
+ if (display_html == true)
+ printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">",
+ use_ssl ? "https" : "http", host_name ? host_name : server_address,
+ server_port, server_url);
+
+ /* initialize alarm signal handling, set socket timeout, start timer */
+ (void) signal (SIGALRM, socket_timeout_alarm_handler);
+ (void) alarm (socket_timeout);
+ gettimeofday (&tv, NULL);
+
+ result = check_http ();
+ return result;
+}
+
+/* check whether a file exists */
+void
+test_file (char *path)
+{
+ if (access(path, R_OK) == 0)
+ return;
+ usage2 (_("file does not exist or is not readable"), path);
+}
+
+/*
+ * process command-line arguments
+ * returns true on success, false otherwise
+ */
+bool process_arguments (int argc, char **argv)
+{
+ int c = 1;
+ char *p;
+ char *temp;
+
+ enum {
+ INVERT_REGEX = CHAR_MAX + 1,
+ SNI_OPTION,
+ MAX_REDIRS_OPTION,
+ CONTINUE_AFTER_CHECK_CERT
+ };
+
+ int option = 0;
+ static struct option longopts[] = {
+ STD_LONG_OPTS,
+ {"link", no_argument, 0, 'L'},
+ {"nohtml", no_argument, 0, 'n'},
+ {"ssl", optional_argument, 0, 'S'},
+ {"sni", no_argument, 0, SNI_OPTION},
+ {"post", required_argument, 0, 'P'},
+ {"method", required_argument, 0, 'j'},
+ {"IP-address", required_argument, 0, 'I'},
+ {"url", required_argument, 0, 'u'},
+ {"port", required_argument, 0, 'p'},
+ {"authorization", required_argument, 0, 'a'},
+ {"proxy-authorization", required_argument, 0, 'b'},
+ {"header-string", required_argument, 0, 'd'},
+ {"string", required_argument, 0, 's'},
+ {"expect", required_argument, 0, 'e'},
+ {"regex", required_argument, 0, 'r'},
+ {"ereg", required_argument, 0, 'r'},
+ {"eregi", required_argument, 0, 'R'},
+ {"linespan", no_argument, 0, 'l'},
+ {"onredirect", required_argument, 0, 'f'},
+ {"certificate", required_argument, 0, 'C'},
+ {"client-cert", required_argument, 0, 'J'},
+ {"private-key", required_argument, 0, 'K'},
+ {"continue-after-certificate", no_argument, 0, CONTINUE_AFTER_CHECK_CERT},
+ {"useragent", required_argument, 0, 'A'},
+ {"header", required_argument, 0, 'k'},
+ {"no-body", no_argument, 0, 'N'},
+ {"max-age", required_argument, 0, 'M'},
+ {"content-type", required_argument, 0, 'T'},
+ {"pagesize", required_argument, 0, 'm'},
+ {"invert-regex", no_argument, NULL, INVERT_REGEX},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"extended-perfdata", no_argument, 0, 'E'},
+ {"show-body", no_argument, 0, 'B'},
+ {"max-redirs", required_argument, 0, MAX_REDIRS_OPTION},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return false;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ if (strcmp ("-hn", argv[c]) == 0)
+ strcpy (argv[c], "-H");
+ if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ if (strcmp ("-nohtml", argv[c]) == 0)
+ strcpy (argv[c], "-n");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:d:e:p:s:R:r:u:f:C:J:K:nlLS::m:M:NEB", longopts, &option);
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* usage */
+ usage5 ();
+ break;
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ break;
+ case 't': /* timeout period */
+ if (!is_intnonneg (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ socket_timeout = atoi (optarg);
+ break;
+ case 'c': /* critical time threshold */
+ critical_thresholds = optarg;
+ break;
+ case 'w': /* warning time threshold */
+ warning_thresholds = optarg;
+ break;
+ case 'A': /* User Agent String */
+ xasprintf (&user_agent, "User-Agent: %s", optarg);
+ break;
+ case 'k': /* Additional headers */
+ if (http_opt_headers_count == 0)
+ http_opt_headers = malloc (sizeof (char *) * (++http_opt_headers_count));
+ else
+ http_opt_headers = realloc (http_opt_headers, sizeof (char *) * (++http_opt_headers_count));
+ http_opt_headers[http_opt_headers_count - 1] = optarg;
+ /* xasprintf (&http_opt_headers, "%s", optarg); */
+ break;
+ case 'L': /* show html link */
+ display_html = true;
+ break;
+ case 'n': /* do not show html link */
+ display_html = false;
+ break;
+ case 'C': /* Check SSL cert validity */
+#ifdef HAVE_SSL
+ if ((temp=strchr(optarg,','))!=NULL) {
+ *temp='\0';
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid certificate expiration period"), optarg);
+ days_till_exp_warn = atoi(optarg);
+ *temp=',';
+ temp++;
+ if (!is_intnonneg (temp))
+ usage2 (_("Invalid certificate expiration period"), temp);
+ days_till_exp_crit = atoi (temp);
+ }
+ else {
+ days_till_exp_crit=0;
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid certificate expiration period"), optarg);
+ days_till_exp_warn = atoi (optarg);
+ }
+ check_cert = true;
+ goto enable_ssl;
+#endif
+ case CONTINUE_AFTER_CHECK_CERT: /* don't stop after the certificate is checked */
+#ifdef HAVE_SSL
+ continue_after_check_cert = true;
+ break;
+#endif
+ case 'J': /* use client certificate */
+#ifdef HAVE_SSL
+ test_file(optarg);
+ client_cert = optarg;
+ goto enable_ssl;
+#endif
+ case 'K': /* use client private key */
+#ifdef HAVE_SSL
+ test_file(optarg);
+ client_privkey = optarg;
+ goto enable_ssl;
+#endif
+ case 'S': /* use SSL */
+#ifdef HAVE_SSL
+ enable_ssl:
+ /* ssl_version initialized to 0 as a default. Only set if it's non-zero. This helps when we include multiple
+ parameters, like -S and -C combinations */
+ use_ssl = true;
+ if (c=='S' && optarg != NULL) {
+ int got_plus = strchr(optarg, '+') != NULL;
+
+ if (!strncmp (optarg, "1.2", 3))
+ ssl_version = got_plus ? MP_TLSv1_2_OR_NEWER : MP_TLSv1_2;
+ else if (!strncmp (optarg, "1.1", 3))
+ ssl_version = got_plus ? MP_TLSv1_1_OR_NEWER : MP_TLSv1_1;
+ else if (optarg[0] == '1')
+ ssl_version = got_plus ? MP_TLSv1_OR_NEWER : MP_TLSv1;
+ else if (optarg[0] == '3')
+ ssl_version = got_plus ? MP_SSLv3_OR_NEWER : MP_SSLv3;
+ else if (optarg[0] == '2')
+ ssl_version = got_plus ? MP_SSLv2_OR_NEWER : MP_SSLv2;
+ else
+ usage4 (_("Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional '+' suffix)"));
+ }
+ if (specify_port == false)
+ server_port = HTTPS_PORT;
+#else
+ /* -C -J and -K fall through to here without SSL */
+ usage4 (_("Invalid option - SSL is not available"));
+#endif
+ break;
+ case SNI_OPTION:
+ use_sni = true;
+ break;
+ case MAX_REDIRS_OPTION:
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid max_redirs count"), optarg);
+ else {
+ max_depth = atoi (optarg);
+ }
+ break;
+ case 'f': /* onredirect */
+ if (!strcmp (optarg, "stickyport"))
+ onredirect = STATE_DEPENDENT, followsticky = STICKY_HOST|STICKY_PORT;
+ else if (!strcmp (optarg, "sticky"))
+ onredirect = STATE_DEPENDENT, followsticky = STICKY_HOST;
+ else if (!strcmp (optarg, "follow"))
+ onredirect = STATE_DEPENDENT, followsticky = STICKY_NONE;
+ else if (!strcmp (optarg, "unknown"))
+ onredirect = STATE_UNKNOWN;
+ else if (!strcmp (optarg, "ok"))
+ onredirect = STATE_OK;
+ else if (!strcmp (optarg, "warning"))
+ onredirect = STATE_WARNING;
+ else if (!strcmp (optarg, "critical"))
+ onredirect = STATE_CRITICAL;
+ else usage2 (_("Invalid onredirect option"), optarg);
+ if (verbose)
+ printf(_("option f:%d \n"), onredirect);
+ break;
+ /* Note: H, I, and u must be malloc'd or will fail on redirects */
+ case 'H': /* Host Name (virtual host) */
+ host_name = strdup (optarg);
+ if (host_name[0] == '[') {
+ if ((p = strstr (host_name, "]:")) != NULL) { /* [IPv6]:port */
+ virtual_port = atoi (p + 2);
+ /* cut off the port */
+ host_name_length = strlen (host_name) - strlen (p) - 1;
+ free (host_name);
+ host_name = strndup (optarg, host_name_length);
+ if (specify_port == false)
+ server_port = virtual_port;
+ }
+ } else if ((p = strchr (host_name, ':')) != NULL
+ && strchr (++p, ':') == NULL) { /* IPv4:port or host:port */
+ virtual_port = atoi (p);
+ /* cut off the port */
+ host_name_length = strlen (host_name) - strlen (p) - 1;
+ free (host_name);
+ host_name = strndup (optarg, host_name_length);
+ if (specify_port == false)
+ server_port = virtual_port;
+ }
+ break;
+ case 'I': /* Server IP-address */
+ server_address = strdup (optarg);
+ break;
+ case 'u': /* URL path */
+ server_url = strdup (optarg);
+ server_url_length = strlen (server_url);
+ break;
+ case 'p': /* Server port */
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid port number"), optarg);
+ else {
+ server_port = atoi (optarg);
+ specify_port = true;
+ }
+ break;
+ case 'a': /* authorization info */
+ strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1);
+ user_auth[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 'b': /* proxy-authorization info */
+ strncpy (proxy_auth, optarg, MAX_INPUT_BUFFER - 1);
+ proxy_auth[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 'P': /* HTTP POST data in URL encoded format; ignored if settings already */
+ if (! http_post_data)
+ http_post_data = strdup (optarg);
+ if (! http_method)
+ http_method = strdup("POST");
+ break;
+ case 'j': /* Set HTTP method */
+ if (http_method)
+ free(http_method);
+ http_method = strdup (optarg);
+ char *tmp;
+ if ((tmp = strstr(http_method, ":")) > 0) {
+ tmp[0] = '\0';
+ http_method = http_method;
+ http_method_proxy = ++tmp;
+ }
+ break;
+ case 'd': /* string or substring */
+ strncpy (header_expect, optarg, MAX_INPUT_BUFFER - 1);
+ header_expect[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 's': /* string or substring */
+ strncpy (string_expect, optarg, MAX_INPUT_BUFFER - 1);
+ string_expect[MAX_INPUT_BUFFER - 1] = 0;
+ break;
+ case 'e': /* string or substring */
+ strncpy (server_expect, optarg, MAX_INPUT_BUFFER - 1);
+ server_expect[MAX_INPUT_BUFFER - 1] = 0;
+ server_expect_yn = 1;
+ break;
+ case 'T': /* Content-type */
+ xasprintf (&http_content_type, "%s", optarg);
+ break;
+ case 'l': /* linespan */
+ cflags &= ~REG_NEWLINE;
+ break;
+ case 'R': /* regex */
+ cflags |= REG_ICASE;
+ // fall through
+ case 'r': /* regex */
+ strncpy (regexp, optarg, MAX_RE_SIZE - 1);
+ regexp[MAX_RE_SIZE - 1] = 0;
+ errcode = regcomp (&preg, regexp, cflags);
+ if (errcode != 0) {
+ (void) regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
+ printf (_("Could Not Compile Regular Expression: %s"), errbuf);
+ return false;
+ }
+ break;
+ case INVERT_REGEX:
+ invert_regex = 1;
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case 'v': /* verbose */
+ verbose = true;
+ break;
+ case 'm': /* min_page_length */
+ {
+ char *tmp;
+ if (strchr(optarg, ':') != (char *)NULL) {
+ /* range, so get two values, min:max */
+ tmp = strtok(optarg, ":");
+ if (tmp == NULL) {
+ printf("Bad format: try \"-m min:max\"\n");
+ exit (STATE_WARNING);
+ } else
+ min_page_len = atoi(tmp);
+
+ tmp = strtok(NULL, ":");
+ if (tmp == NULL) {
+ printf("Bad format: try \"-m min:max\"\n");
+ exit (STATE_WARNING);
+ } else
+ max_page_len = atoi(tmp);
+ } else
+ min_page_len = atoi (optarg);
+ break;
+ }
+ case 'N': /* no-body */
+ no_body = true;
+ break;
+ case 'M': /* max-age */
+ {
+ int L = strlen(optarg);
+ if (L && optarg[L-1] == 'm')
+ maximum_age = atoi (optarg) * 60;
+ else if (L && optarg[L-1] == 'h')
+ maximum_age = atoi (optarg) * 60 * 60;
+ else if (L && optarg[L-1] == 'd')
+ maximum_age = atoi (optarg) * 60 * 60 * 24;
+ else if (L && (optarg[L-1] == 's' ||
+ isdigit (optarg[L-1])))
+ maximum_age = atoi (optarg);
+ else {
+ fprintf (stderr, "unparsable max-age: %s\n", optarg);
+ exit (STATE_WARNING);
+ }
+ }
+ break;
+ case 'E': /* show extended perfdata */
+ show_extended_perfdata = true;
+ break;
+ case 'B': /* print body content after status line */
+ show_body = true;
+ break;
+ }
+ }
+
+ c = optind;
+
+ if (server_address == NULL && c < argc)
+ server_address = strdup (argv[c++]);
+
+ if (host_name == NULL && c < argc)
+ host_name = strdup (argv[c++]);
+
+ if (server_address == NULL) {
+ if (host_name == NULL)
+ usage4 (_("You must specify a server address or host name"));
+ else
+ server_address = strdup (host_name);
+ }
+
+ set_thresholds(&thlds, warning_thresholds, critical_thresholds);
+
+ if (critical_thresholds && thlds->critical->end>(double)socket_timeout)
+ socket_timeout = (int)thlds->critical->end + 1;
+
+ if (http_method == NULL)
+ http_method = strdup ("GET");
+
+ if (http_method_proxy == NULL)
+ http_method_proxy = strdup ("GET");
+
+ if (client_cert && !client_privkey)
+ usage4 (_("If you use a client certificate you must also specify a private key file"));
+
+ if (virtual_port == 0)
+ virtual_port = server_port;
+
+ return true;
+}
+
+
+
+/* Returns 1 if we're done processing the document body; 0 to keep going */
+static int
+document_headers_done (char *full_page)
+{
+ const char *body;
+
+ for (body = full_page; *body; body++) {
+ if (!strncmp (body, "\n\n", 2) || !strncmp (body, "\n\r\n", 3))
+ break;
+ }
+
+ if (!*body)
+ return 0; /* haven't read end of headers yet */
+
+ full_page[body - full_page] = 0;
+ return 1;
+}
+
+static time_t
+parse_time_string (const char *string)
+{
+ struct tm tm;
+ time_t t;
+ memset (&tm, 0, sizeof(tm));
+
+ /* Like this: Tue, 25 Dec 2001 02:59:03 GMT */
+
+ if (isupper (string[0]) && /* Tue */
+ islower (string[1]) &&
+ islower (string[2]) &&
+ ',' == string[3] &&
+ ' ' == string[4] &&
+ (isdigit(string[5]) || string[5] == ' ') && /* 25 */
+ isdigit (string[6]) &&
+ ' ' == string[7] &&
+ isupper (string[8]) && /* Dec */
+ islower (string[9]) &&
+ islower (string[10]) &&
+ ' ' == string[11] &&
+ isdigit (string[12]) && /* 2001 */
+ isdigit (string[13]) &&
+ isdigit (string[14]) &&
+ isdigit (string[15]) &&
+ ' ' == string[16] &&
+ isdigit (string[17]) && /* 02: */
+ isdigit (string[18]) &&
+ ':' == string[19] &&
+ isdigit (string[20]) && /* 59: */
+ isdigit (string[21]) &&
+ ':' == string[22] &&
+ isdigit (string[23]) && /* 03 */
+ isdigit (string[24]) &&
+ ' ' == string[25] &&
+ 'G' == string[26] && /* GMT */
+ 'M' == string[27] && /* GMT */
+ 'T' == string[28]) {
+
+ tm.tm_sec = 10 * (string[23]-'0') + (string[24]-'0');
+ tm.tm_min = 10 * (string[20]-'0') + (string[21]-'0');
+ tm.tm_hour = 10 * (string[17]-'0') + (string[18]-'0');
+ tm.tm_mday = 10 * (string[5] == ' ' ? 0 : string[5]-'0') + (string[6]-'0');
+ tm.tm_mon = (!strncmp (string+8, "Jan", 3) ? 0 :
+ !strncmp (string+8, "Feb", 3) ? 1 :
+ !strncmp (string+8, "Mar", 3) ? 2 :
+ !strncmp (string+8, "Apr", 3) ? 3 :
+ !strncmp (string+8, "May", 3) ? 4 :
+ !strncmp (string+8, "Jun", 3) ? 5 :
+ !strncmp (string+8, "Jul", 3) ? 6 :
+ !strncmp (string+8, "Aug", 3) ? 7 :
+ !strncmp (string+8, "Sep", 3) ? 8 :
+ !strncmp (string+8, "Oct", 3) ? 9 :
+ !strncmp (string+8, "Nov", 3) ? 10 :
+ !strncmp (string+8, "Dec", 3) ? 11 :
+ -1);
+ tm.tm_year = ((1000 * (string[12]-'0') +
+ 100 * (string[13]-'0') +
+ 10 * (string[14]-'0') +
+ (string[15]-'0'))
+ - 1900);
+
+ tm.tm_isdst = 0; /* GMT is never in DST, right? */
+
+ if (tm.tm_mon < 0 || tm.tm_mday < 1 || tm.tm_mday > 31)
+ return 0;
+
+ /*
+ This is actually wrong: we need to subtract the local timezone
+ offset from GMT from this value. But, that's ok in this usage,
+ because we only comparing these two GMT dates against each other,
+ so it doesn't matter what time zone we parse them in.
+ */
+
+ t = mktime (&tm);
+ if (t == (time_t) -1) t = 0;
+
+ if (verbose) {
+ const char *s = string;
+ while (*s && *s != '\r' && *s != '\n')
+ fputc (*s++, stdout);
+ printf (" ==> %lu\n", (unsigned long) t);
+ }
+
+ return t;
+
+ } else {
+ return 0;
+ }
+}
+
+/* Checks if the server 'reply' is one of the expected 'statuscodes' */
+static int
+expected_statuscode (const char *reply, const char *statuscodes)
+{
+ char *expected, *code;
+ int result = 0;
+
+ if ((expected = strdup (statuscodes)) == NULL)
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Memory allocation error\n"));
+
+ for (code = strtok (expected, ","); code != NULL; code = strtok (NULL, ","))
+ if (strstr (reply, code) != NULL) {
+ result = 1;
+ break;
+ }
+
+ free (expected);
+ return result;
+}
+
+static int
+check_document_dates (const char *headers, char **msg)
+{
+ const char *s;
+ char *server_date = 0;
+ char *document_date = 0;
+ int date_result = STATE_OK;
+
+ s = headers;
+ while (*s) {
+ const char *field = s;
+ const char *value = 0;
+
+ /* Find the end of the header field */
+ while (*s && !isspace(*s) && *s != ':')
+ s++;
+
+ /* Remember the header value, if any. */
+ if (*s == ':')
+ value = ++s;
+
+ /* Skip to the end of the header, including continuation lines. */
+ while (*s && !(*s == '\n' && (s[1] != ' ' && s[1] != '\t')))
+ s++;
+
+ /* Avoid stepping over end-of-string marker */
+ if (*s)
+ s++;
+
+ /* Process this header. */
+ if (value && value > field+2) {
+ char *ff = (char *) malloc (value-field);
+ char *ss = ff;
+ while (field < value-1)
+ *ss++ = tolower(*field++);
+ *ss++ = 0;
+
+ if (!strcmp (ff, "date") || !strcmp (ff, "last-modified")) {
+ const char *e;
+ while (*value && isspace (*value))
+ value++;
+ for (e = value; *e && *e != '\r' && *e != '\n'; e++)
+ ;
+ ss = (char *) malloc (e - value + 1);
+ strncpy (ss, value, e - value);
+ ss[e - value] = 0;
+ if (!strcmp (ff, "date")) {
+ if (server_date) free (server_date);
+ server_date = ss;
+ } else {
+ if (document_date) free (document_date);
+ document_date = ss;
+ }
+ }
+ free (ff);
+ }
+ }
+
+ /* Done parsing the body. Now check the dates we (hopefully) parsed. */
+ if (!server_date || !*server_date) {
+ xasprintf (msg, _("%sServer date unknown, "), *msg);
+ date_result = max_state_alt(STATE_UNKNOWN, date_result);
+ } else if (!document_date || !*document_date) {
+ xasprintf (msg, _("%sDocument modification date unknown, "), *msg);
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else {
+ time_t srv_data = parse_time_string (server_date);
+ time_t doc_data = parse_time_string (document_date);
+
+ if (srv_data <= 0) {
+ xasprintf (msg, _("%sServer date \"%100s\" unparsable, "), *msg, server_date);
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else if (doc_data <= 0) {
+ xasprintf (msg, _("%sDocument date \"%100s\" unparsable, "), *msg, document_date);
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else if (doc_data > srv_data + 30) {
+ xasprintf (msg, _("%sDocument is %d seconds in the future, "), *msg, (int)doc_data - (int)srv_data);
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else if (doc_data < srv_data - maximum_age) {
+ int n = (srv_data - doc_data);
+ if (n > (60 * 60 * 24 * 2)) {
+ xasprintf (msg, _("%sLast modified %.1f days ago, "), *msg, ((float) n) / (60 * 60 * 24));
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ } else {
+ xasprintf (msg, _("%sLast modified %d:%02d:%02d ago, "), *msg, n / (60 * 60), (n / 60) % 60, n % 60);
+ date_result = max_state_alt(STATE_CRITICAL, date_result);
+ }
+ }
+ free (server_date);
+ free (document_date);
+ }
+ return date_result;
+}
+
+int
+get_content_length (const char *headers)
+{
+ const char *s;
+ int content_length = 0;
+
+ s = headers;
+ while (*s) {
+ const char *field = s;
+ const char *value = 0;
+
+ /* Find the end of the header field */
+ while (*s && !isspace(*s) && *s != ':')
+ s++;
+
+ /* Remember the header value, if any. */
+ if (*s == ':')
+ value = ++s;
+
+ /* Skip to the end of the header, including continuation lines. */
+ while (*s && !(*s == '\n' && (s[1] != ' ' && s[1] != '\t')))
+ s++;
+
+ /* Avoid stepping over end-of-string marker */
+ if (*s)
+ s++;
+
+ /* Process this header. */
+ if (value && value > field+2) {
+ char *ff = (char *) malloc (value-field);
+ char *ss = ff;
+ while (field < value-1)
+ *ss++ = tolower(*field++);
+ *ss++ = 0;
+
+ if (!strcmp (ff, "content-length")) {
+ const char *e;
+ while (*value && isspace (*value))
+ value++;
+ for (e = value; *e && *e != '\r' && *e != '\n'; e++)
+ ;
+ ss = (char *) malloc (e - value + 1);
+ strncpy (ss, value, e - value);
+ ss[e - value] = 0;
+ content_length = atoi(ss);
+ free (ss);
+ }
+ free (ff);
+ }
+ }
+ return (content_length);
+}
+
+char *
+prepend_slash (char *path)
+{
+ char *newpath;
+
+ if (path[0] == '/')
+ return path;
+
+ if ((newpath = malloc (strlen(path) + 2)) == NULL)
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Memory allocation error\n"));
+ newpath[0] = '/';
+ strcpy (newpath + 1, path);
+ free (path);
+ return newpath;
+}
+
+int
+check_http (void)
+{
+ char *msg;
+ char *status_line;
+ char *status_code;
+ char *header;
+ char *page;
+ char *auth;
+ int http_status;
+ int i = 0;
+ size_t pagesize = 0;
+ char *full_page;
+ char *full_page_new;
+ char *buf;
+ char *pos;
+ long microsec = 0L;
+ double elapsed_time = 0.0;
+ long microsec_connect = 0L;
+ double elapsed_time_connect = 0.0;
+ long microsec_ssl = 0L;
+ double elapsed_time_ssl = 0.0;
+ long microsec_firstbyte = 0L;
+ double elapsed_time_firstbyte = 0.0;
+ long microsec_headers = 0L;
+ double elapsed_time_headers = 0.0;
+ long microsec_transfer = 0L;
+ double elapsed_time_transfer = 0.0;
+ int page_len = 0;
+ int result = STATE_OK;
+ char *force_host_header = NULL;
+
+ /* try to connect to the host at the given port number */
+ gettimeofday (&tv_temp, NULL);
+ if (my_tcp_connect (server_address, server_port, &sd) != STATE_OK)
+ die (STATE_CRITICAL, _("HTTP CRITICAL - Unable to open TCP socket\n"));
+ microsec_connect = deltime (tv_temp);
+
+ /* if we are called with the -I option, the -j method is CONNECT and */
+ /* we received -S for SSL, then we tunnel the request through a proxy*/
+ /* @20100414, public[at]frank4dd.com, http://www.frank4dd.com/howto */
+
+ if ( server_address != NULL && strcmp(http_method, "CONNECT") == 0
+ && host_name != NULL && use_ssl == true) {
+
+ if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", server_address, server_port, host_name, HTTPS_PORT);
+ asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent);
+ if (strlen(proxy_auth)) {
+ base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
+ xasprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth);
+ }
+ /* optionally send any other header tag */
+ if (http_opt_headers_count) {
+ for (i = 0; i < http_opt_headers_count ; i++) {
+ if (force_host_header != http_opt_headers[i]) {
+ xasprintf (&buf, "%s%s\r\n", buf, http_opt_headers[i]);
+ }
+ }
+ /* This cannot be free'd here because a redirection will then try to access this and segfault */
+ /* Covered in a testcase in tests/check_http.t */
+ /* free(http_opt_headers); */
+ }
+ asprintf (&buf, "%sProxy-Connection: keep-alive\r\n", buf);
+ asprintf (&buf, "%sHost: %s\r\n", buf, host_name);
+ /* we finished our request, send empty line with CRLF */
+ asprintf (&buf, "%s%s", buf, CRLF);
+ if (verbose) printf ("%s\n", buf);
+ send(sd, buf, strlen (buf), 0);
+ buf[0]='\0';
+
+ if (verbose) printf ("Receive response from proxy\n");
+ read (sd, buffer, MAX_INPUT_BUFFER-1);
+ if (verbose) printf ("%s", buffer);
+ /* Here we should check if we got HTTP/1.1 200 Connection established */
+ }
+#ifdef HAVE_SSL
+ elapsed_time_connect = (double)microsec_connect / 1.0e6;
+ if (use_ssl == true) {
+ gettimeofday (&tv_temp, NULL);
+ result = np_net_ssl_init_with_hostname_version_and_cert(sd, (use_sni ? host_name : NULL), ssl_version, client_cert, client_privkey);
+ if (verbose) printf ("SSL initialized\n");
+ if (result != STATE_OK)
+ die (STATE_CRITICAL, NULL);
+ microsec_ssl = deltime (tv_temp);
+ elapsed_time_ssl = (double)microsec_ssl / 1.0e6;
+ if (check_cert == true) {
+ result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
+ if (continue_after_check_cert == false) {
+ if (sd) close(sd);
+ np_net_ssl_cleanup();
+ return result;
+ }
+ }
+ }
+#endif /* HAVE_SSL */
+
+ if ( server_address != NULL && strcmp(http_method, "CONNECT") == 0
+ && host_name != NULL && use_ssl == true)
+ asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method_proxy, server_url, host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent);
+ else
+ asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method, server_url, host_name ? "HTTP/1.1" : "HTTP/1.0", user_agent);
+
+ /* tell HTTP/1.1 servers not to keep the connection alive */
+ xasprintf (&buf, "%sConnection: close\r\n", buf);
+
+ /* check if Host header is explicitly set in options */
+ if (http_opt_headers_count) {
+ for (i = 0; i < http_opt_headers_count ; i++) {
+ if (strncmp(http_opt_headers[i], "Host:", 5) == 0) {
+ force_host_header = http_opt_headers[i];
+ }
+ }
+ }
+
+ /* optionally send the host header info */
+ if (host_name) {
+ if (force_host_header) {
+ xasprintf (&buf, "%s%s\r\n", buf, force_host_header);
+ }
+ else {
+ /*
+ * Specify the port only if we're using a non-default port (see RFC 2616,
+ * 14.23). Some server applications/configurations cause trouble if the
+ * (default) port is explicitly specified in the "Host:" header line.
+ */
+ if ((use_ssl == false && virtual_port == HTTP_PORT) ||
+ (use_ssl == true && virtual_port == HTTPS_PORT) ||
+ (server_address != NULL && strcmp(http_method, "CONNECT") == 0
+ && host_name != NULL && use_ssl == true))
+ xasprintf (&buf, "%sHost: %s\r\n", buf, host_name);
+ else
+ xasprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, virtual_port);
+ }
+ }
+
+ /* optionally send any other header tag */
+ if (http_opt_headers_count) {
+ for (i = 0; i < http_opt_headers_count ; i++) {
+ if (force_host_header != http_opt_headers[i]) {
+ xasprintf (&buf, "%s%s\r\n", buf, http_opt_headers[i]);
+ }
+ }
+ /* This cannot be free'd here because a redirection will then try to access this and segfault */
+ /* Covered in a testcase in tests/check_http.t */
+ /* free(http_opt_headers); */
+ }
+
+ /* optionally send the authentication info */
+ if (strlen(user_auth)) {
+ base64_encode_alloc (user_auth, strlen (user_auth), &auth);
+ xasprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth);
+ }
+
+ /* optionally send the proxy authentication info */
+ if (strlen(proxy_auth)) {
+ base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
+ xasprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth);
+ }
+
+ /* either send http POST data (any data, not only POST)*/
+ if (http_post_data) {
+ if (http_content_type) {
+ xasprintf (&buf, "%sContent-Type: %s\r\n", buf, http_content_type);
+ } else {
+ xasprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf);
+ }
+
+ xasprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, (int)strlen (http_post_data));
+ xasprintf (&buf, "%s%s", buf, http_post_data);
+ } else {
+ /* or just a newline so the server knows we're done with the request */
+ xasprintf (&buf, "%s%s", buf, CRLF);
+ }
+
+ if (verbose) printf ("%s\n", buf);
+ gettimeofday (&tv_temp, NULL);
+ my_send (buf, strlen (buf));
+ microsec_headers = deltime (tv_temp);
+ elapsed_time_headers = (double)microsec_headers / 1.0e6;
+
+ /* fetch the page */
+ full_page = strdup("");
+ gettimeofday (&tv_temp, NULL);
+ while ((i = my_recv (buffer, MAX_INPUT_BUFFER-1)) > 0) {
+ if ((i >= 1) && (elapsed_time_firstbyte <= 0.000001)) {
+ microsec_firstbyte = deltime (tv_temp);
+ elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6;
+ }
+ while ((pos = memchr(buffer, '\0', i))) {
+ /* replace nul character with a blank */
+ *pos = ' ';
+ }
+ buffer[i] = '\0';
+
+ if ((full_page_new = realloc(full_page, pagesize + i + 1)) == NULL)
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate memory for full_page\n"));
+
+ memmove(&full_page_new[pagesize], buffer, i + 1);
+
+ full_page = full_page_new;
+
+ pagesize += i;
+
+ if (no_body && document_headers_done (full_page)) {
+ i = 0;
+ break;
+ }
+ }
+ microsec_transfer = deltime (tv_temp);
+ elapsed_time_transfer = (double)microsec_transfer / 1.0e6;
+
+ if (i < 0 && errno != ECONNRESET) {
+ die(STATE_CRITICAL, _("HTTP CRITICAL - Error on receive\n"));
+ }
+
+ /* return a CRITICAL status if we couldn't read any data */
+ if (pagesize == (size_t) 0)
+ die (STATE_CRITICAL, _("HTTP CRITICAL - No data received from host\n"));
+
+ /* close the connection */
+ if (sd) close(sd);
+#ifdef HAVE_SSL
+ np_net_ssl_cleanup();
+#endif
+
+ /* Save check time */
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
+
+ /* leave full_page untouched so we can free it later */
+ page = full_page;
+
+ if (verbose)
+ printf ("%s://%s:%d%s is %d characters\n",
+ use_ssl ? "https" : "http", server_address,
+ server_port, server_url, (int)pagesize);
+
+ /* find status line and null-terminate it */
+ status_line = page;
+ page += (size_t) strcspn (page, "\r\n");
+ pos = page;
+ page += (size_t) strspn (page, "\r\n");
+ status_line[strcspn(status_line, "\r\n")] = 0;
+ strip (status_line);
+ if (verbose)
+ printf ("STATUS: %s\n", status_line);
+
+ /* find header info and null-terminate it */
+ header = page;
+ while (strcspn (page, "\r\n") > 0) {
+ page += (size_t) strcspn (page, "\r\n");
+ pos = page;
+ if ((strspn (page, "\r") == 1 && strspn (page, "\r\n") >= 2) ||
+ (strspn (page, "\n") == 1 && strspn (page, "\r\n") >= 2))
+ page += (size_t) 2;
+ else
+ page += (size_t) 1;
+ }
+ page += (size_t) strspn (page, "\r\n");
+ header[pos - header] = 0;
+ if (verbose)
+ printf ("**** HEADER ****\n%s\n**** CONTENT ****\n%s\n", header,
+ (no_body ? " [[ skipped ]]" : page));
+
+ /* make sure the status line matches the response we are looking for */
+ if (!expected_statuscode (status_line, server_expect)) {
+ if (server_port == HTTP_PORT)
+ xasprintf (&msg,
+ _("Invalid HTTP response received from host: %s\n"),
+ status_line);
+ else
+ xasprintf (&msg,
+ _("Invalid HTTP response received from host on port %d: %s\n"),
+ server_port, status_line);
+ if (show_body)
+ xasprintf (&msg, _("%s\n%s"), msg, page);
+ die (STATE_CRITICAL, "HTTP CRITICAL - %s", msg);
+ }
+
+ /* Bypass normal status line check if server_expect was set by user and not default */
+ /* NOTE: After this if/else block msg *MUST* be an asprintf-allocated string */
+ if ( server_expect_yn ) {
+ xasprintf (&msg,
+ _("Status line output matched \"%s\" - "), server_expect);
+ if (verbose)
+ printf ("%s\n",msg);
+ }
+ else {
+ /* Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF */
+ /* HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT */
+ /* Status-Code = 3 DIGITS */
+
+ status_code = strchr (status_line, ' ') + sizeof (char);
+ if (strspn (status_code, "1234567890") != 3)
+ die (STATE_CRITICAL, _("HTTP CRITICAL: Invalid Status Line (%s)\n"), status_line);
+
+ http_status = atoi (status_code);
+
+ /* check the return code */
+
+ if (http_status >= 600 || http_status < 100) {
+ die (STATE_CRITICAL, _("HTTP CRITICAL: Invalid Status (%s)\n"), status_line);
+ }
+ /* server errors result in a critical state */
+ else if (http_status >= 500) {
+ xasprintf (&msg, _("%s - "), status_line);
+ result = STATE_CRITICAL;
+ }
+ /* client errors result in a warning state */
+ else if (http_status >= 400) {
+ xasprintf (&msg, _("%s - "), status_line);
+ result = max_state_alt(STATE_WARNING, result);
+ }
+ /* check redirected page if specified */
+ else if (http_status >= 300) {
+
+ if (onredirect == STATE_DEPENDENT)
+ redir (header, status_line);
+ else
+ result = max_state_alt(onredirect, result);
+ xasprintf (&msg, _("%s - "), status_line);
+ } /* end if (http_status >= 300) */
+ else {
+ /* Print OK status anyway */
+ xasprintf (&msg, _("%s - "), status_line);
+ }
+
+ } /* end else (server_expect_yn) */
+
+ /* reset the alarm - must be called *after* redir or we'll never die on redirects! */
+ alarm (0);
+
+ if (maximum_age >= 0) {
+ result = max_state_alt(check_document_dates(header, &msg), result);
+ }
+
+ /* Page and Header content checks go here */
+ if (strlen(header_expect) > 0) {
+ if (strstr(header, header_expect) == NULL) {
+ // We did not find the header, the rest is for building the output and setting the state
+ char output_header_search[30] = "";
+
+ strncpy(&output_header_search[0], header_expect,
+ sizeof(output_header_search));
+
+ if (output_header_search[sizeof(output_header_search) - 1] != '\0') {
+ bcopy("...",
+ &output_header_search[sizeof(output_header_search) - 4],
+ 4);
+ }
+
+ xasprintf (&msg,
+ _("%sheader '%s' not found on '%s://%s:%d%s', "),
+ msg,
+ output_header_search, use_ssl ? "https" : "http",
+ host_name ? host_name : server_address, server_port,
+ server_url);
+
+ result = STATE_CRITICAL;
+ }
+ }
+
+ // At this point we should test if the content is chunked and unchunk it, so
+ // it can be searched (and possibly printed)
+ const char *chunked_header_regex_string = "Transfer-Encoding: *chunked *";
+ regex_t chunked_header_regex;
+
+ if (regcomp(&chunked_header_regex, chunked_header_regex_string, REG_ICASE)) {
+ die(STATE_UNKNOWN, "HTTP %s: %s\n", state_text(STATE_UNKNOWN), "Failed to compile chunked_header_regex regex");
+ }
+
+ regmatch_t chre_pmatch[1]; // We actually do not care about this, since we only want to know IF it was found
+
+ if (!no_body && regexec(&chunked_header_regex, header, 1, chre_pmatch, 0) == 0) {
+ if (verbose) {
+ printf("Found chunked content\n");
+ }
+ // We actually found the chunked header
+ char *tmp = unchunk_content(page);
+ if (tmp == NULL) {
+ die(STATE_UNKNOWN, "HTTP %s: %s\n", state_text(STATE_UNKNOWN), "Failed to unchunk message body");
+ }
+ page = tmp;
+ }
+
+ if (strlen(string_expect) > 0) {
+ if (!strstr(page, string_expect)) {
+ // We found the string the body, the rest is for building the output
+ char output_string_search[30] = "";
+ strncpy(&output_string_search[0], string_expect,
+ sizeof(output_string_search));
+ if (output_string_search[sizeof(output_string_search) - 1] != '\0') {
+ bcopy("...", &output_string_search[sizeof(output_string_search) - 4],
+ 4);
+ }
+ xasprintf (&msg, _("%sstring '%s' not found on '%s://%s:%d%s', "), msg, output_string_search, use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url);
+ result = STATE_CRITICAL;
+ }
+ }
+
+ if (strlen(regexp) > 0) {
+ errcode = regexec(&preg, page, REGS, pmatch, 0);
+ if ((errcode == 0 && invert_regex == 0) ||
+ (errcode == REG_NOMATCH && invert_regex == 1)) {
+ /* OK - No-op to avoid changing the logic around it */
+ result = max_state_alt(STATE_OK, result);
+ }
+ else if ((errcode == REG_NOMATCH && invert_regex == 0) || (errcode == 0 && invert_regex == 1)) {
+ if (invert_regex == 0)
+ xasprintf (&msg, _("%spattern not found, "), msg);
+ else
+ xasprintf (&msg, _("%spattern found, "), msg);
+ result = STATE_CRITICAL;
+ }
+ else {
+ /* FIXME: Shouldn't that be UNKNOWN? */
+ regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
+ xasprintf (&msg, _("%sExecute Error: %s, "), msg, errbuf);
+ result = STATE_CRITICAL;
+ }
+ }
+
+ /* make sure the page is of an appropriate size */
+ /* page_len = get_content_length(header); */
+ /* FIXME: Will this work with -N ? IMHO we should use
+ * get_content_length(header) and always check if it's different than the
+ * returned pagesize
+ */
+ /* FIXME: IIRC pagesize returns headers - shouldn't we make
+ * it == get_content_length(header) ??
+ */
+ page_len = pagesize;
+ if ((max_page_len > 0) && (page_len > max_page_len)) {
+ xasprintf (&msg, _("%spage size %d too large, "), msg, page_len);
+ result = max_state_alt(STATE_WARNING, result);
+ } else if ((min_page_len > 0) && (page_len < min_page_len)) {
+ xasprintf (&msg, _("%spage size %d too small, "), msg, page_len);
+ result = max_state_alt(STATE_WARNING, result);
+ }
+
+ /* Cut-off trailing characters */
+ if(msg[strlen(msg)-2] == ',')
+ msg[strlen(msg)-2] = '\0';
+ else
+ msg[strlen(msg)-3] = '\0';
+
+ /* check elapsed time */
+ if (show_extended_perfdata)
+ xasprintf (&msg,
+ _("%s - %d bytes in %.3f second response time %s|%s %s %s %s %s %s %s"),
+ msg, page_len, elapsed_time,
+ (display_html ? "</A>" : ""),
+ perfd_time (elapsed_time),
+ perfd_size (page_len),
+ perfd_time_connect (elapsed_time_connect),
+ use_ssl == true ? perfd_time_ssl (elapsed_time_ssl) : "",
+ perfd_time_headers (elapsed_time_headers),
+ perfd_time_firstbyte (elapsed_time_firstbyte),
+ perfd_time_transfer (elapsed_time_transfer));
+ else
+ xasprintf (&msg,
+ _("%s - %d bytes in %.3f second response time %s|%s %s"),
+ msg, page_len, elapsed_time,
+ (display_html ? "</A>" : ""),
+ perfd_time (elapsed_time),
+ perfd_size (page_len));
+
+ if (show_body)
+ xasprintf (&msg, _("%s\n%s"), msg, page);
+
+ result = max_state_alt(get_status(elapsed_time, thlds), result);
+
+ die (result, "HTTP %s: %s\n", state_text(result), msg);
+ /* die failed? */
+ return STATE_UNKNOWN;
+}
+
+/* Receivces a pointer to the beginning of the body of a HTTP message
+ * which is chunked and returns a pointer to a freshly allocated memory
+ * region containing the unchunked body or NULL if something failed.
+ * The result must be freed by the caller.
+ */
+char *unchunk_content(const char *content) {
+ // https://en.wikipedia.org/wiki/Chunked_transfer_encoding
+ // https://www.rfc-editor.org/rfc/rfc7230#section-4.1
+ char *result = NULL;
+ char *start_of_chunk;
+ char* end_of_chunk;
+ long size_of_chunk;
+ const char *pointer = content;
+ char *endptr;
+ long length_of_chunk = 0;
+ size_t overall_size = 0;
+
+ while (true) {
+ size_of_chunk = strtol(pointer, &endptr, 16);
+ if (size_of_chunk == LONG_MIN || size_of_chunk == LONG_MAX) {
+ // Apparently underflow or overflow, should not happen
+ if (verbose) {
+ printf("Got an underflow or overflow from strtol at: %u\n", __LINE__);
+ }
+ return NULL;
+ }
+ if (endptr == pointer) {
+ // Apparently this was not a number
+ if (verbose) {
+ printf("Chunked content did not start with a number at all (Line: %u)\n", __LINE__);
+ }
+ return NULL;
+ }
+
+ // So, we got the length of the chunk
+ if (*endptr == ';') {
+ // Chunk extension starts here
+ while (*endptr != '\r') {
+ endptr++;
+ }
+ }
+
+ start_of_chunk = endptr + 2;
+ end_of_chunk = start_of_chunk + size_of_chunk;
+ length_of_chunk = (long)(end_of_chunk - start_of_chunk);
+ pointer = end_of_chunk + 2; //Next number should be here
+
+ if (length_of_chunk == 0) {
+ // Chunk length is 0, so this is the last one
+ break;
+ }
+
+ overall_size += length_of_chunk;
+
+ if (result == NULL) {
+ // Size of the chunk plus the ending NULL byte
+ result = (char *)malloc(length_of_chunk +1);
+ if (result == NULL) {
+ if (verbose) {
+ printf("Failed to allocate memory for unchunked body\n");
+ }
+ return NULL;
+ }
+ } else {
+ // Enlarge memory to the new size plus the ending NULL byte
+ void *tmp = realloc(result, overall_size +1);
+ if (tmp == NULL) {
+ if (verbose) {
+ printf("Failed to allocate memory for unchunked body\n");
+ }
+ return NULL;
+ } else {
+ result = tmp;
+ }
+ }
+
+ memcpy(result + (overall_size - size_of_chunk), start_of_chunk, size_of_chunk);
+ }
+
+ if (overall_size == 0 && result == NULL) {
+ // We might just have received the end chunk without previous content, so result is never allocated
+ result = calloc(1, sizeof(char));
+ // No error handling here, we can only return NULL anyway
+ } else {
+ result[overall_size] = '\0';
+ }
+ return result;
+}
+
+/* per RFC 2396 */
+#define URI_HTTP "%5[HTPShtps]"
+#define URI_HOST "%255[-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]"
+#define URI_PORT "%6d" /* MAX_PORT's width is 5 chars, 6 to detect overflow */
+#define URI_PATH "%[-_.!~*'();/?:@&=+$,%#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]"
+#define HD1 URI_HTTP "://" URI_HOST ":" URI_PORT "/" URI_PATH
+#define HD2 URI_HTTP "://" URI_HOST "/" URI_PATH
+#define HD3 URI_HTTP "://" URI_HOST ":" URI_PORT
+#define HD4 URI_HTTP "://" URI_HOST
+/* relative reference redirect like //www.site.org/test https://tools.ietf.org/html/rfc3986 */
+#define HD5 "//" URI_HOST "/" URI_PATH
+#define HD6 URI_PATH
+
+void
+redir (char *pos, char *status_line)
+{
+ int i = 0;
+ char *x;
+ char xx[2];
+ char type[6];
+ char *addr;
+ char *url;
+
+ addr = malloc (MAX_IPV4_HOSTLENGTH + 1);
+ if (addr == NULL)
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate addr\n"));
+
+ memset(addr, 0, MAX_IPV4_HOSTLENGTH);
+ url = malloc (strcspn (pos, "\r\n"));
+ if (url == NULL)
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate URL\n"));
+
+ while (pos) {
+ sscanf (pos, "%1[Ll]%*1[Oo]%*1[Cc]%*1[Aa]%*1[Tt]%*1[Ii]%*1[Oo]%*1[Nn]:%n", xx, &i);
+ if (i == 0) {
+ pos += (size_t) strcspn (pos, "\r\n");
+ pos += (size_t) strspn (pos, "\r\n");
+ if (strlen(pos) == 0)
+ die (STATE_UNKNOWN,
+ _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"),
+ status_line, (display_html ? "</A>" : ""));
+ continue;
+ }
+
+ pos += i;
+ pos += strspn (pos, " \t");
+
+ /*
+ * RFC 2616 (4.2): ``Header fields can be extended over multiple lines by
+ * preceding each extra line with at least one SP or HT.''
+ */
+ for (; (i = strspn (pos, "\r\n")); pos += i) {
+ pos += i;
+ if (!(i = strspn (pos, " \t"))) {
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Empty redirect location%s\n"),
+ display_html ? "</A>" : "");
+ }
+ }
+
+ url = realloc (url, strcspn (pos, "\r\n") + 1);
+ if (url == NULL)
+ die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate URL\n"));
+
+ /* URI_HTTP, URI_HOST, URI_PORT, URI_PATH */
+ if (sscanf (pos, HD1, type, addr, &i, url) == 4) {
+ url = prepend_slash (url);
+ use_ssl = server_type_check (type);
+ }
+
+ /* URI_HTTP URI_HOST URI_PATH */
+ else if (sscanf (pos, HD2, type, addr, url) == 3 ) {
+ url = prepend_slash (url);
+ use_ssl = server_type_check (type);
+ i = server_port_check (use_ssl);
+ }
+
+ /* URI_HTTP URI_HOST URI_PORT */
+ else if (sscanf (pos, HD3, type, addr, &i) == 3) {
+ strcpy (url, HTTP_URL);
+ use_ssl = server_type_check (type);
+ }
+
+ /* URI_HTTP URI_HOST */
+ else if (sscanf (pos, HD4, type, addr) == 2) {
+ strcpy (url, HTTP_URL);
+ use_ssl = server_type_check (type);
+ i = server_port_check (use_ssl);
+ }
+ /* URI_HTTP, URI_HOST, URI_PATH */
+ else if (sscanf (pos, HD5, addr, url) == 2) {
+ if(use_ssl){
+ strcpy (type,"https");
+ }
+ else{
+ strcpy (type, server_type);
+ }
+ xasprintf (&url, "/%s", url);
+ use_ssl = server_type_check (type);
+ i = server_port_check (use_ssl);
+ }
+
+ /* URI_PATH */
+ else if (sscanf (pos, HD6, url) == 1) {
+ /* relative url */
+ if ((url[0] != '/')) {
+ if ((x = strrchr(server_url, '/')))
+ *x = '\0';
+ xasprintf (&url, "%s/%s", server_url, url);
+ }
+ i = server_port;
+ strcpy (type, server_type);
+ strcpy (addr, host_name ? host_name : server_address);
+ }
+
+ else {
+ die (STATE_UNKNOWN,
+ _("HTTP UNKNOWN - Could not parse redirect location - %s%s\n"),
+ pos, (display_html ? "</A>" : ""));
+ }
+
+ break;
+
+ } /* end while (pos) */
+
+ if (++redir_depth > max_depth)
+ die (STATE_WARNING,
+ _("HTTP WARNING - maximum redirection depth %d exceeded - %s://%s:%d%s%s\n"),
+ max_depth, type, addr, i, url, (display_html ? "</A>" : ""));
+
+ if (server_port==i &&
+ !strncmp(server_address, addr, MAX_IPV4_HOSTLENGTH) &&
+ (host_name && !strncmp(host_name, addr, MAX_IPV4_HOSTLENGTH)) &&
+ !strcmp(server_url, url))
+ die (STATE_CRITICAL,
+ _("HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"),
+ type, addr, i, url, (display_html ? "</A>" : ""));
+
+ strcpy (server_type, type);
+
+ free (host_name);
+ host_name = strndup (addr, MAX_IPV4_HOSTLENGTH);
+
+ if (!(followsticky & STICKY_HOST)) {
+ free (server_address);
+ server_address = strndup (addr, MAX_IPV4_HOSTLENGTH);
+ }
+ if (!(followsticky & STICKY_PORT)) {
+ server_port = i;
+ }
+
+ free (server_url);
+ server_url = url;
+
+ if (server_port > MAX_PORT)
+ die (STATE_UNKNOWN,
+ _("HTTP UNKNOWN - Redirection to port above %d - %s://%s:%d%s%s\n"),
+ MAX_PORT, server_type, server_address, server_port, server_url,
+ display_html ? "</A>" : "");
+
+ /* reset virtual port */
+ virtual_port = server_port;
+
+ if (verbose)
+ printf (_("Redirection to %s://%s:%d%s\n"), server_type,
+ host_name ? host_name : server_address, server_port, server_url);
+
+ free(addr);
+ check_http ();
+}
+
+
+bool
+server_type_check (const char *type)
+{
+ if (strcmp (type, "https"))
+ return false;
+ else
+ return true;
+}
+
+int
+server_port_check (int ssl_flag)
+{
+ if (ssl_flag)
+ return HTTPS_PORT;
+ else
+ return HTTP_PORT;
+}
+
+char *perfd_time (double elapsed_time)
+{
+ return fperfdata ("time", elapsed_time, "s",
+ thlds->warning?true:false, thlds->warning?thlds->warning->end:0,
+ thlds->critical?true:false, thlds->critical?thlds->critical->end:0,
+ true, 0, true, socket_timeout);
+}
+
+char *perfd_time_connect (double elapsed_time_connect)
+{
+ return fperfdata ("time_connect", elapsed_time_connect, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_ssl (double elapsed_time_ssl)
+{
+ return fperfdata ("time_ssl", elapsed_time_ssl, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_headers (double elapsed_time_headers)
+{
+ return fperfdata ("time_headers", elapsed_time_headers, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_firstbyte (double elapsed_time_firstbyte)
+{
+ return fperfdata ("time_firstbyte", elapsed_time_firstbyte, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_time_transfer (double elapsed_time_transfer)
+{
+ return fperfdata ("time_transfer", elapsed_time_transfer, "s", false, 0, false, 0, false, 0, true, socket_timeout);
+}
+
+char *perfd_size (int page_len)
+{
+ return perfdata ("size", page_len, "B",
+ (min_page_len>0?true:false), min_page_len,
+ (min_page_len>0?true:false), 0,
+ true, 0, false, 0);
+}
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin tests the HTTP service on the specified host. It can test"));
+ printf ("%s\n", _("normal (http) and secure (https) servers, follow redirects, search for"));
+ printf ("%s\n", _("strings and regular expressions, check connection times, and report on"));
+ printf ("%s\n", _("certificate expiration times."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+#ifdef HAVE_SSL
+ printf (_("In the first form, make an HTTP request."));
+ printf (_("In the second form, connect to the server and check the TLS certificate."));
+#endif
+ printf (_("NOTE: One or both of -H and -I must be specified"));
+
+ printf ("\n");
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-H, --hostname=ADDRESS");
+ printf (" %s\n", _("Host name argument for servers using host headers (virtual host)"));
+ printf (" %s\n", _("Append a port to include it in the header (eg: example.com:5000)"));
+ printf (" %s\n", "-I, --IP-address=ADDRESS");
+ printf (" %s\n", _("IP address or name (use numeric address if possible to bypass DNS lookup)."));
+ printf (" %s\n", "-p, --port=INTEGER");
+ printf (" %s", _("Port number (default: "));
+ printf ("%d)\n", HTTP_PORT);
+
+ printf (UT_IPv46);
+
+#ifdef HAVE_SSL
+ printf (" %s\n", "-S, --ssl=VERSION[+]");
+ printf (" %s\n", _("Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"));
+ printf (" %s\n", _("auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"));
+ printf (" %s\n", _("1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted."));
+ printf (" %s\n", "--sni");
+ printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)"));
+ printf (" %s\n", "-C, --certificate=INTEGER[,INTEGER]");
+ printf (" %s\n", _("Minimum number of days a certificate has to be valid. Port defaults to 443"));
+ printf (" %s\n", _("(when this option is used the URL is not checked by default. You can use"));
+ printf (" %s\n", _(" --continue-after-certificate to override this behavior)"));
+ printf (" %s\n", "--continue-after-certificate");
+ printf (" %s\n", _("Allows the HTTP check to continue after performing the certificate check."));
+ printf (" %s\n", _("Does nothing unless -C is used."));
+ printf (" %s\n", "-J, --client-cert=FILE");
+ printf (" %s\n", _("Name of file that contains the client certificate (PEM format)"));
+ printf (" %s\n", _("to be used in establishing the SSL session"));
+ printf (" %s\n", "-K, --private-key=FILE");
+ printf (" %s\n", _("Name of file containing the private key (PEM format)"));
+ printf (" %s\n", _("matching the client certificate"));
+#endif
+
+ printf (" %s\n", "-e, --expect=STRING");
+ printf (" %s\n", _("Comma-delimited list of strings, at least one of them is expected in"));
+ printf (" %s", _("the first (status) line of the server response (default: "));
+ printf ("%s)\n", HTTP_EXPECT);
+ printf (" %s\n", _("If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"));
+ printf (" %s\n", "-d, --header-string=STRING");
+ printf (" %s\n", _("String to expect in the response headers"));
+ printf (" %s\n", "-s, --string=STRING");
+ printf (" %s\n", _("String to expect in the content"));
+ printf (" %s\n", "-u, --url=PATH");
+ printf (" %s\n", _("URL to GET or POST (default: /)"));
+ printf (" %s\n", "-P, --post=STRING");
+ printf (" %s\n", _("URL encoded http POST data"));
+ printf (" %s\n", "-j, --method=STRING (for example: HEAD, OPTIONS, TRACE, PUT, DELETE, CONNECT, CONNECT:POST)");
+ printf (" %s\n", _("Set HTTP method."));
+ printf (" %s\n", "-N, --no-body");
+ printf (" %s\n", _("Don't wait for document body: stop reading after headers."));
+ printf (" %s\n", _("(Note that this still does an HTTP GET or POST, not a HEAD.)"));
+ printf (" %s\n", "-M, --max-age=SECONDS");
+ printf (" %s\n", _("Warn if document is more than SECONDS old. the number can also be of"));
+ printf (" %s\n", _("the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."));
+ printf (" %s\n", "-T, --content-type=STRING");
+ printf (" %s\n", _("specify Content-Type header media type when POSTing\n"));
+
+ printf (" %s\n", "-l, --linespan");
+ printf (" %s\n", _("Allow regex to span newlines (must precede -r or -R)"));
+ printf (" %s\n", "-r, --regex, --ereg=STRING");
+ printf (" %s\n", _("Search page for regex STRING"));
+ printf (" %s\n", "-R, --eregi=STRING");
+ printf (" %s\n", _("Search page for case-insensitive regex STRING"));
+ printf (" %s\n", "--invert-regex");
+ printf (" %s\n", _("Return CRITICAL if found, OK if not\n"));
+
+ printf (" %s\n", "-a, --authorization=AUTH_PAIR");
+ printf (" %s\n", _("Username:password on sites with basic authentication"));
+ printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");
+ printf (" %s\n", _("Username:password on proxy-servers with basic authentication"));
+ printf (" %s\n", "-A, --useragent=STRING");
+ printf (" %s\n", _("String to be sent in http header as \"User Agent\""));
+ printf (" %s\n", "-k, --header=STRING");
+ printf (" %s\n", _("Any other tags to be sent in http header. Use multiple times for additional headers"));
+ printf (" %s\n", "-E, --extended-perfdata");
+ printf (" %s\n", _("Print additional performance data"));
+ printf (" %s\n", "-B, --show-body");
+ printf (" %s\n", _("Print body content below status line"));
+ printf (" %s\n", "-L, --link");
+ printf (" %s\n", _("Wrap output in HTML link (obsoleted by urlize)"));
+ printf (" %s\n", "-f, --onredirect=<ok|warning|critical|follow|sticky|stickyport>");
+ printf (" %s\n", _("How to handle redirected pages. sticky is like follow but stick to the"));
+ printf (" %s\n", _("specified IP address. stickyport also ensures port stays the same."));
+ printf (" %s\n", "--max-redirs=INTEGER");
+ printf (" %s", _("Maximal number of redirects (default: "));
+ printf ("%d)\n", DEFAULT_MAX_REDIRS);
+ printf (" %s\n", "-m, --pagesize=INTEGER<:INTEGER>");
+ printf (" %s\n", _("Minimum page size required (bytes) : Maximum page size required (bytes)"));
+ printf (UT_WARN_CRIT);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("This plugin will attempt to open an HTTP connection with the host."));
+ printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL"));
+ printf (" %s\n", _("other errors return STATE_UNKNOWN. Successful connects, but incorrect response"));
+ printf (" %s\n", _("messages from the host result in STATE_WARNING return values. If you are"));
+ printf (" %s\n", _("checking a virtual server that uses 'host headers' you must supply the FQDN"));
+ printf (" %s\n", _("(fully qualified domain name) as the [host_name] argument."));
+
+#ifdef HAVE_SSL
+ printf ("\n");
+ printf (" %s\n", _("This plugin can also check whether an SSL enabled web server is able to"));
+ printf (" %s\n", _("serve content (optionally within a specified time) or whether the X509 "));
+ printf (" %s\n", _("certificate is still valid for the specified number of days."));
+ printf ("\n");
+ printf (" %s\n", _("Please note that this plugin does not check if the presented server"));
+ printf (" %s\n", _("certificate matches the hostname of the server, or if the certificate"));
+ printf (" %s\n", _("has a valid chain of trust to one of the locally installed CAs."));
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n\n", "CHECK CONTENT: check_http -w 5 -c 10 --ssl -H www.verisign.com");
+ printf (" %s\n", _("When the 'www.verisign.com' server returns its content within 5 seconds,"));
+ printf (" %s\n", _("a STATE_OK will be returned. When the server returns its content but exceeds"));
+ printf (" %s\n", _("the 5-second threshold, a STATE_WARNING will be returned. When an error occurs,"));
+ printf (" %s\n", _("a STATE_CRITICAL will be returned."));
+ printf ("\n");
+ printf (" %s\n\n", "CHECK CERTIFICATE: check_http -H www.verisign.com -C 14");
+ printf (" %s\n", _("When the certificate of 'www.verisign.com' is valid for more than 14 days,"));
+ printf (" %s\n", _("a STATE_OK is returned. When the certificate is still valid, but for less than"));
+ printf (" %s\n", _("14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"));
+ printf (" %s\n\n", _("the certificate is expired."));
+ printf ("\n");
+ printf (" %s\n\n", "CHECK CERTIFICATE: check_http -H www.verisign.com -C 30,14");
+ printf (" %s\n", _("When the certificate of 'www.verisign.com' is valid for more than 30 days,"));
+ printf (" %s\n", _("a STATE_OK is returned. When the certificate is still valid, but for less than"));
+ printf (" %s\n", _("30 days, but more than 14 days, a STATE_WARNING is returned."));
+ printf (" %s\n", _("A STATE_CRITICAL will be returned when certificate expires in less than 14 days"));
+
+ printf (" %s\n\n", "CHECK SSL WEBSERVER CONTENT VIA PROXY USING HTTP 1.1 CONNECT: ");
+ printf (" %s\n", _("check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j CONNECT -H www.verisign.com "));
+ printf (" %s\n", _("all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -S(sl) -j CONNECT -H <webserver>"));
+ printf (" %s\n", _("a STATE_OK will be returned. When the server returns its content but exceeds"));
+ printf (" %s\n", _("the 5-second threshold, a STATE_WARNING will be returned. When an error occurs,"));
+ printf (" %s\n", _("a STATE_CRITICAL will be returned. By adding a colon to the method you can set the method used"));
+ printf (" %s\n", _("inside the proxied connection: -j CONNECT:POST"));
+
+#endif
+
+ printf (UT_SUPPORT);
+
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]\n",progname);
+ printf (" [-J <client certificate file>] [-K <private key>]\n");
+ printf (" [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-E] [-a auth]\n");
+ printf (" [-b proxy_auth] [-f <ok|warning|critical|follow|sticky|stickyport>]\n");
+ printf (" [-e <expect>] [-d string] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n");
+ printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n");
+ printf (" [-A string] [-k string] [-S <version>] [--sni]\n");
+ printf (" [-T <content-type>] [-j method]\n");
+ printf (" %s -H <vhost> | -I <IP-address> -C <warn_age>[,<crit_age>]\n",progname);
+ printf (" [-p <port>] [-t <timeout>] [-4|-6] [--sni]\n");
+}
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
new file mode 100644
index 0000000..0160d98
--- /dev/null
+++ b/plugins/check_ide_smart.c
@@ -0,0 +1,608 @@
+/*****************************************************************************
+*
+* Monitoring check_ide_smart plugin
+* ide-smart 1.3 - IDE S.M.A.R.T. checking tool
+*
+* License: GPL
+* Copyright (C) 1998-1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>
+* 1998 Gadi Oxman <gadio@netvision.net.il>
+* Copyright (c) 2000 Robert Dale <rdale@digital-mission.com>
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_ide_smart plugin
+*
+* This plugin checks a local hard drive with the (Linux specific) SMART
+* interface
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_ide_smart";
+const char *copyright = "1998-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+
+void print_help (void);
+void print_usage (void);
+
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#ifdef __linux__
+#include <linux/hdreg.h>
+#include <linux/types.h>
+
+#define OPEN_MODE O_RDONLY
+#endif /* __linux__ */
+#ifdef __NetBSD__
+#include <sys/device.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/videoio.h> /* for __u8 and friends */
+#include <sys/scsiio.h>
+#include <sys/ataio.h>
+#include <dev/ata/atareg.h>
+#include <dev/ic/wdcreg.h>
+
+#define SMART_ENABLE WDSM_ENABLE_OPS
+#define SMART_DISABLE WDSM_DISABLE_OPS
+#define SMART_IMMEDIATE_OFFLINE WDSM_EXEC_OFFL_IMM
+#define SMART_AUTO_OFFLINE 0xdb /* undefined in NetBSD headers */
+
+#define OPEN_MODE O_RDWR
+#endif /* __NetBSD__ */
+#include <errno.h>
+
+#define NR_ATTRIBUTES 30
+
+#ifndef TRUE
+#define TRUE 1
+#endif /* */
+
+#define PREFAILURE 2
+#define ADVISORY 1
+#define OPERATIONAL 0
+#define UNKNOWN -1
+
+typedef struct threshold_s
+{
+ __u8 id;
+ __u8 threshold;
+ __u8 reserved[10];
+}
+__attribute__ ((packed)) threshold_t;
+
+typedef struct thresholds_s
+{
+ __u16 revision;
+ threshold_t thresholds[NR_ATTRIBUTES];
+ __u8 reserved[18];
+ __u8 vendor[131];
+ __u8 checksum;
+}
+__attribute__ ((packed)) thresholds_t;
+
+typedef struct value_s
+{
+ __u8 id;
+ __u16 status;
+ __u8 value;
+ __u8 vendor[8];
+}
+__attribute__ ((packed)) value_t;
+
+typedef struct values_s
+{
+ __u16 revision;
+ value_t values[NR_ATTRIBUTES];
+ __u8 offline_status;
+ __u8 vendor1;
+ __u16 offline_timeout;
+ __u8 vendor2;
+ __u8 offline_capability;
+ __u16 smart_capability;
+ __u8 reserved[16];
+ __u8 vendor[125];
+ __u8 checksum;
+}
+__attribute__ ((packed)) values_t;
+
+struct
+{
+ __u8 value;
+ char *text;
+}
+
+offline_status_text[] =
+ {
+ {0x00, "NeverStarted"},
+ {0x02, "Completed"},
+ {0x04, "Suspended"},
+ {0x05, "Aborted"},
+ {0x06, "Failed"},
+ {0, 0}
+ };
+
+struct
+{
+ __u8 value;
+ char *text;
+}
+
+smart_command[] =
+ {
+ {SMART_ENABLE, "SMART_ENABLE"},
+ {SMART_DISABLE, "SMART_DISABLE"},
+ {SMART_IMMEDIATE_OFFLINE, "SMART_IMMEDIATE_OFFLINE"},
+ {SMART_AUTO_OFFLINE, "SMART_AUTO_OFFLINE"}
+ };
+
+
+/* Index to smart_command table, keep in order */
+enum SmartCommand
+ { SMART_CMD_ENABLE,
+ SMART_CMD_DISABLE,
+ SMART_CMD_IMMEDIATE_OFFLINE,
+ SMART_CMD_AUTO_OFFLINE
+ };
+
+char *get_offline_text (int);
+int smart_read_values (int, values_t *);
+int nagios (values_t *, thresholds_t *);
+void print_value (value_t *, threshold_t *);
+void print_values (values_t *, thresholds_t *);
+int smart_cmd_simple (int, enum SmartCommand, __u8, char);
+int smart_read_thresholds (int, thresholds_t *);
+int verbose = FALSE;
+
+int
+main (int argc, char *argv[])
+{
+ char *device = NULL;
+ int o, longindex;
+ int retval = 0;
+
+ thresholds_t thresholds;
+ values_t values;
+ int fd;
+
+ static struct option longopts[] = {
+ {"device", required_argument, 0, 'd'},
+ {"immediate", no_argument, 0, 'i'},
+ {"quiet-check", no_argument, 0, 'q'},
+ {"auto-on", no_argument, 0, '1'},
+ {"auto-off", no_argument, 0, '0'},
+ {"nagios", no_argument, 0, 'n'}, /* DEPRECATED, but we still accept it */
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {0, 0, 0, 0}
+ };
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ while (1) {
+
+ o = getopt_long (argc, argv, "+d:iq10nhVv", longopts, &longindex);
+
+ if (o == -1 || o == EOF || o == 1)
+ break;
+
+ switch (o) {
+ case 'd':
+ device = optarg;
+ break;
+ case 'q':
+ fprintf (stderr, "%s\n", _("DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\"."));
+ fprintf (stderr, "%s\n", _("Nagios-compatible output is now always returned."));
+ break;
+ case 'i':
+ case '1':
+ case '0':
+ printf ("%s\n", _("SMART commands are broken and have been disabled (See Notes in --help)."));
+ return STATE_CRITICAL;
+ break;
+ case 'n':
+ fprintf (stderr, "%s\n", _("DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the"));
+ fprintf (stderr, "%s\n", _("default and will be removed from future releases."));
+ break;
+ case 'v': /* verbose */
+ verbose = TRUE;
+ break;
+ case 'h':
+ print_help ();
+ return STATE_UNKNOWN;
+ case 'V':
+ print_revision (progname, NP_VERSION);
+ return STATE_UNKNOWN;
+ default:
+ usage5 ();
+ }
+ }
+
+ if (optind < argc) {
+ device = argv[optind];
+ }
+
+ if (!device) {
+ print_help ();
+ return STATE_UNKNOWN;
+ }
+
+ fd = open (device, OPEN_MODE);
+
+ if (fd < 0) {
+ printf (_("CRITICAL - Couldn't open device %s: %s\n"), device, strerror (errno));
+ return STATE_CRITICAL;
+ }
+
+ if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, FALSE)) {
+ printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
+ return STATE_CRITICAL;
+ }
+
+ smart_read_values (fd, &values);
+ smart_read_thresholds (fd, &thresholds);
+ retval = nagios (&values, &thresholds);
+ if (verbose) print_values (&values, &thresholds);
+
+ close (fd);
+ return retval;
+}
+
+
+
+char *
+get_offline_text (int status)
+{
+ int i;
+ for (i = 0; offline_status_text[i].text; i++) {
+ if (offline_status_text[i].value == status) {
+ return offline_status_text[i].text;
+ }
+ }
+ return "UNKNOWN";
+}
+
+
+
+int
+smart_read_values (int fd, values_t * values)
+{
+#ifdef __linux__
+ int e;
+ __u8 args[4 + 512];
+ args[0] = WIN_SMART;
+ args[1] = 0;
+ args[2] = SMART_READ_VALUES;
+ args[3] = 1;
+ if (ioctl (fd, HDIO_DRIVE_CMD, &args)) {
+ e = errno;
+ printf (_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror (errno));
+ return e;
+ }
+ memcpy (values, args + 4, 512);
+#endif /* __linux__ */
+#ifdef __NetBSD__
+ struct atareq req;
+ unsigned char inbuf[DEV_BSIZE];
+
+ memset(&req, 0, sizeof(req));
+ req.timeout = 1000;
+ memset(&inbuf, 0, sizeof(inbuf));
+
+ req.flags = ATACMD_READ;
+ req.features = WDSM_RD_DATA;
+ req.command = WDCC_SMART;
+ req.databuf = (char *)inbuf;
+ req.datalen = sizeof(inbuf);
+ req.cylinder = WDSMART_CYL;
+
+ if (ioctl(fd, ATAIOCCOMMAND, &req) == 0) {
+ if (req.retsts != ATACMD_OK)
+ errno = ENODEV;
+ }
+
+ if (errno != 0) {
+ int e = errno;
+ printf (_("CRITICAL - SMART_READ_VALUES: %s\n"), strerror (errno));
+ return e;
+ }
+
+ (void)memcpy(values, inbuf, 512);
+#endif /* __NetBSD__ */
+ return 0;
+}
+
+
+
+int
+nagios (values_t * p, thresholds_t * t)
+{
+ value_t * value = p->values;
+ threshold_t * threshold = t->thresholds;
+ int status = OPERATIONAL;
+ int prefailure = 0;
+ int advisory = 0;
+ int failed = 0;
+ int passed = 0;
+ int total = 0;
+ int i;
+ for (i = 0; i < NR_ATTRIBUTES; i++) {
+ if (value->id && threshold->id && value->id == threshold->id) {
+ if (value->value < threshold->threshold) {
+ ++failed;
+ if (value->status & 1) {
+ status = PREFAILURE;
+ ++prefailure;
+ }
+ else {
+ status = ADVISORY;
+ ++advisory;
+ }
+ }
+ else {
+ ++passed;
+ }
+ ++total;
+ }
+ ++value;
+ ++threshold;
+ }
+ switch (status) {
+ case PREFAILURE:
+ printf (_("CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"),
+ prefailure,
+ prefailure > 1 ? 's' : ' ',
+ failed,
+ total);
+ status=STATE_CRITICAL;
+ break;
+ case ADVISORY:
+ printf (_("WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"),
+ advisory,
+ advisory > 1 ? "ies" : "y",
+ failed,
+ total);
+ status=STATE_WARNING;
+ break;
+ case OPERATIONAL:
+ printf (_("OK - Operational (%d/%d tests passed)\n"), passed, total);
+ status=STATE_OK;
+ break;
+ default:
+ printf (_("ERROR - Status '%d' unknown. %d/%d tests passed\n"), status,
+ passed, total);
+ status = STATE_UNKNOWN;
+ break;
+ }
+ return status;
+}
+
+
+
+void
+print_value (value_t * p, threshold_t * t)
+{
+ printf ("Id=%3d, Status=%2d {%s , %s}, Value=%3d, Threshold=%3d, %s\n",
+ p->id, p->status, p->status & 1 ? "PreFailure" : "Advisory ",
+ p->status & 2 ? "OnLine " : "OffLine", p->value, t->threshold,
+ p->value >= t->threshold ? "Passed" : "Failed");
+}
+
+
+
+void
+print_values (values_t * p, thresholds_t * t)
+{
+ value_t * value = p->values;
+ threshold_t * threshold = t->thresholds;
+ int i;
+ for (i = 0; i < NR_ATTRIBUTES; i++) {
+ if (value->id && threshold->id && value->id == threshold->id) {
+ print_value (value++, threshold++);
+ }
+ }
+ printf
+ (_("OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"),
+ p->offline_status,
+ get_offline_text (p->offline_status & 0x7f),
+ (p->offline_status & 0x80 ? "Yes" : "No"),
+ p->offline_timeout / 60);
+ printf
+ (_("OffLineCapability=%d {%s %s %s}\n"),
+ p->offline_capability,
+ p->offline_capability & 1 ? "Immediate" : "",
+ p->offline_capability & 2 ? "Auto" : "",
+ p->offline_capability & 4 ? "AbortOnCmd" : "SuspendOnCmd");
+ printf
+ (_("SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"),
+ p->revision,
+ p->checksum,
+ p->smart_capability,
+ p->smart_capability & 1 ? "SaveOnStandBy" : "",
+ p->smart_capability & 2 ? "AutoSave" : "");
+}
+
+
+int
+smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error)
+{
+ int e = STATE_UNKNOWN;
+#ifdef __linux__
+ __u8 args[4];
+ args[0] = WIN_SMART;
+ args[1] = val0;
+ args[2] = smart_command[command].value;
+ args[3] = 0;
+ if (ioctl (fd, HDIO_DRIVE_CMD, &args)) {
+ e = STATE_CRITICAL;
+ if (show_error)
+ printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno));
+ } else {
+ e = STATE_OK;
+ if (show_error)
+ printf (_("OK - Command sent (%s)\n"), smart_command[command].text);
+ }
+
+#endif /* __linux__ */
+#ifdef __NetBSD__
+ struct atareq req;
+
+ memset(&req, 0, sizeof(req));
+ req.timeout = 1000;
+ req.flags = ATACMD_READREG;
+ req.features = smart_command[command].value;
+ req.command = WDCC_SMART;
+ req.cylinder = WDSMART_CYL;
+ req.sec_count = val0;
+
+ if (ioctl(fd, ATAIOCCOMMAND, &req) == 0) {
+ if (req.retsts != ATACMD_OK)
+ errno = ENODEV;
+ if (req.cylinder != WDSMART_CYL)
+ errno = ENODEV;
+ }
+
+ if (errno != 0) {
+ e = STATE_CRITICAL;
+ if (show_error)
+ printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno));
+ } else {
+ e = STATE_OK;
+ if (show_error)
+ printf (_("OK - Command sent (%s)\n"), smart_command[command].text);
+ }
+
+#endif /* __NetBSD__ */
+ return e;
+}
+
+
+
+int
+smart_read_thresholds (int fd, thresholds_t * thresholds)
+{
+#ifdef __linux__
+ int e;
+ __u8 args[4 + 512];
+ args[0] = WIN_SMART;
+ args[1] = 0;
+ args[2] = SMART_READ_THRESHOLDS;
+ args[3] = 1;
+ if (ioctl (fd, HDIO_DRIVE_CMD, &args)) {
+ e = errno;
+ printf (_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror (errno));
+ return e;
+ }
+ memcpy (thresholds, args + 4, 512);
+#endif /* __linux__ */
+#ifdef __NetBSD__
+ struct atareq req;
+ unsigned char inbuf[DEV_BSIZE];
+
+ memset(&req, 0, sizeof(req));
+ req.timeout = 1000;
+ memset(&inbuf, 0, sizeof(inbuf));
+
+ req.flags = ATACMD_READ;
+ req.features = WDSM_RD_THRESHOLDS;
+ req.command = WDCC_SMART;
+ req.databuf = (char *)inbuf;
+ req.datalen = sizeof(inbuf);
+ req.cylinder = WDSMART_CYL;
+
+ if (ioctl(fd, ATAIOCCOMMAND, &req) == 0) {
+ if (req.retsts != ATACMD_OK)
+ errno = ENODEV;
+ }
+
+ if (errno != 0) {
+ int e = errno;
+ printf (_("CRITICAL - SMART_READ_THRESHOLDS: %s\n"), strerror (errno));
+ return e;
+ }
+
+ (void)memcpy(thresholds, inbuf, 512);
+#endif /* __NetBSD__ */
+ return 0;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>\n");
+ printf ("Plugin implementation - 1999 Robert Dale <rdale@digital-mission.com>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("This plugin checks a local hard drive with the (Linux specific) SMART interface [http://smartlinux.sourceforge.net/smart/index.php]."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-d, --device=DEVICE");
+ printf (" %s\n", _("Select device DEVICE"));
+ printf (" %s\n", _("Note: if the device is specified without this option, any further option will"));
+ printf (" %s\n", _("be ignored."));
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were"));
+ printf (" %s\n", _("broken in an underhand manner and have been disabled. You can use smartctl"));
+ printf (" %s\n", _("instead:"));
+ printf (" %s\n", _("-0/--auto-off: use \"smartctl --offlineauto=off\""));
+ printf (" %s\n", _("-1/--auto-on: use \"smartctl --offlineauto=on\""));
+ printf (" %s\n", _("-i/--immediate: use \"smartctl --test=offline\""));
+
+ printf (UT_SUPPORT);
+}
+
+ /* todo : add to the long nanual as example
+ *
+ * Run with: check_ide-smart --nagios [-d] <DRIVE>
+ * Where DRIVE is an IDE drive, ie. /dev/hda, /dev/hdb, /dev/hdc
+ *
+ * - Returns 0 on no errors
+ * - Returns 1 on advisories
+ * - Returns 2 on prefailure
+ * - Returns -1 not too often
+ */
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s [-d <device>] [-v]", progname);
+}
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
new file mode 100644
index 0000000..15113b1
--- /dev/null
+++ b/plugins/check_ldap.c
@@ -0,0 +1,517 @@
+/*****************************************************************************
+*
+* Monitoring check_ldap plugin
+*
+* License: GPL
+* Copyright (c) 2000-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_ldap plugin
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+/* progname may be check_ldaps */
+char *progname = "check_ldap";
+const char *copyright = "2000-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+#include <lber.h>
+#define LDAP_DEPRECATED 1
+#include <ldap.h>
+
+enum {
+ UNDEFINED = 0,
+#ifdef HAVE_LDAP_SET_OPTION
+ DEFAULT_PROTOCOL = 2,
+#endif
+ DEFAULT_PORT = 389
+};
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+char ld_defattr[] = "(objectclass=*)";
+char *ld_attr = ld_defattr;
+char *ld_host = NULL;
+char *ld_base = NULL;
+char *ld_passwd = NULL;
+char *ld_binddn = NULL;
+int ld_port = -1;
+#ifdef HAVE_LDAP_SET_OPTION
+int ld_protocol = DEFAULT_PROTOCOL;
+#endif
+#ifndef LDAP_OPT_SUCCESS
+# define LDAP_OPT_SUCCESS LDAP_SUCCESS
+#endif
+double warn_time = UNDEFINED;
+double crit_time = UNDEFINED;
+thresholds *entries_thresholds = NULL;
+struct timeval tv;
+char* warn_entries = NULL;
+char* crit_entries = NULL;
+int starttls = FALSE;
+int ssl_on_connect = FALSE;
+int verbose = 0;
+
+/* for ldap tls */
+
+char *SERVICE = "LDAP";
+
+int
+main (int argc, char *argv[])
+{
+
+ LDAP *ld;
+ LDAPMessage *result;
+
+ /* should be int result = STATE_UNKNOWN; */
+
+ int status = STATE_UNKNOWN;
+ long microsec;
+ double elapsed_time;
+
+ /* for ldap tls */
+
+ int tls;
+ int version=3;
+
+ int status_entries = STATE_OK;
+ int num_entries = 0;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ if (strstr(argv[0],"check_ldaps")) {
+ xasprintf (&progname, "check_ldaps");
+ }
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ if (strstr(argv[0],"check_ldaps") && ! starttls && ! ssl_on_connect)
+ starttls = TRUE;
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+
+ /* get the start time */
+ gettimeofday (&tv, NULL);
+
+ /* initialize ldap */
+#ifdef HAVE_LDAP_INIT
+ if (!(ld = ldap_init (ld_host, ld_port))) {
+ printf ("Could not connect to the server at port %i\n", ld_port);
+ return STATE_CRITICAL;
+ }
+#else
+ if (!(ld = ldap_open (ld_host, ld_port))) {
+ if (verbose)
+ ldap_perror(ld, "ldap_open");
+ printf (_("Could not connect to the server at port %i\n"), ld_port);
+ return STATE_CRITICAL;
+ }
+#endif /* HAVE_LDAP_INIT */
+
+#ifdef HAVE_LDAP_SET_OPTION
+ /* set ldap options */
+ if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) !=
+ LDAP_OPT_SUCCESS ) {
+ printf(_("Could not set protocol version %d\n"), ld_protocol);
+ return STATE_CRITICAL;
+ }
+#endif
+
+ if (ld_port == LDAPS_PORT || ssl_on_connect) {
+ xasprintf (&SERVICE, "LDAPS");
+#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)
+ /* ldaps: set option tls */
+ tls = LDAP_OPT_X_TLS_HARD;
+
+ if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS)
+ {
+ if (verbose)
+ ldap_perror(ld, "ldaps_option");
+ printf (_("Could not init TLS at port %i!\n"), ld_port);
+ return STATE_CRITICAL;
+ }
+#else
+ printf (_("TLS not supported by the libraries!\n"));
+ return STATE_CRITICAL;
+#endif /* LDAP_OPT_X_TLS */
+ } else if (starttls) {
+ xasprintf (&SERVICE, "LDAP-TLS");
+#if defined(HAVE_LDAP_SET_OPTION) && defined(HAVE_LDAP_START_TLS_S)
+ /* ldap with startTLS: set option version */
+ if (ldap_get_option(ld,LDAP_OPT_PROTOCOL_VERSION, &version) == LDAP_OPT_SUCCESS )
+ {
+ if (version < LDAP_VERSION3)
+ {
+ version = LDAP_VERSION3;
+ ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version);
+ }
+ }
+ /* call start_tls */
+ if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)
+ {
+ if (verbose)
+ ldap_perror(ld, "ldap_start_tls");
+ printf (_("Could not init startTLS at port %i!\n"), ld_port);
+ return STATE_CRITICAL;
+ }
+#else
+ printf (_("startTLS not supported by the library, needs LDAPv3!\n"));
+ return STATE_CRITICAL;
+#endif /* HAVE_LDAP_START_TLS_S */
+ }
+
+ /* bind to the ldap server */
+ if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) !=
+ LDAP_SUCCESS) {
+ if (verbose)
+ ldap_perror(ld, "ldap_bind");
+ printf (_("Could not bind to the LDAP server\n"));
+ return STATE_CRITICAL;
+ }
+
+ /* do a search of all objectclasses in the base dn */
+ if (ldap_search_s (ld, ld_base, (crit_entries!=NULL || warn_entries!=NULL) ? LDAP_SCOPE_SUBTREE : LDAP_SCOPE_BASE, ld_attr, NULL, 0, &result)
+ != LDAP_SUCCESS) {
+ if (verbose)
+ ldap_perror(ld, "ldap_search");
+ printf (_("Could not search/find objectclasses in %s\n"), ld_base);
+ return STATE_CRITICAL;
+ } else if (crit_entries!=NULL || warn_entries!=NULL) {
+ num_entries = ldap_count_entries(ld, result);
+ }
+
+ /* unbind from the ldap server */
+ ldap_unbind (ld);
+
+ /* reset the alarm handler */
+ alarm (0);
+
+ /* calculate the elapsed time and compare to thresholds */
+
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
+
+ if (crit_time!=UNDEFINED && elapsed_time>crit_time)
+ status = STATE_CRITICAL;
+ else if (warn_time!=UNDEFINED && elapsed_time>warn_time)
+ status = STATE_WARNING;
+ else
+ status = STATE_OK;
+
+ if(entries_thresholds != NULL) {
+ if (verbose) {
+ printf ("entries found: %d\n", num_entries);
+ print_thresholds("entry thresholds", entries_thresholds);
+ }
+ status_entries = get_status(num_entries, entries_thresholds);
+ if (status_entries == STATE_CRITICAL) {
+ status = STATE_CRITICAL;
+ } else if (status != STATE_CRITICAL) {
+ status = status_entries;
+ }
+ }
+
+ /* print out the result */
+ if (crit_entries!=NULL || warn_entries!=NULL) {
+ printf (_("LDAP %s - found %d entries in %.3f seconds|%s %s\n"),
+ state_text (status),
+ num_entries,
+ elapsed_time,
+ fperfdata ("time", elapsed_time, "s",
+ (int)warn_time, warn_time,
+ (int)crit_time, crit_time,
+ TRUE, 0, FALSE, 0),
+ sperfdata ("entries", (double)num_entries, "",
+ warn_entries,
+ crit_entries,
+ TRUE, 0.0, FALSE, 0.0));
+ } else {
+ printf (_("LDAP %s - %.3f seconds response time|%s\n"),
+ state_text (status),
+ elapsed_time,
+ fperfdata ("time", elapsed_time, "s",
+ (int)warn_time, warn_time,
+ (int)crit_time, crit_time,
+ TRUE, 0, FALSE, 0));
+ }
+
+ return status;
+}
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ /* initialize the long option struct */
+ static struct option longopts[] = {
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"timeout", required_argument, 0, 't'},
+ {"hostname", required_argument, 0, 'H'},
+ {"base", required_argument, 0, 'b'},
+ {"attr", required_argument, 0, 'a'},
+ {"bind", required_argument, 0, 'D'},
+ {"pass", required_argument, 0, 'P'},
+#ifdef HAVE_LDAP_SET_OPTION
+ {"ver2", no_argument, 0, '2'},
+ {"ver3", no_argument, 0, '3'},
+#endif
+ {"starttls", no_argument, 0, 'T'},
+ {"ssl", no_argument, 0, 'S'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"port", required_argument, 0, 'p'},
+ {"warn", required_argument, 0, 'w'},
+ {"crit", required_argument, 0, 'c'},
+ {"warn-entries", required_argument, 0, 'W'},
+ {"crit-entries", required_argument, 0, 'C'},
+ {"verbose", no_argument, 0, 'v'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "hvV234TS6t:c:w:H:b:p:a:D:P:C:W:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 't': /* timeout period */
+ if (!is_intnonneg (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ socket_timeout = atoi (optarg);
+ break;
+ case 'H':
+ ld_host = optarg;
+ break;
+ case 'b':
+ ld_base = optarg;
+ break;
+ case 'p':
+ ld_port = atoi (optarg);
+ break;
+ case 'a':
+ ld_attr = optarg;
+ break;
+ case 'D':
+ ld_binddn = optarg;
+ break;
+ case 'P':
+ ld_passwd = optarg;
+ break;
+ case 'w':
+ warn_time = strtod (optarg, NULL);
+ break;
+ case 'c':
+ crit_time = strtod (optarg, NULL);
+ break;
+ case 'W':
+ warn_entries = optarg;
+ break;
+ case 'C':
+ crit_entries = optarg;
+ break;
+#ifdef HAVE_LDAP_SET_OPTION
+ case '2':
+ ld_protocol = 2;
+ break;
+ case '3':
+ ld_protocol = 3;
+ break;
+#endif
+ case '4':
+ address_family = AF_INET;
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'T':
+ if (! ssl_on_connect)
+ starttls = TRUE;
+ else
+ usage_va(_("%s cannot be combined with %s"), "-T/--starttls", "-S/--ssl");
+ break;
+ case 'S':
+ if (! starttls) {
+ ssl_on_connect = TRUE;
+ if (ld_port == -1)
+ ld_port = LDAPS_PORT;
+ } else
+ usage_va(_("%s cannot be combined with %s"), "-S/--ssl", "-T/--starttls");
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage (_("IPv6 support not available\n"));
+#endif
+ break;
+ default:
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (ld_host == NULL && is_host(argv[c]))
+ ld_host = strdup (argv[c++]);
+
+ if (ld_base == NULL && argv[c])
+ ld_base = strdup (argv[c++]);
+
+ if (ld_port == -1)
+ ld_port = DEFAULT_PORT;
+
+ return validate_arguments ();
+}
+
+
+int
+validate_arguments ()
+{
+ if (ld_host==NULL || strlen(ld_host)==0)
+ usage4 (_("Please specify the host name\n"));
+
+ if (ld_base==NULL)
+ usage4 (_("Please specify the LDAP base\n"));
+
+ if (crit_entries!=NULL || warn_entries!=NULL) {
+ set_thresholds(&entries_thresholds,
+ warn_entries, crit_entries);
+ }
+ if (ld_passwd==NULL)
+ ld_passwd = getenv("LDAP_PASSWORD");
+
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", DEFAULT_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (UT_IPv46);
+
+ printf (" %s\n", "-a [--attr]");
+ printf (" %s\n", _("ldap attribute to search (default: \"(objectclass=*)\""));
+ printf (" %s\n", "-b [--base]");
+ printf (" %s\n", _("ldap base (eg. ou=my unit, o=my org, c=at"));
+ printf (" %s\n", "-D [--bind]");
+ printf (" %s\n", _("ldap bind DN (if required)"));
+ printf (" %s\n", "-P [--pass]");
+ printf (" %s\n", _("ldap password (if required, or set the password through environment variable 'LDAP_PASSWORD')"));
+ printf (" %s\n", "-T [--starttls]");
+ printf (" %s\n", _("use starttls mechanism introduced in protocol version 3"));
+ printf (" %s\n", "-S [--ssl]");
+ printf (" %s %i\n", _("use ldaps (ldap v2 ssl method). this also sets the default port to"), LDAPS_PORT);
+
+#ifdef HAVE_LDAP_SET_OPTION
+ printf (" %s\n", "-2 [--ver2]");
+ printf (" %s\n", _("use ldap protocol version 2"));
+ printf (" %s\n", "-3 [--ver3]");
+ printf (" %s\n", _("use ldap protocol version 3"));
+ printf (" (%s %d)\n", _("default protocol version:"), DEFAULT_PROTOCOL);
+#endif
+
+ printf (UT_WARN_CRIT);
+
+ printf (" %s\n", "-W [--warn-entries]");
+ printf (" %s\n", _("Number of found entries to result in warning status"));
+ printf (" %s\n", "-C [--crit-entries]");
+ printf (" %s\n", _("Number of found entries to result in critical status"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"));
+ printf (_(" implied (using default port %i) unless --port=636 is specified. In that case\n"), DEFAULT_PORT);
+ printf (" %s\n", _("'SSL on connect' will be used no matter how the plugin was called."));
+ printf (" %s\n", _("This detection is deprecated, please use 'check_ldap' with the '--starttls' or '--ssl' flags"));
+ printf (" %s\n", _("to define the behaviour explicitly instead."));
+ printf (" %s\n", _("The parameters --warn-entries and --crit-entries are optional."));
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]",progname);
+ printf ("\n [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n",
+#ifdef HAVE_LDAP_SET_OPTION
+ "\n [-2|-3] [-4|-6]"
+#else
+ ""
+#endif
+ );
+}
diff --git a/plugins/check_load.c b/plugins/check_load.c
new file mode 100644
index 0000000..313df8a
--- /dev/null
+++ b/plugins/check_load.c
@@ -0,0 +1,417 @@
+/*****************************************************************************
+*
+* Monitoring check_load plugin
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_load plugin
+*
+* This plugin tests the current system load average.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_load";
+const char *copyright = "1999-2022";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "./common.h"
+#include "./runcmd.h"
+#include "./utils.h"
+#include "./popen.h"
+
+#include <string.h>
+
+#ifdef HAVE_SYS_LOADAVG_H
+#include <sys/loadavg.h>
+#endif
+
+/* needed for compilation under NetBSD, as suggested by Andy Doran */
+#ifndef LOADAVG_1MIN
+#define LOADAVG_1MIN 0
+#define LOADAVG_5MIN 1
+#define LOADAVG_15MIN 2
+#endif /* !defined LOADAVG_1MIN */
+
+
+static int process_arguments (int argc, char **argv);
+static int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+static int print_top_consuming_processes();
+
+static int n_procs_to_show = 0;
+
+/* strictly for pretty-print usage in loops */
+static const int nums[3] = { 1, 5, 15 };
+
+/* provide some fairly sane defaults */
+double wload[3] = { 0.0, 0.0, 0.0 };
+double cload[3] = { 0.0, 0.0, 0.0 };
+#define la1 la[0]
+#define la5 la[1]
+#define la15 la[2]
+
+char *status_line;
+bool take_into_account_cpus = false;
+
+static void
+get_threshold(char *arg, double *th)
+{
+ size_t i, n;
+ int valid = 0;
+ char *str = arg, *p;
+
+ n = strlen(arg);
+ for(i = 0; i < 3; i++) {
+ th[i] = strtod(str, &p);
+ if(p == str) break;
+
+ valid = 1;
+ str = p + 1;
+ if(n <= (size_t)(str - arg)) break;
+ }
+
+ /* empty argument or non-floatish, so warn about it and die */
+ if(!i && !valid) usage (_("Warning threshold must be float or float triplet!\n"));
+
+ if(i != 2) {
+ /* one or more numbers were given, so fill array with last
+ * we got (most likely to NOT produce the least expected result) */
+ for(n = i; n < 3; n++) th[n] = th[i];
+ }
+}
+
+
+int
+main (int argc, char **argv)
+{
+ int result = -1;
+ int i;
+ long numcpus;
+
+ double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about uninitialized arrays */
+#ifndef HAVE_GETLOADAVG
+ char input_buffer[MAX_INPUT_BUFFER];
+# ifdef HAVE_PROC_LOADAVG
+ FILE *fp;
+ char *str, *next;
+# endif
+#endif
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ setlocale(LC_NUMERIC, "POSIX");
+
+ /* Parse extra opts if any */
+ argv = np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+#ifdef HAVE_GETLOADAVG
+ result = getloadavg (la, 3);
+ if (result != 3)
+ return STATE_UNKNOWN;
+#else
+# ifdef HAVE_PROC_LOADAVG
+ fp = fopen (PROC_LOADAVG, "r");
+ if (fp == NULL) {
+ printf (_("Error opening %s\n"), PROC_LOADAVG);
+ return STATE_UNKNOWN;
+ }
+
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) {
+ str = (char *)input_buffer;
+ for(i = 0; i < 3; i++) {
+ la[i] = strtod(str, &next);
+ str = next;
+ }
+ }
+
+ fclose (fp);
+# else
+ child_process = spopen (PATH_TO_UPTIME);
+ if (child_process == NULL) {
+ printf (_("Error opening %s\n"), PATH_TO_UPTIME);
+ return STATE_UNKNOWN;
+ }
+ child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
+ if (child_stderr == NULL) {
+ printf (_("Could not open stderr for %s\n"), PATH_TO_UPTIME);
+ }
+ fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process);
+ if(strstr(input_buffer, "load average:")) {
+ sscanf (input_buffer, "%*[^l]load average: %lf, %lf, %lf", &la1, &la5, &la15);
+ }
+ else if(strstr(input_buffer, "load averages:")) {
+ sscanf (input_buffer, "%*[^l]load averages: %lf, %lf, %lf", &la1, &la5, &la15);
+ }
+ else {
+ printf (_("could not parse load from uptime %s: %d\n"), PATH_TO_UPTIME, result);
+ return STATE_UNKNOWN;
+ }
+
+ result = spclose (child_process);
+ if (result) {
+ printf (_("Error code %d returned in %s\n"), result, PATH_TO_UPTIME);
+ return STATE_UNKNOWN;
+ }
+# endif
+#endif
+
+ if ((la[0] < 0.0) || (la[1] < 0.0) || (la[2] < 0.0)) {
+#ifdef HAVE_GETLOADAVG
+ printf (_("Error in getloadavg()\n"));
+#else
+# ifdef HAVE_PROC_LOADAVG
+ printf (_("Error processing %s\n"), PROC_LOADAVG);
+# else
+ printf (_("Error processing %s\n"), PATH_TO_UPTIME);
+# endif
+#endif
+ return STATE_UNKNOWN;
+ }
+
+ /* we got this far, so assume OK until we've measured */
+ result = STATE_OK;
+
+ xasprintf(&status_line, _("load average: %.2f, %.2f, %.2f"), la1, la5, la15);
+ xasprintf(&status_line, ("total %s"), status_line);
+
+
+ double scaled_la[3] = { 0.0, 0.0, 0.0 };
+ bool is_using_scaled_load_values = false;
+
+ if (take_into_account_cpus == true && (numcpus = GET_NUMBER_OF_CPUS()) > 0) {
+ is_using_scaled_load_values = true;
+
+ scaled_la[0] = la[0] / numcpus;
+ scaled_la[1] = la[1] / numcpus;
+ scaled_la[2] = la[2] / numcpus;
+
+ char *tmp = NULL;
+ xasprintf(&tmp, _("load average: %.2f, %.2f, %.2f"), scaled_la[0], scaled_la[1], scaled_la[2]);
+ xasprintf(&status_line, "scaled %s - %s", tmp, status_line);
+ }
+
+ for(i = 0; i < 3; i++) {
+ if (is_using_scaled_load_values) {
+ if(scaled_la[i] > cload[i]) {
+ result = STATE_CRITICAL;
+ break;
+ }
+ else if(scaled_la[i] > wload[i]) result = STATE_WARNING;
+ } else {
+ if(la[i] > cload[i]) {
+ result = STATE_CRITICAL;
+ break;
+ }
+ else if(la[i] > wload[i]) result = STATE_WARNING;
+ }
+ }
+
+ printf("LOAD %s - %s|", state_text(result), status_line);
+ for(i = 0; i < 3; i++) {
+ if (is_using_scaled_load_values) {
+ printf("load%d=%.3f;;;0; ", nums[i], la[i]);
+ printf("scaled_load%d=%.3f;%.3f;%.3f;0; ", nums[i], scaled_la[i], wload[i], cload[i]);
+ } else {
+ printf("load%d=%.3f;%.3f;%.3f;0; ", nums[i], la[i], wload[i], cload[i]);
+ }
+ }
+
+ putchar('\n');
+ if (n_procs_to_show > 0) {
+ print_top_consuming_processes();
+ }
+ return result;
+}
+
+
+/* process command-line arguments */
+static int
+process_arguments (int argc, char **argv)
+{
+ int c = 0;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"percpu", no_argument, 0, 'r'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"procs-to-show", required_argument, 0, 'n'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vhrc:w:n:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'w': /* warning time threshold */
+ get_threshold(optarg, wload);
+ break;
+ case 'c': /* critical time threshold */
+ get_threshold(optarg, cload);
+ break;
+ case 'r': /* Divide load average by number of CPUs */
+ take_into_account_cpus = true;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'n':
+ n_procs_to_show = atoi(optarg);
+ break;
+ case '?': /* help */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (c == argc)
+ return validate_arguments ();
+
+ /* handle the case if both arguments are missing,
+ * but not if only one is given without -c or -w flag */
+ if(c - argc == 2) {
+ get_threshold(argv[c++], wload);
+ get_threshold(argv[c++], cload);
+ }
+ else if(c - argc == 1) {
+ get_threshold(argv[c++], cload);
+ }
+
+ return validate_arguments ();
+}
+
+
+static int
+validate_arguments (void)
+{
+ int i = 0;
+
+ /* match cload first, as it will give the most friendly error message
+ * if user hasn't given the -c switch properly */
+ for(i = 0; i < 3; i++) {
+ if(cload[i] < 0)
+ die (STATE_UNKNOWN, _("Critical threshold for %d-minute load average is not specified\n"), nums[i]);
+ if(wload[i] < 0)
+ die (STATE_UNKNOWN, _("Warning threshold for %d-minute load average is not specified\n"), nums[i]);
+ if(wload[i] > cload[i])
+ die (STATE_UNKNOWN, _("Parameter inconsistency: %d-minute \"warning load\" is greater than \"critical load\"\n"), nums[i]);
+ }
+
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Felipe Gustavo de Almeida <galmeida@linux.ime.usp.br>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("This plugin tests the current system load average."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-w, --warning=WLOAD1,WLOAD5,WLOAD15");
+ printf (" %s\n", _("Exit with WARNING status if load average exceeds WLOADn"));
+ printf (" %s\n", "-c, --critical=CLOAD1,CLOAD5,CLOAD15");
+ printf (" %s\n", _("Exit with CRITICAL status if load average exceed CLOADn"));
+ printf (" %s\n", _("the load average format is the same used by \"uptime\" and \"w\""));
+ printf (" %s\n", "-r, --percpu");
+ printf (" %s\n", _("Divide the load averages by the number of CPUs (when possible)"));
+ printf (" %s\n", "-n, --procs-to-show=NUMBER_OF_PROCS");
+ printf (" %s\n", _("Number of processes to show when printing the top consuming processes."));
+ printf (" %s\n", _("NUMBER_OF_PROCS=0 disables this feature. Default value is 0"));
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15 [-n NUMBER_OF_PROCS]\n", progname);
+}
+
+#ifdef PS_USES_PROCPCPU
+int cmpstringp(const void *p1, const void *p2) {
+ int procuid = 0;
+ int procpid = 0;
+ int procppid = 0;
+ int procvsz = 0;
+ int procrss = 0;
+ float procpcpu = 0;
+ char procstat[8];
+#ifdef PS_USES_PROCETIME
+ char procetime[MAX_INPUT_BUFFER];
+#endif /* PS_USES_PROCETIME */
+ char procprog[MAX_INPUT_BUFFER];
+ int pos;
+ sscanf (* (char * const *) p1, PS_FORMAT, PS_VARLIST);
+ float procpcpu1 = procpcpu;
+ sscanf (* (char * const *) p2, PS_FORMAT, PS_VARLIST);
+ return procpcpu1 < procpcpu;
+}
+#endif /* PS_USES_PROCPCPU */
+
+static int print_top_consuming_processes() {
+ int i = 0;
+ struct output chld_out, chld_err;
+ if(np_runcmd(PS_COMMAND, &chld_out, &chld_err, 0) != 0){
+ fprintf(stderr, _("'%s' exited with non-zero status.\n"), PS_COMMAND);
+ return STATE_UNKNOWN;
+ }
+ if (chld_out.lines < 2) {
+ fprintf(stderr, _("some error occurred getting procs list.\n"));
+ return STATE_UNKNOWN;
+ }
+#ifdef PS_USES_PROCPCPU
+ qsort(chld_out.line + 1, chld_out.lines - 1, sizeof(char*), cmpstringp);
+#endif /* PS_USES_PROCPCPU */
+ int lines_to_show = chld_out.lines < (size_t)(n_procs_to_show + 1)
+ ? (int)chld_out.lines : n_procs_to_show + 1;
+ for (i = 0; i < lines_to_show; i += 1) {
+ printf("%s\n", chld_out.line[i]);
+ }
+ return OK;
+}
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
new file mode 100644
index 0000000..1fda549
--- /dev/null
+++ b/plugins/check_mrtg.c
@@ -0,0 +1,385 @@
+/*****************************************************************************
+*
+* Monitoring check_mrtg plugin
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_mrtg plugin
+*
+* This plugin will check either the average or maximum value of one of the
+* two variables recorded in an MRTG log file.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_mrtg";
+const char *copyright = "1999-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+char *log_file = NULL;
+int expire_minutes = 0;
+int use_average = TRUE;
+int variable_number = -1;
+unsigned long value_warning_threshold = 0L;
+unsigned long value_critical_threshold = 0L;
+char *label;
+char *units;
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_OK;
+ FILE *fp;
+ int line;
+ char input_buffer[MAX_INPUT_BUFFER];
+ char *temp_buffer;
+ time_t current_time;
+ time_t timestamp = 0L;
+ unsigned long average_value_rate = 0L;
+ unsigned long maximum_value_rate = 0L;
+ unsigned long rate = 0L;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments\n"));
+
+ /* open the MRTG log file for reading */
+ fp = fopen (log_file, "r");
+ if (fp == NULL) {
+ printf (_("Unable to open MRTG log file\n"));
+ return STATE_UNKNOWN;
+ }
+
+ line = 0;
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) {
+
+ line++;
+
+ /* skip the first line of the log file */
+ if (line == 1)
+ continue;
+
+ /* break out of read loop if we've passed the number of entries we want to read */
+ if (line > 2)
+ break;
+
+ /* grab the timestamp */
+ temp_buffer = strtok (input_buffer, " ");
+ timestamp = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the average value 1 rate */
+ temp_buffer = strtok (NULL, " ");
+ if (variable_number == 1)
+ average_value_rate = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the average value 2 rate */
+ temp_buffer = strtok (NULL, " ");
+ if (variable_number == 2)
+ average_value_rate = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the maximum value 1 rate */
+ temp_buffer = strtok (NULL, " ");
+ if (variable_number == 1)
+ maximum_value_rate = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the maximum value 2 rate */
+ temp_buffer = strtok (NULL, " ");
+ if (variable_number == 2)
+ maximum_value_rate = strtoul (temp_buffer, NULL, 10);
+ }
+
+ /* close the log file */
+ fclose (fp);
+
+ /* if we couldn't read enough data, return an unknown error */
+ if (line <= 2) {
+ printf (_("Unable to process MRTG log file\n"));
+ return STATE_UNKNOWN;
+ }
+
+ /* make sure the MRTG data isn't too old */
+ time (&current_time);
+ if (expire_minutes > 0
+ && (current_time - timestamp) > (expire_minutes * 60)) {
+ printf (_("MRTG data has expired (%d minutes old)\n"),
+ (int) ((current_time - timestamp) / 60));
+ return STATE_WARNING;
+ }
+
+ /* else check the incoming/outgoing rates */
+ if (use_average == TRUE)
+ rate = average_value_rate;
+ else
+ rate = maximum_value_rate;
+
+ if (rate > value_critical_threshold)
+ result = STATE_CRITICAL;
+ else if (rate > value_warning_threshold)
+ result = STATE_WARNING;
+
+ printf("%s. %s = %lu %s|%s\n",
+ (use_average == TRUE) ? _("Avg") : _("Max"),
+ label, rate, units,
+ perfdata(label, (long) rate, units,
+ (int) value_warning_threshold, (long) value_warning_threshold,
+ (int) value_critical_threshold, (long) value_critical_threshold,
+ 0, 0, 0, 0));
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"logfile", required_argument, 0, 'F'},
+ {"expires", required_argument, 0, 'e'},
+ {"aggregation", required_argument, 0, 'a'},
+ {"variable", required_argument, 0, 'v'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"label", required_argument, 0, 'l'},
+ {"units", required_argument, 0, 'u'},
+ {"variable", required_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", longopts,
+ &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'F': /* input file */
+ log_file = optarg;
+ break;
+ case 'e': /* ups name */
+ expire_minutes = atoi (optarg);
+ break;
+ case 'a': /* port */
+ if (!strcmp (optarg, "MAX"))
+ use_average = FALSE;
+ else
+ use_average = TRUE;
+ break;
+ case 'v':
+ variable_number = atoi (optarg);
+ if (variable_number < 1 || variable_number > 2)
+ usage4 (_("Invalid variable number"));
+ break;
+ case 'w': /* critical time threshold */
+ value_warning_threshold = strtoul (optarg, NULL, 10);
+ break;
+ case 'c': /* warning time threshold */
+ value_critical_threshold = strtoul (optarg, NULL, 10);
+ break;
+ case 'l': /* label */
+ label = optarg;
+ break;
+ case 'u': /* timeout */
+ units = optarg;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case '?': /* help */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (log_file == NULL && argc > c) {
+ log_file = argv[c++];
+ }
+
+ if (expire_minutes <= 0 && argc > c) {
+ if (is_intpos (argv[c]))
+ expire_minutes = atoi (argv[c++]);
+ else
+ die (STATE_UNKNOWN,
+ _("%s is not a valid expiration time\nUse '%s -h' for additional help\n"),
+ argv[c], progname);
+ }
+
+ if (argc > c && strcmp (argv[c], "MAX") == 0) {
+ use_average = FALSE;
+ c++;
+ }
+ else if (argc > c && strcmp (argv[c], "AVG") == 0) {
+ use_average = TRUE;
+ c++;
+ }
+
+ if (argc > c && variable_number == -1) {
+ variable_number = atoi (argv[c++]);
+ if (variable_number < 1 || variable_number > 2) {
+ printf ("%s :", argv[c]);
+ usage (_("Invalid variable number\n"));
+ }
+ }
+
+ if (argc > c && value_warning_threshold == 0) {
+ value_warning_threshold = strtoul (argv[c++], NULL, 10);
+ }
+
+ if (argc > c && value_critical_threshold == 0) {
+ value_critical_threshold = strtoul (argv[c++], NULL, 10);
+ }
+
+ if (argc > c && strlen (label) == 0) {
+ label = argv[c++];
+ }
+
+ if (argc > c && strlen (units) == 0) {
+ units = argv[c++];
+ }
+
+ return validate_arguments ();
+}
+
+int
+validate_arguments (void)
+{
+ if (variable_number == -1)
+ usage4 (_("You must supply the variable number"));
+
+ if (label == NULL)
+ label = strdup ("value");
+
+ if (units == NULL)
+ units = strdup ("");
+
+ return OK;
+}
+
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin will check either the average or maximum value of one of the"));
+ printf ("%s\n", _("two variables recorded in an MRTG log file."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-F, --logfile=FILE");
+ printf (" %s\n", _("The MRTG log file containing the data you want to monitor"));
+ printf (" %s\n", "-e, --expires=MINUTES");
+ printf (" %s\n", _("Minutes before MRTG data is considered to be too old"));
+ printf (" %s\n", "-a, --aggregation=AVG|MAX");
+ printf (" %s\n", _("Should we check average or maximum values?"));
+ printf (" %s\n", "-v, --variable=INTEGER");
+ printf (" %s\n", _("Which variable set should we inspect? (1 or 2)"));
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Threshold value for data to result in WARNING status"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Threshold value for data to result in CRITICAL status"));
+ printf (" %s\n", "-l, --label=STRING");
+ printf (" %s\n", _("Type label for data (Examples: Conns, \"Processor Load\", In, Out)"));
+ printf (" %s\n", "-u, --units=STRING");
+ printf (" %s\n", _("Option units label for data (Example: Packets/Sec, Errors/Sec,"));
+ printf (" %s\n", _("\"Bytes Per Second\", \"%% Utilization\")"));
+
+ printf ("\n");
+ printf (" %s\n", _("If the value exceeds the <vwl> threshold, a WARNING status is returned. If"));
+ printf (" %s\n", _("the value exceeds the <vcl> threshold, a CRITICAL status is returned. If"));
+ printf (" %s\n", _("the data in the log file is older than <expire_minutes> old, a WARNING"));
+ printf (" %s\n", _("status is returned and a warning message is printed."));
+
+ printf ("\n");
+ printf (" %s\n", _("This plugin is useful for monitoring MRTG data that does not correspond to"));
+ printf (" %s\n", _("bandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth)."));
+ printf (" %s\n", _("It can be used to monitor any kind of data that MRTG is monitoring - errors,"));
+ printf (" %s\n", _("packets/sec, etc. I use MRTG in conjunction with the Novell NLM that allows"));
+ printf (" %s\n", _("me to track processor utilization, user connections, drive space, etc and"));
+ printf (" %s\n\n", _("this plugin works well for monitoring that kind of data as well."));
+
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("- This plugin only monitors one of the two variables stored in the MRTG log"));
+ printf (" %s\n", _("file. If you want to monitor both values you will have to define two"));
+ printf (" %s\n", _("commands with different values for the <variable> argument. Of course,"));
+ printf (" %s\n", _("you can always hack the code to make this plugin work for you..."));
+ printf (" %s\n", _("- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded from"));
+ printf (" %s\n", "http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html");
+
+ printf (UT_SUPPORT);
+}
+
+
+
+/* original command line:
+ <log_file> <expire_minutes> <AVG|MAX> <variable> <vwl> <vcl> <label> [units] */
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -F log_file -a <AVG | MAX> -v variable -w warning -c critical\n",progname);
+ printf ("[-l label] [-u units] [-e expire_minutes] [-t timeout] [-v]\n");
+}
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
new file mode 100644
index 0000000..eb66f62
--- /dev/null
+++ b/plugins/check_mrtgtraf.c
@@ -0,0 +1,381 @@
+/*****************************************************************************
+*
+* Monitoring check_mrtgtraf plugin
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_mtrgtraf plugin
+*
+* This plugin will check the incoming/outgoing transfer rates of a router
+* switch, etc recorded in an MRTG log.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils.h"
+
+const char *progname = "check_mrtgtraf";
+const char *copyright = "1999-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help(void);
+void print_usage(void);
+
+char *log_file = NULL;
+int expire_minutes = -1;
+int use_average = TRUE;
+unsigned long incoming_warning_threshold = 0L;
+unsigned long incoming_critical_threshold = 0L;
+unsigned long outgoing_warning_threshold = 0L;
+unsigned long outgoing_critical_threshold = 0L;
+
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_OK;
+ FILE *fp;
+ int line;
+ char input_buffer[MAX_INPUT_BUFFER];
+ char *temp_buffer;
+ time_t current_time;
+ char *error_message;
+ time_t timestamp = 0L;
+ unsigned long average_incoming_rate = 0L;
+ unsigned long average_outgoing_rate = 0L;
+ unsigned long maximum_incoming_rate = 0L;
+ unsigned long maximum_outgoing_rate = 0L;
+ unsigned long incoming_rate = 0L;
+ unsigned long outgoing_rate = 0L;
+ double adjusted_incoming_rate = 0.0;
+ double adjusted_outgoing_rate = 0.0;
+ char incoming_speed_rating[8];
+ char outgoing_speed_rating[8];
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* open the MRTG log file for reading */
+ fp = fopen (log_file, "r");
+ if (fp == NULL)
+ usage4 (_("Unable to open MRTG log file"));
+
+ line = 0;
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) {
+
+ line++;
+
+ /* skip the first line of the log file */
+ if (line == 1)
+ continue;
+
+ /* break out of read loop */
+ /* if we've passed the number of entries we want to read */
+ if (line > 2)
+ break;
+
+ /* grab the timestamp */
+ temp_buffer = strtok (input_buffer, " ");
+ timestamp = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the average incoming transfer rate */
+ temp_buffer = strtok (NULL, " ");
+ average_incoming_rate = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the average outgoing transfer rate */
+ temp_buffer = strtok (NULL, " ");
+ average_outgoing_rate = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the maximum incoming transfer rate */
+ temp_buffer = strtok (NULL, " ");
+ maximum_incoming_rate = strtoul (temp_buffer, NULL, 10);
+
+ /* grab the maximum outgoing transfer rate */
+ temp_buffer = strtok (NULL, " ");
+ maximum_outgoing_rate = strtoul (temp_buffer, NULL, 10);
+ }
+
+ /* close the log file */
+ fclose (fp);
+
+ /* if we couldn't read enough data, return an unknown error */
+ if (line <= 2)
+ usage4 (_("Unable to process MRTG log file"));
+
+ /* make sure the MRTG data isn't too old */
+ time (&current_time);
+ if ((expire_minutes > 0) &&
+ (current_time - timestamp) > (expire_minutes * 60))
+ die (STATE_WARNING, _("MRTG data has expired (%d minutes old)\n"),
+ (int) ((current_time - timestamp) / 60));
+
+ /* else check the incoming/outgoing rates */
+ if (use_average == TRUE) {
+ incoming_rate = average_incoming_rate;
+ outgoing_rate = average_outgoing_rate;
+ }
+ else {
+ incoming_rate = maximum_incoming_rate;
+ outgoing_rate = maximum_outgoing_rate;
+ }
+
+ /* report incoming traffic in Bytes/sec */
+ if (incoming_rate < 1024) {
+ strcpy (incoming_speed_rating, "B");
+ adjusted_incoming_rate = (double) incoming_rate;
+ }
+
+ /* report incoming traffic in KBytes/sec */
+ else if (incoming_rate < (1024 * 1024)) {
+ strcpy (incoming_speed_rating, "KB");
+ adjusted_incoming_rate = (double) (incoming_rate / 1024.0);
+ }
+
+ /* report incoming traffic in MBytes/sec */
+ else {
+ strcpy (incoming_speed_rating, "MB");
+ adjusted_incoming_rate = (double) (incoming_rate / 1024.0 / 1024.0);
+ }
+
+ /* report outgoing traffic in Bytes/sec */
+ if (outgoing_rate < 1024) {
+ strcpy (outgoing_speed_rating, "B");
+ adjusted_outgoing_rate = (double) outgoing_rate;
+ }
+
+ /* report outgoing traffic in KBytes/sec */
+ else if (outgoing_rate < (1024 * 1024)) {
+ strcpy (outgoing_speed_rating, "KB");
+ adjusted_outgoing_rate = (double) (outgoing_rate / 1024.0);
+ }
+
+ /* report outgoing traffic in MBytes/sec */
+ else {
+ strcpy (outgoing_speed_rating, "MB");
+ adjusted_outgoing_rate = (double) (outgoing_rate / 1024.0 / 1024.0);
+ }
+
+ if (incoming_rate > incoming_critical_threshold
+ || outgoing_rate > outgoing_critical_threshold) {
+ result = STATE_CRITICAL;
+ }
+ else if (incoming_rate > incoming_warning_threshold
+ || outgoing_rate > outgoing_warning_threshold) {
+ result = STATE_WARNING;
+ }
+
+ xasprintf (&error_message, _("%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"),
+ (use_average == TRUE) ? _("Avg") : _("Max"), adjusted_incoming_rate,
+ incoming_speed_rating, (use_average == TRUE) ? _("Avg") : _("Max"),
+ adjusted_outgoing_rate, outgoing_speed_rating,
+ fperfdata("in", adjusted_incoming_rate, incoming_speed_rating,
+ (int)incoming_warning_threshold, incoming_warning_threshold,
+ (int)incoming_critical_threshold, incoming_critical_threshold,
+ TRUE, 0, FALSE, 0),
+ fperfdata("out", adjusted_outgoing_rate, outgoing_speed_rating,
+ (int)outgoing_warning_threshold, outgoing_warning_threshold,
+ (int)outgoing_critical_threshold, outgoing_critical_threshold,
+ TRUE, 0, FALSE, 0));
+
+ printf (_("Traffic %s - %s\n"), state_text(result), error_message);
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"filename", required_argument, 0, 'F'},
+ {"expires", required_argument, 0, 'e'},
+ {"aggregation", required_argument, 0, 'a'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'F': /* input file */
+ log_file = optarg;
+ break;
+ case 'e': /* expiration time */
+ expire_minutes = atoi (optarg);
+ break;
+ case 'a': /* aggregation (AVE or MAX) */
+ if (!strcmp (optarg, "MAX"))
+ use_average = FALSE;
+ else
+ use_average = TRUE;
+ break;
+ case 'c': /* warning threshold */
+ sscanf (optarg, "%lu,%lu", &incoming_critical_threshold,
+ &outgoing_critical_threshold);
+ break;
+ case 'w': /* critical threshold */
+ sscanf (optarg, "%lu,%lu", &incoming_warning_threshold,
+ &outgoing_warning_threshold);
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case '?': /* help */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (argc > c && log_file == NULL) {
+ log_file = argv[c++];
+ }
+
+ if (argc > c && expire_minutes == -1) {
+ expire_minutes = atoi (argv[c++]);
+ }
+
+ if (argc > c && strcmp (argv[c], "MAX") == 0) {
+ use_average = FALSE;
+ c++;
+ }
+ else if (argc > c && strcmp (argv[c], "AVG") == 0) {
+ use_average = TRUE;
+ c++;
+ }
+
+ if (argc > c && incoming_warning_threshold == 0) {
+ incoming_warning_threshold = strtoul (argv[c++], NULL, 10);
+ }
+
+ if (argc > c && incoming_critical_threshold == 0) {
+ incoming_critical_threshold = strtoul (argv[c++], NULL, 10);
+ }
+
+ if (argc > c && outgoing_warning_threshold == 0) {
+ outgoing_warning_threshold = strtoul (argv[c++], NULL, 10);
+ }
+
+ if (argc > c && outgoing_critical_threshold == 0) {
+ outgoing_critical_threshold = strtoul (argv[c++], NULL, 10);
+ }
+
+ return validate_arguments ();
+}
+
+
+int
+validate_arguments (void)
+{
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin will check the incoming/outgoing transfer rates of a router,"));
+ printf ("%s\n", _("switch, etc recorded in an MRTG log. If the newest log entry is older"));
+ printf ("%s\n", _("than <expire_minutes>, a WARNING status is returned. If either the"));
+ printf ("%s\n", _("incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"));
+ printf ("%s\n", _("Bytes/sec), a CRITICAL status results. If either of the rates exceed"));
+ printf ("%s\n", _("the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-F, --filename=STRING");
+ printf (" %s\n", _("File to read log from"));
+ printf (" %s\n", "-e, --expires=INTEGER");
+ printf (" %s\n", _("Minutes after which log expires"));
+ printf (" %s\n", "-a, --aggregation=(AVG|MAX)");
+ printf (" %s\n", _("Test average or maximum"));
+ printf (" %s\n", "-w, --warning");
+ printf (" %s\n", _("Warning threshold pair <incoming>,<outgoing>"));
+ printf (" %s\n", "-c, --critical");
+ printf (" %s\n", _("Critical threshold pair <incoming>,<outgoing>"));
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"));
+ printf (" %s\n", " http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html");
+ printf (" %s\n", _("- While MRTG can monitor things other than traffic rates, this"));
+ printf (" %s\n", _(" plugin probably won't work with much else without modification."));
+ printf (" %s\n", _("- The calculated i/o rates are a little off from what MRTG actually"));
+ printf (" %s\n", _(" reports. I'm not sure why this is right now, but will look into it"));
+ printf (" %s\n", _(" for future enhancements of this plugin."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf (_("Usage"));
+ printf (" %s -F <log_file> -a <AVG | MAX> -w <warning_pair>\n",progname);
+ printf ("-c <critical_pair> [-e expire_minutes]\n");
+}
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
new file mode 100644
index 0000000..7d85554
--- /dev/null
+++ b/plugins/check_mysql.c
@@ -0,0 +1,612 @@
+/*****************************************************************************
+*
+* Monitoring check_mysql plugin
+*
+* License: GPL
+* Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)
+* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net)
+* Copyright (c) 1999-2011 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_mysql plugin
+*
+* This program tests connections to a mysql server
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_mysql";
+const char *copyright = "1999-2011";
+const char *email = "devel@monitoring-plugins.org";
+
+#define SLAVERESULTSIZE 96
+
+#include "common.h"
+#include "utils.h"
+#include "utils_base.h"
+#include "netutils.h"
+
+#include <mysql.h>
+#include <mysqld_error.h>
+#include <errmsg.h>
+
+char *db_user = NULL;
+char *db_host = NULL;
+char *db_socket = NULL;
+char *db_pass = NULL;
+char *db = NULL;
+char *ca_cert = NULL;
+char *ca_dir = NULL;
+char *cert = NULL;
+char *key = NULL;
+char *ciphers = NULL;
+bool ssl = false;
+char *opt_file = NULL;
+char *opt_group = NULL;
+unsigned int db_port = MYSQL_PORT;
+int check_slave = 0, warn_sec = 0, crit_sec = 0;
+int ignore_auth = 0;
+int verbose = 0;
+
+static double warning_time = 0;
+static double critical_time = 0;
+
+#define LENGTH_METRIC_UNIT 6
+static const char *metric_unit[LENGTH_METRIC_UNIT] = {
+ "Open_files",
+ "Open_tables",
+ "Qcache_free_memory",
+ "Qcache_queries_in_cache",
+ "Threads_connected",
+ "Threads_running"
+};
+
+#define LENGTH_METRIC_COUNTER 9
+static const char *metric_counter[LENGTH_METRIC_COUNTER] = {
+ "Connections",
+ "Qcache_hits",
+ "Qcache_inserts",
+ "Qcache_lowmem_prunes",
+ "Qcache_not_cached",
+ "Queries",
+ "Questions",
+ "Table_locks_waited",
+ "Uptime"
+};
+
+#define MYSQLDUMP_THREADS_QUERY "SELECT COUNT(1) mysqldumpThreads FROM information_schema.processlist WHERE info LIKE 'SELECT /*!40001 SQL_NO_CACHE */%'"
+
+thresholds *my_threshold = NULL;
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+int
+main (int argc, char **argv)
+{
+
+ MYSQL mysql;
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+
+ /* should be status */
+
+ char *result = NULL;
+ char *error = NULL;
+ char slaveresult[SLAVERESULTSIZE] = { 0 };
+ char* perf;
+
+ perf = strdup ("");
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize mysql */
+ mysql_init (&mysql);
+
+ if (opt_file != NULL)
+ mysql_options(&mysql,MYSQL_READ_DEFAULT_FILE,opt_file);
+
+ if (opt_group != NULL)
+ mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,opt_group);
+ else
+ mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"client");
+
+ if (ssl)
+ mysql_ssl_set(&mysql,key,cert,ca_cert,ca_dir,ciphers);
+ /* establish a connection to the server and error checking */
+ if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) {
+ /* Depending on internally-selected auth plugin MySQL might return */
+ /* ER_ACCESS_DENIED_NO_PASSWORD_ERROR or ER_ACCESS_DENIED_ERROR. */
+ /* Semantically these errors are the same. */
+ if (ignore_auth && (mysql_errno (&mysql) == ER_ACCESS_DENIED_ERROR || mysql_errno (&mysql) == ER_ACCESS_DENIED_NO_PASSWORD_ERROR))
+ {
+ printf("MySQL OK - Version: %s (protocol %d)\n",
+ mysql_get_server_info(&mysql),
+ mysql_get_proto_info(&mysql)
+ );
+ mysql_close (&mysql);
+ return STATE_OK;
+ }
+ else if (mysql_errno (&mysql) == CR_UNKNOWN_HOST)
+ die (STATE_WARNING, "%s\n", mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_VERSION_ERROR)
+ die (STATE_WARNING, "%s\n", mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_OUT_OF_MEMORY)
+ die (STATE_WARNING, "%s\n", mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_IPSOCK_ERROR)
+ die (STATE_WARNING, "%s\n", mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_SOCKET_CREATE_ERROR)
+ die (STATE_WARNING, "%s\n", mysql_error (&mysql));
+ else
+ die (STATE_CRITICAL, "%s\n", mysql_error (&mysql));
+ }
+
+ /* get the server stats */
+ result = strdup (mysql_stat (&mysql));
+
+ /* error checking once more */
+ if (mysql_error (&mysql)) {
+ if (mysql_errno (&mysql) == CR_SERVER_GONE_ERROR)
+ die (STATE_CRITICAL, "%s\n", mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_SERVER_LOST)
+ die (STATE_CRITICAL, "%s\n", mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_UNKNOWN_ERROR)
+ die (STATE_CRITICAL, "%s\n", mysql_error (&mysql));
+ }
+
+ /* try to fetch some perf data */
+ if (mysql_query (&mysql, "show global status") == 0) {
+ if ( (res = mysql_store_result (&mysql)) == NULL) {
+ error = strdup(mysql_error(&mysql));
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, _("status store_result error: %s\n"), error);
+ }
+
+ while ( (row = mysql_fetch_row (res)) != NULL) {
+ int i;
+
+ for(i = 0; i < LENGTH_METRIC_UNIT; i++) {
+ if (strcmp(row[0], metric_unit[i]) == 0) {
+ xasprintf(&perf, "%s%s ", perf, perfdata(metric_unit[i],
+ atol(row[1]), "", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0));
+ continue;
+ }
+ }
+ for(i = 0; i < LENGTH_METRIC_COUNTER; i++) {
+ if (strcmp(row[0], metric_counter[i]) == 0) {
+ xasprintf(&perf, "%s%s ", perf, perfdata(metric_counter[i],
+ atol(row[1]), "c", FALSE, 0, FALSE, 0, FALSE, 0, FALSE, 0));
+ continue;
+ }
+ }
+ }
+ /* remove trailing space */
+ if (strlen(perf) > 0)
+ perf[strlen(perf) - 1] = '\0';
+ }
+
+ if(check_slave) {
+ /* check the slave status */
+ if (mysql_query (&mysql, "show slave status") != 0) {
+ error = strdup(mysql_error(&mysql));
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, _("slave query error: %s\n"), error);
+ }
+
+ /* store the result */
+ if ( (res = mysql_store_result (&mysql)) == NULL) {
+ error = strdup(mysql_error(&mysql));
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, _("slave store_result error: %s\n"), error);
+ }
+
+ /* Check there is some data */
+ if (mysql_num_rows(res) == 0) {
+ mysql_close(&mysql);
+ die (STATE_WARNING, "%s\n", _("No slaves defined"));
+ }
+
+ /* fetch the first row */
+ if ( (row = mysql_fetch_row (res)) == NULL) {
+ error = strdup(mysql_error(&mysql));
+ mysql_free_result (res);
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, _("slave fetch row error: %s\n"), error);
+ }
+
+ if (mysql_field_count (&mysql) == 12) {
+ /* mysql 3.23.x */
+ snprintf (slaveresult, SLAVERESULTSIZE, _("Slave running: %s"), row[6]);
+ if (strcmp (row[6], "Yes") != 0) {
+ mysql_free_result (res);
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, "%s\n", slaveresult);
+ }
+
+ } else {
+ /* mysql 4.x.x and mysql 5.x.x */
+ int slave_io_field = -1 , slave_sql_field = -1, seconds_behind_field = -1, i, num_fields;
+ MYSQL_FIELD* fields;
+
+ num_fields = mysql_num_fields(res);
+ fields = mysql_fetch_fields(res);
+ for(i = 0; i < num_fields; i++) {
+ if (strcmp(fields[i].name, "Slave_IO_Running") == 0) {
+ slave_io_field = i;
+ continue;
+ }
+ if (strcmp(fields[i].name, "Slave_SQL_Running") == 0) {
+ slave_sql_field = i;
+ continue;
+ }
+ if (strcmp(fields[i].name, "Seconds_Behind_Master") == 0) {
+ seconds_behind_field = i;
+ continue;
+ }
+ }
+
+ /* Check if slave status is available */
+ if ((slave_io_field < 0) || (slave_sql_field < 0) || (num_fields == 0)) {
+ mysql_free_result (res);
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, "Slave status unavailable\n");
+ }
+
+ /* Save slave status in slaveresult */
+ snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s Seconds Behind Master: %s", row[slave_io_field], row[slave_sql_field], seconds_behind_field!=-1?row[seconds_behind_field]:"Unknown");
+
+ /* Raise critical error if SQL THREAD or IO THREAD are stopped, but only if there are no mysqldump threads running */
+ if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp (row[slave_sql_field], "Yes") != 0) {
+ MYSQL_RES *res_mysqldump;
+ MYSQL_ROW row_mysqldump;
+ unsigned int mysqldump_threads = 0;
+
+ if (mysql_query (&mysql, MYSQLDUMP_THREADS_QUERY) == 0) {
+ /* store the result */
+ if ( (res_mysqldump = mysql_store_result (&mysql)) != NULL) {
+ if (mysql_num_rows(res_mysqldump) == 1) {
+ if ( (row_mysqldump = mysql_fetch_row (res_mysqldump)) != NULL) {
+ mysqldump_threads = atoi(row_mysqldump[0]);
+ }
+ }
+ /* free the result */
+ mysql_free_result (res_mysqldump);
+ }
+ mysql_close (&mysql);
+ }
+ if (mysqldump_threads == 0) {
+ die (STATE_CRITICAL, "%s\n", slaveresult);
+ } else {
+ strncat(slaveresult, " Mysqldump: in progress", SLAVERESULTSIZE-1);
+ }
+ }
+
+ if (verbose >=3) {
+ if (seconds_behind_field == -1) {
+ printf("seconds_behind_field not found\n");
+ } else {
+ printf ("seconds_behind_field(index %d)=%s\n", seconds_behind_field, row[seconds_behind_field]);
+ }
+ }
+
+ /* Check Seconds Behind against threshold */
+ if ((seconds_behind_field != -1) && (row[seconds_behind_field] != NULL && strcmp (row[seconds_behind_field], "NULL") != 0)) {
+ double value = atof(row[seconds_behind_field]);
+ int status;
+
+ status = get_status(value, my_threshold);
+
+ xasprintf (&perf, "%s %s", perf, fperfdata ("seconds behind master", value, "s",
+ TRUE, (double) warning_time,
+ TRUE, (double) critical_time,
+ FALSE, 0,
+ FALSE, 0));
+
+ if (status == STATE_WARNING) {
+ printf("SLOW_SLAVE %s: %s|%s\n", _("WARNING"), slaveresult, perf);
+ exit(STATE_WARNING);
+ } else if (status == STATE_CRITICAL) {
+ printf("SLOW_SLAVE %s: %s|%s\n", _("CRITICAL"), slaveresult, perf);
+ exit(STATE_CRITICAL);
+ }
+ }
+ }
+
+ /* free the result */
+ mysql_free_result (res);
+ }
+
+ /* close the connection */
+ mysql_close (&mysql);
+
+ /* print out the result of stats */
+ if (check_slave) {
+ printf ("%s %s|%s\n", result, slaveresult, perf);
+ } else {
+ printf ("%s|%s\n", result, perf);
+ }
+
+ return STATE_OK;
+}
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ char *warning = NULL;
+ char *critical = NULL;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"socket", required_argument, 0, 's'},
+ {"database", required_argument, 0, 'd'},
+ {"username", required_argument, 0, 'u'},
+ {"password", required_argument, 0, 'p'},
+ {"file", required_argument, 0, 'f'},
+ {"group", required_argument, 0, 'g'},
+ {"port", required_argument, 0, 'P'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"check-slave", no_argument, 0, 'S'},
+ {"ignore-auth", no_argument, 0, 'n'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"ssl", no_argument, 0, 'l'},
+ {"ca-cert", optional_argument, 0, 'C'},
+ {"key", required_argument,0,'k'},
+ {"cert", required_argument,0,'a'},
+ {"ca-dir", required_argument, 0, 'D'},
+ {"ciphers", required_argument, 0, 'L'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 1)
+ return ERROR;
+
+ while (1) {
+ c = getopt_long (argc, argv, "hlvVnSP:p:u:d:H:s:c:w:a:k:C:D:L:f:g:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'H': /* hostname */
+ if (is_host (optarg)) {
+ db_host = optarg;
+ }
+ else if (*optarg == '/') {
+ db_socket = optarg;
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ break;
+ case 's': /* socket */
+ db_socket = optarg;
+ break;
+ case 'd': /* database */
+ db = optarg;
+ break;
+ case 'l':
+ ssl = true;
+ break;
+ case 'C':
+ ca_cert = optarg;
+ break;
+ case 'a':
+ cert = optarg;
+ break;
+ case 'k':
+ key = optarg;
+ break;
+ case 'D':
+ ca_dir = optarg;
+ break;
+ case 'L':
+ ciphers = optarg;
+ break;
+ case 'u': /* username */
+ db_user = optarg;
+ break;
+ case 'p': /* authentication information: password */
+ db_pass = strdup(optarg);
+
+ /* Delete the password from process list */
+ while (*optarg != '\0') {
+ *optarg = 'X';
+ optarg++;
+ }
+ break;
+ case 'f': /* client options file */
+ opt_file = optarg;
+ break;
+ case 'g': /* client options group */
+ opt_group = optarg;
+ break;
+ case 'P': /* critical time threshold */
+ db_port = atoi (optarg);
+ break;
+ case 'S':
+ check_slave = 1; /* check-slave */
+ break;
+ case 'n':
+ ignore_auth = 1; /* ignore-auth */
+ break;
+ case 'w':
+ warning = optarg;
+ warning_time = strtod (warning, NULL);
+ break;
+ case 'c':
+ critical = optarg;
+ critical_time = strtod (critical, NULL);
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'v':
+ verbose++;
+ break;
+ case '?': /* help */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+
+ set_thresholds(&my_threshold, warning, critical);
+
+ while ( argc > c ) {
+
+ if (db_host == NULL)
+ if (is_host (argv[c])) {
+ db_host = argv[c++];
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), argv[c]);
+ }
+ else if (db_user == NULL)
+ db_user = argv[c++];
+ else if (db_pass == NULL)
+ db_pass = argv[c++];
+ else if (db == NULL)
+ db = argv[c++];
+ else if (is_intnonneg (argv[c]))
+ db_port = atoi (argv[c++]);
+ else
+ break;
+ }
+
+ return validate_arguments ();
+}
+
+
+int
+validate_arguments (void)
+{
+ if (db_user == NULL)
+ db_user = strdup("");
+
+ if (db_host == NULL)
+ db_host = strdup("");
+
+ if (db == NULL)
+ db = strdup("");
+
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", MYSQL_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf (_(COPYRIGHT), copyright, email);
+
+ printf ("%s\n", _("This program tests connections to a MySQL server"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'P', myport);
+ printf (" %s\n", "-n, --ignore-auth");
+ printf (" %s\n", _("Ignore authentication failure and check for mysql connectivity only"));
+
+ printf (" %s\n", "-s, --socket=STRING");
+ printf (" %s\n", _("Use the specified socket (has no effect if -H is used)"));
+
+ printf (" %s\n", "-d, --database=STRING");
+ printf (" %s\n", _("Check database with indicated name"));
+ printf (" %s\n", "-f, --file=STRING");
+ printf (" %s\n", _("Read from the specified client options file"));
+ printf (" %s\n", "-g, --group=STRING");
+ printf (" %s\n", _("Use a client options group"));
+ printf (" %s\n", "-u, --username=STRING");
+ printf (" %s\n", _("Connect using the indicated username"));
+ printf (" %s\n", "-p, --password=STRING");
+ printf (" %s\n", _("Use the indicated password to authenticate the connection"));
+ printf (" ==> %s <==\n", _("IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"));
+ printf (" %s\n", _("Your clear-text password could be visible as a process table entry"));
+ printf (" %s\n", "-S, --check-slave");
+ printf (" %s\n", _("Check if the slave thread is running properly."));
+ printf (" %s\n", "-w, --warning");
+ printf (" %s\n", _("Exit with WARNING status if slave server is more than INTEGER seconds"));
+ printf (" %s\n", _("behind master"));
+ printf (" %s\n", "-c, --critical");
+ printf (" %s\n", _("Exit with CRITICAL status if slave server is more then INTEGER seconds"));
+ printf (" %s\n", _("behind master"));
+ printf (" %s\n", "-l, --ssl");
+ printf (" %s\n", _("Use ssl encryption"));
+ printf (" %s\n", "-C, --ca-cert=STRING");
+ printf (" %s\n", _("Path to CA signing the cert"));
+ printf (" %s\n", "-a, --cert=STRING");
+ printf (" %s\n", _("Path to SSL certificate"));
+ printf (" %s\n", "-k, --key=STRING");
+ printf (" %s\n", _("Path to private SSL key"));
+ printf (" %s\n", "-D, --ca-dir=STRING");
+ printf (" %s\n", _("Path to CA directory"));
+ printf (" %s\n", "-L, --ciphers=STRING");
+ printf (" %s\n", _("List of valid SSL ciphers"));
+
+
+ printf ("\n");
+ printf (" %s\n", _("There are no required arguments. By default, the local database is checked"));
+ printf (" %s\n", _("using the default unix socket. You can force TCP on localhost by using an"));
+ printf (" %s\n", _("IP address or FQDN ('localhost' will use the socket as well)."));
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("You must specify -p with an empty string to force an empty password,"));
+ printf (" %s\n", _("overriding any my.cnf settings."));
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s [-d database] [-H host] [-P port] [-s socket]\n",progname);
+ printf (" [-u user] [-p password] [-S] [-l] [-a cert] [-k key]\n");
+ printf (" [-C ca-cert] [-D ca-dir] [-L ciphers] [-f optfile] [-g group]\n");
+}
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
new file mode 100644
index 0000000..ac2fb15
--- /dev/null
+++ b/plugins/check_mysql_query.c
@@ -0,0 +1,354 @@
+/*****************************************************************************
+*
+* Monitoring check_mysql_query plugin
+*
+* License: GPL
+* Copyright (c) 2006-2009 Monitoring Plugins Development Team
+* Original code from check_mysql, copyright 1999 Didi Rieder
+*
+* Description:
+*
+* This file contains the check_mysql_query plugin
+*
+* This plugin is for running arbitrary SQL and checking the results
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_mysql_query";
+const char *copyright = "1999-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "utils_base.h"
+#include "netutils.h"
+
+#include <mysql.h>
+#include <errmsg.h>
+
+char *db_user = NULL;
+char *db_host = NULL;
+char *db_socket = NULL;
+char *db_pass = NULL;
+char *db = NULL;
+char *opt_file = NULL;
+char *opt_group = NULL;
+unsigned int db_port = MYSQL_PORT;
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+char *sql_query = NULL;
+int verbose = 0;
+thresholds *my_thresholds = NULL;
+
+
+int
+main (int argc, char **argv)
+{
+
+ MYSQL mysql;
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+
+ double value;
+ char *error = NULL;
+ int status;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize mysql */
+ mysql_init (&mysql);
+
+ if (opt_file != NULL)
+ mysql_options(&mysql,MYSQL_READ_DEFAULT_FILE,opt_file);
+
+ if (opt_group != NULL)
+ mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,opt_group);
+ else
+ mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"client");
+
+ /* establish a connection to the server and error checking */
+ if (!mysql_real_connect(&mysql,db_host,db_user,db_pass,db,db_port,db_socket,0)) {
+ if (mysql_errno (&mysql) == CR_UNKNOWN_HOST)
+ die (STATE_WARNING, "QUERY %s: %s\n", _("WARNING"), mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_VERSION_ERROR)
+ die (STATE_WARNING, "QUERY %s: %s\n", _("WARNING"), mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_OUT_OF_MEMORY)
+ die (STATE_WARNING, "QUERY %s: %s\n", _("WARNING"), mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_IPSOCK_ERROR)
+ die (STATE_WARNING, "QUERY %s: %s\n", _("WARNING"), mysql_error (&mysql));
+ else if (mysql_errno (&mysql) == CR_SOCKET_CREATE_ERROR)
+ die (STATE_WARNING, "QUERY %s: %s\n", _("WARNING"), mysql_error (&mysql));
+ else
+ die (STATE_CRITICAL, "QUERY %s: %s\n", _("CRITICAL"), mysql_error (&mysql));
+ }
+
+ if (mysql_query (&mysql, sql_query) != 0) {
+ error = strdup(mysql_error(&mysql));
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, "QUERY %s: %s - %s\n", _("CRITICAL"), _("Error with query"), error);
+ }
+
+ /* store the result */
+ if ( (res = mysql_store_result (&mysql)) == NULL) {
+ error = strdup(mysql_error(&mysql));
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, "QUERY %s: Error with store_result - %s\n", _("CRITICAL"), error);
+ }
+
+ /* Check there is some data */
+ if (mysql_num_rows(res) == 0) {
+ mysql_close(&mysql);
+ die (STATE_WARNING, "QUERY %s: %s\n", _("WARNING"), _("No rows returned"));
+ }
+
+ /* fetch the first row */
+ if ( (row = mysql_fetch_row (res)) == NULL) {
+ error = strdup(mysql_error(&mysql));
+ mysql_free_result (res);
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, "QUERY %s: Fetch row error - %s\n", _("CRITICAL"), error);
+ }
+
+ if (! is_numeric(row[0])) {
+ die (STATE_CRITICAL, "QUERY %s: %s - '%s'\n", _("CRITICAL"), _("Is not a numeric"), row[0]);
+ }
+
+ value = strtod(row[0], NULL);
+
+ /* free the result */
+ mysql_free_result (res);
+
+ /* close the connection */
+ mysql_close (&mysql);
+
+ if (verbose >= 3)
+ printf("mysql result: %f\n", value);
+
+ status = get_status(value, my_thresholds);
+
+ if (status == STATE_OK) {
+ printf("QUERY %s: ", _("OK"));
+ } else if (status == STATE_WARNING) {
+ printf("QUERY %s: ", _("WARNING"));
+ } else if (status == STATE_CRITICAL) {
+ printf("QUERY %s: ", _("CRITICAL"));
+ }
+ printf(_("'%s' returned %f | %s"), sql_query, value,
+ fperfdata("result", value, "",
+ my_thresholds->warning?TRUE:FALSE, my_thresholds->warning?my_thresholds->warning->end:0,
+ my_thresholds->critical?TRUE:FALSE, my_thresholds->critical?my_thresholds->critical->end:0,
+ FALSE, 0,
+ FALSE, 0)
+ );
+ printf("\n");
+
+ return status;
+}
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ char *warning = NULL;
+ char *critical = NULL;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"socket", required_argument, 0, 's'},
+ {"database", required_argument, 0, 'd'},
+ {"username", required_argument, 0, 'u'},
+ {"password", required_argument, 0, 'p'},
+ {"file", required_argument, 0, 'f'},
+ {"group", required_argument, 0, 'g'},
+ {"port", required_argument, 0, 'P'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"query", required_argument, 0, 'q'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 1)
+ return ERROR;
+
+ while (1) {
+ c = getopt_long (argc, argv, "hvVP:p:u:d:H:s:q:w:c:f:g:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'H': /* hostname */
+ if (is_host (optarg)) {
+ db_host = optarg;
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ break;
+ case 's': /* socket */
+ db_socket = optarg;
+ break;
+ case 'd': /* database */
+ db = optarg;
+ break;
+ case 'u': /* username */
+ db_user = optarg;
+ break;
+ case 'p': /* authentication information: password */
+ db_pass = strdup(optarg);
+
+ /* Delete the password from process list */
+ while (*optarg != '\0') {
+ *optarg = 'X';
+ optarg++;
+ }
+ break;
+ case 'f': /* client options file */
+ opt_file = optarg;
+ break;
+ case 'g': /* client options group */
+ opt_group = optarg;
+ break;
+ case 'P': /* critical time threshold */
+ db_port = atoi (optarg);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'q':
+ xasprintf(&sql_query, "%s", optarg);
+ break;
+ case 'w':
+ warning = optarg;
+ break;
+ case 'c':
+ critical = optarg;
+ break;
+ case '?': /* help */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+
+ set_thresholds(&my_thresholds, warning, critical);
+
+ return validate_arguments ();
+}
+
+
+int
+validate_arguments (void)
+{
+ if (sql_query == NULL)
+ usage("Must specify a SQL query to run");
+
+ if (db_user == NULL)
+ db_user = strdup("");
+
+ if (db_host == NULL)
+ db_host = strdup("");
+
+ if (db == NULL)
+ db = strdup("");
+
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", MYSQL_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf (_(COPYRIGHT), copyright, email);
+
+ printf ("%s\n", _("This program checks a query result against threshold levels"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+ printf (" -q, --query=STRING\n");
+ printf (" %s\n", _("SQL query to run. Only first column in first row will be read"));
+ printf (UT_WARN_CRIT_RANGE);
+ printf (UT_HOST_PORT, 'P', myport);
+ printf (" %s\n", "-s, --socket=STRING");
+ printf (" %s\n", _("Use the specified socket (has no effect if -H is used)"));
+ printf (" -d, --database=STRING\n");
+ printf (" %s\n", _("Database to check"));
+ printf (" %s\n", "-f, --file=STRING");
+ printf (" %s\n", _("Read from the specified client options file"));
+ printf (" %s\n", "-g, --group=STRING");
+ printf (" %s\n", _("Use a client options group"));
+ printf (" -u, --username=STRING\n");
+ printf (" %s\n", _("Username to login with"));
+ printf (" -p, --password=STRING\n");
+ printf (" %s\n", _("Password to login with"));
+ printf (" ==> %s <==\n", _("IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"));
+ printf (" %s\n", _("Your clear-text password could be visible as a process table entry"));
+
+ printf ("\n");
+ printf (" %s\n", _("A query is required. The result from the query should be numeric."));
+ printf (" %s\n", _("For extra security, create a user with minimal access."));
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("You must specify -p with an empty string to force an empty password,"));
+ printf (" %s\n", _("overriding any my.cnf settings."));
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s -q SQL_query [-w warn] [-c crit] [-H host] [-P port] [-s socket]\n",progname);
+ printf (" [-d database] [-u user] [-p password] [-f optfile] [-g group]\n");
+}
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
new file mode 100644
index 0000000..40d68f0
--- /dev/null
+++ b/plugins/check_nagios.c
@@ -0,0 +1,325 @@
+/*****************************************************************************
+*
+* Monitoring check_nagios plugin
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_nagios plugin
+*
+* This plugin checks the status of the Nagios process on the local machine.
+* The plugin will check to make sure the Nagios status log is no older than
+* the number of minutes specified by the expires option.
+* It also checks the process table for a process matching the command
+* argument.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_nagios";
+const char *copyright = "1999-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "runcmd.h"
+#include "utils.h"
+
+int process_arguments (int, char **);
+void print_help (void);
+void print_usage (void);
+
+char *status_log = NULL;
+char *process_string = NULL;
+int expire_minutes = 0;
+
+int verbose = 0;
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+ char input_buffer[MAX_INPUT_BUFFER];
+ unsigned long latest_entry_time = 0L;
+ unsigned long temp_entry_time = 0L;
+ int proc_entries = 0;
+ time_t current_time;
+ char *temp_ptr;
+ FILE *fp;
+ int procuid = 0;
+ int procpid = 0;
+ int procppid = 0;
+ int procvsz = 0;
+ int procrss = 0;
+ float procpcpu = 0;
+ char procstat[8];
+#ifdef PS_USES_PROCETIME
+ char procetime[MAX_INPUT_BUFFER];
+#endif /* PS_USES_PROCETIME */
+ char procprog[MAX_INPUT_BUFFER];
+ char *procargs;
+ int pos, cols;
+ int expected_cols = PS_COLS - 1;
+ const char *zombie = "Z";
+ char *temp_string;
+ output chld_out, chld_err;
+ size_t i;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage_va(_("Could not parse arguments"));
+
+ /* Set signal handling and alarm timeout */
+ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
+ usage_va(_("Cannot catch SIGALRM"));
+ }
+
+ /* handle timeouts gracefully... */
+ alarm (timeout_interval);
+
+ /* open the status log */
+ fp = fopen (status_log, "r");
+ if (fp == NULL) {
+ die (STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), _("Cannot open status log for reading!"));
+ }
+
+ /* get the date/time of the last item updated in the log */
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) {
+ if ((temp_ptr = strstr (input_buffer, "created=")) != NULL) {
+ temp_entry_time = strtoul (temp_ptr + 8, NULL, 10);
+ latest_entry_time = temp_entry_time;
+ break;
+ } else if ((temp_ptr = strtok (input_buffer, "]")) != NULL) {
+ temp_entry_time = strtoul (temp_ptr + 1, NULL, 10);
+ if (temp_entry_time > latest_entry_time)
+ latest_entry_time = temp_entry_time;
+ }
+ }
+ fclose (fp);
+
+ if (verbose >= 2)
+ printf("command: %s\n", PS_COMMAND);
+
+ /* run the command to check for the Nagios process.. */
+ if((result = np_runcmd(PS_COMMAND, &chld_out, &chld_err, 0)) != 0)
+ result = STATE_WARNING;
+
+ /* count the number of matching Nagios processes... */
+ for(i = 0; i < chld_out.lines; i++) {
+ cols = sscanf (chld_out.line[i], PS_FORMAT, PS_VARLIST);
+ /* Zombie processes do not give a procprog command */
+ if ( cols == (expected_cols - 1) && strstr(procstat, zombie) ) {
+ cols = expected_cols;
+ /* Set some value for procargs for the strip command further below
+ * Seen to be a problem on some Solaris 7 and 8 systems */
+ chld_out.line[i][pos] = '\n';
+ chld_out.line[i][pos+1] = 0x0;
+ }
+ if ( cols >= expected_cols ) {
+ xasprintf (&procargs, "%s", chld_out.line[i] + pos);
+ strip (procargs);
+
+ /* Some ps return full pathname for command. This removes path */
+ temp_string = strtok ((char *)procprog, "/");
+ while (temp_string) {
+ strcpy(procprog, temp_string);
+ temp_string = strtok (NULL, "/");
+ }
+
+ /* May get empty procargs */
+ if (!strstr(procargs, argv[0]) && strstr(procargs, process_string) && strcmp(procargs,"")) {
+ proc_entries++;
+ if (verbose >= 2) {
+ printf (_("Found process: %s %s\n"), procprog, procargs);
+ }
+ }
+ }
+ }
+
+ /* If we get anything on stderr, at least set warning */
+ if(chld_err.buflen)
+ result = max_state (result, STATE_WARNING);
+
+ /* reset the alarm handler */
+ alarm (0);
+
+ if (proc_entries == 0) {
+ die (STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), _("Could not locate a running Nagios process!"));
+ }
+
+ if (latest_entry_time == 0L) {
+ die (STATE_CRITICAL, "NAGIOS %s: %s\n", _("CRITICAL"), _("Cannot parse Nagios log file for valid time"));
+ }
+
+ time (&current_time);
+ if ((int)(current_time - latest_entry_time) > (expire_minutes * 60)) {
+ result = STATE_WARNING;
+ } else {
+ result = STATE_OK;
+ }
+
+ printf ("NAGIOS %s: ", (result == STATE_OK) ? _("OK") : _("WARNING"));
+ printf (ngettext ("%d process", "%d processes", proc_entries), proc_entries);
+ printf (", ");
+ printf (
+ ngettext ("status log updated %d second ago",
+ "status log updated %d seconds ago",
+ (int) (current_time - latest_entry_time) ),
+ (int) (current_time - latest_entry_time) );
+ printf ("\n");
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"filename", required_argument, 0, 'F'},
+ {"expires", required_argument, 0, 'e'},
+ {"command", required_argument, 0, 'C'},
+ {"timeout", optional_argument, 0, 't'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"verbose", no_argument, 0, 'v'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ if (!is_option (argv[1])) {
+ status_log = argv[1];
+ if (is_intnonneg (argv[2]))
+ expire_minutes = atoi (argv[2]);
+ else
+ die (STATE_UNKNOWN,
+ _("Expiration time must be an integer (seconds)\n"));
+ process_string = argv[3];
+ return OK;
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVvF:C:e:t:", longopts, &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'F': /* status log */
+ status_log = optarg;
+ break;
+ case 'C': /* command */
+ process_string = optarg;
+ break;
+ case 'e': /* expiry time */
+ if (is_intnonneg (optarg))
+ expire_minutes = atoi (optarg);
+ else
+ die (STATE_UNKNOWN,
+ _("Expiration time must be an integer (seconds)\n"));
+ break;
+ case 't': /* timeout */
+ if (is_intnonneg (optarg))
+ timeout_interval = atoi (optarg);
+ else
+ die (STATE_UNKNOWN,
+ _("Timeout must be an integer (seconds)\n"));
+ break;
+ case 'v':
+ verbose++;
+ break;
+ default: /* print short usage_va statement if args not parsable */
+ usage5();
+ }
+ }
+
+
+ if (status_log == NULL)
+ die (STATE_UNKNOWN, _("You must provide the status_log\n"));
+
+ if (process_string == NULL)
+ die (STATE_UNKNOWN, _("You must provide a process string\n"));
+
+ return OK;
+}
+
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf (_(COPYRIGHT), copyright, email);
+
+ printf ("%s\n", _("This plugin checks the status of the Nagios process on the local machine"));
+ printf ("%s\n", _("The plugin will check to make sure the Nagios status log is no older than"));
+ printf ("%s\n", _("the number of minutes specified by the expires option."));
+ printf ("%s\n", _("It also checks the process table for a process matching the command argument."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-F, --filename=FILE");
+ printf (" %s\n", _("Name of the log file to check"));
+ printf (" %s\n", "-e, --expires=INTEGER");
+ printf (" %s\n", _("Minutes aging after which logfile is considered stale"));
+ printf (" %s\n", "-C, --command=STRING");
+ printf (" %s\n", _("Substring to search for in process arguments"));
+ printf (" %s\n", "-t, --timeout=INTEGER");
+ printf (" %s\n", _("Timeout for the plugin in seconds"));
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "check_nagios -t 20 -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios");
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -F <status log file> -t <timeout_seconds> -e <expire_minutes> -C <process_string>\n", progname);
+}
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
new file mode 100644
index 0000000..d73d83c
--- /dev/null
+++ b/plugins/check_nt.c
@@ -0,0 +1,801 @@
+/*****************************************************************************
+*
+* Monitoring check_nt plugin
+*
+* License: GPL
+* Copyright (c) 2000-2002 Yves Rubin (rubiyz@yahoo.com)
+* Copyright (c) 2003-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_nt plugin
+*
+* This plugin collects data from the NSClient service running on a
+* Windows NT/2000/XP/2003 server.
+* This plugin requires NSClient software to run on NT
+* (http://nsclient.ready2run.nl/)
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_nt";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+enum checkvars {
+ CHECK_NONE,
+ CHECK_CLIENTVERSION,
+ CHECK_CPULOAD,
+ CHECK_UPTIME,
+ CHECK_USEDDISKSPACE,
+ CHECK_SERVICESTATE,
+ CHECK_PROCSTATE,
+ CHECK_MEMUSE,
+ CHECK_COUNTER,
+ CHECK_FILEAGE,
+ CHECK_INSTANCES
+};
+
+enum {
+ MAX_VALUE_LIST = 30,
+ PORT = 1248
+};
+
+char *server_address=NULL;
+char *volume_name=NULL;
+int server_port=PORT;
+char *value_list=NULL;
+char *req_password=NULL;
+unsigned long lvalue_list[MAX_VALUE_LIST];
+unsigned long warning_value=0L;
+unsigned long critical_value=0L;
+int check_warning_value=FALSE;
+int check_critical_value=FALSE;
+enum checkvars vars_to_check = CHECK_NONE;
+int show_all=FALSE;
+
+char recv_buffer[MAX_INPUT_BUFFER];
+
+void fetch_data (const char* address, int port, const char* sendb);
+int process_arguments(int, char **);
+void preparelist(char *string);
+int strtoularray(unsigned long *array, char *string, const char *delim);
+void print_help(void);
+void print_usage(void);
+
+int main(int argc, char **argv){
+
+/* should be int result = STATE_UNKNOWN; */
+
+ int return_code = STATE_UNKNOWN;
+ char *send_buffer=NULL;
+ char *output_message=NULL;
+ char *perfdata=NULL;
+ char *temp_string=NULL;
+ char *temp_string_perf=NULL;
+ char *description=NULL,*counter_unit = NULL;
+ char *minval = NULL, *maxval = NULL, *errcvt = NULL;
+ char *fds=NULL, *tds=NULL;
+ char *numstr;
+
+ double total_disk_space=0;
+ double free_disk_space=0;
+ double percent_used_space=0;
+ double warning_used_space=0;
+ double critical_used_space=0;
+ double mem_commitLimit=0;
+ double mem_commitByte=0;
+ double fminval = 0, fmaxval = 0;
+ unsigned long utilization;
+ unsigned long uptime;
+ unsigned long age_in_minutes;
+ double counter_value = 0.0;
+ int offset=0;
+ int updays=0;
+ int uphours=0;
+ int upminutes=0;
+
+ int isPercent = FALSE;
+ int allRight = FALSE;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if(process_arguments(argc,argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize alarm signal handling */
+ signal(SIGALRM,socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm(socket_timeout);
+
+ switch (vars_to_check) {
+
+ case CHECK_CLIENTVERSION:
+
+ xasprintf(&send_buffer, "%s&1", req_password);
+ fetch_data (server_address, server_port, send_buffer);
+ if (value_list != NULL && strcmp(recv_buffer, value_list) != 0) {
+ xasprintf (&output_message, _("Wrong client version - running: %s, required: %s"), recv_buffer, value_list);
+ return_code = STATE_WARNING;
+ } else {
+ xasprintf (&output_message, "%s", recv_buffer);
+ return_code = STATE_OK;
+ }
+ break;
+
+ case CHECK_CPULOAD:
+
+ if (value_list==NULL)
+ output_message = strdup (_("missing -l parameters"));
+ else if (strtoularray(lvalue_list,value_list,",")==FALSE)
+ output_message = strdup (_("wrong -l parameter."));
+ else {
+ /* -l parameters is present with only integers */
+ return_code=STATE_OK;
+ temp_string = strdup (_("CPU Load"));
+ temp_string_perf = strdup (" ");
+
+ /* loop until one of the parameters is wrong or not present */
+ while (lvalue_list[0+offset]> (unsigned long)0 &&
+ lvalue_list[0+offset]<=(unsigned long)17280 &&
+ lvalue_list[1+offset]> (unsigned long)0 &&
+ lvalue_list[1+offset]<=(unsigned long)100 &&
+ lvalue_list[2+offset]> (unsigned long)0 &&
+ lvalue_list[2+offset]<=(unsigned long)100) {
+
+ /* Send request and retrieve data */
+ xasprintf(&send_buffer,"%s&2&%lu",req_password,lvalue_list[0+offset]);
+ fetch_data (server_address, server_port, send_buffer);
+
+ utilization=strtoul(recv_buffer,NULL,10);
+
+ /* Check if any of the request is in a warning or critical state */
+ if(utilization >= lvalue_list[2+offset])
+ return_code=STATE_CRITICAL;
+ else if(utilization >= lvalue_list[1+offset] && return_code<STATE_WARNING)
+ return_code=STATE_WARNING;
+
+ xasprintf(&output_message,_(" %lu%% (%lu min average)"), utilization, lvalue_list[0+offset]);
+ xasprintf(&temp_string,"%s%s",temp_string,output_message);
+ xasprintf(&perfdata,_(" '%lu min avg Load'=%lu%%;%lu;%lu;0;100"), lvalue_list[0+offset], utilization,
+ lvalue_list[1+offset], lvalue_list[2+offset]);
+ xasprintf(&temp_string_perf,"%s%s",temp_string_perf,perfdata);
+ offset+=3; /* move across the array */
+ }
+
+ if (strlen(temp_string)>10) { /* we had at least one loop */
+ output_message = strdup (temp_string);
+ perfdata = temp_string_perf;
+ } else
+ output_message = strdup (_("not enough values for -l parameters"));
+ }
+ break;
+
+ case CHECK_UPTIME:
+
+ if (value_list == NULL) {
+ value_list = "minutes";
+ }
+ if (strncmp(value_list, "seconds", strlen("seconds") + 1 ) &&
+ strncmp(value_list, "minutes", strlen("minutes") + 1) &&
+ strncmp(value_list, "hours", strlen("hours") + 1) &&
+ strncmp(value_list, "days", strlen("days") + 1)) {
+
+ output_message = strdup (_("wrong -l argument"));
+ } else {
+ xasprintf(&send_buffer, "%s&3", req_password);
+ fetch_data (server_address, server_port, send_buffer);
+ uptime=strtoul(recv_buffer,NULL,10);
+ updays = uptime / 86400;
+ uphours = (uptime % 86400) / 3600;
+ upminutes = ((uptime % 86400) % 3600) / 60;
+
+ if (!strncmp(value_list, "minutes", strlen("minutes")))
+ uptime = uptime / 60;
+ else if (!strncmp(value_list, "hours", strlen("hours")))
+ uptime = uptime / 3600;
+ else if (!strncmp(value_list, "days", strlen("days")))
+ uptime = uptime / 86400;
+ /* else uptime in seconds, nothing to do */
+
+ xasprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"),updays, uphours, upminutes, uptime);
+
+ if (check_critical_value==TRUE && uptime <= critical_value)
+ return_code=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && uptime <= warning_value)
+ return_code=STATE_WARNING;
+ else
+ return_code=STATE_OK;
+ }
+ break;
+
+ case CHECK_USEDDISKSPACE:
+
+ if (value_list==NULL)
+ output_message = strdup (_("missing -l parameters"));
+ else if (strlen(value_list)!=1)
+ output_message = strdup (_("wrong -l argument"));
+ else {
+ xasprintf(&send_buffer,"%s&4&%s", req_password, value_list);
+ fetch_data (server_address, server_port, send_buffer);
+ fds=strtok(recv_buffer,"&");
+ tds=strtok(NULL,"&");
+ if(fds!=NULL)
+ free_disk_space=atof(fds);
+ if(tds!=NULL)
+ total_disk_space=atof(tds);
+
+ if (total_disk_space>0 && free_disk_space>=0) {
+ percent_used_space = ((total_disk_space - free_disk_space) / total_disk_space) * 100;
+ warning_used_space = ((float)warning_value / 100) * total_disk_space;
+ critical_used_space = ((float)critical_value / 100) * total_disk_space;
+
+ xasprintf(&temp_string,_("%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"),
+ value_list, total_disk_space / 1073741824, (total_disk_space - free_disk_space) / 1073741824,
+ percent_used_space, free_disk_space / 1073741824, (free_disk_space / total_disk_space)*100);
+ xasprintf(&temp_string_perf,_("'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"), value_list,
+ (total_disk_space - free_disk_space) / 1073741824, warning_used_space / 1073741824,
+ critical_used_space / 1073741824, total_disk_space / 1073741824);
+
+ if(check_critical_value==TRUE && percent_used_space >= critical_value)
+ return_code=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && percent_used_space >= warning_value)
+ return_code=STATE_WARNING;
+ else
+ return_code=STATE_OK;
+
+ output_message = strdup (temp_string);
+ perfdata = temp_string_perf;
+ } else {
+ output_message = strdup (_("Free disk space : Invalid drive"));
+ return_code=STATE_UNKNOWN;
+ }
+ }
+ break;
+
+ case CHECK_SERVICESTATE:
+ case CHECK_PROCSTATE:
+
+ if (value_list==NULL)
+ output_message = strdup (_("No service/process specified"));
+ else {
+ preparelist(value_list); /* replace , between services with & to send the request */
+ xasprintf(&send_buffer,"%s&%u&%s&%s", req_password,(vars_to_check==CHECK_SERVICESTATE)?5:6,
+ (show_all==TRUE) ? "ShowAll" : "ShowFail",value_list);
+ fetch_data (server_address, server_port, send_buffer);
+ numstr = strtok(recv_buffer,"&");
+ if (numstr == NULL)
+ die(STATE_UNKNOWN, _("could not fetch information from server\n"));
+ return_code=atoi(numstr);
+ temp_string=strtok(NULL,"&");
+ output_message = strdup (temp_string);
+ }
+ break;
+
+ case CHECK_MEMUSE:
+
+ xasprintf(&send_buffer,"%s&7", req_password);
+ fetch_data (server_address, server_port, send_buffer);
+ numstr = strtok(recv_buffer,"&");
+ if (numstr == NULL)
+ die(STATE_UNKNOWN, _("could not fetch information from server\n"));
+ mem_commitLimit=atof(numstr);
+ numstr = strtok(NULL,"&");
+ if (numstr == NULL)
+ die(STATE_UNKNOWN, _("could not fetch information from server\n"));
+ mem_commitByte=atof(numstr);
+ percent_used_space = (mem_commitByte / mem_commitLimit) * 100;
+ warning_used_space = ((float)warning_value / 100) * mem_commitLimit;
+ critical_used_space = ((float)critical_value / 100) * mem_commitLimit;
+
+ /* Divisor should be 1048567, not 3044515, as we are measuring "Commit Charge" here,
+ which equals RAM + Pagefiles. */
+ xasprintf(&output_message,_("Memory usage: total:%.2f MB - used: %.2f MB (%.0f%%) - free: %.2f MB (%.0f%%)"),
+ mem_commitLimit / 1048567, mem_commitByte / 1048567, percent_used_space,
+ (mem_commitLimit - mem_commitByte) / 1048567, (mem_commitLimit - mem_commitByte) / mem_commitLimit * 100);
+ xasprintf(&perfdata,_("'Memory usage'=%.2fMB;%.2f;%.2f;0.00;%.2f"), mem_commitByte / 1048567,
+ warning_used_space / 1048567, critical_used_space / 1048567, mem_commitLimit / 1048567);
+
+ return_code=STATE_OK;
+ if(check_critical_value==TRUE && percent_used_space >= critical_value)
+ return_code=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && percent_used_space >= warning_value)
+ return_code=STATE_WARNING;
+
+ break;
+
+ case CHECK_COUNTER:
+
+
+ /*
+ CHECK_COUNTER has been modified to provide extensive perfdata information.
+ In order to do this, some modifications have been done to the code
+ and some constraints have been introduced.
+
+ 1) For the sake of simplicity of the code, perfdata information will only be
+ provided when the "description" field is added.
+
+ 2) If the counter you're going to measure is percent-based, the code will detect
+ the percent sign in its name and will attribute minimum (0%) and maximum (100%)
+ values automagically, as well the "%" sign to graph units.
+
+ 3) OTOH, if the counter is "absolute", you'll have to provide the following
+ the counter unit - that is, the dimensions of the counter you're getting. Examples:
+ pages/s, packets transferred, etc.
+
+ 4) If you want, you may provide the minimum and maximum values to expect. They aren't mandatory,
+ but once specified they MUST have the same order of magnitude and units of -w and -c; otherwise.
+ strange things will happen when you make graphs of your data.
+ */
+
+ if (value_list == NULL)
+ output_message = strdup (_("No counter specified"));
+ else
+ {
+ preparelist (value_list); /* replace , between services with & to send the request */
+ isPercent = (strchr (value_list, '%') != NULL);
+
+ strtok (value_list, "&"); /* burn the first parameters */
+ description = strtok (NULL, "&");
+ counter_unit = strtok (NULL, "&");
+ xasprintf (&send_buffer, "%s&8&%s", req_password, value_list);
+ fetch_data (server_address, server_port, send_buffer);
+ counter_value = atof (recv_buffer);
+
+ if (description == NULL)
+ xasprintf (&output_message, "%.f", counter_value);
+ else if (isPercent)
+ {
+ counter_unit = strdup ("%");
+ allRight = TRUE;
+ }
+
+ if ((counter_unit != NULL) && (!allRight))
+ {
+ minval = strtok (NULL, "&");
+ maxval = strtok (NULL, "&");
+
+ /* All parameters specified. Let's check the numbers */
+
+ fminval = (minval != NULL) ? strtod (minval, &errcvt) : -1;
+ fmaxval = (minval != NULL) ? strtod (maxval, &errcvt) : -1;
+
+ if ((fminval == 0) && (minval == errcvt))
+ output_message = strdup (_("Minimum value contains non-numbers"));
+ else
+ {
+ if ((fmaxval == 0) && (maxval == errcvt))
+ output_message = strdup (_("Maximum value contains non-numbers"));
+ else
+ allRight = TRUE; /* Everything is OK. */
+
+ }
+ }
+ else if ((counter_unit == NULL) && (description != NULL))
+ output_message = strdup (_("No unit counter specified"));
+
+ if (allRight)
+ {
+ /* Let's format the output string, finally... */
+ if (strstr(description, "%") == NULL) {
+ xasprintf (&output_message, "%s = %.2f %s", description, counter_value, counter_unit);
+ } else {
+ /* has formatting, will segv if wrong */
+ xasprintf (&output_message, description, counter_value);
+ }
+ xasprintf (&output_message, "%s |", output_message);
+ xasprintf (&output_message,"%s %s", output_message,
+ fperfdata (description, counter_value,
+ counter_unit, 1, warning_value, 1, critical_value,
+ (!(isPercent) && (minval != NULL)), fminval,
+ (!(isPercent) && (minval != NULL)), fmaxval));
+ }
+ }
+
+ if (critical_value > warning_value)
+ { /* Normal thresholds */
+ if (check_critical_value == TRUE && counter_value >= critical_value)
+ return_code = STATE_CRITICAL;
+ else if (check_warning_value == TRUE && counter_value >= warning_value)
+ return_code = STATE_WARNING;
+ else
+ return_code = STATE_OK;
+ }
+ else
+ { /* inverse thresholds */
+ return_code = STATE_OK;
+ if (check_critical_value == TRUE && counter_value <= critical_value)
+ return_code = STATE_CRITICAL;
+ else if (check_warning_value == TRUE && counter_value <= warning_value)
+ return_code = STATE_WARNING;
+ }
+ break;
+
+ case CHECK_FILEAGE:
+
+ if (value_list==NULL)
+ output_message = strdup (_("No counter specified"));
+ else {
+ preparelist(value_list); /* replace , between services with & to send the request */
+ xasprintf(&send_buffer,"%s&9&%s", req_password,value_list);
+ fetch_data (server_address, server_port, send_buffer);
+ age_in_minutes = atoi(strtok(recv_buffer,"&"));
+ description = strtok(NULL,"&");
+ output_message = strdup (description);
+
+ if (critical_value > warning_value) { /* Normal thresholds */
+ if(check_critical_value==TRUE && age_in_minutes >= critical_value)
+ return_code=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && age_in_minutes >= warning_value)
+ return_code=STATE_WARNING;
+ else
+ return_code=STATE_OK;
+ }
+ else { /* inverse thresholds */
+ if(check_critical_value==TRUE && age_in_minutes <= critical_value)
+ return_code=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && age_in_minutes <= warning_value)
+ return_code=STATE_WARNING;
+ else
+ return_code=STATE_OK;
+ }
+ }
+ break;
+
+ case CHECK_INSTANCES:
+ if (value_list==NULL)
+ output_message = strdup (_("No counter specified"));
+ else {
+ xasprintf(&send_buffer,"%s&10&%s", req_password,value_list);
+ fetch_data (server_address, server_port, send_buffer);
+ if (!strncmp(recv_buffer,"ERROR",5)) {
+ printf("NSClient - %s\n",recv_buffer);
+ exit(STATE_UNKNOWN);
+ }
+ xasprintf(&output_message,"%s",recv_buffer);
+ return_code=STATE_OK;
+ }
+ break;
+
+ case CHECK_NONE:
+ default:
+ usage4 (_("Please specify a variable to check"));
+ break;
+
+ }
+
+ /* reset timeout */
+ alarm(0);
+
+ if (perfdata==NULL)
+ printf("%s\n",output_message);
+ else
+ printf("%s | %s\n",output_message,perfdata);
+ return return_code;
+}
+
+
+
+/* process command-line arguments */
+int process_arguments(int argc, char **argv){
+ int c;
+
+ int option = 0;
+ static struct option longopts[] =
+ {
+ {"port", required_argument,0,'p'},
+ {"timeout", required_argument,0,'t'},
+ {"critical", required_argument,0,'c'},
+ {"warning", required_argument,0,'w'},
+ {"variable", required_argument,0,'v'},
+ {"hostname", required_argument,0,'H'},
+ {"params", required_argument,0,'l'},
+ {"secret", required_argument,0,'s'},
+ {"display", required_argument,0,'d'},
+ {"unknown-timeout", no_argument, 0, 'u'},
+ {"version", no_argument, 0,'V'},
+ {"help", no_argument, 0,'h'},
+ {0,0,0,0}
+ };
+
+ /* no options were supplied */
+ if(argc<2) return ERROR;
+
+ /* backwards compatibility */
+ if (! is_option(argv[1])) {
+ server_address = strdup(argv[1]);
+ argv[1]=argv[0];
+ argv=&argv[1];
+ argc--;
+ }
+
+ for (c=1;c<argc;c++) {
+ if(strcmp("-to",argv[c])==0)
+ strcpy(argv[c],"-t");
+ else if (strcmp("-wv",argv[c])==0)
+ strcpy(argv[c],"-w");
+ else if (strcmp("-cv",argv[c])==0)
+ strcpy(argv[c],"-c");
+ }
+
+ while (1) {
+ c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:u",longopts,&option);
+
+ if (c==-1||c==EOF||c==1)
+ break;
+
+ switch (c) {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'h': /* help */
+ print_help();
+ exit(STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision(progname, NP_VERSION);
+ exit(STATE_UNKNOWN);
+ case 'H': /* hostname */
+ server_address = optarg;
+ break;
+ case 's': /* password */
+ req_password = optarg;
+ break;
+ case 'p': /* port */
+ if (is_intnonneg(optarg))
+ server_port=atoi(optarg);
+ else
+ die(STATE_UNKNOWN,_("Server port must be an integer\n"));
+ break;
+ case 'v':
+ if(strlen(optarg)<4)
+ return ERROR;
+ if(!strcmp(optarg,"CLIENTVERSION"))
+ vars_to_check=CHECK_CLIENTVERSION;
+ else if(!strcmp(optarg,"CPULOAD"))
+ vars_to_check=CHECK_CPULOAD;
+ else if(!strcmp(optarg,"UPTIME"))
+ vars_to_check=CHECK_UPTIME;
+ else if(!strcmp(optarg,"USEDDISKSPACE"))
+ vars_to_check=CHECK_USEDDISKSPACE;
+ else if(!strcmp(optarg,"SERVICESTATE"))
+ vars_to_check=CHECK_SERVICESTATE;
+ else if(!strcmp(optarg,"PROCSTATE"))
+ vars_to_check=CHECK_PROCSTATE;
+ else if(!strcmp(optarg,"MEMUSE"))
+ vars_to_check=CHECK_MEMUSE;
+ else if(!strcmp(optarg,"COUNTER"))
+ vars_to_check=CHECK_COUNTER;
+ else if(!strcmp(optarg,"FILEAGE"))
+ vars_to_check=CHECK_FILEAGE;
+ else if(!strcmp(optarg,"INSTANCES"))
+ vars_to_check=CHECK_INSTANCES;
+ else
+ return ERROR;
+ break;
+ case 'l': /* value list */
+ value_list = optarg;
+ break;
+ case 'w': /* warning threshold */
+ warning_value=strtoul(optarg,NULL,10);
+ check_warning_value=TRUE;
+ break;
+ case 'c': /* critical threshold */
+ critical_value=strtoul(optarg,NULL,10);
+ check_critical_value=TRUE;
+ break;
+ case 'd': /* Display select for services */
+ if (!strcmp(optarg,"SHOWALL"))
+ show_all = TRUE;
+ break;
+ case 'u':
+ socket_timeout_state=STATE_UNKNOWN;
+ break;
+ case 't': /* timeout */
+ socket_timeout=atoi(optarg);
+ if(socket_timeout<=0)
+ return ERROR;
+ }
+
+ }
+ if (server_address == NULL)
+ usage4 (_("You must provide a server address or host name"));
+
+ if (vars_to_check==CHECK_NONE)
+ return ERROR;
+
+ if (req_password == NULL)
+ req_password = strdup (_("None"));
+
+ return OK;
+}
+
+
+
+void fetch_data (const char *address, int port, const char *sendb) {
+ int result;
+
+ result=process_tcp_request(address, port, sendb, recv_buffer,sizeof(recv_buffer));
+
+ if(result!=STATE_OK)
+ die (result, _("could not fetch information from server\n"));
+
+ if (!strncmp(recv_buffer,"ERROR",5))
+ die (STATE_UNKNOWN, "NSClient - %s\n",recv_buffer);
+}
+
+int strtoularray(unsigned long *array, char *string, const char *delim) {
+ /* split a <delim> delimited string into a long array */
+ int idx=0;
+ char *t1;
+
+ for (idx=0;idx<MAX_VALUE_LIST;idx++)
+ array[idx]=0;
+
+ idx=0;
+ for(t1 = strtok(string,delim);t1 != NULL; t1 = strtok(NULL, delim)) {
+ if (is_numeric(t1) && idx<MAX_VALUE_LIST) {
+ array[idx]=strtoul(t1,NULL,10);
+ idx++;
+ } else
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void preparelist(char *string) {
+ /* Replace all , with & which is the delimiter for the request */
+ int i;
+
+ for (i = 0; (size_t)i < strlen(string); i++)
+ if (string[i] == ',') {
+ string[i]='&';
+ }
+}
+
+
+
+void print_help(void)
+{
+ print_revision(progname, NP_VERSION);
+
+ printf ("Copyright (c) 2000 Yves Rubin (rubiyz@yahoo.com)\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin collects data from the NSClient service running on a"));
+ printf ("%s\n", _("Windows NT/2000/XP/2003 server."));
+
+ printf ("\n\n");
+
+ print_usage();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf ("%s\n", _("Options:"));
+ printf (" %s\n", "-H, --hostname=HOST");
+ printf (" %s\n", _("Name of the host to check"));
+ printf (" %s\n", "-p, --port=INTEGER");
+ printf (" %s", _("Optional port number (default: "));
+ printf ("%d)\n", PORT);
+ printf (" %s\n", "-s, --secret=<password>");
+ printf (" %s\n", _("Password needed for the request"));
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Threshold which will result in a warning status"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Threshold which will result in a critical status"));
+ printf (" %s\n", "-t, --timeout=INTEGER");
+ printf (" %s", _("Seconds before connection attempt times out (default: "));
+ printf (" %s\n", "-l, --params=<parameters>");
+ printf (" %s", _("Parameters passed to specified check (see below)"));
+ printf (" %s\n", "-d, --display={SHOWALL}");
+ printf (" %s", _("Display options (currently only SHOWALL works)"));
+ printf (" %s\n", "-u, --unknown-timeout");
+ printf (" %s", _("Return UNKNOWN on timeouts"));
+ printf ("%d)\n", DEFAULT_SOCKET_TIMEOUT);
+ printf (" %s\n", "-h, --help");
+ printf (" %s\n", _("Print this help screen"));
+ printf (" %s\n", "-V, --version");
+ printf (" %s\n", _("Print version information"));
+ printf (" %s\n", "-v, --variable=STRING");
+ printf (" %s\n\n", _("Variable to check"));
+ printf ("%s\n", _("Valid variables are:"));
+ printf (" %s", "CLIENTVERSION =");
+ printf (" %s\n", _("Get the NSClient version"));
+ printf (" %s\n", _("If -l <version> is specified, will return warning if versions differ."));
+ printf (" %s\n", "CPULOAD =");
+ printf (" %s\n", _("Average CPU load on last x minutes."));
+ printf (" %s\n", _("Request a -l parameter with the following syntax:"));
+ printf (" %s\n", _("-l <minutes range>,<warning threshold>,<critical threshold>."));
+ printf (" %s\n", _("<minute range> should be less than 24*60."));
+ printf (" %s\n", _("Thresholds are percentage and up to 10 requests can be done in one shot."));
+ printf (" %s\n", "ie: -l 60,90,95,120,90,95");
+ printf (" %s\n", "UPTIME =");
+ printf (" %s\n", _("Get the uptime of the machine."));
+ printf (" %s\n", _("-l <unit> "));
+ printf (" %s\n", _("<unit> = seconds, minutes, hours, or days. (default: minutes)"));
+ printf (" %s\n", _("Thresholds will use the unit specified above."));
+ printf (" %s\n", "USEDDISKSPACE =");
+ printf (" %s\n", _("Size and percentage of disk use."));
+ printf (" %s\n", _("Request a -l parameter containing the drive letter only."));
+ printf (" %s\n", _("Warning and critical thresholds can be specified with -w and -c."));
+ printf (" %s\n", "MEMUSE =");
+ printf (" %s\n", _("Memory use."));
+ printf (" %s\n", _("Warning and critical thresholds can be specified with -w and -c."));
+ printf (" %s\n", "SERVICESTATE =");
+ printf (" %s\n", _("Check the state of one or several services."));
+ printf (" %s\n", _("Request a -l parameters with the following syntax:"));
+ printf (" %s\n", _("-l <service1>,<service2>,<service3>,..."));
+ printf (" %s\n", _("You can specify -d SHOWALL in case you want to see working services"));
+ printf (" %s\n", _("in the returned string."));
+ printf (" %s\n", "PROCSTATE =");
+ printf (" %s\n", _("Check if one or several process are running."));
+ printf (" %s\n", _("Same syntax as SERVICESTATE."));
+ printf (" %s\n", "COUNTER =");
+ printf (" %s\n", _("Check any performance counter of Windows NT/2000."));
+ printf (" %s\n", _("Request a -l parameters with the following syntax:"));
+ printf (" %s\n", _("-l \"\\\\<performance object>\\\\counter\",\"<description>"));
+ printf (" %s\n", _("The <description> parameter is optional and is given to a printf "));
+ printf (" %s\n", _("output command which requires a float parameter."));
+ printf (" %s\n", _("If <description> does not include \"%%\", it is used as a label."));
+ printf (" %s\n", _("Some examples:"));
+ printf (" %s\n", "\"Paging file usage is %%.2f %%%%\"");
+ printf (" %s\n", "\"%%.f %%%% paging file used.\"");
+ printf (" %s\n", "INSTANCES =");
+ printf (" %s\n", _("Check any performance counter object of Windows NT/2000."));
+ printf (" %s\n", _("Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>"));
+ printf (" %s\n", _("<counter object> is a Windows Perfmon Counter object (eg. Process),"));
+ printf (" %s\n", _("if it is two words, it should be enclosed in quotes"));
+ printf (" %s\n", _("The returned results will be a comma-separated list of instances on "));
+ printf (" %s\n", _(" the selected computer for that object."));
+ printf (" %s\n", _("The purpose of this is to be run from command line to determine what instances"));
+ printf (" %s\n", _(" are available for monitoring without having to log onto the Windows server"));
+ printf (" %s\n", _(" to run Perfmon directly."));
+ printf (" %s\n", _("It can also be used in scripts that automatically create the monitoring service"));
+ printf (" %s\n", _(" configuration files."));
+ printf (" %s\n", _("Some examples:"));
+ printf (" %s\n\n", _("check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process"));
+
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("- The NSClient service should be running on the server to get any information"));
+ printf (" %s\n", "(http://nsclient.ready2run.nl).");
+ printf (" %s\n", _("- Critical thresholds should be lower than warning thresholds"));
+ printf (" %s\n", _("- Default port 1248 is sometimes in use by other services. The error"));
+ printf (" %s\n", _("output when this happens contains \"Cannot map xxxxx to protocol number\"."));
+ printf (" %s\n", _("One fix for this is to change the port to something else on check_nt "));
+ printf (" %s\n", _("and on the client service it\'s connecting to."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void print_usage(void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname);
+ printf ("[-l params] [-d SHOWALL] [-u] [-t timeout]\n");
+}
+
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
new file mode 100644
index 0000000..99537c8
--- /dev/null
+++ b/plugins/check_ntp.c
@@ -0,0 +1,900 @@
+/*****************************************************************************
+*
+* Monitoring check_ntp plugin
+*
+* License: GPL
+* Copyright (c) 2006 Sean Finney <seanius@seanius.net>
+* Copyright (c) 2006-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_ntp plugin
+*
+* This plugin to check ntp servers independent of any commandline
+* programs or external libraries.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_ntp";
+const char *copyright = "2006-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+static char *server_address=NULL;
+static int verbose=0;
+static short do_offset=0;
+static char *owarn="60";
+static char *ocrit="120";
+static short do_jitter=0;
+static char *jwarn="5000";
+static char *jcrit="10000";
+
+int process_arguments (int, char **);
+thresholds *offset_thresholds = NULL;
+thresholds *jitter_thresholds = NULL;
+void print_help (void);
+void print_usage (void);
+
+/* number of times to perform each request to get a good average. */
+#ifndef AVG_NUM
+#define AVG_NUM 4
+#endif
+
+/* max size of control message data */
+#define MAX_CM_SIZE 468
+
+/* this structure holds everything in an ntp request/response as per rfc1305 */
+typedef struct {
+ uint8_t flags; /* byte with leapindicator,vers,mode. see macros */
+ uint8_t stratum; /* clock stratum */
+ int8_t poll; /* polling interval */
+ int8_t precision; /* precision of the local clock */
+ int32_t rtdelay; /* total rt delay, as a fixed point num. see macros */
+ uint32_t rtdisp; /* like above, but for max err to primary src */
+ uint32_t refid; /* ref clock identifier */
+ uint64_t refts; /* reference timestamp. local time local clock */
+ uint64_t origts; /* time at which request departed client */
+ uint64_t rxts; /* time at which request arrived at server */
+ uint64_t txts; /* time at which request departed server */
+} ntp_message;
+
+/* this structure holds data about results from querying offset from a peer */
+typedef struct {
+ time_t waiting; /* ts set when we started waiting for a response */
+ int num_responses; /* number of successfully received responses */
+ uint8_t stratum; /* copied verbatim from the ntp_message */
+ double rtdelay; /* converted from the ntp_message */
+ double rtdisp; /* converted from the ntp_message */
+ double offset[AVG_NUM]; /* offsets from each response */
+ uint8_t flags; /* byte with leapindicator,vers,mode. see macros */
+} ntp_server_results;
+
+/* this structure holds everything in an ntp control message as per rfc1305 */
+typedef struct {
+ uint8_t flags; /* byte with leapindicator,vers,mode. see macros */
+ uint8_t op; /* R,E,M bits and Opcode */
+ uint16_t seq; /* Packet sequence */
+ uint16_t status; /* Clock status */
+ uint16_t assoc; /* Association */
+ uint16_t offset; /* Similar to TCP sequence # */
+ uint16_t count; /* # bytes of data */
+ char data[MAX_CM_SIZE]; /* ASCII data of the request */
+ /* NB: not necessarily NULL terminated! */
+} ntp_control_message;
+
+/* this is an association/status-word pair found in control packet responses */
+typedef struct {
+ uint16_t assoc;
+ uint16_t status;
+} ntp_assoc_status_pair;
+
+/* bits 1,2 are the leap indicator */
+#define LI_MASK 0xc0
+#define LI(x) ((x&LI_MASK)>>6)
+#define LI_SET(x,y) do{ x |= ((y<<6)&LI_MASK); }while(0)
+/* and these are the values of the leap indicator */
+#define LI_NOWARNING 0x00
+#define LI_EXTRASEC 0x01
+#define LI_MISSINGSEC 0x02
+#define LI_ALARM 0x03
+/* bits 3,4,5 are the ntp version */
+#define VN_MASK 0x38
+#define VN(x) ((x&VN_MASK)>>3)
+#define VN_SET(x,y) do{ x |= ((y<<3)&VN_MASK); }while(0)
+#define VN_RESERVED 0x02
+/* bits 6,7,8 are the ntp mode */
+#define MODE_MASK 0x07
+#define MODE(x) (x&MODE_MASK)
+#define MODE_SET(x,y) do{ x |= (y&MODE_MASK); }while(0)
+/* here are some values */
+#define MODE_CLIENT 0x03
+#define MODE_CONTROLMSG 0x06
+/* In control message, bits 8-10 are R,E,M bits */
+#define REM_MASK 0xe0
+#define REM_RESP 0x80
+#define REM_ERROR 0x40
+#define REM_MORE 0x20
+/* In control message, bits 11 - 15 are opcode */
+#define OP_MASK 0x1f
+#define OP_SET(x,y) do{ x |= (y&OP_MASK); }while(0)
+#define OP_READSTAT 0x01
+#define OP_READVAR 0x02
+/* In peer status bytes, bits 6,7,8 determine clock selection status */
+#define PEER_SEL(x) ((ntohs(x)>>8)&0x07)
+#define PEER_INCLUDED 0x04
+#define PEER_SYNCSOURCE 0x06
+
+/**
+ ** a note about the 32-bit "fixed point" numbers:
+ **
+ they are divided into halves, each being a 16-bit int in network byte order:
+ - the first 16 bits are an int on the left side of a decimal point.
+ - the second 16 bits represent a fraction n/(2^16)
+ likewise for the 64-bit "fixed point" numbers with everything doubled :)
+ **/
+
+/* macros to access the left/right 16 bits of a 32-bit ntp "fixed point"
+ number. note that these can be used as lvalues too */
+#define L16(x) (((uint16_t*)&x)[0])
+#define R16(x) (((uint16_t*)&x)[1])
+/* macros to access the left/right 32 bits of a 64-bit ntp "fixed point"
+ number. these too can be used as lvalues */
+#define L32(x) (((uint32_t*)&x)[0])
+#define R32(x) (((uint32_t*)&x)[1])
+
+/* ntp wants seconds since 1/1/00, epoch is 1/1/70. this is the difference */
+#define EPOCHDIFF 0x83aa7e80UL
+
+/* extract a 32-bit ntp fixed point number into a double */
+#define NTP32asDOUBLE(x) (ntohs(L16(x)) + (double)ntohs(R16(x))/65536.0)
+
+/* likewise for a 64-bit ntp fp number */
+#define NTP64asDOUBLE(n) (double)(((uint64_t)n)?\
+ (ntohl(L32(n))-EPOCHDIFF) + \
+ (.00000001*(0.5+(double)(ntohl(R32(n))/42.94967296))):\
+ 0)
+
+/* convert a struct timeval to a double */
+#define TVasDOUBLE(x) (double)(x.tv_sec+(0.000001*x.tv_usec))
+
+/* convert an ntp 64-bit fp number to a struct timeval */
+#define NTP64toTV(n,t) \
+ do{ if(!n) t.tv_sec = t.tv_usec = 0; \
+ else { \
+ t.tv_sec=ntohl(L32(n))-EPOCHDIFF; \
+ t.tv_usec=(int)(0.5+(double)(ntohl(R32(n))/4294.967296)); \
+ } \
+ }while(0)
+
+/* convert a struct timeval to an ntp 64-bit fp number */
+#define TVtoNTP64(t,n) \
+ do{ if(!t.tv_usec && !t.tv_sec) n=0x0UL; \
+ else { \
+ L32(n)=htonl(t.tv_sec + EPOCHDIFF); \
+ R32(n)=htonl((uint64_t)((4294.967296*t.tv_usec)+.5)); \
+ } \
+ } while(0)
+
+/* NTP control message header is 12 bytes, plus any data in the data
+ * field, plus null padding to the nearest 32-bit boundary per rfc.
+ */
+#define SIZEOF_NTPCM(m) (12+ntohs(m.count)+((ntohs(m.count)%4)?4-(ntohs(m.count)%4):0))
+
+/* finally, a little helper or two for debugging: */
+#define DBG(x) do{if(verbose>1){ x; }}while(0);
+#define PRINTSOCKADDR(x) \
+ do{ \
+ printf("%u.%u.%u.%u", (x>>24)&0xff, (x>>16)&0xff, (x>>8)&0xff, x&0xff);\
+ }while(0);
+
+/* calculate the offset of the local clock */
+static inline double calc_offset(const ntp_message *m, const struct timeval *t){
+ double client_tx, peer_rx, peer_tx, client_rx;
+ client_tx = NTP64asDOUBLE(m->origts);
+ peer_rx = NTP64asDOUBLE(m->rxts);
+ peer_tx = NTP64asDOUBLE(m->txts);
+ client_rx=TVasDOUBLE((*t));
+ return (.5*((peer_tx-client_rx)+(peer_rx-client_tx)));
+}
+
+/* print out a ntp packet in human readable/debuggable format */
+void print_ntp_message(const ntp_message *p){
+ struct timeval ref, orig, rx, tx;
+
+ NTP64toTV(p->refts,ref);
+ NTP64toTV(p->origts,orig);
+ NTP64toTV(p->rxts,rx);
+ NTP64toTV(p->txts,tx);
+
+ printf("packet contents:\n");
+ printf("\tflags: 0x%.2x\n", p->flags);
+ printf("\t li=%d (0x%.2x)\n", LI(p->flags), p->flags&LI_MASK);
+ printf("\t vn=%d (0x%.2x)\n", VN(p->flags), p->flags&VN_MASK);
+ printf("\t mode=%d (0x%.2x)\n", MODE(p->flags), p->flags&MODE_MASK);
+ printf("\tstratum = %d\n", p->stratum);
+ printf("\tpoll = %g\n", pow(2, p->poll));
+ printf("\tprecision = %g\n", pow(2, p->precision));
+ printf("\trtdelay = %-.16g\n", NTP32asDOUBLE(p->rtdelay));
+ printf("\trtdisp = %-.16g\n", NTP32asDOUBLE(p->rtdisp));
+ printf("\trefid = %x\n", p->refid);
+ printf("\trefts = %-.16g\n", NTP64asDOUBLE(p->refts));
+ printf("\torigts = %-.16g\n", NTP64asDOUBLE(p->origts));
+ printf("\trxts = %-.16g\n", NTP64asDOUBLE(p->rxts));
+ printf("\ttxts = %-.16g\n", NTP64asDOUBLE(p->txts));
+}
+
+void print_ntp_control_message(const ntp_control_message *p){
+ int i=0, numpeers=0;
+ const ntp_assoc_status_pair *peer=NULL;
+
+ printf("control packet contents:\n");
+ printf("\tflags: 0x%.2x , 0x%.2x\n", p->flags, p->op);
+ printf("\t li=%d (0x%.2x)\n", LI(p->flags), p->flags&LI_MASK);
+ printf("\t vn=%d (0x%.2x)\n", VN(p->flags), p->flags&VN_MASK);
+ printf("\t mode=%d (0x%.2x)\n", MODE(p->flags), p->flags&MODE_MASK);
+ printf("\t response=%d (0x%.2x)\n", (p->op&REM_RESP)>0, p->op&REM_RESP);
+ printf("\t more=%d (0x%.2x)\n", (p->op&REM_MORE)>0, p->op&REM_MORE);
+ printf("\t error=%d (0x%.2x)\n", (p->op&REM_ERROR)>0, p->op&REM_ERROR);
+ printf("\t op=%d (0x%.2x)\n", p->op&OP_MASK, p->op&OP_MASK);
+ printf("\tsequence: %d (0x%.2x)\n", ntohs(p->seq), ntohs(p->seq));
+ printf("\tstatus: %d (0x%.2x)\n", ntohs(p->status), ntohs(p->status));
+ printf("\tassoc: %d (0x%.2x)\n", ntohs(p->assoc), ntohs(p->assoc));
+ printf("\toffset: %d (0x%.2x)\n", ntohs(p->offset), ntohs(p->offset));
+ printf("\tcount: %d (0x%.2x)\n", ntohs(p->count), ntohs(p->count));
+ numpeers=ntohs(p->count)/(sizeof(ntp_assoc_status_pair));
+ if(p->op&REM_RESP && p->op&OP_READSTAT){
+ peer=(ntp_assoc_status_pair*)p->data;
+ for(i=0;i<numpeers;i++){
+ printf("\tpeer id %.2x status %.2x",
+ ntohs(peer[i].assoc), ntohs(peer[i].status));
+ if (PEER_SEL(peer[i].status) >= PEER_INCLUDED){
+ if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){
+ printf(" <-- current sync source");
+ } else {
+ printf(" <-- current sync candidate");
+ }
+ }
+ printf("\n");
+ }
+ }
+}
+
+void setup_request(ntp_message *p){
+ struct timeval t;
+
+ memset(p, 0, sizeof(ntp_message));
+ LI_SET(p->flags, LI_ALARM);
+ VN_SET(p->flags, 4);
+ MODE_SET(p->flags, MODE_CLIENT);
+ p->poll=4;
+ p->precision=(int8_t)0xfa;
+ L16(p->rtdelay)=htons(1);
+ L16(p->rtdisp)=htons(1);
+
+ gettimeofday(&t, NULL);
+ TVtoNTP64(t,p->txts);
+}
+
+/* select the "best" server from a list of servers, and return its index.
+ * this is done by filtering servers based on stratum, dispersion, and
+ * finally round-trip delay. */
+int best_offset_server(const ntp_server_results *slist, int nservers){
+ int cserver=0, best_server=-1;
+
+ /* for each server */
+ for(cserver=0; cserver<nservers; cserver++){
+ /* We don't want any servers that fails these tests */
+ /* Sort out servers that didn't respond or responede with a 0 stratum;
+ * stratum 0 is for reference clocks so no NTP server should ever report
+ * a stratum 0 */
+ if ( slist[cserver].stratum == 0){
+ if (verbose) printf("discarding peer %d: stratum=%d\n", cserver, slist[cserver].stratum);
+ continue;
+ }
+ /* Sort out servers with error flags */
+ if ( LI(slist[cserver].flags) == LI_ALARM ){
+ if (verbose) printf("discarding peer %d: flags=%d\n", cserver, LI(slist[cserver].flags));
+ continue;
+ }
+
+ /* If we don't have a server yet, use the first one */
+ if (best_server == -1) {
+ best_server = cserver;
+ DBG(printf("using peer %d as our first candidate\n", best_server));
+ continue;
+ }
+
+ /* compare the server to the best one we've seen so far */
+ /* does it have an equal or better stratum? */
+ DBG(printf("comparing peer %d with peer %d\n", cserver, best_server));
+ if(slist[cserver].stratum <= slist[best_server].stratum){
+ DBG(printf("stratum for peer %d <= peer %d\n", cserver, best_server));
+ /* does it have an equal or better dispersion? */
+ if(slist[cserver].rtdisp <= slist[best_server].rtdisp){
+ DBG(printf("dispersion for peer %d <= peer %d\n", cserver, best_server));
+ /* does it have a better rtdelay? */
+ if(slist[cserver].rtdelay < slist[best_server].rtdelay){
+ DBG(printf("rtdelay for peer %d < peer %d\n", cserver, best_server));
+ best_server = cserver;
+ DBG(printf("peer %d is now our best candidate\n", best_server));
+ }
+ }
+ }
+ }
+
+ if(best_server >= 0) {
+ DBG(printf("best server selected: peer %d\n", best_server));
+ return best_server;
+ } else {
+ DBG(printf("no peers meeting synchronization criteria :(\n"));
+ return -1;
+ }
+}
+
+/* do everything we need to get the total average offset
+ * - we use a certain amount of parallelization with poll() to ensure
+ * we don't waste time sitting around waiting for single packets.
+ * - we also "manually" handle resolving host names and connecting, because
+ * we have to do it in a way that our lazy macros don't handle currently :( */
+double offset_request(const char *host, int *status){
+ int i=0, ga_result=0, num_hosts=0, *socklist=NULL, respnum=0;
+ int servers_completed=0, one_read=0, servers_readable=0, best_index=-1;
+ time_t now_time=0, start_ts=0;
+ ntp_message *req=NULL;
+ double avg_offset=0.;
+ struct timeval recv_time;
+ struct addrinfo *ai=NULL, *ai_tmp=NULL, hints;
+ struct pollfd *ufds=NULL;
+ ntp_server_results *servers=NULL;
+
+ /* setup hints to only return results from getaddrinfo that we'd like */
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = address_family;
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_socktype = SOCK_DGRAM;
+
+ /* fill in ai with the list of hosts resolved by the host name */
+ ga_result = getaddrinfo(host, "123", &hints, &ai);
+ if(ga_result!=0){
+ die(STATE_UNKNOWN, "error getting address for %s: %s\n",
+ host, gai_strerror(ga_result));
+ }
+
+ /* count the number of returned hosts, and allocate stuff accordingly */
+ for(ai_tmp=ai; ai_tmp!=NULL; ai_tmp=ai_tmp->ai_next){ num_hosts++; }
+ req=(ntp_message*)malloc(sizeof(ntp_message)*num_hosts);
+ if(req==NULL) die(STATE_UNKNOWN, "can not allocate ntp message array");
+ socklist=(int*)malloc(sizeof(int)*num_hosts);
+ if(socklist==NULL) die(STATE_UNKNOWN, "can not allocate socket array");
+ ufds=(struct pollfd*)malloc(sizeof(struct pollfd)*num_hosts);
+ if(ufds==NULL) die(STATE_UNKNOWN, "can not allocate socket array");
+ servers=(ntp_server_results*)malloc(sizeof(ntp_server_results)*num_hosts);
+ if(servers==NULL) die(STATE_UNKNOWN, "can not allocate server array");
+ memset(servers, 0, sizeof(ntp_server_results)*num_hosts);
+ DBG(printf("Found %d peers to check\n", num_hosts));
+
+ /* setup each socket for writing, and the corresponding struct pollfd */
+ ai_tmp=ai;
+ for(i=0;ai_tmp;i++){
+ socklist[i]=socket(ai_tmp->ai_family, SOCK_DGRAM, IPPROTO_UDP);
+ if(socklist[i] == -1) {
+ perror(NULL);
+ die(STATE_UNKNOWN, "can not create new socket");
+ }
+ if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){
+ /* don't die here, because it is enough if there is one server
+ answering in time. This also would break for dual ipv4/6 stacked
+ ntp servers when the client only supports on of them.
+ */
+ DBG(printf("can't create socket connection on peer %i: %s\n", i, strerror(errno)));
+ } else {
+ ufds[i].fd=socklist[i];
+ ufds[i].events=POLLIN;
+ ufds[i].revents=0;
+ }
+ ai_tmp = ai_tmp->ai_next;
+ }
+
+ /* now do AVG_NUM checks to each host. we stop before timeout/2 seconds
+ * have passed in order to ensure post-processing and jitter time. */
+ now_time=start_ts=time(NULL);
+ while(servers_completed<num_hosts && now_time-start_ts <= socket_timeout/2){
+ /* loop through each server and find each one which hasn't
+ * been touched in the past second or so and is still lacking
+ * some responses. for each of these servers, send a new request,
+ * and update the "waiting" timestamp with the current time. */
+ now_time=time(NULL);
+
+ for(i=0; i<num_hosts; i++){
+ if(servers[i].waiting<now_time && servers[i].num_responses<AVG_NUM){
+ if(verbose && servers[i].waiting != 0) printf("re-");
+ if(verbose) printf("sending request to peer %d\n", i);
+ setup_request(&req[i]);
+ write(socklist[i], &req[i], sizeof(ntp_message));
+ servers[i].waiting=now_time;
+ break;
+ }
+ }
+
+ /* quickly poll for any sockets with pending data */
+ servers_readable=poll(ufds, num_hosts, 100);
+ if(servers_readable==-1){
+ perror("polling ntp sockets");
+ die(STATE_UNKNOWN, "communication errors");
+ }
+
+ /* read from any sockets with pending data */
+ for(i=0; servers_readable && i<num_hosts; i++){
+ if(ufds[i].revents&POLLIN && servers[i].num_responses < AVG_NUM){
+ if(verbose) {
+ printf("response from peer %d: ", i);
+ }
+
+ read(ufds[i].fd, &req[i], sizeof(ntp_message));
+ gettimeofday(&recv_time, NULL);
+ DBG(print_ntp_message(&req[i]));
+ respnum=servers[i].num_responses++;
+ servers[i].offset[respnum]=calc_offset(&req[i], &recv_time);
+ if(verbose) {
+ printf("offset %.10g\n", servers[i].offset[respnum]);
+ }
+ servers[i].stratum=req[i].stratum;
+ servers[i].rtdisp=NTP32asDOUBLE(req[i].rtdisp);
+ servers[i].rtdelay=NTP32asDOUBLE(req[i].rtdelay);
+ servers[i].waiting=0;
+ servers[i].flags=req[i].flags;
+ servers_readable--;
+ one_read = 1;
+ if(servers[i].num_responses==AVG_NUM) servers_completed++;
+ }
+ }
+ /* lather, rinse, repeat. */
+ }
+
+ if (one_read == 0) {
+ die(STATE_CRITICAL, "NTP CRITICAL: No response from NTP server\n");
+ }
+
+ /* now, pick the best server from the list */
+ best_index=best_offset_server(servers, num_hosts);
+ if(best_index < 0){
+ *status=STATE_UNKNOWN;
+ } else {
+ /* finally, calculate the average offset */
+ for(i=0; i<servers[best_index].num_responses;i++){
+ avg_offset+=servers[best_index].offset[i];
+ }
+ avg_offset/=servers[best_index].num_responses;
+ }
+
+ /* cleanup */
+ /* FIXME: Not closing the socket to avoid reuse of the local port
+ * which can cause old NTP packets to be read instead of NTP control
+ * packets in jitter_request(). THERE MUST BE ANOTHER WAY...
+ * for(j=0; j<num_hosts; j++){ close(socklist[j]); } */
+ free(socklist);
+ free(ufds);
+ free(servers);
+ free(req);
+ freeaddrinfo(ai);
+
+ if(verbose) printf("overall average offset: %.10g\n", avg_offset);
+ return avg_offset;
+}
+
+void
+setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){
+ memset(p, 0, sizeof(ntp_control_message));
+ LI_SET(p->flags, LI_NOWARNING);
+ VN_SET(p->flags, VN_RESERVED);
+ MODE_SET(p->flags, MODE_CONTROLMSG);
+ OP_SET(p->op, opcode);
+ p->seq = htons(seq);
+ /* Remaining fields are zero for requests */
+}
+
+/* XXX handle responses with the error bit set */
+double jitter_request(int *status){
+ int conn=-1, i, npeers=0, num_candidates=0, syncsource_found=0;
+ int run=0, min_peer_sel=PEER_INCLUDED, num_selected=0, num_valid=0;
+ int peers_size=0, peer_offset=0;
+ ntp_assoc_status_pair *peers=NULL;
+ ntp_control_message req;
+ const char *getvar = "jitter";
+ double rval = 0.0, jitter = -1.0;
+ char *startofvalue=NULL, *nptr=NULL;
+ void *tmp;
+
+ /* Long-winded explanation:
+ * Getting the jitter requires a number of steps:
+ * 1) Send a READSTAT request.
+ * 2) Interpret the READSTAT reply
+ * a) The data section contains a list of peer identifiers (16 bits)
+ * and associated status words (16 bits)
+ * b) We want the value of 0x06 in the SEL (peer selection) value,
+ * which means "current synchronizatin source". If that's missing,
+ * we take anything better than 0x04 (see the rfc for details) but
+ * set a minimum of warning.
+ * 3) Send a READVAR request for information on each peer identified
+ * in 2b greater than the minimum selection value.
+ * 4) Extract the jitter value from the data[] (it's ASCII)
+ */
+ my_udp_connect(server_address, 123, &conn);
+
+ /* keep sending requests until the server stops setting the
+ * REM_MORE bit, though usually this is only 1 packet. */
+ do{
+ setup_control_request(&req, OP_READSTAT, 1);
+ DBG(printf("sending READSTAT request"));
+ write(conn, &req, SIZEOF_NTPCM(req));
+ DBG(print_ntp_control_message(&req));
+ /* Attempt to read the largest size packet possible */
+ req.count=htons(MAX_CM_SIZE);
+ DBG(printf("receiving READSTAT response"))
+ read(conn, &req, SIZEOF_NTPCM(req));
+ DBG(print_ntp_control_message(&req));
+ /* Each peer identifier is 4 bytes in the data section, which
+ * we represent as a ntp_assoc_status_pair datatype.
+ */
+ peers_size+=ntohs(req.count);
+ if((tmp=realloc(peers, peers_size)) == NULL)
+ free(peers), die(STATE_UNKNOWN, "can not (re)allocate 'peers' buffer\n");
+ peers=tmp;
+ memcpy((void*)((ptrdiff_t)peers+peer_offset), (void*)req.data, ntohs(req.count));
+ npeers=peers_size/sizeof(ntp_assoc_status_pair);
+ peer_offset+=ntohs(req.count);
+ } while(req.op&REM_MORE);
+
+ /* first, let's find out if we have a sync source, or if there are
+ * at least some candidates. in the case of the latter we'll issue
+ * a warning but go ahead with the check on them. */
+ for (i = 0; i < npeers; i++){
+ if (PEER_SEL(peers[i].status) >= PEER_INCLUDED){
+ num_candidates++;
+ if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){
+ syncsource_found=1;
+ min_peer_sel=PEER_SYNCSOURCE;
+ }
+ }
+ }
+ if(verbose) printf("%d candidate peers available\n", num_candidates);
+ if(verbose && syncsource_found) printf("synchronization source found\n");
+ if(! syncsource_found){
+ *status = STATE_UNKNOWN;
+ if(verbose) printf("warning: no synchronization source found\n");
+ }
+
+
+ for (run=0; run<AVG_NUM; run++){
+ if(verbose) printf("jitter run %d of %d\n", run+1, AVG_NUM);
+ for (i = 0; i < npeers; i++){
+ /* Only query this server if it is the current sync source */
+ if (PEER_SEL(peers[i].status) >= min_peer_sel){
+ char jitter_data[MAX_CM_SIZE+1];
+ size_t jitter_data_count;
+
+ num_selected++;
+ setup_control_request(&req, OP_READVAR, 2);
+ req.assoc = peers[i].assoc;
+ /* By spec, putting the variable name "jitter" in the request
+ * should cause the server to provide _only_ the jitter value.
+ * thus reducing net traffic, guaranteeing us only a single
+ * datagram in reply, and making interpretation much simpler
+ */
+ /* Older servers doesn't know what jitter is, so if we get an
+ * error on the first pass we redo it with "dispersion" */
+ strncpy(req.data, getvar, MAX_CM_SIZE-1);
+ req.count = htons(strlen(getvar));
+ DBG(printf("sending READVAR request...\n"));
+ write(conn, &req, SIZEOF_NTPCM(req));
+ DBG(print_ntp_control_message(&req));
+
+ req.count = htons(MAX_CM_SIZE);
+ DBG(printf("receiving READVAR response...\n"));
+ read(conn, &req, SIZEOF_NTPCM(req));
+ DBG(print_ntp_control_message(&req));
+
+ if(req.op&REM_ERROR && strstr(getvar, "jitter")) {
+ if(verbose) printf("The 'jitter' command failed (old ntp server?)\nRestarting with 'dispersion'...\n");
+ getvar = "dispersion";
+ num_selected--;
+ i--;
+ continue;
+ }
+
+ /* get to the float value */
+ if(verbose) {
+ printf("parsing jitter from peer %.2x: ", ntohs(peers[i].assoc));
+ }
+ if((jitter_data_count = ntohs(req.count)) >= sizeof(jitter_data)){
+ die(STATE_UNKNOWN,
+ _("jitter response too large (%lu bytes)\n"),
+ (unsigned long)jitter_data_count);
+ }
+ memcpy(jitter_data, req.data, jitter_data_count);
+ jitter_data[jitter_data_count] = '\0';
+ startofvalue = strchr(jitter_data, '=');
+ if(startofvalue != NULL) {
+ startofvalue++;
+ jitter = strtod(startofvalue, &nptr);
+ }
+ if(startofvalue == NULL || startofvalue==nptr){
+ printf("warning: unable to read server jitter response.\n");
+ *status = STATE_UNKNOWN;
+ } else {
+ if(verbose) printf("%g\n", jitter);
+ num_valid++;
+ rval += jitter;
+ }
+ }
+ }
+ if(verbose){
+ printf("jitter parsed from %d/%d peers\n", num_valid, num_selected);
+ }
+ }
+
+ rval = num_valid ? rval / num_valid : -1.0;
+
+ close(conn);
+ if(peers!=NULL) free(peers);
+ /* If we return -1.0, it means no synchronization source was found */
+ return rval;
+}
+
+int process_arguments(int argc, char **argv){
+ int c;
+ int option=0;
+ static struct option longopts[] = {
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"verbose", no_argument, 0, 'v'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"jwarn", required_argument, 0, 'j'},
+ {"jcrit", required_argument, 0, 'k'},
+ {"timeout", required_argument, 0, 't'},
+ {"hostname", required_argument, 0, 'H'},
+ {0, 0, 0, 0}
+ };
+
+
+ if (argc < 2)
+ usage ("\n");
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vhv46w:c:j:k:t:H:", longopts, &option);
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case 'h':
+ print_help();
+ exit(STATE_UNKNOWN);
+ break;
+ case 'V':
+ print_revision(progname, NP_VERSION);
+ exit(STATE_UNKNOWN);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'w':
+ do_offset=1;
+ owarn = optarg;
+ break;
+ case 'c':
+ do_offset=1;
+ ocrit = optarg;
+ break;
+ case 'j':
+ do_jitter=1;
+ jwarn = optarg;
+ break;
+ case 'k':
+ do_jitter=1;
+ jcrit = optarg;
+ break;
+ case 'H':
+ if(is_host(optarg) == FALSE)
+ usage2(_("Invalid hostname/address"), optarg);
+ server_address = strdup(optarg);
+ break;
+ case 't':
+ socket_timeout=atoi(optarg);
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case '?':
+ /* print short usage statement if args not parsable */
+ usage5 ();
+ break;
+ }
+ }
+
+ if(server_address == NULL){
+ usage4(_("Hostname was not supplied"));
+ }
+
+ return 0;
+}
+
+char *perfd_offset (double offset)
+{
+ return fperfdata ("offset", offset, "s",
+ TRUE, offset_thresholds->warning->end,
+ TRUE, offset_thresholds->critical->end,
+ FALSE, 0, FALSE, 0);
+}
+
+char *perfd_jitter (double jitter)
+{
+ return fperfdata ("jitter", jitter, "s",
+ do_jitter, jitter_thresholds->warning->end,
+ do_jitter, jitter_thresholds->critical->end,
+ TRUE, 0, FALSE, 0);
+}
+
+int main(int argc, char *argv[]){
+ int result, offset_result, jitter_result;
+ double offset=0, jitter=0;
+ char *result_line, *perfdata_line;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ result = offset_result = jitter_result = STATE_OK;
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ set_thresholds(&offset_thresholds, owarn, ocrit);
+ set_thresholds(&jitter_thresholds, jwarn, jcrit);
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+
+ offset = offset_request(server_address, &offset_result);
+ /* check_ntp used to always return CRITICAL if offset_result == STATE_UNKNOWN.
+ * Now we'll only do that is the offset thresholds were set */
+ if (do_offset && offset_result == STATE_UNKNOWN) {
+ result = STATE_CRITICAL;
+ } else {
+ result = get_status(fabs(offset), offset_thresholds);
+ }
+
+ /* If not told to check the jitter, we don't even send packets.
+ * jitter is checked using NTP control packets, which not all
+ * servers recognize. Trying to check the jitter on OpenNTPD
+ * (for example) will result in an error
+ */
+ if(do_jitter){
+ jitter=jitter_request(&jitter_result);
+ result = max_state_alt(result, get_status(jitter, jitter_thresholds));
+ /* -1 indicates that we couldn't calculate the jitter
+ * Only overrides STATE_OK from the offset */
+ if(jitter == -1.0 && result == STATE_OK)
+ result = STATE_UNKNOWN;
+ }
+ result = max_state_alt(result, jitter_result);
+
+ switch (result) {
+ case STATE_CRITICAL :
+ xasprintf(&result_line, _("NTP CRITICAL:"));
+ break;
+ case STATE_WARNING :
+ xasprintf(&result_line, _("NTP WARNING:"));
+ break;
+ case STATE_OK :
+ xasprintf(&result_line, _("NTP OK:"));
+ break;
+ default :
+ xasprintf(&result_line, _("NTP UNKNOWN:"));
+ break;
+ }
+ if(offset_result == STATE_UNKNOWN){
+ xasprintf(&result_line, "%s %s", result_line, _("Offset unknown"));
+ xasprintf(&perfdata_line, "");
+ } else {
+ xasprintf(&result_line, "%s %s %.10g secs", result_line, _("Offset"), offset);
+ xasprintf(&perfdata_line, "%s", perfd_offset(offset));
+ }
+ if (do_jitter) {
+ xasprintf(&result_line, "%s, jitter=%f", result_line, jitter);
+ xasprintf(&perfdata_line, "%s %s", perfdata_line, perfd_jitter(jitter));
+ }
+ printf("%s|%s\n", result_line, perfdata_line);
+
+ if(server_address!=NULL) free(server_address);
+ return result;
+}
+
+
+
+void print_help(void){
+ print_revision(progname, NP_VERSION);
+
+ printf ("Copyright (c) 2006 Sean Finney\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin checks the selected ntp server"));
+
+ printf ("\n\n");
+
+ print_usage();
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+ printf (UT_HOST_PORT, 'p', "123");
+ printf (UT_IPv46);
+ printf (" %s\n", "-w, --warning=THRESHOLD");
+ printf (" %s\n", _("Offset to result in warning status (seconds)"));
+ printf (" %s\n", "-c, --critical=THRESHOLD");
+ printf (" %s\n", _("Offset to result in critical status (seconds)"));
+ printf (" %s\n", "-j, --jwarn=THRESHOLD");
+ printf (" %s\n", _("Warning threshold for jitter"));
+ printf (" %s\n", "-k, --jcrit=THRESHOLD");
+ printf (" %s\n", _("Critical threshold for jitter"));
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (UT_VERBOSE);
+
+ printf("\n");
+ printf("%s\n", _("Notes:"));
+ printf(UT_THRESHOLDS_NOTES);
+
+ printf("\n");
+ printf("%s\n", _("Examples:"));
+ printf(" %s\n", _("Normal offset check:"));
+ printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1"));
+ printf("\n");
+ printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available"));
+ printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
+ printf(" %s\n", ("./check_ntp -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
+
+ printf (UT_SUPPORT);
+
+ printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or"));
+ printf ("%s\n\n", _("check_ntp_time instead."));
+}
+
+void
+print_usage(void)
+{
+ printf ("%s\n", _("WARNING: check_ntp is deprecated. Please use check_ntp_peer or"));
+ printf ("%s\n\n", _("check_ntp_time instead."));
+ printf ("%s\n", _("Usage:"));
+ printf(" %s -H <host> [-w <warn>] [-c <crit>] [-j <warn>] [-k <crit>] [-4|-6] [-v verbose]\n", progname);
+}
diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c
new file mode 100644
index 0000000..49cb100
--- /dev/null
+++ b/plugins/check_ntp_peer.c
@@ -0,0 +1,756 @@
+/*****************************************************************************
+*
+* Monitoring check_ntp_peer plugin
+*
+* License: GPL
+* Copyright (c) 2006 Sean Finney <seanius@seanius.net>
+* Copyright (c) 2006-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_ntp_peer plugin
+*
+* This plugin checks an NTP server independent of any commandline
+* programs or external libraries.
+*
+* Use this plugin to check the health of an NTP server. It supports
+* checking the offset with the sync peer, the jitter and stratum. This
+* plugin will not check the clock offset between the local host and NTP
+* server; please use check_ntp_time for that purpose.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_ntp_peer";
+const char *copyright = "2006-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+static char *server_address=NULL;
+static int port=123;
+static int verbose=0;
+static int quiet=0;
+static short do_offset=0;
+static char *owarn="60";
+static char *ocrit="120";
+static short do_stratum=0;
+static char *swarn="-1:16";
+static char *scrit="-1:16";
+static short do_jitter=0;
+static char *jwarn="-1:5000";
+static char *jcrit="-1:10000";
+static short do_truechimers=0;
+static char *twarn="0:";
+static char *tcrit="0:";
+static int syncsource_found=0;
+static int li_alarm=0;
+
+int process_arguments (int, char **);
+thresholds *offset_thresholds = NULL;
+thresholds *jitter_thresholds = NULL;
+thresholds *stratum_thresholds = NULL;
+thresholds *truechimer_thresholds = NULL;
+void print_help (void);
+void print_usage (void);
+
+/* max size of control message data */
+#define MAX_CM_SIZE 468
+
+/* this structure holds everything in an ntp control message as per rfc1305 */
+typedef struct {
+ uint8_t flags; /* byte with leapindicator,vers,mode. see macros */
+ uint8_t op; /* R,E,M bits and Opcode */
+ uint16_t seq; /* Packet sequence */
+ uint16_t status; /* Clock status */
+ uint16_t assoc; /* Association */
+ uint16_t offset; /* Similar to TCP sequence # */
+ uint16_t count; /* # bytes of data */
+ char data[MAX_CM_SIZE]; /* ASCII data of the request */
+ /* NB: not necessarily NULL terminated! */
+} ntp_control_message;
+
+/* this is an association/status-word pair found in control packet responses */
+typedef struct {
+ uint16_t assoc;
+ uint16_t status;
+} ntp_assoc_status_pair;
+
+/* bits 1,2 are the leap indicator */
+#define LI_MASK 0xc0
+#define LI(x) ((x&LI_MASK)>>6)
+#define LI_SET(x,y) do{ x |= ((y<<6)&LI_MASK); }while(0)
+/* and these are the values of the leap indicator */
+#define LI_NOWARNING 0x00
+#define LI_EXTRASEC 0x01
+#define LI_MISSINGSEC 0x02
+#define LI_ALARM 0x03
+/* bits 3,4,5 are the ntp version */
+#define VN_MASK 0x38
+#define VN(x) ((x&VN_MASK)>>3)
+#define VN_SET(x,y) do{ x |= ((y<<3)&VN_MASK); }while(0)
+#define VN_RESERVED 0x02
+/* bits 6,7,8 are the ntp mode */
+#define MODE_MASK 0x07
+#define MODE(x) (x&MODE_MASK)
+#define MODE_SET(x,y) do{ x |= (y&MODE_MASK); }while(0)
+/* here are some values */
+#define MODE_CLIENT 0x03
+#define MODE_CONTROLMSG 0x06
+/* In control message, bits 8-10 are R,E,M bits */
+#define REM_MASK 0xe0
+#define REM_RESP 0x80
+#define REM_ERROR 0x40
+#define REM_MORE 0x20
+/* In control message, bits 11 - 15 are opcode */
+#define OP_MASK 0x1f
+#define OP_SET(x,y) do{ x |= (y&OP_MASK); }while(0)
+#define OP_READSTAT 0x01
+#define OP_READVAR 0x02
+/* In peer status bytes, bits 6,7,8 determine clock selection status */
+#define PEER_SEL(x) ((ntohs(x)>>8)&0x07)
+#define PEER_TRUECHIMER 0x02
+#define PEER_INCLUDED 0x04
+#define PEER_SYNCSOURCE 0x06
+
+/* NTP control message header is 12 bytes, plus any data in the data
+ * field, plus null padding to the nearest 32-bit boundary per rfc.
+ */
+#define SIZEOF_NTPCM(m) (12+ntohs(m.count)+((ntohs(m.count)%4)?4-(ntohs(m.count)%4):0))
+
+/* finally, a little helper or two for debugging: */
+#define DBG(x) do{if(verbose>1){ x; }}while(0);
+#define PRINTSOCKADDR(x) \
+ do{ \
+ printf("%u.%u.%u.%u", (x>>24)&0xff, (x>>16)&0xff, (x>>8)&0xff, x&0xff);\
+ }while(0);
+
+void print_ntp_control_message(const ntp_control_message *p){
+ int i=0, numpeers=0;
+ const ntp_assoc_status_pair *peer=NULL;
+
+ printf("control packet contents:\n");
+ printf("\tflags: 0x%.2x , 0x%.2x\n", p->flags, p->op);
+ printf("\t li=%d (0x%.2x)\n", LI(p->flags), p->flags&LI_MASK);
+ printf("\t vn=%d (0x%.2x)\n", VN(p->flags), p->flags&VN_MASK);
+ printf("\t mode=%d (0x%.2x)\n", MODE(p->flags), p->flags&MODE_MASK);
+ printf("\t response=%d (0x%.2x)\n", (p->op&REM_RESP)>0, p->op&REM_RESP);
+ printf("\t more=%d (0x%.2x)\n", (p->op&REM_MORE)>0, p->op&REM_MORE);
+ printf("\t error=%d (0x%.2x)\n", (p->op&REM_ERROR)>0, p->op&REM_ERROR);
+ printf("\t op=%d (0x%.2x)\n", p->op&OP_MASK, p->op&OP_MASK);
+ printf("\tsequence: %d (0x%.2x)\n", ntohs(p->seq), ntohs(p->seq));
+ printf("\tstatus: %d (0x%.2x)\n", ntohs(p->status), ntohs(p->status));
+ printf("\tassoc: %d (0x%.2x)\n", ntohs(p->assoc), ntohs(p->assoc));
+ printf("\toffset: %d (0x%.2x)\n", ntohs(p->offset), ntohs(p->offset));
+ printf("\tcount: %d (0x%.2x)\n", ntohs(p->count), ntohs(p->count));
+ numpeers=ntohs(p->count)/(sizeof(ntp_assoc_status_pair));
+ if(p->op&REM_RESP && p->op&OP_READSTAT){
+ peer=(ntp_assoc_status_pair*)p->data;
+ for(i=0;i<numpeers;i++){
+ printf("\tpeer id %.2x status %.2x",
+ ntohs(peer[i].assoc), ntohs(peer[i].status));
+ if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){
+ printf(" <-- current sync source");
+ } else if(PEER_SEL(peer[i].status) >= PEER_INCLUDED){
+ printf(" <-- current sync candidate");
+ } else if(PEER_SEL(peer[i].status) >= PEER_TRUECHIMER){
+ printf(" <-- outlyer, but truechimer");
+ }
+ printf("\n");
+ }
+ }
+}
+
+void
+setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){
+ memset(p, 0, sizeof(ntp_control_message));
+ LI_SET(p->flags, LI_NOWARNING);
+ VN_SET(p->flags, VN_RESERVED);
+ MODE_SET(p->flags, MODE_CONTROLMSG);
+ OP_SET(p->op, opcode);
+ p->seq = htons(seq);
+ /* Remaining fields are zero for requests */
+}
+
+/* This function does all the actual work; roughly here's what it does
+ * beside setting the offset, jitter and stratum passed as argument:
+ * - offset can be negative, so if it cannot get the offset, offset_result
+ * is set to UNKNOWN, otherwise OK.
+ * - jitter and stratum are set to -1 if they cannot be retrieved so any
+ * positive value means a success retrieving the value.
+ * - status is set to WARNING if there's no sync.peer (otherwise OK) and is
+ * the return value of the function.
+ * status is pretty much useless as syncsource_found is a global variable
+ * used later in main to check is the server was synchronized. It works
+ * so I left it alone */
+int ntp_request(double *offset, int *offset_result, double *jitter, int *stratum, int *num_truechimers){
+ int conn=-1, i, npeers=0, num_candidates=0;
+ double tmp_offset = 0;
+ int min_peer_sel=PEER_INCLUDED;
+ int peers_size=0, peer_offset=0;
+ int status;
+ ntp_assoc_status_pair *peers=NULL;
+ ntp_control_message req;
+ const char *getvar = "stratum,offset,jitter";
+ char *data, *value, *nptr;
+ void *tmp;
+
+ status = STATE_OK;
+ *offset_result = STATE_UNKNOWN;
+ *jitter = *stratum = -1;
+ *num_truechimers = 0;
+
+ /* Long-winded explanation:
+ * Getting the sync peer offset, jitter and stratum requires a number of
+ * steps:
+ * 1) Send a READSTAT request.
+ * 2) Interpret the READSTAT reply
+ * a) The data section contains a list of peer identifiers (16 bits)
+ * and associated status words (16 bits)
+ * b) We want the value of 0x06 in the SEL (peer selection) value,
+ * which means "current synchronizatin source". If that's missing,
+ * we take anything better than 0x04 (see the rfc for details) but
+ * set a minimum of warning.
+ * 3) Send a READVAR request for information on each peer identified
+ * in 2b greater than the minimum selection value.
+ * 4) Extract the offset, jitter and stratum value from the data[]
+ * (it's ASCII)
+ */
+ my_udp_connect(server_address, port, &conn);
+
+ /* keep sending requests until the server stops setting the
+ * REM_MORE bit, though usually this is only 1 packet. */
+ do{
+ setup_control_request(&req, OP_READSTAT, 1);
+ DBG(printf("sending READSTAT request"));
+ write(conn, &req, SIZEOF_NTPCM(req));
+ DBG(print_ntp_control_message(&req));
+
+ do {
+ /* Attempt to read the largest size packet possible */
+ req.count=htons(MAX_CM_SIZE);
+ DBG(printf("receiving READSTAT response"))
+ if(read(conn, &req, SIZEOF_NTPCM(req)) == -1)
+ die(STATE_CRITICAL, "NTP CRITICAL: No response from NTP server\n");
+ DBG(print_ntp_control_message(&req));
+ /* discard obviously invalid packets */
+ if (ntohs(req.count) > MAX_CM_SIZE)
+ die(STATE_CRITICAL, "NTP CRITICAL: Invalid packet received from NTP server\n");
+ } while (!(req.op&OP_READSTAT && ntohs(req.seq) == 1));
+
+ if (LI(req.flags) == LI_ALARM) li_alarm = 1;
+ /* Each peer identifier is 4 bytes in the data section, which
+ * we represent as a ntp_assoc_status_pair datatype.
+ */
+ peers_size+=ntohs(req.count);
+ if((tmp=realloc(peers, peers_size)) == NULL)
+ free(peers), die(STATE_UNKNOWN, "can not (re)allocate 'peers' buffer\n");
+ peers=tmp;
+ memcpy((void*)((ptrdiff_t)peers+peer_offset), (void*)req.data, ntohs(req.count));
+ npeers=peers_size/sizeof(ntp_assoc_status_pair);
+ peer_offset+=ntohs(req.count);
+ } while(req.op&REM_MORE);
+
+ /* first, let's find out if we have a sync source, or if there are
+ * at least some candidates. In the latter case we'll issue
+ * a warning but go ahead with the check on them. */
+ for (i = 0; i < npeers; i++){
+ if(PEER_SEL(peers[i].status) >= PEER_TRUECHIMER){
+ (*num_truechimers)++;
+ if(PEER_SEL(peers[i].status) >= PEER_INCLUDED){
+ num_candidates++;
+ if(PEER_SEL(peers[i].status) >= PEER_SYNCSOURCE){
+ syncsource_found=1;
+ min_peer_sel=PEER_SYNCSOURCE;
+ }
+ }
+ }
+ }
+ if(verbose) printf("%d candidate peers available\n", num_candidates);
+ if(verbose && syncsource_found) printf("synchronization source found\n");
+ if(! syncsource_found){
+ status = STATE_WARNING;
+ if(verbose) printf("warning: no synchronization source found\n");
+ }
+ if(li_alarm){
+ status = STATE_WARNING;
+ if(verbose) printf("warning: LI_ALARM bit is set\n");
+ }
+
+
+ for (i = 0; i < npeers; i++){
+ /* Only query this server if it is the current sync source */
+ /* If there's no sync.peer, query all candidates and use the best one */
+ if (PEER_SEL(peers[i].status) >= min_peer_sel){
+ if(verbose) printf("Getting offset, jitter and stratum for peer %.2x\n", ntohs(peers[i].assoc));
+ xasprintf(&data, "");
+ do{
+ setup_control_request(&req, OP_READVAR, 2);
+ req.assoc = peers[i].assoc;
+ /* Putting the wanted variable names in the request
+ * cause the server to provide _only_ the requested values.
+ * thus reducing net traffic, guaranteeing us only a single
+ * datagram in reply, and making interpretation much simpler
+ */
+ /* Older servers doesn't know what jitter is, so if we get an
+ * error on the first pass we redo it with "dispersion" */
+ strncpy(req.data, getvar, MAX_CM_SIZE-1);
+ req.count = htons(strlen(getvar));
+ DBG(printf("sending READVAR request...\n"));
+ write(conn, &req, SIZEOF_NTPCM(req));
+ DBG(print_ntp_control_message(&req));
+
+ do {
+ req.count = htons(MAX_CM_SIZE);
+ DBG(printf("receiving READVAR response...\n"));
+ read(conn, &req, SIZEOF_NTPCM(req));
+ DBG(print_ntp_control_message(&req));
+ } while (!(req.op&OP_READVAR && ntohs(req.seq) == 2));
+
+ if(!(req.op&REM_ERROR))
+ xasprintf(&data, "%s%s", data, req.data);
+ } while(req.op&REM_MORE);
+
+ if(req.op&REM_ERROR) {
+ if(strstr(getvar, "jitter")) {
+ if(verbose) printf("The command failed. This is usually caused by servers refusing the 'jitter'\nvariable. Restarting with 'dispersion'...\n");
+ getvar = "stratum,offset,dispersion";
+ i--;
+ continue;
+ } else if(strlen(getvar)) {
+ if(verbose) printf("Server didn't like dispersion either; will retrieve everything\n");
+ getvar = "";
+ i--;
+ continue;
+ }
+ }
+
+ if(verbose > 1)
+ printf("Server responded: >>>%s<<<\n", data);
+
+ /* get the offset */
+ if(verbose)
+ printf("parsing offset from peer %.2x: ", ntohs(peers[i].assoc));
+
+ value = np_extract_ntpvar(data, "offset");
+ nptr=NULL;
+ /* Convert the value if we have one */
+ if(value != NULL)
+ tmp_offset = strtod(value, &nptr) / 1000;
+ /* If value is null or no conversion was performed */
+ if(value == NULL || value==nptr) {
+ if(verbose) printf("error: unable to read server offset response.\n");
+ } else {
+ if(verbose) printf("%.10g\n", tmp_offset);
+ if(*offset_result == STATE_UNKNOWN || fabs(tmp_offset) < fabs(*offset)) {
+ *offset = tmp_offset;
+ *offset_result = STATE_OK;
+ } else {
+ /* Skip this one; move to the next */
+ continue;
+ }
+ }
+
+ if(do_jitter) {
+ /* get the jitter */
+ if(verbose) {
+ printf("parsing %s from peer %.2x: ", strstr(getvar, "dispersion") != NULL ? "dispersion" : "jitter", ntohs(peers[i].assoc));
+ }
+ value = np_extract_ntpvar(data, strstr(getvar, "dispersion") != NULL ? "dispersion" : "jitter");
+ nptr=NULL;
+ /* Convert the value if we have one */
+ if(value != NULL)
+ *jitter = strtod(value, &nptr);
+ /* If value is null or no conversion was performed */
+ if(value == NULL || value==nptr) {
+ if(verbose) printf("error: unable to read server jitter/dispersion response.\n");
+ *jitter = -1;
+ } else if(verbose) {
+ printf("%.10g\n", *jitter);
+ }
+ }
+
+ if(do_stratum) {
+ /* get the stratum */
+ if(verbose) {
+ printf("parsing stratum from peer %.2x: ", ntohs(peers[i].assoc));
+ }
+ value = np_extract_ntpvar(data, "stratum");
+ nptr=NULL;
+ /* Convert the value if we have one */
+ if(value != NULL)
+ *stratum = strtol(value, &nptr, 10);
+ if(value == NULL || value==nptr) {
+ if(verbose) printf("error: unable to read server stratum response.\n");
+ *stratum = -1;
+ } else {
+ if(verbose) printf("%i\n", *stratum);
+ }
+ }
+ } /* if (PEER_SEL(peers[i].status) >= min_peer_sel) */
+ } /* for (i = 0; i < npeers; i++) */
+
+ close(conn);
+ if(peers!=NULL) free(peers);
+
+ return status;
+}
+
+int process_arguments(int argc, char **argv){
+ int c;
+ int option=0;
+ static struct option longopts[] = {
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"verbose", no_argument, 0, 'v'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"quiet", no_argument, 0, 'q'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"swarn", required_argument, 0, 'W'},
+ {"scrit", required_argument, 0, 'C'},
+ {"jwarn", required_argument, 0, 'j'},
+ {"jcrit", required_argument, 0, 'k'},
+ {"twarn", required_argument, 0, 'm'},
+ {"tcrit", required_argument, 0, 'n'},
+ {"timeout", required_argument, 0, 't'},
+ {"hostname", required_argument, 0, 'H'},
+ {"port", required_argument, 0, 'p'},
+ {0, 0, 0, 0}
+ };
+
+
+ if (argc < 2)
+ usage ("\n");
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vhv46qw:c:W:C:j:k:m:n:t:H:p:", longopts, &option);
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case 'h':
+ print_help();
+ exit(STATE_UNKNOWN);
+ break;
+ case 'V':
+ print_revision(progname, NP_VERSION);
+ exit(STATE_UNKNOWN);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'q':
+ quiet = 1;
+ break;
+ case 'w':
+ do_offset=1;
+ owarn = optarg;
+ break;
+ case 'c':
+ do_offset=1;
+ ocrit = optarg;
+ break;
+ case 'W':
+ do_stratum=1;
+ swarn = optarg;
+ break;
+ case 'C':
+ do_stratum=1;
+ scrit = optarg;
+ break;
+ case 'j':
+ do_jitter=1;
+ jwarn = optarg;
+ break;
+ case 'k':
+ do_jitter=1;
+ jcrit = optarg;
+ break;
+ case 'm':
+ do_truechimers=1;
+ twarn = optarg;
+ break;
+ case 'n':
+ do_truechimers=1;
+ tcrit = optarg;
+ break;
+ case 'H':
+ if(is_host(optarg) == FALSE)
+ usage2(_("Invalid hostname/address"), optarg);
+ server_address = strdup(optarg);
+ break;
+ case 'p':
+ port=atoi(optarg);
+ break;
+ case 't':
+ socket_timeout=atoi(optarg);
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case '?':
+ /* print short usage statement if args not parsable */
+ usage5 ();
+ break;
+ }
+ }
+
+ if(server_address == NULL){
+ usage4(_("Hostname was not supplied"));
+ }
+
+ return 0;
+}
+
+char *perfd_offset (double offset)
+{
+ return fperfdata ("offset", offset, "s",
+ TRUE, offset_thresholds->warning->end,
+ TRUE, offset_thresholds->critical->end,
+ FALSE, 0, FALSE, 0);
+}
+
+char *perfd_jitter (double jitter)
+{
+ return fperfdata ("jitter", jitter, "",
+ do_jitter, jitter_thresholds->warning->end,
+ do_jitter, jitter_thresholds->critical->end,
+ TRUE, 0, FALSE, 0);
+}
+
+char *perfd_stratum (int stratum)
+{
+ return perfdata ("stratum", stratum, "",
+ do_stratum, (int)stratum_thresholds->warning->end,
+ do_stratum, (int)stratum_thresholds->critical->end,
+ TRUE, 0, TRUE, 16);
+}
+
+char *perfd_truechimers (int num_truechimers)
+{
+ return perfdata ("truechimers", num_truechimers, "",
+ do_truechimers, (int)truechimer_thresholds->warning->end,
+ do_truechimers, (int)truechimer_thresholds->critical->end,
+ TRUE, 0, FALSE, 0);
+}
+
+int main(int argc, char *argv[]){
+ int result, offset_result, stratum, num_truechimers, oresult, jresult, sresult, tresult;
+ double offset=0, jitter=0;
+ char *result_line, *perfdata_line;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ set_thresholds(&offset_thresholds, owarn, ocrit);
+ set_thresholds(&jitter_thresholds, jwarn, jcrit);
+ set_thresholds(&stratum_thresholds, swarn, scrit);
+ set_thresholds(&truechimer_thresholds, twarn, tcrit);
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+
+ /* This returns either OK or WARNING (See comment preceding ntp_request) */
+ result = ntp_request(&offset, &offset_result, &jitter, &stratum, &num_truechimers);
+
+ if(offset_result == STATE_UNKNOWN) {
+ /* if there's no sync peer (this overrides ntp_request output): */
+ result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL);
+ } else {
+ /* Be quiet if there's no candidates either */
+ if (quiet == 1 && result == STATE_WARNING)
+ result = STATE_UNKNOWN;
+ result = max_state_alt(result, get_status(fabs(offset), offset_thresholds));
+ }
+ oresult = result;
+
+ if(do_truechimers) {
+ tresult = get_status(num_truechimers, truechimer_thresholds);
+ result = max_state_alt(result, tresult);
+ }
+
+ if(do_stratum) {
+ sresult = get_status(stratum, stratum_thresholds);
+ result = max_state_alt(result, sresult);
+ }
+
+ if(do_jitter) {
+ jresult = get_status(jitter, jitter_thresholds);
+ result = max_state_alt(result, jresult);
+ }
+
+ switch (result) {
+ case STATE_CRITICAL :
+ xasprintf(&result_line, _("NTP CRITICAL:"));
+ break;
+ case STATE_WARNING :
+ xasprintf(&result_line, _("NTP WARNING:"));
+ break;
+ case STATE_OK :
+ xasprintf(&result_line, _("NTP OK:"));
+ break;
+ default :
+ xasprintf(&result_line, _("NTP UNKNOWN:"));
+ break;
+ }
+ if(!syncsource_found)
+ xasprintf(&result_line, "%s %s,", result_line, _("Server not synchronized"));
+ else if(li_alarm)
+ xasprintf(&result_line, "%s %s,", result_line, _("Server has the LI_ALARM bit set"));
+
+ if(offset_result == STATE_UNKNOWN){
+ xasprintf(&result_line, "%s %s", result_line, _("Offset unknown"));
+ xasprintf(&perfdata_line, "");
+ } else if (oresult == STATE_WARNING) {
+ xasprintf(&result_line, "%s %s %.10g secs (WARNING)", result_line, _("Offset"), offset);
+ } else if (oresult == STATE_CRITICAL) {
+ xasprintf(&result_line, "%s %s %.10g secs (CRITICAL)", result_line, _("Offset"), offset);
+ } else {
+ xasprintf(&result_line, "%s %s %.10g secs", result_line, _("Offset"), offset);
+ }
+ xasprintf(&perfdata_line, "%s", perfd_offset(offset));
+
+ if (do_jitter) {
+ if (jresult == STATE_WARNING) {
+ xasprintf(&result_line, "%s, jitter=%f (WARNING)", result_line, jitter);
+ } else if (jresult == STATE_CRITICAL) {
+ xasprintf(&result_line, "%s, jitter=%f (CRITICAL)", result_line, jitter);
+ } else {
+ xasprintf(&result_line, "%s, jitter=%f", result_line, jitter);
+ }
+ xasprintf(&perfdata_line, "%s %s", perfdata_line, perfd_jitter(jitter));
+ }
+ if (do_stratum) {
+ if (sresult == STATE_WARNING) {
+ xasprintf(&result_line, "%s, stratum=%i (WARNING)", result_line, stratum);
+ } else if (sresult == STATE_CRITICAL) {
+ xasprintf(&result_line, "%s, stratum=%i (CRITICAL)", result_line, stratum);
+ } else {
+ xasprintf(&result_line, "%s, stratum=%i", result_line, stratum);
+ }
+ xasprintf(&perfdata_line, "%s %s", perfdata_line, perfd_stratum(stratum));
+ }
+ if (do_truechimers) {
+ if (tresult == STATE_WARNING) {
+ xasprintf(&result_line, "%s, truechimers=%i (WARNING)", result_line, num_truechimers);
+ } else if (tresult == STATE_CRITICAL) {
+ xasprintf(&result_line, "%s, truechimers=%i (CRITICAL)", result_line, num_truechimers);
+ } else {
+ xasprintf(&result_line, "%s, truechimers=%i", result_line, num_truechimers);
+ }
+ xasprintf(&perfdata_line, "%s %s", perfdata_line, perfd_truechimers(num_truechimers));
+ }
+ printf("%s|%s\n", result_line, perfdata_line);
+
+ if(server_address!=NULL) free(server_address);
+ return result;
+}
+
+void print_help(void){
+ print_revision(progname, NP_VERSION);
+
+ printf ("Copyright (c) 2006 Sean Finney\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin checks the selected ntp server"));
+
+ printf ("\n\n");
+
+ print_usage();
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+ printf (UT_IPv46);
+ printf (UT_HOST_PORT, 'p', "123");
+ printf (" %s\n", "-q, --quiet");
+ printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"));
+ printf (" %s\n", "-w, --warning=THRESHOLD");
+ printf (" %s\n", _("Offset to result in warning status (seconds)"));
+ printf (" %s\n", "-c, --critical=THRESHOLD");
+ printf (" %s\n", _("Offset to result in critical status (seconds)"));
+ printf (" %s\n", "-W, --swarn=THRESHOLD");
+ printf (" %s\n", _("Warning threshold for stratum of server's synchronization peer"));
+ printf (" %s\n", "-C, --scrit=THRESHOLD");
+ printf (" %s\n", _("Critical threshold for stratum of server's synchronization peer"));
+ printf (" %s\n", "-j, --jwarn=THRESHOLD");
+ printf (" %s\n", _("Warning threshold for jitter"));
+ printf (" %s\n", "-k, --jcrit=THRESHOLD");
+ printf (" %s\n", _("Critical threshold for jitter"));
+ printf (" %s\n", "-m, --twarn=THRESHOLD");
+ printf (" %s\n", _("Warning threshold for number of usable time sources (\"truechimers\")"));
+ printf (" %s\n", "-n, --tcrit=THRESHOLD");
+ printf (" %s\n", _("Critical threshold for number of usable time sources (\"truechimers\")"));
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (UT_VERBOSE);
+
+ printf("\n");
+ printf("%s\n", _("This plugin checks an NTP server independent of any commandline"));
+ printf("%s\n\n", _("programs or external libraries."));
+
+ printf("%s\n", _("Notes:"));
+ printf(" %s\n", _("Use this plugin to check the health of an NTP server. It supports"));
+ printf(" %s\n", _("checking the offset with the sync peer, the jitter and stratum. This"));
+ printf(" %s\n", _("plugin will not check the clock offset between the local host and NTP"));
+ printf(" %s\n", _("server; please use check_ntp_time for that purpose."));
+ printf("\n");
+ printf(UT_THRESHOLDS_NOTES);
+
+ printf("\n");
+ printf("%s\n", _("Examples:"));
+ printf(" %s\n", _("Simple NTP server check:"));
+ printf(" %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1"));
+ printf("\n");
+ printf(" %s\n", _("Check jitter too, avoiding critical notifications if jitter isn't available"));
+ printf(" %s\n", _("(See Notes above for more details on thresholds formats):"));
+ printf(" %s\n", ("./check_ntp_peer -H ntpserv -w 0.5 -c 1 -j -1:100 -k -1:200"));
+ printf("\n");
+ printf(" %s\n", _("Only check the number of usable time sources (\"truechimers\"):"));
+ printf(" %s\n", ("./check_ntp_peer -H ntpserv -m @5 -n @3"));
+ printf("\n");
+ printf(" %s\n", _("Check only stratum:"));
+ printf(" %s\n", ("./check_ntp_peer -H ntpserv -W 4 -C 6"));
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage(void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf(" %s -H <host> [-4|-6] [-w <warn>] [-c <crit>] [-W <warn>] [-C <crit>]\n", progname);
+ printf(" [-j <warn>] [-k <crit>] [-v verbose]\n");
+}
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
new file mode 100644
index 0000000..46cc604
--- /dev/null
+++ b/plugins/check_ntp_time.c
@@ -0,0 +1,654 @@
+/*****************************************************************************
+*
+* Monitoring check_ntp_time plugin
+*
+* License: GPL
+* Copyright (c) 2006 Sean Finney <seanius@seanius.net>
+* Copyright (c) 2006-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_ntp_time plugin
+*
+* This plugin checks the clock offset between the local host and a
+* remote NTP server. It is independent of any commandline programs or
+* external libraries.
+*
+* If you'd rather want to monitor an NTP server, please use
+* check_ntp_peer.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_ntp_time";
+const char *copyright = "2006-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+static char *server_address=NULL;
+static char *port="123";
+static int verbose=0;
+static int quiet=0;
+static char *owarn="60";
+static char *ocrit="120";
+static int time_offset=0;
+
+int process_arguments (int, char **);
+thresholds *offset_thresholds = NULL;
+void print_help (void);
+void print_usage (void);
+
+/* number of times to perform each request to get a good average. */
+#ifndef AVG_NUM
+#define AVG_NUM 4
+#endif
+
+/* max size of control message data */
+#define MAX_CM_SIZE 468
+
+/* this structure holds everything in an ntp request/response as per rfc1305 */
+typedef struct {
+ uint8_t flags; /* byte with leapindicator,vers,mode. see macros */
+ uint8_t stratum; /* clock stratum */
+ int8_t poll; /* polling interval */
+ int8_t precision; /* precision of the local clock */
+ int32_t rtdelay; /* total rt delay, as a fixed point num. see macros */
+ uint32_t rtdisp; /* like above, but for max err to primary src */
+ uint32_t refid; /* ref clock identifier */
+ uint64_t refts; /* reference timestamp. local time local clock */
+ uint64_t origts; /* time at which request departed client */
+ uint64_t rxts; /* time at which request arrived at server */
+ uint64_t txts; /* time at which request departed server */
+} ntp_message;
+
+/* this structure holds data about results from querying offset from a peer */
+typedef struct {
+ time_t waiting; /* ts set when we started waiting for a response */
+ int num_responses; /* number of successfully received responses */
+ uint8_t stratum; /* copied verbatim from the ntp_message */
+ double rtdelay; /* converted from the ntp_message */
+ double rtdisp; /* converted from the ntp_message */
+ double offset[AVG_NUM]; /* offsets from each response */
+ uint8_t flags; /* byte with leapindicator,vers,mode. see macros */
+} ntp_server_results;
+
+/* bits 1,2 are the leap indicator */
+#define LI_MASK 0xc0
+#define LI(x) ((x&LI_MASK)>>6)
+#define LI_SET(x,y) do{ x |= ((y<<6)&LI_MASK); }while(0)
+/* and these are the values of the leap indicator */
+#define LI_NOWARNING 0x00
+#define LI_EXTRASEC 0x01
+#define LI_MISSINGSEC 0x02
+#define LI_ALARM 0x03
+/* bits 3,4,5 are the ntp version */
+#define VN_MASK 0x38
+#define VN(x) ((x&VN_MASK)>>3)
+#define VN_SET(x,y) do{ x |= ((y<<3)&VN_MASK); }while(0)
+#define VN_RESERVED 0x02
+/* bits 6,7,8 are the ntp mode */
+#define MODE_MASK 0x07
+#define MODE(x) (x&MODE_MASK)
+#define MODE_SET(x,y) do{ x |= (y&MODE_MASK); }while(0)
+/* here are some values */
+#define MODE_CLIENT 0x03
+#define MODE_CONTROLMSG 0x06
+/* In control message, bits 8-10 are R,E,M bits */
+#define REM_MASK 0xe0
+#define REM_RESP 0x80
+#define REM_ERROR 0x40
+#define REM_MORE 0x20
+/* In control message, bits 11 - 15 are opcode */
+#define OP_MASK 0x1f
+#define OP_SET(x,y) do{ x |= (y&OP_MASK); }while(0)
+#define OP_READSTAT 0x01
+#define OP_READVAR 0x02
+/* In peer status bytes, bits 6,7,8 determine clock selection status */
+#define PEER_SEL(x) ((ntohs(x)>>8)&0x07)
+#define PEER_INCLUDED 0x04
+#define PEER_SYNCSOURCE 0x06
+
+/**
+ ** a note about the 32-bit "fixed point" numbers:
+ **
+ they are divided into halves, each being a 16-bit int in network byte order:
+ - the first 16 bits are an int on the left side of a decimal point.
+ - the second 16 bits represent a fraction n/(2^16)
+ likewise for the 64-bit "fixed point" numbers with everything doubled :)
+ **/
+
+/* macros to access the left/right 16 bits of a 32-bit ntp "fixed point"
+ number. note that these can be used as lvalues too */
+#define L16(x) (((uint16_t*)&x)[0])
+#define R16(x) (((uint16_t*)&x)[1])
+/* macros to access the left/right 32 bits of a 64-bit ntp "fixed point"
+ number. these too can be used as lvalues */
+#define L32(x) (((uint32_t*)&x)[0])
+#define R32(x) (((uint32_t*)&x)[1])
+
+/* ntp wants seconds since 1/1/00, epoch is 1/1/70. this is the difference */
+#define EPOCHDIFF 0x83aa7e80UL
+
+/* extract a 32-bit ntp fixed point number into a double */
+#define NTP32asDOUBLE(x) (ntohs(L16(x)) + (double)ntohs(R16(x))/65536.0)
+
+/* likewise for a 64-bit ntp fp number */
+#define NTP64asDOUBLE(n) (double)(((uint64_t)n)?\
+ (ntohl(L32(n))-EPOCHDIFF) + \
+ (.00000001*(0.5+(double)(ntohl(R32(n))/42.94967296))):\
+ 0)
+
+/* convert a struct timeval to a double */
+#define TVasDOUBLE(x) (double)(x.tv_sec+(0.000001*x.tv_usec))
+
+/* convert an ntp 64-bit fp number to a struct timeval */
+#define NTP64toTV(n,t) \
+ do{ if(!n) t.tv_sec = t.tv_usec = 0; \
+ else { \
+ t.tv_sec=ntohl(L32(n))-EPOCHDIFF; \
+ t.tv_usec=(int)(0.5+(double)(ntohl(R32(n))/4294.967296)); \
+ } \
+ }while(0)
+
+/* convert a struct timeval to an ntp 64-bit fp number */
+#define TVtoNTP64(t,n) \
+ do{ if(!t.tv_usec && !t.tv_sec) n=0x0UL; \
+ else { \
+ L32(n)=htonl(t.tv_sec + EPOCHDIFF); \
+ R32(n)=htonl((uint64_t)((4294.967296*t.tv_usec)+.5)); \
+ } \
+ } while(0)
+
+/* NTP control message header is 12 bytes, plus any data in the data
+ * field, plus null padding to the nearest 32-bit boundary per rfc.
+ */
+#define SIZEOF_NTPCM(m) (12+ntohs(m.count)+((m.count)?4-(ntohs(m.count)%4):0))
+
+/* finally, a little helper or two for debugging: */
+#define DBG(x) do{if(verbose>1){ x; }}while(0);
+#define PRINTSOCKADDR(x) \
+ do{ \
+ printf("%u.%u.%u.%u", (x>>24)&0xff, (x>>16)&0xff, (x>>8)&0xff, x&0xff);\
+ }while(0);
+
+/* calculate the offset of the local clock */
+static inline double calc_offset(const ntp_message *m, const struct timeval *t){
+ double client_tx, peer_rx, peer_tx, client_rx;
+ client_tx = NTP64asDOUBLE(m->origts);
+ peer_rx = NTP64asDOUBLE(m->rxts);
+ peer_tx = NTP64asDOUBLE(m->txts);
+ client_rx=TVasDOUBLE((*t));
+ return (.5*((peer_tx-client_rx)+(peer_rx-client_tx)));
+}
+
+/* print out a ntp packet in human readable/debuggable format */
+void print_ntp_message(const ntp_message *p){
+ struct timeval ref, orig, rx, tx;
+
+ NTP64toTV(p->refts,ref);
+ NTP64toTV(p->origts,orig);
+ NTP64toTV(p->rxts,rx);
+ NTP64toTV(p->txts,tx);
+
+ printf("packet contents:\n");
+ printf("\tflags: 0x%.2x\n", p->flags);
+ printf("\t li=%d (0x%.2x)\n", LI(p->flags), p->flags&LI_MASK);
+ printf("\t vn=%d (0x%.2x)\n", VN(p->flags), p->flags&VN_MASK);
+ printf("\t mode=%d (0x%.2x)\n", MODE(p->flags), p->flags&MODE_MASK);
+ printf("\tstratum = %d\n", p->stratum);
+ printf("\tpoll = %g\n", pow(2, p->poll));
+ printf("\tprecision = %g\n", pow(2, p->precision));
+ printf("\trtdelay = %-.16g\n", NTP32asDOUBLE(p->rtdelay));
+ printf("\trtdisp = %-.16g\n", NTP32asDOUBLE(p->rtdisp));
+ printf("\trefid = %x\n", p->refid);
+ printf("\trefts = %-.16g\n", NTP64asDOUBLE(p->refts));
+ printf("\torigts = %-.16g\n", NTP64asDOUBLE(p->origts));
+ printf("\trxts = %-.16g\n", NTP64asDOUBLE(p->rxts));
+ printf("\ttxts = %-.16g\n", NTP64asDOUBLE(p->txts));
+}
+
+void setup_request(ntp_message *p){
+ struct timeval t;
+
+ memset(p, 0, sizeof(ntp_message));
+ LI_SET(p->flags, LI_ALARM);
+ VN_SET(p->flags, 4);
+ MODE_SET(p->flags, MODE_CLIENT);
+ p->poll=4;
+ p->precision=(int8_t)0xfa;
+ L16(p->rtdelay)=htons(1);
+ L16(p->rtdisp)=htons(1);
+
+ gettimeofday(&t, NULL);
+ TVtoNTP64(t,p->txts);
+}
+
+/* select the "best" server from a list of servers, and return its index.
+ * this is done by filtering servers based on stratum, dispersion, and
+ * finally round-trip delay. */
+int best_offset_server(const ntp_server_results *slist, int nservers){
+ int cserver=0, best_server=-1;
+
+ /* for each server */
+ for(cserver=0; cserver<nservers; cserver++){
+ /* We don't want any servers that fails these tests */
+ /* Sort out servers that didn't respond or responede with a 0 stratum;
+ * stratum 0 is for reference clocks so no NTP server should ever report
+ * a stratum 0 */
+ if ( slist[cserver].stratum == 0){
+ if (verbose) printf("discarding peer %d: stratum=%d\n", cserver, slist[cserver].stratum);
+ continue;
+ }
+ /* Sort out servers with error flags */
+ if ( LI(slist[cserver].flags) == LI_ALARM ){
+ if (verbose) printf("discarding peer %d: flags=%d\n", cserver, LI(slist[cserver].flags));
+ continue;
+ }
+
+ /* If we don't have a server yet, use the first one */
+ if (best_server == -1) {
+ best_server = cserver;
+ DBG(printf("using peer %d as our first candidate\n", best_server));
+ continue;
+ }
+
+ /* compare the server to the best one we've seen so far */
+ /* does it have an equal or better stratum? */
+ DBG(printf("comparing peer %d with peer %d\n", cserver, best_server));
+ if(slist[cserver].stratum <= slist[best_server].stratum){
+ DBG(printf("stratum for peer %d <= peer %d\n", cserver, best_server));
+ /* does it have an equal or better dispersion? */
+ if(slist[cserver].rtdisp <= slist[best_server].rtdisp){
+ DBG(printf("dispersion for peer %d <= peer %d\n", cserver, best_server));
+ /* does it have a better rtdelay? */
+ if(slist[cserver].rtdelay < slist[best_server].rtdelay){
+ DBG(printf("rtdelay for peer %d < peer %d\n", cserver, best_server));
+ best_server = cserver;
+ DBG(printf("peer %d is now our best candidate\n", best_server));
+ }
+ }
+ }
+ }
+
+ if(best_server >= 0) {
+ DBG(printf("best server selected: peer %d\n", best_server));
+ return best_server;
+ } else {
+ DBG(printf("no peers meeting synchronization criteria :(\n"));
+ return -1;
+ }
+}
+
+/* do everything we need to get the total average offset
+ * - we use a certain amount of parallelization with poll() to ensure
+ * we don't waste time sitting around waiting for single packets.
+ * - we also "manually" handle resolving host names and connecting, because
+ * we have to do it in a way that our lazy macros don't handle currently :( */
+double offset_request(const char *host, int *status){
+ int i=0, j=0, ga_result=0, num_hosts=0, *socklist=NULL, respnum=0;
+ int servers_completed=0, one_read=0, servers_readable=0, best_index=-1;
+ time_t now_time=0, start_ts=0;
+ ntp_message *req=NULL;
+ double avg_offset=0.;
+ struct timeval recv_time;
+ struct addrinfo *ai=NULL, *ai_tmp=NULL, hints;
+ struct pollfd *ufds=NULL;
+ ntp_server_results *servers=NULL;
+
+ /* setup hints to only return results from getaddrinfo that we'd like */
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = address_family;
+ hints.ai_protocol = IPPROTO_UDP;
+ hints.ai_socktype = SOCK_DGRAM;
+
+ /* fill in ai with the list of hosts resolved by the host name */
+ ga_result = getaddrinfo(host, port, &hints, &ai);
+ if(ga_result!=0){
+ die(STATE_UNKNOWN, "error getting address for %s: %s\n",
+ host, gai_strerror(ga_result));
+ }
+
+ /* count the number of returned hosts, and allocate stuff accordingly */
+ for(ai_tmp=ai; ai_tmp!=NULL; ai_tmp=ai_tmp->ai_next){ num_hosts++; }
+ req=(ntp_message*)malloc(sizeof(ntp_message)*num_hosts);
+ if(req==NULL) die(STATE_UNKNOWN, "can not allocate ntp message array");
+ socklist=(int*)malloc(sizeof(int)*num_hosts);
+ if(socklist==NULL) die(STATE_UNKNOWN, "can not allocate socket array");
+ ufds=(struct pollfd*)malloc(sizeof(struct pollfd)*num_hosts);
+ if(ufds==NULL) die(STATE_UNKNOWN, "can not allocate socket array");
+ servers=(ntp_server_results*)malloc(sizeof(ntp_server_results)*num_hosts);
+ if(servers==NULL) die(STATE_UNKNOWN, "can not allocate server array");
+ memset(servers, 0, sizeof(ntp_server_results)*num_hosts);
+ DBG(printf("Found %d peers to check\n", num_hosts));
+
+ /* setup each socket for writing, and the corresponding struct pollfd */
+ ai_tmp=ai;
+ for(i=0;ai_tmp;i++){
+ socklist[i]=socket(ai_tmp->ai_family, SOCK_DGRAM, IPPROTO_UDP);
+ if(socklist[i] == -1) {
+ perror(NULL);
+ die(STATE_UNKNOWN, "can not create new socket");
+ }
+ if(connect(socklist[i], ai_tmp->ai_addr, ai_tmp->ai_addrlen)){
+ /* don't die here, because it is enough if there is one server
+ answering in time. This also would break for dual ipv4/6 stacked
+ ntp servers when the client only supports on of them.
+ */
+ DBG(printf("can't create socket connection on peer %i: %s\n", i, strerror(errno)));
+ } else {
+ ufds[i].fd=socklist[i];
+ ufds[i].events=POLLIN;
+ ufds[i].revents=0;
+ }
+ ai_tmp = ai_tmp->ai_next;
+ }
+
+ /* now do AVG_NUM checks to each host. We stop before timeout/2 seconds
+ * have passed in order to ensure post-processing and jitter time. */
+ now_time=start_ts=time(NULL);
+ while(servers_completed<num_hosts && now_time-start_ts <= socket_timeout/2){
+ /* loop through each server and find each one which hasn't
+ * been touched in the past second or so and is still lacking
+ * some responses. For each of these servers, send a new request,
+ * and update the "waiting" timestamp with the current time. */
+ now_time=time(NULL);
+
+ for(i=0; i<num_hosts; i++){
+ if(servers[i].waiting<now_time && servers[i].num_responses<AVG_NUM){
+ if(verbose && servers[i].waiting != 0) printf("re-");
+ if(verbose) printf("sending request to peer %d\n", i);
+ setup_request(&req[i]);
+ write(socklist[i], &req[i], sizeof(ntp_message));
+ servers[i].waiting=now_time;
+ break;
+ }
+ }
+
+ /* quickly poll for any sockets with pending data */
+ servers_readable=poll(ufds, num_hosts, 100);
+ if(servers_readable==-1){
+ perror("polling ntp sockets");
+ die(STATE_UNKNOWN, "communication errors");
+ }
+
+ /* read from any sockets with pending data */
+ for(i=0; servers_readable && i<num_hosts; i++){
+ if(ufds[i].revents&POLLIN && servers[i].num_responses < AVG_NUM){
+ if(verbose) {
+ printf("response from peer %d: ", i);
+ }
+
+ read(ufds[i].fd, &req[i], sizeof(ntp_message));
+ gettimeofday(&recv_time, NULL);
+ DBG(print_ntp_message(&req[i]));
+ respnum=servers[i].num_responses++;
+ servers[i].offset[respnum]=calc_offset(&req[i], &recv_time)+time_offset;
+ if(verbose) {
+ printf("offset %.10g\n", servers[i].offset[respnum]);
+ }
+ servers[i].stratum=req[i].stratum;
+ servers[i].rtdisp=NTP32asDOUBLE(req[i].rtdisp);
+ servers[i].rtdelay=NTP32asDOUBLE(req[i].rtdelay);
+ servers[i].waiting=0;
+ servers[i].flags=req[i].flags;
+ servers_readable--;
+ one_read = 1;
+ if(servers[i].num_responses==AVG_NUM) servers_completed++;
+ }
+ }
+ /* lather, rinse, repeat. */
+ }
+
+ if (one_read == 0) {
+ die(STATE_CRITICAL, "NTP CRITICAL: No response from NTP server\n");
+ }
+
+ /* now, pick the best server from the list */
+ best_index=best_offset_server(servers, num_hosts);
+ if(best_index < 0){
+ *status=STATE_UNKNOWN;
+ } else {
+ /* finally, calculate the average offset */
+ for(i=0; i<servers[best_index].num_responses;i++){
+ avg_offset+=servers[best_index].offset[i];
+ }
+ avg_offset/=servers[best_index].num_responses;
+ }
+
+ /* cleanup */
+ for(j=0; j<num_hosts; j++){ close(socklist[j]); }
+ free(socklist);
+ free(ufds);
+ free(servers);
+ free(req);
+ freeaddrinfo(ai);
+
+ if(verbose) printf("overall average offset: %.10g\n", avg_offset);
+ return avg_offset;
+}
+
+int process_arguments(int argc, char **argv){
+ int c;
+ int option=0;
+ static struct option longopts[] = {
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"verbose", no_argument, 0, 'v'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"quiet", no_argument, 0, 'q'},
+ {"time-offset", optional_argument, 0, 'o'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"timeout", required_argument, 0, 't'},
+ {"hostname", required_argument, 0, 'H'},
+ {"port", required_argument, 0, 'p'},
+ {0, 0, 0, 0}
+ };
+
+
+ if (argc < 2)
+ usage ("\n");
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vhv46qw:c:t:H:p:o:", longopts, &option);
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case 'h':
+ print_help();
+ exit(STATE_UNKNOWN);
+ break;
+ case 'V':
+ print_revision(progname, NP_VERSION);
+ exit(STATE_UNKNOWN);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'q':
+ quiet = 1;
+ break;
+ case 'w':
+ owarn = optarg;
+ break;
+ case 'c':
+ ocrit = optarg;
+ break;
+ case 'H':
+ if(is_host(optarg) == FALSE)
+ usage2(_("Invalid hostname/address"), optarg);
+ server_address = strdup(optarg);
+ break;
+ case 'p':
+ port = strdup(optarg);
+ break;
+ case 't':
+ socket_timeout=atoi(optarg);
+ break;
+ case 'o':
+ time_offset=atoi(optarg);
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case '?':
+ /* print short usage statement if args not parsable */
+ usage5 ();
+ break;
+ }
+ }
+
+ if(server_address == NULL){
+ usage4(_("Hostname was not supplied"));
+ }
+
+ return 0;
+}
+
+char *perfd_offset (double offset)
+{
+ return fperfdata ("offset", offset, "s",
+ TRUE, offset_thresholds->warning->end,
+ TRUE, offset_thresholds->critical->end,
+ FALSE, 0, FALSE, 0);
+}
+
+int main(int argc, char *argv[]){
+ int result, offset_result;
+ double offset=0;
+ char *result_line, *perfdata_line;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ result = offset_result = STATE_OK;
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ set_thresholds(&offset_thresholds, owarn, ocrit);
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+
+ offset = offset_request(server_address, &offset_result);
+ if (offset_result == STATE_UNKNOWN) {
+ result = (quiet == 1 ? STATE_UNKNOWN : STATE_CRITICAL);
+ } else {
+ result = get_status(fabs(offset), offset_thresholds);
+ }
+
+ switch (result) {
+ case STATE_CRITICAL :
+ xasprintf(&result_line, _("NTP CRITICAL:"));
+ break;
+ case STATE_WARNING :
+ xasprintf(&result_line, _("NTP WARNING:"));
+ break;
+ case STATE_OK :
+ xasprintf(&result_line, _("NTP OK:"));
+ break;
+ default :
+ xasprintf(&result_line, _("NTP UNKNOWN:"));
+ break;
+ }
+ if(offset_result == STATE_UNKNOWN){
+ xasprintf(&result_line, "%s %s", result_line, _("Offset unknown"));
+ xasprintf(&perfdata_line, "");
+ } else {
+ xasprintf(&result_line, "%s %s %.10g secs", result_line, _("Offset"), offset);
+ xasprintf(&perfdata_line, "%s", perfd_offset(offset));
+ }
+ printf("%s|%s\n", result_line, perfdata_line);
+
+ if(server_address!=NULL) free(server_address);
+ return result;
+}
+
+void print_help(void){
+ print_revision(progname, NP_VERSION);
+
+ printf ("Copyright (c) 2006 Sean Finney\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin checks the clock offset with the ntp server"));
+
+ printf ("\n\n");
+
+ print_usage();
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+ printf (UT_IPv46);
+ printf (UT_HOST_PORT, 'p', "123");
+ printf (" %s\n", "-q, --quiet");
+ printf (" %s\n", _("Returns UNKNOWN instead of CRITICAL if offset cannot be found"));
+ printf (" %s\n", "-w, --warning=THRESHOLD");
+ printf (" %s\n", _("Offset to result in warning status (seconds)"));
+ printf (" %s\n", "-c, --critical=THRESHOLD");
+ printf (" %s\n", _("Offset to result in critical status (seconds)"));
+ printf (" %s\n", "-o, --time_offset=INTEGER");
+ printf (" %s\n", _("Expected offset of the ntp server relative to local server (seconds)"));
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (UT_VERBOSE);
+
+ printf("\n");
+ printf("%s\n", _("This plugin checks the clock offset between the local host and a"));
+ printf("%s\n", _("remote NTP server. It is independent of any commandline programs or"));
+ printf("%s\n", _("external libraries."));
+
+ printf("\n");
+ printf("%s\n", _("Notes:"));
+ printf(" %s\n", _("If you'd rather want to monitor an NTP server, please use"));
+ printf(" %s\n", _("check_ntp_peer."));
+ printf(" %s\n", _("--time-offset is useful for compensating for servers with known"));
+ printf(" %s\n", _("and expected clock skew."));
+ printf("\n");
+ printf(UT_THRESHOLDS_NOTES);
+
+ printf("\n");
+ printf("%s\n", _("Examples:"));
+ printf(" %s\n", ("./check_ntp_time -H ntpserv -w 0.5 -c 1"));
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage(void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf(" %s -H <host> [-4|-6] [-w <warn>] [-c <crit>] [-v verbose] [-o <time offset>]\n", progname);
+}
+
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
new file mode 100644
index 0000000..3c9d23e
--- /dev/null
+++ b/plugins/check_nwstat.c
@@ -0,0 +1,1687 @@
+/*****************************************************************************
+*
+* Monitoring check_nwstat plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_nwstat plugin
+*
+* This plugin attempts to contact the MRTGEXT NLM running on a
+* Novell server to gather the requested system information.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_nwstat";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+enum checkvar {
+ NONE,
+ LOAD1, /* check 1 minute CPU load */
+ LOAD5, /* check 5 minute CPU load */
+ LOAD15, /* check 15 minute CPU load */
+ CONNS, /* check number of connections */
+ VPF, /* check % free space on volume */
+ VMF, /* check MB free space on volume */
+ VMU, /* check MB used space on volume */
+ VMP, /* check MB purgeable space on volume */
+ VKF, /* check KB free space on volume */
+ LTCH, /* check long-term cache hit percentage */
+ CBUFF, /* check total cache buffers */
+ CDBUFF, /* check dirty cache buffers */
+ LRUM, /* check LRU sitting time in minutes */
+ DSDB, /* check to see if DS Database is open */
+ LOGINS, /* check to see if logins are enabled */
+ NRMH, /* check to see NRM Health Status */
+ PUPRB, /* check % of used packet receive buffers */
+ UPRB, /* check used packet receive buffers */
+ SAPENTRIES, /* check SAP entries */
+ OFILES, /* check number of open files */
+ VKP, /* check KB purgeable space on volume */
+ VPP, /* check % purgeable space on volume */
+ VKNP, /* check KB not yet purgeable space on volume */
+ VPNP, /* check % not yet purgeable space on volume */
+ ABENDS, /* check abended thread count */
+ CSPROCS, /* check number of current service processes */
+ TSYNC, /* check timesync status 0=no 1=yes in sync to the network */
+ LRUS, /* check LRU sitting time in seconds */
+ DCB, /* check dirty cache buffers as a percentage of the total */
+ TCB, /* check total cache buffers as a percentage of the original */
+ DSVER, /* check NDS version */
+ UPTIME, /* check server uptime */
+ NLM, /* check NLM loaded */
+ NRMP, /* check NRM Process Values */
+ NRMM, /* check NRM Memory Values */
+ NRMS, /* check NRM Values */
+ NSS1, /* check Statistics from _Admin:Manage_NSS\GeneralStats.xml */
+ NSS2, /* check Statistics from _Admin:Manage_NSS\BufferCache.xml */
+ NSS3, /* check statistics from _Admin:Manage_NSS\NameCache.xml */
+ NSS4, /* check statistics from _Admin:Manage_NSS\FileStats.xml */
+ NSS5, /* check statistics from _Admin:Manage_NSS\ObjectCache.xml */
+ NSS6, /* check statistics from _Admin:Manage_NSS\Thread.xml */
+ NSS7 /* check statistics from _Admin:Manage_NSS\AuthorizationCache.xml */
+};
+
+enum {
+ PORT = 9999
+};
+
+char *server_address=NULL;
+char *volume_name=NULL;
+char *nlm_name=NULL;
+char *nrmp_name=NULL;
+char *nrmm_name=NULL;
+char *nrms_name=NULL;
+char *nss1_name=NULL;
+char *nss2_name=NULL;
+char *nss3_name=NULL;
+char *nss4_name=NULL;
+char *nss5_name=NULL;
+char *nss6_name=NULL;
+char *nss7_name=NULL;
+int server_port=PORT;
+unsigned long warning_value=0L;
+unsigned long critical_value=0L;
+int check_warning_value=FALSE;
+int check_critical_value=FALSE;
+int check_netware_version=FALSE;
+enum checkvar vars_to_check = NONE;
+int sap_number=-1;
+
+int process_arguments(int, char **);
+void print_help(void);
+void print_usage(void);
+
+
+
+int
+main(int argc, char **argv) {
+ int result = STATE_UNKNOWN;
+ int sd;
+ char *send_buffer=NULL;
+ char recv_buffer[MAX_INPUT_BUFFER];
+ char *output_message=NULL;
+ char *temp_buffer=NULL;
+ char *netware_version=NULL;
+
+ int time_sync_status=0;
+ int nrm_health_status=0;
+ unsigned long total_cache_buffers=0;
+ unsigned long dirty_cache_buffers=0;
+ unsigned long open_files=0;
+ unsigned long abended_threads=0;
+ unsigned long max_service_processes=0;
+ unsigned long current_service_processes=0;
+ unsigned long free_disk_space=0L;
+ unsigned long nrmp_value=0L;
+ unsigned long nrmm_value=0L;
+ unsigned long nrms_value=0L;
+ unsigned long nss1_value=0L;
+ unsigned long nss2_value=0L;
+ unsigned long nss3_value=0L;
+ unsigned long nss4_value=0L;
+ unsigned long nss5_value=0L;
+ unsigned long nss6_value=0L;
+ unsigned long nss7_value=0L;
+ unsigned long total_disk_space=0L;
+ unsigned long purgeable_disk_space=0L;
+ unsigned long non_purgeable_disk_space=0L;
+ unsigned long percent_free_space=0;
+ unsigned long percent_purgeable_space=0;
+ unsigned long percent_non_purgeable_space=0;
+ unsigned long current_connections=0L;
+ unsigned long utilization=0L;
+ unsigned long cache_hits=0;
+ unsigned long cache_buffers=0L;
+ unsigned long lru_time=0L;
+ unsigned long max_packet_receive_buffers=0;
+ unsigned long used_packet_receive_buffers=0;
+ unsigned long percent_used_packet_receive_buffers=0L;
+ unsigned long sap_entries=0;
+ char uptime[MAX_INPUT_BUFFER];
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts(&argc, argv, progname);
+
+ if (process_arguments(argc,argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize alarm signal handling */
+ signal(SIGALRM,socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm(socket_timeout);
+
+ /* open connection */
+ my_tcp_connect (server_address, server_port, &sd);
+
+ /* get OS version string */
+ if (check_netware_version==TRUE) {
+ send_buffer = strdup ("S19\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ if (!strcmp(recv_buffer,"-1\n"))
+ netware_version = strdup("");
+ else {
+ recv_buffer[strlen(recv_buffer)-1]=0;
+ xasprintf (&netware_version,_("NetWare %s: "),recv_buffer);
+ }
+ } else
+ netware_version = strdup("");
+
+
+ /* check CPU load */
+ if (vars_to_check==LOAD1 || vars_to_check==LOAD5 || vars_to_check==LOAD15) {
+
+ switch(vars_to_check) {
+ case LOAD1:
+ temp_buffer = strdup ("1");
+ break;
+ case LOAD5:
+ temp_buffer = strdup ("5");
+ break;
+ default:
+ temp_buffer = strdup ("15");
+ break;
+ }
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"UTIL%s\r\n",temp_buffer);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ utilization=strtoul(recv_buffer,NULL,10);
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("UPTIME\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ recv_buffer[strlen(recv_buffer)-1]=0;
+ sprintf(uptime,_("Up %s,"),recv_buffer);
+
+ if (check_critical_value==TRUE && utilization >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && utilization >= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,
+ _("Load %s - %s %s-min load average = %lu%%|load%s=%lu;%lu;%lu;0;100"),
+ state_text(result),
+ uptime,
+ temp_buffer,
+ utilization,
+ temp_buffer,
+ utilization,
+ warning_value,
+ critical_value);
+
+ /* check number of user connections */
+ } else if (vars_to_check==CONNS) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("CONNECT\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ current_connections=strtoul(recv_buffer,NULL,10);
+
+ if (check_critical_value==TRUE && current_connections >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && current_connections >= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,
+ _("Conns %s - %lu current connections|Conns=%lu;%lu;%lu;;"),
+ state_text(result),
+ current_connections,
+ current_connections,
+ warning_value,
+ critical_value);
+
+ /* check % long term cache hits */
+ } else if (vars_to_check==LTCH) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S1\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ cache_hits=atoi(recv_buffer);
+
+ if (check_critical_value==TRUE && cache_hits <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && cache_hits <= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,
+ _("%s: Long term cache hits = %lu%%"),
+ state_text(result),
+ cache_hits);
+
+ /* check cache buffers */
+ } else if (vars_to_check==CBUFF) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S2\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ cache_buffers=strtoul(recv_buffer,NULL,10);
+
+ if (check_critical_value==TRUE && cache_buffers <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && cache_buffers <= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,
+ _("%s: Total cache buffers = %lu|Cachebuffers=%lu;%lu;%lu;;"),
+ state_text(result),
+ cache_buffers,
+ cache_buffers,
+ warning_value,
+ critical_value);
+
+ /* check dirty cache buffers */
+ } else if (vars_to_check==CDBUFF) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S3\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ cache_buffers=strtoul(recv_buffer,NULL,10);
+
+ if (check_critical_value==TRUE && cache_buffers >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && cache_buffers >= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,
+ _("%s: Dirty cache buffers = %lu|Dirty-Cache-Buffers=%lu;%lu;%lu;;"),
+ state_text(result),
+ cache_buffers,
+ cache_buffers,
+ warning_value,
+ critical_value);
+
+ /* check LRU sitting time in minutes */
+ } else if (vars_to_check==LRUM) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S5\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ lru_time=strtoul(recv_buffer,NULL,10);
+
+ if (check_critical_value==TRUE && lru_time <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && lru_time <= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,
+ _("%s: LRU sitting time = %lu minutes"),
+ state_text(result),
+ lru_time);
+
+
+ /* check KB free space on volume */
+ } else if (vars_to_check==VKF) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKF%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+ } else {
+ free_disk_space=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && free_disk_space <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && free_disk_space <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"),
+ (result==STATE_OK)?"":_("Only "),
+ free_disk_space,
+ volume_name,
+ volume_name,
+ free_disk_space,
+ warning_value,
+ critical_value);
+ }
+
+ /* check MB free space on volume */
+ } else if (vars_to_check==VMF) {
+
+ xasprintf (&send_buffer,"VMF%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+ } else {
+ free_disk_space=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && free_disk_space <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && free_disk_space <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"),
+ (result==STATE_OK)?"":_("Only "),
+ free_disk_space,
+ volume_name,
+ volume_name,
+ free_disk_space,
+ warning_value,
+ critical_value);
+ }
+ /* check MB used space on volume */
+ } else if (vars_to_check==VMU) {
+
+ xasprintf (&send_buffer,"VMU%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+ } else {
+ free_disk_space=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && free_disk_space <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && free_disk_space <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"),
+ (result==STATE_OK)?"":_("Only "),
+ free_disk_space,
+ volume_name,
+ volume_name,
+ free_disk_space,
+ warning_value,
+ critical_value);
+ }
+
+
+ /* check % free space on volume */
+ } else if (vars_to_check==VPF) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKF%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+
+ } else {
+
+ free_disk_space=strtoul(recv_buffer,NULL,10);
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKS%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ total_disk_space=strtoul(recv_buffer,NULL,10);
+
+ percent_free_space=(unsigned long)(((double)free_disk_space/(double)total_disk_space)*100.0);
+
+ if (check_critical_value==TRUE && percent_free_space <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && percent_free_space <= warning_value)
+ result=STATE_WARNING;
+ free_disk_space/=1024;
+ total_disk_space/=1024;
+ xasprintf (&output_message,_("%lu MB (%lu%%) free on volume %s - total %lu MB|FreeMB%s=%lu;%lu;%lu;0;100"),
+ free_disk_space,
+ percent_free_space,
+ volume_name,
+ total_disk_space,
+ volume_name,
+ percent_free_space,
+ warning_value,
+ critical_value
+ );
+ }
+
+ /* check to see if DS Database is open or closed */
+ } else if (vars_to_check==DSDB) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S11\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ if (atoi(recv_buffer)==1)
+ result=STATE_OK;
+ else
+ result=STATE_WARNING;
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S13\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ temp_buffer=strtok(recv_buffer,"\r\n");
+
+ xasprintf (&output_message,_("Directory Services Database is %s (DS version %s)"),(result==STATE_OK)?"open":"closed",temp_buffer);
+
+ /* check to see if logins are enabled */
+ } else if (vars_to_check==LOGINS) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S12\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ if (atoi(recv_buffer)==1)
+ result=STATE_OK;
+ else
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,_("Logins are %s"),(result==STATE_OK)?_("enabled"):_("disabled"));
+
+
+ /* check NRM Health Status Summary*/
+ } else if (vars_to_check==NRMH) {
+
+ xasprintf (&send_buffer,"NRMH\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ nrm_health_status=atoi(recv_buffer);
+
+ if (nrm_health_status==2) {
+ result=STATE_OK;
+ xasprintf (&output_message,_("CRITICAL - NRM Status is bad!"));
+ }
+ else {
+ if (nrm_health_status==1) {
+ result=STATE_WARNING;
+ xasprintf (&output_message,_("Warning - NRM Status is suspect!"));
+ }
+
+ xasprintf (&output_message,_("OK - NRM Status is good!"));
+ }
+
+
+
+ /* check packet receive buffers */
+ } else if (vars_to_check==UPRB || vars_to_check==PUPRB) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S15\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ used_packet_receive_buffers=atoi(recv_buffer);
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S16\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ max_packet_receive_buffers=atoi(recv_buffer);
+
+ percent_used_packet_receive_buffers=(unsigned long)(((double)used_packet_receive_buffers/(double)max_packet_receive_buffers)*100.0);
+
+ if (vars_to_check==UPRB) {
+ if (check_critical_value==TRUE && used_packet_receive_buffers >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && used_packet_receive_buffers >= warning_value)
+ result=STATE_WARNING;
+ } else {
+ if (check_critical_value==TRUE && percent_used_packet_receive_buffers >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && percent_used_packet_receive_buffers >= warning_value)
+ result=STATE_WARNING;
+ }
+
+ xasprintf (&output_message,_("%lu of %lu (%lu%%) packet receive buffers used"),used_packet_receive_buffers,max_packet_receive_buffers,percent_used_packet_receive_buffers);
+
+ /* check SAP table entries */
+ } else if (vars_to_check==SAPENTRIES) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ if (sap_number==-1)
+ xasprintf (&send_buffer,"S9\r\n");
+ else
+ xasprintf (&send_buffer,"S9.%d\r\n",sap_number);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ sap_entries=atoi(recv_buffer);
+
+ if (check_critical_value==TRUE && sap_entries >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && sap_entries >= warning_value)
+ result=STATE_WARNING;
+
+ if (sap_number==-1)
+ xasprintf (&output_message,_("%lu entries in SAP table"),sap_entries);
+ else
+ xasprintf (&output_message,_("%lu entries in SAP table for SAP type %d"),sap_entries,sap_number);
+
+ /* check KB purgeable space on volume */
+ } else if (vars_to_check==VKP) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKP%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+ } else {
+ purgeable_disk_space=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && purgeable_disk_space >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && purgeable_disk_space >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,_("%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"),
+ (result==STATE_OK)?"":_("Only "),
+ purgeable_disk_space,
+ volume_name,
+ volume_name,
+ purgeable_disk_space,
+ warning_value,
+ critical_value);
+ }
+ /* check MB purgeable space on volume */
+ } else if (vars_to_check==VMP) {
+
+ xasprintf (&send_buffer,"VMP%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+ } else {
+ purgeable_disk_space=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && purgeable_disk_space >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && purgeable_disk_space >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,_("%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"),
+ (result==STATE_OK)?"":_("Only "),
+ purgeable_disk_space,
+ volume_name,
+ volume_name,
+ purgeable_disk_space,
+ warning_value,
+ critical_value);
+ }
+
+ /* check % purgeable space on volume */
+ } else if (vars_to_check==VPP) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKP%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+
+ } else {
+
+ purgeable_disk_space=strtoul(recv_buffer,NULL,10);
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKS%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ total_disk_space=strtoul(recv_buffer,NULL,10);
+
+ percent_purgeable_space=(unsigned long)(((double)purgeable_disk_space/(double)total_disk_space)*100.0);
+
+ if (check_critical_value==TRUE && percent_purgeable_space >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && percent_purgeable_space >= warning_value)
+ result=STATE_WARNING;
+ purgeable_disk_space/=1024;
+ xasprintf (&output_message,_("%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"),
+ purgeable_disk_space,
+ percent_purgeable_space,
+ volume_name,
+ volume_name,
+ percent_purgeable_space,
+ warning_value,
+ critical_value
+ );
+ }
+
+ /* check KB not yet purgeable space on volume */
+ } else if (vars_to_check==VKNP) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKNP%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+ } else {
+ non_purgeable_disk_space=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && non_purgeable_disk_space >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && non_purgeable_disk_space >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,_("%s%lu KB not yet purgeable on volume %s"),(result==STATE_OK)?"":_("Only "),non_purgeable_disk_space,volume_name);
+ }
+
+ /* check % not yet purgeable space on volume */
+ } else if (vars_to_check==VPNP) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKNP%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+
+ xasprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
+ result=STATE_CRITICAL;
+
+ } else {
+
+ non_purgeable_disk_space=strtoul(recv_buffer,NULL,10);
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"VKS%s\r\n",volume_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ total_disk_space=strtoul(recv_buffer,NULL,10);
+
+ percent_non_purgeable_space=(unsigned long)(((double)non_purgeable_disk_space/(double)total_disk_space)*100.0);
+
+ if (check_critical_value==TRUE && percent_non_purgeable_space >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && percent_non_purgeable_space >= warning_value)
+ result=STATE_WARNING;
+ purgeable_disk_space/=1024;
+ xasprintf (&output_message,_("%lu MB (%lu%%) not yet purgeable on volume %s"),non_purgeable_disk_space,percent_non_purgeable_space,volume_name);
+ }
+
+ /* check # of open files */
+ } else if (vars_to_check==OFILES) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S18\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ open_files=atoi(recv_buffer);
+
+ if (check_critical_value==TRUE && open_files >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && open_files >= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,_("%lu open files|Openfiles=%lu;%lu;%lu;0,0"),
+ open_files,
+ open_files,
+ warning_value,
+ critical_value);
+
+
+ /* check # of abended threads (Netware > 5.x only) */
+ } else if (vars_to_check==ABENDS) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S17\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ abended_threads=atoi(recv_buffer);
+
+ if (check_critical_value==TRUE && abended_threads >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && abended_threads >= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,_("%lu abended threads|Abends=%lu;%lu;%lu;;"),
+ abended_threads,
+ abended_threads,
+ warning_value,
+ critical_value);
+
+ /* check # of current service processes (Netware 5.x only) */
+ } else if (vars_to_check==CSPROCS) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S20\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ max_service_processes=atoi(recv_buffer);
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S21\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ current_service_processes=atoi(recv_buffer);
+
+ if (check_critical_value==TRUE && current_service_processes >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && current_service_processes >= warning_value)
+ result=STATE_WARNING;
+
+ xasprintf (&output_message,
+ _("%lu current service processes (%lu max)|Processes=%lu;%lu;%lu;0;%lu"),
+ current_service_processes,
+ max_service_processes,
+ current_service_processes,
+ warning_value,
+ critical_value,
+ max_service_processes);
+
+ /* check # Timesync Status */
+ } else if (vars_to_check==TSYNC) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S22\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ time_sync_status=atoi(recv_buffer);
+
+ if (time_sync_status==0) {
+ result=STATE_CRITICAL;
+ xasprintf (&output_message,_("CRITICAL - Time not in sync with network!"));
+ }
+ else {
+ xasprintf (&output_message,_("OK - Time in sync with network!"));
+ }
+
+
+
+
+
+ /* check LRU sitting time in secondss */
+ } else if (vars_to_check==LRUS) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S4\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ lru_time=strtoul(recv_buffer,NULL,10);
+
+ if (check_critical_value==TRUE && lru_time <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && lru_time <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,_("LRU sitting time = %lu seconds"),lru_time);
+
+
+ /* check % dirty cacheobuffers as a percentage of the total*/
+ } else if (vars_to_check==DCB) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S6\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ dirty_cache_buffers=atoi(recv_buffer);
+
+ if (check_critical_value==TRUE && dirty_cache_buffers <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && dirty_cache_buffers <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,_("Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"),
+ dirty_cache_buffers,
+ dirty_cache_buffers,
+ warning_value,
+ critical_value);
+
+ /* check % total cache buffers as a percentage of the original*/
+ } else if (vars_to_check==TCB) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ send_buffer = strdup ("S7\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+ total_cache_buffers=atoi(recv_buffer);
+
+ if (check_critical_value==TRUE && total_cache_buffers <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && total_cache_buffers <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,_("Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"),
+ total_cache_buffers,
+ total_cache_buffers,
+ warning_value,
+ critical_value);
+
+ } else if (vars_to_check==DSVER) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S13\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ recv_buffer[strlen(recv_buffer)-1]=0;
+
+ xasprintf (&output_message,_("NDS Version %s"),recv_buffer);
+
+ } else if (vars_to_check==UPTIME) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"UPTIME\r\n");
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+
+ recv_buffer[sizeof(recv_buffer)-1]=0;
+ recv_buffer[strlen(recv_buffer)-1]=0;
+
+ xasprintf (&output_message,_("Up %s"),recv_buffer);
+
+ } else if (vars_to_check==NLM) {
+
+ close(sd);
+ my_tcp_connect (server_address, server_port, &sd);
+
+ xasprintf (&send_buffer,"S24:%s\r\n",nlm_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ recv_buffer[strlen(recv_buffer)-1]=0;
+ if (strcmp(recv_buffer,"-1")) {
+ xasprintf (&output_message,_("Module %s version %s is loaded"),nlm_name,recv_buffer);
+ } else {
+ result=STATE_CRITICAL;
+ xasprintf (&output_message,_("Module %s is not loaded"),nlm_name);
+
+ }
+ } else if (vars_to_check==NRMP) {
+
+ xasprintf (&send_buffer,"NRMP:%s\r\n",nrmp_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nrmp_name);
+ result=STATE_CRITICAL;
+ } else {
+ nrmp_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nrmp_value <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nrmp_value <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nrmp_name,
+ nrmp_value,
+ nrmp_name,
+ nrmp_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NRMM) {
+
+ xasprintf (&send_buffer,"NRMM:%s\r\n",nrmm_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nrmm_name);
+ result=STATE_CRITICAL;
+ } else {
+ nrmm_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nrmm_value <= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nrmm_value <= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nrmm_name,
+ nrmm_value,
+ nrmm_name,
+ nrmm_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NRMS) {
+
+ xasprintf (&send_buffer,"NRMS:%s\r\n",nrms_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nrms_name);
+ result=STATE_CRITICAL;
+ } else {
+ nrms_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nrms_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nrms_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nrms_name,
+ nrms_value,
+ nrms_name,
+ nrms_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NSS1) {
+
+ xasprintf (&send_buffer,"NSS1:%s\r\n",nss1_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nss1_name);
+ result=STATE_CRITICAL;
+ } else {
+ nss1_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nss1_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nss1_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nss1_name,
+ nss1_value,
+ nss1_name,
+ nss1_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NSS2) {
+
+ xasprintf (&send_buffer,"NSS2:%s\r\n",nss2_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nss2_name);
+ result=STATE_CRITICAL;
+ } else {
+ nss2_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nss2_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nss2_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nss2_name,
+ nss2_value,
+ nss2_name,
+ nss2_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NSS3) {
+
+ xasprintf (&send_buffer,"NSS3:%s\r\n",nss3_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nss3_name);
+ result=STATE_CRITICAL;
+ } else {
+ nss3_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nss3_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nss3_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nss3_name,
+ nss3_value,
+ nss3_name,
+ nss3_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NSS4) {
+
+ xasprintf (&send_buffer,"NSS4:%s\r\n",nss4_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nss4_name);
+ result=STATE_CRITICAL;
+ } else {
+ nss4_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nss4_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nss4_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nss4_name,
+ nss4_value,
+ nss4_name,
+ nss4_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NSS5) {
+
+ xasprintf (&send_buffer,"NSS5:%s\r\n",nss5_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nss5_name);
+ result=STATE_CRITICAL;
+ } else {
+ nss5_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nss5_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nss5_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nss5_name,
+ nss5_value,
+ nss5_name,
+ nss5_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NSS6) {
+
+ xasprintf (&send_buffer,"NSS6:%s\r\n",nss6_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nss6_name);
+ result=STATE_CRITICAL;
+ } else {
+ nss6_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nss6_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nss6_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nss6_name,
+ nss6_value,
+ nss6_name,
+ nss6_value,
+ warning_value,
+ critical_value);
+ }
+
+ } else if (vars_to_check==NSS7) {
+
+ xasprintf (&send_buffer,"NSS7:%s\r\n",nss7_name);
+ result=send_tcp_request(sd,send_buffer,recv_buffer,sizeof(recv_buffer));
+ if (result!=STATE_OK)
+ return result;
+
+ if (!strcmp(recv_buffer,"-1\n")) {
+ xasprintf (&output_message,_("CRITICAL - Value '%s' does not exist!"),nss7_name);
+ result=STATE_CRITICAL;
+ } else {
+ nss7_value=strtoul(recv_buffer,NULL,10);
+ if (check_critical_value==TRUE && nss7_value >= critical_value)
+ result=STATE_CRITICAL;
+ else if (check_warning_value==TRUE && nss7_value >= warning_value)
+ result=STATE_WARNING;
+ xasprintf (&output_message,
+ _("%s is %lu|%s=%lu;%lu;%lu;;"),
+ nss7_name,
+ nss7_value,
+ nss7_name,
+ nss7_value,
+ warning_value,
+ critical_value);
+ }
+
+
+}
+ else {
+
+ output_message = strdup (_("Nothing to check!\n"));
+ result=STATE_UNKNOWN;
+
+ }
+
+ close (sd);
+
+ /* reset timeout */
+ alarm(0);
+
+ printf("%s%s\n",netware_version,output_message);
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int process_arguments(int argc, char **argv) {
+ int c;
+
+ int option = 0;
+ static struct option longopts[] =
+ {
+ {"port", required_argument,0,'p'},
+ {"timeout", required_argument,0,'t'},
+ {"critical", required_argument,0,'c'},
+ {"warning", required_argument,0,'w'},
+ {"variable", required_argument,0,'v'},
+ {"hostname", required_argument,0,'H'},
+ {"osversion",no_argument, 0,'o'},
+ {"version", no_argument, 0,'V'},
+ {"help", no_argument, 0,'h'},
+ {0,0,0,0}
+ };
+
+ /* no options were supplied */
+ if (argc<2) return ERROR;
+
+ /* backwards compatibility */
+ if (! is_option(argv[1])) {
+ server_address=argv[1];
+ argv[1]=argv[0];
+ argv=&argv[1];
+ argc--;
+ }
+
+ for (c=1;c<argc;c++) {
+ if (strcmp("-to",argv[c])==0)
+ strcpy(argv[c],"-t");
+ else if (strcmp("-wv",argv[c])==0)
+ strcpy(argv[c],"-w");
+ else if (strcmp("-cv",argv[c])==0)
+ strcpy(argv[c],"-c");
+ }
+
+ while (1) {
+ c = getopt_long(argc,argv,"+hoVH:t:c:w:p:v:",longopts,&option);
+
+ if (c==-1||c==EOF||c==1)
+ break;
+
+ switch (c)
+ {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'h': /* help */
+ print_help();
+ exit(STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision(progname, NP_VERSION);
+ exit(STATE_UNKNOWN);
+ case 'H': /* hostname */
+ server_address=optarg;
+ break;
+ case 'o': /* display nos version */
+ check_netware_version=TRUE;
+ break;
+ case 'p': /* port */
+ if (is_intnonneg(optarg))
+ server_port=atoi(optarg);
+ else
+ die(STATE_UNKNOWN,_("Server port an integer\n"));
+ break;
+ case 'v':
+ if (strlen(optarg)<3)
+ return ERROR;
+ if (!strcmp(optarg,"LOAD1"))
+ vars_to_check=LOAD1;
+ else if (!strcmp(optarg,"LOAD5"))
+ vars_to_check=LOAD5;
+ else if (!strcmp(optarg,"LOAD15"))
+ vars_to_check=LOAD15;
+ else if (!strcmp(optarg,"CONNS"))
+ vars_to_check=CONNS;
+ else if (!strcmp(optarg,"LTCH"))
+ vars_to_check=LTCH;
+ else if (!strcmp(optarg,"DCB"))
+ vars_to_check=DCB;
+ else if (!strcmp(optarg,"TCB"))
+ vars_to_check=TCB;
+ else if (!strcmp(optarg,"CBUFF"))
+ vars_to_check=CBUFF;
+ else if (!strcmp(optarg,"CDBUFF"))
+ vars_to_check=CDBUFF;
+ else if (!strcmp(optarg,"LRUM"))
+ vars_to_check=LRUM;
+ else if (!strcmp(optarg,"LRUS"))
+ vars_to_check=LRUS;
+ else if (strncmp(optarg,"VPF",3)==0) {
+ vars_to_check=VPF;
+ volume_name = strdup (optarg+3);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (strncmp(optarg,"VKF",3)==0) {
+ vars_to_check=VKF;
+ volume_name = strdup (optarg+3);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (strncmp(optarg,"VMF",3)==0) {
+ vars_to_check=VMF;
+ volume_name = strdup (optarg+3);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (!strcmp(optarg,"DSDB"))
+ vars_to_check=DSDB;
+ else if (!strcmp(optarg,"LOGINS"))
+ vars_to_check=LOGINS;
+ else if (!strcmp(optarg,"NRMH"))
+ vars_to_check=NRMH;
+ else if (!strcmp(optarg,"UPRB"))
+ vars_to_check=UPRB;
+ else if (!strcmp(optarg,"PUPRB"))
+ vars_to_check=PUPRB;
+ else if (!strncmp(optarg,"SAPENTRIES",10)) {
+ vars_to_check=SAPENTRIES;
+ if (strlen(optarg)>10)
+ sap_number=atoi(optarg+10);
+ else
+ sap_number=-1;
+ }
+ else if (!strcmp(optarg,"OFILES"))
+ vars_to_check=OFILES;
+ else if (strncmp(optarg,"VKP",3)==0) {
+ vars_to_check=VKP;
+ volume_name = strdup (optarg+3);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (strncmp(optarg,"VMP",3)==0) {
+ vars_to_check=VMP;
+ volume_name = strdup (optarg+3);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (strncmp(optarg,"VMU",3)==0) {
+ vars_to_check=VMU;
+ volume_name = strdup (optarg+3);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (strncmp(optarg,"VPP",3)==0) {
+ vars_to_check=VPP;
+ volume_name = strdup (optarg+3);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (strncmp(optarg,"VKNP",4)==0) {
+ vars_to_check=VKNP;
+ volume_name = strdup (optarg+4);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup ("SYS");
+ }
+ else if (strncmp(optarg,"VPNP",4)==0) {
+ vars_to_check=VPNP;
+ volume_name = strdup (optarg+4);
+ if (!strcmp(volume_name,""))
+ volume_name = strdup("SYS");
+ }
+ else if (!strcmp(optarg,"ABENDS"))
+ vars_to_check=ABENDS;
+ else if (!strcmp(optarg,"CSPROCS"))
+ vars_to_check=CSPROCS;
+ else if (!strcmp(optarg,"TSYNC"))
+ vars_to_check=TSYNC;
+ else if (!strcmp(optarg,"DSVER"))
+ vars_to_check=DSVER;
+ else if (!strcmp(optarg,"UPTIME")) {
+ vars_to_check=UPTIME;
+ }
+ else if (strncmp(optarg,"NLM:",4)==0) {
+ vars_to_check=NLM;
+ nlm_name=strdup (optarg+4);
+ }
+ else if (strncmp(optarg,"NRMP",4)==0) {
+ vars_to_check=NRMP;
+ nrmp_name = strdup (optarg+4);
+ if (!strcmp(nrmp_name,""))
+ nrmp_name = strdup ("AVAILABLE_MEMORY");
+ }
+ else if (strncmp(optarg,"NRMM",4)==0) {
+ vars_to_check=NRMM;
+ nrmm_name = strdup (optarg+4);
+ if (!strcmp(nrmm_name,""))
+ nrmm_name = strdup ("AVAILABLE_CACHE_MEMORY");
+
+ }
+
+ else if (strncmp(optarg,"NRMS",4)==0) {
+ vars_to_check=NRMS;
+ nrms_name = strdup (optarg+4);
+ if (!strcmp(nrms_name,""))
+ nrms_name = strdup ("USED_SWAP_SPACE");
+
+ }
+
+ else if (strncmp(optarg,"NSS1",4)==0) {
+ vars_to_check=NSS1;
+ nss1_name = strdup (optarg+4);
+ if (!strcmp(nss1_name,""))
+ nss1_name = strdup ("CURRENTBUFFERCACHESIZE");
+
+ }
+
+ else if (strncmp(optarg,"NSS2",4)==0) {
+ vars_to_check=NSS2;
+ nss2_name = strdup (optarg+4);
+ if (!strcmp(nss2_name,""))
+ nss2_name = strdup ("CACHEHITS");
+
+ }
+
+ else if (strncmp(optarg,"NSS3",4)==0) {
+ vars_to_check=NSS3;
+ nss3_name = strdup (optarg+4);
+ if (!strcmp(nss3_name,""))
+ nss3_name = strdup ("CACHEGITPERCENT");
+
+ }
+
+ else if (strncmp(optarg,"NSS4",4)==0) {
+ vars_to_check=NSS4;
+ nss4_name = strdup (optarg+4);
+ if (!strcmp(nss4_name,""))
+ nss4_name = strdup ("CURRENTOPENCOUNT");
+
+ }
+
+ else if (strncmp(optarg,"NSS5",4)==0) {
+ vars_to_check=NSS5;
+ nss5_name = strdup (optarg+4);
+ if (!strcmp(nss5_name,""))
+ nss5_name = strdup ("CACHEMISSES");
+
+ }
+
+
+ else if (strncmp(optarg,"NSS6",4)==0) {
+ vars_to_check=NSS6;
+ nss6_name = strdup (optarg+4);
+ if (!strcmp(nss6_name,""))
+ nss6_name = strdup ("PENDINGWORKSCOUNT");
+
+ }
+
+
+ else if (strncmp(optarg,"NSS7",4)==0) {
+ vars_to_check=NSS7;
+ nss7_name = strdup (optarg+4);
+ if (!strcmp(nss7_name,""))
+ nss7_name = strdup ("CACHESIZE");
+
+ }
+
+
+ else
+ return ERROR;
+ break;
+ case 'w': /* warning threshold */
+ warning_value=strtoul(optarg,NULL,10);
+ check_warning_value=TRUE;
+ break;
+ case 'c': /* critical threshold */
+ critical_value=strtoul(optarg,NULL,10);
+ check_critical_value=TRUE;
+ break;
+ case 't': /* timeout */
+ socket_timeout=atoi(optarg);
+ if (socket_timeout<=0)
+ return ERROR;
+ }
+
+ }
+
+ return OK;
+}
+
+
+
+void print_help(void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin attempts to contact the MRTGEXT NLM running on a"));
+ printf ("%s\n", _("Novell server to gather the requested system information."));
+
+ printf ("\n\n");
+
+ print_usage();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (" %s\n", "-v, --variable=STRING");
+ printf (" %s\n", _("Variable to check. Valid variables include:"));
+ printf (" %s\n", _("LOAD1 = 1 minute average CPU load"));
+ printf (" %s\n", _("LOAD5 = 5 minute average CPU load"));
+ printf (" %s\n", _("LOAD15 = 15 minute average CPU load"));
+ printf (" %s\n", _("CSPROCS = number of current service processes (NW 5.x only)"));
+ printf (" %s\n", _("ABENDS = number of abended threads (NW 5.x only)"));
+ printf (" %s\n", _("UPTIME = server uptime"));
+ printf (" %s\n", _("LTCH = percent long term cache hits"));
+ printf (" %s\n", _("CBUFF = current number of cache buffers"));
+ printf (" %s\n", _("CDBUFF = current number of dirty cache buffers"));
+ printf (" %s\n", _("DCB = dirty cache buffers as a percentage of the total"));
+ printf (" %s\n", _("TCB = dirty cache buffers as a percentage of the original"));
+ printf (" %s\n", _("OFILES = number of open files"));
+ printf (" %s\n", _(" VMF<vol> = MB of free space on Volume <vol>"));
+ printf (" %s\n", _(" VMU<vol> = MB used space on Volume <vol>"));
+ printf (" %s\n", _(" VMP<vol> = MB of purgeable space on Volume <vol>"));
+ printf (" %s\n", _(" VPF<vol> = percent free space on volume <vol>"));
+ printf (" %s\n", _(" VKF<vol> = KB of free space on volume <vol>"));
+ printf (" %s\n", _(" VPP<vol> = percent purgeable space on volume <vol>"));
+ printf (" %s\n", _(" VKP<vol> = KB of purgeable space on volume <vol>"));
+ printf (" %s\n", _(" VPNP<vol> = percent not yet purgeable space on volume <vol>"));
+ printf (" %s\n", _(" VKNP<vol> = KB of not yet purgeable space on volume <vol>"));
+ printf (" %s\n", _(" LRUM = LRU sitting time in minutes"));
+ printf (" %s\n", _(" LRUS = LRU sitting time in seconds"));
+ printf (" %s\n", _(" DSDB = check to see if DS Database is open"));
+ printf (" %s\n", _(" DSVER = NDS version"));
+ printf (" %s\n", _(" UPRB = used packet receive buffers"));
+ printf (" %s\n", _(" PUPRB = percent (of max) used packet receive buffers"));
+ printf (" %s\n", _(" SAPENTRIES = number of entries in the SAP table"));
+ printf (" %s\n", _(" SAPENTRIES<n> = number of entries in the SAP table for SAP type <n>"));
+ printf (" %s\n", _(" TSYNC = timesync status"));
+ printf (" %s\n", _(" LOGINS = check to see if logins are enabled"));
+ printf (" %s\n", _(" CONNS = number of currently licensed connections"));
+ printf (" %s\n", _(" NRMH = NRM Summary Status"));
+ printf (" %s\n", _(" NRMP<stat> = Returns the current value for a NRM health item"));
+ printf (" %s\n", _(" NRMM<stat> = Returns the current memory stats from NRM"));
+ printf (" %s\n", _(" NRMS<stat> = Returns the current Swapfile stats from NRM"));
+ printf (" %s\n", _(" NSS1<stat> = Statistics from _Admin:Manage_NSS\\GeneralStats.xml"));
+ printf (" %s\n", _(" NSS3<stat> = Statistics from _Admin:Manage_NSS\\NameCache.xml"));
+ printf (" %s\n", _(" NSS4<stat> = Statistics from _Admin:Manage_NSS\\FileStats.xml"));
+ printf (" %s\n", _(" NSS5<stat> = Statistics from _Admin:Manage_NSS\\ObjectCache.xml"));
+ printf (" %s\n", _(" NSS6<stat> = Statistics from _Admin:Manage_NSS\\Thread.xml"));
+ printf (" %s\n", _(" NSS7<stat> = Statistics from _Admin:Manage_NSS\\AuthorizationCache.xml"));
+ printf (" %s\n", _(" NLM:<nlm> = check if NLM is loaded and report version"));
+ printf (" %s\n", _(" (e.g. NLM:TSANDS.NLM)"));
+ printf ("\n");
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Threshold which will result in a warning status"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Threshold which will result in a critical status"));
+ printf (" %s\n", "-o, --osversion");
+ printf (" %s\n", _("Include server version string in results"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("- This plugin requires that the MRTGEXT.NLM file from James Drews' MRTG"));
+ printf (" %s\n", _(" extension for NetWare be loaded on the Novell servers you wish to check."));
+ printf (" %s\n", _(" (available from http://www.engr.wisc.edu/~drews/mrtg/)"));
+ printf (" %s\n", _("- Values for critical thresholds should be lower than warning thresholds"));
+ printf (" %s\n", _(" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "));
+ printf (" %s\n", _(" TCB, LRUS and LRUM."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void print_usage(void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n",progname);
+}
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
new file mode 100644
index 0000000..9a4d25f
--- /dev/null
+++ b/plugins/check_overcr.c
@@ -0,0 +1,469 @@
+/*****************************************************************************
+*
+* Monitoring check_overcr plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_overcr plugin
+*
+* This plugin attempts to contact the Over-CR collector daemon running on the
+* remote UNIX server in order to gather the requested system information.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_overcr";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+enum checkvar {
+ NONE,
+ LOAD1,
+ LOAD5,
+ LOAD15,
+ DPU,
+ PROCS,
+ NETSTAT,
+ UPTIME
+};
+
+enum {
+ PORT = 2000
+};
+
+char *server_address = NULL;
+int server_port = PORT;
+double warning_value = 0L;
+double critical_value = 0L;
+int check_warning_value = FALSE;
+int check_critical_value = FALSE;
+enum checkvar vars_to_check = NONE;
+int cmd_timeout = 1;
+
+int netstat_port = 0;
+char *disk_name = NULL;
+char *process_name = NULL;
+ char send_buffer[MAX_INPUT_BUFFER];
+
+int process_arguments (int, char **);
+void print_usage (void);
+void print_help (void);
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+ char recv_buffer[MAX_INPUT_BUFFER];
+ char temp_buffer[MAX_INPUT_BUFFER];
+ char *temp_ptr = NULL;
+ int found_disk = FALSE;
+ unsigned long percent_used_disk_space = 100;
+ double load;
+ double load_1min;
+ double load_5min;
+ double load_15min;
+ int port_connections = 0;
+ int processes = 0;
+ double uptime_raw_hours;
+ int uptime_raw_minutes = 0;
+ int uptime_days = 0;
+ int uptime_hours = 0;
+ int uptime_minutes = 0;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+
+ result = process_tcp_request2 (server_address,
+ server_port,
+ send_buffer,
+ recv_buffer,
+ sizeof (recv_buffer));
+
+ switch (vars_to_check) {
+
+ case LOAD1:
+ case LOAD5:
+ case LOAD15:
+
+ if (result != STATE_OK)
+ die (result, _("Unknown error fetching load data\n"));
+
+ temp_ptr = (char *) strtok (recv_buffer, "\r\n");
+ if (temp_ptr == NULL)
+ die (STATE_CRITICAL, _("Invalid response from server - no load information\n"));
+ else
+ load_1min = strtod (temp_ptr, NULL);
+
+ temp_ptr = (char *) strtok (NULL, "\r\n");
+ if (temp_ptr == NULL)
+ die (STATE_CRITICAL, _("Invalid response from server after load 1\n"));
+ else
+ load_5min = strtod (temp_ptr, NULL);
+
+ temp_ptr = (char *) strtok (NULL, "\r\n");
+ if (temp_ptr == NULL)
+ die (STATE_CRITICAL, _("Invalid response from server after load 5\n"));
+ else
+ load_15min = strtod (temp_ptr, NULL);
+
+ switch (vars_to_check) {
+ case LOAD1:
+ strcpy (temp_buffer, "1");
+ load = load_1min;
+ break;
+ case LOAD5:
+ strcpy (temp_buffer, "5");
+ load = load_5min;
+ break;
+ default:
+ strcpy (temp_buffer, "15");
+ load = load_15min;
+ break;
+ }
+
+ if (check_critical_value == TRUE && (load >= critical_value))
+ result = STATE_CRITICAL;
+ else if (check_warning_value == TRUE && (load >= warning_value))
+ result = STATE_WARNING;
+
+ die (result,
+ _("Load %s - %s-min load average = %0.2f"),
+ state_text(result),
+ temp_buffer,
+ load);
+
+ break;
+
+ case DPU:
+
+ if (result != STATE_OK)
+ die (result, _("Unknown error fetching disk data\n"));
+
+ for (temp_ptr = (char *) strtok (recv_buffer, " ");
+ temp_ptr != NULL;
+ temp_ptr = (char *) strtok (NULL, " ")) {
+
+ if (!strcmp (temp_ptr, disk_name)) {
+ found_disk = TRUE;
+ temp_ptr = (char *) strtok (NULL, "%");
+ if (temp_ptr == NULL)
+ die (STATE_CRITICAL, _("Invalid response from server\n"));
+ else
+ percent_used_disk_space = strtoul (temp_ptr, NULL, 10);
+ break;
+ }
+
+ temp_ptr = (char *) strtok (NULL, "\r\n");
+ }
+
+ /* error if we couldn't find the info for the disk */
+ if (found_disk == FALSE)
+ die (STATE_CRITICAL,
+ "CRITICAL - Disk '%s' non-existent or not mounted",
+ disk_name);
+
+ if (check_critical_value == TRUE && (percent_used_disk_space >= critical_value))
+ result = STATE_CRITICAL;
+ else if (check_warning_value == TRUE && (percent_used_disk_space >= warning_value))
+ result = STATE_WARNING;
+
+ die (result, "Disk %s - %lu%% used on %s", state_text(result), percent_used_disk_space, disk_name);
+
+ break;
+
+ case NETSTAT:
+
+ if (result != STATE_OK)
+ die (result, _("Unknown error fetching network status\n"));
+ else
+ port_connections = strtod (recv_buffer, NULL);
+
+ if (check_critical_value == TRUE && (port_connections >= critical_value))
+ result = STATE_CRITICAL;
+ else if (check_warning_value == TRUE && (port_connections >= warning_value))
+ result = STATE_WARNING;
+
+ die (result,
+ _("Net %s - %d connection%s on port %d"),
+ state_text(result),
+ port_connections,
+ (port_connections == 1) ? "" : "s",
+ netstat_port);
+
+ break;
+
+ case PROCS:
+
+ if (result != STATE_OK)
+ die (result, _("Unknown error fetching process status\n"));
+
+ temp_ptr = (char *) strtok (recv_buffer, "(");
+ if (temp_ptr == NULL)
+ die (STATE_CRITICAL, _("Invalid response from server\n"));
+
+ temp_ptr = (char *) strtok (NULL, ")");
+ if (temp_ptr == NULL)
+ die (STATE_CRITICAL, _("Invalid response from server\n"));
+ else
+ processes = strtod (temp_ptr, NULL);
+
+ if (check_critical_value == TRUE && (processes >= critical_value))
+ result = STATE_CRITICAL;
+ else if (check_warning_value == TRUE && (processes >= warning_value))
+ result = STATE_WARNING;
+
+ die (result,
+ _("Process %s - %d instance%s of %s running"),
+ state_text(result),
+ processes,
+ (processes == 1) ? "" : "s",
+ process_name);
+ break;
+
+ case UPTIME:
+
+ if (result != STATE_OK)
+ return result;
+
+ uptime_raw_hours = strtod (recv_buffer, NULL);
+ uptime_raw_minutes = (unsigned long) (uptime_raw_hours * 60.0);
+
+ if (check_critical_value == TRUE && (uptime_raw_minutes <= critical_value))
+ result = STATE_CRITICAL;
+ else if (check_warning_value == TRUE && (uptime_raw_minutes <= warning_value))
+ result = STATE_WARNING;
+
+ uptime_days = uptime_raw_minutes / 1440;
+ uptime_raw_minutes %= 1440;
+ uptime_hours = uptime_raw_minutes / 60;
+ uptime_raw_minutes %= 60;
+ uptime_minutes = uptime_raw_minutes;
+
+ die (result,
+ _("Uptime %s - Up %d days %d hours %d minutes"),
+ state_text(result),
+ uptime_days,
+ uptime_hours,
+ uptime_minutes);
+ break;
+
+ default:
+ die (STATE_UNKNOWN, _("Nothing to check!\n"));
+ break;
+ }
+}
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"port", required_argument, 0, 'p'},
+ {"timeout", required_argument, 0, 't'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"variable", required_argument, 0, 'v'},
+ {"hostname", required_argument, 0, 'H'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ /* no options were supplied */
+ if (argc < 2)
+ return ERROR;
+
+ /* backwards compatibility */
+ if (!is_option (argv[1])) {
+ server_address = argv[1];
+ argv[1] = argv[0];
+ argv = &argv[1];
+ argc--;
+ }
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wv", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-cv", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVH:t:c:w:p:v:", longopts,
+ &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'H': /* hostname */
+ server_address = optarg;
+ break;
+ case 'p': /* port */
+ if (is_intnonneg (optarg))
+ server_port = atoi (optarg);
+ else
+ die (STATE_UNKNOWN,
+ _("Server port an integer\n"));
+ break;
+ case 'v': /* variable */
+ if (strcmp (optarg, "LOAD") == 0) {
+ strcpy (send_buffer, "LOAD\r\nQUIT\r\n");
+ if (strcmp (optarg, "LOAD1") == 0)
+ vars_to_check = LOAD1;
+ else if (strcmp (optarg, "LOAD5") == 0)
+ vars_to_check = LOAD5;
+ else if (strcmp (optarg, "LOAD15") == 0)
+ vars_to_check = LOAD15;
+ }
+ else if (strcmp (optarg, "UPTIME") == 0) {
+ vars_to_check = UPTIME;
+ strcpy (send_buffer, "UPTIME\r\n");
+ }
+ else if (strstr (optarg, "PROC") == optarg) {
+ vars_to_check = PROCS;
+ process_name = strscpy (process_name, optarg + 4);
+ sprintf (send_buffer, "PROCESS %s\r\n", process_name);
+ }
+ else if (strstr (optarg, "NET") == optarg) {
+ vars_to_check = NETSTAT;
+ netstat_port = atoi (optarg + 3);
+ sprintf (send_buffer, "NETSTAT %d\r\n", netstat_port);
+ }
+ else if (strstr (optarg, "DPU") == optarg) {
+ vars_to_check = DPU;
+ strcpy (send_buffer, "DISKSPACE\r\n");
+ disk_name = strscpy (disk_name, optarg + 3);
+ }
+ else
+ return ERROR;
+ break;
+ case 'w': /* warning threshold */
+ warning_value = strtoul (optarg, NULL, 10);
+ check_warning_value = TRUE;
+ break;
+ case 'c': /* critical threshold */
+ critical_value = strtoul (optarg, NULL, 10);
+ check_critical_value = TRUE;
+ break;
+ case 't': /* timeout */
+ socket_timeout = atoi (optarg);
+ if (socket_timeout <= 0)
+ return ERROR;
+ }
+
+ }
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin attempts to contact the Over-CR collector daemon running on the"));
+ printf ("%s\n", _("remote UNIX server in order to gather the requested system information."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Threshold which will result in a warning status"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Threshold which will result in a critical status"));
+ printf (" %s\n", "-v, --variable=STRING");
+ printf (" %s\n", _("Variable to check. Valid variables include:"));
+ printf (" %s\n", _("LOAD1 = 1 minute average CPU load"));
+ printf (" %s\n", _("LOAD5 = 5 minute average CPU load"));
+ printf (" %s\n", _("LOAD15 = 15 minute average CPU load"));
+ printf (" %s\n", _("DPU<filesys> = percent used disk space on filesystem <filesys>"));
+ printf (" %s\n", _("PROC<process> = number of running processes with name <process>"));
+ printf (" %s\n", _("NET<port> = number of active connections on TCP port <port>"));
+ printf (" %s\n", _("UPTIME = system uptime in seconds"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("This plugin requires that Eric Molitors' Over-CR collector daemon be"));
+ printf ("%s\n", _("running on the remote server."));
+ printf ("%s\n", _("Over-CR can be downloaded from http://www.molitor.org/overcr"));
+ printf ("%s\n", _("This plugin was tested with version 0.99.53 of the Over-CR collector"));
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("For the available options, the critical threshold value should always be"));
+ printf (" %s\n", _("higher than the warning threshold value, EXCEPT with the uptime variable"));
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host [-p port] [-v variable] [-w warning] [-c critical] [-t timeout]\n", progname);
+}
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
new file mode 100644
index 0000000..6199033
--- /dev/null
+++ b/plugins/check_pgsql.c
@@ -0,0 +1,636 @@
+/*****************************************************************************
+*
+* Monitoring check_pgsql plugin
+*
+* License: GPL
+* Copyright (c) 1999-2011 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_pgsql plugin
+*
+* Test whether a PostgreSQL Database is accepting connections.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_pgsql";
+const char *copyright = "1999-2011";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "utils_cmd.h"
+
+#include "netutils.h"
+#include <libpq-fe.h>
+#include <pg_config_manual.h>
+
+#define DEFAULT_DB "template1"
+#define DEFAULT_HOST "127.0.0.1"
+
+/* return the PSQL server version as a 3-tuple */
+#define PSQL_SERVER_VERSION3(server_version) \
+ (server_version) / 10000, \
+ (server_version) / 100 - (int)((server_version) / 10000) * 100, \
+ (server_version) - (int)((server_version) / 100) * 100
+/* return true if the given host is a UNIX domain socket */
+#define PSQL_IS_UNIX_DOMAIN_SOCKET(host) \
+ ((NULL == (host)) || ('\0' == *(host)) || ('/' == *(host)))
+/* return a 3-tuple identifying a host/port independent of the socket type */
+#define PSQL_SOCKET3(host, port) \
+ ((NULL == (host)) || ('\0' == *(host))) ? DEFAULT_PGSOCKET_DIR : host, \
+ PSQL_IS_UNIX_DOMAIN_SOCKET (host) ? "/.s.PGSQL." : ":", \
+ port
+
+enum {
+ DEFAULT_PORT = 5432,
+ DEFAULT_WARN = 2,
+ DEFAULT_CRIT = 8
+};
+
+
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_usage (void);
+void print_help (void);
+int is_pg_logname (char *);
+int do_query (PGconn *, char *);
+
+char *pghost = NULL; /* host name of the backend server */
+char *pgport = NULL; /* port of the backend server */
+int default_port = DEFAULT_PORT;
+char *pgoptions = NULL;
+char *pgtty = NULL;
+char dbName[NAMEDATALEN] = DEFAULT_DB;
+char *pguser = NULL;
+char *pgpasswd = NULL;
+char *pgparams = NULL;
+double twarn = (double)DEFAULT_WARN;
+double tcrit = (double)DEFAULT_CRIT;
+char *pgquery = NULL;
+#define OPTID_QUERYNAME -1000
+char *pgqueryname = NULL;
+char *query_warning = NULL;
+char *query_critical = NULL;
+thresholds *qthresholds = NULL;
+int verbose = 0;
+
+/******************************************************************************
+
+The (pseudo?)literate programming XML is contained within \@\@\- <XML> \-\@\@
+tags in the comments. With in the tags, the XML is assembled sequentially.
+You can define entities in tags. You also have all the #defines available as
+entities.
+
+Please note that all tags must be lowercase to use the DocBook XML DTD.
+
+@@-<article>
+
+<sect1>
+<title>Quick Reference</title>
+<!-- The refentry forms a manpage -->
+<refentry>
+<refmeta>
+<manvolnum>5<manvolnum>
+</refmeta>
+<refnamdiv>
+<refname>&progname;</refname>
+<refpurpose>&SUMMARY;</refpurpose>
+</refnamdiv>
+</refentry>
+</sect1>
+
+<sect1>
+<title>FAQ</title>
+</sect1>
+
+<sect1>
+<title>Theory, Installation, and Operation</title>
+
+<sect2>
+<title>General Description</title>
+<para>
+&DESCRIPTION;
+</para>
+</sect2>
+
+<sect2>
+<title>Future Enhancements</title>
+<para>ToDo List</para>
+</sect2>
+
+
+<sect2>
+<title>Functions</title>
+-@@
+******************************************************************************/
+
+
+
+int
+main (int argc, char **argv)
+{
+ PGconn *conn;
+ char *conninfo = NULL;
+
+ struct timeval start_timeval;
+ struct timeval end_timeval;
+ double elapsed_time;
+ int status = STATE_UNKNOWN;
+ int query_status = STATE_UNKNOWN;
+
+ /* begin, by setting the parameters for a backend connection if the
+ * parameters are null, then the system will try to use reasonable
+ * defaults by looking up environment variables or, failing that,
+ * using hardwired constants */
+
+ pgoptions = NULL; /* special options to start up the backend server */
+ pgtty = NULL; /* debugging tty for the backend server */
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+ if (verbose > 2)
+ printf("Arguments initialized\n");
+
+ /* Set signal handling and alarm */
+ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
+ usage4 (_("Cannot catch SIGALRM"));
+ }
+ alarm (timeout_interval);
+
+ if (pgparams)
+ asprintf (&conninfo, "%s ", pgparams);
+
+ asprintf (&conninfo, "%sdbname = '%s'", conninfo ? conninfo : "", dbName);
+ if (pghost)
+ asprintf (&conninfo, "%s host = '%s'", conninfo, pghost);
+ if (pgport)
+ asprintf (&conninfo, "%s port = '%s'", conninfo, pgport);
+ if (pgoptions)
+ asprintf (&conninfo, "%s options = '%s'", conninfo, pgoptions);
+ /* if (pgtty) -- ignored by PQconnectdb */
+ if (pguser)
+ asprintf (&conninfo, "%s user = '%s'", conninfo, pguser);
+
+ if (verbose) /* do not include password (see right below) in output */
+ printf ("Connecting to PostgreSQL using conninfo: %s%s\n", conninfo,
+ pgpasswd ? " password = <hidden>" : "");
+
+ if (pgpasswd)
+ asprintf (&conninfo, "%s password = '%s'", conninfo, pgpasswd);
+
+ /* make a connection to the database */
+ gettimeofday (&start_timeval, NULL);
+ conn = PQconnectdb (conninfo);
+ gettimeofday (&end_timeval, NULL);
+
+ while (start_timeval.tv_usec > end_timeval.tv_usec) {
+ --end_timeval.tv_sec;
+ end_timeval.tv_usec += 1000000;
+ }
+ elapsed_time = (double)(end_timeval.tv_sec - start_timeval.tv_sec)
+ + (double)(end_timeval.tv_usec - start_timeval.tv_usec) / 1000000.0;
+
+ if (verbose)
+ printf("Time elapsed: %f\n", elapsed_time);
+
+ /* check to see that the backend connection was successfully made */
+ if (verbose)
+ printf("Verifying connection\n");
+ if (PQstatus (conn) == CONNECTION_BAD) {
+ printf (_("CRITICAL - no connection to '%s' (%s).\n"),
+ dbName, PQerrorMessage (conn));
+ PQfinish (conn);
+ return STATE_CRITICAL;
+ }
+ else if (elapsed_time > tcrit) {
+ status = STATE_CRITICAL;
+ }
+ else if (elapsed_time > twarn) {
+ status = STATE_WARNING;
+ }
+ else {
+ status = STATE_OK;
+ }
+
+ if (verbose) {
+ char *server_host = PQhost (conn);
+ int server_version = PQserverVersion (conn);
+
+ printf ("Successfully connected to database %s (user %s) "
+ "at server %s%s%s (server version: %d.%d.%d, "
+ "protocol version: %d, pid: %d)\n",
+ PQdb (conn), PQuser (conn),
+ PSQL_SOCKET3 (server_host, PQport (conn)),
+ PSQL_SERVER_VERSION3 (server_version),
+ PQprotocolVersion (conn), PQbackendPID (conn));
+ }
+
+ printf (_(" %s - database %s (%f sec.)|%s\n"),
+ state_text(status), dbName, elapsed_time,
+ fperfdata("time", elapsed_time, "s",
+ !!(twarn > 0.0), twarn, !!(tcrit > 0.0), tcrit, TRUE, 0, FALSE,0));
+
+ if (pgquery)
+ query_status = do_query (conn, pgquery);
+
+ if (verbose)
+ printf("Closing connection\n");
+ PQfinish (conn);
+ return (pgquery && query_status > status) ? query_status : status;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"timeout", required_argument, 0, 't'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"hostname", required_argument, 0, 'H'},
+ {"logname", required_argument, 0, 'l'},
+ {"password", required_argument, 0, 'p'},
+ {"authorization", required_argument, 0, 'a'},
+ {"port", required_argument, 0, 'P'},
+ {"database", required_argument, 0, 'd'},
+ {"option", required_argument, 0, 'o'},
+ {"query", required_argument, 0, 'q'},
+ {"queryname", required_argument, 0, OPTID_QUERYNAME},
+ {"query_critical", required_argument, 0, 'C'},
+ {"query_warning", required_argument, 0, 'W'},
+ {"verbose", no_argument, 0, 'v'},
+ {0, 0, 0, 0}
+ };
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVt:c:w:H:P:d:l:p:a:o:q:C:W:v",
+ longopts, &option);
+
+ if (c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* usage */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 't': /* timeout period */
+ if (!is_integer (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ timeout_interval = atoi (optarg);
+ break;
+ case 'c': /* critical time threshold */
+ if (!is_nonnegative (optarg))
+ usage2 (_("Critical threshold must be a positive integer"), optarg);
+ else
+ tcrit = strtod (optarg, NULL);
+ break;
+ case 'w': /* warning time threshold */
+ if (!is_nonnegative (optarg))
+ usage2 (_("Warning threshold must be a positive integer"), optarg);
+ else
+ twarn = strtod (optarg, NULL);
+ break;
+ case 'C': /* critical query threshold */
+ query_critical = optarg;
+ break;
+ case 'W': /* warning query threshold */
+ query_warning = optarg;
+ break;
+ case 'H': /* host */
+ if ((*optarg != '/') && (!is_host (optarg)))
+ usage2 (_("Invalid hostname/address"), optarg);
+ else
+ pghost = optarg;
+ break;
+ case 'P': /* port */
+ if (!is_integer (optarg))
+ usage2 (_("Port must be a positive integer"), optarg);
+ else
+ pgport = optarg;
+ break;
+ case 'd': /* database name */
+ if (strlen(optarg) >= NAMEDATALEN) {
+ usage2 (_("Database name exceeds the maximum length"), optarg);
+ }
+ snprintf(dbName, NAMEDATALEN, "%s", optarg);
+ break;
+ case 'l': /* login name */
+ if (!is_pg_logname (optarg))
+ usage2 (_("User name is not valid"), optarg);
+ else
+ pguser = optarg;
+ break;
+ case 'p': /* authentication password */
+ case 'a':
+ pgpasswd = optarg;
+ break;
+ case 'o':
+ if (pgparams)
+ asprintf (&pgparams, "%s %s", pgparams, optarg);
+ else
+ asprintf (&pgparams, "%s", optarg);
+ break;
+ case 'q':
+ pgquery = optarg;
+ break;
+ case OPTID_QUERYNAME:
+ pgqueryname = optarg;
+ break;
+ case 'v':
+ verbose++;
+ break;
+ }
+ }
+
+ set_thresholds (&qthresholds, query_warning, query_critical);
+
+ return validate_arguments ();
+}
+
+
+/******************************************************************************
+
+@@-
+<sect3>
+<title>validate_arguments</title>
+
+<para>&PROTO_validate_arguments;</para>
+
+<para>Given a database name, this function returns TRUE if the string
+is a valid PostgreSQL database name, and returns false if it is
+not.</para>
+
+<para>Valid PostgreSQL database names are less than &NAMEDATALEN;
+characters long and consist of letters, numbers, and underscores. The
+first character cannot be a number, however.</para>
+
+</sect3>
+-@@
+******************************************************************************/
+
+
+
+int
+validate_arguments ()
+{
+ return OK;
+}
+
+/**
+
+the tango program should eventually create an entity here based on the
+function prototype
+
+@@-
+<sect3>
+<title>is_pg_logname</title>
+
+<para>&PROTO_is_pg_logname;</para>
+
+<para>Given a username, this function returns TRUE if the string is a
+valid PostgreSQL username, and returns false if it is not. Valid PostgreSQL
+usernames are less than &NAMEDATALEN; characters long and consist of
+letters, numbers, dashes, and underscores, plus possibly some other
+characters.</para>
+
+<para>Currently this function only checks string length. Additional checks
+should be added.</para>
+
+</sect3>
+-@@
+******************************************************************************/
+
+
+
+int
+is_pg_logname (char *username)
+{
+ if (strlen (username) > NAMEDATALEN - 1)
+ return (FALSE);
+ return (TRUE);
+}
+
+/******************************************************************************
+@@-
+</sect2>
+</sect1>
+</article>
+-@@
+******************************************************************************/
+
+
+
+void
+print_help (void)
+{
+ char *myport;
+
+ xasprintf (&myport, "%d", DEFAULT_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("Test whether a PostgreSQL Database is accepting connections."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'P', myport);
+
+ printf (" %s\n", "-d, --database=STRING");
+ printf (" %s", _("Database to check "));
+ printf (_("(default: %s)\n"), DEFAULT_DB);
+ printf (" %s\n", "-l, --logname = STRING");
+ printf (" %s\n", _("Login name of user"));
+ printf (" %s\n", "-p, --password = STRING");
+ printf (" %s\n", _("Password (BIG SECURITY ISSUE)"));
+ printf (" %s\n", "-o, --option = STRING");
+ printf (" %s\n", _("Connection parameters (keyword = value), see below"));
+
+ printf (UT_WARN_CRIT);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (" %s\n", "-q, --query=STRING");
+ printf (" %s\n", _("SQL query to run. Only first column in first row will be read"));
+ printf (" %s\n", "--queryname=STRING");
+ printf (" %s\n", _("A name for the query, this string is used instead of the query"));
+ printf (" %s\n", _("in the long output of the plugin"));
+ printf (" %s\n", "-W, --query-warning=RANGE");
+ printf (" %s\n", _("SQL query value to result in warning status (double)"));
+ printf (" %s\n", "-C, --query-critical=RANGE");
+ printf (" %s\n", _("SQL query value to result in critical status (double)"));
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf (" %s\n", _("All parameters are optional."));
+ printf (" %s\n", _("This plugin tests a PostgreSQL DBMS to determine whether it is active and"));
+ printf (" %s\n", _("accepting queries. In its current operation, it simply connects to the"));
+ printf (" %s\n", _("specified database, and then disconnects. If no database is specified, it"));
+ printf (" %s\n", _("connects to the template1 database, which is present in every functioning"));
+ printf (" %s\n\n", _("PostgreSQL DBMS."));
+
+ printf (" %s\n", _("If a query is specified using the -q option, it will be executed after"));
+ printf (" %s\n", _("connecting to the server. The result from the query has to be numeric."));
+ printf (" %s\n", _("Multiple SQL commands, separated by semicolon, are allowed but the result "));
+ printf (" %s\n", _("of the last command is taken into account only. The value of the first"));
+ printf (" %s\n", _("column in the first row is used as the check result. If a second column is"));
+ printf (" %s\n", _("present in the result set, this is added to the plugin output with a"));
+ printf (" %s\n", _("prefix of \"Extra Info:\". This information can be displayed in the system"));
+ printf (" %s\n\n", _("executing the plugin."));
+
+ printf (" %s\n", _("See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"));
+ printf (" %s\n\n", _("for details about how to access internal statistics of the database server."));
+
+ printf (" %s\n", _("For a list of available connection parameters which may be used with the -o"));
+ printf (" %s\n", _("command line option, see the documentation for PQconnectdb() in the chapter"));
+ printf (" %s\n", _("\"libpq - C Library\" of the PostgreSQL manual. For example, this may be"));
+ printf (" %s\n", _("used to specify a service name in pg_service.conf to be used for additional"));
+ printf (" %s\n", _("connection parameters: -o 'service=<name>' or to specify the SSL mode:"));
+ printf (" %s\n\n", _("-o 'sslmode=require'."));
+
+ printf (" %s\n", _("The plugin will connect to a local postmaster if no host is specified. To"));
+ printf (" %s\n", _("connect to a remote host, be sure that the remote postmaster accepts TCP/IP"));
+ printf (" %s\n\n", _("connections (start the postmaster with the -i option)."));
+
+ printf (" %s\n", _("Typically, the monitoring user (unless the --logname option is used) should be"));
+ printf (" %s\n", _("able to connect to the database without a password. The plugin can also send"));
+ printf (" %s\n", _("a password, but no effort is made to obscure or encrypt the password."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n", progname);
+ printf (" [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n"
+ "[-q <query>] [-C <critical query range>] [-W <warning query range>]\n");
+}
+
+int
+do_query (PGconn *conn, char *query)
+{
+ PGresult *res;
+
+ char *val_str;
+ char *extra_info;
+ double value;
+
+ char *endptr = NULL;
+
+ int my_status = STATE_UNKNOWN;
+
+ if (verbose)
+ printf ("Executing SQL query \"%s\".\n", query);
+ res = PQexec (conn, query);
+
+ if (PGRES_TUPLES_OK != PQresultStatus (res)) {
+ printf (_("QUERY %s - %s: %s.\n"), _("CRITICAL"), _("Error with query"),
+ PQerrorMessage (conn));
+ return STATE_CRITICAL;
+ }
+
+ if (PQntuples (res) < 1) {
+ printf ("QUERY %s - %s.\n", _("WARNING"), _("No rows returned"));
+ return STATE_WARNING;
+ }
+
+ if (PQnfields (res) < 1) {
+ printf ("QUERY %s - %s.\n", _("WARNING"), _("No columns returned"));
+ return STATE_WARNING;
+ }
+
+ val_str = PQgetvalue (res, 0, 0);
+ if (! val_str) {
+ printf ("QUERY %s - %s.\n", _("CRITICAL"), _("No data returned"));
+ return STATE_CRITICAL;
+ }
+
+ value = strtod (val_str, &endptr);
+ if (verbose)
+ printf ("Query result: %f\n", value);
+
+ if (endptr == val_str) {
+ printf ("QUERY %s - %s: %s\n", _("CRITICAL"), _("Is not a numeric"), val_str);
+ return STATE_CRITICAL;
+ }
+ else if ((endptr != NULL) && (*endptr != '\0')) {
+ if (verbose)
+ printf ("Garbage after value: %s.\n", endptr);
+ }
+
+ my_status = get_status (value, qthresholds);
+ printf ("QUERY %s - ",
+ (my_status == STATE_OK)
+ ? _("OK")
+ : (my_status == STATE_WARNING)
+ ? _("WARNING")
+ : (my_status == STATE_CRITICAL)
+ ? _("CRITICAL")
+ : _("UNKNOWN"));
+ if(pgqueryname) {
+ printf (_("%s returned %f"), pgqueryname, value);
+ }
+ else {
+ printf (_("'%s' returned %f"), query, value);
+ }
+
+ printf ("|query=%f;%s;%s;;\n", value,
+ query_warning ? query_warning : "",
+ query_critical ? query_critical : "");
+ if (PQnfields (res) > 1) {
+ extra_info = PQgetvalue (res, 0, 1);
+ if (extra_info != NULL) {
+ printf ("Extra Info: %s\n", extra_info);
+ }
+ }
+ return my_status;
+}
+
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
new file mode 100644
index 0000000..741f732
--- /dev/null
+++ b/plugins/check_ping.c
@@ -0,0 +1,620 @@
+/*****************************************************************************
+*
+* Monitoring check_ping plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_ping plugin
+*
+* Use the ping program to check connection statistics for a remote host.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_ping";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "popen.h"
+#include "utils.h"
+
+#include <signal.h>
+
+#define WARN_DUPLICATES "DUPLICATES FOUND! "
+#define UNKNOWN_TRIP_TIME -1.0 /* -1 seconds */
+
+enum {
+ UNKNOWN_PACKET_LOSS = 200, /* 200% */
+ DEFAULT_MAX_PACKETS = 5 /* default no. of ICMP ECHO packets */
+};
+
+int process_arguments (int, char **);
+int get_threshold (char *, float *, int *);
+int validate_arguments (void);
+int run_ping (const char *cmd, const char *addr);
+int error_scan (char buf[MAX_INPUT_BUFFER], const char *addr);
+void print_usage (void);
+void print_help (void);
+
+int display_html = FALSE;
+int wpl = UNKNOWN_PACKET_LOSS;
+int cpl = UNKNOWN_PACKET_LOSS;
+float wrta = UNKNOWN_TRIP_TIME;
+float crta = UNKNOWN_TRIP_TIME;
+char **addresses = NULL;
+int n_addresses = 0;
+int max_addr = 1;
+int max_packets = -1;
+int verbose = 0;
+
+float rta = UNKNOWN_TRIP_TIME;
+int pl = UNKNOWN_PACKET_LOSS;
+
+char *warn_text;
+
+
+
+int
+main (int argc, char **argv)
+{
+ char *cmd = NULL;
+ char *rawcmd = NULL;
+ int result = STATE_UNKNOWN;
+ int this_result = STATE_UNKNOWN;
+ int i;
+
+ setlocale (LC_ALL, "");
+ setlocale (LC_NUMERIC, "C");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ addresses = malloc (sizeof(char*) * max_addr);
+ addresses[0] = NULL;
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* Set signal handling and alarm */
+ if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) {
+ usage4 (_("Cannot catch SIGALRM"));
+ }
+
+ /* If ./configure finds ping has timeout values, set plugin alarm slightly
+ * higher so that we can use response from command line ping */
+#if defined(PING_PACKETS_FIRST) && defined(PING_HAS_TIMEOUT)
+ alarm (timeout_interval + 1);
+#else
+ alarm (timeout_interval);
+#endif
+
+ for (i = 0 ; i < n_addresses ; i++) {
+
+#ifdef PING6_COMMAND
+ if (address_family != AF_INET && is_inet6_addr(addresses[i]))
+ rawcmd = strdup(PING6_COMMAND);
+ else
+ rawcmd = strdup(PING_COMMAND);
+#else
+ rawcmd = strdup(PING_COMMAND);
+#endif
+
+ /* does the host address of number of packets argument come first? */
+#ifdef PING_PACKETS_FIRST
+# ifdef PING_HAS_TIMEOUT
+ xasprintf (&cmd, rawcmd, timeout_interval, max_packets, addresses[i]);
+# else
+ xasprintf (&cmd, rawcmd, max_packets, addresses[i]);
+# endif
+#else
+ xasprintf (&cmd, rawcmd, addresses[i], max_packets);
+#endif
+
+ if (verbose >= 2)
+ printf ("CMD: %s\n", cmd);
+
+ /* run the command */
+ this_result = run_ping (cmd, addresses[i]);
+
+ if (pl == UNKNOWN_PACKET_LOSS || rta < 0.0) {
+ printf ("%s\n", cmd);
+ die (STATE_UNKNOWN,
+ _("CRITICAL - Could not interpret output from ping command\n"));
+ }
+
+ if (pl >= cpl || rta >= crta || rta < 0)
+ this_result = STATE_CRITICAL;
+ else if (pl >= wpl || rta >= wrta)
+ this_result = STATE_WARNING;
+ else if (pl >= 0 && rta >= 0)
+ this_result = max_state (STATE_OK, this_result);
+
+ if (n_addresses > 1 && this_result != STATE_UNKNOWN)
+ die (STATE_OK, "%s is alive\n", addresses[i]);
+
+ if (display_html == TRUE)
+ printf ("<A HREF='%s/traceroute.cgi?%s'>", CGIURL, addresses[i]);
+ if (pl == 100)
+ printf (_("PING %s - %sPacket loss = %d%%"), state_text (this_result), warn_text,
+ pl);
+ else
+ printf (_("PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"),
+ state_text (this_result), warn_text, pl, rta);
+ if (display_html == TRUE)
+ printf ("</A>");
+
+ /* Print performance data */
+ if (pl != 100) {
+ printf("|%s", fperfdata ("rta", (double) rta, "ms",
+ wrta>0?TRUE:FALSE, wrta,
+ crta>0?TRUE:FALSE, crta,
+ TRUE, 0, FALSE, 0));
+ } else {
+ printf("| rta=U;%f;%f;;", wrta, crta);
+ }
+ printf(" %s\n", perfdata ("pl", (long) pl, "%",
+ wpl>0?TRUE:FALSE, wpl,
+ cpl>0?TRUE:FALSE, cpl,
+ TRUE, 0, FALSE, 0));
+
+ if (verbose >= 2)
+ printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl);
+
+ result = max_state (result, this_result);
+ free (rawcmd);
+ free (cmd);
+ }
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c = 1;
+ char *ptr;
+
+ int option = 0;
+ static struct option longopts[] = {
+ STD_LONG_OPTS,
+ {"packets", required_argument, 0, 'p'},
+ {"nohtml", no_argument, 0, 'n'},
+ {"link", no_argument, 0, 'L'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ if (strcmp ("-nohtml", argv[c]) == 0)
+ strcpy (argv[c], "-n");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "VvhnL46t:c:w:H:p:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* usage */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ break;
+ case 't': /* timeout period */
+ timeout_interval = atoi (optarg);
+ break;
+ case 'v': /* verbose mode */
+ verbose++;
+ break;
+ case '4': /* IPv4 only */
+ address_family = AF_INET;
+ break;
+ case '6': /* IPv6 only */
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage (_("IPv6 support not available\n"));
+#endif
+ break;
+ case 'H': /* hostname */
+ ptr=optarg;
+ while (1) {
+ n_addresses++;
+ if (n_addresses > max_addr) {
+ max_addr *= 2;
+ addresses = realloc (addresses, sizeof(char*) * max_addr);
+ if (addresses == NULL)
+ die (STATE_UNKNOWN, _("Could not realloc() addresses\n"));
+ }
+ addresses[n_addresses-1] = ptr;
+ if ((ptr = index (ptr, ','))) {
+ strcpy (ptr, "");
+ ptr += sizeof(char);
+ } else {
+ break;
+ }
+ }
+ break;
+ case 'p': /* number of packets to send */
+ if (is_intnonneg (optarg))
+ max_packets = atoi (optarg);
+ else
+ usage2 (_("<max_packets> (%s) must be a non-negative number\n"), optarg);
+ break;
+ case 'n': /* no HTML */
+ display_html = FALSE;
+ break;
+ case 'L': /* show HTML */
+ display_html = TRUE;
+ break;
+ case 'c':
+ get_threshold (optarg, &crta, &cpl);
+ break;
+ case 'w':
+ get_threshold (optarg, &wrta, &wpl);
+ break;
+ }
+ }
+
+ c = optind;
+ if (c == argc)
+ return validate_arguments ();
+
+ if (addresses[0] == NULL) {
+ if (is_host (argv[c]) == FALSE) {
+ usage2 (_("Invalid hostname/address"), argv[c]);
+ } else {
+ addresses[0] = argv[c++];
+ n_addresses++;
+ if (c == argc)
+ return validate_arguments ();
+ }
+ }
+
+ if (wpl == UNKNOWN_PACKET_LOSS) {
+ if (is_intpercent (argv[c]) == FALSE) {
+ printf (_("<wpl> (%s) must be an integer percentage\n"), argv[c]);
+ return ERROR;
+ } else {
+ wpl = atoi (argv[c++]);
+ if (c == argc)
+ return validate_arguments ();
+ }
+ }
+
+ if (cpl == UNKNOWN_PACKET_LOSS) {
+ if (is_intpercent (argv[c]) == FALSE) {
+ printf (_("<cpl> (%s) must be an integer percentage\n"), argv[c]);
+ return ERROR;
+ } else {
+ cpl = atoi (argv[c++]);
+ if (c == argc)
+ return validate_arguments ();
+ }
+ }
+
+ if (wrta < 0.0) {
+ if (is_negative (argv[c])) {
+ printf (_("<wrta> (%s) must be a non-negative number\n"), argv[c]);
+ return ERROR;
+ } else {
+ wrta = atof (argv[c++]);
+ if (c == argc)
+ return validate_arguments ();
+ }
+ }
+
+ if (crta < 0.0) {
+ if (is_negative (argv[c])) {
+ printf (_("<crta> (%s) must be a non-negative number\n"), argv[c]);
+ return ERROR;
+ } else {
+ crta = atof (argv[c++]);
+ if (c == argc)
+ return validate_arguments ();
+ }
+ }
+
+ if (max_packets == -1) {
+ if (is_intnonneg (argv[c])) {
+ max_packets = atoi (argv[c++]);
+ } else {
+ printf (_("<max_packets> (%s) must be a non-negative number\n"), argv[c]);
+ return ERROR;
+ }
+ }
+
+ return validate_arguments ();
+}
+
+
+
+int
+get_threshold (char *arg, float *trta, int *tpl)
+{
+ if (is_intnonneg (arg) && sscanf (arg, "%f", trta) == 1)
+ return OK;
+ else if (strpbrk (arg, ",:") && strstr (arg, "%") && sscanf (arg, "%f%*[:,]%d%%", trta, tpl) == 2)
+ return OK;
+ else if (strstr (arg, "%") && sscanf (arg, "%d%%", tpl) == 1)
+ return OK;
+
+ usage2 (_("%s: Warning threshold must be integer or percentage!\n\n"), arg);
+ return STATE_UNKNOWN;
+}
+
+
+
+int
+validate_arguments ()
+{
+ float max_seconds;
+ int i;
+
+ if (wrta < 0.0) {
+ printf (_("<wrta> was not set\n"));
+ return ERROR;
+ }
+ else if (crta < 0.0) {
+ printf (_("<crta> was not set\n"));
+ return ERROR;
+ }
+ else if (wpl == UNKNOWN_PACKET_LOSS) {
+ printf (_("<wpl> was not set\n"));
+ return ERROR;
+ }
+ else if (cpl == UNKNOWN_PACKET_LOSS) {
+ printf (_("<cpl> was not set\n"));
+ return ERROR;
+ }
+ else if (wrta > crta) {
+ printf (_("<wrta> (%f) cannot be larger than <crta> (%f)\n"), wrta, crta);
+ return ERROR;
+ }
+ else if (wpl > cpl) {
+ printf (_("<wpl> (%d) cannot be larger than <cpl> (%d)\n"), wpl, cpl);
+ return ERROR;
+ }
+
+ if (max_packets == -1)
+ max_packets = DEFAULT_MAX_PACKETS;
+
+ max_seconds = crta / 1000.0 * max_packets + max_packets;
+ if (max_seconds > timeout_interval)
+ timeout_interval = (int)max_seconds;
+
+ for (i=0; i<n_addresses; i++) {
+ if (is_host(addresses[i]) == FALSE)
+ usage2 (_("Invalid hostname/address"), addresses[i]);
+ }
+
+ if (n_addresses == 0) {
+ usage (_("You must specify a server address or host name"));
+ }
+
+ return OK;
+}
+
+
+
+int
+run_ping (const char *cmd, const char *addr)
+{
+ char buf[MAX_INPUT_BUFFER];
+ int result = STATE_UNKNOWN;
+ int match;
+
+ if ((child_process = spopen (cmd)) == NULL)
+ die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd);
+
+ child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
+ if (child_stderr == NULL)
+ printf (_("Cannot open stderr for %s\n"), cmd);
+
+ while (fgets (buf, MAX_INPUT_BUFFER - 1, child_process)) {
+
+ if (verbose >= 3)
+ printf("Output: %s", buf);
+
+ result = max_state (result, error_scan (buf, addr));
+
+ /* get the percent loss statistics */
+ match = 0;
+ if((sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
+ (sscanf(buf,"%*[^(](%d%% %*[^)])%n",&pl,&match) && match)
+ )
+ continue;
+
+ /* get the round trip average */
+ else
+ if((sscanf(buf,"round-trip min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) ||
+ (sscanf(buf,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+ (sscanf(buf,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+ (sscanf(buf,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+ (sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+ (sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) ||
+ (sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+ (sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms%n",&rta,&match) && match) ||
+ (sscanf(buf, "%*[^=] = %*fms, %*[^=] = %*fms, %*[^=] = %fms%n", &rta, &match) && match)
+ )
+ continue;
+ }
+
+ /* this is needed because there is no rta if all packets are lost */
+ if (pl == 100)
+ rta = crta;
+
+ /* check stderr, setting at least WARNING if there is output here */
+ /* Add warning into warn_text */
+ while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) {
+ if (
+ ! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP")
+ && ! strstr(buf,"Warning: time of day goes back")
+
+ ) {
+ if (verbose >= 3) {
+ printf("Got stderr: %s", buf);
+ }
+ if ((result=error_scan(buf, addr)) == STATE_OK) {
+ result = STATE_WARNING;
+ if (warn_text == NULL) {
+ warn_text = strdup(_("System call sent warnings to stderr "));
+ } else {
+ xasprintf(&warn_text, "%s %s", warn_text, _("System call sent warnings to stderr "));
+ }
+ }
+ }
+ }
+
+ (void) fclose (child_stderr);
+
+
+ spclose (child_process);
+
+ if (warn_text == NULL)
+ warn_text = strdup("");
+
+ return result;
+}
+
+
+
+int
+error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
+{
+ if (strstr (buf, "Network is unreachable") ||
+ strstr (buf, "Destination Net Unreachable") ||
+ strstr (buf, "No route")
+ )
+ die (STATE_CRITICAL, _("CRITICAL - Network Unreachable (%s)\n"), addr);
+ else if (strstr (buf, "Destination Host Unreachable") || strstr(buf, "Address unreachable"))
+ die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)\n"), addr);
+ else if (strstr (buf, "Destination Port Unreachable") || strstr(buf, "Port unreachable"))
+ die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"), addr);
+ else if (strstr (buf, "Destination Protocol Unreachable"))
+ die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"), addr);
+ else if (strstr (buf, "Destination Net Prohibited"))
+ die (STATE_CRITICAL, _("CRITICAL - Network Prohibited (%s)\n"), addr);
+ else if (strstr (buf, "Destination Host Prohibited"))
+ die (STATE_CRITICAL, _("CRITICAL - Host Prohibited (%s)\n"), addr);
+ else if (strstr (buf, "Packet filtered") || strstr(buf, "Administratively prohibited"))
+ die (STATE_CRITICAL, _("CRITICAL - Packet Filtered (%s)\n"), addr);
+ else if (strstr (buf, "unknown host" ))
+ die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)\n"), addr);
+ else if (strstr (buf, "Time to live exceeded") || strstr(buf, "Time exceeded"))
+ die (STATE_CRITICAL, _("CRITICAL - Time to live exceeded (%s)\n"), addr);
+ else if (strstr (buf, "Destination unreachable: "))
+ die (STATE_CRITICAL, _("CRITICAL - Destination Unreachable (%s)\n"), addr);
+
+ if (strstr (buf, "(DUP!)") || strstr (buf, "DUPLICATES FOUND")) {
+ if (warn_text == NULL)
+ warn_text = strdup (_(WARN_DUPLICATES));
+ else if (! strstr (warn_text, _(WARN_DUPLICATES)) &&
+ xasprintf (&warn_text, "%s %s", warn_text, _(WARN_DUPLICATES)) == -1)
+ die (STATE_UNKNOWN, _("Unable to realloc warn_text\n"));
+ return (STATE_WARNING);
+ }
+
+ return (STATE_OK);
+}
+
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("Use ping to check connection statistics for a remote host."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_IPv46);
+
+ printf (" %s\n", "-H, --hostname=HOST");
+ printf (" %s\n", _("host to ping"));
+ printf (" %s\n", "-w, --warning=THRESHOLD");
+ printf (" %s\n", _("warning threshold pair"));
+ printf (" %s\n", "-c, --critical=THRESHOLD");
+ printf (" %s\n", _("critical threshold pair"));
+ printf (" %s\n", "-p, --packets=INTEGER");
+ printf (" %s ", _("number of ICMP ECHO packets to send"));
+ printf (_("(Default: %d)\n"), DEFAULT_MAX_PACKETS);
+ printf (" %s\n", "-L, --link");
+ printf (" %s\n", _("show HTML in the plugin output (obsoleted by urlize)"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf ("\n");
+ printf ("%s\n", _("THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"));
+ printf ("%s\n", _("time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"));
+ printf ("%s\n", _("percentage of packet loss to trigger an alarm state."));
+
+ printf ("\n");
+ printf ("%s\n", _("This plugin uses the ping command to probe the specified host for packet loss"));
+ printf ("%s\n", _("(percentage) and round trip average (milliseconds). It can produce HTML output"));
+ printf ("%s\n", _("linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"));
+ printf ("%s\n", _("the contrib area of the downloads section at http://www.nagios.org/"));
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n", progname);
+ printf (" [-p packets] [-t timeout] [-4|-6]\n");
+}
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
new file mode 100644
index 0000000..1637e3e
--- /dev/null
+++ b/plugins/check_procs.c
@@ -0,0 +1,834 @@
+/*****************************************************************************
+*
+* Monitoring check_procs plugin
+*
+* License: GPL
+* Copyright (c) 2000-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_procs plugin
+*
+* Checks all processes and generates WARNING or CRITICAL states if the
+* specified metric is outside the required threshold ranges. The metric
+* defaults to number of processes. Search filters can be applied to limit
+* the processes to check.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_procs";
+const char *program_name = "check_procs"; /* Required for coreutils libs */
+const char *copyright = "2000-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "utils_cmd.h"
+#include "regex.h"
+
+#include <pwd.h>
+#include <errno.h>
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+int convert_to_seconds (char *);
+void print_help (void);
+void print_usage (void);
+
+char *warning_range = NULL;
+char *critical_range = NULL;
+thresholds *procs_thresholds = NULL;
+
+int options = 0; /* bitmask of filter criteria to test against */
+#define ALL 1
+#define STAT 2
+#define PPID 4
+#define USER 8
+#define PROG 16
+#define ARGS 32
+#define VSZ 64
+#define RSS 128
+#define PCPU 256
+#define ELAPSED 512
+#define EREG_ARGS 1024
+#define EXCLUDE_PROGS 2048
+
+#define KTHREAD_PARENT "kthreadd" /* the parent process of kernel threads:
+ ppid of procs are compared to pid of this proc*/
+
+/* Different metrics */
+char *metric_name;
+enum metric {
+ METRIC_PROCS,
+ METRIC_VSZ,
+ METRIC_RSS,
+ METRIC_CPU,
+ METRIC_ELAPSED
+};
+enum metric metric = METRIC_PROCS;
+
+int verbose = 0;
+int uid;
+pid_t ppid;
+int vsz;
+int rss;
+float pcpu;
+char *statopts;
+char *prog;
+char *exclude_progs;
+char **exclude_progs_arr = NULL;
+char exclude_progs_counter = 0;
+char *args;
+char *input_filename = NULL;
+regex_t re_args;
+char *fmt;
+char *fails;
+char tmp[MAX_INPUT_BUFFER];
+int kthread_filter = 0;
+int usepid = 0; /* whether to test for pid or /proc/pid/exe */
+
+FILE *ps_input = NULL;
+
+static int
+stat_exe (const pid_t pid, struct stat *buf) {
+ char *path;
+ int ret;
+ xasprintf(&path, "/proc/%d/exe", pid);
+ ret = stat(path, buf);
+ free(path);
+ return ret;
+}
+
+
+int
+main (int argc, char **argv)
+{
+ char *input_buffer;
+ char *input_line;
+ char *procprog;
+
+ pid_t mypid = 0;
+ pid_t myppid = 0;
+ struct stat statbuf;
+ dev_t mydev = 0;
+ ino_t myino = 0;
+ int procuid = 0;
+ pid_t procpid = 0;
+ pid_t procppid = 0;
+ pid_t kthread_ppid = 0;
+ int procvsz = 0;
+ int procrss = 0;
+ int procseconds = 0;
+ float procpcpu = 0;
+ char procstat[8];
+ char procetime[MAX_INPUT_BUFFER] = { '\0' };
+ char *procargs;
+
+ const char *zombie = "Z";
+
+ int resultsum = 0; /* bitmask of the filter criteria met by a process */
+ int found = 0; /* counter for number of lines returned in `ps` output */
+ int procs = 0; /* counter for number of processes meeting filter criteria */
+ int pos; /* number of spaces before 'args' in `ps` output */
+ int cols; /* number of columns in ps output */
+ int expected_cols = PS_COLS - 1;
+ int warn = 0; /* number of processes in warn state */
+ int crit = 0; /* number of processes in crit state */
+ int i = 0, j = 0;
+ int result = STATE_UNKNOWN;
+ int ret = 0;
+ output chld_out, chld_err;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ setlocale(LC_NUMERIC, "POSIX");
+
+ input_buffer = malloc (MAX_INPUT_BUFFER);
+ procprog = malloc (MAX_INPUT_BUFFER);
+
+ xasprintf (&metric_name, "PROCS");
+ metric = METRIC_PROCS;
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* find ourself */
+ mypid = getpid();
+ myppid = getppid();
+ if (usepid || stat_exe(mypid, &statbuf) == -1) {
+ /* usepid might have been set by -T */
+ usepid = 1;
+ } else {
+ usepid = 0;
+ mydev = statbuf.st_dev;
+ myino = statbuf.st_ino;
+ }
+
+ /* Set signal handling and alarm timeout */
+ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
+ die (STATE_UNKNOWN, _("Cannot catch SIGALRM"));
+ }
+ (void) alarm ((unsigned) timeout_interval);
+
+ if (verbose >= 2)
+ printf (_("CMD: %s\n"), PS_COMMAND);
+
+ if (input_filename == NULL) {
+ result = cmd_run( PS_COMMAND, &chld_out, &chld_err, 0);
+ if (chld_err.lines > 0) {
+ printf ("%s: %s", _("System call sent warnings to stderr"), chld_err.line[0]);
+ exit(STATE_WARNING);
+ }
+ } else {
+ result = cmd_file_read( input_filename, &chld_out, 0);
+ }
+
+ /* flush first line: j starts at 1 */
+ for (j = 1; j < chld_out.lines; j++) {
+ input_line = chld_out.line[j];
+
+ if (verbose >= 3)
+ printf ("%s", input_line);
+
+ strcpy (procprog, "");
+ xasprintf (&procargs, "%s", "");
+
+ cols = sscanf (input_line, PS_FORMAT, PS_VARLIST);
+
+ /* Zombie processes do not give a procprog command */
+ if ( cols < expected_cols && strstr(procstat, zombie) ) {
+ cols = expected_cols;
+ }
+ if ( cols >= expected_cols ) {
+ resultsum = 0;
+ xasprintf (&procargs, "%s", input_line + pos);
+ strip (procargs);
+
+ /* Some ps return full pathname for command. This removes path */
+ strcpy(procprog, base_name(procprog));
+
+ /* we need to convert the elapsed time to seconds */
+ procseconds = convert_to_seconds(procetime);
+
+ if (verbose >= 3)
+ printf ("proc#=%d uid=%d vsz=%d rss=%d pid=%d ppid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n",
+ procs, procuid, procvsz, procrss,
+ procpid, procppid, procpcpu, procstat,
+ procetime, procprog, procargs);
+
+ /* Ignore self */
+ if ((usepid && mypid == procpid) ||
+ ( ((!usepid) && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino)) ||
+ (ret == -1 && errno == ENOENT))
+ ) {
+ if (verbose >= 3)
+ printf("not considering - is myself or gone\n");
+ continue;
+ }
+ /* Ignore parent*/
+ else if (myppid == procpid) {
+ if (verbose >= 3)
+ printf("not considering - is parent\n");
+ continue;
+ }
+
+ /* Ignore excluded processes by name */
+ if(options & EXCLUDE_PROGS) {
+ int found = 0;
+ int i = 0;
+
+ for(i=0; i < (exclude_progs_counter); i++) {
+ if(!strcmp(procprog, exclude_progs_arr[i])) {
+ found = 1;
+ }
+ }
+ if(found == 0) {
+ resultsum |= EXCLUDE_PROGS;
+ } else
+ {
+ if(verbose >= 3)
+ printf("excluding - by ignorelist\n");
+ }
+ }
+
+ /* filter kernel threads (children of KTHREAD_PARENT)*/
+ /* TODO adapt for other OSes than GNU/Linux
+ sorry for not doing that, but I've no other OSes to test :-( */
+ if (kthread_filter == 1) {
+ /* get pid KTHREAD_PARENT */
+ if (kthread_ppid == 0 && !strcmp(procprog, KTHREAD_PARENT) )
+ kthread_ppid = procpid;
+
+ if (kthread_ppid == procppid) {
+ if (verbose >= 2)
+ printf ("Ignore kernel thread: pid=%d ppid=%d prog=%s args=%s\n", procpid, procppid, procprog, procargs);
+ continue;
+ }
+ }
+
+ if ((options & STAT) && (strstr (procstat, statopts)))
+ resultsum |= STAT;
+ if ((options & ARGS) && procargs && (strstr (procargs, args) != NULL))
+ resultsum |= ARGS;
+ if ((options & EREG_ARGS) && procargs && (regexec(&re_args, procargs, (size_t) 0, NULL, 0) == 0))
+ resultsum |= EREG_ARGS;
+ if ((options & PROG) && procprog && (strcmp (prog, procprog) == 0))
+ resultsum |= PROG;
+ if ((options & PPID) && (procppid == ppid))
+ resultsum |= PPID;
+ if ((options & USER) && (procuid == uid))
+ resultsum |= USER;
+ if ((options & VSZ) && (procvsz >= vsz))
+ resultsum |= VSZ;
+ if ((options & RSS) && (procrss >= rss))
+ resultsum |= RSS;
+ if ((options & PCPU) && (procpcpu >= pcpu))
+ resultsum |= PCPU;
+
+ found++;
+
+ /* Next line if filters not matched */
+ if (!(options == resultsum || options == ALL))
+ continue;
+
+ procs++;
+ if (verbose >= 2) {
+ printf ("Matched: uid=%d vsz=%d rss=%d pid=%d ppid=%d pcpu=%.2f stat=%s etime=%s prog=%s args=%s\n",
+ procuid, procvsz, procrss,
+ procpid, procppid, procpcpu, procstat,
+ procetime, procprog, procargs);
+ }
+
+ if (metric == METRIC_VSZ)
+ i = get_status ((double)procvsz, procs_thresholds);
+ else if (metric == METRIC_RSS)
+ i = get_status ((double)procrss, procs_thresholds);
+ /* TODO? float thresholds for --metric=CPU */
+ else if (metric == METRIC_CPU)
+ i = get_status (procpcpu, procs_thresholds);
+ else if (metric == METRIC_ELAPSED)
+ i = get_status ((double)procseconds, procs_thresholds);
+
+ if (metric != METRIC_PROCS) {
+ if (i == STATE_WARNING) {
+ warn++;
+ xasprintf (&fails, "%s%s%s", fails, (strcmp(fails,"") ? ", " : ""), procprog);
+ result = max_state (result, i);
+ }
+ if (i == STATE_CRITICAL) {
+ crit++;
+ xasprintf (&fails, "%s%s%s", fails, (strcmp(fails,"") ? ", " : ""), procprog);
+ result = max_state (result, i);
+ }
+ }
+ }
+ /* This should not happen */
+ else if (verbose) {
+ printf(_("Not parseable: %s"), input_buffer);
+ }
+ }
+
+ if (found == 0) { /* no process lines parsed so return STATE_UNKNOWN */
+ printf (_("Unable to read output\n"));
+ return STATE_UNKNOWN;
+ }
+
+ if ( result == STATE_UNKNOWN )
+ result = STATE_OK;
+
+ /* Needed if procs found, but none match filter */
+ if ( metric == METRIC_PROCS ) {
+ result = max_state (result, get_status ((double)procs, procs_thresholds) );
+ }
+
+ if ( result == STATE_OK ) {
+ printf ("%s %s: ", metric_name, _("OK"));
+ } else if (result == STATE_WARNING) {
+ printf ("%s %s: ", metric_name, _("WARNING"));
+ if ( metric != METRIC_PROCS ) {
+ printf (_("%d warn out of "), warn);
+ }
+ } else if (result == STATE_CRITICAL) {
+ printf ("%s %s: ", metric_name, _("CRITICAL"));
+ if (metric != METRIC_PROCS) {
+ printf (_("%d crit, %d warn out of "), crit, warn);
+ }
+ }
+ printf (ngettext ("%d process", "%d processes", (unsigned long) procs), procs);
+
+ if (strcmp(fmt,"") != 0) {
+ printf (_(" with %s"), fmt);
+ }
+
+ if ( verbose >= 1 && strcmp(fails,"") )
+ printf (" [%s]", fails);
+
+ if (metric == METRIC_PROCS)
+ printf (" | procs=%d;%s;%s;0;", procs,
+ warning_range ? warning_range : "",
+ critical_range ? critical_range : "");
+ else
+ printf (" | procs=%d;;;0; procs_warn=%d;;;0; procs_crit=%d;;;0;", procs, warn, crit);
+
+ printf ("\n");
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c = 1;
+ char *user;
+ struct passwd *pw;
+ int option = 0;
+ int err;
+ int cflags = REG_NOSUB | REG_EXTENDED;
+ char errbuf[MAX_INPUT_BUFFER];
+ char *temp_string;
+ int i=0;
+ static struct option longopts[] = {
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"metric", required_argument, 0, 'm'},
+ {"timeout", required_argument, 0, 't'},
+ {"status", required_argument, 0, 's'},
+ {"ppid", required_argument, 0, 'p'},
+ {"user", required_argument, 0, 'u'},
+ {"command", required_argument, 0, 'C'},
+ {"vsz", required_argument, 0, 'z'},
+ {"rss", required_argument, 0, 'r'},
+ {"pcpu", required_argument, 0, 'P'},
+ {"elapsed", required_argument, 0, 'e'},
+ {"argument-array", required_argument, 0, 'a'},
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"verbose", no_argument, 0, 'v'},
+ {"ereg-argument-array", required_argument, 0, CHAR_MAX+1},
+ {"input-file", required_argument, 0, CHAR_MAX+2},
+ {"no-kthreads", required_argument, 0, 'k'},
+ {"traditional-filter", no_argument, 0, 'T'},
+ {"exclude-process", required_argument, 0, 'X'},
+ {0, 0, 0, 0}
+ };
+
+ for (c = 1; c < argc; c++)
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+
+ while (1) {
+ c = getopt_long (argc, argv, "Vvhkt:c:w:p:s:u:C:a:z:r:m:P:T:X:",
+ longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* help */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 't': /* timeout period */
+ if (!is_integer (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ timeout_interval = atoi (optarg);
+ break;
+ case 'c': /* critical threshold */
+ critical_range = optarg;
+ break;
+ case 'w': /* warning threshold */
+ warning_range = optarg;
+ break;
+ case 'p': /* process id */
+ if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) {
+ xasprintf (&fmt, "%s%sPPID = %d", (fmt ? fmt : "") , (options ? ", " : ""), ppid);
+ options |= PPID;
+ break;
+ }
+ usage4 (_("Parent Process ID must be an integer!"));
+ case 's': /* status */
+ if (statopts)
+ break;
+ else
+ statopts = optarg;
+ xasprintf (&fmt, _("%s%sSTATE = %s"), (fmt ? fmt : ""), (options ? ", " : ""), statopts);
+ options |= STAT;
+ break;
+ case 'u': /* user or user id */
+ if (is_integer (optarg)) {
+ uid = atoi (optarg);
+ pw = getpwuid ((uid_t) uid);
+ /* check to be sure user exists */
+ if (pw == NULL)
+ usage2 (_("UID was not found"), optarg);
+ }
+ else {
+ pw = getpwnam (optarg);
+ /* check to be sure user exists */
+ if (pw == NULL)
+ usage2 (_("User name was not found"), optarg);
+ /* then get uid */
+ uid = pw->pw_uid;
+ }
+ user = pw->pw_name;
+ xasprintf (&fmt, "%s%sUID = %d (%s)", (fmt ? fmt : ""), (options ? ", " : ""),
+ uid, user);
+ options |= USER;
+ break;
+ case 'C': /* command */
+ /* TODO: allow this to be passed in with --metric */
+ if (prog)
+ break;
+ else
+ prog = optarg;
+ xasprintf (&fmt, _("%s%scommand name '%s'"), (fmt ? fmt : ""), (options ? ", " : ""),
+ prog);
+ options |= PROG;
+ break;
+ case 'X':
+ if(exclude_progs)
+ break;
+ else
+ exclude_progs = optarg;
+ xasprintf (&fmt, _("%s%sexclude progs '%s'"), (fmt ? fmt : ""), (options ? ", " : ""),
+ exclude_progs);
+ char *p = strtok(exclude_progs, ",");
+
+ while(p){
+ exclude_progs_arr = realloc(exclude_progs_arr, sizeof(char*) * ++exclude_progs_counter);
+ exclude_progs_arr[exclude_progs_counter-1] = p;
+ p = strtok(NULL, ",");
+ }
+
+ options |= EXCLUDE_PROGS;
+ break;
+ case 'a': /* args (full path name with args) */
+ /* TODO: allow this to be passed in with --metric */
+ if (args)
+ break;
+ else
+ args = optarg;
+ xasprintf (&fmt, "%s%sargs '%s'", (fmt ? fmt : ""), (options ? ", " : ""), args);
+ options |= ARGS;
+ break;
+ case CHAR_MAX+1:
+ err = regcomp(&re_args, optarg, cflags);
+ if (err != 0) {
+ regerror (err, &re_args, errbuf, MAX_INPUT_BUFFER);
+ die (STATE_UNKNOWN, "PROCS %s: %s - %s\n", _("UNKNOWN"), _("Could not compile regular expression"), errbuf);
+ }
+ /* Strip off any | within the regex optarg */
+ temp_string = strdup(optarg);
+ while(temp_string[i]!='\0'){
+ if(temp_string[i]=='|')
+ temp_string[i]=',';
+ i++;
+ }
+ xasprintf (&fmt, "%s%sregex args '%s'", (fmt ? fmt : ""), (options ? ", " : ""), temp_string);
+ options |= EREG_ARGS;
+ break;
+ case 'r': /* RSS */
+ if (sscanf (optarg, "%d%[^0-9]", &rss, tmp) == 1) {
+ xasprintf (&fmt, "%s%sRSS >= %d", (fmt ? fmt : ""), (options ? ", " : ""), rss);
+ options |= RSS;
+ break;
+ }
+ usage4 (_("RSS must be an integer!"));
+ case 'z': /* VSZ */
+ if (sscanf (optarg, "%d%[^0-9]", &vsz, tmp) == 1) {
+ xasprintf (&fmt, "%s%sVSZ >= %d", (fmt ? fmt : ""), (options ? ", " : ""), vsz);
+ options |= VSZ;
+ break;
+ }
+ usage4 (_("VSZ must be an integer!"));
+ case 'P': /* PCPU */
+ /* TODO: -P 1.5.5 is accepted */
+ if (sscanf (optarg, "%f%[^0-9.]", &pcpu, tmp) == 1) {
+ xasprintf (&fmt, "%s%sPCPU >= %.2f", (fmt ? fmt : ""), (options ? ", " : ""), pcpu);
+ options |= PCPU;
+ break;
+ }
+ usage4 (_("PCPU must be a float!"));
+ case 'm':
+ xasprintf (&metric_name, "%s", optarg);
+ if ( strcmp(optarg, "PROCS") == 0) {
+ metric = METRIC_PROCS;
+ break;
+ }
+ else if ( strcmp(optarg, "VSZ") == 0) {
+ metric = METRIC_VSZ;
+ break;
+ }
+ else if ( strcmp(optarg, "RSS") == 0 ) {
+ metric = METRIC_RSS;
+ break;
+ }
+ else if ( strcmp(optarg, "CPU") == 0 ) {
+ metric = METRIC_CPU;
+ break;
+ }
+ else if ( strcmp(optarg, "ELAPSED") == 0) {
+ metric = METRIC_ELAPSED;
+ break;
+ }
+
+ usage4 (_("Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"));
+ case 'k': /* linux kernel thread filter */
+ kthread_filter = 1;
+ break;
+ case 'v': /* command */
+ verbose++;
+ break;
+ case 'T':
+ usepid = 1;
+ break;
+ case CHAR_MAX+2:
+ input_filename = optarg;
+ break;
+ }
+ }
+
+ c = optind;
+ if ((! warning_range) && argv[c])
+ warning_range = argv[c++];
+ if ((! critical_range) && argv[c])
+ critical_range = argv[c++];
+ if (statopts == NULL && argv[c]) {
+ xasprintf (&statopts, "%s", argv[c++]);
+ xasprintf (&fmt, _("%s%sSTATE = %s"), (fmt ? fmt : ""), (options ? ", " : ""), statopts);
+ options |= STAT;
+ }
+
+ /* this will abort in case of invalid ranges */
+ set_thresholds (&procs_thresholds, warning_range, critical_range);
+
+ return validate_arguments ();
+}
+
+
+
+int
+validate_arguments ()
+{
+ if (options == 0)
+ options = ALL;
+
+ if (statopts==NULL)
+ statopts = strdup("");
+
+ if (prog==NULL)
+ prog = strdup("");
+
+ if (args==NULL)
+ args = strdup("");
+
+ if (fmt==NULL)
+ fmt = strdup("");
+
+ if (fails==NULL)
+ fails = strdup("");
+
+ return options;
+}
+
+
+/* convert the elapsed time to seconds */
+int
+convert_to_seconds(char *etime) {
+
+ char *ptr;
+ int total;
+
+ int hyphcnt;
+ int coloncnt;
+ int days;
+ int hours;
+ int minutes;
+ int seconds;
+
+ hyphcnt = 0;
+ coloncnt = 0;
+ days = 0;
+ hours = 0;
+ minutes = 0;
+ seconds = 0;
+
+ for (ptr = etime; *ptr != '\0'; ptr++) {
+
+ if (*ptr == '-') {
+ hyphcnt++;
+ continue;
+ }
+ if (*ptr == ':') {
+ coloncnt++;
+ continue;
+ }
+ }
+
+ if (hyphcnt > 0) {
+ sscanf(etime, "%d-%d:%d:%d",
+ &days, &hours, &minutes, &seconds);
+ /* linux 2.6.5/2.6.6 reporting some processes with infinite
+ * elapsed times for some reason */
+ if (days == 49710) {
+ return 0;
+ }
+ } else {
+ if (coloncnt == 2) {
+ sscanf(etime, "%d:%d:%d",
+ &hours, &minutes, &seconds);
+ } else if (coloncnt == 1) {
+ sscanf(etime, "%d:%d",
+ &minutes, &seconds);
+ }
+ }
+
+ total = (days * 86400) +
+ (hours * 3600) +
+ (minutes * 60) +
+ seconds;
+
+ if (verbose >= 3 && metric == METRIC_ELAPSED) {
+ printf("seconds: %d\n", total);
+ }
+ return total;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("Checks all processes and generates WARNING or CRITICAL states if the specified"));
+ printf ("%s\n", _("metric is outside the required threshold ranges. The metric defaults to number"));
+ printf ("%s\n", _("of processes. Search filters can be applied to limit the processes to check."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+ printf (" %s\n", "-w, --warning=RANGE");
+ printf (" %s\n", _("Generate warning state if metric is outside this range"));
+ printf (" %s\n", "-c, --critical=RANGE");
+ printf (" %s\n", _("Generate critical state if metric is outside this range"));
+ printf (" %s\n", "-m, --metric=TYPE");
+ printf (" %s\n", _("Check thresholds against metric. Valid types:"));
+ printf (" %s\n", _("PROCS - number of processes (default)"));
+ printf (" %s\n", _("VSZ - virtual memory size"));
+ printf (" %s\n", _("RSS - resident set memory size"));
+ printf (" %s\n", _("CPU - percentage CPU"));
+/* only linux etime is support currently */
+#if defined( __linux__ )
+ printf (" %s\n", _("ELAPSED - time elapsed in seconds"));
+#endif /* defined(__linux__) */
+ printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (" %s\n", "-v, --verbose");
+ printf (" %s\n", _("Extra information. Up to 3 verbosity levels"));
+
+ printf (" %s\n", "-T, --traditional");
+ printf (" %s\n", _("Filter own process the traditional way by PID instead of /proc/pid/exe"));
+
+ printf ("\n");
+ printf ("%s\n", "Filters:");
+ printf (" %s\n", "-s, --state=STATUSFLAGS");
+ printf (" %s\n", _("Only scan for processes that have, in the output of `ps`, one or"));
+ printf (" %s\n", _("more of the status flags you specify (for example R, Z, S, RS,"));
+ printf (" %s\n", _("RSZDT, plus others based on the output of your 'ps' command)."));
+ printf (" %s\n", "-p, --ppid=PPID");
+ printf (" %s\n", _("Only scan for children of the parent process ID indicated."));
+ printf (" %s\n", "-z, --vsz=VSZ");
+ printf (" %s\n", _("Only scan for processes with VSZ higher than indicated."));
+ printf (" %s\n", "-r, --rss=RSS");
+ printf (" %s\n", _("Only scan for processes with RSS higher than indicated."));
+ printf (" %s\n", "-P, --pcpu=PCPU");
+ printf (" %s\n", _("Only scan for processes with PCPU higher than indicated."));
+ printf (" %s\n", "-u, --user=USER");
+ printf (" %s\n", _("Only scan for processes with user name or ID indicated."));
+ printf (" %s\n", "-a, --argument-array=STRING");
+ printf (" %s\n", _("Only scan for processes with args that contain STRING."));
+ printf (" %s\n", "--ereg-argument-array=STRING");
+ printf (" %s\n", _("Only scan for processes with args that contain the regex STRING."));
+ printf (" %s\n", "-C, --command=COMMAND");
+ printf (" %s\n", _("Only scan for exact matches of COMMAND (without path)."));
+ printf (" %s\n", "-X, --exclude-process");
+ printf (" %s\n", _("Exclude processes which match this comma separated list"));
+ printf (" %s\n", "-k, --no-kthreads");
+ printf (" %s\n", _("Only scan for non kernel threads (works on Linux only)."));
+
+ printf(_("\n\
+RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n\
+specified 'max:min', a warning status will be generated if the\n\
+count is inside the specified range\n\n"));
+
+ printf(_("\
+This plugin checks the number of currently running processes and\n\
+generates WARNING or CRITICAL states if the process count is outside\n\
+the specified threshold ranges. The process count can be filtered by\n\
+process owner, parent process PID, current state (e.g., 'Z'), or may\n\
+be the total number of running processes\n\n"));
+
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "check_procs -w 2:2 -c 2:1024 -C portsentry");
+ printf (" %s\n", _("Warning if not two processes with command name portsentry."));
+ printf (" %s\n\n", _("Critical if < 2 or > 1024 processes"));
+ printf (" %s\n", "check_procs -c 1: -C sshd");
+ printf (" %s\n", _("Critical if not at least 1 process with command sshd"));
+ printf (" %s\n", "check_procs -w 1024 -c 1: -C sshd");
+ printf (" %s\n", _("Warning if > 1024 processes with command name sshd."));
+ printf (" %s\n\n", _("Critical if < 1 processes with command name sshd."));
+ printf (" %s\n", "check_procs -w 10 -a '/usr/local/bin/perl' -u root");
+ printf (" %s\n", _("Warning alert if > 10 processes with command arguments containing"));
+ printf (" %s\n\n", _("'/usr/local/bin/perl' and owned by root"));
+ printf (" %s\n", "check_procs -w 50000 -c 100000 --metric=VSZ");
+ printf (" %s\n\n", _("Alert if VSZ of any processes over 50K or 100K"));
+ printf (" %s\n", "check_procs -w 10 -c 20 --metric=CPU");
+ printf (" %s\n", _("Alert if CPU of any processes over 10\% or 20\%"));
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n", progname);
+ printf (" [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n");
+ printf (" [-C command] [-X process_to_exclude] [-k] [-t timeout] [-v]\n");
+}
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
new file mode 100644
index 0000000..b1b4938
--- /dev/null
+++ b/plugins/check_radius.c
@@ -0,0 +1,416 @@
+/*****************************************************************************
+*
+* Monitoring check_radius plugin
+*
+* License: GPL
+* Copyright (c) 1999-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_radius plugin
+*
+* Tests to see if a radius server is accepting connections.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_radius";
+const char *copyright = "2000-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "netutils.h"
+
+#if defined(HAVE_LIBRADCLI)
+#include <radcli/radcli.h>
+#elif defined(HAVE_LIBFREERADIUS_CLIENT)
+#include <freeradius-client.h>
+#elif defined(HAVE_LIBRADIUSCLIENT_NG)
+#include <radiusclient-ng.h>
+#else
+#include <radiusclient.h>
+#endif
+
+int process_arguments (int, char **);
+void print_help (void);
+void print_usage (void);
+
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) || defined(HAVE_LIBRADCLI)
+#define my_rc_conf_str(a) rc_conf_str(rch,a)
+#if defined(HAVE_LIBRADCLI)
+#define my_rc_send_server(a,b) rc_send_server(rch,a,b,AUTH)
+#else
+#define my_rc_send_server(a,b) rc_send_server(rch,a,b)
+#endif
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADCLI)
+#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,(a)->secret,e,f)
+#else
+#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,e,f)
+#endif
+#define my_rc_avpair_add(a,b,c,d) rc_avpair_add(rch,a,b,c,-1,d)
+#define my_rc_read_dictionary(a) rc_read_dictionary(rch, a)
+#else
+#define my_rc_conf_str(a) rc_conf_str(a)
+#define my_rc_send_server(a,b) rc_send_server(a, b)
+#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(a,b,c,d,e,f)
+#define my_rc_avpair_add(a,b,c,d) rc_avpair_add(a, b, c, d)
+#define my_rc_read_dictionary(a) rc_read_dictionary(a)
+#endif
+
+/* REJECT_RC is only defined in some version of radiusclient. It has
+ * been reported from radiusclient-ng 0.5.6 on FreeBSD 7.2-RELEASE */
+#ifndef REJECT_RC
+#define REJECT_RC BADRESP_RC
+#endif
+
+int my_rc_read_config(char *);
+
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) || defined(HAVE_LIBRADCLI)
+rc_handle *rch = NULL;
+#endif
+
+char *server = NULL;
+char *username = NULL;
+char *password = NULL;
+char *nasid = NULL;
+char *nasipaddress = NULL;
+char *expect = NULL;
+char *config_file = NULL;
+unsigned short port = PW_AUTH_UDP_PORT;
+int retries = 1;
+int verbose = FALSE;
+
+/******************************************************************************
+
+The (pseudo?)literate programming XML is contained within \@\@\- <XML> \-\@\@
+tags in the comments. With in the tags, the XML is assembled sequentially.
+You can define entities in tags. You also have all the #defines available as
+entities.
+
+Please note that all tags must be lowercase to use the DocBook XML DTD.
+
+@@-<article>
+
+<sect1>
+<title>Quick Reference</title>
+<!-- The refentry forms a manpage -->
+<refentry>
+<refmeta>
+<manvolnum>5<manvolnum>
+</refmeta>
+<refnamdiv>
+<refname>&progname;</refname>
+<refpurpose>&SUMMARY;</refpurpose>
+</refnamdiv>
+</refentry>
+</sect1>
+
+<sect1>
+<title>FAQ</title>
+</sect1>
+
+<sect1>
+<title>Theory, Installation, and Operation</title>
+
+<sect2>
+<title>General Description</title>
+<para>
+&DESCRIPTION;
+</para>
+</sect2>
+
+<sect2>
+<title>Future Enhancements</title>
+<para>Todo List</para>
+<itemizedlist>
+<listitem>Add option to get password from a secured file rather than the command line</listitem>
+</itemizedlist>
+</sect2>
+
+
+<sect2>
+<title>Functions</title>
+-@@
+******************************************************************************/
+
+
+
+int
+main (int argc, char **argv)
+{
+ struct sockaddr_storage ss;
+ char name[HOST_NAME_MAX];
+#ifdef RC_BUFFER_LEN
+ char msg[RC_BUFFER_LEN];
+#else
+ char msg[BUFFER_LEN];
+#endif
+ SEND_DATA data;
+ int result = STATE_UNKNOWN;
+ uint32_t client_id, service;
+ char *str;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ str = strdup ("dictionary");
+ if ((config_file && my_rc_read_config (config_file)) ||
+ my_rc_read_dictionary (my_rc_conf_str (str)))
+ die (STATE_UNKNOWN, _("Config file error\n"));
+
+ service = PW_AUTHENTICATE_ONLY;
+
+ memset (&data, 0, sizeof(data));
+ if (!(my_rc_avpair_add (&data.send_pairs, PW_SERVICE_TYPE, &service, 0) &&
+ my_rc_avpair_add (&data.send_pairs, PW_USER_NAME, username, 0) &&
+ my_rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0)
+ ))
+ die (STATE_UNKNOWN, _("Out of Memory?\n"));
+
+ if (nasid != NULL) {
+ if (!(my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0)))
+ die (STATE_UNKNOWN, _("Invalid NAS-Identifier\n"));
+ }
+
+ if (nasipaddress == NULL) {
+ if (gethostname (name, sizeof(name)) != 0)
+ die (STATE_UNKNOWN, _("gethostname() failed!\n"));
+ nasipaddress = name;
+ }
+ if (!dns_lookup (nasipaddress, &ss, AF_INET)) /* TODO: Support IPv6. */
+ die (STATE_UNKNOWN, _("Invalid NAS-IP-Address\n"));
+ client_id = ntohl (((struct sockaddr_in *)&ss)->sin_addr.s_addr);
+ if (my_rc_avpair_add (&(data.send_pairs), PW_NAS_IP_ADDRESS, &client_id, 0) == NULL)
+ die (STATE_UNKNOWN, _("Invalid NAS-IP-Address\n"));
+
+ my_rc_buildreq (&data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval,
+ retries);
+
+ result = my_rc_send_server (&data, msg);
+ rc_avpair_free (data.send_pairs);
+ if (data.receive_pairs)
+ rc_avpair_free (data.receive_pairs);
+
+ if (result == TIMEOUT_RC)
+ die (STATE_CRITICAL, _("Timeout\n"));
+ if (result == ERROR_RC)
+ die (STATE_CRITICAL, _("Auth Error\n"));
+ if (result == REJECT_RC)
+ die (STATE_WARNING, _("Auth Failed\n"));
+ if (result == BADRESP_RC)
+ die (STATE_WARNING, _("Bad Response\n"));
+ if (expect && !strstr (msg, expect))
+ die (STATE_WARNING, "%s\n", msg);
+ if (result == OK_RC)
+ die (STATE_OK, _("Auth OK\n"));
+ (void)snprintf(msg, sizeof(msg), _("Unexpected result code %d"), result);
+ die (STATE_UNKNOWN, "%s\n", msg);
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"port", required_argument, 0, 'P'},
+ {"username", required_argument, 0, 'u'},
+ {"password", required_argument, 0, 'p'},
+ {"nas-id", required_argument, 0, 'n'},
+ {"nas-ip-address", required_argument, 0, 'N'},
+ {"filename", required_argument, 0, 'F'},
+ {"expect", required_argument, 0, 'e'},
+ {"retries", required_argument, 0, 'r'},
+ {"timeout", required_argument, 0, 't'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVvH:P:F:u:p:n:N:t:r:e:", longopts,
+ &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'v': /* verbose mode */
+ verbose = TRUE;
+ break;
+ case 'H': /* hostname */
+ if (is_host (optarg) == FALSE) {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ server = optarg;
+ break;
+ case 'P': /* port */
+ if (is_intnonneg (optarg))
+ port = (unsigned short)atoi (optarg);
+ else
+ usage4 (_("Port must be a positive integer"));
+ break;
+ case 'u': /* username */
+ username = optarg;
+ break;
+ case 'p': /* password */
+ password = strdup(optarg);
+
+ /* Delete the password from process list */
+ while (*optarg != '\0') {
+ *optarg = 'X';
+ optarg++;
+ }
+ break;
+ case 'n': /* nas id */
+ nasid = optarg;
+ break;
+ case 'N': /* nas ip address */
+ nasipaddress = optarg;
+ break;
+ case 'F': /* configuration file */
+ config_file = optarg;
+ break;
+ case 'e': /* expect */
+ expect = optarg;
+ break;
+ case 'r': /* retries */
+ if (is_intpos (optarg))
+ retries = atoi (optarg);
+ else
+ usage4 (_("Number of retries must be a positive integer"));
+ break;
+ case 't': /* timeout */
+ if (is_intpos (optarg))
+ timeout_interval = (unsigned)atoi (optarg);
+ else
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ break;
+ }
+ }
+
+ if (server == NULL)
+ usage4 (_("Hostname was not supplied"));
+ if (username == NULL)
+ usage4 (_("User not specified"));
+ if (password == NULL)
+ usage4 (_("Password not specified"));
+ if (config_file == NULL)
+ usage4 (_("Configuration file not specified"));
+
+ return OK;
+}
+
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", PW_AUTH_UDP_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Robert August Vincent II\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf("%s\n", _("Tests to see if a RADIUS server is accepting connections."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'P', myport);
+
+ printf (" %s\n", "-u, --username=STRING");
+ printf (" %s\n", _("The user to authenticate"));
+ printf (" %s\n", "-p, --password=STRING");
+ printf (" %s\n", _("Password for authentication (SECURITY RISK)"));
+ printf (" %s\n", "-n, --nas-id=STRING");
+ printf (" %s\n", _("NAS identifier"));
+ printf (" %s\n", "-N, --nas-ip-address=STRING");
+ printf (" %s\n", _("NAS IP Address"));
+ printf (" %s\n", "-F, --filename=STRING");
+ printf (" %s\n", _("Configuration file"));
+ printf (" %s\n", "-e, --expect=STRING");
+ printf (" %s\n", _("Response string to expect from the server"));
+ printf (" %s\n", "-r, --retries=INTEGER");
+ printf (" %s\n", _("Number of times to retry a failed connection"));
+
+ printf (UT_CONN_TIMEOUT, timeout_interval);
+
+ printf ("\n");
+ printf ("%s\n", _("This plugin tests a RADIUS server to see if it is accepting connections."));
+ printf ("%s\n", _("The server to test must be specified in the invocation, as well as a user"));
+ printf ("%s\n", _("name and password. A configuration file must be present. The format of"));
+ printf ("%s\n", _("the configuration file is described in the radiusclient library sources."));
+ printf ("%s\n", _("The password option presents a substantial security issue because the"));
+ printf ("%s\n", _("password can possibly be determined by careful watching of the command line"));
+ printf ("%s\n", _("in a process listing. This risk is exacerbated because the plugin will"));
+ printf ("%s\n", _("typically be executed at regular predictable intervals. Please be sure that"));
+ printf ("%s\n", _("the password used does not allow access to sensitive system resources."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host -F config_file -u username -p password\n\
+ [-P port] [-t timeout] [-r retries] [-e expect]\n\
+ [-n nas-id] [-N nas-ip-addr]\n", progname);
+}
+
+
+
+int my_rc_read_config(char * a)
+{
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) || defined(HAVE_LIBRADCLI)
+ rch = rc_read_config(a);
+ return (rch == NULL) ? 1 : 0;
+#else
+ return rc_read_config(a);
+#endif
+}
diff --git a/plugins/check_real.c b/plugins/check_real.c
new file mode 100644
index 0000000..fbdb70f
--- /dev/null
+++ b/plugins/check_real.c
@@ -0,0 +1,454 @@
+/*****************************************************************************
+*
+* Monitoring check_real plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_real plugin
+*
+* This plugin tests the REAL service on the specified host.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_real";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+enum {
+ PORT = 554
+};
+
+#define EXPECT "RTSP/1."
+#define URL ""
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+int server_port = PORT;
+char *server_address;
+char *host_name;
+char *server_url = NULL;
+char *server_expect;
+int warning_time = 0;
+int check_warning_time = FALSE;
+int critical_time = 0;
+int check_critical_time = FALSE;
+int verbose = FALSE;
+
+
+
+int
+main (int argc, char **argv)
+{
+ int sd;
+ int result = STATE_UNKNOWN;
+ char buffer[MAX_INPUT_BUFFER];
+ char *status_line = NULL;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+ time (&start_time);
+
+ /* try to connect to the host at the given port number */
+ if (my_tcp_connect (server_address, server_port, &sd) != STATE_OK)
+ die (STATE_CRITICAL, _("Unable to connect to %s on port %d\n"),
+ server_address, server_port);
+
+ /* Part I - Server Check */
+
+ /* send the OPTIONS request */
+ sprintf (buffer, "OPTIONS rtsp://%s:%d RTSP/1.0\r\n", host_name, server_port);
+ result = send (sd, buffer, strlen (buffer), 0);
+
+ /* send the header sync */
+ sprintf (buffer, "CSeq: 1\r\n");
+ result = send (sd, buffer, strlen (buffer), 0);
+
+ /* send a newline so the server knows we're done with the request */
+ sprintf (buffer, "\r\n");
+ result = send (sd, buffer, strlen (buffer), 0);
+
+ /* watch for the REAL connection string */
+ result = recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0);
+
+ /* return a CRITICAL status if we couldn't read any data */
+ if (result == -1)
+ die (STATE_CRITICAL, _("No data received from %s\n"), host_name);
+
+ /* make sure we find the response we are looking for */
+ if (!strstr (buffer, server_expect)) {
+ if (server_port == PORT)
+ printf ("%s\n", _("Invalid REAL response received from host"));
+ else
+ printf (_("Invalid REAL response received from host on port %d\n"),
+ server_port);
+ }
+ else {
+ /* else we got the REAL string, so check the return code */
+
+ time (&end_time);
+
+ result = STATE_OK;
+
+ status_line = (char *) strtok (buffer, "\n");
+
+ if (strstr (status_line, "200"))
+ result = STATE_OK;
+
+ /* client errors result in a warning state */
+ else if (strstr (status_line, "400"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "401"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "402"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "403"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "404"))
+ result = STATE_WARNING;
+
+ /* server errors result in a critical state */
+ else if (strstr (status_line, "500"))
+ result = STATE_CRITICAL;
+ else if (strstr (status_line, "501"))
+ result = STATE_CRITICAL;
+ else if (strstr (status_line, "502"))
+ result = STATE_CRITICAL;
+ else if (strstr (status_line, "503"))
+ result = STATE_CRITICAL;
+
+ else
+ result = STATE_UNKNOWN;
+ }
+
+ /* Part II - Check stream exists and is ok */
+ if ((result == STATE_OK )&& (server_url != NULL) ) {
+
+ /* Part I - Server Check */
+
+ /* send the DESCRIBE request */
+ sprintf (buffer, "DESCRIBE rtsp://%s:%d%s RTSP/1.0\r\n", host_name,
+ server_port, server_url);
+ result = send (sd, buffer, strlen (buffer), 0);
+
+ /* send the header sync */
+ sprintf (buffer, "CSeq: 2\r\n");
+ result = send (sd, buffer, strlen (buffer), 0);
+
+ /* send a newline so the server knows we're done with the request */
+ sprintf (buffer, "\r\n");
+ result = send (sd, buffer, strlen (buffer), 0);
+
+ /* watch for the REAL connection string */
+ result = recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0);
+ buffer[result] = '\0'; /* null terminate received buffer */
+
+ /* return a CRITICAL status if we couldn't read any data */
+ if (result == -1) {
+ printf (_("No data received from host\n"));
+ result = STATE_CRITICAL;
+ }
+ else {
+ /* make sure we find the response we are looking for */
+ if (!strstr (buffer, server_expect)) {
+ if (server_port == PORT)
+ printf ("%s\n", _("Invalid REAL response received from host"));
+ else
+ printf (_("Invalid REAL response received from host on port %d\n"),
+ server_port);
+ }
+ else {
+
+ /* else we got the REAL string, so check the return code */
+
+ time (&end_time);
+
+ result = STATE_OK;
+
+ status_line = (char *) strtok (buffer, "\n");
+
+ if (strstr (status_line, "200"))
+ result = STATE_OK;
+
+ /* client errors result in a warning state */
+ else if (strstr (status_line, "400"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "401"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "402"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "403"))
+ result = STATE_WARNING;
+ else if (strstr (status_line, "404"))
+ result = STATE_WARNING;
+
+ /* server errors result in a critical state */
+ else if (strstr (status_line, "500"))
+ result = STATE_CRITICAL;
+ else if (strstr (status_line, "501"))
+ result = STATE_CRITICAL;
+ else if (strstr (status_line, "502"))
+ result = STATE_CRITICAL;
+ else if (strstr (status_line, "503"))
+ result = STATE_CRITICAL;
+
+ else
+ result = STATE_UNKNOWN;
+ }
+ }
+ }
+
+ /* Return results */
+ if (result == STATE_OK) {
+
+ if (check_critical_time == TRUE
+ && (end_time - start_time) > critical_time) result = STATE_CRITICAL;
+ else if (check_warning_time == TRUE
+ && (end_time - start_time) > warning_time) result =
+ STATE_WARNING;
+
+ /* Put some HTML in here to create a dynamic link */
+ printf (_("REAL %s - %d second response time\n"),
+ state_text (result),
+ (int) (end_time - start_time));
+ }
+ else
+ printf ("%s\n", status_line);
+
+ /* close the connection */
+ close (sd);
+
+ /* reset the alarm */
+ alarm (0);
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"IPaddress", required_argument, 0, 'I'},
+ {"expect", required_argument, 0, 'e'},
+ {"url", required_argument, 0, 'u'},
+ {"port", required_argument, 0, 'p'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"timeout", required_argument, 0, 't'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hvVI:H:e:u:p:w:c:t:", longopts,
+ &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'I': /* hostname */
+ case 'H': /* hostname */
+ if (server_address)
+ break;
+ else if (is_host (optarg))
+ server_address = optarg;
+ else
+ usage2 (_("Invalid hostname/address"), optarg);
+ break;
+ case 'e': /* string to expect in response header */
+ server_expect = optarg;
+ break;
+ case 'u': /* server URL */
+ server_url = optarg;
+ break;
+ case 'p': /* port */
+ if (is_intpos (optarg)) {
+ server_port = atoi (optarg);
+ }
+ else {
+ usage4 (_("Port must be a positive integer"));
+ }
+ break;
+ case 'w': /* warning time threshold */
+ if (is_intnonneg (optarg)) {
+ warning_time = atoi (optarg);
+ check_warning_time = TRUE;
+ }
+ else {
+ usage4 (_("Warning time must be a positive integer"));
+ }
+ break;
+ case 'c': /* critical time threshold */
+ if (is_intnonneg (optarg)) {
+ critical_time = atoi (optarg);
+ check_critical_time = TRUE;
+ }
+ else {
+ usage4 (_("Critical time must be a positive integer"));
+ }
+ break;
+ case 'v': /* verbose */
+ verbose = TRUE;
+ break;
+ case 't': /* timeout */
+ if (is_intnonneg (optarg)) {
+ socket_timeout = atoi (optarg);
+ }
+ else {
+ usage4 (_("Timeout interval must be a positive integer"));
+ }
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case '?': /* usage */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (server_address==NULL && argc>c) {
+ if (is_host (argv[c])) {
+ server_address = argv[c++];
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), argv[c]);
+ }
+ }
+
+ if (server_address==NULL)
+ usage4 (_("You must provide a server to check"));
+
+ if (host_name==NULL)
+ host_name = strdup (server_address);
+
+ if (server_expect == NULL)
+ server_expect = strdup(EXPECT);
+
+ return validate_arguments ();
+}
+
+
+
+int
+validate_arguments (void)
+{
+ return OK;
+}
+
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Pedro Leite <leite@cic.ua.pt>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin tests the REAL service on the specified host."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (" %s\n", "-u, --url=STRING");
+ printf (" %s\n", _("Connect to this url"));
+ printf (" %s\n", "-e, --expect=STRING");
+ printf (_("String to expect in first line of server response (default: %s)\n"),
+ EXPECT);
+
+ printf (UT_WARN_CRIT);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("This plugin will attempt to open an RTSP connection with the host."));
+ printf ("%s\n", _("Successful connects return STATE_OK, refusals and timeouts return"));
+ printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,"));
+ printf ("%s\n", _("but incorrect response messages from the host result in STATE_WARNING return"));
+ printf ("%s\n", _("values."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host [-e expect] [-p port] [-w warn] [-c crit] [-t timeout] [-v]\n", progname);
+}
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
new file mode 100644
index 0000000..fc0ae2c
--- /dev/null
+++ b/plugins/check_smtp.c
@@ -0,0 +1,929 @@
+/*****************************************************************************
+*
+* Monitoring check_smtp plugin
+*
+* License: GPL
+* Copyright (c) 2000-2023 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_smtp plugin
+*
+* This plugin will attempt to open an SMTP connection with the host.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_smtp";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+#include "base64.h"
+
+#include <ctype.h>
+
+#ifdef HAVE_SSL
+int check_cert = FALSE;
+int days_till_exp_warn, days_till_exp_crit;
+# define my_recv(buf, len) (((use_starttls || use_ssl) && ssl_established) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
+# define my_send(buf, len) (((use_starttls || use_ssl) && ssl_established) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0))
+#else /* ifndef HAVE_SSL */
+# define my_recv(buf, len) read(sd, buf, len)
+# define my_send(buf, len) send(sd, buf, len, 0)
+#endif
+
+enum {
+ SMTP_PORT = 25,
+ SMTPS_PORT = 465
+};
+#define PROXY_PREFIX "PROXY TCP4 0.0.0.0 0.0.0.0 25 25\r\n"
+#define SMTP_EXPECT "220"
+#define SMTP_HELO "HELO "
+#define SMTP_EHLO "EHLO "
+#define SMTP_LHLO "LHLO "
+#define SMTP_QUIT "QUIT\r\n"
+#define SMTP_STARTTLS "STARTTLS\r\n"
+#define SMTP_AUTH_LOGIN "AUTH LOGIN\r\n"
+
+#define EHLO_SUPPORTS_STARTTLS 1
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+void smtp_quit(void);
+int recvline(char *, size_t);
+int recvlines(char *, size_t);
+int my_close(void);
+
+#include "regex.h"
+char regex_expect[MAX_INPUT_BUFFER] = "";
+regex_t preg;
+regmatch_t pmatch[10];
+char timestamp[20] = "";
+char errbuf[MAX_INPUT_BUFFER];
+int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
+int eflags = 0;
+int errcode, excode;
+
+int server_port = SMTP_PORT;
+int server_port_option = 0;
+char *server_address = NULL;
+char *server_expect = NULL;
+char *mail_command = NULL;
+char *from_arg = NULL;
+int send_mail_from=0;
+int ncommands=0;
+int command_size=0;
+int nresponses=0;
+int response_size=0;
+char **commands = NULL;
+char **responses = NULL;
+char *authtype = NULL;
+char *authuser = NULL;
+char *authpass = NULL;
+double warning_time = 0;
+int check_warning_time = FALSE;
+double critical_time = 0;
+int check_critical_time = FALSE;
+int verbose = 0;
+int use_ssl = FALSE;
+int use_starttls = FALSE;
+int use_sni = FALSE;
+short use_proxy_prefix = FALSE;
+short use_ehlo = FALSE;
+short use_lhlo = FALSE;
+short ssl_established = 0;
+char *localhostname = NULL;
+int sd;
+char buffer[MAX_INPUT_BUFFER];
+enum {
+ TCP_PROTOCOL = 1,
+ UDP_PROTOCOL = 2,
+};
+int ignore_send_quit_failure = FALSE;
+
+
+int
+main (int argc, char **argv)
+{
+ short supports_tls=FALSE;
+ int n = 0;
+ double elapsed_time;
+ long microsec;
+ int result = STATE_UNKNOWN;
+ char *cmd_str = NULL;
+ char *helocmd = NULL;
+ char *error_msg = "";
+ char *server_response = NULL;
+ struct timeval tv;
+
+ /* Catch pipe errors in read/write - sometimes occurs when writing QUIT */
+ (void) signal (SIGPIPE, SIG_IGN);
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* If localhostname not set on command line, use gethostname to set */
+ if(! localhostname){
+ localhostname = malloc (HOST_MAX_BYTES);
+ if(!localhostname){
+ printf(_("malloc() failed!\n"));
+ return STATE_CRITICAL;
+ }
+ if(gethostname(localhostname, HOST_MAX_BYTES)){
+ printf(_("gethostname() failed!\n"));
+ return STATE_CRITICAL;
+ }
+ }
+ if(use_lhlo)
+ xasprintf (&helocmd, "%s%s%s", SMTP_LHLO, localhostname, "\r\n");
+ else if(use_ehlo)
+ xasprintf (&helocmd, "%s%s%s", SMTP_EHLO, localhostname, "\r\n");
+ else
+ xasprintf (&helocmd, "%s%s%s", SMTP_HELO, localhostname, "\r\n");
+
+ if (verbose)
+ printf("HELOCMD: %s", helocmd);
+
+ /* initialize the MAIL command with optional FROM command */
+ xasprintf (&cmd_str, "%sFROM:<%s>%s", mail_command, from_arg, "\r\n");
+
+ if (verbose && send_mail_from)
+ printf ("FROM CMD: %s", cmd_str);
+
+ /* initialize alarm signal handling */
+ (void) signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ (void) alarm (socket_timeout);
+
+ /* start timer */
+ gettimeofday (&tv, NULL);
+
+ /* try to connect to the host at the given port number */
+ result = my_tcp_connect (server_address, server_port, &sd);
+
+ if (result == STATE_OK) { /* we connected */
+ /* If requested, send PROXY header */
+ if (use_proxy_prefix) {
+ if (verbose)
+ printf ("Sending header %s\n", PROXY_PREFIX);
+ my_send(PROXY_PREFIX, strlen(PROXY_PREFIX));
+ }
+
+#ifdef HAVE_SSL
+ if (use_ssl) {
+ result = np_net_ssl_init_with_hostname(sd, (use_sni ? server_address : NULL));
+ if (result != STATE_OK) {
+ printf (_("CRITICAL - Cannot create SSL context.\n"));
+ close(sd);
+ np_net_ssl_cleanup();
+ return STATE_CRITICAL;
+ } else {
+ ssl_established = 1;
+ }
+ }
+#endif
+
+ /* watch for the SMTP connection string and */
+ /* return a WARNING status if we couldn't read any data */
+ if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) {
+ printf (_("recv() failed\n"));
+ return STATE_WARNING;
+ }
+
+ /* save connect return (220 hostname ..) for later use */
+ xasprintf(&server_response, "%s", buffer);
+
+ /* send the HELO/EHLO command */
+ my_send(helocmd, strlen(helocmd));
+
+ /* allow for response to helo command to reach us */
+ if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) {
+ printf (_("recv() failed\n"));
+ return STATE_WARNING;
+ } else if(use_ehlo || use_lhlo){
+ if(strstr(buffer, "250 STARTTLS") != NULL ||
+ strstr(buffer, "250-STARTTLS") != NULL){
+ supports_tls=TRUE;
+ }
+ }
+
+ if(use_starttls && ! supports_tls){
+ printf(_("WARNING - TLS not supported by server\n"));
+ smtp_quit();
+ return STATE_WARNING;
+ }
+
+#ifdef HAVE_SSL
+ if(use_starttls) {
+ /* send the STARTTLS command */
+ send(sd, SMTP_STARTTLS, strlen(SMTP_STARTTLS), 0);
+
+ recvlines(buffer, MAX_INPUT_BUFFER); /* wait for it */
+ if (!strstr (buffer, SMTP_EXPECT)) {
+ printf (_("Server does not support STARTTLS\n"));
+ smtp_quit();
+ return STATE_UNKNOWN;
+ }
+ result = np_net_ssl_init_with_hostname(sd, (use_sni ? server_address : NULL));
+ if(result != STATE_OK) {
+ printf (_("CRITICAL - Cannot create SSL context.\n"));
+ close(sd);
+ np_net_ssl_cleanup();
+ return STATE_CRITICAL;
+ } else {
+ ssl_established = 1;
+ }
+
+ /*
+ * Resend the EHLO command.
+ *
+ * RFC 3207 (4.2) says: ``The client MUST discard any knowledge
+ * obtained from the server, such as the list of SMTP service
+ * extensions, which was not obtained from the TLS negotiation
+ * itself. The client SHOULD send an EHLO command as the first
+ * command after a successful TLS negotiation.'' For this
+ * reason, some MTAs will not allow an AUTH LOGIN command before
+ * we resent EHLO via TLS.
+ */
+ if (my_send(helocmd, strlen(helocmd)) <= 0) {
+ printf("%s\n", _("SMTP UNKNOWN - Cannot send EHLO command via TLS."));
+ my_close();
+ return STATE_UNKNOWN;
+ }
+ if (verbose)
+ printf(_("sent %s"), helocmd);
+ if ((n = recvlines(buffer, MAX_INPUT_BUFFER)) <= 0) {
+ printf("%s\n", _("SMTP UNKNOWN - Cannot read EHLO response via TLS."));
+ my_close();
+ return STATE_UNKNOWN;
+ }
+ if (verbose) {
+ printf("%s", buffer);
+ }
+
+# ifdef USE_OPENSSL
+ if ( check_cert ) {
+ result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
+ smtp_quit();
+ my_close();
+ return result;
+ }
+# endif /* USE_OPENSSL */
+ }
+#endif
+
+ if (verbose)
+ printf ("%s", buffer);
+
+ /* save buffer for later use */
+ xasprintf(&server_response, "%s%s", server_response, buffer);
+ /* strip the buffer of carriage returns */
+ strip (server_response);
+
+ /* make sure we find the droids we are looking for */
+ if (!strstr (server_response, server_expect)) {
+ if (server_port == SMTP_PORT)
+ printf (_("Invalid SMTP response received from host: %s\n"), server_response);
+ else
+ printf (_("Invalid SMTP response received from host on port %d: %s\n"),
+ server_port, server_response);
+ return STATE_WARNING;
+ }
+
+ if (send_mail_from) {
+ my_send(cmd_str, strlen(cmd_str));
+ if (recvlines(buffer, MAX_INPUT_BUFFER) >= 1 && verbose)
+ printf("%s", buffer);
+ }
+
+ n = 0;
+ while (n < ncommands) {
+ xasprintf (&cmd_str, "%s%s", commands[n], "\r\n");
+ my_send(cmd_str, strlen(cmd_str));
+ if (recvlines(buffer, MAX_INPUT_BUFFER) >= 1 && verbose)
+ printf("%s", buffer);
+ strip (buffer);
+ if (n < nresponses) {
+ cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
+ errcode = regcomp (&preg, responses[n], cflags);
+ if (errcode != 0) {
+ regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
+ printf (_("Could Not Compile Regular Expression"));
+ return ERROR;
+ }
+ excode = regexec (&preg, buffer, 10, pmatch, eflags);
+ if (excode == 0) {
+ result = STATE_OK;
+ }
+ else if (excode == REG_NOMATCH) {
+ result = STATE_WARNING;
+ printf (_("SMTP %s - Invalid response '%s' to command '%s'\n"), state_text (result), buffer, commands[n]);
+ }
+ else {
+ regerror (excode, &preg, errbuf, MAX_INPUT_BUFFER);
+ printf (_("Execute Error: %s\n"), errbuf);
+ result = STATE_UNKNOWN;
+ }
+ }
+ n++;
+ }
+
+ if (authtype != NULL) {
+ if (strcmp (authtype, "LOGIN") == 0) {
+ char *abuf;
+ int ret;
+ do {
+ if (authuser == NULL) {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("no authuser specified, "));
+ break;
+ }
+ if (authpass == NULL) {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("no authpass specified, "));
+ break;
+ }
+
+ /* send AUTH LOGIN */
+ my_send(SMTP_AUTH_LOGIN, strlen(SMTP_AUTH_LOGIN));
+ if (verbose)
+ printf (_("sent %s\n"), "AUTH LOGIN");
+
+ if ((ret = recvlines(buffer, MAX_INPUT_BUFFER)) <= 0) {
+ xasprintf(&error_msg, _("recv() failed after AUTH LOGIN, "));
+ result = STATE_WARNING;
+ break;
+ }
+ if (verbose)
+ printf (_("received %s\n"), buffer);
+
+ if (strncmp (buffer, "334", 3) != 0) {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("invalid response received after AUTH LOGIN, "));
+ break;
+ }
+
+ /* encode authuser with base64 */
+ base64_encode_alloc (authuser, strlen(authuser), &abuf);
+ xasprintf(&abuf, "%s\r\n", abuf);
+ my_send(abuf, strlen(abuf));
+ if (verbose)
+ printf (_("sent %s\n"), abuf);
+
+ if ((ret = recvlines(buffer, MAX_INPUT_BUFFER)) <= 0) {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("recv() failed after sending authuser, "));
+ break;
+ }
+ if (verbose) {
+ printf (_("received %s\n"), buffer);
+ }
+ if (strncmp (buffer, "334", 3) != 0) {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("invalid response received after authuser, "));
+ break;
+ }
+ /* encode authpass with base64 */
+ base64_encode_alloc (authpass, strlen(authpass), &abuf);
+ xasprintf(&abuf, "%s\r\n", abuf);
+ my_send(abuf, strlen(abuf));
+ if (verbose) {
+ printf (_("sent %s\n"), abuf);
+ }
+ if ((ret = recvlines(buffer, MAX_INPUT_BUFFER)) <= 0) {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("recv() failed after sending authpass, "));
+ break;
+ }
+ if (verbose) {
+ printf (_("received %s\n"), buffer);
+ }
+ if (strncmp (buffer, "235", 3) != 0) {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("invalid response received after authpass, "));
+ break;
+ }
+ break;
+ } while (0);
+ } else {
+ result = STATE_CRITICAL;
+ xasprintf(&error_msg, _("only authtype LOGIN is supported, "));
+ }
+ }
+
+ /* tell the server we're done */
+ smtp_quit();
+
+ /* finally close the connection */
+ close (sd);
+ }
+
+ /* reset the alarm */
+ alarm (0);
+
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
+
+ if (result == STATE_OK) {
+ if (check_critical_time && elapsed_time > critical_time)
+ result = STATE_CRITICAL;
+ else if (check_warning_time && elapsed_time > warning_time)
+ result = STATE_WARNING;
+ }
+
+ printf (_("SMTP %s - %s%.3f sec. response time%s%s|%s\n"),
+ state_text (result),
+ error_msg,
+ elapsed_time,
+ verbose?", ":"", verbose?buffer:"",
+ fperfdata ("time", elapsed_time, "s",
+ (int)check_warning_time, warning_time,
+ (int)check_critical_time, critical_time,
+ TRUE, 0, FALSE, 0));
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ char* temp;
+
+ enum {
+ SNI_OPTION
+ };
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"expect", required_argument, 0, 'e'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"timeout", required_argument, 0, 't'},
+ {"port", required_argument, 0, 'p'},
+ {"from", required_argument, 0, 'f'},
+ {"fqdn", required_argument, 0, 'F'},
+ {"authtype", required_argument, 0, 'A'},
+ {"authuser", required_argument, 0, 'U'},
+ {"authpass", required_argument, 0, 'P'},
+ {"command", required_argument, 0, 'C'},
+ {"response", required_argument, 0, 'R'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"help", no_argument, 0, 'h'},
+ {"lmtp", no_argument, 0, 'L'},
+ {"ssl", no_argument, 0, 's'},
+ {"tls", no_argument, 0, 's'},
+ {"starttls",no_argument,0,'S'},
+ {"sni", no_argument, 0, SNI_OPTION},
+ {"certificate",required_argument,0,'D'},
+ {"ignore-quit-failure",no_argument,0,'q'},
+ {"proxy",no_argument,0,'r'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVv46Lrt:p:f:e:c:w:H:C:R:sSD:F:A:U:P:q",
+ longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'H': /* hostname */
+ if (is_host (optarg)) {
+ server_address = optarg;
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ break;
+ case 'p': /* port */
+ if (is_intpos (optarg))
+ server_port_option = atoi (optarg);
+ else
+ usage4 (_("Port must be a positive integer"));
+ break;
+ case 'F':
+ /* localhostname */
+ localhostname = strdup(optarg);
+ break;
+ case 'f': /* from argument */
+ from_arg = optarg + strspn(optarg, "<");
+ from_arg = strndup(from_arg, strcspn(from_arg, ">"));
+ send_mail_from = 1;
+ break;
+ case 'A':
+ authtype = optarg;
+ use_ehlo = TRUE;
+ break;
+ case 'U':
+ authuser = optarg;
+ break;
+ case 'P':
+ authpass = optarg;
+ break;
+ case 'e': /* server expect string on 220 */
+ server_expect = optarg;
+ break;
+ case 'C': /* commands */
+ if (ncommands >= command_size) {
+ command_size+=8;
+ commands = realloc (commands, sizeof(char *) * command_size);
+ if (commands == NULL)
+ die (STATE_UNKNOWN,
+ _("Could not realloc() units [%d]\n"), ncommands);
+ }
+ commands[ncommands] = (char *) malloc (sizeof(char) * 255);
+ strncpy (commands[ncommands], optarg, 255);
+ ncommands++;
+ break;
+ case 'R': /* server responses */
+ if (nresponses >= response_size) {
+ response_size += 8;
+ responses = realloc (responses, sizeof(char *) * response_size);
+ if (responses == NULL)
+ die (STATE_UNKNOWN,
+ _("Could not realloc() units [%d]\n"), nresponses);
+ }
+ responses[nresponses] = (char *) malloc (sizeof(char) * 255);
+ strncpy (responses[nresponses], optarg, 255);
+ nresponses++;
+ break;
+ case 'c': /* critical time threshold */
+ if (!is_nonnegative (optarg))
+ usage4 (_("Critical time must be a positive"));
+ else {
+ critical_time = strtod (optarg, NULL);
+ check_critical_time = TRUE;
+ }
+ break;
+ case 'w': /* warning time threshold */
+ if (!is_nonnegative (optarg))
+ usage4 (_("Warning time must be a positive"));
+ else {
+ warning_time = strtod (optarg, NULL);
+ check_warning_time = TRUE;
+ }
+ break;
+ case 'v': /* verbose */
+ verbose++;
+ break;
+ case 'q':
+ ignore_send_quit_failure++; /* ignore problem sending QUIT */
+ break;
+ case 't': /* timeout */
+ if (is_intnonneg (optarg)) {
+ socket_timeout = atoi (optarg);
+ }
+ else {
+ usage4 (_("Timeout interval must be a positive integer"));
+ }
+ break;
+ case 'D':
+ /* Check SSL cert validity */
+#ifdef USE_OPENSSL
+ if ((temp=strchr(optarg,','))!=NULL) {
+ *temp='\0';
+ if (!is_intnonneg (optarg))
+ usage2 ("Invalid certificate expiration period", optarg);
+ days_till_exp_warn = atoi(optarg);
+ *temp=',';
+ temp++;
+ if (!is_intnonneg (temp))
+ usage2 (_("Invalid certificate expiration period"), temp);
+ days_till_exp_crit = atoi (temp);
+ }
+ else {
+ days_till_exp_crit=0;
+ if (!is_intnonneg (optarg))
+ usage2 ("Invalid certificate expiration period", optarg);
+ days_till_exp_warn = atoi (optarg);
+ }
+ check_cert = TRUE;
+ ignore_send_quit_failure = TRUE;
+#else
+ usage (_("SSL support not available - install OpenSSL and recompile"));
+#endif
+ case 's':
+ /* ssl */
+ use_ssl = TRUE;
+ server_port = SMTPS_PORT;
+ break;
+ case 'S':
+ /* starttls */
+ use_starttls = TRUE;
+ use_ehlo = TRUE;
+ break;
+ case SNI_OPTION:
+#ifdef HAVE_SSL
+ use_sni = TRUE;
+#else
+ usage (_("SSL support not available - install OpenSSL and recompile"));
+#endif
+ break;
+ case 'r':
+ use_proxy_prefix = TRUE;
+ break;
+ case 'L':
+ use_lhlo = TRUE;
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case '?': /* help */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (server_address == NULL) {
+ if (argv[c]) {
+ if (is_host (argv[c]))
+ server_address = argv[c];
+ else
+ usage2 (_("Invalid hostname/address"), argv[c]);
+ }
+ else {
+ xasprintf (&server_address, "127.0.0.1");
+ }
+ }
+
+ if (server_expect == NULL)
+ server_expect = strdup (SMTP_EXPECT);
+
+ if (mail_command == NULL)
+ mail_command = strdup("MAIL ");
+
+ if (from_arg==NULL)
+ from_arg = strdup(" ");
+
+ if (use_starttls && use_ssl) {
+ usage4 (_("Set either -s/--ssl/--tls or -S/--starttls"));
+ }
+
+ if (server_port_option != 0) {
+ server_port = server_port_option;
+ }
+
+ return validate_arguments ();
+}
+
+
+
+int
+validate_arguments (void)
+{
+ return OK;
+}
+
+
+void
+smtp_quit(void)
+{
+ int bytes;
+ int n;
+
+ n = my_send(SMTP_QUIT, strlen(SMTP_QUIT));
+ if(n < 0) {
+ if(ignore_send_quit_failure) {
+ if(verbose) {
+ printf(_("Connection closed by server before sending QUIT command\n"));
+ }
+ return;
+ }
+ die (STATE_UNKNOWN,
+ _("Connection closed by server before sending QUIT command\n"));
+ }
+
+ if (verbose)
+ printf(_("sent %s\n"), "QUIT");
+
+ /* read the response but don't care about problems */
+ bytes = recvlines(buffer, MAX_INPUT_BUFFER);
+ if (verbose) {
+ if (bytes < 0)
+ printf(_("recv() failed after QUIT."));
+ else if (bytes == 0)
+ printf(_("Connection reset by peer."));
+ else {
+ buffer[bytes] = '\0';
+ printf(_("received %s\n"), buffer);
+ }
+ }
+}
+
+
+/*
+ * Receive one line, copy it into buf and nul-terminate it. Returns the
+ * number of bytes written to buf (excluding the '\0') or 0 on EOF or <0 on
+ * error.
+ *
+ * TODO: Reading one byte at a time is very inefficient. Replace this by a
+ * function which buffers the data, move that to netutils.c and change
+ * check_smtp and other plugins to use that. Also, remove (\r)\n.
+ */
+int
+recvline(char *buf, size_t bufsize)
+{
+ int result;
+ unsigned i;
+
+ for (i = result = 0; i < bufsize - 1; i++) {
+ if ((result = my_recv(&buf[i], 1)) != 1)
+ break;
+ if (buf[i] == '\n') {
+ buf[++i] = '\0';
+ return i;
+ }
+ }
+ return (result == 1 || i == 0) ? -2 : result; /* -2 if out of space */
+}
+
+
+/*
+ * Receive one or more lines, copy them into buf and nul-terminate it. Returns
+ * the number of bytes written to buf (excluding the '\0') or 0 on EOF or <0 on
+ * error. Works for all protocols which format multiline replies as follows:
+ *
+ * ``The format for multiline replies requires that every line, except the last,
+ * begin with the reply code, followed immediately by a hyphen, `-' (also known
+ * as minus), followed by text. The last line will begin with the reply code,
+ * followed immediately by <SP>, optionally some text, and <CRLF>. As noted
+ * above, servers SHOULD send the <SP> if subsequent text is not sent, but
+ * clients MUST be prepared for it to be omitted.'' (RFC 2821, 4.2.1)
+ *
+ * TODO: Move this to netutils.c. Also, remove \r and possibly the final \n.
+ */
+int
+recvlines(char *buf, size_t bufsize)
+{
+ int result, i;
+
+ for (i = 0; /* forever */; i += result)
+ if (!((result = recvline(buf + i, bufsize - i)) > 3 &&
+ isdigit((int)buf[i]) &&
+ isdigit((int)buf[i + 1]) &&
+ isdigit((int)buf[i + 2]) &&
+ buf[i + 3] == '-'))
+ break;
+
+ return (result <= 0) ? result : result + i;
+}
+
+
+int
+my_close (void)
+{
+ int result;
+ result = close(sd);
+#ifdef HAVE_SSL
+ np_net_ssl_cleanup();
+#endif
+ return result;
+}
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", SMTP_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999-2001 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf("%s\n", _("This plugin will attempt to open an SMTP connection with the host."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (UT_IPv46);
+
+ printf (" %s\n", "-e, --expect=STRING");
+ printf (_(" String to expect in first line of server response (default: '%s')\n"), SMTP_EXPECT);
+ printf (" %s\n", "-C, --command=STRING");
+ printf (" %s\n", _("SMTP command (may be used repeatedly)"));
+ printf (" %s\n", "-R, --response=STRING");
+ printf (" %s\n", _("Expected response to command (may be used repeatedly)"));
+ printf (" %s\n", "-f, --from=STRING");
+ printf (" %s\n", _("FROM-address to include in MAIL command, required by Exchange 2000")),
+ printf (" %s\n", "-F, --fqdn=STRING");
+ printf (" %s\n", _("FQDN used for HELO"));
+ printf (" %s\n", "-r, --proxy");
+ printf (" %s\n", _("Use PROXY protocol prefix for the connection."));
+#ifdef HAVE_SSL
+ printf (" %s\n", "-D, --certificate=INTEGER[,INTEGER]");
+ printf (" %s\n", _("Minimum number of days a certificate has to be valid."));
+ printf (" %s\n", "-s, --ssl, --tls");
+ printf (" %s\n", _("Use SSL/TLS for the connection."));
+ printf (_(" Sets default port to %d.\n"), SMTPS_PORT);
+ printf (" %s\n", "-S, --starttls");
+ printf (" %s\n", _("Use STARTTLS for the connection."));
+ printf (" %s\n", "--sni");
+ printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)"));
+#endif
+
+ printf (" %s\n", "-A, --authtype=STRING");
+ printf (" %s\n", _("SMTP AUTH type to check (default none, only LOGIN supported)"));
+ printf (" %s\n", "-U, --authuser=STRING");
+ printf (" %s\n", _("SMTP AUTH username"));
+ printf (" %s\n", "-P, --authpass=STRING");
+ printf (" %s\n", _("SMTP AUTH password"));
+ printf (" %s\n", "-L, --lmtp");
+ printf (" %s\n", _("Send LHLO instead of HELO/EHLO"));
+ printf (" %s\n", "-q, --ignore-quit-failure");
+ printf (" %s\n", _("Ignore failure when sending QUIT command to server"));
+
+ printf (UT_WARN_CRIT);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf("\n");
+ printf ("%s\n", _("Successful connects return STATE_OK, refusals and timeouts return"));
+ printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful"));
+ printf ("%s\n", _("connects, but incorrect response messages from the host result in"));
+ printf ("%s\n", _("STATE_WARNING return values."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host [-p port] [-4|-6] [-e expect] [-C command] [-R response] [-f from addr]\n", progname);
+ printf ("[-A authtype -U authuser -P authpass] [-w warn] [-c crit] [-t timeout] [-q]\n");
+ printf ("[-F fqdn] [-S] [-L] [-D warn days cert expire[,crit days cert expire]] [-r] [--sni] [-v] \n");
+}
+
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
new file mode 100644
index 0000000..56a586a
--- /dev/null
+++ b/plugins/check_snmp.c
@@ -0,0 +1,1379 @@
+/*****************************************************************************
+*
+* Monitoring check_snmp plugin
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_snmp plugin
+*
+* Check status of remote machines and obtain system information via SNMP
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_snmp";
+const char *copyright = "1999-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "runcmd.h"
+#include "utils.h"
+#include "utils_cmd.h"
+
+#define DEFAULT_COMMUNITY "public"
+#define DEFAULT_PORT "161"
+#define DEFAULT_MIBLIST "ALL"
+#define DEFAULT_PROTOCOL "1"
+#define DEFAULT_RETRIES 5
+#define DEFAULT_AUTH_PROTOCOL "MD5"
+#define DEFAULT_PRIV_PROTOCOL "DES"
+#define DEFAULT_DELIMITER "="
+#define DEFAULT_OUTPUT_DELIMITER " "
+#define DEFAULT_BUFFER_SIZE 100
+
+#define mark(a) ((a)!=0?"*":"")
+
+#define CHECK_UNDEF 0
+#define CRIT_PRESENT 1
+#define CRIT_STRING 2
+#define CRIT_REGEX 4
+#define WARN_PRESENT 8
+#define WARN_STRING 16
+#define WARN_REGEX 32
+
+#define OID_COUNT_STEP 8
+
+/* Longopts only arguments */
+#define L_CALCULATE_RATE CHAR_MAX+1
+#define L_RATE_MULTIPLIER CHAR_MAX+2
+#define L_INVERT_SEARCH CHAR_MAX+3
+#define L_OFFSET CHAR_MAX+4
+#define L_IGNORE_MIB_PARSING_ERRORS CHAR_MAX+5
+
+/* Gobble to string - stop incrementing c when c[0] match one of the
+ * characters in s */
+#define GOBBLE_TOS(c, s) while(c[0]!='\0' && strchr(s, c[0])==NULL) { c++; }
+/* Given c, keep track of backslashes (bk) and double-quotes (dq)
+ * from c[0] */
+#define COUNT_SEQ(c, bk, dq) switch(c[0]) {\
+ case '\\': \
+ if (bk) bk--; \
+ else bk++; \
+ break; \
+ case '"': \
+ if (!dq) { dq++; } \
+ else if(!bk) { dq--; } \
+ else { bk--; } \
+ break; \
+ }
+
+
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+char *thisarg (char *str);
+char *nextarg (char *str);
+void print_usage (void);
+void print_help (void);
+char *multiply (char *str);
+
+#include "regex.h"
+char regex_expect[MAX_INPUT_BUFFER] = "";
+regex_t preg;
+regmatch_t pmatch[10];
+char errbuf[MAX_INPUT_BUFFER] = "";
+char perfstr[MAX_INPUT_BUFFER] = "| ";
+int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
+int eflags = 0;
+int errcode, excode;
+
+char *server_address = NULL;
+char *community = NULL;
+char **contextargs = NULL;
+char *context = NULL;
+char **authpriv = NULL;
+char *proto = NULL;
+char *seclevel = NULL;
+char *secname = NULL;
+char *authproto = NULL;
+char *privproto = NULL;
+char *authpasswd = NULL;
+char *privpasswd = NULL;
+int nulloid = STATE_UNKNOWN;
+char **oids = NULL;
+size_t oids_size = 0;
+char *label;
+char *units;
+char *port;
+char *snmpcmd;
+char string_value[MAX_INPUT_BUFFER] = "";
+int invert_search=0;
+char **labels = NULL;
+char **unitv = NULL;
+size_t nlabels = 0;
+size_t labels_size = OID_COUNT_STEP;
+size_t nunits = 0;
+size_t unitv_size = OID_COUNT_STEP;
+int numoids = 0;
+int numauthpriv = 0;
+int numcontext = 0;
+int verbose = 0;
+int usesnmpgetnext = FALSE;
+char *warning_thresholds = NULL;
+char *critical_thresholds = NULL;
+thresholds **thlds;
+size_t thlds_size = OID_COUNT_STEP;
+double *response_value;
+size_t response_size = OID_COUNT_STEP;
+int retries = 0;
+int *eval_method;
+size_t eval_size = OID_COUNT_STEP;
+char *delimiter;
+char *output_delim;
+char *miblist = NULL;
+int needmibs = FALSE;
+int calculate_rate = 0;
+double offset = 0.0;
+int rate_multiplier = 1;
+state_data *previous_state;
+double *previous_value;
+size_t previous_size = OID_COUNT_STEP;
+int perf_labels = 1;
+char* ip_version = "";
+double multiplier = 1.0;
+char *fmtstr = "";
+bool fmtstr_set = false;
+char buffer[DEFAULT_BUFFER_SIZE];
+bool ignore_mib_parsing_errors = false;
+
+static char *fix_snmp_range(char *th)
+{
+ double left, right;
+ char *colon, *ret;
+
+ if ((colon = strchr(th, ':')) == NULL || *(colon + 1) == '\0')
+ return th;
+
+ left = strtod(th, NULL);
+ right = strtod(colon + 1, NULL);
+ if (right >= left)
+ return th;
+
+ if ((ret = malloc(strlen(th) + 2)) == NULL)
+ die(STATE_UNKNOWN, _("Cannot malloc"));
+ *colon = '\0';
+ sprintf(ret, "@%s:%s", colon + 1, th);
+ free(th);
+ return ret;
+}
+
+int
+main (int argc, char **argv)
+{
+ int i, len, line, total_oids;
+ unsigned int bk_count = 0, dq_count = 0;
+ int iresult = STATE_UNKNOWN;
+ int result = STATE_UNKNOWN;
+ int return_code = 0;
+ int external_error = 0;
+ char **command_line = NULL;
+ char *cl_hidden_auth = NULL;
+ char *oidname = NULL;
+ char *response = NULL;
+ char *mult_resp = NULL;
+ char *outbuff;
+ char *ptr = NULL;
+ char *show = NULL;
+ char *th_warn=NULL;
+ char *th_crit=NULL;
+ char type[8] = "";
+ output chld_out, chld_err;
+ char *previous_string=NULL;
+ char *ap=NULL;
+ char *state_string=NULL;
+ size_t response_length, current_length, string_length;
+ char *temp_string=NULL;
+ char *quote_string=NULL;
+ time_t current_time;
+ double temp_double;
+ time_t duration;
+ char *conv = "12345678";
+ int is_counter=0;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ labels = malloc (labels_size * sizeof(*labels));
+ unitv = malloc (unitv_size * sizeof(*unitv));
+ thlds = malloc (thlds_size * sizeof(*thlds));
+ response_value = malloc (response_size * sizeof(*response_value));
+ previous_value = malloc (previous_size * sizeof(*previous_value));
+ eval_method = calloc (eval_size, sizeof(*eval_method));
+ oids = calloc(oids_size, sizeof (char *));
+
+ label = strdup ("SNMP");
+ units = strdup ("");
+ port = strdup (DEFAULT_PORT);
+ outbuff = strdup ("");
+ delimiter = strdup (" = ");
+ output_delim = strdup (DEFAULT_OUTPUT_DELIMITER);
+ timeout_interval = DEFAULT_SOCKET_TIMEOUT;
+ retries = DEFAULT_RETRIES;
+
+ np_init( (char *) progname, argc, argv );
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ np_set_args(argc, argv);
+
+ time(&current_time);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ if(calculate_rate) {
+ if (!strcmp(label, "SNMP"))
+ label = strdup("SNMP RATE");
+ i=0;
+ previous_state = np_state_read();
+ if(previous_state!=NULL) {
+ /* Split colon separated values */
+ previous_string = strdup((char *) previous_state->data);
+ while((ap = strsep(&previous_string, ":")) != NULL) {
+ if(verbose>2)
+ printf("State for %d=%s\n", i, ap);
+ while (i >= previous_size) {
+ previous_size += OID_COUNT_STEP;
+ previous_value = realloc(previous_value, previous_size * sizeof(*previous_value));
+ }
+ previous_value[i++]=strtod(ap,NULL);
+ }
+ }
+ }
+
+ /* Populate the thresholds */
+ th_warn=warning_thresholds;
+ th_crit=critical_thresholds;
+ for (i=0; i<numoids; i++) {
+ char *w = th_warn ? strndup(th_warn, strcspn(th_warn, ",")) : NULL;
+ char *c = th_crit ? strndup(th_crit, strcspn(th_crit, ",")) : NULL;
+ /* translate "2:1" to "@1:2" for backwards compatibility */
+ w = w ? fix_snmp_range(w) : NULL;
+ c = c ? fix_snmp_range(c) : NULL;
+
+ while (i >= thlds_size) {
+ thlds_size += OID_COUNT_STEP;
+ thlds = realloc(thlds, thlds_size * sizeof(*thlds));
+ }
+
+ /* Skip empty thresholds, while avoiding segfault */
+ set_thresholds(&thlds[i],
+ w ? strpbrk(w, NP_THRESHOLDS_CHARS) : NULL,
+ c ? strpbrk(c, NP_THRESHOLDS_CHARS) : NULL);
+ if (w) {
+ th_warn=strchr(th_warn, ',');
+ if (th_warn) th_warn++;
+ free(w);
+ }
+ if (c) {
+ th_crit=strchr(th_crit, ',');
+ if (th_crit) th_crit++;
+ free(c);
+ }
+ }
+
+ /* Create the command array to execute */
+ if(usesnmpgetnext == TRUE) {
+ snmpcmd = strdup (PATH_TO_SNMPGETNEXT);
+ }else{
+ snmpcmd = strdup (PATH_TO_SNMPGET);
+ }
+
+ /* 10 arguments to pass before context and authpriv options + 1 for host and numoids. Add one for terminating NULL */
+
+ unsigned index = 0;
+ command_line = calloc (11 + numcontext + numauthpriv + 1 + numoids + 1, sizeof (char *));
+
+ command_line[index++] = snmpcmd;
+ command_line[index++] = strdup ("-Le");
+ command_line[index++] = strdup ("-t");
+ xasprintf (&command_line[index++], "%d", timeout_interval);
+ command_line[index++] = strdup ("-r");
+ xasprintf (&command_line[index++], "%d", retries);
+ command_line[index++] = strdup ("-m");
+ command_line[index++] = strdup (miblist);
+ command_line[index++] = "-v";
+ command_line[index++] = strdup (proto);
+
+ xasprintf(&cl_hidden_auth, "%s -Le -t %d -r %d -m %s -v %s",
+ snmpcmd, timeout_interval, retries, strlen(miblist) ? miblist : "''", proto);
+
+ if (ignore_mib_parsing_errors) {
+ command_line[index++] = "-Pe";
+ xasprintf(&cl_hidden_auth, "%s -Pe", cl_hidden_auth);
+ }
+
+
+ for (i = 0; i < numcontext; i++) {
+ command_line[index++] = contextargs[i];
+ }
+
+ for (i = 0; i < numauthpriv; i++) {
+ command_line[index++] = authpriv[i];
+ }
+
+ xasprintf (&command_line[index++], "%s:%s", server_address, port);
+
+ xasprintf(&cl_hidden_auth, "%s [context] [authpriv] %s:%s",
+ cl_hidden_auth,
+ server_address,
+ port);
+
+ for (i = 0; i < numoids; i++) {
+ command_line[index++] = oids[i];
+ xasprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]);
+ }
+
+ command_line[index++] = NULL;
+
+ if (verbose) {
+ printf ("%s\n", cl_hidden_auth);
+ }
+
+ /* Set signal handling and alarm */
+ if (signal (SIGALRM, runcmd_timeout_alarm_handler) == SIG_ERR) {
+ usage4 (_("Cannot catch SIGALRM"));
+ }
+ alarm(timeout_interval * retries + 5);
+
+ /* Run the command */
+ return_code = cmd_run_array (command_line, &chld_out, &chld_err, 0);
+
+ /* disable alarm again */
+ alarm(0);
+
+ /* Due to net-snmp sometimes showing stderr messages with poorly formed MIBs,
+ only return state unknown if return code is non zero or there is no stdout.
+ Do this way so that if there is stderr, will get added to output, which helps problem diagnosis
+ */
+ if (return_code != 0)
+ external_error=1;
+ if (chld_out.lines == 0)
+ external_error=1;
+ if (external_error) {
+ if (chld_err.lines > 0) {
+ printf (_("External command error: %s\n"), chld_err.line[0]);
+ for (i = 1; i < chld_err.lines; i++) {
+ printf ("%s\n", chld_err.line[i]);
+ }
+ } else {
+ printf(_("External command error with no output (return code: %d)\n"), return_code);
+ }
+ exit (STATE_UNKNOWN);
+ }
+
+ if (verbose) {
+ for (i = 0; i < chld_out.lines; i++) {
+ printf ("%s\n", chld_out.line[i]);
+ }
+ }
+
+ for (line=0, i=0; line < chld_out.lines && i < numoids ; line++, i++) {
+ if(calculate_rate)
+ conv = "%.10g";
+ else
+ conv = "%.0f";
+
+ ptr = chld_out.line[line];
+ oidname = strpcpy (oidname, ptr, delimiter);
+ response = strstr (ptr, delimiter);
+ if (response == NULL)
+ break;
+
+ if (verbose > 2) {
+ printf("Processing oid %i (line %i)\n oidname: %s\n response: %s\n", i+1, line+1, oidname, response);
+ }
+
+ /* Clean up type array - Sol10 does not necessarily zero it out */
+ bzero(type, sizeof(type));
+
+ is_counter=0;
+ /* We strip out the datatype indicator for PHBs */
+ if (strstr (response, "Gauge: ")) {
+ show = multiply (strstr (response, "Gauge: ") + 7);
+ }
+ else if (strstr (response, "Gauge32: ")) {
+ show = multiply (strstr (response, "Gauge32: ") + 9);
+ }
+ else if (strstr (response, "Counter32: ")) {
+ show = strstr (response, "Counter32: ") + 11;
+ is_counter=1;
+ if(!calculate_rate)
+ strcpy(type, "c");
+ }
+ else if (strstr (response, "Counter64: ")) {
+ show = strstr (response, "Counter64: ") + 11;
+ is_counter=1;
+ if(!calculate_rate)
+ strcpy(type, "c");
+ }
+ else if (strstr (response, "INTEGER: ")) {
+ show = multiply (strstr (response, "INTEGER: ") + 9);
+
+ if (fmtstr_set) {
+ conv = fmtstr;
+ }
+ }
+ else if (strstr (response, "OID: ")) {
+ show = strstr (response, "OID: ") + 5;
+ }
+ else if (strstr (response, "STRING: ")) {
+ show = strstr (response, "STRING: ") + 8;
+ conv = "%.10g";
+
+ /* Get the rest of the string on multi-line strings */
+ ptr = show;
+ COUNT_SEQ(ptr, bk_count, dq_count)
+ while (dq_count && ptr[0] != '\n' && ptr[0] != '\0') {
+ ptr++;
+ GOBBLE_TOS(ptr, "\n\"\\")
+ COUNT_SEQ(ptr, bk_count, dq_count)
+ }
+
+ if (dq_count) { /* unfinished line */
+ /* copy show verbatim first */
+ if (!mult_resp) mult_resp = strdup("");
+ xasprintf (&mult_resp, "%s%s:\n%s\n", mult_resp, oids[i], show);
+ /* then strip out unmatched double-quote from single-line output */
+ if (show[0] == '"') show++;
+
+ /* Keep reading until we match end of double-quoted string */
+ for (line++; line < chld_out.lines; line++) {
+ ptr = chld_out.line[line];
+ xasprintf (&mult_resp, "%s%s\n", mult_resp, ptr);
+
+ COUNT_SEQ(ptr, bk_count, dq_count)
+ while (dq_count && ptr[0] != '\n' && ptr[0] != '\0') {
+ ptr++;
+ GOBBLE_TOS(ptr, "\n\"\\")
+ COUNT_SEQ(ptr, bk_count, dq_count)
+ }
+ /* Break for loop before next line increment when done */
+ if (!dq_count) break;
+ }
+ }
+
+ }
+ else if (strstr (response, "Timeticks: ")) {
+ show = strstr (response, "Timeticks: ");
+ }
+ else
+ show = response + 3;
+
+ iresult = STATE_DEPENDENT;
+
+ /* Process this block for numeric comparisons */
+ /* Make some special values,like Timeticks numeric only if a threshold is defined */
+ if (thlds[i]->warning || thlds[i]->critical || calculate_rate) {
+ if (verbose > 2) {
+ print_thresholds(" thresholds", thlds[i]);
+ }
+ ptr = strpbrk (show, "-0123456789");
+ if (ptr == NULL){
+ if (nulloid == 3)
+ die (STATE_UNKNOWN,_("No valid data returned (%s)\n"), show);
+ else if (nulloid == 0)
+ die (STATE_OK,_("No valid data returned (%s)\n"), show);
+ else if (nulloid == 1)
+ die (STATE_WARNING,_("No valid data returned (%s)\n"), show);
+ else if (nulloid == 2)
+ die (STATE_CRITICAL,_("No valid data returned (%s)\n"), show);
+ }
+ while (i >= response_size) {
+ response_size += OID_COUNT_STEP;
+ response_value = realloc(response_value, response_size * sizeof(*response_value));
+ }
+ response_value[i] = strtod (ptr, NULL) + offset;
+
+ if(calculate_rate) {
+ if (previous_state!=NULL) {
+ duration = current_time-previous_state->time;
+ if(duration<=0)
+ die(STATE_UNKNOWN,_("Time duration between plugin calls is invalid"));
+ temp_double = response_value[i]-previous_value[i];
+ /* Simple overflow catcher (same as in rrdtool, rrd_update.c) */
+ if(is_counter) {
+ if(temp_double<(double)0.0)
+ temp_double+=(double)4294967296.0; /* 2^32 */
+ if(temp_double<(double)0.0)
+ temp_double+=(double)18446744069414584320.0; /* 2^64-2^32 */;
+ }
+ /* Convert to per second, then use multiplier */
+ temp_double = temp_double/duration*rate_multiplier;
+ iresult = get_status(temp_double, thlds[i]);
+ xasprintf (&show, conv, temp_double);
+ }
+ } else {
+ iresult = get_status(response_value[i], thlds[i]);
+ xasprintf (&show, conv, response_value[i]);
+ }
+ }
+
+ /* Process this block for string matching */
+ else if (eval_size > i && eval_method[i] & CRIT_STRING) {
+ if (strcmp (show, string_value))
+ iresult = (invert_search==0) ? STATE_CRITICAL : STATE_OK;
+ else
+ iresult = (invert_search==0) ? STATE_OK : STATE_CRITICAL;
+ }
+
+ /* Process this block for regex matching */
+ else if (eval_size > i && eval_method[i] & CRIT_REGEX) {
+ excode = regexec (&preg, response, 10, pmatch, eflags);
+ if (excode == 0) {
+ iresult = (invert_search==0) ? STATE_OK : STATE_CRITICAL;
+ }
+ else if (excode != REG_NOMATCH) {
+ regerror (excode, &preg, errbuf, MAX_INPUT_BUFFER);
+ printf (_("Execute Error: %s\n"), errbuf);
+ exit (STATE_CRITICAL);
+ }
+ else {
+ iresult = (invert_search==0) ? STATE_CRITICAL : STATE_OK;
+ }
+ }
+
+ /* Process this block for existence-nonexistence checks */
+ /* TV: Should this be outside of this else block? */
+ else {
+ if (eval_size > i && eval_method[i] & CRIT_PRESENT)
+ iresult = STATE_CRITICAL;
+ else if (eval_size > i && eval_method[i] & WARN_PRESENT)
+ iresult = STATE_WARNING;
+ else if (response && iresult == STATE_DEPENDENT)
+ iresult = STATE_OK;
+ }
+
+ /* Result is the worst outcome of all the OIDs tested */
+ result = max_state (result, iresult);
+
+ /* Prepend a label for this OID if there is one */
+ if (nlabels >= (size_t)1 && (size_t)i < nlabels && labels[i] != NULL)
+ xasprintf (&outbuff, "%s%s%s %s%s%s", outbuff,
+ (i == 0) ? " " : output_delim,
+ labels[i], mark (iresult), show, mark (iresult));
+ else
+ xasprintf (&outbuff, "%s%s%s%s%s", outbuff, (i == 0) ? " " : output_delim,
+ mark (iresult), show, mark (iresult));
+
+ /* Append a unit string for this OID if there is one */
+ if (nunits > (size_t)0 && (size_t)i < nunits && unitv[i] != NULL)
+ xasprintf (&outbuff, "%s %s", outbuff, unitv[i]);
+
+ /* Write perfdata with whatever can be parsed by strtod, if possible */
+ ptr = NULL;
+ strtod(show, &ptr);
+ if (ptr > show) {
+ if (perf_labels && nlabels >= (size_t)1 && (size_t)i < nlabels && labels[i] != NULL)
+ temp_string=labels[i];
+ else
+ temp_string=oidname;
+ if (strpbrk (temp_string, " ='\"") == NULL) {
+ strncat(perfstr, temp_string, sizeof(perfstr)-strlen(perfstr)-1);
+ } else {
+ if (strpbrk (temp_string, "'") == NULL) {
+ quote_string="'";
+ } else {
+ quote_string="\"";
+ }
+ strncat(perfstr, quote_string, sizeof(perfstr)-strlen(perfstr)-1);
+ strncat(perfstr, temp_string, sizeof(perfstr)-strlen(perfstr)-1);
+ strncat(perfstr, quote_string, sizeof(perfstr)-strlen(perfstr)-1);
+ }
+ strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
+ len = sizeof(perfstr)-strlen(perfstr)-1;
+ strncat(perfstr, show, len>ptr-show ? ptr-show : len);
+
+ if (strcmp(type, "") != 0) {
+ strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
+ }
+
+ if (warning_thresholds) {
+ strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
+ if(thlds[i]->warning && thlds[i]->warning->text)
+ strncat(perfstr, thlds[i]->warning->text, sizeof(perfstr)-strlen(perfstr)-1);
+ }
+
+ if (critical_thresholds) {
+ if (!warning_thresholds)
+ strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
+ strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
+ if(thlds[i]->critical && thlds[i]->critical->text)
+ strncat(perfstr, thlds[i]->critical->text, sizeof(perfstr)-strlen(perfstr)-1);
+ }
+
+ strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
+ }
+ }
+ total_oids=i;
+
+ /* Save state data, as all data collected now */
+ if(calculate_rate) {
+ string_length=1024;
+ state_string=malloc(string_length);
+ if(state_string==NULL)
+ die(STATE_UNKNOWN, _("Cannot malloc"));
+
+ current_length=0;
+ for(i=0; i<total_oids; i++) {
+ xasprintf(&temp_string,"%.0f",response_value[i]);
+ if(temp_string==NULL)
+ die(STATE_UNKNOWN,_("Cannot asprintf()"));
+ response_length = strlen(temp_string);
+ if(current_length+response_length>string_length) {
+ string_length=current_length+1024;
+ state_string=realloc(state_string,string_length);
+ if(state_string==NULL)
+ die(STATE_UNKNOWN, _("Cannot realloc()"));
+ }
+ strcpy(&state_string[current_length],temp_string);
+ current_length=current_length+response_length;
+ state_string[current_length]=':';
+ current_length++;
+ free(temp_string);
+ }
+ state_string[--current_length]='\0';
+ if (verbose > 2)
+ printf("State string=%s\n",state_string);
+
+ /* This is not strictly the same as time now, but any subtle variations will cancel out */
+ np_state_write_string(current_time, state_string );
+ if(previous_state==NULL) {
+ /* Or should this be highest state? */
+ die( STATE_OK, _("No previous data to calculate rate - assume okay" ) );
+ }
+ }
+
+ printf ("%s %s -%s %s\n", label, state_text (result), outbuff, perfstr);
+ if (mult_resp) printf ("%s", mult_resp);
+
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ char *ptr;
+ int c = 1;
+ int j = 0, jj = 0, ii = 0;
+
+ int option = 0;
+ static struct option longopts[] = {
+ STD_LONG_OPTS,
+ {"community", required_argument, 0, 'C'},
+ {"oid", required_argument, 0, 'o'},
+ {"object", required_argument, 0, 'o'},
+ {"delimiter", required_argument, 0, 'd'},
+ {"nulloid", required_argument, 0, 'z'},
+ {"output-delimiter", required_argument, 0, 'D'},
+ {"string", required_argument, 0, 's'},
+ {"timeout", required_argument, 0, 't'},
+ {"regex", required_argument, 0, 'r'},
+ {"ereg", required_argument, 0, 'r'},
+ {"eregi", required_argument, 0, 'R'},
+ {"label", required_argument, 0, 'l'},
+ {"units", required_argument, 0, 'u'},
+ {"port", required_argument, 0, 'p'},
+ {"retries", required_argument, 0, 'e'},
+ {"miblist", required_argument, 0, 'm'},
+ {"protocol", required_argument, 0, 'P'},
+ {"context", required_argument, 0, 'N'},
+ {"seclevel", required_argument, 0, 'L'},
+ {"secname", required_argument, 0, 'U'},
+ {"authproto", required_argument, 0, 'a'},
+ {"privproto", required_argument, 0, 'x'},
+ {"authpasswd", required_argument, 0, 'A'},
+ {"privpasswd", required_argument, 0, 'X'},
+ {"next", no_argument, 0, 'n'},
+ {"rate", no_argument, 0, L_CALCULATE_RATE},
+ {"rate-multiplier", required_argument, 0, L_RATE_MULTIPLIER},
+ {"offset", required_argument, 0, L_OFFSET},
+ {"invert-search", no_argument, 0, L_INVERT_SEARCH},
+ {"perf-oids", no_argument, 0, 'O'},
+ {"ipv4", no_argument, 0, '4'},
+ {"ipv6", no_argument, 0, '6'},
+ {"multiplier", required_argument, 0, 'M'},
+ {"fmtstr", required_argument, 0, 'f'},
+ {"ignore-mib-parsing-errors", no_argument, false, L_IGNORE_MIB_PARSING_ERRORS},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ /* reverse compatibility for very old non-POSIX usage forms */
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ if (strcmp ("-wv", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ if (strcmp ("-cv", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "nhvVO46t:c:w:H:C:o:e:E:d:D:s:t:R:r:l:u:p:m:P:N:L:U:a:x:A:X:M:f:z:",
+ longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* usage */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'v': /* verbose */
+ verbose++;
+ break;
+
+ /* Connection info */
+ case 'C': /* group or community */
+ community = optarg;
+ break;
+ case 'H': /* Host or server */
+ server_address = optarg;
+ break;
+ case 'p': /* TCP port number */
+ port = optarg;
+ break;
+ case 'm': /* List of MIBS */
+ miblist = optarg;
+ break;
+ case 'n': /* usesnmpgetnext */
+ usesnmpgetnext = TRUE;
+ break;
+ case 'P': /* SNMP protocol version */
+ proto = optarg;
+ break;
+ case 'N': /* SNMPv3 context */
+ context = optarg;
+ break;
+ case 'L': /* security level */
+ seclevel = optarg;
+ break;
+ case 'U': /* security username */
+ secname = optarg;
+ break;
+ case 'a': /* auth protocol */
+ authproto = optarg;
+ break;
+ case 'x': /* priv protocol */
+ privproto = optarg;
+ break;
+ case 'A': /* auth passwd */
+ authpasswd = optarg;
+ break;
+ case 'X': /* priv passwd */
+ privpasswd = optarg;
+ break;
+ case 't': /* timeout period */
+ if (!is_integer (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ timeout_interval = atoi (optarg);
+ break;
+
+ /* Test parameters */
+ case 'c': /* critical threshold */
+ critical_thresholds = optarg;
+ break;
+ case 'w': /* warning threshold */
+ warning_thresholds = optarg;
+ break;
+ case 'e': /* PRELIMINARY - may change */
+ case 'E': /* PRELIMINARY - may change */
+ if (!is_integer (optarg))
+ usage2 (_("Retries interval must be a positive integer"), optarg);
+ else
+ retries = atoi(optarg);
+ break;
+ case 'o': /* object identifier */
+ if ( strspn( optarg, "0123456789.," ) != strlen( optarg ) ) {
+ /*
+ * we have something other than digits, periods and comas,
+ * so we have a mib variable, rather than just an SNMP OID,
+ * so we have to actually read the mib files
+ */
+ needmibs = TRUE;
+ }
+ for (ptr = strtok(optarg, ", "); ptr != NULL; ptr = strtok(NULL, ", "), j++) {
+ while (j >= oids_size) {
+ oids_size += OID_COUNT_STEP;
+ oids = realloc(oids, oids_size * sizeof (*oids));
+ }
+ oids[j] = strdup(ptr);
+ }
+ numoids = j;
+ if (c == 'E' || c == 'e') {
+ jj++;
+ ii++;
+ while (j+1 >= eval_size) {
+ eval_size += OID_COUNT_STEP;
+ eval_method = realloc(eval_method, eval_size * sizeof(*eval_method));
+ memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
+ }
+ if (c == 'E')
+ eval_method[j+1] |= WARN_PRESENT;
+ else if (c == 'e')
+ eval_method[j+1] |= CRIT_PRESENT;
+ }
+ break;
+ case 'z': /* Null OID Return Check */
+ if (!is_integer (optarg))
+ usage2 (_("Exit status must be a positive integer"), optarg);
+ else
+ nulloid = atoi(optarg);
+ break;
+ case 's': /* string or substring */
+ strncpy (string_value, optarg, sizeof (string_value) - 1);
+ string_value[sizeof (string_value) - 1] = 0;
+ while (jj >= eval_size) {
+ eval_size += OID_COUNT_STEP;
+ eval_method = realloc(eval_method, eval_size * sizeof(*eval_method));
+ memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
+ }
+ eval_method[jj++] = CRIT_STRING;
+ ii++;
+ break;
+ case 'R': /* regex */
+ cflags = REG_ICASE;
+ // fall through
+ case 'r': /* regex */
+ cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
+ strncpy (regex_expect, optarg, sizeof (regex_expect) - 1);
+ regex_expect[sizeof (regex_expect) - 1] = 0;
+ errcode = regcomp (&preg, regex_expect, cflags);
+ if (errcode != 0) {
+ regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER);
+ printf (_("Could Not Compile Regular Expression"));
+ return ERROR;
+ }
+ while (jj >= eval_size) {
+ eval_size += OID_COUNT_STEP;
+ eval_method = realloc(eval_method, eval_size * sizeof(*eval_method));
+ memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
+ }
+ eval_method[jj++] = CRIT_REGEX;
+ ii++;
+ break;
+
+ /* Format */
+ case 'd': /* delimiter */
+ delimiter = strscpy (delimiter, optarg);
+ break;
+ case 'D': /* output-delimiter */
+ output_delim = strscpy (output_delim, optarg);
+ break;
+ case 'l': /* label */
+ nlabels++;
+ if (nlabels > labels_size) {
+ labels_size += 8;
+ labels = realloc (labels, labels_size * sizeof(*labels));
+ if (labels == NULL)
+ die (STATE_UNKNOWN, _("Could not reallocate labels[%d]"), (int)nlabels);
+ }
+ labels[nlabels - 1] = optarg;
+ ptr = thisarg (optarg);
+ labels[nlabels - 1] = ptr;
+ if (ptr[0] == '\'')
+ labels[nlabels - 1] = ptr + 1;
+ while (ptr && (ptr = nextarg (ptr))) {
+ nlabels++;
+ if (nlabels > labels_size) {
+ labels_size += 8;
+ labels = realloc (labels, labels_size * sizeof(*labels));
+ if (labels == NULL)
+ die (STATE_UNKNOWN, _("Could not reallocate labels\n"));
+ }
+ ptr = thisarg (ptr);
+ if (ptr[0] == '\'')
+ labels[nlabels - 1] = ptr + 1;
+ else
+ labels[nlabels - 1] = ptr;
+ }
+ break;
+ case 'u': /* units */
+ units = optarg;
+ nunits++;
+ if (nunits > unitv_size) {
+ unitv_size += 8;
+ unitv = realloc (unitv, unitv_size * sizeof(*unitv));
+ if (unitv == NULL)
+ die (STATE_UNKNOWN, _("Could not reallocate units [%d]\n"), (int)nunits);
+ }
+ unitv[nunits - 1] = optarg;
+ ptr = thisarg (optarg);
+ unitv[nunits - 1] = ptr;
+ if (ptr[0] == '\'')
+ unitv[nunits - 1] = ptr + 1;
+ while (ptr && (ptr = nextarg (ptr))) {
+ if (nunits > unitv_size) {
+ unitv_size += 8;
+ unitv = realloc (unitv, unitv_size * sizeof(*unitv));
+ if (units == NULL)
+ die (STATE_UNKNOWN, _("Could not realloc() units\n"));
+ }
+ nunits++;
+ ptr = thisarg (ptr);
+ if (ptr[0] == '\'')
+ unitv[nunits - 1] = ptr + 1;
+ else
+ unitv[nunits - 1] = ptr;
+ }
+ break;
+ case L_CALCULATE_RATE:
+ if(calculate_rate==0)
+ np_enable_state(NULL, 1);
+ calculate_rate = 1;
+ break;
+ case L_RATE_MULTIPLIER:
+ if(!is_integer(optarg)||((rate_multiplier=atoi(optarg))<=0))
+ usage2(_("Rate multiplier must be a positive integer"),optarg);
+ break;
+ case L_OFFSET:
+ offset=strtod(optarg,NULL);
+ break;
+ case L_INVERT_SEARCH:
+ invert_search=1;
+ break;
+ case 'O':
+ perf_labels=0;
+ break;
+ case '4':
+ break;
+ case '6':
+ xasprintf(&ip_version, "udp6:");
+ if(verbose>2)
+ printf("IPv6 detected! Will pass \"udp6:\" to snmpget.\n");
+ break;
+ case 'M':
+ if ( strspn( optarg, "0123456789.," ) == strlen( optarg ) ) {
+ multiplier=strtod(optarg,NULL);
+ }
+ break;
+ case 'f':
+ if (multiplier != 1.0) {
+ fmtstr=optarg;
+ fmtstr_set = true;
+ }
+ break;
+ case L_IGNORE_MIB_PARSING_ERRORS:
+ ignore_mib_parsing_errors = true;
+ }
+ }
+
+ if (server_address == NULL)
+ server_address = argv[optind];
+
+ if (community == NULL)
+ community = strdup (DEFAULT_COMMUNITY);
+
+ return validate_arguments ();
+}
+
+
+/******************************************************************************
+
+@@-
+<sect3>
+<title>validate_arguments</title>
+
+<para>&PROTO_validate_arguments;</para>
+
+<para>Checks to see if the default miblist needs to be loaded. Also verifies
+the authentication and authorization combinations based on protocol version
+selected.</para>
+
+<para></para>
+
+</sect3>
+-@@
+******************************************************************************/
+
+
+
+int
+validate_arguments ()
+{
+ /* check whether to load locally installed MIBS (CPU/disk intensive) */
+ if (miblist == NULL) {
+ if ( needmibs == TRUE ) {
+ miblist = strdup (DEFAULT_MIBLIST);
+ }else{
+ miblist = ""; /* don't read any mib files for numeric oids */
+ }
+ }
+
+ /* Check server_address is given */
+ if (server_address == NULL)
+ die(STATE_UNKNOWN, _("No host specified\n"));
+
+ /* Check oid is given */
+ if (numoids == 0)
+ die(STATE_UNKNOWN, _("No OIDs specified\n"));
+
+ if (proto == NULL)
+ xasprintf(&proto, DEFAULT_PROTOCOL);
+
+ if ((strcmp(proto,"1") == 0) || (strcmp(proto, "2c")==0)) { /* snmpv1 or snmpv2c */
+ numauthpriv = 2;
+ authpriv = calloc (numauthpriv, sizeof (char *));
+ authpriv[0] = strdup ("-c");
+ authpriv[1] = strdup (community);
+ }
+ else if ( strcmp (proto, "3") == 0 ) { /* snmpv3 args */
+ if (!(context == NULL)) {
+ numcontext = 2;
+ contextargs = calloc (numcontext, sizeof (char *));
+ contextargs[0] = strdup ("-n");
+ contextargs[1] = strdup (context);
+ }
+
+ if (seclevel == NULL)
+ xasprintf(&seclevel, "noAuthNoPriv");
+
+ if (secname == NULL)
+ die(STATE_UNKNOWN, _("Required parameter: %s\n"), "secname");
+
+ if (strcmp(seclevel, "noAuthNoPriv") == 0) {
+ numauthpriv = 4;
+ authpriv = calloc (numauthpriv, sizeof (char *));
+ authpriv[0] = strdup ("-l");
+ authpriv[1] = strdup ("noAuthNoPriv");
+ authpriv[2] = strdup ("-u");
+ authpriv[3] = strdup (secname);
+ } else {
+ if (! ( (strcmp(seclevel, "authNoPriv")==0) || (strcmp(seclevel, "authPriv")==0) ) ) {
+ usage2 (_("Invalid seclevel"), seclevel);
+ }
+
+ if (authproto == NULL )
+ xasprintf(&authproto, DEFAULT_AUTH_PROTOCOL);
+
+ if (authpasswd == NULL)
+ die(STATE_UNKNOWN, _("Required parameter: %s\n"), "authpasswd");
+
+ if ( strcmp(seclevel, "authNoPriv") == 0 ) {
+ numauthpriv = 8;
+ authpriv = calloc (numauthpriv, sizeof (char *));
+ authpriv[0] = strdup ("-l");
+ authpriv[1] = strdup ("authNoPriv");
+ authpriv[2] = strdup ("-a");
+ authpriv[3] = strdup (authproto);
+ authpriv[4] = strdup ("-u");
+ authpriv[5] = strdup (secname);
+ authpriv[6] = strdup ("-A");
+ authpriv[7] = strdup (authpasswd);
+ } else if ( strcmp(seclevel, "authPriv") == 0 ) {
+ if (privproto == NULL )
+ xasprintf(&privproto, DEFAULT_PRIV_PROTOCOL);
+
+ if (privpasswd == NULL)
+ die(STATE_UNKNOWN, _("Required parameter: %s\n"), "privpasswd");
+
+ numauthpriv = 12;
+ authpriv = calloc (numauthpriv, sizeof (char *));
+ authpriv[0] = strdup ("-l");
+ authpriv[1] = strdup ("authPriv");
+ authpriv[2] = strdup ("-a");
+ authpriv[3] = strdup (authproto);
+ authpriv[4] = strdup ("-u");
+ authpriv[5] = strdup (secname);
+ authpriv[6] = strdup ("-A");
+ authpriv[7] = strdup (authpasswd);
+ authpriv[8] = strdup ("-x");
+ authpriv[9] = strdup (privproto);
+ authpriv[10] = strdup ("-X");
+ authpriv[11] = strdup (privpasswd);
+ }
+ }
+
+ }
+ else {
+ usage2 (_("Invalid SNMP version"), proto);
+ }
+
+ return OK;
+}
+
+
+
+/* trim leading whitespace
+ if there is a leading quote, make sure it balances */
+
+char *
+thisarg (char *str)
+{
+ str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
+ if (str[0] == '\'') { /* handle SIMPLE quoted strings */
+ if (strlen (str) == 1 || !strstr (str + 1, "'"))
+ die (STATE_UNKNOWN, _("Unbalanced quotes\n"));
+ }
+ return str;
+}
+
+
+
+/* if there's a leading quote, advance to the trailing quote
+ set the trailing quote to '\x0'
+ if the string continues, advance beyond the comma */
+
+char *
+nextarg (char *str)
+{
+ if (str[0] == '\'') {
+ str[0] = 0;
+ if (strlen (str) > 1) {
+ str = strstr (str + 1, "'");
+ return (++str);
+ }
+ else {
+ return NULL;
+ }
+ }
+ if (str[0] == ',') {
+ str[0] = 0;
+ if (strlen (str) > 1) {
+ return (++str);
+ }
+ else {
+ return NULL;
+ }
+ }
+ if ((str = strstr (str, ",")) && strlen (str) > 1) {
+ str[0] = 0;
+ return (++str);
+ }
+ return NULL;
+}
+
+
+
+/* multiply result (values 0 < n < 1 work as divider) */
+char *
+multiply (char *str)
+{
+ char *endptr;
+ double val;
+ char *conv = "%f";
+
+ if(multiplier == 1)
+ return(str);
+
+ if(verbose>2)
+ printf(" multiply input: %s\n", str);
+
+ val = strtod (str, &endptr);
+ if ((val == 0.0) && (endptr == str)) {
+ die(STATE_UNKNOWN, _("multiplier set (%.1f), but input is not a number: %s"), multiplier, str);
+ }
+
+ if(verbose>2)
+ printf(" multiply extracted double: %f\n", val);
+ val *= multiplier;
+ if (fmtstr_set) {
+ conv = fmtstr;
+ }
+ if (val == (int)val) {
+ snprintf(buffer, DEFAULT_BUFFER_SIZE, "%.0f", val);
+ } else {
+ if(verbose>2)
+ printf(" multiply using format: %s\n", conv);
+ snprintf(buffer, DEFAULT_BUFFER_SIZE, conv, val);
+ }
+ if(verbose>2)
+ printf(" multiply result: %s\n", buffer);
+ return buffer;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("Check status of remote machines and obtain system information via SNMP"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+ printf (UT_IPv46);
+
+ printf (UT_HOST_PORT, 'p', DEFAULT_PORT);
+
+ /* SNMP and Authentication Protocol */
+ printf (" %s\n", "-n, --next");
+ printf (" %s\n", _("Use SNMP GETNEXT instead of SNMP GET"));
+ printf (" %s\n", "-P, --protocol=[1|2c|3]");
+ printf (" %s\n", _("SNMP protocol version"));
+ printf (" %s\n", "-N, --context=CONTEXT");
+ printf (" %s\n", _("SNMPv3 context"));
+ printf (" %s\n", "-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]");
+ printf (" %s\n", _("SNMPv3 securityLevel"));
+ printf (" %s\n", "-a, --authproto=[MD5|SHA]");
+ printf (" %s\n", _("SNMPv3 auth proto"));
+ printf (" %s\n", "-x, --privproto=[DES|AES]");
+ printf (" %s\n", _("SNMPv3 priv proto (default DES)"));
+
+ /* Authentication Tokens*/
+ printf (" %s\n", "-C, --community=STRING");
+ printf (" %s ", _("Optional community string for SNMP communication"));
+ printf ("(%s \"%s\")\n", _("default is") ,DEFAULT_COMMUNITY);
+ printf (" %s\n", "-U, --secname=USERNAME");
+ printf (" %s\n", _("SNMPv3 username"));
+ printf (" %s\n", "-A, --authpasswd=PASSWORD");
+ printf (" %s\n", _("SNMPv3 authentication password"));
+ printf (" %s\n", "-X, --privpasswd=PASSWORD");
+ printf (" %s\n", _("SNMPv3 privacy password"));
+
+ /* OID Stuff */
+ printf (" %s\n", "-o, --oid=OID(s)");
+ printf (" %s\n", _("Object identifier(s) or SNMP variables whose value you wish to query"));
+ printf (" %s\n", "-m, --miblist=STRING");
+ printf (" %s\n", _("List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'"));
+ printf (" %s\n", _("for symbolic OIDs.)"));
+ printf (" %s\n", "-d, --delimiter=STRING");
+ printf (" %s \"%s\"\n", _("Delimiter to use when parsing returned data. Default is"), DEFAULT_DELIMITER);
+ printf (" %s\n", _("Any data on the right hand side of the delimiter is considered"));
+ printf (" %s\n", _("to be the data that should be used in the evaluation."));
+ printf (" %s\n", "-z, --nulloid=#");
+ printf (" %s\n", _("If the check returns a 0 length string or NULL value"));
+ printf (" %s\n", _("This option allows you to choose what status you want it to exit"));
+ printf (" %s\n", _("Excluding this option renders the default exit of 3(STATE_UNKNOWN)"));
+ printf (" %s\n", _("0 = OK"));
+ printf (" %s\n", _("1 = WARNING"));
+ printf (" %s\n", _("2 = CRITICAL"));
+ printf (" %s\n", _("3 = UNKNOWN"));
+
+ /* Tests Against Integers */
+ printf (" %s\n", "-w, --warning=THRESHOLD(s)");
+ printf (" %s\n", _("Warning threshold range(s)"));
+ printf (" %s\n", "-c, --critical=THRESHOLD(s)");
+ printf (" %s\n", _("Critical threshold range(s)"));
+ printf (" %s\n", "--rate");
+ printf (" %s\n", _("Enable rate calculation. See 'Rate Calculation' below"));
+ printf (" %s\n", "--rate-multiplier");
+ printf (" %s\n", _("Converts rate per second. For example, set to 60 to convert to per minute"));
+ printf (" %s\n", "--offset=OFFSET");
+ printf (" %s\n", _("Add/subtract the specified OFFSET to numeric sensor data"));
+
+ /* Tests Against Strings */
+ printf (" %s\n", "-s, --string=STRING");
+ printf (" %s\n", _("Return OK state (for that OID) if STRING is an exact match"));
+ printf (" %s\n", "-r, --ereg=REGEX");
+ printf (" %s\n", _("Return OK state (for that OID) if extended regular expression REGEX matches"));
+ printf (" %s\n", "-R, --eregi=REGEX");
+ printf (" %s\n", _("Return OK state (for that OID) if case-insensitive extended REGEX matches"));
+ printf (" %s\n", "--invert-search");
+ printf (" %s\n", _("Invert search result (CRITICAL if found)"));
+
+ /* Output Formatting */
+ printf (" %s\n", "-l, --label=STRING");
+ printf (" %s\n", _("Prefix label for output from plugin"));
+ printf (" %s\n", "-u, --units=STRING");
+ printf (" %s\n", _("Units label(s) for output data (e.g., 'sec.')."));
+ printf (" %s\n", "-D, --output-delimiter=STRING");
+ printf (" %s\n", _("Separates output on multiple OID requests"));
+ printf (" %s\n", "-M, --multiplier=FLOAT");
+ printf (" %s\n", _("Multiplies current value, 0 < n < 1 works as divider, defaults to 1"));
+ printf (" %s\n", "-f, --fmtstr=STRING");
+ printf (" %s\n", _("C-style format string for float values (see option -M)"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+ printf (" %s\n", _("NOTE the final timeout value is calculated using this formula: timeout_interval * retries + 5"));
+ printf (" %s\n", "-e, --retries=INTEGER");
+ printf (" %s%i\n", _("Number of retries to be used in the requests, default: "), DEFAULT_RETRIES);
+
+ printf (" %s\n", "-O, --perf-oids");
+ printf (" %s\n", _("Label performance data with OIDs instead of --label's"));
+
+ printf (" %s\n", "--ignore-mib-parsing-errors");
+ printf (" %s\n", _("Tell snmpget to not print errors encountered when parsing MIB files"));
+
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("This plugin uses the 'snmpget' command included with the NET-SNMP package."));
+ printf ("%s\n", _("if you don't have the package installed, you will need to download it from"));
+ printf ("%s\n", _("http://net-snmp.sourceforge.net before you can use this plugin."));
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "));
+ printf (" %s\n", _("list (lists with internal spaces must be quoted)."));
+
+ printf(" -%s", UT_THRESHOLDS_NOTES);
+
+ printf (" %s\n", _("- When checking multiple OIDs, separate ranges by commas like '-w 1:10,1:,:20'"));
+ printf (" %s\n", _("- Note that only one string and one regex may be checked at present"));
+ printf (" %s\n", _("- All evaluation methods other than PR, STR, and SUBSTR expect that the value"));
+ printf (" %s\n", _("returned from the SNMP query is an unsigned integer."));
+
+ printf("\n");
+ printf("%s\n", _("Rate Calculation:"));
+ printf(" %s\n", _("In many places, SNMP returns counters that are only meaningful when"));
+ printf(" %s\n", _("calculating the counter difference since the last check. check_snmp"));
+ printf(" %s\n", _("saves the last state information in a file so that the rate per second"));
+ printf(" %s\n", _("can be calculated. Use the --rate option to save state information."));
+ printf(" %s\n", _("On the first run, there will be no prior state - this will return with OK."));
+ printf(" %s\n", _("The state is uniquely determined by the arguments to the plugin, so"));
+ printf(" %s\n", _("changing the arguments will create a new state file."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range]\n",progname);
+ printf ("[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]\n");
+ printf ("[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]\n");
+ printf ("[-m miblist] [-P snmp version] [-N context] [-L seclevel] [-U secname]\n");
+ printf ("[-a authproto] [-A authpasswd] [-x privproto] [-X privpasswd] [-4|6]\n");
+ printf ("[-M multiplier [-f format]]\n");
+}
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
new file mode 100644
index 0000000..8ccbd5a
--- /dev/null
+++ b/plugins/check_ssh.c
@@ -0,0 +1,328 @@
+/*****************************************************************************
+*
+* Monitoring check_ssh plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_ssh plugin
+*
+* Try to connect to an SSH server at specified server and port
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_ssh";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+#ifndef MSG_DONTWAIT
+#define MSG_DONTWAIT 0
+#endif
+
+#define SSH_DFL_PORT 22
+#define BUFF_SZ 256
+
+int port = -1;
+char *server_name = NULL;
+char *remote_version = NULL;
+char *remote_protocol = NULL;
+int verbose = FALSE;
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+int ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol);
+
+
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ alarm (socket_timeout);
+
+ /* ssh_connect exits if error is found */
+ result = ssh_connect (server_name, port, remote_version, remote_protocol);
+
+ alarm (0);
+
+ return (result);
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"host", required_argument, 0, 'H'}, /* backward compatibility */
+ {"hostname", required_argument, 0, 'H'},
+ {"port", required_argument, 0, 'p'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"timeout", required_argument, 0, 't'},
+ {"verbose", no_argument, 0, 'v'},
+ {"remote-version", required_argument, 0, 'r'},
+ {"remote-protcol", required_argument, 0, 'P'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++)
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+
+ while (1) {
+ c = getopt_long (argc, argv, "+Vhv46t:r:H:p:P:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* help */
+ usage5 ();
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'v': /* verbose */
+ verbose = TRUE;
+ break;
+ case 't': /* timeout period */
+ if (!is_integer (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ socket_timeout = atoi (optarg);
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case 'r': /* remote version */
+ remote_version = optarg;
+ break;
+ case 'P': /* remote version */
+ remote_protocol = optarg;
+ break;
+ case 'H': /* host */
+ if (is_host (optarg) == FALSE)
+ usage2 (_("Invalid hostname/address"), optarg);
+ server_name = optarg;
+ break;
+ case 'p': /* port */
+ if (is_intpos (optarg)) {
+ port = atoi (optarg);
+ }
+ else {
+ usage2 (_("Port number must be a positive integer"), optarg);
+ }
+ }
+ }
+
+ c = optind;
+ if (server_name == NULL && c < argc) {
+ if (is_host (argv[c])) {
+ server_name = argv[c++];
+ }
+ }
+
+ if (port == -1 && c < argc) {
+ if (is_intpos (argv[c])) {
+ port = atoi (argv[c++]);
+ }
+ else {
+ print_usage ();
+ exit (STATE_UNKNOWN);
+ }
+ }
+
+ return validate_arguments ();
+}
+
+int
+validate_arguments (void)
+{
+ if (server_name == NULL)
+ return ERROR;
+ if (port == -1) /* funky, but allows -p to override stray integer in args */
+ port = SSH_DFL_PORT;
+ return OK;
+}
+
+
+/************************************************************************
+*
+* Try to connect to SSH server at specified server and port
+*
+*-----------------------------------------------------------------------*/
+
+
+int
+ssh_connect (char *haddr, int hport, char *remote_version, char *remote_protocol)
+{
+ int sd;
+ int result;
+ char *output = NULL;
+ char *buffer = NULL;
+ char *ssh_proto = NULL;
+ char *ssh_server = NULL;
+ static char *rev_no = VERSION;
+ struct timeval tv;
+ double elapsed_time;
+
+ gettimeofday(&tv, NULL);
+
+ result = my_tcp_connect (haddr, hport, &sd);
+
+ if (result != STATE_OK)
+ return result;
+
+ output = (char *) malloc (BUFF_SZ + 1);
+ memset (output, 0, BUFF_SZ + 1);
+ recv (sd, output, BUFF_SZ, 0);
+ if (strncmp (output, "SSH", 3)) {
+ printf (_("Server answer: %s"), output);
+ close(sd);
+ exit (STATE_CRITICAL);
+ }
+ else {
+ strip (output);
+ if (verbose)
+ printf ("%s\n", output);
+ ssh_proto = output + 4;
+ ssh_server = ssh_proto + strspn (ssh_proto, "-0123456789. ");
+ ssh_proto[strspn (ssh_proto, "0123456789. ")] = 0;
+
+ xasprintf (&buffer, "SSH-%s-check_ssh_%s\r\n", ssh_proto, rev_no);
+ send (sd, buffer, strlen (buffer), MSG_DONTWAIT);
+ if (verbose)
+ printf ("%s\n", buffer);
+
+ if (remote_version && strcmp(remote_version, ssh_server)) {
+ printf
+ (_("SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"),
+ ssh_server, ssh_proto, remote_version);
+ close(sd);
+ exit (STATE_CRITICAL);
+ }
+
+ if (remote_protocol && strcmp(remote_protocol, ssh_proto)) {
+ printf
+ (_("SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"),
+ ssh_server, ssh_proto, remote_protocol);
+ close(sd);
+ exit (STATE_CRITICAL);
+ }
+
+ elapsed_time = (double)deltime(tv) / 1.0e6;
+
+ printf
+ (_("SSH OK - %s (protocol %s) | %s\n"),
+ ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s",
+ FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout));
+ close(sd);
+ exit (STATE_OK);
+ }
+}
+
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", SSH_DFL_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Remi Paulmier <remi@sinfomic.fr>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("Try to connect to an SSH server at specified server and port"));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (UT_IPv46);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (" %s\n", "-r, --remote-version=STRING");
+ printf (" %s\n", _("Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"));
+
+ printf (" %s\n", "-P, --remote-protocol=STRING");
+ printf (" %s\n", _("Alert if protocol doesn't match expected protocol version (ex: 2.0)"));
+
+ printf (UT_VERBOSE);
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s [-4|-6] [-t <timeout>] [-r <remote version>] [-p <port>] <host>\n", progname);
+}
+
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
new file mode 100644
index 0000000..cd965e3
--- /dev/null
+++ b/plugins/check_swap.c
@@ -0,0 +1,610 @@
+/*****************************************************************************
+*
+* Monitoring check_swap plugin
+*
+* License: GPL
+* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net)
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_swap plugin
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_swap";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "popen.h"
+#include "utils.h"
+
+#ifdef HAVE_DECL_SWAPCTL
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+# ifdef HAVE_SYS_SWAP_H
+# include <sys/swap.h>
+# endif
+# ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+# endif
+#endif
+
+#ifndef SWAP_CONVERSION
+# define SWAP_CONVERSION 1
+#endif
+
+typedef struct {
+ int is_percentage;
+ uint64_t value;
+} threshold_t;
+
+int check_swap (float free_swap_mb, float total_swap_mb);
+int process_arguments (int argc, char **argv);
+int validate_arguments (void);
+void print_usage (void);
+void print_help (void);
+
+threshold_t warn;
+threshold_t crit;
+int verbose;
+int allswaps;
+int no_swap_state = STATE_CRITICAL;
+
+int
+main (int argc, char **argv)
+{
+ unsigned int percent_used, percent;
+ uint64_t total_swap_mb = 0, used_swap_mb = 0, free_swap_mb = 0;
+ uint64_t dsktotal_mb = 0, dskused_mb = 0, dskfree_mb = 0;
+ uint64_t tmp_KB = 0;
+ int result = STATE_UNKNOWN;
+ char input_buffer[MAX_INPUT_BUFFER];
+#ifdef HAVE_PROC_MEMINFO
+ FILE *fp;
+#else
+ int conv_factor = SWAP_CONVERSION;
+# ifdef HAVE_SWAP
+ char *temp_buffer;
+ char *swap_command;
+ char *swap_format;
+# else
+# ifdef HAVE_DECL_SWAPCTL
+ int i=0, nswaps=0, swapctl_res=0;
+# ifdef CHECK_SWAP_SWAPCTL_SVR4
+ swaptbl_t *tbl=NULL;
+ swapent_t *ent=NULL;
+# else
+# ifdef CHECK_SWAP_SWAPCTL_BSD
+ struct swapent *ent;
+# endif /* CHECK_SWAP_SWAPCTL_BSD */
+# endif /* CHECK_SWAP_SWAPCTL_SVR4 */
+# endif /* HAVE_DECL_SWAPCTL */
+# endif
+#endif
+ char str[32];
+ char *status;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ status = strdup ("");
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+#ifdef HAVE_PROC_MEMINFO
+ if (verbose >= 3) {
+ printf("Reading PROC_MEMINFO at %s\n", PROC_MEMINFO);
+ }
+ fp = fopen (PROC_MEMINFO, "r");
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) {
+ /*
+ * The following sscanf call looks for a line looking like: "Swap: 123 123 123"
+ * On which kind of system this format exists, I can not say, but I wanted to
+ * document this for people who are not adapt with sscanf anymore, like me
+ */
+ if (sscanf (input_buffer, "%*[S]%*[w]%*[a]%*[p]%*[:] %lu %lu %lu", &dsktotal_mb, &dskused_mb, &dskfree_mb) == 3) {
+ dsktotal_mb = dsktotal_mb / (1024 * 1024); /* Apply conversion */
+ dskused_mb = dskused_mb / (1024 * 1024);
+ dskfree_mb = dskfree_mb / (1024 * 1024);
+ total_swap_mb += dsktotal_mb;
+ used_swap_mb += dskused_mb;
+ free_swap_mb += dskfree_mb;
+ if (allswaps) {
+ if (dsktotal_mb == 0)
+ percent=100.0;
+ else
+ percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb));
+ result = max_state (result, check_swap (dskfree_mb, dsktotal_mb));
+ if (verbose)
+ xasprintf (&status, "%s [%lu (%d%%)]", status, dskfree_mb, 100 - percent);
+ }
+ }
+
+ /*
+ * The following sscanf call looks for lines looking like: "SwapTotal: 123" and "SwapFree: 123"
+ * This format exists at least on Debian Linux with a 5.* kernel
+ */
+ else if (sscanf (input_buffer, "%*[S]%*[w]%*[a]%*[p]%[TotalFreCchd]%*[:] %lu %*[k]%*[B]", str, &tmp_KB)) {
+ if (verbose >= 3) {
+ printf("Got %s with %lu\n", str, tmp_KB);
+ }
+ /* I think this part is always in Kb, so convert to mb */
+ if (strcmp ("Total", str) == 0) {
+ dsktotal_mb = tmp_KB / 1024;
+ }
+ else if (strcmp ("Free", str) == 0) {
+ dskfree_mb = dskfree_mb + tmp_KB / 1024;
+ }
+ else if (strcmp ("Cached", str) == 0) {
+ dskfree_mb = dskfree_mb + tmp_KB / 1024;
+ }
+ }
+ }
+ fclose(fp);
+ dskused_mb = dsktotal_mb - dskfree_mb;
+ total_swap_mb = dsktotal_mb;
+ used_swap_mb = dskused_mb;
+ free_swap_mb = dskfree_mb;
+#else
+# ifdef HAVE_SWAP
+ xasprintf(&swap_command, "%s", SWAP_COMMAND);
+ xasprintf(&swap_format, "%s", SWAP_FORMAT);
+
+/* These override the command used if a summary (and thus ! allswaps) is required */
+/* The summary flag returns more accurate information about swap usage on these OSes */
+# ifdef _AIX
+ if (!allswaps) {
+ xasprintf(&swap_command, "%s", "/usr/sbin/lsps -s");
+ xasprintf(&swap_format, "%s", "%lu%*s %lu");
+ conv_factor = 1;
+ }
+# endif
+
+ if (verbose >= 2)
+ printf (_("Command: %s\n"), swap_command);
+ if (verbose >= 3)
+ printf (_("Format: %s\n"), swap_format);
+
+ child_process = spopen (swap_command);
+ if (child_process == NULL) {
+ printf (_("Could not open pipe: %s\n"), swap_command);
+ return STATE_UNKNOWN;
+ }
+
+ child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
+ if (child_stderr == NULL)
+ printf (_("Could not open stderr for %s\n"), swap_command);
+
+ sprintf (str, "%s", "");
+ /* read 1st line */
+ fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process);
+ if (strcmp (swap_format, "") == 0) {
+ temp_buffer = strtok (input_buffer, " \n");
+ while (temp_buffer) {
+ if (strstr (temp_buffer, "blocks"))
+ sprintf (str, "%s %s", str, "%lu");
+ else if (strstr (temp_buffer, "dskfree"))
+ sprintf (str, "%s %s", str, "%lu");
+ else
+ sprintf (str, "%s %s", str, "%*s");
+ temp_buffer = strtok (NULL, " \n");
+ }
+ }
+
+/* If different swap command is used for summary switch, need to read format differently */
+# ifdef _AIX
+ if (!allswaps) {
+ fgets(input_buffer, MAX_INPUT_BUFFER - 1, child_process); /* Ignore first line */
+ sscanf (input_buffer, swap_format, &total_swap_mb, &used_swap_mb);
+ free_swap_mb = total_swap_mb * (100 - used_swap_mb) /100;
+ used_swap_mb = total_swap_mb - free_swap_mb;
+ if (verbose >= 3)
+ printf (_("total=%.0f, used=%.0f, free=%.0f\n"), total_swap_mb, used_swap_mb, free_swap_mb);
+ } else {
+# endif
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
+ sscanf (input_buffer, swap_format, &dsktotal_mb, &dskfree_mb);
+
+ dsktotal_mb = dsktotal_mb / conv_factor;
+ /* AIX lists percent used, so this converts to dskfree in MBs */
+# ifdef _AIX
+ dskfree_mb = dsktotal_mb * (100 - dskfree_mb) / 100;
+# else
+ dskfree_mb = dskfree_mb / conv_factor;
+# endif
+ if (verbose >= 3)
+ printf (_("total=%.0f, free=%.0f\n"), dsktotal_mb, dskfree_mb);
+
+ dskused_mb = dsktotal_mb - dskfree_mb;
+ total_swap_mb += dsktotal_mb;
+ used_swap_mb += dskused_mb;
+ free_swap_mb += dskfree_mb;
+ if (allswaps) {
+ percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb));
+ result = max_state (result, check_swap (dskfree_mb, dsktotal_mb));
+ if (verbose)
+ xasprintf (&status, "%s [%.0f (%d%%)]", status, dskfree_mb, 100 - percent);
+ }
+ }
+# ifdef _AIX
+ }
+# endif
+
+ /* If we get anything on STDERR, at least set warning */
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr))
+ result = max_state (result, STATE_WARNING);
+
+ /* close stderr */
+ (void) fclose (child_stderr);
+
+ /* close the pipe */
+ if (spclose (child_process))
+ result = max_state (result, STATE_WARNING);
+# else
+# ifdef CHECK_SWAP_SWAPCTL_SVR4
+
+ /* get the number of active swap devices */
+ if((nswaps=swapctl(SC_GETNSWP, NULL))== -1)
+ die(STATE_UNKNOWN, _("Error getting swap devices\n") );
+
+ if(nswaps == 0)
+ die(STATE_OK, _("SWAP OK: No swap devices defined\n"));
+
+ if(verbose >= 3)
+ printf("Found %d swap device(s)\n", nswaps);
+
+ /* initialize swap table + entries */
+ tbl=(swaptbl_t*)malloc(sizeof(swaptbl_t)+(sizeof(swapent_t)*nswaps));
+
+ if(tbl==NULL)
+ die(STATE_UNKNOWN, _("malloc() failed!\n"));
+
+ memset(tbl, 0, sizeof(swaptbl_t)+(sizeof(swapent_t)*nswaps));
+ tbl->swt_n=nswaps;
+ for(i=0;i<nswaps;i++){
+ if((tbl->swt_ent[i].ste_path=(char*)malloc(sizeof(char)*MAXPATHLEN)) == NULL)
+ die(STATE_UNKNOWN, _("malloc() failed!\n"));
+ }
+
+ /* and now, tally 'em up */
+ swapctl_res=swapctl(SC_LIST, tbl);
+ if(swapctl_res < 0){
+ perror(_("swapctl failed: "));
+ die(STATE_UNKNOWN, _("Error in swapctl call\n"));
+ }
+
+ for(i=0;i<nswaps;i++){
+ dsktotal_mb = (float) tbl->swt_ent[i].ste_pages / SWAP_CONVERSION;
+ dskfree_mb = (float) tbl->swt_ent[i].ste_free / SWAP_CONVERSION;
+ dskused_mb = ( dsktotal_mb - dskfree_mb );
+
+ if (verbose >= 3)
+ printf ("dsktotal_mb=%.0f dskfree_mb=%.0f dskused_mb=%.0f\n", dsktotal_mb, dskfree_mb, dskused_mb);
+
+ if(allswaps && dsktotal_mb > 0){
+ percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb));
+ result = max_state (result, check_swap (dskfree_mb, dsktotal_mb));
+ if (verbose) {
+ xasprintf (&status, "%s [%.0f (%d%%)]", status, dskfree_mb, 100 - percent);
+ }
+ }
+
+ total_swap_mb += dsktotal_mb;
+ free_swap_mb += dskfree_mb;
+ used_swap_mb += dskused_mb;
+ }
+
+ /* and clean up after ourselves */
+ for(i=0;i<nswaps;i++){
+ free(tbl->swt_ent[i].ste_path);
+ }
+ free(tbl);
+# else
+# ifdef CHECK_SWAP_SWAPCTL_BSD
+
+ /* get the number of active swap devices */
+ nswaps=swapctl(SWAP_NSWAP, NULL, 0);
+
+ /* initialize swap table + entries */
+ ent=(struct swapent*)malloc(sizeof(struct swapent)*nswaps);
+
+ /* and now, tally 'em up */
+ swapctl_res=swapctl(SWAP_STATS, ent, nswaps);
+ if(swapctl_res < 0){
+ perror(_("swapctl failed: "));
+ die(STATE_UNKNOWN, _("Error in swapctl call\n"));
+ }
+
+ for(i=0;i<nswaps;i++){
+ dsktotal_mb = (float) ent[i].se_nblks / conv_factor;
+ dskused_mb = (float) ent[i].se_inuse / conv_factor;
+ dskfree_mb = ( dsktotal_mb - dskused_mb );
+
+ if(allswaps && dsktotal_mb > 0){
+ percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb));
+ result = max_state (result, check_swap(dskfree_mb, dsktotal_mb));
+ if (verbose) {
+ xasprintf (&status, "%s [%.0f (%d%%)]", status, dskfree_mb, 100 - percent);
+ }
+ }
+
+ total_swap_mb += dsktotal_mb;
+ free_swap_mb += dskfree_mb;
+ used_swap_mb += dskused_mb;
+ }
+
+ /* and clean up after ourselves */
+ free(ent);
+
+# endif /* CHECK_SWAP_SWAPCTL_BSD */
+# endif /* CHECK_SWAP_SWAPCTL_SVR4 */
+# endif /* HAVE_SWAP */
+#endif /* HAVE_PROC_MEMINFO */
+
+ /* if total_swap_mb == 0, let's not divide by 0 */
+ if(total_swap_mb) {
+ percent_used = 100 * ((double) used_swap_mb) / ((double) total_swap_mb);
+ } else {
+ percent_used = 100;
+ status = "- Swap is either disabled, not present, or of zero size. ";
+ }
+
+ result = max_state (result, check_swap(free_swap_mb, total_swap_mb));
+ printf (_("SWAP %s - %d%% free (%dMB out of %dMB) %s|"),
+ state_text (result),
+ (100 - percent_used), (int) free_swap_mb, (int) total_swap_mb, status);
+
+ uint64_t warn_print = warn.value;
+ if (warn.is_percentage) warn_print = warn.value * (total_swap_mb *1024 *1024/100);
+ uint64_t crit_print = crit.value;
+ if (crit.is_percentage) crit_print = crit.value * (total_swap_mb *1024 *1024/100);
+
+ puts (perfdata_uint64 ("swap", free_swap_mb *1024 *1024, "B",
+ TRUE, warn_print,
+ TRUE, crit_print,
+ TRUE, 0,
+ TRUE, (long) total_swap_mb * 1024 * 1024));
+
+ return result;
+}
+
+
+int
+check_swap(float free_swap_mb, float total_swap_mb)
+{
+
+ if (!total_swap_mb) return no_swap_state;
+
+ uint64_t free_swap = free_swap_mb * (1024 * 1024); /* Convert back to bytes as warn and crit specified in bytes */
+
+ if (!crit.is_percentage && crit.value >= free_swap) return STATE_CRITICAL;
+ if (!warn.is_percentage && warn.value >= free_swap) return STATE_WARNING;
+
+
+ uint64_t usage_percentage = ((total_swap_mb - free_swap_mb) / total_swap_mb) * 100;
+
+ if (crit.is_percentage &&
+ crit.value != 0 &&
+ usage_percentage >= (100 - crit.value))
+ {
+ return STATE_CRITICAL;
+ }
+
+ if (warn.is_percentage &&
+ warn.value != 0 &&
+ usage_percentage >= (100 - warn.value))
+ {
+ return STATE_WARNING;
+ }
+
+ return STATE_OK;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c = 0; /* option character */
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"allswaps", no_argument, 0, 'a'},
+ {"no-swap", required_argument, 0, 'n'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ while (1) {
+ c = getopt_long (argc, argv, "+?Vvhac:w:n:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'w': /* warning size threshold */
+ {
+ /*
+ * We expect either a positive integer value without a unit, which means
+ * the unit is Bytes or a positive integer value and a percentage sign (%),
+ * which means the value must be with 0 and 100 and is relative to the total swap
+ */
+ size_t length;
+ length = strlen(optarg);
+
+ if (optarg[length - 1] == '%') {
+ /* It's percentage */
+ warn.is_percentage = 1;
+ optarg[length - 1] = '\0';
+ if (is_uint64(optarg, &warn.value)) {
+ if (warn.value > 100) {
+ usage4 (_("Warning threshold percentage must be <= 100!"));
+ }
+ }
+ break;
+ } else {
+ /* It's Bytes */
+ warn.is_percentage = 0;
+ if (is_uint64(optarg, &warn.value)) {
+ break;
+ } else {
+ usage4 (_("Warning threshold be positive integer or percentage!"));
+ }
+ }
+ }
+ case 'c': /* critical size threshold */
+ {
+ /*
+ * We expect either a positive integer value without a unit, which means
+ * the unit is Bytes or a positive integer value and a percentage sign (%),
+ * which means the value must be with 0 and 100 and is relative to the total swap
+ */
+ size_t length;
+ length = strlen(optarg);
+
+ if (optarg[length - 1] == '%') {
+ /* It's percentage */
+ crit.is_percentage = 1;
+ optarg[length - 1] = '\0';
+ if (is_uint64(optarg, &crit.value)) {
+ if (crit.value> 100) {
+ usage4 (_("Critical threshold percentage must be <= 100!"));
+ }
+ }
+ break;
+ } else {
+ /* It's Bytes */
+ crit.is_percentage = 0;
+ if (is_uint64(optarg, &crit.value)) {
+ break;
+ } else {
+ usage4 (_("Critical threshold be positive integer or percentage!"));
+ }
+ }
+ }
+ case 'a': /* all swap */
+ allswaps = TRUE;
+ break;
+ case 'n':
+ if ((no_swap_state = mp_translate_state(optarg)) == ERROR) {
+ usage4 (_("no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
+ }
+ break;
+ case 'v': /* verbose */
+ verbose++;
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case '?': /* error */
+ usage5 ();
+ }
+ }
+
+ c = optind;
+ if (c == argc)
+ return validate_arguments ();
+
+ return validate_arguments ();
+}
+
+
+
+int
+validate_arguments (void)
+{
+ if (warn.value == 0 && crit.value == 0) {
+ return ERROR;
+ }
+ else if ((warn.is_percentage == crit.is_percentage) && (warn.value < crit.value)) {
+ /* This is NOT triggered if warn and crit are different units, e.g warn is percentage
+ * and crit is absolute. We cannot determine the condition at this point since we
+ * dont know the value of total swap yet
+ */
+ usage4(_("Warning should be more than critical"));
+ }
+ return OK;
+}
+
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf (_(COPYRIGHT), copyright, email);
+
+ printf ("%s\n", _("Check swap space on local machine."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Exit with WARNING status if less than INTEGER bytes of swap space are free"));
+ printf (" %s\n", "-w, --warning=PERCENT%");
+ printf (" %s\n", _("Exit with WARNING status if less than PERCENT of swap space is free"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Exit with CRITICAL status if less than INTEGER bytes of swap space are free"));
+ printf (" %s\n", "-c, --critical=PERCENT%");
+ printf (" %s\n", _("Exit with CRITICAL status if less than PERCENT of swap space is free"));
+ printf (" %s\n", "-a, --allswaps");
+ printf (" %s\n", _("Conduct comparisons for all swap partitions, one by one"));
+ printf (" %s\n", "-n, --no-swap=<ok|warning|critical|unknown>");
+ printf (" %s %s\n", _("Resulting state when there is no swap regardless of thresholds. Default:"), state_text(no_swap_state));
+ printf (UT_VERBOSE);
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("Both INTEGER and PERCENT thresholds can be specified, they are all checked."));
+ printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."));
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf (" %s [-av] -w <percent_free>%% -c <percent_free>%%\n",progname);
+ printf (" -w <bytes_free> -c <bytes_free> [-n <state>]\n");
+}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
new file mode 100644
index 0000000..1d307cf
--- /dev/null
+++ b/plugins/check_tcp.c
@@ -0,0 +1,715 @@
+/*****************************************************************************
+*
+* Monitoring check_tcp plugin
+*
+* License: GPL
+* Copyright (c) 1999-2013 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_tcp plugin
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+* $Id$
+*
+*****************************************************************************/
+
+/* progname "check_tcp" changes depending on symlink called */
+char *progname;
+const char *copyright = "1999-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+#include "utils_tcp.h"
+
+#include <ctype.h>
+#include <sys/select.h>
+
+#ifdef HAVE_SSL
+static int check_cert = FALSE;
+static int days_till_exp_warn, days_till_exp_crit;
+# define my_recv(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
+# define my_send(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0))
+#else
+# define my_recv(buf, len) read(sd, buf, len)
+# define my_send(buf, len) send(sd, buf, len, 0)
+#endif
+
+/* int my_recv(char *, size_t); */
+static int process_arguments (int, char **);
+void print_help (void);
+void print_usage (void);
+
+#define EXPECT server_expect[0]
+static char *SERVICE = "TCP";
+static char *SEND = NULL;
+static char *QUIT = NULL;
+static int PROTOCOL = IPPROTO_TCP; /* most common is default */
+static int PORT = 0;
+static int READ_TIMEOUT = 2;
+
+static int server_port = 0;
+static char *server_address = NULL;
+static int host_specified = FALSE;
+static char *server_send = NULL;
+static char *server_quit = NULL;
+static char **server_expect;
+static size_t server_expect_count = 0;
+static size_t maxbytes = 0;
+static char **warn_codes = NULL;
+static size_t warn_codes_count = 0;
+static char **crit_codes = NULL;
+static size_t crit_codes_count = 0;
+static unsigned int delay = 0;
+static double warning_time = 0;
+static double critical_time = 0;
+static double elapsed_time = 0;
+static long microsec;
+static int sd = 0;
+#define MAXBUF 1024
+static char buffer[MAXBUF];
+static int expect_mismatch_state = STATE_WARNING;
+static int match_flags = NP_MATCH_EXACT;
+
+#ifdef HAVE_SSL
+static char *sni = NULL;
+static int sni_specified = FALSE;
+#endif
+
+#define FLAG_SSL 0x01
+#define FLAG_VERBOSE 0x02
+#define FLAG_TIME_WARN 0x04
+#define FLAG_TIME_CRIT 0x08
+#define FLAG_HIDE_OUTPUT 0x10
+static size_t flags;
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+ int i;
+ char *status = NULL;
+ struct timeval tv;
+ struct timeval timeout;
+ size_t len;
+ int match = -1;
+ fd_set rfds;
+
+ FD_ZERO(&rfds);
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* determine program- and service-name quickly */
+ progname = strrchr(argv[0], '/');
+ if(progname != NULL) progname++;
+ else progname = argv[0];
+
+ len = strlen(progname);
+ if(len > 6 && !memcmp(progname, "check_", 6)) {
+ SERVICE = strdup(progname + 6);
+ for(i = 0; i < len - 6; i++)
+ SERVICE[i] = toupper(SERVICE[i]);
+ }
+
+ /* set up a reasonable buffer at first (will be realloc()'ed if
+ * user specifies other options) */
+ server_expect = calloc(sizeof(char *), 2);
+
+ /* determine defaults for this service's protocol */
+ if (!strncmp(SERVICE, "UDP", 3)) {
+ PROTOCOL = IPPROTO_UDP;
+ }
+ else if (!strncmp(SERVICE, "FTP", 3)) {
+ EXPECT = "220";
+ QUIT = "QUIT\r\n";
+ PORT = 21;
+ }
+ else if (!strncmp(SERVICE, "POP", 3) || !strncmp(SERVICE, "POP3", 4)) {
+ EXPECT = "+OK";
+ QUIT = "QUIT\r\n";
+ PORT = 110;
+ }
+ else if (!strncmp(SERVICE, "SMTP", 4)) {
+ EXPECT = "220";
+ QUIT = "QUIT\r\n";
+ PORT = 25;
+ }
+ else if (!strncmp(SERVICE, "IMAP", 4)) {
+ EXPECT = "* OK";
+ QUIT = "a1 LOGOUT\r\n";
+ PORT = 143;
+ }
+#ifdef HAVE_SSL
+ else if (!strncmp(SERVICE, "SIMAP", 5)) {
+ EXPECT = "* OK";
+ QUIT = "a1 LOGOUT\r\n";
+ flags |= FLAG_SSL;
+ PORT = 993;
+ }
+ else if (!strncmp(SERVICE, "SPOP", 4)) {
+ EXPECT = "+OK";
+ QUIT = "QUIT\r\n";
+ flags |= FLAG_SSL;
+ PORT = 995;
+ }
+ else if (!strncmp(SERVICE, "SSMTP", 5)) {
+ EXPECT = "220";
+ QUIT = "QUIT\r\n";
+ flags |= FLAG_SSL;
+ PORT = 465;
+ }
+ else if (!strncmp(SERVICE, "JABBER", 6)) {
+ SEND = "<stream:stream to=\'host\' xmlns=\'jabber:client\' xmlns:stream=\'http://etherx.jabber.org/streams\'>\n";
+ EXPECT = "<?xml version=\'1.0\'";
+ QUIT = "</stream:stream>\n";
+ flags |= FLAG_HIDE_OUTPUT;
+ PORT = 5222;
+ }
+ else if (!strncmp (SERVICE, "NNTPS", 5)) {
+ server_expect_count = 2;
+ server_expect[0] = "200";
+ server_expect[1] = "201";
+ QUIT = "QUIT\r\n";
+ flags |= FLAG_SSL;
+ PORT = 563;
+ }
+#endif
+ else if (!strncmp (SERVICE, "NNTP", 4)) {
+ server_expect_count = 2;
+ server_expect = malloc(sizeof(char *) * server_expect_count);
+ server_expect[0] = strdup("200");
+ server_expect[1] = strdup("201");
+ QUIT = "QUIT\r\n";
+ PORT = 119;
+ }
+ else if (!strncmp(SERVICE, "CLAMD", 5)) {
+ SEND = "PING";
+ EXPECT = "PONG";
+ QUIT = NULL;
+ PORT = 3310;
+ }
+ /* fallthrough check, so it's supposed to use reverse matching */
+ else if (strcmp (SERVICE, "TCP"))
+ usage (_("CRITICAL - Generic check_tcp called with unknown service\n"));
+
+ server_address = "127.0.0.1";
+ server_port = PORT;
+ server_send = SEND;
+ server_quit = QUIT;
+ status = NULL;
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ if(flags & FLAG_VERBOSE) {
+ printf("Using service %s\n", SERVICE);
+ printf("Port: %d\n", server_port);
+ printf("flags: 0x%x\n", (int)flags);
+ }
+
+ if(EXPECT && !server_expect_count)
+ server_expect_count++;
+
+ if(PROTOCOL==IPPROTO_UDP && !(server_expect_count && server_send)){
+ usage(_("With UDP checks, a send/expect string must be specified."));
+ }
+
+ /* set up the timer */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+ alarm (socket_timeout);
+
+ /* try to connect to the host at the given port number */
+ gettimeofday (&tv, NULL);
+
+ result = np_net_connect (server_address, server_port, &sd, PROTOCOL);
+ if (result == STATE_CRITICAL) return econn_refuse_state;
+
+#ifdef HAVE_SSL
+ if (flags & FLAG_SSL){
+ result = np_net_ssl_init_with_hostname(sd, (sni_specified ? sni : NULL));
+ if (result == STATE_OK && check_cert == TRUE) {
+ result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
+ }
+ }
+ if(result != STATE_OK){
+ if(sd) close(sd);
+ np_net_ssl_cleanup();
+ return result;
+ }
+#endif /* HAVE_SSL */
+
+ if (server_send != NULL) { /* Something to send? */
+ my_send(server_send, strlen(server_send));
+ }
+
+ if (delay > 0) {
+ tv.tv_sec += delay;
+ sleep (delay);
+ }
+
+ if(flags & FLAG_VERBOSE) {
+ if (server_send) {
+ printf("Send string: %s\n", server_send);
+ }
+ if (server_quit) {
+ printf("Quit string: %s\n", server_quit);
+ }
+ printf("server_expect_count: %d\n", (int)server_expect_count);
+ for(i = 0; i < server_expect_count; i++)
+ printf("\t%d: %s\n", i, server_expect[i]);
+ }
+
+ /* if(len) later on, we know we have a non-NULL response */
+ len = 0;
+ if (server_expect_count) {
+
+ /* watch for the expect string */
+ while ((i = my_recv(buffer, sizeof(buffer))) > 0) {
+ status = realloc(status, len + i + 1);
+ memcpy(&status[len], buffer, i);
+ len += i;
+ status[len] = '\0';
+
+ /* stop reading if user-forced */
+ if (maxbytes && len >= maxbytes)
+ break;
+
+ if ((match = np_expect_match(status,
+ server_expect,
+ server_expect_count,
+ match_flags)) != NP_MATCH_RETRY)
+ break;
+
+ /* some protocols wait for further input, so make sure we don't wait forever */
+ FD_SET(sd, &rfds);
+ timeout.tv_sec = READ_TIMEOUT;
+ timeout.tv_usec = 0;
+ if(select(sd + 1, &rfds, NULL, NULL, &timeout) <= 0)
+ break;
+ }
+ if (match == NP_MATCH_RETRY)
+ match = NP_MATCH_FAILURE;
+
+ /* no data when expected, so return critical */
+ if (len == 0)
+ die (STATE_CRITICAL, _("No data received from host\n"));
+
+ /* print raw output if we're debugging */
+ if(flags & FLAG_VERBOSE)
+ printf("received %d bytes from host\n#-raw-recv-------#\n%s\n#-raw-recv-------#\n",
+ (int)len + 1, status);
+ /* strip whitespace from end of output */
+ while(--len > 0 && isspace(status[len]))
+ status[len] = '\0';
+ }
+
+ if (server_quit != NULL) {
+ my_send(server_quit, strlen(server_quit));
+ }
+ if (sd) close (sd);
+#ifdef HAVE_SSL
+ np_net_ssl_cleanup();
+#endif
+
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
+
+ if (flags & FLAG_TIME_CRIT && elapsed_time > critical_time)
+ result = STATE_CRITICAL;
+ else if (flags & FLAG_TIME_WARN && elapsed_time > warning_time)
+ result = STATE_WARNING;
+
+ /* did we get the response we hoped? */
+ if(match == NP_MATCH_FAILURE && result != STATE_CRITICAL)
+ result = expect_mismatch_state;
+
+ /* reset the alarm */
+ alarm (0);
+
+ /* this is a bit stupid, because we don't want to print the
+ * response time (which can look ok to the user) if we didn't get
+ * the response we were looking for. if-else */
+ printf("%s %s - ", SERVICE, state_text(result));
+
+ if(match == NP_MATCH_FAILURE && len && !(flags & FLAG_HIDE_OUTPUT))
+ printf("Unexpected response from host/socket: %s", status);
+ else {
+ if(match == NP_MATCH_FAILURE)
+ printf("Unexpected response from host/socket on ");
+ else
+ printf("%.3f second response time on ", elapsed_time);
+ if(server_address[0] != '/') {
+ if (host_specified)
+ printf("%s port %d",
+ server_address, server_port);
+ else
+ printf("port %d", server_port);
+ }
+ else
+ printf("socket %s", server_address);
+ }
+
+ if (match != NP_MATCH_FAILURE && !(flags & FLAG_HIDE_OUTPUT) && len)
+ printf (" [%s]", status);
+
+ /* perf-data doesn't apply when server doesn't talk properly,
+ * so print all zeroes on warn and crit. Use fperfdata since
+ * localisation settings can make different outputs */
+ if(match == NP_MATCH_FAILURE)
+ printf ("|%s",
+ fperfdata ("time", elapsed_time, "s",
+ (flags & FLAG_TIME_WARN ? TRUE : FALSE), 0,
+ (flags & FLAG_TIME_CRIT ? TRUE : FALSE), 0,
+ TRUE, 0,
+ TRUE, socket_timeout)
+ );
+ else
+ printf("|%s",
+ fperfdata ("time", elapsed_time, "s",
+ (flags & FLAG_TIME_WARN ? TRUE : FALSE), warning_time,
+ (flags & FLAG_TIME_CRIT ? TRUE : FALSE), critical_time,
+ TRUE, 0,
+ TRUE, socket_timeout)
+ );
+
+ putchar('\n');
+ return result;
+}
+
+
+
+/* process command-line arguments */
+static int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ int escape = 0;
+ char *temp;
+
+ enum {
+ SNI_OPTION = CHAR_MAX + 1
+ };
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical-codes", required_argument, 0, 'C'},
+ {"warning-codes", required_argument, 0, 'W'},
+ {"timeout", required_argument, 0, 't'},
+ {"protocol", required_argument, 0, 'P'}, /* FIXME: Unhandled */
+ {"port", required_argument, 0, 'p'},
+ {"escape", no_argument, 0, 'E'},
+ {"all", no_argument, 0, 'A'},
+ {"send", required_argument, 0, 's'},
+ {"expect", required_argument, 0, 'e'},
+ {"maxbytes", required_argument, 0, 'm'},
+ {"quit", required_argument, 0, 'q'},
+ {"jail", no_argument, 0, 'j'},
+ {"delay", required_argument, 0, 'd'},
+ {"refuse", required_argument, 0, 'r'},
+ {"mismatch", required_argument, 0, 'M'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {"ssl", no_argument, 0, 'S'},
+ {"sni", required_argument, 0, SNI_OPTION},
+ {"certificate", required_argument, 0, 'D'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ usage4 (_("No arguments found"));
+
+ /* backwards compatibility */
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ if (!is_option (argv[1])) {
+ server_address = argv[1];
+ argv[1] = argv[0];
+ argv = &argv[1];
+ argc--;
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVv46EAH:s:e:q:m:c:w:t:p:C:W:d:Sr:jD:M:",
+ longopts, &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'v': /* verbose mode */
+ flags |= FLAG_VERBOSE;
+ match_flags |= NP_MATCH_VERBOSE;
+ break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage4 (_("IPv6 support not available"));
+#endif
+ break;
+ case 'H': /* hostname */
+ host_specified = TRUE;
+ server_address = optarg;
+ break;
+ case 'c': /* critical */
+ critical_time = strtod (optarg, NULL);
+ flags |= FLAG_TIME_CRIT;
+ break;
+ case 'j': /* hide output */
+ flags |= FLAG_HIDE_OUTPUT;
+ break;
+ case 'w': /* warning */
+ warning_time = strtod (optarg, NULL);
+ flags |= FLAG_TIME_WARN;
+ break;
+ case 'C':
+ crit_codes = realloc (crit_codes, ++crit_codes_count);
+ crit_codes[crit_codes_count - 1] = optarg;
+ break;
+ case 'W':
+ warn_codes = realloc (warn_codes, ++warn_codes_count);
+ warn_codes[warn_codes_count - 1] = optarg;
+ break;
+ case 't': /* timeout */
+ if (!is_intpos (optarg))
+ usage4 (_("Timeout interval must be a positive integer"));
+ else
+ socket_timeout = atoi (optarg);
+ break;
+ case 'p': /* port */
+ if (!is_intpos (optarg))
+ usage4 (_("Port must be a positive integer"));
+ else
+ server_port = atoi (optarg);
+ break;
+ case 'E':
+ escape = 1;
+ break;
+ case 's':
+ if (escape)
+ server_send = np_escaped_string(optarg);
+ else
+ xasprintf(&server_send, "%s", optarg);
+ break;
+ case 'e': /* expect string (may be repeated) */
+ match_flags &= ~NP_MATCH_EXACT;
+ if (server_expect_count == 0)
+ server_expect = malloc (sizeof (char *) * (++server_expect_count));
+ else
+ server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count));
+ server_expect[server_expect_count - 1] = optarg;
+ break;
+ case 'm':
+ if (!is_intpos (optarg))
+ usage4 (_("Maxbytes must be a positive integer"));
+ else
+ maxbytes = strtol (optarg, NULL, 0);
+ break;
+ case 'q':
+ if (escape)
+ server_quit = np_escaped_string(optarg);
+ else
+ xasprintf(&server_quit, "%s\r\n", optarg);
+ break;
+ case 'r':
+ if (!strncmp(optarg,"ok",2))
+ econn_refuse_state = STATE_OK;
+ else if (!strncmp(optarg,"warn",4))
+ econn_refuse_state = STATE_WARNING;
+ else if (!strncmp(optarg,"crit",4))
+ econn_refuse_state = STATE_CRITICAL;
+ else
+ usage4 (_("Refuse must be one of ok, warn, crit"));
+ break;
+ case 'M':
+ if (!strncmp(optarg,"ok",2))
+ expect_mismatch_state = STATE_OK;
+ else if (!strncmp(optarg,"warn",4))
+ expect_mismatch_state = STATE_WARNING;
+ else if (!strncmp(optarg,"crit",4))
+ expect_mismatch_state = STATE_CRITICAL;
+ else
+ usage4 (_("Mismatch must be one of ok, warn, crit"));
+ break;
+ case 'd':
+ if (is_intpos (optarg))
+ delay = atoi (optarg);
+ else
+ usage4 (_("Delay must be a positive integer"));
+ break;
+ case 'D': /* Check SSL cert validity - days 'til certificate expiration */
+#ifdef HAVE_SSL
+# ifdef USE_OPENSSL /* XXX */
+ if ((temp=strchr(optarg,','))!=NULL) {
+ *temp='\0';
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid certificate expiration period"), optarg);
+ days_till_exp_warn = atoi (optarg);
+ *temp=',';
+ temp++;
+ if (!is_intnonneg (temp))
+ usage2 (_("Invalid certificate expiration period"), temp);
+ days_till_exp_crit = atoi (temp);
+ }
+ else {
+ days_till_exp_crit=0;
+ if (!is_intnonneg (optarg))
+ usage2 (_("Invalid certificate expiration period"), optarg);
+ days_till_exp_warn = atoi (optarg);
+ }
+ check_cert = TRUE;
+ flags |= FLAG_SSL;
+ break;
+# endif /* USE_OPENSSL */
+#endif
+ /* fallthrough if we don't have ssl */
+ case 'S':
+#ifdef HAVE_SSL
+ flags |= FLAG_SSL;
+#else
+ die (STATE_UNKNOWN, _("Invalid option - SSL is not available"));
+#endif
+ break;
+ case SNI_OPTION:
+#ifdef HAVE_SSL
+ flags |= FLAG_SSL;
+ sni_specified = TRUE;
+ sni = optarg;
+#else
+ die (STATE_UNKNOWN, _("Invalid option - SSL is not available"));
+#endif
+ break;
+ case 'A':
+ match_flags |= NP_MATCH_ALL;
+ break;
+ }
+ }
+
+ c = optind;
+ if(host_specified == FALSE && c < argc)
+ server_address = strdup (argv[c++]);
+
+ if (server_address == NULL)
+ usage4 (_("You must provide a server address"));
+ else if (server_address[0] != '/' && is_host (server_address) == FALSE)
+ die (STATE_CRITICAL, "%s %s - %s: %s\n", SERVICE, state_text(STATE_CRITICAL), _("Invalid hostname, address or socket"), server_address);
+
+ return TRUE;
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf (_("This plugin tests %s connections with the specified host (or unix socket).\n\n"),
+ SERVICE);
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', "none");
+
+ printf (UT_IPv46);
+
+ printf (" %s\n", "-E, --escape");
+ printf (" %s\n", _("Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send or quit option"));
+ printf (" %s\n", _("Default: nothing added to send, \\r\\n added to end of quit"));
+ printf (" %s\n", "-s, --send=STRING");
+ printf (" %s\n", _("String to send to the server"));
+ printf (" %s\n", "-e, --expect=STRING");
+ printf (" %s %s\n", _("String to expect in server response"), _("(may be repeated)"));
+ printf (" %s\n", "-A, --all");
+ printf (" %s\n", _("All expect strings need to occur in server response. Default is any"));
+ printf (" %s\n", "-q, --quit=STRING");
+ printf (" %s\n", _("String to send server to initiate a clean close of the connection"));
+ printf (" %s\n", "-r, --refuse=ok|warn|crit");
+ printf (" %s\n", _("Accept TCP refusals with states ok, warn, crit (default: crit)"));
+ printf (" %s\n", "-M, --mismatch=ok|warn|crit");
+ printf (" %s\n", _("Accept expected string mismatches with states ok, warn, crit (default: warn)"));
+ printf (" %s\n", "-j, --jail");
+ printf (" %s\n", _("Hide output from TCP socket"));
+ printf (" %s\n", "-m, --maxbytes=INTEGER");
+ printf (" %s\n", _("Close connection once more than this number of bytes are received"));
+ printf (" %s\n", "-d, --delay=INTEGER");
+ printf (" %s\n", _("Seconds to wait between sending string and polling for response"));
+
+#ifdef HAVE_SSL
+ printf (" %s\n", "-D, --certificate=INTEGER[,INTEGER]");
+ printf (" %s\n", _("Minimum number of days a certificate has to be valid."));
+ printf (" %s\n", _("1st is #days for warning, 2nd is critical (if not specified - 0)."));
+ printf (" %s\n", "-S, --ssl");
+ printf (" %s\n", _("Use SSL for the connection."));
+ printf (" %s\n", "--sni=STRING");
+ printf (" %s\n", _("SSL server_name"));
+#endif
+
+ printf (UT_WARN_CRIT);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_VERBOSE);
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]\n",progname);
+ printf ("[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]\n");
+ printf ("[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]\n");
+ printf ("[-D <warn days cert expire>[,<crit days cert expire>]] [-S <use SSL>] [-E]\n");
+}
diff --git a/plugins/check_time.c b/plugins/check_time.c
new file mode 100644
index 0000000..baf8c59
--- /dev/null
+++ b/plugins/check_time.c
@@ -0,0 +1,374 @@
+/*****************************************************************************
+*
+* Monitoring check_time plugin
+*
+* License: GPL
+* Copyright (c) 1999-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_time plugin
+*
+* This plugin will check the time difference with the specified host.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_time";
+const char *copyright = "1999-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+enum {
+ TIME_PORT = 37
+};
+
+#define UNIX_EPOCH 2208988800UL
+
+uint32_t raw_server_time;
+unsigned long server_time, diff_time;
+int warning_time = 0;
+int check_warning_time = FALSE;
+int critical_time = 0;
+int check_critical_time = FALSE;
+unsigned long warning_diff = 0;
+int check_warning_diff = FALSE;
+unsigned long critical_diff = 0;
+int check_critical_diff = FALSE;
+int server_port = TIME_PORT;
+char *server_address = NULL;
+int use_udp = FALSE;
+
+int process_arguments (int, char **);
+void print_help (void);
+void print_usage (void);
+
+int
+main (int argc, char **argv)
+{
+ int sd;
+ int result = STATE_UNKNOWN;
+ time_t conntime;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+ time (&start_time);
+
+ /* try to connect to the host at the given port number */
+ if (use_udp) {
+ result = my_udp_connect (server_address, server_port, &sd);
+ } else {
+ result = my_tcp_connect (server_address, server_port, &sd);
+ }
+
+ if (result != STATE_OK) {
+ if (check_critical_time == TRUE)
+ result = STATE_CRITICAL;
+ else if (check_warning_time == TRUE)
+ result = STATE_WARNING;
+ else
+ result = STATE_UNKNOWN;
+ die (result,
+ _("TIME UNKNOWN - could not connect to server %s, port %d\n"),
+ server_address, server_port);
+ }
+
+ if (use_udp) {
+ if (send (sd, "", 0, 0) < 0) {
+ if (check_critical_time == TRUE)
+ result = STATE_CRITICAL;
+ else if (check_warning_time == TRUE)
+ result = STATE_WARNING;
+ else
+ result = STATE_UNKNOWN;
+ die (result,
+ _("TIME UNKNOWN - could not send UDP request to server %s, port %d\n"),
+ server_address, server_port);
+ }
+ }
+
+ /* watch for the connection string */
+ result = recv (sd, (void *)&raw_server_time, sizeof (raw_server_time), 0);
+
+ /* close the connection */
+ close (sd);
+
+ /* reset the alarm */
+ time (&end_time);
+ alarm (0);
+
+ /* return a WARNING status if we couldn't read any data */
+ if (result <= 0) {
+ if (check_critical_time == TRUE)
+ result = STATE_CRITICAL;
+ else if (check_warning_time == TRUE)
+ result = STATE_WARNING;
+ else
+ result = STATE_UNKNOWN;
+ die (result,
+ _("TIME UNKNOWN - no data received from server %s, port %d\n"),
+ server_address, server_port);
+ }
+
+ result = STATE_OK;
+
+ conntime = (end_time - start_time);
+ if (check_critical_time == TRUE && conntime > critical_time)
+ result = STATE_CRITICAL;
+ else if (check_warning_time == TRUE && conntime > warning_time)
+ result = STATE_WARNING;
+
+ if (result != STATE_OK)
+ die (result, _("TIME %s - %d second response time|%s\n"),
+ state_text (result), (int)conntime,
+ perfdata ("time", (long)conntime, "s",
+ check_warning_time, (long)warning_time,
+ check_critical_time, (long)critical_time,
+ TRUE, 0, FALSE, 0));
+
+ server_time = ntohl (raw_server_time) - UNIX_EPOCH;
+ if (server_time > (unsigned long)end_time)
+ diff_time = server_time - (unsigned long)end_time;
+ else
+ diff_time = (unsigned long)end_time - server_time;
+
+ if (check_critical_diff == TRUE && diff_time > critical_diff)
+ result = STATE_CRITICAL;
+ else if (check_warning_diff == TRUE && diff_time > warning_diff)
+ result = STATE_WARNING;
+
+ printf (_("TIME %s - %lu second time difference|%s %s\n"),
+ state_text (result), diff_time,
+ perfdata ("time", (long)conntime, "s",
+ check_warning_time, (long)warning_time,
+ check_critical_time, (long)critical_time,
+ TRUE, 0, FALSE, 0),
+ perfdata ("offset", diff_time, "s",
+ check_warning_diff, warning_diff,
+ check_critical_diff, critical_diff,
+ TRUE, 0, FALSE, 0));
+ return result;
+}
+
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"warning-variance", required_argument, 0, 'w'},
+ {"critical-variance", required_argument, 0, 'c'},
+ {"warning-connect", required_argument, 0, 'W'},
+ {"critical-connect", required_argument, 0, 'C'},
+ {"port", required_argument, 0, 'p'},
+ {"udp", no_argument, 0, 'u'},
+ {"timeout", required_argument, 0, 't'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ usage ("\n");
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wd", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-cd", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ else if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-W");
+ else if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-C");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVH:w:c:W:C:p:t:u", longopts,
+ &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'H': /* hostname */
+ if (is_host (optarg) == FALSE)
+ usage2 (_("Invalid hostname/address"), optarg);
+ server_address = optarg;
+ break;
+ case 'w': /* warning-variance */
+ if (is_intnonneg (optarg)) {
+ warning_diff = strtoul (optarg, NULL, 10);
+ check_warning_diff = TRUE;
+ }
+ else if (strspn (optarg, "0123456789:,") > 0) {
+ if (sscanf (optarg, "%lu%*[:,]%d", &warning_diff, &warning_time) == 2) {
+ check_warning_diff = TRUE;
+ check_warning_time = TRUE;
+ }
+ else {
+ usage4 (_("Warning thresholds must be a positive integer"));
+ }
+ }
+ else {
+ usage4 (_("Warning threshold must be a positive integer"));
+ }
+ break;
+ case 'c': /* critical-variance */
+ if (is_intnonneg (optarg)) {
+ critical_diff = strtoul (optarg, NULL, 10);
+ check_critical_diff = TRUE;
+ }
+ else if (strspn (optarg, "0123456789:,") > 0) {
+ if (sscanf (optarg, "%lu%*[:,]%d", &critical_diff, &critical_time) ==
+ 2) {
+ check_critical_diff = TRUE;
+ check_critical_time = TRUE;
+ }
+ else {
+ usage4 (_("Critical thresholds must be a positive integer"));
+ }
+ }
+ else {
+ usage4 (_("Critical threshold must be a positive integer"));
+ }
+ break;
+ case 'W': /* warning-connect */
+ if (!is_intnonneg (optarg))
+ usage4 (_("Warning threshold must be a positive integer"));
+ else
+ warning_time = atoi (optarg);
+ check_warning_time = TRUE;
+ break;
+ case 'C': /* critical-connect */
+ if (!is_intnonneg (optarg))
+ usage4 (_("Critical threshold must be a positive integer"));
+ else
+ critical_time = atoi (optarg);
+ check_critical_time = TRUE;
+ break;
+ case 'p': /* port */
+ if (!is_intnonneg (optarg))
+ usage4 (_("Port must be a positive integer"));
+ else
+ server_port = atoi (optarg);
+ break;
+ case 't': /* timeout */
+ if (!is_intnonneg (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ socket_timeout = atoi (optarg);
+ break;
+ case 'u': /* udp */
+ use_udp = TRUE;
+ }
+ }
+
+ c = optind;
+ if (server_address == NULL) {
+ if (argc > c) {
+ if (is_host (argv[c]) == FALSE)
+ usage2 (_("Invalid hostname/address"), optarg);
+ server_address = argv[c];
+ }
+ else {
+ usage4 (_("Hostname was not supplied"));
+ }
+ }
+
+ return OK;
+}
+
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", TIME_PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin will check the time on the specified host."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (" %s\n", "-u, --udp");
+ printf (" %s\n", _("Use UDP to connect, not TCP"));
+ printf (" %s\n", "-w, --warning-variance=INTEGER");
+ printf (" %s\n", _("Time difference (sec.) necessary to result in a warning status"));
+ printf (" %s\n", "-c, --critical-variance=INTEGER");
+ printf (" %s\n", _("Time difference (sec.) necessary to result in a critical status"));
+ printf (" %s\n", "-W, --warning-connect=INTEGER");
+ printf (" %s\n", _("Response time (sec.) necessary to result in warning status"));
+ printf (" %s\n", "-C, --critical-connect=INTEGER");
+ printf (" %s\n", _("Response time (sec.) necessary to result in critical status"));
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n",progname);
+ printf (" [-W connect_time] [-C connect_time] [-t timeout]\n");
+}
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
new file mode 100644
index 0000000..68737c4
--- /dev/null
+++ b/plugins/check_ups.c
@@ -0,0 +1,665 @@
+/*****************************************************************************
+*
+* Monitoring check_ups plugin
+*
+* License: GPL
+* Copyright (c) 2000 Tom Shields
+* 2004 Alain Richard <alain.richard@equation.fr>
+* 2004 Arnaud Quette <arnaud.quette@mgeups.com>
+* Copyright (c) 2002-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains Network UPS Tools plugin for Monitoring
+*
+* This plugin tests the UPS service on the specified host. Network UPS Tools
+* from www.networkupstools.org must be running for this plugin to work.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_ups";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "netutils.h"
+#include "utils.h"
+
+enum {
+ PORT = 3493
+};
+
+#define CHECK_NONE 0
+
+#define UPS_NONE 0 /* no supported options */
+#define UPS_UTILITY 1 /* supports utility line voltage */
+#define UPS_BATTPCT 2 /* supports percent battery remaining */
+#define UPS_STATUS 4 /* supports UPS status */
+#define UPS_TEMP 8 /* supports UPS temperature */
+#define UPS_LOADPCT 16 /* supports load percent */
+
+#define UPSSTATUS_NONE 0
+#define UPSSTATUS_OFF 1
+#define UPSSTATUS_OL 2
+#define UPSSTATUS_OB 4
+#define UPSSTATUS_LB 8
+#define UPSSTATUS_CAL 16
+#define UPSSTATUS_RB 32 /*Replace Battery */
+#define UPSSTATUS_BYPASS 64
+#define UPSSTATUS_OVER 128
+#define UPSSTATUS_TRIM 256
+#define UPSSTATUS_BOOST 512
+#define UPSSTATUS_CHRG 1024
+#define UPSSTATUS_DISCHRG 2048
+#define UPSSTATUS_UNKNOWN 4096
+
+enum { NOSUCHVAR = ERROR-1 };
+
+int server_port = PORT;
+char *server_address;
+char *ups_name = NULL;
+double warning_value = 0.0;
+double critical_value = 0.0;
+int check_warn = FALSE;
+int check_crit = FALSE;
+int check_variable = UPS_NONE;
+int supported_options = UPS_NONE;
+int status = UPSSTATUS_NONE;
+
+double ups_utility_voltage = 0.0;
+double ups_battery_percent = 0.0;
+double ups_load_percent = 0.0;
+double ups_temperature = 0.0;
+char *ups_status;
+int temp_output_c = 0;
+
+int determine_status (void);
+int get_ups_variable (const char *, char *);
+
+int process_arguments (int, char **);
+int validate_arguments (void);
+void print_help (void);
+void print_usage (void);
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+ char *message;
+ char *data;
+ char *tunits;
+ char temp_buffer[MAX_INPUT_BUFFER];
+ double ups_utility_deviation = 0.0;
+ int res;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ ups_status = strdup ("N/A");
+ data = strdup ("");
+ message = strdup ("");
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ /* initialize alarm signal handling */
+ signal (SIGALRM, socket_timeout_alarm_handler);
+
+ /* set socket timeout */
+ alarm (socket_timeout);
+
+ /* get the ups status if possible */
+ if (determine_status () != OK)
+ return STATE_CRITICAL;
+ if (supported_options & UPS_STATUS) {
+
+ ups_status = strdup ("");
+ result = STATE_OK;
+
+ if (status & UPSSTATUS_OFF) {
+ xasprintf (&ups_status, "Off");
+ result = STATE_CRITICAL;
+ }
+ else if ((status & (UPSSTATUS_OB | UPSSTATUS_LB)) ==
+ (UPSSTATUS_OB | UPSSTATUS_LB)) {
+ xasprintf (&ups_status, _("On Battery, Low Battery"));
+ result = STATE_CRITICAL;
+ }
+ else {
+ if (status & UPSSTATUS_OL) {
+ xasprintf (&ups_status, "%s%s", ups_status, _("Online"));
+ }
+ if (status & UPSSTATUS_OB) {
+ xasprintf (&ups_status, "%s%s", ups_status, _("On Battery"));
+ result = STATE_WARNING;
+ }
+ if (status & UPSSTATUS_LB) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Low Battery"));
+ result = STATE_WARNING;
+ }
+ if (status & UPSSTATUS_CAL) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Calibrating"));
+ }
+ if (status & UPSSTATUS_RB) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Replace Battery"));
+ result = STATE_WARNING;
+ }
+ if (status & UPSSTATUS_BYPASS) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", On Bypass"));
+ }
+ if (status & UPSSTATUS_OVER) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Overload"));
+ }
+ if (status & UPSSTATUS_TRIM) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Trimming"));
+ }
+ if (status & UPSSTATUS_BOOST) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Boosting"));
+ }
+ if (status & UPSSTATUS_CHRG) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Charging"));
+ }
+ if (status & UPSSTATUS_DISCHRG) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Discharging"));
+ }
+ if (status & UPSSTATUS_UNKNOWN) {
+ xasprintf (&ups_status, "%s%s", ups_status, _(", Unknown"));
+ }
+ }
+ xasprintf (&message, "%sStatus=%s ", message, ups_status);
+ }
+
+ /* get the ups utility voltage if possible */
+ res=get_ups_variable ("input.voltage", temp_buffer);
+ if (res == NOSUCHVAR) supported_options &= ~UPS_UTILITY;
+ else if (res != OK)
+ return STATE_CRITICAL;
+ else {
+ supported_options |= UPS_UTILITY;
+
+ ups_utility_voltage = atof (temp_buffer);
+ xasprintf (&message, "%sUtility=%3.1fV ", message, ups_utility_voltage);
+
+ if (ups_utility_voltage > 120.0)
+ ups_utility_deviation = 120.0 - ups_utility_voltage;
+ else
+ ups_utility_deviation = ups_utility_voltage - 120.0;
+
+ if (check_variable == UPS_UTILITY) {
+ if (check_crit==TRUE && ups_utility_deviation>=critical_value) {
+ result = STATE_CRITICAL;
+ }
+ else if (check_warn==TRUE && ups_utility_deviation>=warning_value) {
+ result = max_state (result, STATE_WARNING);
+ }
+ xasprintf (&data, "%s",
+ perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
+ check_warn, (long)(1000*warning_value),
+ check_crit, (long)(1000*critical_value),
+ TRUE, 0, FALSE, 0));
+ } else {
+ xasprintf (&data, "%s",
+ perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
+ FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+ }
+ }
+
+ /* get the ups battery percent if possible */
+ res=get_ups_variable ("battery.charge", temp_buffer);
+ if (res == NOSUCHVAR) supported_options &= ~UPS_BATTPCT;
+ else if ( res != OK)
+ return STATE_CRITICAL;
+ else {
+ supported_options |= UPS_BATTPCT;
+ ups_battery_percent = atof (temp_buffer);
+ xasprintf (&message, "%sBatt=%3.1f%% ", message, ups_battery_percent);
+
+ if (check_variable == UPS_BATTPCT) {
+ if (check_crit==TRUE && ups_battery_percent <= critical_value) {
+ result = STATE_CRITICAL;
+ }
+ else if (check_warn==TRUE && ups_battery_percent<=warning_value) {
+ result = max_state (result, STATE_WARNING);
+ }
+ xasprintf (&data, "%s %s", data,
+ perfdata ("battery", (long)ups_battery_percent, "%",
+ check_warn, (long)(warning_value),
+ check_crit, (long)(critical_value),
+ TRUE, 0, TRUE, 100));
+ } else {
+ xasprintf (&data, "%s %s", data,
+ perfdata ("battery", (long)ups_battery_percent, "%",
+ FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
+ }
+ }
+
+ /* get the ups load percent if possible */
+ res=get_ups_variable ("ups.load", temp_buffer);
+ if ( res == NOSUCHVAR ) supported_options &= ~UPS_LOADPCT;
+ else if ( res != OK)
+ return STATE_CRITICAL;
+ else {
+ supported_options |= UPS_LOADPCT;
+ ups_load_percent = atof (temp_buffer);
+ xasprintf (&message, "%sLoad=%3.1f%% ", message, ups_load_percent);
+
+ if (check_variable == UPS_LOADPCT) {
+ if (check_crit==TRUE && ups_load_percent>=critical_value) {
+ result = STATE_CRITICAL;
+ }
+ else if (check_warn==TRUE && ups_load_percent>=warning_value) {
+ result = max_state (result, STATE_WARNING);
+ }
+ xasprintf (&data, "%s %s", data,
+ perfdata ("load", (long)ups_load_percent, "%",
+ check_warn, (long)(warning_value),
+ check_crit, (long)(critical_value),
+ TRUE, 0, TRUE, 100));
+ } else {
+ xasprintf (&data, "%s %s", data,
+ perfdata ("load", (long)ups_load_percent, "%",
+ FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
+ }
+ }
+
+ /* get the ups temperature if possible */
+ res=get_ups_variable ("ups.temperature", temp_buffer);
+ if ( res == NOSUCHVAR ) supported_options &= ~UPS_TEMP;
+ else if ( res != OK)
+ return STATE_CRITICAL;
+ else {
+ supported_options |= UPS_TEMP;
+ if (temp_output_c) {
+ tunits="degC";
+ ups_temperature = atof (temp_buffer);
+ xasprintf (&message, "%sTemp=%3.1fC", message, ups_temperature);
+ }
+ else {
+ tunits="degF";
+ ups_temperature = (atof (temp_buffer) * 1.8) + 32;
+ xasprintf (&message, "%sTemp=%3.1fF", message, ups_temperature);
+ }
+
+ if (check_variable == UPS_TEMP) {
+ if (check_crit==TRUE && ups_temperature>=critical_value) {
+ result = STATE_CRITICAL;
+ }
+ else if (check_warn == TRUE && ups_temperature>=warning_value) {
+ result = max_state (result, STATE_WARNING);
+ }
+ xasprintf (&data, "%s %s", data,
+ perfdata ("temp", (long)ups_temperature, tunits,
+ check_warn, (long)(warning_value),
+ check_crit, (long)(critical_value),
+ TRUE, 0, FALSE, 0));
+ } else {
+ xasprintf (&data, "%s %s", data,
+ perfdata ("temp", (long)ups_temperature, tunits,
+ FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+ }
+ }
+
+ /* if the UPS does not support any options we are looking for, report an error */
+ if (supported_options == UPS_NONE) {
+ result = STATE_CRITICAL;
+ xasprintf (&message, _("UPS does not support any available options\n"));
+ }
+
+ /* reset timeout */
+ alarm (0);
+
+ printf ("UPS %s - %s|%s\n", state_text(result), message, data);
+ return result;
+}
+
+
+
+/* determines what options are supported by the UPS */
+int
+determine_status (void)
+{
+ char recv_buffer[MAX_INPUT_BUFFER];
+ char temp_buffer[MAX_INPUT_BUFFER];
+ char *ptr;
+ int res;
+
+ res=get_ups_variable ("ups.status", recv_buffer);
+ if (res == NOSUCHVAR) return OK;
+ if (res != STATE_OK) {
+ printf ("%s\n", _("Invalid response received from host"));
+ return ERROR;
+ }
+
+ supported_options |= UPS_STATUS;
+
+ strcpy (temp_buffer, recv_buffer);
+ for (ptr = (char *) strtok (temp_buffer, " "); ptr != NULL;
+ ptr = (char *) strtok (NULL, " ")) {
+ if (!strcmp (ptr, "OFF"))
+ status |= UPSSTATUS_OFF;
+ else if (!strcmp (ptr, "OL"))
+ status |= UPSSTATUS_OL;
+ else if (!strcmp (ptr, "OB"))
+ status |= UPSSTATUS_OB;
+ else if (!strcmp (ptr, "LB"))
+ status |= UPSSTATUS_LB;
+ else if (!strcmp (ptr, "CAL"))
+ status |= UPSSTATUS_CAL;
+ else if (!strcmp (ptr, "RB"))
+ status |= UPSSTATUS_RB;
+ else if (!strcmp (ptr, "BYPASS"))
+ status |= UPSSTATUS_BYPASS;
+ else if (!strcmp (ptr, "OVER"))
+ status |= UPSSTATUS_OVER;
+ else if (!strcmp (ptr, "TRIM"))
+ status |= UPSSTATUS_TRIM;
+ else if (!strcmp (ptr, "BOOST"))
+ status |= UPSSTATUS_BOOST;
+ else if (!strcmp (ptr, "CHRG"))
+ status |= UPSSTATUS_CHRG;
+ else if (!strcmp (ptr, "DISCHRG"))
+ status |= UPSSTATUS_DISCHRG;
+ else
+ status |= UPSSTATUS_UNKNOWN;
+ }
+
+ return OK;
+}
+
+
+/* gets a variable value for a specific UPS */
+int
+get_ups_variable (const char *varname, char *buf)
+{
+ /* char command[MAX_INPUT_BUFFER]; */
+ char temp_buffer[MAX_INPUT_BUFFER];
+ char send_buffer[MAX_INPUT_BUFFER];
+ char *ptr;
+ char *logout = "OK Goodbye\n";
+ int logout_len = strlen(logout);
+ int len;
+
+ *buf=0;
+
+ /* create the command string to send to the UPS daemon */
+ /* Add LOGOUT to avoid read failure logs */
+ if (snprintf (send_buffer, sizeof(send_buffer), "GET VAR %s %s\nLOGOUT\n", ups_name, varname) >= sizeof(send_buffer)) {
+ printf("%s\n", _("UPS name to long for buffer"));
+ return ERROR;
+ }
+
+ /* send the command to the daemon and get a response back */
+ if (process_tcp_request
+ (server_address, server_port, send_buffer, temp_buffer,
+ sizeof (temp_buffer)) != STATE_OK) {
+ printf ("%s\n", _("Invalid response received from host"));
+ return ERROR;
+ }
+
+ ptr = temp_buffer;
+ len = strlen(ptr);
+ if (len > logout_len && strcmp (ptr + len - logout_len, logout) == 0) len -= logout_len;
+ if (len > 0 && ptr[len-1] == '\n') ptr[len-1]=0;
+ if (strcmp (ptr, "ERR UNKNOWN-UPS") == 0) {
+ printf (_("CRITICAL - no such UPS '%s' on that host\n"), ups_name);
+ return ERROR;
+ }
+
+ if (strcmp (ptr, "ERR VAR-NOT-SUPPORTED") == 0) {
+ /*printf ("Error: Variable '%s' is not supported\n", varname);*/
+ return NOSUCHVAR;
+ }
+
+ if (strcmp (ptr, "ERR DATA-STALE") == 0) {
+ printf ("%s\n", _("CRITICAL - UPS data is stale"));
+ return ERROR;
+ }
+
+ if (strncmp (ptr, "ERR", 3) == 0) {
+ printf (_("Unknown error: %s\n"), ptr);
+ return ERROR;
+ }
+
+ ptr = temp_buffer + strlen (varname) + strlen (ups_name) + 6;
+ len = strlen(ptr);
+ if (len < 2 || ptr[0] != '"' || ptr[len-1] != '"') {
+ printf ("%s\n", _("Error: unable to parse variable"));
+ return ERROR;
+ }
+ strncpy (buf, ptr+1, len - 2);
+ buf[len - 2] = 0;
+
+ return OK;
+}
+
+
+/* Command line: CHECK_UPS -H <host_address> -u ups [-p port] [-v variable]
+ [-wv warn_value] [-cv crit_value] [-to to_sec] */
+
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"hostname", required_argument, 0, 'H'},
+ {"ups", required_argument, 0, 'u'},
+ {"port", required_argument, 0, 'p'},
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"timeout", required_argument, 0, 't'},
+ {"temperature", no_argument, 0, 'T'},
+ {"variable", required_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ return ERROR;
+
+ for (c = 1; c < argc; c++) {
+ if (strcmp ("-to", argv[c]) == 0)
+ strcpy (argv[c], "-t");
+ else if (strcmp ("-wt", argv[c]) == 0)
+ strcpy (argv[c], "-w");
+ else if (strcmp ("-ct", argv[c]) == 0)
+ strcpy (argv[c], "-c");
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "hVTH:u:p:v:c:w:t:", longopts,
+ &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* help */
+ usage5 ();
+ case 'H': /* hostname */
+ if (is_host (optarg)) {
+ server_address = optarg;
+ }
+ else {
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+ break;
+ case 'T': /* FIXME: to be improved (ie "-T C" for Celsius or "-T F" for Fahrenheit) */
+ temp_output_c = 1;
+ break;
+ case 'u': /* ups name */
+ ups_name = optarg;
+ break;
+ case 'p': /* port */
+ if (is_intpos (optarg)) {
+ server_port = atoi (optarg);
+ }
+ else {
+ usage2 (_("Port must be a positive integer"), optarg);
+ }
+ break;
+ case 'c': /* critical time threshold */
+ if (is_intnonneg (optarg)) {
+ critical_value = atoi (optarg);
+ check_crit = TRUE;
+ }
+ else {
+ usage2 (_("Critical time must be a positive integer"), optarg);
+ }
+ break;
+ case 'w': /* warning time threshold */
+ if (is_intnonneg (optarg)) {
+ warning_value = atoi (optarg);
+ check_warn = TRUE;
+ }
+ else {
+ usage2 (_("Warning time must be a positive integer"), optarg);
+ }
+ break;
+ case 'v': /* variable */
+ if (!strcmp (optarg, "LINE"))
+ check_variable = UPS_UTILITY;
+ else if (!strcmp (optarg, "TEMP"))
+ check_variable = UPS_TEMP;
+ else if (!strcmp (optarg, "BATTPCT"))
+ check_variable = UPS_BATTPCT;
+ else if (!strcmp (optarg, "LOADPCT"))
+ check_variable = UPS_LOADPCT;
+ else
+ usage2 (_("Unrecognized UPS variable"), optarg);
+ break;
+ case 't': /* timeout */
+ if (is_intnonneg (optarg)) {
+ socket_timeout = atoi (optarg);
+ }
+ else {
+ usage4 (_("Timeout interval must be a positive integer"));
+ }
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ }
+ }
+
+
+ if (server_address == NULL && argc > optind) {
+ if (is_host (argv[optind]))
+ server_address = argv[optind++];
+ else
+ usage2 (_("Invalid hostname/address"), optarg);
+ }
+
+ if (server_address == NULL)
+ server_address = strdup("127.0.0.1");
+
+ return validate_arguments();
+}
+
+
+int
+validate_arguments (void)
+{
+ if (! ups_name) {
+ printf ("%s\n", _("Error : no UPS indicated"));
+ return ERROR;
+ }
+ return OK;
+}
+
+
+void
+print_help (void)
+{
+ char *myport;
+ xasprintf (&myport, "%d", PORT);
+
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 2000 Tom Shields\n");
+ printf ("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n");
+ printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin tests the UPS service on the specified host. Network UPS Tools"));
+ printf ("%s\n", _("from www.networkupstools.org must be running for this plugin to work."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (UT_HOST_PORT, 'p', myport);
+
+ printf (" %s\n", "-u, --ups=STRING");
+ printf (" %s\n", _("Name of UPS"));
+ printf (" %s\n", "-T, --temperature");
+ printf (" %s\n", _("Output of temperatures in Celsius"));
+ printf (" %s\n", "-v, --variable=STRING");
+ printf (" %s %s\n", _("Valid values for STRING are"), "LINE, TEMP, BATTPCT or LOADPCT");
+
+ printf (UT_WARN_CRIT);
+
+ printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
+
+/* TODO: -v clashing with -v/-variable. Commenting out help text since verbose
+ is unused up to now */
+/* printf (UT_VERBOSE); */
+
+ printf ("\n");
+ printf ("%s\n", _("This plugin attempts to determine the status of a UPS (Uninterruptible Power"));
+ printf ("%s\n", _("Supply) on a local or remote host. If the UPS is online or calibrating, the"));
+ printf ("%s\n", _("plugin will return an OK state. If the battery is on it will return a WARNING"));
+ printf ("%s\n", _("state. If the UPS is off or has a low battery the plugin will return a CRITICAL"));
+ printf ("%s\n", _("state."));
+
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("You may also specify a variable to check (such as temperature, utility voltage,"));
+ printf (" %s\n", _("battery load, etc.) as well as warning and critical thresholds for the value"));
+ printf (" %s\n", _("of that variable. If the remote host has multiple UPS that are being monitored"));
+ printf (" %s\n", _("you will have to use the --ups option to specify which UPS to check."));
+ printf ("\n");
+ printf (" %s\n", _("This plugin requires that the UPSD daemon distributed with Russell Kroll's"));
+ printf (" %s\n", _("Network UPS Tools be installed on the remote host. If you do not have the"));
+ printf (" %s\n", _("package installed on your system, you can download it from"));
+ printf (" %s\n", _("http://www.networkupstools.org"));
+
+ printf (UT_SUPPORT);
+}
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -H host -u ups [-p port] [-v variable] [-w warn_value] [-c crit_value] [-to to_sec] [-T]\n", progname);
+}
diff --git a/plugins/check_users.c b/plugins/check_users.c
new file mode 100644
index 0000000..2a9ee98
--- /dev/null
+++ b/plugins/check_users.c
@@ -0,0 +1,277 @@
+/*****************************************************************************
+*
+* Monitoring check_users plugin
+*
+* License: GPL
+* Copyright (c) 2000-2012 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the check_users plugin
+*
+* This plugin checks the number of users currently logged in on the local
+* system and generates an error if the number exceeds the thresholds
+* specified.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "check_users";
+const char *copyright = "2000-2007";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+
+#if HAVE_WTSAPI32_H
+# include <windows.h>
+# include <wtsapi32.h>
+# undef ERROR
+# define ERROR -1
+#elif HAVE_UTMPX_H
+# include <utmpx.h>
+#else
+# include "popen.h"
+#endif
+
+#ifdef HAVE_LIBSYSTEMD
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-login.h>
+#endif
+
+#define possibly_set(a,b) ((a) == 0 ? (b) : 0)
+
+int process_arguments (int, char **);
+void print_help (void);
+void print_usage (void);
+
+char *warning_range = NULL;
+char *critical_range = NULL;
+thresholds *thlds = NULL;
+
+int
+main (int argc, char **argv)
+{
+ int users = -1;
+ int result = STATE_UNKNOWN;
+#if HAVE_WTSAPI32_H
+ WTS_SESSION_INFO *wtsinfo;
+ DWORD wtscount;
+ DWORD index;
+#elif HAVE_UTMPX_H
+ struct utmpx *putmpx;
+#else
+ char input_buffer[MAX_INPUT_BUFFER];
+#endif
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv = np_extra_opts (&argc, argv, progname);
+
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
+
+ users = 0;
+
+#ifdef HAVE_LIBSYSTEMD
+ if (sd_booted () > 0)
+ users = sd_get_sessions (NULL);
+ else {
+#endif
+#if HAVE_WTSAPI32_H
+ if (!WTSEnumerateSessions(WTS_CURRENT_SERVER_HANDLE,
+ 0, 1, &wtsinfo, &wtscount)) {
+ printf(_("Could not enumerate RD sessions: %d\n"), GetLastError());
+ return STATE_UNKNOWN;
+ }
+
+ for (index = 0; index < wtscount; index++) {
+ LPTSTR username;
+ DWORD size;
+ int len;
+
+ if (!WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE,
+ wtsinfo[index].SessionId, WTSUserName, &username, &size))
+ continue;
+
+ len = lstrlen(username);
+
+ WTSFreeMemory(username);
+
+ if (len == 0)
+ continue;
+
+ if (wtsinfo[index].State == WTSActive ||
+ wtsinfo[index].State == WTSDisconnected)
+ users++;
+ }
+
+ WTSFreeMemory(wtsinfo);
+#elif HAVE_UTMPX_H
+ /* get currently logged users from utmpx */
+ setutxent ();
+
+ while ((putmpx = getutxent ()) != NULL)
+ if (putmpx->ut_type == USER_PROCESS)
+ users++;
+
+ endutxent ();
+#else
+ /* run the command */
+ child_process = spopen (WHO_COMMAND);
+ if (child_process == NULL) {
+ printf (_("Could not open pipe: %s\n"), WHO_COMMAND);
+ return STATE_UNKNOWN;
+ }
+
+ child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
+ if (child_stderr == NULL)
+ printf (_("Could not open stderr for %s\n"), WHO_COMMAND);
+
+ while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
+ /* increment 'users' on all lines except total user count */
+ if (input_buffer[0] != '#') {
+ users++;
+ continue;
+ }
+
+ /* get total logged in users */
+ if (sscanf (input_buffer, _("# users=%d"), &users) == 1)
+ break;
+ }
+
+ /* check STDERR */
+ if (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr))
+ result = possibly_set (result, STATE_UNKNOWN);
+ (void) fclose (child_stderr);
+
+ /* close the pipe */
+ if (spclose (child_process))
+ result = possibly_set (result, STATE_UNKNOWN);
+#endif
+#ifdef HAVE_LIBSYSTEMD
+ }
+#endif
+
+ /* check the user count against warning and critical thresholds */
+ result = get_status((double)users, thlds);
+
+ if (result == STATE_UNKNOWN)
+ printf ("%s\n", _("Unable to read output"));
+ else {
+ printf (_("USERS %s - %d users currently logged in |%s\n"),
+ state_text(result), users,
+ sperfdata_int("users", users, "", warning_range,
+ critical_range, TRUE, 0, FALSE, 0));
+ }
+
+ return result;
+}
+
+/* process command-line arguments */
+int
+process_arguments (int argc, char **argv)
+{
+ int c;
+ int option = 0;
+ static struct option longopts[] = {
+ {"critical", required_argument, 0, 'c'},
+ {"warning", required_argument, 0, 'w'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ if (argc < 2)
+ usage ("\n");
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVvc:w:", longopts, &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+
+ switch (c) {
+ case '?': /* print short usage statement if args not parsable */
+ usage5 ();
+ case 'h': /* help */
+ print_help ();
+ exit (STATE_UNKNOWN);
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (STATE_UNKNOWN);
+ case 'c': /* critical */
+ critical_range = optarg;
+ break;
+ case 'w': /* warning */
+ warning_range = optarg;
+ break;
+ }
+ }
+
+ c = optind;
+ if (warning_range == NULL && argc > c)
+ warning_range = argv[c++];
+ if (critical_range == NULL && argc > c)
+ critical_range = argv[c++];
+
+ /* this will abort in case of invalid ranges */
+ set_thresholds (&thlds, warning_range, critical_range);
+
+ if (thlds->warning->end < 0)
+ usage4 (_("Warning threshold must be a positive integer"));
+ if (thlds->critical->end < 0)
+ usage4 (_("Critical threshold must be a positive integer"));
+
+ return OK;
+}
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 1999 Ethan Galstad\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin checks the number of users currently logged in on the local"));
+ printf ("%s\n", _("system and generates an error if the number exceeds the thresholds specified."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+ printf (UT_EXTRA_OPTS);
+
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
+
+ printf (UT_SUPPORT);
+}
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s -w <users> -c <users>\n", progname);
+}
diff --git a/plugins/common.h b/plugins/common.h
new file mode 100644
index 0000000..6bf4fca
--- /dev/null
+++ b/plugins/common.h
@@ -0,0 +1,228 @@
+/*****************************************************************************
+*
+* Monitoring Plugins common include file
+*
+* License: GPL
+* Copyright (c) 1999 Ethan Galstad (nagios@nagios.org)
+* Copyright (c) 2003-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains common include files and defines used in many of
+* the plugins.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#ifndef _COMMON_H_
+#define _COMMON_H_
+
+#include "config.h"
+
+#ifdef HAVE_FEATURES_H
+#include <features.h>
+#endif
+
+#include <stdio.h> /* obligatory includes */
+#include <stdlib.h>
+#include <errno.h>
+
+/* This block provides uintmax_t - should be reported to coreutils that this should be added to fsuage.h */
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#include <unistd.h>
+#ifndef UINTMAX_MAX
+# define UINTMAX_MAX ((uintmax_t) -1)
+#endif
+
+#include <limits.h> /* This is assumed true, because coreutils assume it too */
+
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+#ifdef _AIX
+#ifdef HAVE_MP_H
+#include <mp.h>
+#endif
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* GET_NUMBER_OF_CPUS is a macro to return
+ number of CPUs, if we can get that data.
+ Use configure.in to test for various OS ways of
+ getting that data
+ Will return -1 if cannot get data
+*/
+#if defined(HAVE_SYSCONF__SC_NPROCESSORS_ONLN)
+# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_ONLN)
+#elif defined (HAVE_SYSCONF__SC_NPROCESSORS_CONF)
+# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF)
+#else
+# define GET_NUMBER_OF_CPUS() -1
+#endif
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+/* GNU Libraries */
+#include <getopt.h>
+#include "dirname.h"
+
+#include <locale.h>
+
+#ifdef HAVE_SYS_POLL_H
+# include "sys/poll.h"
+#endif
+
+/*
+ *
+ * Missing Functions
+ *
+ */
+
+#ifndef HAVE_STRTOL
+# define strtol(a,b,c) atol((a))
+#endif
+
+#ifndef HAVE_STRTOUL
+# define strtoul(a,b,c) (unsigned long)atol((a))
+#endif
+
+/* SSL implementations */
+#ifdef HAVE_GNUTLS_OPENSSL_H
+# include <gnutls/openssl.h>
+#else
+# define OPENSSL_LOAD_CONF /* See the OPENSSL_config(3) man page. */
+# ifdef HAVE_SSL_H
+# include <rsa.h>
+# include <crypto.h>
+# include <x509.h>
+# include <pem.h>
+# include <ssl.h>
+# include <err.h>
+# else
+# ifdef HAVE_OPENSSL_SSL_H
+# include <openssl/rsa.h>
+# include <openssl/crypto.h>
+# include <openssl/x509.h>
+# include <openssl/pem.h>
+# include <openssl/ssl.h>
+# include <openssl/err.h>
+# endif
+# endif
+#endif
+
+/* openssl 1.1 does not set OPENSSL_NO_SSL2 by default but ships without ssl2 */
+#ifdef OPENSSL_VERSION_NUMBER
+# if OPENSSL_VERSION_NUMBER >= 0x10100000
+# define OPENSSL_NO_SSL2
+# endif
+#endif
+
+/*
+ *
+ * Standard Values
+ *
+ */
+
+/* MariaDB 10.2 client does not set MYSQL_PORT */
+#ifndef MYSQL_PORT
+# define MYSQL_PORT 3306
+#endif
+
+enum {
+ OK = 0,
+ ERROR = -1
+};
+
+/* AIX seems to have this defined somewhere else */
+#ifndef FALSE
+enum {
+ FALSE,
+ TRUE
+};
+#endif
+
+enum {
+ STATE_OK,
+ STATE_WARNING,
+ STATE_CRITICAL,
+ STATE_UNKNOWN,
+ STATE_DEPENDENT
+};
+
+enum {
+ DEFAULT_SOCKET_TIMEOUT = 10, /* timeout after 10 seconds */
+ MAX_INPUT_BUFFER = 8192, /* max size of most buffers we use */
+ MAX_HOST_ADDRESS_LENGTH = 256 /* max size of a host address */
+};
+
+/*
+ *
+ * Internationalization
+ *
+ */
+#include "gettext.h"
+#define _(String) gettext (String)
+#if ! ENABLE_NLS
+# undef textdomain
+# define textdomain(Domainname) /* empty */
+# undef bindtextdomain
+# define bindtextdomain(Domainname, Dirname) /* empty */
+#endif
+
+/* For non-GNU compilers to ignore __attribute__ */
+#ifndef __GNUC__
+# define __attribute__(x) /* do nothing */
+#endif
+
+#endif /* _COMMON_H_ */
diff --git a/plugins/negate.c b/plugins/negate.c
new file mode 100644
index 0000000..50f62d3
--- /dev/null
+++ b/plugins/negate.c
@@ -0,0 +1,275 @@
+/*****************************************************************************
+*
+* Monitoring negate plugin
+*
+* License: GPL
+* Copyright (c) 2002-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the negate plugin
+*
+* Negates the status of a plugin (returns OK for CRITICAL, and vice-versa).
+* Can also perform custom state switching.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "negate";
+const char *copyright = "2002-2008";
+const char *email = "devel@monitoring-plugins.org";
+
+#define DEFAULT_TIMEOUT 11
+
+#include "common.h"
+#include "utils.h"
+#include "utils_cmd.h"
+
+#include <ctype.h>
+
+/* char *command_line; */
+
+static const char **process_arguments (int, char **);
+void validate_arguments (char **);
+void print_help (void);
+void print_usage (void);
+int subst_text = FALSE;
+
+static int state[4] = {
+ STATE_OK,
+ STATE_WARNING,
+ STATE_CRITICAL,
+ STATE_UNKNOWN,
+};
+
+int
+main (int argc, char **argv)
+{
+ int result = STATE_UNKNOWN;
+ char *sub;
+ char **command_line;
+ output chld_out, chld_err;
+ int i;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ timeout_interval = DEFAULT_TIMEOUT;
+
+ command_line = (char **) process_arguments (argc, argv);
+
+ /* Set signal handling and alarm */
+ if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR)
+ die (STATE_UNKNOWN, _("Cannot catch SIGALRM"));
+
+ (void) alarm ((unsigned) timeout_interval);
+
+ /* catch when the command is quoted */
+ if(command_line[1] == NULL) {
+ result = cmd_run (command_line[0], &chld_out, &chld_err, 0);
+ } else {
+ result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
+ }
+ if (chld_err.lines > 0) {
+ for (i = 0; i < chld_err.lines; i++) {
+ fprintf (stderr, "%s\n", chld_err.line[i]);
+ }
+ }
+
+ /* Return UNKNOWN or worse if no output is returned */
+ if (chld_out.lines == 0)
+ die (max_state_alt (result, STATE_UNKNOWN), _("No data returned from command\n"));
+
+ for (i = 0; i < chld_out.lines; i++) {
+ if (subst_text && result >= 0 && result <= 4 && result != state[result]) {
+ /* Loop over each match found */
+ while ((sub = strstr (chld_out.line[i], state_text (result)))) {
+ /* Terminate the first part and skip over the string we'll substitute */
+ *sub = '\0';
+ sub += strlen (state_text (result));
+ /* then put everything back together */
+ xasprintf (&chld_out.line[i], "%s%s%s", chld_out.line[i], state_text (state[result]), sub);
+ }
+ }
+ printf ("%s\n", chld_out.line[i]);
+ }
+
+ if (result >= 0 && result <= 4) {
+ exit (state[result]);
+ } else {
+ exit (result);
+ }
+}
+
+
+/* process command-line arguments */
+static const char **
+process_arguments (int argc, char **argv)
+{
+ int c;
+ int permute = TRUE;
+
+ int option = 0;
+ static struct option longopts[] = {
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"timeout", required_argument, 0, 't'},
+ {"timeout-result", required_argument, 0, 'T'},
+ {"ok", required_argument, 0, 'o'},
+ {"warning", required_argument, 0, 'w'},
+ {"critical", required_argument, 0, 'c'},
+ {"unknown", required_argument, 0, 'u'},
+ {"substitute", no_argument, 0, 's'},
+ {0, 0, 0, 0}
+ };
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVt:T:o:w:c:u:s", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case '?': /* help */
+ usage5 ();
+ break;
+ case 'h': /* help */
+ print_help ();
+ exit (EXIT_SUCCESS);
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (EXIT_SUCCESS);
+ case 't': /* timeout period */
+ if (!is_integer (optarg))
+ usage2 (_("Timeout interval must be a positive integer"), optarg);
+ else
+ timeout_interval = atoi (optarg);
+ break;
+ case 'T': /* Result to return on timeouts */
+ if ((timeout_state = mp_translate_state(optarg)) == ERROR)
+ usage4 (_("Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
+ break;
+ case 'o': /* replacement for OK */
+ if ((state[STATE_OK] = mp_translate_state(optarg)) == ERROR)
+ usage4 (_("Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
+ permute = FALSE;
+ break;
+
+ case 'w': /* replacement for WARNING */
+ if ((state[STATE_WARNING] = mp_translate_state(optarg)) == ERROR)
+ usage4 (_("Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
+ permute = FALSE;
+ break;
+ case 'c': /* replacement for CRITICAL */
+ if ((state[STATE_CRITICAL] = mp_translate_state(optarg)) == ERROR)
+ usage4 (_("Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
+ permute = FALSE;
+ break;
+ case 'u': /* replacement for UNKNOWN */
+ if ((state[STATE_UNKNOWN] = mp_translate_state(optarg)) == ERROR)
+ usage4 (_("Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
+ permute = FALSE;
+ break;
+ case 's': /* Substitute status text */
+ subst_text = TRUE;
+ break;
+ }
+ }
+
+ validate_arguments (&argv[optind]);
+
+ if (permute) { /* No [owcu] switch specified, default to this */
+ state[STATE_OK] = STATE_CRITICAL;
+ state[STATE_CRITICAL] = STATE_OK;
+ }
+
+ return (const char **) &argv[optind];
+}
+
+
+void
+validate_arguments (char **command_line)
+{
+ if (command_line[0] == NULL)
+ usage4 (_("Could not parse arguments"));
+
+ if (strncmp(command_line[0],"/",1) != 0 && strncmp(command_line[0],"./",2) != 0)
+ usage4 (_("Require path to command"));
+}
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("Negates the status of a plugin (returns OK for CRITICAL and vice-versa)."));
+ printf ("%s\n", _("Additional switches can be used to control which state becomes what."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+
+ printf (UT_PLUG_TIMEOUT, timeout_interval);
+ printf (" %s\n", _("Keep timeout longer than the plugin timeout to retain CRITICAL status."));
+ printf (" -T, --timeout-result=STATUS\n");
+ printf (" %s\n", _("Custom result on Negate timeouts; see below for STATUS definition\n"));
+
+ printf(" -o, --ok=STATUS\n");
+ printf(" -w, --warning=STATUS\n");
+ printf(" -c, --critical=STATUS\n");
+ printf(" -u, --unknown=STATUS\n");
+ printf(_(" STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single\n"));
+ printf(_(" quotes. Numeric values are accepted. If nothing is specified, permutes\n"));
+ printf(_(" OK and CRITICAL.\n"));
+ printf(" -s, --substitute\n");
+ printf(_(" Substitute output text as well. Will only substitute text in CAPITALS\n"));
+
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "negate /usr/local/nagios/libexec/check_ping -H host");
+ printf (" %s\n", _("Run check_ping and invert result. Must use full path to plugin"));
+ printf (" %s\n", "negate -w OK -c UNKNOWN /usr/local/nagios/libexec/check_procs -a 'vi negate.c'");
+ printf (" %s\n", _("This will return OK instead of WARNING and UNKNOWN instead of CRITICAL"));
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf (" %s\n", _("This plugin is a wrapper to take the output of another plugin and invert it."));
+ printf (" %s\n", _("The full path of the plugin must be provided."));
+ printf (" %s\n", _("If the wrapped plugin returns OK, the wrapper will return CRITICAL."));
+ printf (" %s\n", _("If the wrapped plugin returns CRITICAL, the wrapper will return OK."));
+ printf (" %s\n", _("Otherwise, the output state of the wrapped plugin is unchanged."));
+ printf ("\n");
+ printf (" %s\n", _("Using timeout-result, it is possible to override the timeout behaviour or a"));
+ printf (" %s\n", _("plugin by setting the negate timeout a bit lower."));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s [-t timeout] [-Towcu STATE] [-s] <definition of wrapped plugin>\n", progname);
+}
diff --git a/plugins/netutils.c b/plugins/netutils.c
new file mode 100644
index 0000000..1bb4f07
--- /dev/null
+++ b/plugins/netutils.c
@@ -0,0 +1,379 @@
+/*****************************************************************************
+*
+* Monitoring Plugins network utilities
+*
+* License: GPL
+* Copyright (c) 1999 Ethan Galstad (nagios@nagios.org)
+* Copyright (c) 2003-2008 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains commons functions used in many of the plugins.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "netutils.h"
+
+unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
+unsigned int socket_timeout_state = STATE_CRITICAL;
+
+int econn_refuse_state = STATE_CRITICAL;
+int was_refused = FALSE;
+#if USE_IPV6
+int address_family = AF_UNSPEC;
+#else
+int address_family = AF_INET;
+#endif
+
+/* handles socket timeouts */
+void
+socket_timeout_alarm_handler (int sig)
+{
+ if (sig == SIGALRM)
+ printf (_("%s - Socket timeout after %d seconds\n"), state_text(socket_timeout_state), socket_timeout);
+ else
+ printf (_("%s - Abnormal timeout after %d seconds\n"), state_text(socket_timeout_state), socket_timeout);
+
+ exit (socket_timeout_state);
+}
+
+
+/* connects to a host on a specified tcp port, sends a string, and gets a
+ response. loops on select-recv until timeout or eof to get all of a
+ multi-packet answer */
+int
+process_tcp_request2 (const char *server_address, int server_port,
+ const char *send_buffer, char *recv_buffer, int recv_size)
+{
+
+ int result;
+ int send_result;
+ int recv_result;
+ int sd;
+ struct timeval tv;
+ fd_set readfds;
+ int recv_length = 0;
+
+ result = np_net_connect (server_address, server_port, &sd, IPPROTO_TCP);
+ if (result != STATE_OK)
+ return STATE_CRITICAL;
+
+ send_result = send (sd, send_buffer, strlen (send_buffer), 0);
+ if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
+ printf ("%s\n", _("Send failed"));
+ result = STATE_WARNING;
+ }
+
+ while (1) {
+ /* wait up to the number of seconds for socket timeout
+ minus one for data from the host */
+ tv.tv_sec = socket_timeout - 1;
+ tv.tv_usec = 0;
+ FD_ZERO (&readfds);
+ FD_SET (sd, &readfds);
+ select (sd + 1, &readfds, NULL, NULL, &tv);
+
+ /* make sure some data has arrived */
+ if (!FD_ISSET (sd, &readfds)) { /* it hasn't */
+ if (!recv_length) {
+ strcpy (recv_buffer, "");
+ printf ("%s\n", _("No data was received from host!"));
+ result = STATE_WARNING;
+ }
+ else { /* this one failed, but previous ones worked */
+ recv_buffer[recv_length] = 0;
+ }
+ break;
+ }
+ else { /* it has */
+ recv_result =
+ recv (sd, recv_buffer + recv_length,
+ (size_t)recv_size - recv_length - 1, 0);
+ if (recv_result == -1) {
+ /* recv failed, bail out */
+ strcpy (recv_buffer + recv_length, "");
+ result = STATE_WARNING;
+ break;
+ }
+ else if (recv_result == 0) {
+ /* end of file ? */
+ recv_buffer[recv_length] = 0;
+ break;
+ }
+ else { /* we got data! */
+ recv_length += recv_result;
+ if (recv_length >= recv_size - 1) {
+ /* buffer full, we're done */
+ recv_buffer[recv_size - 1] = 0;
+ break;
+ }
+ }
+ }
+ /* end if(!FD_ISSET(sd,&readfds)) */
+ }
+ /* end while(1) */
+
+ close (sd);
+ return result;
+}
+
+
+/* connects to a host on a specified port, sends a string, and gets a
+ response */
+int
+process_request (const char *server_address, int server_port, int proto,
+ const char *send_buffer, char *recv_buffer, int recv_size)
+{
+ int result;
+ int sd;
+
+ result = STATE_OK;
+
+ result = np_net_connect (server_address, server_port, &sd, proto);
+ if (result != STATE_OK)
+ return STATE_CRITICAL;
+
+ result = send_request (sd, proto, send_buffer, recv_buffer, recv_size);
+
+ close (sd);
+
+ return result;
+}
+
+
+/* opens a tcp or udp connection to a remote host or local socket */
+int
+np_net_connect (const char *host_name, int port, int *sd, int proto)
+{
+ /* send back STATE_UNKOWN if there's an error
+ send back STATE_OK if we connect
+ send back STATE_CRITICAL if we can't connect.
+ Let upstream figure out what to send to the user. */
+ struct addrinfo hints;
+ struct addrinfo *r, *res;
+ struct sockaddr_un su;
+ char port_str[6], host[MAX_HOST_ADDRESS_LENGTH];
+ size_t len;
+ int socktype, result;
+ short is_socket = (host_name[0] == '/');
+
+ socktype = (proto == IPPROTO_UDP) ? SOCK_DGRAM : SOCK_STREAM;
+
+ /* as long as it doesn't start with a '/', it's assumed a host or ip */
+ if (!is_socket){
+ memset (&hints, 0, sizeof (hints));
+ hints.ai_family = address_family;
+ hints.ai_protocol = proto;
+ hints.ai_socktype = socktype;
+
+ len = strlen (host_name);
+ /* check for an [IPv6] address (and strip the brackets) */
+ if (len >= 2 && host_name[0] == '[' && host_name[len - 1] == ']') {
+ host_name++;
+ len -= 2;
+ }
+ if (len >= sizeof(host))
+ return STATE_UNKNOWN;
+ memcpy (host, host_name, len);
+ host[len] = '\0';
+ snprintf (port_str, sizeof (port_str), "%d", port);
+ result = getaddrinfo (host, port_str, &hints, &res);
+
+ if (result != 0) {
+ printf ("%s\n", gai_strerror (result));
+ return STATE_UNKNOWN;
+ }
+
+ r = res;
+ while (r) {
+ /* attempt to create a socket */
+ *sd = socket (r->ai_family, socktype, r->ai_protocol);
+
+ if (*sd < 0) {
+ printf ("%s\n", _("Socket creation failed"));
+ freeaddrinfo (r);
+ return STATE_UNKNOWN;
+ }
+
+ /* attempt to open a connection */
+ result = connect (*sd, r->ai_addr, r->ai_addrlen);
+
+ if (result == 0) {
+ was_refused = FALSE;
+ break;
+ }
+
+ if (result < 0) {
+ switch (errno) {
+ case ECONNREFUSED:
+ was_refused = TRUE;
+ break;
+ }
+ }
+
+ close (*sd);
+ r = r->ai_next;
+ }
+ freeaddrinfo (res);
+ }
+ /* else the hostname is interpreted as a path to a unix socket */
+ else {
+ if(strlen(host_name) >= UNIX_PATH_MAX){
+ die(STATE_UNKNOWN, _("Supplied path too long unix domain socket"));
+ }
+ memset(&su, 0, sizeof(su));
+ su.sun_family = AF_UNIX;
+ strncpy(su.sun_path, host_name, UNIX_PATH_MAX);
+ *sd = socket(PF_UNIX, SOCK_STREAM, 0);
+ if(*sd < 0){
+ die(STATE_UNKNOWN, _("Socket creation failed"));
+ }
+ result = connect(*sd, (struct sockaddr *)&su, sizeof(su));
+ if (result < 0 && errno == ECONNREFUSED)
+ was_refused = TRUE;
+ }
+
+ if (result == 0)
+ return STATE_OK;
+ else if (was_refused) {
+ switch (econn_refuse_state) { /* a user-defined expected outcome */
+ case STATE_OK:
+ case STATE_WARNING: /* user wants WARN or OK on refusal, or... */
+ case STATE_CRITICAL: /* user did not set econn_refuse_state, or wanted critical */
+ if (is_socket)
+ printf("connect to file socket %s: %s\n", host_name, strerror(errno));
+ else
+ printf("connect to address %s and port %d: %s\n",
+ host_name, port, strerror(errno));
+ return STATE_CRITICAL;
+ break;
+ default: /* it's a logic error if we do not end up in STATE_(OK|WARNING|CRITICAL) */
+ return STATE_UNKNOWN;
+ break;
+ }
+ }
+ else {
+ if (is_socket)
+ printf("connect to file socket %s: %s\n", host_name, strerror(errno));
+ else
+ printf("connect to address %s and port %d: %s\n",
+ host_name, port, strerror(errno));
+ return STATE_CRITICAL;
+ }
+}
+
+int
+send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int recv_size)
+{
+ int result = STATE_OK;
+ int send_result;
+ int recv_result;
+ struct timeval tv;
+ fd_set readfds;
+
+ send_result = send (sd, send_buffer, strlen (send_buffer), 0);
+ if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
+ printf ("%s\n", _("Send failed"));
+ result = STATE_WARNING;
+ }
+
+ /* wait up to the number of seconds for socket timeout minus one
+ for data from the host */
+ tv.tv_sec = socket_timeout - 1;
+ tv.tv_usec = 0;
+ FD_ZERO (&readfds);
+ FD_SET (sd, &readfds);
+ select (sd + 1, &readfds, NULL, NULL, &tv);
+
+ /* make sure some data has arrived */
+ if (!FD_ISSET (sd, &readfds)) {
+ strcpy (recv_buffer, "");
+ printf ("%s\n", _("No data was received from host!"));
+ result = STATE_WARNING;
+ }
+
+ else {
+ recv_result = recv (sd, recv_buffer, (size_t)recv_size - 1, 0);
+ if (recv_result == -1) {
+ strcpy (recv_buffer, "");
+ if (proto != IPPROTO_TCP)
+ printf ("%s\n", _("Receive failed"));
+ result = STATE_WARNING;
+ }
+ else
+ recv_buffer[recv_result] = 0;
+
+ /* die returned string */
+ recv_buffer[recv_size - 1] = 0;
+ }
+ return result;
+}
+
+
+int
+is_host (const char *address)
+{
+ if (is_addr (address) || is_hostname (address))
+ return (TRUE);
+
+ return (FALSE);
+}
+
+void
+host_or_die(const char *str)
+{
+ if(!str || (!is_addr(str) && !is_hostname(str)))
+ usage_va(_("Invalid hostname/address - %s"), str);
+}
+
+int
+is_addr (const char *address)
+{
+#ifdef USE_IPV6
+ if (address_family == AF_INET && is_inet_addr (address))
+ return TRUE;
+ else if (address_family == AF_INET6 && is_inet6_addr (address))
+ return TRUE;
+#else
+ if (is_inet_addr (address))
+ return (TRUE);
+#endif
+
+ return (FALSE);
+}
+
+int
+dns_lookup (const char *in, struct sockaddr_storage *ss, int family)
+{
+ struct addrinfo hints;
+ struct addrinfo *res;
+ int retval;
+
+ memset (&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = family;
+
+ retval = getaddrinfo (in, NULL, &hints, &res);
+ if (retval != 0)
+ return FALSE;
+
+ if (ss != NULL)
+ memcpy (ss, res->ai_addr, res->ai_addrlen);
+ freeaddrinfo (res);
+ return TRUE;
+}
diff --git a/plugins/netutils.h b/plugins/netutils.h
new file mode 100644
index 0000000..ea653e7
--- /dev/null
+++ b/plugins/netutils.h
@@ -0,0 +1,120 @@
+/*****************************************************************************
+*
+* Monitoring Plugins net utilities include file
+*
+* License: GPL
+* Copyright (c) 1999 Ethan Galstad (nagios@nagios.org)
+* Copyright (c) 2003-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains common include files and function definitions
+* used in many of the plugins.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#ifndef _NETUTILS_H_
+#define _NETUTILS_H_
+
+#include "common.h"
+#include "utils.h"
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+
+#ifdef HAVE_SYS_UN_H
+# include <sys/un.h>
+# ifndef UNIX_PATH_MAX
+ /* linux uses this, on sun it's hard-coded at 108 without a define, on BSD at 104 */
+# define UNIX_PATH_MAX 104
+# endif /* UNIX_PATH_MAX */
+#endif /* HAVE_SYS_UN_H */
+
+#ifndef HOST_MAX_BYTES
+# define HOST_MAX_BYTES 255
+#endif
+
+/* process_request and wrapper macros */
+#define process_tcp_request(addr, port, sbuf, rbuf, rsize) \
+ process_request(addr, port, IPPROTO_TCP, sbuf, rbuf, rsize)
+#define process_udp_request(addr, port, sbuf, rbuf, rsize) \
+ process_request(addr, port, IPPROTO_UDP, sbuf, rbuf, rsize)
+int process_tcp_request2 (const char *address, int port,
+ const char *sbuffer, char *rbuffer, int rsize);
+int process_request (const char *address, int port, int proto,
+ const char *sbuffer, char *rbuffer, int rsize);
+
+/* my_connect and wrapper macros */
+#define my_tcp_connect(addr, port, s) np_net_connect(addr, port, s, IPPROTO_TCP)
+#define my_udp_connect(addr, port, s) np_net_connect(addr, port, s, IPPROTO_UDP)
+int np_net_connect(const char *address, int port, int *sd, int proto);
+
+/* send_request and wrapper macros */
+#define send_tcp_request(s, sbuf, rbuf, rsize) \
+ send_request(s, IPPROTO_TCP, sbuf, rbuf, rsize)
+#define send_udp_request(s, sbuf, rbuf, rsize) \
+ send_request(s, IPPROTO_UDP, sbuf, rbuf, rsize)
+int send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int recv_size);
+
+
+/* "is_*" wrapper macros and functions */
+int is_host (const char *);
+int is_addr (const char *);
+int dns_lookup (const char *, struct sockaddr_storage *, int);
+void host_or_die(const char *str);
+#define resolve_host_or_addr(addr, family) dns_lookup(addr, NULL, family)
+#define is_inet_addr(addr) resolve_host_or_addr(addr, AF_INET)
+#ifdef USE_IPV6
+# define is_inet6_addr(addr) resolve_host_or_addr(addr, AF_INET6)
+# define is_hostname(addr) resolve_host_or_addr(addr, address_family)
+#else
+# define is_hostname(addr) resolve_host_or_addr(addr, AF_INET)
+#endif
+
+extern unsigned int socket_timeout;
+extern unsigned int socket_timeout_state;
+extern int econn_refuse_state;
+extern int was_refused;
+extern int address_family;
+
+void socket_timeout_alarm_handler (int) __attribute__((noreturn));
+
+/* SSL-Related functionality */
+#ifdef HAVE_SSL
+# define MP_SSLv2 1
+# define MP_SSLv3 2
+# define MP_TLSv1 3
+# define MP_TLSv1_1 4
+# define MP_TLSv1_2 5
+# define MP_SSLv2_OR_NEWER 6
+# define MP_SSLv3_OR_NEWER 7
+# define MP_TLSv1_OR_NEWER 8
+# define MP_TLSv1_1_OR_NEWER 9
+# define MP_TLSv1_2_OR_NEWER 10
+/* maybe this could be merged with the above np_net_connect, via some flags */
+int np_net_ssl_init(int sd);
+int np_net_ssl_init_with_hostname(int sd, char *host_name);
+int np_net_ssl_init_with_hostname_and_version(int sd, char *host_name, int version);
+int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int version, char *cert, char *privkey);
+void np_net_ssl_cleanup();
+int np_net_ssl_write(const void *buf, int num);
+int np_net_ssl_read(void *buf, int num);
+int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit);
+#endif /* HAVE_SSL */
+
+#endif /* _NETUTILS_H_ */
diff --git a/plugins/picohttpparser/Makefile.am b/plugins/picohttpparser/Makefile.am
new file mode 100644
index 0000000..87e0531
--- /dev/null
+++ b/plugins/picohttpparser/Makefile.am
@@ -0,0 +1,3 @@
+noinst_LIBRARIES = libpicohttpparser.a
+
+libpicohttpparser_a_SOURCES = picohttpparser.c picohttpparser.h
diff --git a/plugins/picohttpparser/Makefile.in b/plugins/picohttpparser/Makefile.in
new file mode 100644
index 0000000..75fea6b
--- /dev/null
+++ b/plugins/picohttpparser/Makefile.in
@@ -0,0 +1,2026 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = plugins/picohttpparser
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libpicohttpparser_a_AR = $(AR) $(ARFLAGS)
+libpicohttpparser_a_LIBADD =
+am_libpicohttpparser_a_OBJECTS = picohttpparser.$(OBJEXT)
+libpicohttpparser_a_OBJECTS = $(am_libpicohttpparser_a_OBJECTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/picohttpparser.Po
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libpicohttpparser_a_SOURCES)
+DIST_SOURCES = $(libpicohttpparser_a_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/mkinstalldirs
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+noinst_LIBRARIES = libpicohttpparser.a
+libpicohttpparser_a_SOURCES = picohttpparser.c picohttpparser.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/picohttpparser/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu plugins/picohttpparser/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+libpicohttpparser.a: $(libpicohttpparser_a_OBJECTS) $(libpicohttpparser_a_DEPENDENCIES) $(EXTRA_libpicohttpparser_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libpicohttpparser.a
+ $(AM_V_AR)$(libpicohttpparser_a_AR) libpicohttpparser.a $(libpicohttpparser_a_OBJECTS) $(libpicohttpparser_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libpicohttpparser.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/picohttpparser.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/picohttpparser.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/picohttpparser.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/plugins/picohttpparser/picohttpparser.c b/plugins/picohttpparser/picohttpparser.c
new file mode 100644
index 0000000..d0bfac6
--- /dev/null
+++ b/plugins/picohttpparser/picohttpparser.c
@@ -0,0 +1,651 @@
+/*
+ * Copyright (c) 2009-2014 Kazuho Oku, Tokuhiro Matsuno, Daisuke Murase,
+ * Shigeo Mitsunari
+ *
+ * The software is licensed under either the MIT License (below) or the Perl
+ * license.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+#include <stddef.h>
+#include <string.h>
+#ifdef __SSE4_2__
+#ifdef _MSC_VER
+#include <nmmintrin.h>
+#else
+#include <x86intrin.h>
+#endif
+#endif
+#include "picohttpparser.h"
+
+#if __GNUC__ >= 3
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+#else
+#define likely(x) (x)
+#define unlikely(x) (x)
+#endif
+
+#ifdef _MSC_VER
+#define ALIGNED(n) _declspec(align(n))
+#else
+#define ALIGNED(n) __attribute__((aligned(n)))
+#endif
+
+#define IS_PRINTABLE_ASCII(c) ((unsigned char)(c)-040u < 0137u)
+
+#define CHECK_EOF() \
+ if (buf == buf_end) { \
+ *ret = -2; \
+ return NULL; \
+ }
+
+#define EXPECT_CHAR_NO_CHECK(ch) \
+ if (*buf++ != ch) { \
+ *ret = -1; \
+ return NULL; \
+ }
+
+#define EXPECT_CHAR(ch) \
+ CHECK_EOF(); \
+ EXPECT_CHAR_NO_CHECK(ch);
+
+#define ADVANCE_TOKEN(tok, toklen) \
+ do { \
+ const char *tok_start = buf; \
+ static const char ALIGNED(16) ranges2[16] = "\000\040\177\177"; \
+ int found2; \
+ buf = findchar_fast(buf, buf_end, ranges2, 4, &found2); \
+ if (!found2) { \
+ CHECK_EOF(); \
+ } \
+ while (1) { \
+ if (*buf == ' ') { \
+ break; \
+ } else if (unlikely(!IS_PRINTABLE_ASCII(*buf))) { \
+ if ((unsigned char)*buf < '\040' || *buf == '\177') { \
+ *ret = -1; \
+ return NULL; \
+ } \
+ } \
+ ++buf; \
+ CHECK_EOF(); \
+ } \
+ tok = tok_start; \
+ toklen = buf - tok_start; \
+ } while (0)
+
+static const char *token_char_map = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\1\0\1\1\1\1\1\0\0\1\1\0\1\1\0\1\1\1\1\1\1\1\1\1\1\0\0\0\0\0\0"
+ "\0\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\0\0\0\1\1"
+ "\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\0\1\0\1\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+
+static const char *findchar_fast(const char *buf, const char *buf_end, const char *ranges, size_t ranges_size, int *found)
+{
+ *found = 0;
+#if __SSE4_2__
+ if (likely(buf_end - buf >= 16)) {
+ __m128i ranges16 = _mm_loadu_si128((const __m128i *)ranges);
+
+ size_t left = (buf_end - buf) & ~15;
+ do {
+ __m128i b16 = _mm_loadu_si128((const __m128i *)buf);
+ int r = _mm_cmpestri(ranges16, ranges_size, b16, 16, _SIDD_LEAST_SIGNIFICANT | _SIDD_CMP_RANGES | _SIDD_UBYTE_OPS);
+ if (unlikely(r != 16)) {
+ buf += r;
+ *found = 1;
+ break;
+ }
+ buf += 16;
+ left -= 16;
+ } while (likely(left != 0));
+ }
+#else
+ /* suppress unused parameter warning */
+ (void)buf_end;
+ (void)ranges;
+ (void)ranges_size;
+#endif
+ return buf;
+}
+
+static const char *get_token_to_eol(const char *buf, const char *buf_end, const char **token, size_t *token_len, int *ret)
+{
+ const char *token_start = buf;
+
+#ifdef __SSE4_2__
+ static const char ALIGNED(16) ranges1[16] = "\0\010" /* allow HT */
+ "\012\037" /* allow SP and up to but not including DEL */
+ "\177\177"; /* allow chars w. MSB set */
+ int found;
+ buf = findchar_fast(buf, buf_end, ranges1, 6, &found);
+ if (found)
+ goto FOUND_CTL;
+#else
+ /* find non-printable char within the next 8 bytes, this is the hottest code; manually inlined */
+ while (likely(buf_end - buf >= 8)) {
+#define DOIT() \
+ do { \
+ if (unlikely(!IS_PRINTABLE_ASCII(*buf))) \
+ goto NonPrintable; \
+ ++buf; \
+ } while (0)
+ DOIT();
+ DOIT();
+ DOIT();
+ DOIT();
+ DOIT();
+ DOIT();
+ DOIT();
+ DOIT();
+#undef DOIT
+ continue;
+ NonPrintable:
+ if ((likely((unsigned char)*buf < '\040') && likely(*buf != '\011')) || unlikely(*buf == '\177')) {
+ goto FOUND_CTL;
+ }
+ ++buf;
+ }
+#endif
+ for (;; ++buf) {
+ CHECK_EOF();
+ if (unlikely(!IS_PRINTABLE_ASCII(*buf))) {
+ if ((likely((unsigned char)*buf < '\040') && likely(*buf != '\011')) || unlikely(*buf == '\177')) {
+ goto FOUND_CTL;
+ }
+ }
+ }
+FOUND_CTL:
+ if (likely(*buf == '\015')) {
+ ++buf;
+ EXPECT_CHAR('\012');
+ *token_len = buf - 2 - token_start;
+ } else if (*buf == '\012') {
+ *token_len = buf - token_start;
+ ++buf;
+ } else {
+ *ret = -1;
+ return NULL;
+ }
+ *token = token_start;
+
+ return buf;
+}
+
+static const char *is_complete(const char *buf, const char *buf_end, size_t last_len, int *ret)
+{
+ int ret_cnt = 0;
+ buf = last_len < 3 ? buf : buf + last_len - 3;
+
+ while (1) {
+ CHECK_EOF();
+ if (*buf == '\015') {
+ ++buf;
+ CHECK_EOF();
+ EXPECT_CHAR('\012');
+ ++ret_cnt;
+ } else if (*buf == '\012') {
+ ++buf;
+ ++ret_cnt;
+ } else {
+ ++buf;
+ ret_cnt = 0;
+ }
+ if (ret_cnt == 2) {
+ return buf;
+ }
+ }
+
+ *ret = -2;
+ return NULL;
+}
+
+#define PARSE_INT(valp_, mul_) \
+ if (*buf < '0' || '9' < *buf) { \
+ buf++; \
+ *ret = -1; \
+ return NULL; \
+ } \
+ *(valp_) = (mul_) * (*buf++ - '0');
+
+#define PARSE_INT_3(valp_) \
+ do { \
+ int res_ = 0; \
+ PARSE_INT(&res_, 100) \
+ *valp_ = res_; \
+ PARSE_INT(&res_, 10) \
+ *valp_ += res_; \
+ PARSE_INT(&res_, 1) \
+ *valp_ += res_; \
+ } while (0)
+
+/* returned pointer is always within [buf, buf_end), or null */
+static const char *parse_http_version(const char *buf, const char *buf_end, int *major_version, int *minor_version, int *ret)
+{
+ /* we want at least [HTTP/1.<two chars>] to try to parse */
+ if (buf_end - buf < 9) {
+ *ret = -2;
+ return NULL;
+ }
+ EXPECT_CHAR_NO_CHECK('H');
+ EXPECT_CHAR_NO_CHECK('T');
+ EXPECT_CHAR_NO_CHECK('T');
+ EXPECT_CHAR_NO_CHECK('P');
+ EXPECT_CHAR_NO_CHECK('/');
+ PARSE_INT(major_version, 1);
+ if (*major_version == 1) {
+ EXPECT_CHAR_NO_CHECK('.');
+ PARSE_INT(minor_version, 1);
+ } else {
+ *minor_version = 0;
+ }
+ return buf;
+}
+
+static const char *parse_headers(const char *buf, const char *buf_end, struct phr_header *headers, size_t *num_headers,
+ size_t max_headers, int *ret)
+{
+ for (;; ++*num_headers) {
+ CHECK_EOF();
+ if (*buf == '\015') {
+ ++buf;
+ EXPECT_CHAR('\012');
+ break;
+ } else if (*buf == '\012') {
+ ++buf;
+ break;
+ }
+ if (*num_headers == max_headers) {
+ *ret = -1;
+ return NULL;
+ }
+ if (!(*num_headers != 0 && (*buf == ' ' || *buf == '\t'))) {
+ /* parsing name, but do not discard SP before colon, see
+ * http://www.mozilla.org/security/announce/2006/mfsa2006-33.html */
+ headers[*num_headers].name = buf;
+ static const char ALIGNED(16) ranges1[] = "\x00 " /* control chars and up to SP */
+ "\"\"" /* 0x22 */
+ "()" /* 0x28,0x29 */
+ ",," /* 0x2c */
+ "//" /* 0x2f */
+ ":@" /* 0x3a-0x40 */
+ "[]" /* 0x5b-0x5d */
+ "{\377"; /* 0x7b-0xff */
+ int found;
+ buf = findchar_fast(buf, buf_end, ranges1, sizeof(ranges1) - 1, &found);
+ if (!found) {
+ CHECK_EOF();
+ }
+ while (1) {
+ if (*buf == ':') {
+ break;
+ } else if (!token_char_map[(unsigned char)*buf]) {
+ *ret = -1;
+ return NULL;
+ }
+ ++buf;
+ CHECK_EOF();
+ }
+ if ((headers[*num_headers].name_len = buf - headers[*num_headers].name) == 0) {
+ *ret = -1;
+ return NULL;
+ }
+ ++buf;
+ for (;; ++buf) {
+ CHECK_EOF();
+ if (!(*buf == ' ' || *buf == '\t')) {
+ break;
+ }
+ }
+ } else {
+ headers[*num_headers].name = NULL;
+ headers[*num_headers].name_len = 0;
+ }
+ const char *value;
+ size_t value_len;
+ if ((buf = get_token_to_eol(buf, buf_end, &value, &value_len, ret)) == NULL) {
+ return NULL;
+ }
+ /* remove trailing SPs and HTABs */
+ const char *value_end = value + value_len;
+ for (; value_end != value; --value_end) {
+ const char c = *(value_end - 1);
+ if (!(c == ' ' || c == '\t')) {
+ break;
+ }
+ }
+ headers[*num_headers].value = value;
+ headers[*num_headers].value_len = value_end - value;
+ }
+ return buf;
+}
+
+static const char *parse_request(const char *buf, const char *buf_end, const char **method, size_t *method_len, const char **path,
+ size_t *path_len, int *major_version, int *minor_version, struct phr_header *headers, size_t *num_headers,
+ size_t max_headers, int *ret)
+{
+ /* skip first empty line (some clients add CRLF after POST content) */
+ CHECK_EOF();
+ if (*buf == '\015') {
+ ++buf;
+ EXPECT_CHAR('\012');
+ } else if (*buf == '\012') {
+ ++buf;
+ }
+
+ /* parse request line */
+ ADVANCE_TOKEN(*method, *method_len);
+ do {
+ ++buf;
+ } while (*buf == ' ');
+ ADVANCE_TOKEN(*path, *path_len);
+ do {
+ ++buf;
+ } while (*buf == ' ');
+ if (*method_len == 0 || *path_len == 0) {
+ *ret = -1;
+ return NULL;
+ }
+ if ((buf = parse_http_version(buf, buf_end, major_version, minor_version, ret)) == NULL) {
+ return NULL;
+ }
+ if (*buf == '\015') {
+ ++buf;
+ EXPECT_CHAR('\012');
+ } else if (*buf == '\012') {
+ ++buf;
+ } else {
+ *ret = -1;
+ return NULL;
+ }
+
+ return parse_headers(buf, buf_end, headers, num_headers, max_headers, ret);
+}
+
+int phr_parse_request(const char *buf_start, size_t len, const char **method, size_t *method_len, const char **path,
+ size_t *path_len, int *major_version, int *minor_version, struct phr_header *headers, size_t *num_headers, size_t last_len)
+{
+ const char *buf = buf_start, *buf_end = buf_start + len;
+ size_t max_headers = *num_headers;
+ int r;
+
+ *method = NULL;
+ *method_len = 0;
+ *path = NULL;
+ *path_len = 0;
+ *major_version = -1;
+ *minor_version = -1;
+ *num_headers = 0;
+
+ /* if last_len != 0, check if the request is complete (a fast countermeasure
+ against slowloris */
+ if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) {
+ return r;
+ }
+
+ if ((buf = parse_request(buf, buf_end, method, method_len, path, path_len, major_version, minor_version, headers, num_headers, max_headers,
+ &r)) == NULL) {
+ return r;
+ }
+
+ return (int)(buf - buf_start);
+}
+
+static const char *parse_response(const char *buf, const char *buf_end, int *major_version, int *minor_version, int *status, const char **msg,
+ size_t *msg_len, struct phr_header *headers, size_t *num_headers, size_t max_headers, int *ret)
+{
+ /* parse "HTTP/1.x" */
+ if ((buf = parse_http_version(buf, buf_end, major_version, minor_version, ret)) == NULL) {
+ return NULL;
+ }
+ /* skip space */
+ if (*buf != ' ') {
+ *ret = -1;
+ return NULL;
+ }
+ do {
+ ++buf;
+ } while (*buf == ' ');
+ /* parse status code, we want at least [:digit:][:digit:][:digit:]<other char> to try to parse */
+ if (buf_end - buf < 4) {
+ *ret = -2;
+ return NULL;
+ }
+ PARSE_INT_3(status);
+
+ /* get message including preceding space */
+ if ((buf = get_token_to_eol(buf, buf_end, msg, msg_len, ret)) == NULL) {
+ return NULL;
+ }
+ if (*msg_len == 0) {
+ /* ok */
+ } else if (**msg == ' ') {
+ /* remove preceding space */
+ do {
+ ++*msg;
+ --*msg_len;
+ } while (**msg == ' ');
+ } else {
+ /* garbage found after status code */
+ *ret = -1;
+ return NULL;
+ }
+
+ return parse_headers(buf, buf_end, headers, num_headers, max_headers, ret);
+}
+
+int phr_parse_response(const char *buf_start, size_t len, int *major_version, int *minor_version, int *status, const char **msg, size_t *msg_len,
+ struct phr_header *headers, size_t *num_headers, size_t last_len)
+{
+ const char *buf = buf_start, *buf_end = buf + len;
+ size_t max_headers = *num_headers;
+ int r;
+
+ *major_version = -1;
+ *minor_version = -1;
+ *status = 0;
+ *msg = NULL;
+ *msg_len = 0;
+ *num_headers = 0;
+
+ /* if last_len != 0, check if the response is complete (a fast countermeasure
+ against slowloris */
+ if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) {
+ return r;
+ }
+
+ if ((buf = parse_response(buf, buf_end, major_version, minor_version, status, msg, msg_len, headers, num_headers, max_headers, &r)) == NULL) {
+ return r;
+ }
+
+ return (int)(buf - buf_start);
+}
+
+int phr_parse_headers(const char *buf_start, size_t len, struct phr_header *headers, size_t *num_headers, size_t last_len)
+{
+ const char *buf = buf_start, *buf_end = buf + len;
+ size_t max_headers = *num_headers;
+ int r;
+
+ *num_headers = 0;
+
+ /* if last_len != 0, check if the response is complete (a fast countermeasure
+ against slowloris */
+ if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) {
+ return r;
+ }
+
+ if ((buf = parse_headers(buf, buf_end, headers, num_headers, max_headers, &r)) == NULL) {
+ return r;
+ }
+
+ return (int)(buf - buf_start);
+}
+
+enum {
+ CHUNKED_IN_CHUNK_SIZE,
+ CHUNKED_IN_CHUNK_EXT,
+ CHUNKED_IN_CHUNK_DATA,
+ CHUNKED_IN_CHUNK_CRLF,
+ CHUNKED_IN_TRAILERS_LINE_HEAD,
+ CHUNKED_IN_TRAILERS_LINE_MIDDLE
+};
+
+static int decode_hex(int ch)
+{
+ if ('0' <= ch && ch <= '9') {
+ return ch - '0';
+ } else if ('A' <= ch && ch <= 'F') {
+ return ch - 'A' + 0xa;
+ } else if ('a' <= ch && ch <= 'f') {
+ return ch - 'a' + 0xa;
+ } else {
+ return -1;
+ }
+}
+
+ssize_t phr_decode_chunked(struct phr_chunked_decoder *decoder, char *buf, size_t *_bufsz)
+{
+ size_t dst = 0, src = 0, bufsz = *_bufsz;
+ ssize_t ret = -2; /* incomplete */
+
+ while (1) {
+ switch (decoder->_state) {
+ case CHUNKED_IN_CHUNK_SIZE:
+ for (;; ++src) {
+ int v;
+ if (src == bufsz)
+ goto Exit;
+ if ((v = decode_hex(buf[src])) == -1) {
+ if (decoder->_hex_count == 0) {
+ ret = -1;
+ goto Exit;
+ }
+ break;
+ }
+ if (decoder->_hex_count == sizeof(size_t) * 2) {
+ ret = -1;
+ goto Exit;
+ }
+ decoder->bytes_left_in_chunk = decoder->bytes_left_in_chunk * 16 + v;
+ ++decoder->_hex_count;
+ }
+ decoder->_hex_count = 0;
+ decoder->_state = CHUNKED_IN_CHUNK_EXT;
+ /* fallthru */
+ case CHUNKED_IN_CHUNK_EXT:
+ /* RFC 7230 A.2 "Line folding in chunk extensions is disallowed" */
+ for (;; ++src) {
+ if (src == bufsz)
+ goto Exit;
+ if (buf[src] == '\012')
+ break;
+ }
+ ++src;
+ if (decoder->bytes_left_in_chunk == 0) {
+ if (decoder->consume_trailer) {
+ decoder->_state = CHUNKED_IN_TRAILERS_LINE_HEAD;
+ break;
+ } else {
+ goto Complete;
+ }
+ }
+ decoder->_state = CHUNKED_IN_CHUNK_DATA;
+ /* fallthru */
+ case CHUNKED_IN_CHUNK_DATA: {
+ size_t avail = bufsz - src;
+ if (avail < decoder->bytes_left_in_chunk) {
+ if (dst != src)
+ memmove(buf + dst, buf + src, avail);
+ src += avail;
+ dst += avail;
+ decoder->bytes_left_in_chunk -= avail;
+ goto Exit;
+ }
+ if (dst != src)
+ memmove(buf + dst, buf + src, decoder->bytes_left_in_chunk);
+ src += decoder->bytes_left_in_chunk;
+ dst += decoder->bytes_left_in_chunk;
+ decoder->bytes_left_in_chunk = 0;
+ decoder->_state = CHUNKED_IN_CHUNK_CRLF;
+ }
+ /* fallthru */
+ case CHUNKED_IN_CHUNK_CRLF:
+ for (;; ++src) {
+ if (src == bufsz)
+ goto Exit;
+ if (buf[src] != '\015')
+ break;
+ }
+ if (buf[src] != '\012') {
+ ret = -1;
+ goto Exit;
+ }
+ ++src;
+ decoder->_state = CHUNKED_IN_CHUNK_SIZE;
+ break;
+ case CHUNKED_IN_TRAILERS_LINE_HEAD:
+ for (;; ++src) {
+ if (src == bufsz)
+ goto Exit;
+ if (buf[src] != '\015')
+ break;
+ }
+ if (buf[src++] == '\012')
+ goto Complete;
+ decoder->_state = CHUNKED_IN_TRAILERS_LINE_MIDDLE;
+ /* fallthru */
+ case CHUNKED_IN_TRAILERS_LINE_MIDDLE:
+ for (;; ++src) {
+ if (src == bufsz)
+ goto Exit;
+ if (buf[src] == '\012')
+ break;
+ }
+ ++src;
+ decoder->_state = CHUNKED_IN_TRAILERS_LINE_HEAD;
+ break;
+ default:
+ assert(!"decoder is corrupt");
+ }
+ }
+
+Complete:
+ ret = bufsz - src;
+Exit:
+ if (dst != src)
+ memmove(buf + dst, buf + src, bufsz - src);
+ *_bufsz = dst;
+ return ret;
+}
+
+int phr_decode_chunked_is_in_data(struct phr_chunked_decoder *decoder)
+{
+ return decoder->_state == CHUNKED_IN_CHUNK_DATA;
+}
+
+#undef CHECK_EOF
+#undef EXPECT_CHAR
+#undef ADVANCE_TOKEN
diff --git a/plugins/picohttpparser/picohttpparser.h b/plugins/picohttpparser/picohttpparser.h
new file mode 100644
index 0000000..8f13b36
--- /dev/null
+++ b/plugins/picohttpparser/picohttpparser.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2009-2014 Kazuho Oku, Tokuhiro Matsuno, Daisuke Murase,
+ * Shigeo Mitsunari
+ *
+ * The software is licensed under either the MIT License (below) or the Perl
+ * license.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef picohttpparser_h
+#define picohttpparser_h
+
+#include <sys/types.h>
+
+#ifdef _MSC_VER
+#define ssize_t intptr_t
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* contains name and value of a header (name == NULL if is a continuing line
+ * of a multiline header */
+struct phr_header {
+ const char *name;
+ size_t name_len;
+ const char *value;
+ size_t value_len;
+};
+
+/* returns number of bytes consumed if successful, -2 if request is partial,
+ * -1 if failed */
+int phr_parse_request(const char *buf, size_t len, const char **method, size_t *method_len, const char **path, size_t *path_len,
+ int *major_version, int *minor_version, struct phr_header *headers, size_t *num_headers, size_t last_len);
+
+/* ditto */
+int phr_parse_response(const char *_buf, size_t len, int *major_version, int *minor_version, int *status, const char **msg, size_t *msg_len,
+ struct phr_header *headers, size_t *num_headers, size_t last_len);
+
+/* ditto */
+int phr_parse_headers(const char *buf, size_t len, struct phr_header *headers, size_t *num_headers, size_t last_len);
+
+/* should be zero-filled before start */
+struct phr_chunked_decoder {
+ size_t bytes_left_in_chunk; /* number of bytes left in current chunk */
+ char consume_trailer; /* if trailing headers should be consumed */
+ char _hex_count;
+ char _state;
+};
+
+/* the function rewrites the buffer given as (buf, bufsz) removing the chunked-
+ * encoding headers. When the function returns without an error, bufsz is
+ * updated to the length of the decoded data available. Applications should
+ * repeatedly call the function while it returns -2 (incomplete) every time
+ * supplying newly arrived data. If the end of the chunked-encoded data is
+ * found, the function returns a non-negative number indicating the number of
+ * octets left undecoded at the tail of the supplied buffer. Returns -1 on
+ * error.
+ */
+ssize_t phr_decode_chunked(struct phr_chunked_decoder *decoder, char *buf, size_t *bufsz);
+
+/* returns if the chunked decoder is in middle of chunked data */
+int phr_decode_chunked_is_in_data(struct phr_chunked_decoder *decoder);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/plugins/popen.c b/plugins/popen.c
new file mode 100644
index 0000000..036bc60
--- /dev/null
+++ b/plugins/popen.c
@@ -0,0 +1,294 @@
+/*****************************************************************************
+*
+* Monitoring Plugins popen
+*
+* License: GPL
+* Copyright (c) 2005-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* A safe alternative to popen
+*
+* Provides spopen and spclose
+*
+* FILE * spopen(const char *);
+* int spclose(FILE *);
+*
+* Code taken with little modification from "Advanced Programming for the Unix
+* Environment" by W. Richard Stevens
+*
+* This is considered safe in that no shell is spawned, and the environment
+* and path passed to the exec'd program are essentially empty. (popen create
+* a shell and passes the environment to it).
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "./common.h"
+#include "./utils.h"
+#include "../lib/maxfd.h"
+
+/* extern so plugin has pid to kill exec'd process on timeouts */
+extern pid_t *childpid;
+extern int *child_stderr_array;
+extern FILE *child_process;
+
+FILE *spopen (const char *);
+int spclose (FILE *);
+#ifdef REDHAT_SPOPEN_ERROR
+void popen_sigchld_handler (int);
+#endif
+void popen_timeout_alarm_handler (int);
+
+#include <stdarg.h> /* ANSI C header file */
+#include <fcntl.h>
+
+#include <limits.h>
+#include <sys/resource.h>
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+/* 4.3BSD Reno <signal.h> doesn't define SIG_ERR */
+#if defined(SIG_IGN) && !defined(SIG_ERR)
+#define SIG_ERR ((Sigfunc *)-1)
+#endif
+
+
+char *pname = NULL; /* caller can set this from argv[0] */
+
+#ifdef REDHAT_SPOPEN_ERROR
+static volatile int childtermd = 0;
+#endif
+
+FILE *
+spopen (const char *cmdstring)
+{
+ char *env[2];
+ char *cmd = NULL;
+ char **argv = NULL;
+ char *str, *tmp;
+ int argc;
+
+ int i = 0, pfd[2], pfderr[2];
+ pid_t pid;
+
+#ifdef RLIMIT_CORE
+ /* do not leave core files */
+ struct rlimit limit;
+ getrlimit (RLIMIT_CORE, &limit);
+ limit.rlim_cur = 0;
+ setrlimit (RLIMIT_CORE, &limit);
+#endif
+
+ env[0] = strdup("LC_ALL=C");
+ env[1] = '\0';
+
+ /* if no command was passed, return with no error */
+ if (cmdstring == NULL)
+ return (NULL);
+
+ /* make copy of command string so strtok() doesn't silently modify it */
+ /* (the calling program may want to access it later) */
+ cmd = malloc (strlen (cmdstring) + 1);
+ if (cmd == NULL)
+ return NULL;
+ strcpy (cmd, cmdstring);
+
+ /* This is not a shell, so we don't handle "???" */
+ if (strstr (cmdstring, "\""))
+ return NULL;
+
+ /* allow single quotes, but only if non-whitesapce doesn't occur on both sides */
+ if (strstr (cmdstring, " ' ") || strstr (cmdstring, "'''"))
+ return NULL;
+
+ /* there cannot be more args than characters */
+ argc = strlen (cmdstring) + 1; /* add 1 for NULL termination */
+ argv = malloc (sizeof(char*)*argc);
+
+ if (argv == NULL) {
+ printf ("%s\n", _("Could not malloc argv array in popen()"));
+ return NULL;
+ }
+
+ /* loop to get arguments to command */
+ while (cmd) {
+ str = cmd;
+ str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
+
+ if (i >= argc - 2) {
+ printf ("%s\n",_("CRITICAL - You need more args!!!"));
+ return (NULL);
+ }
+
+ if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */
+ str++;
+ if (!strstr (str, "'"))
+ return NULL; /* balanced? */
+ cmd = 1 + strstr (str, "'");
+ str[strcspn (str, "'")] = 0;
+ }
+ else if (strcspn(str,"'") < strcspn (str, " \t\r\n")) {
+ /* handle --option='foo bar' strings */
+ tmp = str + strcspn(str, "'") + 1;
+ if (!strstr (tmp, "'"))
+ return NULL; /* balanced? */
+ tmp += strcspn(tmp,"'") + 1;
+ *tmp = 0;
+ cmd = tmp + 1;
+ } else {
+ if (strpbrk (str, " \t\r\n")) {
+ cmd = 1 + strpbrk (str, " \t\r\n");
+ str[strcspn (str, " \t\r\n")] = 0;
+ }
+ else {
+ cmd = NULL;
+ }
+ }
+
+ if (cmd && strlen (cmd) == strspn (cmd, " \t\r\n"))
+ cmd = NULL;
+
+ argv[i++] = str;
+
+ }
+ argv[i] = NULL;
+
+ long maxfd = mp_open_max();
+
+ if (childpid == NULL) { /* first time through */
+ if ((childpid = calloc ((size_t)maxfd, sizeof (pid_t))) == NULL)
+ return (NULL);
+ }
+
+ if (child_stderr_array == NULL) { /* first time through */
+ if ((child_stderr_array = calloc ((size_t)maxfd, sizeof (int))) == NULL)
+ return (NULL);
+ }
+
+ if (pipe (pfd) < 0)
+ return (NULL); /* errno set by pipe() */
+
+ if (pipe (pfderr) < 0)
+ return (NULL); /* errno set by pipe() */
+
+#ifdef REDHAT_SPOPEN_ERROR
+ if (signal (SIGCHLD, popen_sigchld_handler) == SIG_ERR) {
+ usage4 (_("Cannot catch SIGCHLD"));
+ }
+#endif
+
+ if ((pid = fork ()) < 0)
+ return (NULL); /* errno set by fork() */
+ else if (pid == 0) { /* child */
+ close (pfd[0]);
+ if (pfd[1] != STDOUT_FILENO) {
+ dup2 (pfd[1], STDOUT_FILENO);
+ close (pfd[1]);
+ }
+ close (pfderr[0]);
+ if (pfderr[1] != STDERR_FILENO) {
+ dup2 (pfderr[1], STDERR_FILENO);
+ close (pfderr[1]);
+ }
+ /* close all descriptors in childpid[] */
+ for (i = 0; i < maxfd; i++)
+ if (childpid[i] > 0)
+ close (i);
+
+ execve (argv[0], argv, env);
+ _exit (0);
+ }
+
+ close (pfd[1]); /* parent */
+ if ((child_process = fdopen (pfd[0], "r")) == NULL)
+ return (NULL);
+ close (pfderr[1]);
+
+ childpid[fileno (child_process)] = pid; /* remember child pid for this fd */
+ child_stderr_array[fileno (child_process)] = pfderr[0]; /* remember STDERR */
+ return (child_process);
+}
+
+int
+spclose (FILE * fp)
+{
+ int fd, status;
+ pid_t pid;
+
+ if (childpid == NULL)
+ return (1); /* popen() has never been called */
+
+ fd = fileno (fp);
+ if ((pid = childpid[fd]) == 0)
+ return (1); /* fp wasn't opened by popen() */
+
+ childpid[fd] = 0;
+ if (fclose (fp) == EOF)
+ return (1);
+
+#ifdef REDHAT_SPOPEN_ERROR
+ while (!childtermd); /* wait until SIGCHLD */
+#endif
+
+ while (waitpid (pid, &status, 0) < 0)
+ if (errno != EINTR)
+ return (1); /* error other than EINTR from waitpid() */
+
+ if (WIFEXITED (status))
+ return (WEXITSTATUS (status)); /* return child's termination status */
+
+ return (1);
+}
+
+#ifdef REDHAT_SPOPEN_ERROR
+void
+popen_sigchld_handler (int signo)
+{
+ if (signo == SIGCHLD)
+ childtermd = 1;
+}
+#endif
+
+void
+popen_timeout_alarm_handler (int signo)
+{
+ int fh;
+ if (signo == SIGALRM) {
+ if (child_process != NULL) {
+ fh=fileno (child_process);
+ if(fh >= 0){
+ kill (childpid[fh], SIGKILL);
+ }
+ printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
+ timeout_interval);
+ } else {
+ printf ("%s\n", _("CRITICAL - popen timeout received, but no child process"));
+ }
+ exit (STATE_CRITICAL);
+ }
+}
diff --git a/plugins/popen.h b/plugins/popen.h
new file mode 100644
index 0000000..1ea6963
--- /dev/null
+++ b/plugins/popen.h
@@ -0,0 +1,13 @@
+/******************************************************************************
+*
+*
+*****************************************************************************/
+
+FILE *spopen (const char *);
+int spclose (FILE *);
+void popen_timeout_alarm_handler (int);
+
+pid_t *childpid=NULL;
+int *child_stderr_array=NULL;
+FILE *child_process=NULL;
+FILE *child_stderr=NULL;
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
new file mode 100644
index 0000000..4f3e349
--- /dev/null
+++ b/plugins/runcmd.c
@@ -0,0 +1,342 @@
+/*****************************************************************************
+*
+* Monitoring run command utilities
+*
+* License: GPL
+* Copyright (c) 2005-2006 Monitoring Plugins Development Team
+*
+* Description :
+*
+* A simple interface to executing programs from other programs, using an
+* optimized and safe popen()-like implementation. It is considered safe
+* in that no shell needs to be spawned and the environment passed to the
+* execve()'d program is essentially empty.
+*
+* The code in this file is a derivative of popen.c which in turn was taken
+* from "Advanced Programming for the Unix Environment" by W. Richard Stevens.
+*
+* Care has been taken to make sure the functions are async-safe. The one
+* function which isn't is np_runcmd_init() which it doesn't make sense to
+* call twice anyway, so the api as a whole should be considered async-safe.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#define NAGIOSPLUG_API_C 1
+
+/** includes **/
+#include "runcmd.h"
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#include "./utils.h"
+
+/** macros **/
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+/* 4.3BSD Reno <signal.h> doesn't define SIG_ERR */
+#if defined(SIG_IGN) && !defined(SIG_ERR)
+# define SIG_ERR ((Sigfunc *)-1)
+#endif
+
+#include "../lib/maxfd.h"
+
+/* This variable must be global, since there's no way the caller
+ * can forcibly slay a dead or ungainly running program otherwise.
+ * Multithreading apps and plugins can initialize it (via NP_RUNCMD_INIT)
+ * in an async safe manner PRIOR to calling np_runcmd() for the first time.
+ *
+ * The check for initialized values is atomic and can
+ * occur in any number of threads simultaneously. */
+static pid_t *np_pids = NULL;
+
+/** prototypes **/
+static int np_runcmd_open(const char *, int *, int *)
+ __attribute__((__nonnull__(1, 2, 3)));
+
+static int np_fetch_output(int, output *, int)
+ __attribute__((__nonnull__(2)));
+
+static int np_runcmd_close(int);
+
+/* prototype imported from utils.h */
+extern void die (int, const char *, ...)
+ __attribute__((__noreturn__,__format__(__printf__, 2, 3)));
+
+
+/* this function is NOT async-safe. It is exported so multithreaded
+ * plugins (or other apps) can call it prior to running any commands
+ * through this api and thus achieve async-safeness throughout the api */
+void np_runcmd_init(void)
+{
+ long maxfd = mp_open_max();
+ if(!np_pids) np_pids = calloc(maxfd, sizeof(pid_t));
+}
+
+
+/* Start running a command */
+static int
+np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr)
+{
+ char *env[2];
+ char *cmd = NULL;
+ char **argv = NULL;
+ char *str;
+ int argc;
+ size_t cmdlen;
+ pid_t pid;
+#ifdef RLIMIT_CORE
+ struct rlimit limit;
+#endif
+
+ int i = 0;
+
+ if(!np_pids) NP_RUNCMD_INIT;
+
+ env[0] = strdup("LC_ALL=C");
+ env[1] = '\0';
+
+ /* make copy of command string so strtok() doesn't silently modify it */
+ /* (the calling program may want to access it later) */
+ cmdlen = strlen(cmdstring);
+ if((cmd = malloc(cmdlen + 1)) == NULL) return -1;
+ memcpy(cmd, cmdstring, cmdlen);
+ cmd[cmdlen] = '\0';
+
+ /* This is not a shell, so we don't handle "???" */
+ if (strstr (cmdstring, "\"")) return -1;
+
+ /* allow single quotes, but only if non-whitesapce doesn't occur on both sides */
+ if (strstr (cmdstring, " ' ") || strstr (cmdstring, "'''"))
+ return -1;
+
+ /* each arg must be whitespace-separated, so args can be a maximum
+ * of (len / 2) + 1. We add 1 extra to the mix for NULL termination */
+ argc = (cmdlen >> 1) + 2;
+ argv = calloc(sizeof(char *), argc);
+
+ if (argv == NULL) {
+ printf ("%s\n", _("Could not malloc argv array in popen()"));
+ return -1;
+ }
+
+ /* get command arguments (stupidly, but fairly quickly) */
+ while (cmd) {
+ str = cmd;
+ str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
+
+ if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */
+ str++;
+ if (!strstr (str, "'")) return -1; /* balanced? */
+ cmd = 1 + strstr (str, "'");
+ str[strcspn (str, "'")] = 0;
+ }
+ else {
+ if (strpbrk (str, " \t\r\n")) {
+ cmd = 1 + strpbrk (str, " \t\r\n");
+ str[strcspn (str, " \t\r\n")] = 0;
+ }
+ else {
+ cmd = NULL;
+ }
+ }
+
+ if (cmd && strlen (cmd) == strspn (cmd, " \t\r\n"))
+ cmd = NULL;
+
+ argv[i++] = str;
+ }
+
+ if (pipe(pfd) < 0 || pipe(pfderr) < 0 || (pid = fork()) < 0)
+ return -1; /* errno set by the failing function */
+
+ /* child runs exceve() and _exit. */
+ if (pid == 0) {
+#ifdef RLIMIT_CORE
+ /* the program we execve shouldn't leave core files */
+ getrlimit (RLIMIT_CORE, &limit);
+ limit.rlim_cur = 0;
+ setrlimit (RLIMIT_CORE, &limit);
+#endif
+ close (pfd[0]);
+ if (pfd[1] != STDOUT_FILENO) {
+ dup2 (pfd[1], STDOUT_FILENO);
+ close (pfd[1]);
+ }
+ close (pfderr[0]);
+ if (pfderr[1] != STDERR_FILENO) {
+ dup2 (pfderr[1], STDERR_FILENO);
+ close (pfderr[1]);
+ }
+
+ /* close all descriptors in np_pids[]
+ * This is executed in a separate address space (pure child),
+ * so we don't have to worry about async safety */
+ long maxfd = mp_open_max();
+ for (i = 0; i < maxfd; i++)
+ if(np_pids[i] > 0)
+ close (i);
+
+ execve (argv[0], argv, env);
+ _exit (STATE_UNKNOWN);
+ }
+
+ /* parent picks up execution here */
+ /* close children descriptors in our address space */
+ close(pfd[1]);
+ close(pfderr[1]);
+
+ /* tag our file's entry in the pid-list and return it */
+ np_pids[pfd[0]] = pid;
+
+ return pfd[0];
+}
+
+
+static int
+np_runcmd_close(int fd)
+{
+ int status;
+ pid_t pid;
+
+ /* make sure this fd was opened by popen() */
+ long maxfd = mp_open_max();
+ if(fd < 0 || fd > maxfd || !np_pids || (pid = np_pids[fd]) == 0)
+ return -1;
+
+ np_pids[fd] = 0;
+ if (close (fd) == -1) return -1;
+
+ /* EINTR is ok (sort of), everything else is bad */
+ while (waitpid (pid, &status, 0) < 0)
+ if (errno != EINTR) return -1;
+
+ /* return child's termination status */
+ return (WIFEXITED(status)) ? WEXITSTATUS(status) : -1;
+}
+
+
+void
+runcmd_timeout_alarm_handler (int signo)
+{
+ size_t i;
+
+ if (signo == SIGALRM)
+ puts(_("CRITICAL - Plugin timed out while executing system call"));
+
+ long maxfd = mp_open_max();
+ if(np_pids) for(i = 0; i < maxfd; i++) {
+ if(np_pids[i] != 0) kill(np_pids[i], SIGKILL);
+ }
+
+ exit (STATE_CRITICAL);
+}
+
+
+static int
+np_fetch_output(int fd, output *op, int flags)
+{
+ size_t len = 0, i = 0, lineno = 0;
+ size_t rsf = 6, ary_size = 0; /* rsf = right shift factor, dec'ed uncond once */
+ char *buf = NULL;
+ int ret;
+ char tmpbuf[4096];
+
+ op->buf = NULL;
+ op->buflen = 0;
+ while((ret = read(fd, tmpbuf, sizeof(tmpbuf))) > 0) {
+ len = (size_t)ret;
+ op->buf = realloc(op->buf, op->buflen + len + 1);
+ memcpy(op->buf + op->buflen, tmpbuf, len);
+ op->buflen += len;
+ i++;
+ }
+
+ if(ret < 0) {
+ printf("read() returned %d: %s\n", ret, strerror(errno));
+ return ret;
+ }
+
+ /* some plugins may want to keep output unbroken, and some commands
+ * will yield no output, so return here for those */
+ if(flags & RUNCMD_NO_ARRAYS || !op->buf || !op->buflen)
+ return op->buflen;
+
+ /* and some may want both */
+ if(flags & RUNCMD_NO_ASSOC) {
+ buf = malloc(op->buflen);
+ memcpy(buf, op->buf, op->buflen);
+ }
+ else buf = op->buf;
+
+ op->line = NULL;
+ op->lens = NULL;
+ i = 0;
+ while(i < op->buflen) {
+ /* make sure we have enough memory */
+ if(lineno >= ary_size) {
+ /* ary_size must never be zero */
+ do {
+ ary_size = op->buflen >> --rsf;
+ } while(!ary_size);
+
+ op->line = realloc(op->line, ary_size * sizeof(char *));
+ op->lens = realloc(op->lens, ary_size * sizeof(size_t));
+ }
+
+ /* set the pointer to the string */
+ op->line[lineno] = &buf[i];
+
+ /* hop to next newline or end of buffer */
+ while(buf[i] != '\n' && i < op->buflen) i++;
+ buf[i] = '\0';
+
+ /* calculate the string length using pointer difference */
+ op->lens[lineno] = (size_t)&buf[i] - (size_t)op->line[lineno];
+
+ lineno++;
+ i++;
+ }
+
+ return lineno;
+}
+
+
+int
+np_runcmd(const char *cmd, output *out, output *err, int flags)
+{
+ int fd, pfd_out[2], pfd_err[2];
+
+ /* initialize the structs */
+ if(out) memset(out, 0, sizeof(output));
+ if(err) memset(err, 0, sizeof(output));
+
+ if((fd = np_runcmd_open(cmd, pfd_out, pfd_err)) == -1)
+ die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd);
+
+ if(out) out->lines = np_fetch_output(pfd_out[0], out, flags);
+ if(err) err->lines = np_fetch_output(pfd_err[0], err, flags);
+
+ return np_runcmd_close(fd);
+}
diff --git a/plugins/runcmd.h b/plugins/runcmd.h
new file mode 100644
index 0000000..2dcdadf
--- /dev/null
+++ b/plugins/runcmd.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+*
+* License: GPL
+* Copyright (c) 2005 Monitoring Plugins Development Team
+* Author: Andreas Ericsson <ae@op5.se>
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#ifndef NAGIOSPLUG_RUNCMD_H
+#define NAGIOSPLUG_RUNCMD_H
+
+#include "common.h"
+#include "utils_cmd.h" /* for the "output" type */
+
+/** prototypes **/
+int np_runcmd(const char *, output *, output *, int);
+void runcmd_timeout_alarm_handler(int)
+ __attribute__((__noreturn__));
+
+/* only multi-threaded plugins need to bother with this */
+void np_runcmd_init(void);
+#define NP_RUNCMD_INIT np_runcmd_init()
+
+/* possible flags for np_runcmd()'s fourth argument */
+#define RUNCMD_NO_ARRAYS 0x01 /* don't populate arrays at all */
+#define RUNCMD_NO_ASSOC 0x02 /* output.line won't point to buf */
+
+#endif /* NAGIOSPLUG_RUNCMD_H */
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
new file mode 100644
index 0000000..6bc0ba8
--- /dev/null
+++ b/plugins/sslutils.c
@@ -0,0 +1,330 @@
+/*****************************************************************************
+*
+* Monitoring Plugins SSL utilities
+*
+* License: GPL
+* Copyright (c) 2005-2010 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains common functions for plugins that require SSL.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#define MAX_CN_LENGTH 256
+#include "common.h"
+#include "netutils.h"
+
+#ifdef HAVE_SSL
+static SSL_CTX *ctx=NULL;
+static SSL *s=NULL;
+
+int np_net_ssl_init(int sd) {
+ return np_net_ssl_init_with_hostname(sd, NULL);
+}
+
+int np_net_ssl_init_with_hostname(int sd, char *host_name) {
+ return np_net_ssl_init_with_hostname_and_version(sd, host_name, 0);
+}
+
+int np_net_ssl_init_with_hostname_and_version(int sd, char *host_name, int version) {
+ return np_net_ssl_init_with_hostname_version_and_cert(sd, host_name, version, NULL, NULL);
+}
+
+int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int version, char *cert, char *privkey) {
+ long options = 0;
+
+ if ((ctx = SSL_CTX_new(TLS_client_method())) == NULL) {
+ printf("%s\n", _("CRITICAL - Cannot create SSL context."));
+ return STATE_CRITICAL;
+ }
+
+ switch (version) {
+ case MP_SSLv2: /* SSLv2 protocol */
+ printf("%s\n", _("UNKNOWN - SSL protocol version 2 is not supported by your SSL library."));
+ return STATE_UNKNOWN;
+ case MP_SSLv3: /* SSLv3 protocol */
+#if defined(OPENSSL_NO_SSL3)
+ printf("%s\n", _("UNKNOWN - SSL protocol version 3 is not supported by your SSL library."));
+ return STATE_UNKNOWN;
+#else
+ SSL_CTX_set_min_proto_version(ctx, SSL3_VERSION);
+ SSL_CTX_set_max_proto_version(ctx, SSL3_VERSION);
+ break;
+#endif
+ case MP_TLSv1: /* TLSv1 protocol */
+#if defined(OPENSSL_NO_TLS1)
+ printf("%s\n", _("UNKNOWN - TLS protocol version 1 is not supported by your SSL library."));
+ return STATE_UNKNOWN;
+#else
+ SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);
+ SSL_CTX_set_max_proto_version(ctx, TLS1_VERSION);
+ break;
+#endif
+ case MP_TLSv1_1: /* TLSv1.1 protocol */
+#if !defined(SSL_OP_NO_TLSv1_1)
+ printf("%s\n", _("UNKNOWN - TLS protocol version 1.1 is not supported by your SSL library."));
+ return STATE_UNKNOWN;
+#else
+ SSL_CTX_set_min_proto_version(ctx, TLS1_1_VERSION);
+ SSL_CTX_set_max_proto_version(ctx, TLS1_1_VERSION);
+ break;
+#endif
+ case MP_TLSv1_2: /* TLSv1.2 protocol */
+#if !defined(SSL_OP_NO_TLSv1_2)
+ printf("%s\n", _("UNKNOWN - TLS protocol version 1.2 is not supported by your SSL library."));
+ return STATE_UNKNOWN;
+#else
+ SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION);
+ SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION);
+ break;
+#endif
+ case MP_TLSv1_2_OR_NEWER:
+#if !defined(SSL_OP_NO_TLSv1_1)
+ printf("%s\n", _("UNKNOWN - Disabling TLSv1.1 is not supported by your SSL library."));
+ return STATE_UNKNOWN;
+#else
+ SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION);
+ break;
+#endif
+ case MP_TLSv1_1_OR_NEWER:
+#if !defined(SSL_OP_NO_TLSv1)
+ printf("%s\n", _("UNKNOWN - Disabling TLSv1 is not supported by your SSL library."));
+ return STATE_UNKNOWN;
+#else
+ SSL_CTX_set_min_proto_version(ctx, TLS1_1_VERSION);
+ break;
+#endif
+ case MP_TLSv1_OR_NEWER:
+#if defined(SSL_OP_NO_SSLv3)
+ SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);
+ break;
+#endif
+ case MP_SSLv3_OR_NEWER:
+#if defined(SSL_OP_NO_SSLv2)
+ SSL_CTX_set_min_proto_version(ctx, SSL3_VERSION);
+ break;
+#endif
+ }
+
+ if (cert && privkey) {
+#ifdef USE_OPENSSL
+ if (!SSL_CTX_use_certificate_chain_file(ctx, cert)) {
+#elif USE_GNUTLS
+ if (!SSL_CTX_use_certificate_file(ctx, cert, SSL_FILETYPE_PEM)) {
+#else
+#error Unported for unknown SSL library
+#endif
+ printf ("%s\n", _("CRITICAL - Unable to open certificate chain file!\n"));
+ return STATE_CRITICAL;
+ }
+ SSL_CTX_use_PrivateKey_file(ctx, privkey, SSL_FILETYPE_PEM);
+#ifdef USE_OPENSSL
+ if (!SSL_CTX_check_private_key(ctx)) {
+ printf ("%s\n", _("CRITICAL - Private key does not seem to match certificate!\n"));
+ return STATE_CRITICAL;
+ }
+#endif
+ }
+#ifdef SSL_OP_NO_TICKET
+ options |= SSL_OP_NO_TICKET;
+#endif
+ SSL_CTX_set_options(ctx, options);
+ SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
+ if ((s = SSL_new(ctx)) != NULL) {
+#ifdef SSL_set_tlsext_host_name
+ if (host_name != NULL)
+ SSL_set_tlsext_host_name(s, host_name);
+#endif
+ SSL_set_fd(s, sd);
+ if (SSL_connect(s) == 1) {
+ return OK;
+ } else {
+ printf("%s\n", _("CRITICAL - Cannot make SSL connection."));
+# ifdef USE_OPENSSL /* XXX look into ERR_error_string */
+ ERR_print_errors_fp(stdout);
+# endif /* USE_OPENSSL */
+ }
+ } else {
+ printf("%s\n", _("CRITICAL - Cannot initiate SSL handshake."));
+ }
+ return STATE_CRITICAL;
+}
+
+void np_net_ssl_cleanup() {
+ if (s) {
+#ifdef SSL_set_tlsext_host_name
+ SSL_set_tlsext_host_name(s, NULL);
+#endif
+ SSL_shutdown(s);
+ SSL_free(s);
+ if (ctx) {
+ SSL_CTX_free(ctx);
+ ctx=NULL;
+ }
+ s=NULL;
+ }
+}
+
+int np_net_ssl_write(const void *buf, int num) {
+ return SSL_write(s, buf, num);
+}
+
+int np_net_ssl_read(void *buf, int num) {
+ return SSL_read(s, buf, num);
+}
+
+int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){
+# ifdef USE_OPENSSL
+ X509_NAME *subj=NULL;
+ char timestamp[50] = "";
+ char cn[MAX_CN_LENGTH]= "";
+ char *tz;
+
+ int cnlen =-1;
+ int status=STATE_UNKNOWN;
+
+ ASN1_STRING *tm;
+ int offset;
+ struct tm stamp;
+ float time_left;
+ int days_left;
+ int time_remaining;
+ time_t tm_t;
+
+ if (!certificate) {
+ printf("%s\n",_("CRITICAL - Cannot retrieve server certificate."));
+ return STATE_CRITICAL;
+ }
+
+ /* Extract CN from certificate subject */
+ subj=X509_get_subject_name(certificate);
+
+ if (!subj) {
+ printf("%s\n",_("CRITICAL - Cannot retrieve certificate subject."));
+ return STATE_CRITICAL;
+ }
+ cnlen = X509_NAME_get_text_by_NID(subj, NID_commonName, cn, sizeof(cn));
+ if (cnlen == -1)
+ strcpy(cn, _("Unknown CN"));
+
+ /* Retrieve timestamp of certificate */
+ tm = X509_get_notAfter(certificate);
+
+ /* Generate tm structure to process timestamp */
+ if (tm->type == V_ASN1_UTCTIME) {
+ if (tm->length < 10) {
+ printf("%s\n", _("CRITICAL - Wrong time format in certificate."));
+ return STATE_CRITICAL;
+ } else {
+ stamp.tm_year = (tm->data[0] - '0') * 10 + (tm->data[1] - '0');
+ if (stamp.tm_year < 50)
+ stamp.tm_year += 100;
+ offset = 0;
+ }
+ } else {
+ if (tm->length < 12) {
+ printf("%s\n", _("CRITICAL - Wrong time format in certificate."));
+ return STATE_CRITICAL;
+ } else {
+ stamp.tm_year =
+ (tm->data[0] - '0') * 1000 + (tm->data[1] - '0') * 100 +
+ (tm->data[2] - '0') * 10 + (tm->data[3] - '0');
+ stamp.tm_year -= 1900;
+ offset = 2;
+ }
+ }
+ stamp.tm_mon =
+ (tm->data[2 + offset] - '0') * 10 + (tm->data[3 + offset] - '0') - 1;
+ stamp.tm_mday =
+ (tm->data[4 + offset] - '0') * 10 + (tm->data[5 + offset] - '0');
+ stamp.tm_hour =
+ (tm->data[6 + offset] - '0') * 10 + (tm->data[7 + offset] - '0');
+ stamp.tm_min =
+ (tm->data[8 + offset] - '0') * 10 + (tm->data[9 + offset] - '0');
+ stamp.tm_sec =
+ (tm->data[10 + offset] - '0') * 10 + (tm->data[11 + offset] - '0');
+ stamp.tm_isdst = -1;
+
+ tm_t = timegm(&stamp);
+ time_left = difftime(tm_t, time(NULL));
+ days_left = time_left / 86400;
+ tz = getenv("TZ");
+ setenv("TZ", "GMT", 1);
+ tzset();
+ strftime(timestamp, 50, "%c %z", localtime(&tm_t));
+ if (tz)
+ setenv("TZ", tz, 1);
+ else
+ unsetenv("TZ");
+ tzset();
+
+ if (days_left > 0 && days_left <= days_till_exp_warn) {
+ printf (_("%s - Certificate '%s' expires in %d day(s) (%s).\n"), (days_left>days_till_exp_crit)?"WARNING":"CRITICAL", cn, days_left, timestamp);
+ if (days_left > days_till_exp_crit)
+ status = STATE_WARNING;
+ else
+ status = STATE_CRITICAL;
+ } else if (days_left == 0 && time_left > 0) {
+ if (time_left >= 3600)
+ time_remaining = (int) time_left / 3600;
+ else
+ time_remaining = (int) time_left / 60;
+
+ printf (_("%s - Certificate '%s' expires in %u %s (%s)\n"),
+ (days_left>days_till_exp_crit) ? "WARNING" : "CRITICAL", cn, time_remaining,
+ time_left >= 3600 ? "hours" : "minutes", timestamp);
+
+ if ( days_left > days_till_exp_crit)
+ status = STATE_WARNING;
+ else
+ status = STATE_CRITICAL;
+ } else if (time_left < 0) {
+ printf(_("CRITICAL - Certificate '%s' expired on %s.\n"), cn, timestamp);
+ status=STATE_CRITICAL;
+ } else if (days_left == 0) {
+ printf (_("%s - Certificate '%s' just expired (%s).\n"), (days_left>days_till_exp_crit)?"WARNING":"CRITICAL", cn, timestamp);
+ if (days_left > days_till_exp_crit)
+ status = STATE_WARNING;
+ else
+ status = STATE_CRITICAL;
+ } else {
+ printf(_("OK - Certificate '%s' will expire on %s.\n"), cn, timestamp);
+ status = STATE_OK;
+ }
+ X509_free(certificate);
+ return status;
+# else /* ifndef USE_OPENSSL */
+ printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
+ return STATE_WARNING;
+# endif /* USE_OPENSSL */
+}
+
+int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){
+# ifdef USE_OPENSSL
+ X509 *certificate = NULL;
+ certificate=SSL_get_peer_certificate(s);
+ return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit));
+# else /* ifndef USE_OPENSSL */
+ printf("%s\n", _("WARNING - Plugin does not support checking certificates."));
+ return STATE_WARNING;
+# endif /* USE_OPENSSL */
+}
+
+
+#endif /* HAVE_SSL */
diff --git a/plugins/t/check_apt.t b/plugins/t/check_apt.t
new file mode 100644
index 0000000..430eb53
--- /dev/null
+++ b/plugins/t/check_apt.t
@@ -0,0 +1,106 @@
+#!/usr/bin/perl -w -I ..
+#
+# Test check_apt using input files.
+# Contributed by Alex Bradley, October 2012
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+sub make_result_regexp {
+ my ($warning, $critical) = @_;
+ my $status;
+ if ($warning == 0 && $critical == 0) {
+ $status = "OK";
+ } elsif ($critical == 0) {
+ $status = "WARNING";
+ } else {
+ $status = "CRITICAL";
+ }
+ return sprintf('/^APT %s: %d packages available for upgrade \(%d critical updates\)\. |available_upgrades=%d;;;0 critical_updates=%d;;;0$/',
+ $status, $warning, $critical, $warning, $critical);
+}
+
+if (-x "./check_apt") {
+ plan tests => 36;
+} else {
+ plan skip_all => "No check_apt compiled";
+}
+
+my $result;
+
+my $testfile_command = "./check_apt %s --input-file=t/check_apt_input/%s";
+
+$result = NPTest->testCmd( sprintf($testfile_command, "", "debian1") );
+is( $result->return_code, 0, "No upgrades" );
+like( $result->output, make_result_regexp(0, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "", "debian2") );
+is( $result->return_code, 1, "Debian apt output, warning" );
+like( $result->output, make_result_regexp(13, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-o", "debian2") );
+is( $result->return_code, 0, "Debian apt output, no critical" );
+like( $result->output, make_result_regexp(13, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "", "debian3") );
+is( $result->return_code, 2, "Debian apt output, some critical" );
+like( $result->output, make_result_regexp(19, 4), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-o", "debian3") );
+is( $result->return_code, 2, "Debian apt output, some critical" );
+like( $result->output, make_result_regexp(19, 4), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-c '^[^\\(]*\\(.* (Debian-Security:|Ubuntu:[^/]*/[^-]*-security)'", "debian3") );
+is( $result->return_code, 2, "Debian apt output - should have same result when default security regexp specified via -c" );
+like( $result->output, make_result_regexp(19, 4), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-i libc6", "debian3") );
+is( $result->return_code, 1, "Debian apt output, filter for libc6" );
+like( $result->output, make_result_regexp(3, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-i libc6", "debian3") );
+is( $result->return_code, 1, "Debian apt output, filter for libc6, not critical" );
+like( $result->output, make_result_regexp(3, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-i libc6 -i xen", "debian3") );
+is( $result->return_code, 2, "Debian apt output, filter for libc6 and xen" );
+like( $result->output, make_result_regexp(9, 4), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-i libc6 -i xen -i linux", "debian3") );
+is( $result->return_code, 2, "Debian apt output, filter for libc6, xen, linux" );
+like( $result->output, make_result_regexp(12, 4), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-e libc6", "debian3") );
+is( $result->return_code, 2, "Debian apt output, filter out libc6" );
+like( $result->output, make_result_regexp(16, 4), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-e libc6 -o", "debian3") );
+is( $result->return_code, 2, "Debian apt output, filter out libc6, critical" );
+like( $result->output, make_result_regexp(16, 4), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-e libc6 -e xen", "debian3") );
+is( $result->return_code, 1, "Debian apt output, filter out libc6 and xen" );
+like( $result->output, make_result_regexp(10, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-e libc6 -e xen -e linux", "debian3") );
+is( $result->return_code, 1, "Debian apt output, filter out libc6, xen, linux" );
+like( $result->output, make_result_regexp(7, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-c Debian-Security -c linux", "debian3") );
+is( $result->return_code, 2, "Debian apt output, critical on Debian-Security or linux" );
+like( $result->output, make_result_regexp(19, 9), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "-i lib -i linux -e gc1c -c linux-image", "debian3") );
+is( $result->return_code, 2, "Debian apt output, include lib and linux, exclude gc1c, critical on linux-image" );
+like( $result->output, make_result_regexp(10, 2), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "", "ubuntu1") );
+is( $result->return_code, 1, "Ubuntu apt output, warning" );
+like( $result->output, make_result_regexp(5, 0), "Output correct" );
+
+$result = NPTest->testCmd( sprintf($testfile_command, "", "ubuntu2") );
+is( $result->return_code, 2, "Ubuntu apt output, some critical" );
+like( $result->output, make_result_regexp(25, 14), "Output correct" );
+
diff --git a/plugins/t/check_apt_input/debian1 b/plugins/t/check_apt_input/debian1
new file mode 100644
index 0000000..317e7ea
--- /dev/null
+++ b/plugins/t/check_apt_input/debian1
@@ -0,0 +1,4 @@
+NOTE: This is only a simulation!
+ apt-get needs root privileges for real execution.
+ Keep also in mind that locking is deactivated,
+ so don't depend on the relevance to the real current situation!
diff --git a/plugins/t/check_apt_input/debian2 b/plugins/t/check_apt_input/debian2
new file mode 100644
index 0000000..effd155
--- /dev/null
+++ b/plugins/t/check_apt_input/debian2
@@ -0,0 +1,37 @@
+NOTE: This is only a simulation!
+ apt-get needs root privileges for real execution.
+ Keep also in mind that locking is deactivated,
+ so don't depend on the relevance to the real current situation!
+Reading package lists... Done
+Building dependency tree
+Reading state information... Done
+The following packages will be upgraded:
+ base-files debian-archive-keyring dpkg firmware-linux-free libc-bin libc-dev-bin libc6 libc6-dev linux-base
+ linux-image-2.6.32-5-xen-amd64 linux-libc-dev locales lockfile-progs
+13 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Inst base-files [6.0squeeze5] (6.0squeeze6 Debian:6.0.6/stable [amd64])
+Conf base-files (6.0squeeze6 Debian:6.0.6/stable [amd64])
+Inst dpkg [1.15.8.12] (1.15.8.13 Debian:6.0.6/stable [amd64])
+Conf dpkg (1.15.8.13 Debian:6.0.6/stable [amd64])
+Inst linux-base [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all])
+Inst linux-image-2.6.32-5-xen-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64])
+Inst debian-archive-keyring [2010.08.28] (2010.08.28+squeeze1 Debian:6.0.6/stable [all])
+Conf debian-archive-keyring (2010.08.28+squeeze1 Debian:6.0.6/stable [all])
+Inst libc6-dev [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) []
+Inst libc-dev-bin [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) []
+Inst linux-libc-dev [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64]) []
+Inst libc-bin [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ]
+Conf libc-bin (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ]
+Inst libc6 [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64])
+Conf libc6 (2.11.3-4 Debian:6.0.6/stable [amd64])
+Inst locales [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [all])
+Inst firmware-linux-free [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all])
+Inst lockfile-progs [0.1.15] (0.1.15+squeeze1 Debian:6.0.6/stable [amd64])
+Conf linux-base (2.6.32-46 Debian:6.0.6/stable [all])
+Conf linux-image-2.6.32-5-xen-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64])
+Conf libc-dev-bin (2.11.3-4 Debian:6.0.6/stable [amd64])
+Conf linux-libc-dev (2.6.32-46 Debian:6.0.6/stable [amd64])
+Conf libc6-dev (2.11.3-4 Debian:6.0.6/stable [amd64])
+Conf locales (2.11.3-4 Debian:6.0.6/stable [all])
+Conf firmware-linux-free (2.6.32-46 Debian:6.0.6/stable [all])
+Conf lockfile-progs (0.1.15+squeeze1 Debian:6.0.6/stable [amd64])
diff --git a/plugins/t/check_apt_input/debian3 b/plugins/t/check_apt_input/debian3
new file mode 100644
index 0000000..719dce9
--- /dev/null
+++ b/plugins/t/check_apt_input/debian3
@@ -0,0 +1,42 @@
+NOTE: This is only a simulation!
+ apt-get needs root privileges for real execution.
+ Keep also in mind that locking is deactivated,
+ so don't depend on the relevance to the real current situation!
+Inst base-files [6.0squeeze5] (6.0squeeze6 Debian:6.0.6/stable [amd64])
+Conf base-files (6.0squeeze6 Debian:6.0.6/stable [amd64])
+Inst dpkg [1.15.8.12] (1.15.8.13 Debian:6.0.6/stable [amd64])
+Conf dpkg (1.15.8.13 Debian:6.0.6/stable [amd64])
+Inst linux-base [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all])
+Inst linux-image-2.6.32-5-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64])
+Inst xen-hypervisor-4.0-amd64 [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Inst xen-linux-system-2.6.32-5-xen-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64]) []
+Inst linux-image-2.6.32-5-xen-amd64 [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [amd64])
+Inst debian-archive-keyring [2010.08.28] (2010.08.28+squeeze1 Debian:6.0.6/stable [all])
+Conf debian-archive-keyring (2010.08.28+squeeze1 Debian:6.0.6/stable [all])
+Inst libc6-i386 [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) []
+Inst libc-bin [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ]
+Conf libc-bin (2.11.3-4 Debian:6.0.6/stable [amd64]) [libc6:amd64 ]
+Inst libc6 [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [amd64])
+Conf libc6 (2.11.3-4 Debian:6.0.6/stable [amd64])
+Inst libgc1c2 [1:6.8-1.2] (1:6.8-2 Debian:6.0.6/stable [amd64])
+Inst locales [2.11.3-3] (2.11.3-4 Debian:6.0.6/stable [all])
+Inst firmware-linux-free [2.6.32-45] (2.6.32-46 Debian:6.0.6/stable [all])
+Inst libxenstore3.0 [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Inst lockfile-progs [0.1.15] (0.1.15+squeeze1 Debian:6.0.6/stable [amd64])
+Inst xen-utils-4.0 [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Inst xenstore-utils [4.0.1-5.3] (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Inst libconfig-inifiles-perl [2.52-1] (2.52-1+squeeze1 Debian:6.0.6/stable [all])
+Conf linux-base (2.6.32-46 Debian:6.0.6/stable [all])
+Conf linux-image-2.6.32-5-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64])
+Conf xen-hypervisor-4.0-amd64 (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Conf linux-image-2.6.32-5-xen-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64])
+Conf xen-linux-system-2.6.32-5-xen-amd64 (2.6.32-46 Debian:6.0.6/stable [amd64])
+Conf libc6-i386 (2.11.3-4 Debian:6.0.6/stable [amd64])
+Conf libgc1c2 (1:6.8-2 Debian:6.0.6/stable [amd64])
+Conf locales (2.11.3-4 Debian:6.0.6/stable [all])
+Conf firmware-linux-free (2.6.32-46 Debian:6.0.6/stable [all])
+Conf libxenstore3.0 (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Conf lockfile-progs (0.1.15+squeeze1 Debian:6.0.6/stable [amd64])
+Conf xen-utils-4.0 (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Conf xenstore-utils (4.0.1-5.4 Debian:6.0.6/stable, Debian-Security:6.0/stable [amd64])
+Conf libconfig-inifiles-perl (2.52-1+squeeze1 Debian:6.0.6/stable [all])
diff --git a/plugins/t/check_apt_input/ubuntu1 b/plugins/t/check_apt_input/ubuntu1
new file mode 100644
index 0000000..2f61c30
--- /dev/null
+++ b/plugins/t/check_apt_input/ubuntu1
@@ -0,0 +1,14 @@
+NOTE: This is only a simulation!
+ apt-get needs root privileges for real execution.
+ Also keep in mind that locking is deactivated,
+ so don't depend on the relevance to the real current situation!
+Inst grub-pc [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) []
+Inst grub-pc-bin [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) []
+Inst grub2-common [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) []
+Inst grub-efi-amd64-bin [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64]) []
+Inst grub-common [1.99-21ubuntu3.1] (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64])
+Conf grub-common (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64])
+Conf grub2-common (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64])
+Conf grub-pc-bin (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64])
+Conf grub-pc (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64])
+Conf grub-efi-amd64-bin (1.99-21ubuntu3.4 Ubuntu:12.04/precise-updates [amd64])
diff --git a/plugins/t/check_apt_input/ubuntu2 b/plugins/t/check_apt_input/ubuntu2
new file mode 100644
index 0000000..29a14a0
--- /dev/null
+++ b/plugins/t/check_apt_input/ubuntu2
@@ -0,0 +1,54 @@
+NOTE: This is only a simulation!
+ apt-get needs root privileges for real execution.
+ Also keep in mind that locking is deactivated,
+ so don't depend on the relevance to the real current situation!
+Inst libc6-dev [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) []
+Inst libc-dev-bin [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) []
+Inst linux-libc-dev [3.2.0-29.46] (3.2.0-31.50 Ubuntu:12.04/precise-security [amd64]) []
+Inst tzdata [2012e-0ubuntu0.12.04] (2012e-0ubuntu0.12.04.1 Ubuntu:12.04/precise-security [all]) []
+Conf tzdata (2012e-0ubuntu0.12.04.1 Ubuntu:12.04/precise-security [all]) []
+Inst libc-bin [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) [libc6:amd64 ]
+Conf libc-bin (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64]) [libc6:amd64 ]
+Inst libc6 [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64])
+Conf libc6 (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64])
+Inst libapt-pkg4.12 [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Conf libapt-pkg4.12 (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Inst ubuntu-keyring [2011.11.21] (2011.11.21.1 Ubuntu:12.04/precise-updates [all])
+Conf ubuntu-keyring (2011.11.21.1 Ubuntu:12.04/precise-updates [all])
+Inst gpgv [1.4.11-3ubuntu2] (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64])
+Conf gpgv (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64])
+Inst gnupg [1.4.11-3ubuntu2] (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64])
+Conf gnupg (1.4.11-3ubuntu2.1 Ubuntu:12.04/precise-security [amd64])
+Inst apt [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Conf apt (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Inst libssl1.0.0 [1.0.1-4ubuntu5.3] (1.0.1-4ubuntu5.5 Ubuntu:12.04/precise-updates [amd64])
+Conf libssl1.0.0 (1.0.1-4ubuntu5.5 Ubuntu:12.04/precise-updates [amd64])
+Inst libapt-inst1.4 [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Inst resolvconf [1.63ubuntu15] (1.63ubuntu16 Ubuntu:12.04/precise-updates [all])
+Inst libdbus-1-3 [1.4.18-1ubuntu1] (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64])
+Inst libxml2 [2.7.8.dfsg-5.1ubuntu4.1] (2.7.8.dfsg-5.1ubuntu4.2 Ubuntu:12.04/precise-security [amd64])
+Inst multiarch-support [2.15-0ubuntu10] (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64])
+Conf multiarch-support (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64])
+Inst apt-utils [0.8.16~exp12ubuntu10.2] (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Inst isc-dhcp-client [4.1.ESV-R4-0ubuntu5.2] (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64]) []
+Inst isc-dhcp-common [4.1.ESV-R4-0ubuntu5.2] (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64])
+Inst dbus [1.4.18-1ubuntu1] (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64])
+Inst linux-firmware [1.79] (1.79.1 Ubuntu:12.04/precise-updates [all])
+Inst xserver-common [2:1.11.4-0ubuntu10.7] (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [all])
+Inst xserver-xorg-core [2:1.11.4-0ubuntu10.7] (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [amd64])
+Inst xserver-xorg-input-synaptics [1.6.2-1ubuntu1~precise1] (1.6.2-1ubuntu1~precise2 Ubuntu:12.04/precise-updates [amd64])
+Conf libc-dev-bin (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64])
+Conf linux-libc-dev (3.2.0-31.50 Ubuntu:12.04/precise-security [amd64])
+Conf libc6-dev (2.15-0ubuntu10.2 Ubuntu:12.04/precise-security [amd64])
+Conf libapt-inst1.4 (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Conf resolvconf (1.63ubuntu16 Ubuntu:12.04/precise-updates [all])
+Conf libdbus-1-3 (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64])
+Conf libxml2 (2.7.8.dfsg-5.1ubuntu4.2 Ubuntu:12.04/precise-security [amd64])
+Conf apt-utils (0.8.16~exp12ubuntu10.3 Ubuntu:12.04/precise-updates [amd64])
+Conf isc-dhcp-common (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64])
+Conf isc-dhcp-client (4.1.ESV-R4-0ubuntu5.5 Ubuntu:12.04/precise-security [amd64])
+Conf dbus (1.4.18-1ubuntu1.1 Ubuntu:12.04/precise-security [amd64])
+Conf linux-firmware (1.79.1 Ubuntu:12.04/precise-updates [all])
+Conf xserver-common (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [all])
+Conf xserver-xorg-core (2:1.11.4-0ubuntu10.8 Ubuntu:12.04/precise-updates [amd64])
+Conf xserver-xorg-input-synaptics (1.6.2-1ubuntu1~precise2 Ubuntu:12.04/precise-updates [amd64])
diff --git a/plugins/t/check_by_ssh.t b/plugins/t/check_by_ssh.t
new file mode 100644
index 0000000..b6479f1
--- /dev/null
+++ b/plugins/t/check_by_ssh.t
@@ -0,0 +1,153 @@
+#! /usr/bin/perl -w -I ..
+#
+# check_by_ssh tests
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+# Required parameters
+my $ssh_service = getTestParameter("NP_SSH_HOST", "A host providing SSH service", "localhost");
+my $ssh_key = getTestParameter("NP_SSH_IDENTITY", "A key allowing access to NP_SSH_HOST", "~/.ssh/id_dsa");
+my $ssh_conf = getTestParameter( "NP_SSH_CONFIGFILE", "A config file with ssh settings", "~/.ssh/config");
+
+
+plan skip_all => "SSH_HOST and SSH_IDENTITY must be defined" unless ($ssh_service && $ssh_key);
+
+plan tests => 42;
+
+# Some random check strings/response
+my @response = ('OK: Everything is fine',
+ 'WARNING: Hey, pick me, pick me',
+ 'CRITICAL: Shit happens',
+ 'UNKNOWN: What can I do for ya',
+ 'WOOPS: What did I smoke',
+);
+my @response_re;
+my @check;
+for (@response) {
+ push(@check, "echo $_");
+ my $re_str = $_;
+ $re_str =~ s{(.)} { "\Q$1" }ge;
+ push(@response_re, $re_str);
+}
+
+my $result;
+
+# expand paths
+$ssh_key = glob($ssh_key) if $ssh_key;
+$ssh_conf = glob($ssh_conf) if $ssh_conf;
+
+## Single active checks
+
+for (my $i=0; $i<4; $i++) {
+ $result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[$i]; exit $i'"
+ );
+ cmp_ok($result->return_code, '==', $i, "Exit with return code $i");
+ is($result->output, $response[$i], "Status text is correct for check $i");
+}
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C 'exit 0'"
+ );
+cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)");
+is($result->output, 'OK - check_by_ssh: Remote command \'exit 0\' returned status 0', "Status text if command returned none (OK)");
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C 'exit 1'"
+ );
+cmp_ok($result->return_code, '==', 1, "Exit with return code 1 (WARNING)");
+is($result->output, 'WARNING - check_by_ssh: Remote command \'exit 1\' returned status 1', "Status text if command returned none (WARNING)");
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C 'exit 2'"
+ );
+cmp_ok($result->return_code, '==', 2, "Exit with return code 2 (CRITICAL)");
+is($result->output, 'CRITICAL - check_by_ssh: Remote command \'exit 2\' returned status 2', "Status text if command returned none (CRITICAL)");
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C 'exit 3'"
+ );
+cmp_ok($result->return_code, '==', 3, "Exit with return code 3 (UNKNOWN)");
+is($result->output, 'UNKNOWN - check_by_ssh: Remote command \'exit 3\' returned status 3', "Status text if command returned none (UNKNOWN)");
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C 'exit 7'"
+ );
+cmp_ok($result->return_code, '==', 7, "Exit with return code 7 (out of bounds)");
+is($result->output, 'UNKNOWN - check_by_ssh: Remote command \'exit 7\' returned status 7', "Status text if command returned none (out of bounds)");
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[4]; exit 8'"
+ );
+cmp_ok($result->return_code, '==', 8, "Exit with return code 8 (out of bounds)");
+is($result->output, $response[4], "Return proper status text even with unknown status codes");
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -F $ssh_conf -C 'exit 0'"
+ );
+cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)");
+is($result->output, 'OK - check_by_ssh: Remote command \'exit 0\' returned status 0', "Status text if command returned none (OK)");
+
+# Multiple active checks
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[1]; sh -c exit\\ 1' -C '$check[0]; sh -c exit\\ 0' -C '$check[3]; sh -c exit\\ 3' -C '$check[2]; sh -c exit\\ 2'"
+ );
+cmp_ok($result->return_code, '==', 0, "Multiple checks always return OK");
+my @lines = split(/\n/, $result->output);
+cmp_ok(scalar(@lines), '==', 8, "Correct number of output lines for multiple checks");
+my %linemap = (
+ '0' => '1',
+ '2' => '0',
+ '4' => '3',
+ '6' => '2',
+);
+foreach my $line (0, 2, 4, 6) {
+ my $code = $linemap{$line};
+ my $statline = $line+1;
+ is($lines[$line], "$response[$code]", "multiple checks status text is correct for line $line");
+ is($lines[$statline], "STATUS CODE: $code", "multiple check status code is correct for line $line");
+}
+
+# Passive checks
+unlink("/tmp/check_by_ssh.$$");
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -n flint -s serv -C '$check[2]; sh -c exit\\ 2' -O /tmp/check_by_ssh.$$"
+ );
+cmp_ok($result->return_code, '==', 0, "Exit always ok on passive checks");
+open(PASV, "/tmp/check_by_ssh.$$") or die("Unable to open '/tmp/check_by_ssh.$$': $!");
+my @pasv = <PASV>;
+close(PASV) or die("Unable to close '/tmp/check_by_ssh.$$': $!");
+cmp_ok(scalar(@pasv), '==', 1, 'One passive result for one check performed');
+for (0) {
+ if ($pasv[$_]) {
+ like($pasv[$_], '/^\[\d+\] PROCESS_SERVICE_CHECK_RESULT;flint;serv;2;' . $response_re[2] . '$/', 'proper result for passive check');
+ } else {
+ fail('proper result for passive check');
+ }
+}
+unlink("/tmp/check_by_ssh.$$") or die("Unable to unlink '/tmp/check_by_ssh.$$': $!");
+undef @pasv;
+
+$result = NPTest->testCmd(
+ "./check_by_ssh -i $ssh_key -H $ssh_service -n flint -s c0:c1:c2:c3:c4 -C '$check[0];sh -c exit\\ 0' -C '$check[1];sh -c exit\\ 1' -C '$check[2];sh -c exit\\ 2' -C '$check[3];sh -c exit\\ 3' -C '$check[4];sh -c exit\\ 9' -O /tmp/check_by_ssh.$$"
+ );
+cmp_ok($result->return_code, '==', 0, "Exit always ok on passive checks");
+open(PASV, "/tmp/check_by_ssh.$$") or die("Unable to open '/tmp/check_by_ssh.$$': $!");
+@pasv = <PASV>;
+close(PASV) or die("Unable to close '/tmp/check_by_ssh.$$': $!");
+cmp_ok(scalar(@pasv), '==', 5, 'Five passive result for five checks performed');
+for (0, 1, 2, 3, 4) {
+ if ($pasv[$_]) {
+ my $ret = $_;
+ $ret = 9 if ($_ == 4);
+ like($pasv[$_], '/^\[\d+\] PROCESS_SERVICE_CHECK_RESULT;flint;c' . $_ . ';' . $ret . ';' . $response_re[$_] . '$/', "proper result for passive check $_");
+ } else {
+ fail("proper result for passive check $_");
+ }
+}
+unlink("/tmp/check_by_ssh.$$") or die("Unable to unlink '/tmp/check_by_ssh.$$': $!");
+
diff --git a/plugins/t/check_cluster.t b/plugins/t/check_cluster.t
new file mode 100644
index 0000000..4736f06
--- /dev/null
+++ b/plugins/t/check_cluster.t
@@ -0,0 +1,82 @@
+#! /usr/bin/perl -w -I ..
+#
+# check_cluster tests
+#
+#
+
+use strict;
+use Test::More tests => 15;
+use NPTest;
+
+my $result;
+
+$result = NPTest->testCmd(
+ "./check_cluster -s -w 0:0 -c 0:0 -d 0,0,0,0"
+ );
+cmp_ok( $result->return_code, '==', 0, "Exit OK if non-ok services are inside critical and warning ranges" );
+like( $result->output, qr/service/i, "Output contains the word 'service' (case insensitive)");
+
+$result = NPTest->testCmd(
+ "./check_cluster -l LABEL -s -w 0:0 -c 0:0 -d 0,0,0,0"
+ );
+like( $result->output, qr/LABEL/, "Output contains the defined label 'LABEL' (case sensitive)");
+
+$result = NPTest->testCmd(
+ "./check_cluster -s -w 0:0 -c 0:1 -d 0,0,0,1"
+ );
+cmp_ok( $result->return_code, '==', 1, "Exit WARNING if non-ok services are inside critical and outside warning ranges" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -s -w 0:0 -c 0:1 -d 0,0,1,1"
+ );
+cmp_ok( $result->return_code, '==', 2, "Exit CRITICAL if non-ok services are inside critical and outside warning ranges" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -s -w 0 -c 0 -d 0,0,0,0"
+ );
+cmp_ok( $result->return_code, '==', 0, "Exit OK if non-ok services are inside critical and warning (no ranges)" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -s -w 0 -c 1 -d 0,0,1,0"
+ );
+cmp_ok( $result->return_code, '==', 1, "Exit WARNING if number of non-ok services exceed warning (no ranges)" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -s -w 0 -c 1 -d 0,0,1,1"
+ );
+cmp_ok( $result->return_code, '==', 2, "Exit Critical if non-ok services exceed critical warning (no ranges)" );
+
+
+#
+# And for hosts..
+#
+$result = NPTest->testCmd(
+ "./check_cluster -h -w 0:0 -c 0:0 -d 0,0,0,0"
+ );
+cmp_ok( $result->return_code, '==', 0, "Exit OK if non-ok hosts are inside critical and warning ranges" );
+like( $result->output, qr/host/i, "Output contains the word 'host' (case insensitive)");
+
+$result = NPTest->testCmd(
+ "./check_cluster -h -w 0:0 -c 0:1 -d 0,0,0,1"
+ );
+cmp_ok( $result->return_code, '==', 1, "Exit WARNING if non-ok hosts are inside critical and outside warning ranges" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -h -w 0:0 -c 0:1 -d 0,0,1,1"
+ );
+cmp_ok( $result->return_code, '==', 2, "Exit CRITICAL if non-ok hosts are inside critical and outside warning ranges" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -h -w 0 -c 0 -d 0,0,0,0"
+ );
+cmp_ok( $result->return_code, '==', 0, "Exit OK if non-ok hosts are inside critical and warning (no ranges)" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -h -w 0 -c 1 -d 0,0,1,0"
+ );
+cmp_ok( $result->return_code, '==', 1, "Exit WARNING if number of non-ok hosts exceed warning (no ranges)" );
+
+$result = NPTest->testCmd(
+ "./check_cluster -h -w 0 -c 1 -d 0,0,1,1"
+ );
+cmp_ok( $result->return_code, '==', 2, "Exit Critical if non-ok hosts exceed critical warning (no ranges)" );
diff --git a/plugins/t/check_curl.t b/plugins/t/check_curl.t
new file mode 100644
index 0000000..eae98cc
--- /dev/null
+++ b/plugins/t/check_curl.t
@@ -0,0 +1,213 @@
+#! /usr/bin/perl -w -I ..
+#
+# HyperText Transfer Protocol (HTTP) Test via check_curl
+#
+#
+
+use strict;
+use Test::More;
+use POSIX qw/mktime strftime/;
+
+use vars qw($tests $has_ipv6);
+
+BEGIN {
+ use NPTest;
+ $has_ipv6 = NPTest::has_ipv6();
+ $tests = $has_ipv6 ? 59 : 57;
+ plan tests => $tests;
+}
+
+
+my $successOutput = '/OK.*HTTP.*second/';
+
+my $res;
+my $plugin = 'check_http';
+$plugin = 'check_curl' if $0 =~ m/check_curl/mx;
+
+my $host_tcp_http = getTestParameter("NP_HOST_TCP_HTTP", "A host providing the HTTP Service (a web server)", "localhost");
+my $host_tcp_http_ipv6 = getTestParameter("NP_HOST_TCP_HTTP_IPV6", "An IPv6 address providing a HTTP Service (a web server)", "::1");
+my $host_tls_http = getTestParameter("NP_HOST_TLS_HTTP", "A host providing the HTTPS Service (a tls web server)", "localhost");
+my $host_tls_cert = getTestParameter("NP_HOST_TLS_CERT", "the common name of the certificate.", "localhost");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+my $internet_access = getTestParameter("NP_INTERNET_ACCESS", "Is this system directly connected to the internet?", "yes");
+my $host_tcp_http2 = getTestParameter("NP_HOST_TCP_HTTP2", "A host providing an index page containing the string 'monitoring'", "test.monitoring-plugins.org");
+my $host_tcp_proxy = getTestParameter("NP_HOST_TCP_PROXY", "A host providing a HTTP proxy with CONNECT support", "localhost");
+my $port_tcp_proxy = getTestParameter("NP_PORT_TCP_PROXY", "Port of the proxy with HTTP and CONNECT support", "3128");
+
+my $faketime = -x '/usr/bin/faketime' ? 1 : 0;
+
+
+$res = NPTest->testCmd(
+ "./$plugin $host_tcp_http -wt 300 -ct 600"
+ );
+cmp_ok( $res->return_code, '==', 0, "Webserver $host_tcp_http responded" );
+like( $res->output, $successOutput, "Output OK" );
+
+if ($has_ipv6) {
+ # Test for IPv6 formatting
+ $res = NPTest->testCmd(
+ "./$plugin -I $host_tcp_http_ipv6 -wt 300 -ct 600"
+ );
+ cmp_ok( $res->return_code, '==', 0, "IPv6 URL formatting is working" );
+ like( $res->output, $successOutput, "Output OK" );
+}
+
+$res = NPTest->testCmd(
+ "./$plugin $host_tcp_http -wt 300 -ct 600 -v -v -v -k 'bob:there' -k 'carl:frown'"
+ );
+like( $res->output, '/bob:there\r\ncarl:frown\r\n/', "Got headers with multiple -k options" );
+
+$res = NPTest->testCmd(
+ "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3"
+ );
+cmp_ok( $res->return_code, '==', 2, "Webserver $host_nonresponsive not responding" );
+# was CRITICAL only, but both check_curl and check_http print HTTP CRITICAL (puzzle?!)
+like( $res->output, "/HTTP CRITICAL - Invalid HTTP response received from host on port 80: cURL returned 28 - Connection timed out after/", "Output OK");
+
+$res = NPTest->testCmd(
+ "./$plugin $hostname_invalid -wt 1 -ct 2"
+ );
+cmp_ok( $res->return_code, '==', 2, "Webserver $hostname_invalid not valid" );
+# The first part of the message comes from the OS catalogue, so cannot check this.
+# On Debian, it is Name or service not known, on Darwin, it is No address associated with nodename
+# Is also possible to get a socket timeout if DNS is not responding fast enough
+# cURL gives us consistent strings from it's own 'lib/strerror.c'
+like( $res->output, "/cURL returned 6 - Could not resolve host:/", "Output OK");
+
+# host header checks
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http");
+like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" );
+like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" );
+
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http -p 80");
+like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" );
+like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" );
+
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80");
+like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" );
+like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" );
+
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80");
+like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" );
+like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" );
+
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80 -k 'Host: testhost:8001'");
+like( $res->output, '/^Host: testhost:8001\s*$/ms', "Host Header OK" );
+like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" );
+
+$res = NPTest->testCmd("./$plugin -v -I $host_tcp_http -p 80 -k 'Host: testhost:8001'");
+like( $res->output, '/^Host: testhost:8001\s*$/ms', "Host Header OK" );
+like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" );
+
+SKIP: {
+ skip "No internet access", 4 if $internet_access eq "no";
+
+ $res = NPTest->testCmd("./$plugin -v -H $host_tls_http -S");
+ like( $res->output, '/^Host: '.$host_tls_http.'\s*$/ms', "Host Header OK" );
+
+ $res = NPTest->testCmd("./$plugin -v -H $host_tls_http:8080 -S -p 443");
+ like( $res->output, '/^Host: '.$host_tls_http.':8080\s*$/ms', "Host Header OK" );
+
+ $res = NPTest->testCmd("./$plugin -v -H $host_tls_http:443 -S -p 443");
+ like( $res->output, '/^Host: '.$host_tls_http.'\s*$/ms', "Host Header OK" );
+
+ $res = NPTest->testCmd("./$plugin -v -H $host_tls_http -D -S -p 443");
+ like( $res->output, '/(^Host: '.$host_tls_http.'\s*$)|(cURL returned 60)/ms', "Host Header OK" );
+};
+
+SKIP: {
+ skip "No host serving monitoring in index file", 7 unless $host_tcp_http2;
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'monitoring'" );
+ cmp_ok( $res->return_code, "==", 0, "Got a reference to 'monitoring'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'mONiTORing'" );
+ cmp_ok( $res->return_code, "==", 2, "Not got 'mONiTORing'");
+ like ( $res->output, "/pattern not found/", "Error message says 'pattern not found'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -R 'mONiTORing'" );
+ cmp_ok( $res->return_code, "==", 0, "But case insensitive doesn't mind 'mONiTORing'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'monitoring' --invert-regex" );
+ cmp_ok( $res->return_code, "==", 2, "Invert results work when found");
+ like ( $res->output, "/pattern found/", "Error message says 'pattern found'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'mONiTORing' --invert-regex" );
+ cmp_ok( $res->return_code, "==", 0, "And also when not found");
+}
+SKIP: {
+ skip "No internet access", 28 if $internet_access eq "no";
+
+ $res = NPTest->testCmd(
+ "./$plugin --ssl $host_tls_http"
+ );
+ cmp_ok( $res->return_code, '==', 0, "Can read https for $host_tls_http" );
+
+ $res = NPTest->testCmd( "./$plugin -C 1 --ssl $host_tls_http" );
+ cmp_ok( $res->return_code, '==', 0, "Checking certificate for $host_tls_http");
+ like ( $res->output, "/Certificate '$host_tls_cert' will expire on/", "Output OK" );
+ my $saved_cert_output = $res->output;
+
+ $res = NPTest->testCmd( "./$plugin -C 8000,1 --ssl $host_tls_http" );
+ cmp_ok( $res->return_code, '==', 1, "Checking certificate for $host_tls_http");
+ like ( $res->output, qr/WARNING - Certificate '$host_tls_cert' expires in \d+ day/, "Output Warning" );
+
+ $res = NPTest->testCmd( "./$plugin $host_tls_http -C 1" );
+ is( $res->return_code, 0, "Old syntax for cert checking okay" );
+ is( $res->output, $saved_cert_output, "Same output as new syntax" );
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tls_http -C 1" );
+ is( $res->return_code, 0, "Updated syntax for cert checking okay" );
+ is( $res->output, $saved_cert_output, "Same output as new syntax" );
+
+ $res = NPTest->testCmd( "./$plugin -C 1 $host_tls_http" );
+ cmp_ok( $res->output, 'eq', $saved_cert_output, "--ssl option automatically added");
+
+ $res = NPTest->testCmd( "./$plugin $host_tls_http -C 1" );
+ cmp_ok( $res->output, 'eq', $saved_cert_output, "Old syntax for cert checking still works");
+
+ # run some certificate checks with faketime
+ SKIP: {
+ skip "No faketime binary found", 12 if !$faketime;
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/OK - Certificate '$host_tls_cert' will expire on/, "Catch cert output");
+ is( $res->return_code, 0, "Catch cert output exit code" );
+ my($mon,$day,$hour,$min,$sec,$year) = ($res->output =~ /(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\d+)/);
+ if(!defined $year) {
+ die("parsing date failed from: ".$res->output);
+ }
+ my $months = {'Jan' => 0, 'Feb' => 1, 'Mar' => 2, 'Apr' => 3, 'May' => 4, 'Jun' => 5, 'Jul' => 6, 'Aug' => 7, 'Sep' => 8, 'Oct' => 9, 'Nov' => 10, 'Dec' => 11};
+ my $ts = mktime($sec, $min, $hour, $day, $months->{$mon}, $year-1900);
+ my $time = strftime("%Y-%m-%d %H:%M:%S", localtime($ts));
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' just expired/, "Output on expire date");
+ is( $res->return_code, 2, "Output on expire date" );
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts-1))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expires in 0 minutes/, "cert expires in 1 second output");
+ is( $res->return_code, 2, "cert expires in 1 second exit code" );
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts-120))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expires in 2 minutes/, "cert expires in 2 minutes output");
+ is( $res->return_code, 2, "cert expires in 2 minutes exit code" );
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts-7200))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expires in 2 hours/, "cert expires in 2 hours output");
+ is( $res->return_code, 2, "cert expires in 2 hours exit code" );
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts+1))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expired on/, "Certificate expired output");
+ is( $res->return_code, 2, "Certificate expired exit code" );
+ };
+
+ $res = NPTest->testCmd( "./$plugin --ssl $host_tls_http -E" );
+ like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
+ like ( $res->output, '/time_ssl=[\d\.]+/', 'Extended Performance Data SSL Output OK' );
+
+ $res = NPTest->testCmd( "./$plugin -H www.mozilla.com -u /firefox -f curl" );
+ is( $res->return_code, 0, "Redirection based on location is okay");
+
+ $res = NPTest->testCmd( "./$plugin -H www.mozilla.com --extended-perfdata" );
+ like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
+}
diff --git a/plugins/t/check_dbi.t b/plugins/t/check_dbi.t
new file mode 100644
index 0000000..c24b5a8
--- /dev/null
+++ b/plugins/t/check_dbi.t
@@ -0,0 +1,103 @@
+#! /usr/bin/perl -w -I ..
+#
+# Database Server Tests via check_dbi
+#
+#
+# Uses the 'sqlite3' DBD driver and command line utility.
+
+use strict;
+use Test::More;
+use NPTest;
+
+use File::Temp;
+
+use vars qw($tests);
+
+plan skip_all => "check_dbi not compiled" unless (-x "check_dbi");
+
+$tests = 20;
+plan tests => $tests;
+
+my $missing_driver_output = "failed to open DBI driver 'sqlite3'";
+
+my $bad_driver_output = "/failed to open DBI driver 'nodriver'/";
+my $conn_time_output = "/OK - connection time: [0-9\.]+s \|/";
+my $missing_query_output = "/Must specify a query to execute/";
+my $no_rows_output = "/WARNING - no rows returned/";
+my $not_numeric_output = "/CRITICAL - result value is not a numeric:/";
+my $query_time_output = "/OK - connection time: [0-9\.]+s, 'SELECT 1' returned 1.000000 in [0-9\.]+s \|/";
+my $syntax_error_output = "/CRITICAL - failed to execute query 'GET ALL FROM test': 1: near \"GET\": syntax error/";
+
+my $result;
+
+SKIP: {
+ my $sqlite3 = qx(which sqlite3 2> /dev/null);
+ chomp($sqlite3);
+
+ skip "No Sqlite3 found", $tests unless $sqlite3;
+
+ my $sqlite3_check = qx(./check_dbi -d sqlite3 -q '');
+ if ($sqlite3_check =~ m/$missing_driver_output/) {
+ skip "No 'sqlite3' DBD driver found", $tests;
+ }
+
+ my $fh = File::Temp->new(
+ TEMPLATE => "/tmp/check_dbi_sqlite3.XXXXXXX",
+ UNLINK => 1,
+ );
+ my $filename = $fh->filename;
+ $filename =~ s/^\/tmp\///;
+
+ system("$sqlite3 /tmp/$filename 'CREATE TABLE test(a INT, b TEXT)'");
+ system("$sqlite3 /tmp/$filename 'INSERT INTO test VALUES (1, \"text1\")'");
+ system("$sqlite3 /tmp/$filename 'INSERT INTO test VALUES (2, \"text2\")'");
+
+ my $check_cmd = "./check_dbi -d sqlite3 -o sqlite3_dbdir=/tmp -o dbname=$filename";
+
+ $result = NPTest->testCmd("$check_cmd -q 'SELECT 1'");
+ cmp_ok($result->return_code, '==', 0, "Sqlite3 login okay and can run query");
+
+ $result = NPTest->testCmd("$check_cmd");
+ cmp_ok($result->return_code, '==', 3, "Missing query parameter");
+ like($result->output, $missing_query_output, "Missing query parameter error message");
+
+ $result = NPTest->testCmd("$check_cmd -q 'GET ALL FROM test'");
+ cmp_ok($result->return_code, '==', 2, "Invalid query");
+ like($result->output, $syntax_error_output, "Syntax error message");
+
+ $result = NPTest->testCmd("$check_cmd -q 'SELECT 2.71828' -w 2 -c 3");
+ cmp_ok($result->return_code, '==', 1, "Got warning");
+
+ $result = NPTest->testCmd("$check_cmd -q 'SELECT 3.1415' -w 2 -c 3");
+ cmp_ok($result->return_code, '==', 2, "Got critical");
+
+ $result = NPTest->testCmd("$check_cmd -q ''");
+ cmp_ok($result->return_code, '==', 1, "No rows returned");
+ like($result->output, $no_rows_output, "Now rows returned warning message");
+
+ $result = NPTest->testCmd("$check_cmd -q 'SELECT b FROM test'");
+ cmp_ok($result->return_code, '==', 2, "Value is not a numeric");
+ like($result->output, $not_numeric_output, "Value is not a numeric error message");
+
+ $result = NPTest->testCmd("$check_cmd -m QUERY_RESULT -q 'SELECT b FROM test' -e text1");
+ cmp_ok($result->return_code, '==', 0, "Query result string comparison okay");
+
+ $result = NPTest->testCmd("$check_cmd -q 'SELECT b FROM test' -r 'eXt[0-9]'");
+ cmp_ok($result->return_code, '==', 2, "Query result case-insensitive regex failure");
+
+ $result = NPTest->testCmd("$check_cmd -q 'SELECT b FROM test' -R 'eXt[0-9]'");
+ cmp_ok($result->return_code, '==', 0, "Query result case-sensitive regex okay");
+
+ $result = NPTest->testCmd("$check_cmd -m CONN_TIME -w 0.5 -c 0.7");
+ cmp_ok($result->return_code, '==', 0, "CONN_TIME metric okay");
+ like($result->output, $conn_time_output, "CONN_TIME metric output okay");
+
+ $result = NPTest->testCmd("$check_cmd -m QUERY_TIME -q 'SELECT 1'");
+ cmp_ok($result->return_code, '==', 0, "QUERY_TIME metric okay");
+ like($result->output, $query_time_output, "QUERY_TIME metric output okay");
+
+ $result = NPTest->testCmd("./check_dbi -d nodriver -q ''");
+ cmp_ok($result->return_code, '==', 3, "Unknown DBI driver");
+ like($result->output, $bad_driver_output, "Correct error message");
+}
+
diff --git a/plugins/t/check_dig.t b/plugins/t/check_dig.t
new file mode 100644
index 0000000..3ed6cc8
--- /dev/null
+++ b/plugins/t/check_dig.t
@@ -0,0 +1,98 @@
+#! /usr/bin/perl -w -I ..
+#
+# Domain Name Server (DNS) Tests via check_dig
+#
+#
+
+use strict;
+use Test::More;
+
+
+use vars qw($tests $has_ipv6);
+BEGIN {
+ plan skip_all => "check_dig not compiled" unless (-x "check_dig");
+ use NPTest;
+ $has_ipv6 = NPTest::has_ipv6();
+ $tests = $has_ipv6 ? 16 : 14;
+ plan tests => $tests;
+}
+
+my $successOutput = '/DNS OK - [\.0-9]+ seconds? response time/';
+
+my $hostname_valid = getTestParameter(
+ "NP_HOSTNAME_VALID",
+ "A valid (known to DNS) hostname",
+ "orwell.monitoring-plugins.org"
+ );
+
+my $hostname_valid_ip = getTestParameter(
+ "NP_HOSTNAME_VALID_IP",
+ "The IP address of the valid hostname $hostname_valid",
+ "130.133.8.40",
+ );
+
+my $hostname_valid_reverse = getTestParameter(
+ "NP_HOSTNAME_VALID_REVERSE",
+ "The hostname of $hostname_valid_ip",
+ "orwell.monitoring-plugins.org.",
+ );
+
+my $hostname_invalid = getTestParameter(
+ "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost.monitoring-plugins.org",
+ );
+
+my $dns_server = getTestParameter(
+ "NP_DNS_SERVER",
+ "A non default (remote) DNS server",
+ );
+
+my $res;
+
+SKIP: {
+ skip "check_dig.t: not enough parameters given",
+ 12 unless ($hostname_valid && $hostname_valid_ip && $hostname_valid_reverse && $hostname_invalid && $dns_server);
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5");
+ cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid");
+ like ( $res->output, $successOutput, "Output OK" );
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5 -w 0.000001 -c 0.00001");
+ cmp_ok( $res->return_code, '==', 2, "Critical threshold passed");
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5 -w 0.000001 -c 5");
+ cmp_ok( $res->return_code, '==', 1, "Warning threshold passed");
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -t 1");
+ cmp_ok( $res->return_code, '==', 3, "Invalid command line -l missing");
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_invalid -t 1");
+ cmp_ok( $res->return_code, '==', 2, "Invalid $hostname_invalid");
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5");
+ cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server");
+ like ( $res->output, $successOutput, "Output OK" );
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5 -4");
+ cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server");
+ like ( $res->output, $successOutput, "Output OK for IPv4" );
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -a $hostname_valid_ip -t 5");
+ cmp_ok( $res->return_code, '==', 0, "Got expected address");
+
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -a 10.10.10.10 -t 5");
+ cmp_ok( $res->return_code, '==', 1, "Got wrong address");
+
+ my $ip_reverse = $hostname_valid_ip;
+ $ip_reverse =~ s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$4.$3.$2.$1.in-addr.arpa/;
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $ip_reverse -a $hostname_valid_reverse -T PTR -t 5");
+ cmp_ok( $res->return_code, '==', 0, "Got expected fqdn");
+ like ( $res->output, $successOutput, "Output OK");
+
+ if($has_ipv6) {
+ $res = NPTest->testCmd("./check_dig -H $dns_server -l $hostname_valid -t 5 -6");
+ cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server");
+ like ( $res->output, $successOutput, "Output OK for IPv6" );
+ }
+}
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t
new file mode 100644
index 0000000..ca035ce
--- /dev/null
+++ b/plugins/t/check_disk.t
@@ -0,0 +1,378 @@
+#! /usr/bin/perl -w -I ..
+#
+# Disk Space Tests via check_disk
+#
+#
+
+# TODO: Add in tests for perf data. Need to beef up Monitoring::Plugin::Performance to cater for max, min, etc
+
+use strict;
+use Test::More;
+use NPTest;
+use POSIX qw(ceil floor);
+
+my $successOutput = '/^DISK OK/';
+my $failureOutput = '/^DISK CRITICAL/';
+my $warningOutput = '/^DISK WARNING/';
+
+my $result;
+
+my $mountpoint_valid = getTestParameter( "NP_MOUNTPOINT_VALID", "Path to valid mountpoint", "/");
+my $mountpoint2_valid = getTestParameter( "NP_MOUNTPOINT2_VALID", "Path to another valid mountpoint. Must be different from 1st one", "/var");
+
+if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") {
+ plan skip_all => "Need 2 mountpoints to test";
+} else {
+ plan tests => 88;
+}
+
+$result = NPTest->testCmd(
+ "./check_disk -w 1% -c 1% -p $mountpoint_valid -w 1% -c 1% -p $mountpoint2_valid"
+ );
+cmp_ok( $result->return_code, "==", 0, "Checking two mountpoints (must have at least 1% free in space and inodes)");
+my $c = 0;
+$_ = $result->output;
+$c++ while /\(/g; # counts number of "(" - should be two
+cmp_ok( $c, '==', 2, "Got two mountpoints in output");
+
+
+# Get perf data
+# Should use Monitoring::Plugin
+my @perf_data = sort(split(/ /, $result->perf_output));
+
+
+# Calculate avg_free free on mountpoint1 and mountpoint2
+# because if you check in the middle, you should get different errors
+$_ = $result->output;
+my ($free_on_mp1, $free_on_mp2) = (m/\((\d+)%.*\((\d+)%/);
+die "Cannot parse output: $_" unless ($free_on_mp1 && $free_on_mp2);
+my $avg_free = ceil(($free_on_mp1+$free_on_mp2)/2);
+my ($more_free, $less_free);
+if ($free_on_mp1 > $free_on_mp2) {
+ $more_free = $mountpoint_valid;
+ $less_free = $mountpoint2_valid;
+} elsif ($free_on_mp1 < $free_on_mp2) {
+ $more_free = $mountpoint2_valid;
+ $less_free = $mountpoint_valid;
+} else {
+ die "Two mountpoints are the same - cannot do rest of test";
+}
+if($free_on_mp1 == $avg_free || $free_on_mp2 == $avg_free) {
+ die "One mountpoints has average space free - cannot do rest of test";
+}
+
+
+# Do same for inodes
+$_ = $result->output;
+my ($free_inode_on_mp1, $free_inode_on_mp2) = (m/inode=(\d+)%.*inode=(\d+)%/);
+die "Cannot parse free inodes: $_" unless ($free_inode_on_mp1 && $free_inode_on_mp2);
+my $avg_inode_free = ceil(($free_inode_on_mp1 + $free_inode_on_mp2)/2);
+my ($more_inode_free, $less_inode_free);
+if ($free_inode_on_mp1 > $free_inode_on_mp2) {
+ $more_inode_free = $mountpoint_valid;
+ $less_inode_free = $mountpoint2_valid;
+} elsif ($free_inode_on_mp1 < $free_inode_on_mp2) {
+ $more_inode_free = $mountpoint2_valid;
+ $less_inode_free = $mountpoint_valid;
+} else {
+ die "Two mountpoints with same inodes free - cannot do rest of test";
+}
+if($free_inode_on_mp1 == $avg_inode_free || $free_inode_on_mp2 == $avg_inode_free) {
+ die "One mountpoints has average inodes free - cannot do rest of test";
+}
+
+# Verify performance data
+# First check absolute thresholds...
+$result = NPTest->testCmd(
+ "./check_disk -w 20 -c 10 -p $mountpoint_valid"
+ );
+$_ = $result->perf_output;
+my ($warn_absth_data, $crit_absth_data, $total_absth_data) = (m/=.[^;]*;(\d+);(\d+);\d+;(\d+)/);
+# default unit is MiB, but perfdata is always bytes
+is ($warn_absth_data, $total_absth_data - (20 * (2 ** 20)), "Wrong warning in perf data using absolute thresholds");
+is ($crit_absth_data, $total_absth_data - (10 * (2 ** 20)), "Wrong critical in perf data using absolute thresholds");
+
+# Then check percent thresholds.
+$result = NPTest->testCmd(
+ "./check_disk -w 20% -c 10% -p $mountpoint_valid"
+ );
+$_ = $result->perf_output;
+my ($warn_percth_data, $crit_percth_data, $total_percth_data) = (m/=.[^;]*;(\d+);(\d+);\d+;(\d+)/);
+is ($warn_percth_data, int((1-20/100)*$total_percth_data), "Wrong warning in perf data using percent thresholds");
+is ($crit_percth_data, int((1-10/100)*$total_percth_data), "Wrong critical in perf data using percent thresholds");
+
+
+# Check when order of mount points are reversed, that perf data remains same
+$result = NPTest->testCmd(
+ "./check_disk -w 1% -c 1% -p $mountpoint2_valid -w 1% -c 1% -p $mountpoint_valid"
+ );
+@_ = sort(split(/ /, $result->perf_output));
+is_deeply( \@perf_data, \@_, "perf data for both filesystems same when reversed");
+
+
+# Basic filesystem checks for sizes
+$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free" );
+cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free");
+like ( $result->output, $successOutput, "OK output" );
+like ( $result->only_output, qr/free space/, "Have free space text");
+like ( $result->only_output, qr/$more_free/, "Have disk name in text");
+
+$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free -p $less_free" );
+cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free and $less_free");
+$_ = $result->output;
+my ($free_mb_on_mp1, $free_mb_on_mp2) = (m/(\d+)MiB .* (\d+)MiB /g);
+my $free_mb_on_all = $free_mb_on_mp1 + $free_mb_on_mp2;
+
+
+
+$result = NPTest->testCmd( "./check_disk -e -w 1 -c 1 -p $more_free" );
+is( $result->only_output, "DISK OK", "No print out of disks with -e for OKs");
+
+$result = NPTest->testCmd( "./check_disk 100 100 $more_free" );
+cmp_ok( $result->return_code, '==', 0, "Old syntax okay" );
+
+$result = NPTest->testCmd( "./check_disk -w 1% -c 1% -p $more_free" );
+cmp_ok( $result->return_code, "==", 0, "At least 1% free" );
+
+$result = NPTest->testCmd(
+ "./check_disk -w 1% -c 1% -p $more_free -w 100% -c 100% -p $less_free"
+ );
+cmp_ok( $result->return_code, "==", 2, "Get critical on less_free mountpoint $less_free" );
+like( $result->output, $failureOutput, "Right output" );
+
+
+$result = NPTest->testCmd(
+ "./check_disk -w $avg_free% -c 0% -p $less_free"
+ );
+cmp_ok( $result->return_code, '==', 1, "Get warning on less_free mountpoint, when checking avg_free");
+
+$result = NPTest->testCmd(
+ "./check_disk -w $avg_free% -c $avg_free% -p $more_free"
+ );
+cmp_ok( $result->return_code, '==', 0, "Get ok on more_free mountpoint, when checking avg_free");
+
+$result = NPTest->testCmd(
+ "./check_disk -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
+ );
+cmp_ok( $result->return_code, "==", 1, "Combining above two tests, get warning");
+my $all_disks = $result->output;
+
+$result = NPTest->testCmd(
+ "./check_disk -e -w $avg_free% -c 0% -p $less_free -w $avg_free% -c $avg_free% -p $more_free"
+ );
+isnt( $result->output, $all_disks, "-e gives different output");
+
+# Need spaces around filesystem name in case less_free and more_free are nested
+like( $result->output, qr/ $less_free /, "Found problem $less_free");
+unlike( $result->only_output, qr/ $more_free /, "Has ignored $more_free as not a problem");
+like( $result->perf_output, qr/ $more_free=/, "But $more_free is still in perf data");
+
+$result = NPTest->testCmd(
+ "./check_disk -w $avg_free% -c 0% -p $more_free"
+ );
+cmp_ok( $result->return_code, '==', 0, "Get ok on more_free mountpoint, checking avg_free");
+
+$result = NPTest->testCmd(
+ "./check_disk -w $avg_free% -c $avg_free% -p $less_free"
+ );
+cmp_ok( $result->return_code, '==', 2, "Get critical on less_free, checking avg_free");
+$result = NPTest->testCmd(
+ "./check_disk -w $avg_free% -c 0% -p $more_free -w $avg_free% -c $avg_free% -p $less_free"
+ );
+cmp_ok( $result->return_code, '==', 2, "Combining above two tests, get critical");
+
+$result = NPTest->testCmd(
+ "./check_disk -w $avg_free% -c $avg_free% -p $less_free -w $avg_free% -c 0% -p $more_free"
+ );
+cmp_ok( $result->return_code, '==', 2, "And reversing arguments should not make a difference");
+
+
+
+# Basic inode checks for sizes
+
+$result = NPTest->testCmd( "./check_disk --icritical 1% --iwarning 1% -p $more_inode_free" );
+is( $result->return_code, 0, "At least 1% free on inodes for both mountpoints");
+
+$result = NPTest->testCmd( "./check_disk -K 100% -W 100% -p $less_inode_free" );
+is( $result->return_code, 2, "Critical requesting 100% free inodes for both mountpoints");
+
+$result = NPTest->testCmd( "./check_disk --iwarning 1% --icritical 1% -p $more_inode_free -K 100% -W 100% -p $less_inode_free" );
+is( $result->return_code, 2, "Get critical on less_inode_free mountpoint $less_inode_free");
+
+$result = NPTest->testCmd( "./check_disk -W $avg_inode_free% -K 0% -p $less_inode_free" );
+is( $result->return_code, 1, "Get warning on less_inode_free, when checking average");
+
+$result = NPTest->testCmd( "./check_disk -W $avg_inode_free% -K $avg_inode_free% -p $more_inode_free ");
+is( $result->return_code, 0, "Get ok on more_inode_free when checking average");
+
+$result = NPTest->testCmd( "./check_disk -W $avg_inode_free% -K 0% -p $less_inode_free -W $avg_inode_free% -K $avg_inode_free% -p $more_inode_free" );
+is ($result->return_code, 1, "Combine above two tests, get warning");
+$all_disks = $result->output;
+
+$result = NPTest->testCmd( "./check_disk -e -W $avg_inode_free% -K 0% -p $less_inode_free -W $avg_inode_free% -K $avg_inode_free% -p $more_inode_free" );
+isnt( $result->output, $all_disks, "-e gives different output");
+like( $result->output, qr/$less_inode_free/, "Found problem $less_inode_free");
+unlike( $result->only_output, qr/$more_inode_free\s/, "Has ignored $more_inode_free as not a problem");
+like( $result->perf_output, qr/$more_inode_free/, "But $more_inode_free is still in perf data");
+
+$result = NPTest->testCmd( "./check_disk -W $avg_inode_free% -K 0% -p $more_inode_free" );
+is( $result->return_code, 0, "Get ok on more_inode_free mountpoint, checking average");
+
+$result = NPTest->testCmd( "./check_disk -W $avg_inode_free% -K $avg_inode_free% -p $less_inode_free" );
+is( $result->return_code, 2, "Get critical on less_inode_free, checking average");
+
+$result = NPTest->testCmd( "./check_disk -W $avg_inode_free% -K 0% -p $more_inode_free -W $avg_inode_free% -K $avg_inode_free% -p $less_inode_free" );
+is( $result->return_code, 2, "Combining above two tests, get critical");
+
+$result = NPTest->testCmd( "./check_disk -W $avg_inode_free% -K $avg_inode_free% -p $less_inode_free -W $avg_inode_free% -K 0% -p $more_inode_free" );
+cmp_ok( $result->return_code, '==', 2, "And reversing arguments should not make a difference");
+
+
+
+
+
+
+TODO: {
+ local $TODO = "Invalid percent figures";
+ $result = NPTest->testCmd(
+ "./check_disk -w 10% -c 15% -p $mountpoint_valid"
+ );
+ cmp_ok( $result->return_code, '==', 3, "Invalid command line options" );
+}
+
+$result = NPTest->testCmd(
+ "./check_disk -p $mountpoint_valid -w 10% -c 15%"
+ );
+cmp_ok( $result->return_code, "==", 3, "Invalid options: -p must come after thresholds" );
+
+$result = NPTest->testCmd( "./check_disk -w 100% -c 100% ".${mountpoint_valid} ); # 100% empty
+cmp_ok( $result->return_code, "==", 2, "100% empty" );
+like( $result->output, $failureOutput, "Right output" );
+
+$result = NPTest->testCmd( "./check_disk -w 100000000 -c 100000000 $mountpoint_valid" );
+cmp_ok( $result->return_code, '==', 2, "Check for 100TB free" );
+
+$result = NPTest->testCmd( "./check_disk -w 100 -c 100 -u TB ".${mountpoint_valid} ); # 100 TB empty
+cmp_ok( $result->return_code, "==", 2, "100 TB empty" );
+
+
+# Checking old syntax of check_disk warn crit [fs], with warn/crit at USED% thresholds
+$result = NPTest->testCmd( "./check_disk 0 0 ".${mountpoint_valid} );
+cmp_ok( $result->return_code, "==", 2, "Old syntax: 0% used");
+like ( $result->only_output, qr(^[^;]*;[^;]*$), "Select only one path with positional arguments");
+
+$result = NPTest->testCmd( "./check_disk 100 100 $mountpoint_valid" );
+cmp_ok( $result->return_code, '==', 0, "Old syntax: 100% used" );
+
+$result = NPTest->testCmd( "./check_disk 0 100 $mountpoint_valid" );
+cmp_ok( $result->return_code, '==', 1, "Old syntax: warn 0% used" );
+
+TODO: {
+ local $TODO = "Invalid values";
+ $result = NPTest->testCmd( "./check_disk 0 200 $mountpoint_valid" );
+ cmp_ok( $result->return_code, '==', 3, "Old syntax: Error with values outside percent range" );
+
+ $result = NPTest->testCmd( "./check_disk 200 200 $mountpoint_valid" );
+ cmp_ok( $result->return_code, '==', 3, "Old syntax: Error with values outside percent range" );
+
+ $result = NPTest->testCmd( "./check_disk 200 0 $mountpoint_valid" );
+ cmp_ok( $result->return_code, '==', 3, "Old syntax: Error with values outside percent range" );
+}
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /bob" );
+cmp_ok( $result->return_code, '==', 2, "Checking /bob - return error because /bob does not exist" );
+like( $result->output, '/^DISK CRITICAL - /bob is not accessible:.*$/', 'Output OK');
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /" );
+my $root_output = $result->output;
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /etc" );
+cmp_ok( $result->return_code, '==', 0, "Checking /etc - should return info for /" );
+cmp_ok( $result->output, 'eq', $root_output, "check_disk /etc gives same as check_disk /");
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -E -p /etc " );
+cmp_ok( $result->return_code, '==', 2, "... unless -E/--exact-match is specified");
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p /etc -E " );
+cmp_ok( $result->return_code, '==', 3, "-E/--exact-match must be specified before -p");
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -r /etc -E " );
+cmp_ok( $result->return_code, '==', 3, "-E/--exact-match must be specified before -r");
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /bob" );
+cmp_ok( $result->return_code, '==', 2, "Checking / and /bob gives critical");
+unlike( $result->perf_output, '/\/bob/', "perf data does not have /bob in it");
+
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p / -p /" );
+unlike( $result->output, '/ \/ .* \/ /', "Should not show same filesystem twice");
+
+# are partitions added if -C is given without path selection -p ?
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -C -w 0% -c 0% -p $mountpoint_valid" );
+like( $result->output, '/;.*;\|/', "-C selects partitions if -p is not given");
+
+# grouping: exit crit if the sum of free megs on mp1+mp2 is less than warn/crit
+$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all + 1) ." -c ". ($free_mb_on_all + 1) ."-g group -p $mountpoint_valid -p $mountpoint2_valid" );
+cmp_ok( $result->return_code, '==', 2, "grouping: exit crit if the sum of free megs on mp1+mp2 is less than warn/crit");
+
+# grouping: exit warning if the sum of free megs on mp1+mp2 is between -w and -c
+$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all + 1) ." -c ". ($free_mb_on_all - 1) ." -g group -p $mountpoint_valid -p $mountpoint2_valid" );
+cmp_ok( $result->return_code, '==', 1, "grouping: exit warning if the sum of free megs on mp1+mp2 is between -w and -c ");
+
+# grouping: exit ok if the sum of free megs on mp1+mp2 is more than warn/crit
+$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all - 1) ." -c ". ($free_mb_on_all - 1) ." -g group -p $mountpoint_valid -p $mountpoint2_valid" );
+cmp_ok( $result->return_code, '==', 0, "grouping: exit ok if the sum of free megs on mp1+mp2 is more than warn/crit");
+
+# grouping: exit unknown if group name is given after -p
+$result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all - 1) ." -c ". ($free_mb_on_all - 1) ." -p $mountpoint_valid -g group -p $mountpoint2_valid" );
+cmp_ok( $result->return_code, '==', 3, "Invalid options: -p must come after groupname");
+
+# regex: exit unknown if given regex is not compilable
+$result = NPTest->testCmd( "./check_disk -w 1 -c 1 -r '('" );
+cmp_ok( $result->return_code, '==', 3, "Exit UNKNOWN if regex is not compilable");
+
+# ignore: exit unknown, if all paths are deselected using -i
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '$mountpoint_valid' -i '$mountpoint2_valid'" );
+cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case sensitive)");
+
+# ignore: exit unknown, if all paths are deselected using -I
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -I '".uc($mountpoint_valid)."' -I '".uc($mountpoint2_valid)."'" );
+cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case insensitive)");
+
+# ignore: exit unknown, if all paths are deselected using -i
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '.*'" );
+cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored using -i '.*'");
+
+# ignore: test if ignored path is actually ignored
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '^$mountpoint2_valid\$'");
+like( $result->output, qr/$mountpoint_valid/, "output data does have $mountpoint_valid in it");
+unlike( $result->output, qr/$mountpoint2_valid/, "output data does not have $mountpoint2_valid in it");
+
+# ignore: test if all paths are listed when ignore regex doesn't match
+$result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '^barbazJodsf\$'");
+like( $result->output, qr/$mountpoint_valid/, "ignore: output data does have $mountpoint_valid when regex doesn't match");
+like( $result->output, qr/$mountpoint2_valid/,"ignore: output data does have $mountpoint2_valid when regex doesn't match");
+
+# ignore-missing: exit okay, when fs is not accessible
+$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -p /bob");
+cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for not existing filesystem /bob");
+like( $result->output, '/^DISK OK - No disks were found for provided parameters; - ignored paths: /bob;.*$/', 'Output OK');
+
+# ignore-missing: exit okay, when regex does not match
+$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -r /bob");
+cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
+like( $result->output, '/^DISK OK - No disks were found for provided parameters;.*$/', 'Output OK');
+
+# ignore-missing: exit okay, when fs with exact match (-E) is not found
+$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -E -p /etc");
+cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay when exact match does not find fs");
+like( $result->output, '/^DISK OK - No disks were found for provided parameters; - ignored paths: /etc;.*$/', 'Output OK');
+
+# ignore-missing: exit okay, when checking one existing fs and one non-existing fs (regex)
+$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -r '/bob' -r '^/\$'");
+cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
+like( $result->output, '/^DISK OK - free space: \/ .*$/', 'Output OK');
+
+# ignore-missing: exit okay, when checking one existing fs and one non-existing fs (path)
+$result = NPTest->testCmd( "./check_disk --ignore-missing -w 0% -c 0% -p '/bob' -p '/'");
+cmp_ok( $result->return_code, '==', 0, "ignore-missing: return okay for regular expression not matching");
+like( $result->output, '/^DISK OK - free space: / .*; - ignored paths: /bob;.*$/', 'Output OK'); \ No newline at end of file
diff --git a/plugins/t/check_dns.t b/plugins/t/check_dns.t
new file mode 100644
index 0000000..afb2062
--- /dev/null
+++ b/plugins/t/check_dns.t
@@ -0,0 +1,115 @@
+#! /usr/bin/perl -w -I ..
+#
+# Domain Name Server (DNS) Tests via check_dns
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+plan skip_all => "check_dns not compiled" unless (-x "check_dns");
+
+plan tests => 23;
+
+my $successOutput = '/DNS OK: [\.0-9]+ seconds? response time/';
+
+my $hostname_valid = getTestParameter(
+ "NP_HOSTNAME_VALID",
+ "A valid (known to DNS) hostname",
+ "monitoring-plugins.org",
+ );
+
+my $hostname_valid_ip = getTestParameter(
+ "NP_HOSTNAME_VALID_IP",
+ "The IP address of the valid hostname $hostname_valid",
+ "130.133.8.40",
+ );
+
+my $hostname_valid_cidr = getTestParameter(
+ "NP_HOSTNAME_VALID_CIDR",
+ "An valid CIDR range containing $hostname_valid_ip",
+ "130.133.8.41/30",
+ );
+
+my $hostname_invalid_cidr = getTestParameter(
+ "NP_HOSTNAME_INVALID_CIDR",
+ "An (valid) CIDR range NOT containing $hostname_valid_ip",
+ "130.133.8.39/30",
+ );
+
+my $hostname_valid_reverse = getTestParameter(
+ "NP_HOSTNAME_VALID_REVERSE",
+ "The hostname of $hostname_valid_ip",
+ "orwell.monitoring-plugins.org.",
+ );
+
+my $hostname_invalid = getTestParameter(
+ "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost.altinity.com",
+ );
+
+my $dns_server = getTestParameter(
+ "NP_DNS_SERVER",
+ "A non default (remote) DNS server",
+ );
+
+my $host_nonresponsive = getTestParameter(
+ "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests",
+ "10.0.0.1",
+ );
+
+my $res;
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5");
+cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid");
+like ( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5 -w 0 -c 0");
+cmp_ok( $res->return_code, '==', 2, "Critical threshold passed");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5 -w 0 -c 5");
+cmp_ok( $res->return_code, '==', 1, "Warning threshold passed");
+like( $res->output, '/\|time=[\d\.]+s;0.0*;5\.0*;0\.0*/', "Output performance data OK" );
+
+$res = NPTest->testCmd("./check_dns -H $hostname_invalid -t 1");
+cmp_ok( $res->return_code, '==', 2, "Invalid $hostname_invalid");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -s $dns_server -t 5");
+cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid on $dns_server");
+like ( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd("./check_dns -H $hostname_invalid -s $dns_server -t 1");
+cmp_ok( $res->return_code, '==', 2, "Invalid $hostname_invalid on $dns_server");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -a $hostname_valid_ip -s $host_nonresponsive -t 2");
+cmp_ok( $res->return_code, '==', 2, "Got no answer from unresponsive server");
+like ( $res->output, "/CRITICAL - /", "Output OK");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -a $hostname_valid_ip -t 5");
+cmp_ok( $res->return_code, '==', 0, "Got expected address");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -a 10.10.10.10 -t 5");
+cmp_ok( $res->return_code, '==', 2, "Got wrong address");
+like ( $res->output, "/^DNS CRITICAL.*expected '10.10.10.10' but got '$hostname_valid_ip'".'$/', "Output OK");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid_ip -a $hostname_valid_reverse -t 5");
+cmp_ok( $res->return_code, '==', 0, "Got expected fqdn");
+like ( $res->output, $successOutput, "Output OK");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -a $hostname_valid_cidr -t 5");
+cmp_ok( $res->return_code, '==', 0, "Got expected address");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -a $hostname_invalid_cidr -t 5");
+cmp_ok( $res->return_code, '==', 2, "Got wrong address");
+like ( $res->output, "/^DNS CRITICAL.*expected '$hostname_invalid_cidr' but got '$hostname_valid_ip'".'$/', "Output OK");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_valid -n");
+cmp_ok( $res->return_code, '==', 2, "Found $hostname_valid");
+like ( $res->output, "/^DNS CRITICAL.*Domain '$hostname_valid' was found by the server:/", "Output OK");
+
+$res = NPTest->testCmd("./check_dns -H $hostname_invalid -n");
+cmp_ok( $res->return_code, '==', 0, "Did not find $hostname_invalid");
+like ( $res->output, $successOutput, "Output OK" );
diff --git a/plugins/t/check_dummy.t b/plugins/t/check_dummy.t
new file mode 100644
index 0000000..15fc157
--- /dev/null
+++ b/plugins/t/check_dummy.t
@@ -0,0 +1,54 @@
+#! /usr/bin/perl -w -I ..
+#
+# check_dummy tests
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+plan tests => 20;
+
+my $res;
+
+$res = NPTest->testCmd("./check_dummy");
+is( $res->return_code, 3, "No args" );
+like( $res->output, "/Could not parse arguments/", "Correct usage message");
+
+$res = NPTest->testCmd("./check_dummy 0");
+is( $res->return_code, 0, "OK state returned");
+is( $res->output, "OK", "Says 'OK'");
+
+$res = NPTest->testCmd("./check_dummy 0 'some random data'");
+is( $res->return_code, 0, "Still OK");
+is( $res->output, "OK: some random data", "Sample text okay");
+
+$res = NPTest->testCmd("./check_dummy 1");
+is( $res->return_code, 1, "Warning okay");
+is( $res->output, "WARNING", "Says 'WARNING'");
+
+$res = NPTest->testCmd("./check_dummy 1 'more stuff'");
+is( $res->return_code, 1, "Still warning");
+is( $res->output, "WARNING: more stuff", "optional text okay" );
+
+$res = NPTest->testCmd("./check_dummy 2");
+is( $res->return_code, 2, "Critical ok" );
+is( $res->output, "CRITICAL", "Says 'CRITICAL'");
+
+$res = NPTest->testCmd("./check_dummy 2 'roughly drafted'");
+is( $res->return_code, 2, "Still critical");
+is( $res->output, "CRITICAL: roughly drafted", "optional text okay" );
+
+$res = NPTest->testCmd("./check_dummy 3");
+is( $res->return_code, 3, "Unknown ok" );
+is( $res->output, "UNKNOWN", "Says 'UNKNOWN'");
+
+$res = NPTest->testCmd("./check_dummy 3 'daringfireball'");
+is( $res->return_code, 3, "Still unknown");
+is( $res->output, "UNKNOWN: daringfireball", "optional text okay" );
+
+$res = NPTest->testCmd("./check_dummy 4");
+is( $res->return_code, 3, "Invalid error code" );
+is( $res->output, "UNKNOWN: Status 4 is not a supported error state", "With appropriate error message");
+
diff --git a/plugins/t/check_fping.t b/plugins/t/check_fping.t
new file mode 100644
index 0000000..67b357b
--- /dev/null
+++ b/plugins/t/check_fping.t
@@ -0,0 +1,34 @@
+#! /usr/bin/perl -w -I ..
+#
+# FPing Tests via check_fping
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $host_responsive = getTestParameter("NP_HOST_RESPONSIVE", "The hostname of system responsive to network requests", "localhost");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+
+my $res;
+
+my $fping = qx(which fping 2> /dev/null);
+chomp($fping);
+if( ! -x "./check_fping") {
+ plan skip_all => "check_fping not found, skipping tests";
+}
+elsif ( !$fping || !-x $fping ) {
+ plan skip_all => "fping not found or cannot be executed, skipping tests";
+} else {
+ plan tests => 3;
+ $res = NPTest->testCmd( "./check_fping $host_responsive" );
+ cmp_ok( $res->return_code, '==', 0, "Responsive host returns OK");
+
+ $res = NPTest->testCmd( "./check_fping $host_nonresponsive" );
+ cmp_ok( $res->return_code, '==', 2, "Non-Responsive host returns Critical");
+
+ $res = NPTest->testCmd( "./check_fping $hostname_invalid" );
+ cmp_ok( $res->return_code, '==', 3, "Invalid host returns Unknown");
+}
diff --git a/plugins/t/check_ftp.t b/plugins/t/check_ftp.t
new file mode 100644
index 0000000..93a7d7c
--- /dev/null
+++ b/plugins/t/check_ftp.t
@@ -0,0 +1,28 @@
+#! /usr/bin/perl -w -I ..
+#
+# File Transfer Protocol (FTP) Test via check_ftp
+#
+#
+
+use strict;
+use Test;
+use NPTest;
+
+use vars qw($tests);
+BEGIN {$tests = 4; plan tests => $tests}
+
+my $host_tcp_ftp = getTestParameter("NP_HOST_TCP_FTP", "A host providing the FTP Service (an FTP server)", "localhost");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+
+my $successOutput = '/FTP OK -\s+[0-9]?\.?[0-9]+ second response time/';
+
+my $t;
+
+$t += checkCmd( "./check_ftp $host_tcp_ftp -wt 300 -ct 600", 0, $successOutput );
+$t += checkCmd( "./check_ftp $host_nonresponsive -wt 0 -ct 0 -to 1", 2 );
+$t += checkCmd( "./check_ftp $hostname_invalid -wt 0 -ct 0", 2 );
+
+exit(0) if defined($Test::Harness::VERSION);
+exit($tests - $t);
+
diff --git a/plugins/t/check_hpjd.t b/plugins/t/check_hpjd.t
new file mode 100644
index 0000000..4d64852
--- /dev/null
+++ b/plugins/t/check_hpjd.t
@@ -0,0 +1,71 @@
+#! /usr/bin/perl -w -I ..
+#
+# HP JetDirect Test via check_hpjd
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+plan skip_all => "check_hpjd not compiled" unless (-x "check_hpjd");
+
+
+my $successOutput = '/^Printer ok - /';
+my $failureOutput = '/Timeout: No [Rr]esponse from /';
+
+my $host_tcp_hpjd = getTestParameter(
+ "NP_HOST_TCP_HPJD",
+ "A host (usually a printer) providing the HP-JetDirect Services"
+ );
+
+my $host_hpjd_port_invalid = getTestParameter(
+ "NP_HOST_HPJD_PORT_INVALID",
+ "A port that HP-JetDirect Services is not listening on",
+ "162"
+ );
+
+my $host_hpjd_port_valid = getTestParameter(
+ "NP_HOST_HPJD_PORT_VALID",
+ "The port that HP-JetDirect Services is currently listening on",
+ "161"
+ );
+
+my $host_nonresponsive = getTestParameter(
+ "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests",
+ "10.0.0.1"
+ );
+
+my $hostname_invalid = getTestParameter(
+ "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost"
+ );
+
+my $tests = $host_tcp_hpjd ? 9 : 5;
+plan tests => $tests;
+my $res;
+
+SKIP: {
+ skip "No HP JetDirect defined", 2 unless $host_tcp_hpjd;
+ $res = NPTest->testCmd("./check_hpjd -H $host_tcp_hpjd");
+ cmp_ok( $res->return_code, 'eq', 0, "Jetdirect responding" );
+ like ( $res->output, $successOutput, "Output correct" );
+
+ $res = NPTest->testCmd("./check_hpjd -H $host_tcp_hpjd -p $host_hpjd_port_valid");
+ cmp_ok( $res->return_code, 'eq', 0, "Jetdirect responding on port $host_hpjd_port_valid" );
+ like ( $res->output, $successOutput, "Output correct" );
+
+ $res = NPTest->testCmd("./check_hpjd -H $host_tcp_hpjd -p $host_hpjd_port_invalid");
+ cmp_ok( $res->return_code, 'eq', 2, "Jetdirect not responding on port $host_hpjd_port_invalid" );
+ like ( $res->output, $failureOutput, "Output correct" );
+}
+
+$res = NPTest->testCmd("./check_hpjd -H $host_nonresponsive");
+cmp_ok( $res->return_code, 'eq', 2, "Host not responding");
+like ( $res->output, $failureOutput, "Output OK" );
+
+$res = NPTest->testCmd("./check_hpjd -H $hostname_invalid");
+cmp_ok( $res->return_code, 'eq', 3, "Hostname invalid");
+
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
new file mode 100644
index 0000000..1f2fbdf
--- /dev/null
+++ b/plugins/t/check_http.t
@@ -0,0 +1,190 @@
+#! /usr/bin/perl -w -I ..
+#
+# HyperText Transfer Protocol (HTTP) Test via check_http
+#
+#
+
+use strict;
+use Test::More;
+use POSIX qw/mktime strftime/;
+use NPTest;
+
+plan tests => 49;
+
+my $successOutput = '/OK.*HTTP.*second/';
+
+my $res;
+my $plugin = 'check_http';
+$plugin = 'check_curl' if $0 =~ m/check_curl/mx;
+
+my $host_tcp_http = getTestParameter("NP_HOST_TCP_HTTP", "A host providing the HTTP Service (a web server)", "localhost");
+my $host_tls_http = getTestParameter("NP_HOST_TLS_HTTP", "A host providing the HTTPS Service (a tls web server)", "localhost");
+my $host_tls_cert = getTestParameter("NP_HOST_TLS_CERT", "the common name of the certificate.", "localhost");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+my $internet_access = getTestParameter("NP_INTERNET_ACCESS", "Is this system directly connected to the internet?", "yes");
+my $host_tcp_http2 = getTestParameter("NP_HOST_TCP_HTTP2", "A host providing an index page containing the string 'monitoring'", "test.monitoring-plugins.org");
+my $host_tcp_proxy = getTestParameter("NP_HOST_TCP_PROXY", "A host providing a HTTP proxy with CONNECT support", "localhost");
+my $port_tcp_proxy = getTestParameter("NP_PORT_TCP_PROXY", "Port of the proxy with HTTP and CONNECT support", "3128");
+
+my $faketime = -x '/usr/bin/faketime' ? 1 : 0;
+
+
+$res = NPTest->testCmd(
+ "./$plugin $host_tcp_http -wt 300 -ct 600"
+ );
+cmp_ok( $res->return_code, '==', 0, "Webserver $host_tcp_http responded" );
+like( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "./$plugin $host_tcp_http -wt 300 -ct 600 -v -v -v -k 'bob:there' -k 'carl:frown'"
+ );
+like( $res->output, '/bob:there\r\ncarl:frown\r\n/', "Got headers with multiple -k options" );
+
+$res = NPTest->testCmd(
+ "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3"
+ );
+cmp_ok( $res->return_code, '==', 2, "Webserver $host_nonresponsive not responding" );
+cmp_ok( $res->output, 'eq', "CRITICAL - Socket timeout after 3 seconds", "Output OK");
+
+$res = NPTest->testCmd(
+ "./$plugin $hostname_invalid -wt 1 -ct 2"
+ );
+cmp_ok( $res->return_code, '==', 2, "Webserver $hostname_invalid not valid" );
+# The first part of the message comes from the OS catalogue, so cannot check this.
+# On Debian, it is Name or service not known, on Darwin, it is No address associated with nodename
+# Is also possible to get a socket timeout if DNS is not responding fast enough
+like( $res->output, "/Unable to open TCP socket|Socket timeout after/", "Output OK");
+
+# host header checks
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http");
+like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" );
+
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http -p 80");
+like( $res->output, '/^Host: '.$host_tcp_http.'\s*$/ms', "Host Header OK" );
+
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80");
+like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" );
+
+$res = NPTest->testCmd("./$plugin -v -H $host_tcp_http:8080 -p 80");
+like( $res->output, '/^Host: '.$host_tcp_http.':8080\s*$/ms', "Host Header OK" );
+
+SKIP: {
+ skip "No internet access", 3 if $internet_access eq "no";
+
+ $res = NPTest->testCmd("./$plugin -v -H $host_tls_http -S");
+ like( $res->output, '/^Host: '.$host_tls_http.'\s*$/ms', "Host Header OK" );
+
+ $res = NPTest->testCmd("./$plugin -v -H $host_tls_http:8080 -S -p 443");
+ like( $res->output, '/^Host: '.$host_tls_http.':8080\s*$/ms', "Host Header OK" );
+
+ $res = NPTest->testCmd("./$plugin -v -H $host_tls_http:443 -S -p 443");
+ like( $res->output, '/^Host: '.$host_tls_http.'\s*$/ms', "Host Header OK" );
+};
+
+SKIP: {
+ skip "No host serving monitoring in index file", 7 unless $host_tcp_http2;
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'monitoring'" );
+ cmp_ok( $res->return_code, "==", 0, "Got a reference to 'monitoring'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'mONiTORing'" );
+ cmp_ok( $res->return_code, "==", 2, "Not got 'mONiTORing'");
+ like ( $res->output, "/pattern not found/", "Error message says 'pattern not found'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -R 'mONiTORing'" );
+ cmp_ok( $res->return_code, "==", 0, "But case insensitive doesn't mind 'mONiTORing'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'monitoring' --invert-regex" );
+ cmp_ok( $res->return_code, "==", 2, "Invert results work when found");
+ like ( $res->output, "/pattern found/", "Error message says 'pattern found'");
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tcp_http2 -r 'mONiTORing' --invert-regex" );
+ cmp_ok( $res->return_code, "==", 0, "And also when not found");
+}
+SKIP: {
+ skip "No internet access", 22 if $internet_access eq "no";
+
+ $res = NPTest->testCmd(
+ "./$plugin --ssl $host_tls_http"
+ );
+ cmp_ok( $res->return_code, '==', 0, "Can read https for $host_tls_http" );
+
+ $res = NPTest->testCmd( "./$plugin -C 1 --ssl $host_tls_http" );
+ cmp_ok( $res->return_code, '==', 0, "Checking certificate for $host_tls_http");
+ like ( $res->output, "/Certificate '$host_tls_cert' will expire on/", "Output OK" );
+ my $saved_cert_output = $res->output;
+
+ $res = NPTest->testCmd( "./$plugin -C 8000,1 --ssl $host_tls_http" );
+ cmp_ok( $res->return_code, '==', 1, "Checking certificate for $host_tls_http");
+ like ( $res->output, qr/WARNING - Certificate '$host_tls_cert' expires in \d+ day/, "Output Warning" );
+
+ $res = NPTest->testCmd( "./$plugin $host_tls_http -C 1" );
+ is( $res->return_code, 0, "Old syntax for cert checking okay" );
+ is( $res->output, $saved_cert_output, "Same output as new syntax" );
+
+ $res = NPTest->testCmd( "./$plugin -H $host_tls_http -C 1" );
+ is( $res->return_code, 0, "Updated syntax for cert checking okay" );
+ is( $res->output, $saved_cert_output, "Same output as new syntax" );
+
+ $res = NPTest->testCmd( "./$plugin -C 1 $host_tls_http" );
+ cmp_ok( $res->output, 'eq', $saved_cert_output, "--ssl option automatically added");
+
+ $res = NPTest->testCmd( "./$plugin $host_tls_http -C 1" );
+ cmp_ok( $res->output, 'eq', $saved_cert_output, "Old syntax for cert checking still works");
+
+ # run some certificate checks with faketime
+ SKIP: {
+ skip "No faketime binary found", 7 if !$faketime;
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/OK - Certificate '$host_tls_cert' will expire on/, "Catch cert output");
+ is( $res->return_code, 0, "Catch cert output exit code" );
+ my($mon,$day,$hour,$min,$sec,$year) = ($res->output =~ /(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\d+)/);
+ if(!defined $year) {
+ die("parsing date failed from: ".$res->output);
+ }
+ my $months = {'Jan' => 0, 'Feb' => 1, 'Mar' => 2, 'Apr' => 3, 'May' => 4, 'Jun' => 5, 'Jul' => 6, 'Aug' => 7, 'Sep' => 8, 'Oct' => 9, 'Nov' => 10, 'Dec' => 11};
+ my $ts = mktime($sec, $min, $hour, $day, $months->{$mon}, $year-1900);
+ my $time = strftime("%Y-%m-%d %H:%M:%S", localtime($ts));
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' just expired/, "Output on expire date");
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts-1))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expires in 0 minutes/, "cert expires in 1 second output");
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts-120))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expires in 2 minutes/, "cert expires in 2 minutes output");
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts-7200))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expires in 2 hours/, "cert expires in 2 hours output");
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts+1))."' ./$plugin -C 1 $host_tls_http");
+ like($res->output, qr/CRITICAL - Certificate '$host_tls_cert' expired on/, "Certificate expired output");
+ };
+
+ $res = NPTest->testCmd( "./$plugin --ssl $host_tls_http -E" );
+ like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
+ like ( $res->output, '/time_ssl=[\d\.]+/', 'Extended Performance Data SSL Output OK' );
+
+ $res = NPTest->testCmd( "./$plugin -H www.mozilla.com -u /firefox -f follow" );
+ is( $res->return_code, 0, "Redirection based on location is okay");
+
+ $res = NPTest->testCmd( "./$plugin -H www.mozilla.com --extended-perfdata" );
+ like ( $res->output, '/time_connect=[\d\.]+/', 'Extended Performance Data Output OK' );
+}
+
+SKIP: {
+ skip "No internet access or proxy configured", 6 if $internet_access eq "no" or ! $host_tcp_proxy;
+
+ $res = NPTest->testCmd( "./$plugin -I $host_tcp_proxy -p $port_tcp_proxy -u http://$host_tcp_http -e 200,301,302");
+ is( $res->return_code, 0, "Proxy HTTP works");
+ like($res->output, qr/OK: Status line output matched/, "Proxy HTTP Output is sufficient");
+
+ $res = NPTest->testCmd( "./$plugin -I $host_tcp_proxy -p $port_tcp_proxy -H $host_tls_http -S -j CONNECT");
+ is( $res->return_code, 0, "Proxy HTTP CONNECT works");
+ like($res->output, qr/HTTP OK:/, "Proxy HTTP CONNECT output sufficient");
+
+ $res = NPTest->testCmd( "./$plugin -I $host_tcp_proxy -p $port_tcp_proxy -H $host_tls_http -S -j CONNECT:HEAD");
+ is( $res->return_code, 0, "Proxy HTTP CONNECT works with override method");
+ like($res->output, qr/HTTP OK:/, "Proxy HTTP CONNECT output sufficient");
+}
diff --git a/plugins/t/check_imap.t b/plugins/t/check_imap.t
new file mode 100644
index 0000000..cf2f81c
--- /dev/null
+++ b/plugins/t/check_imap.t
@@ -0,0 +1,38 @@
+#! /usr/bin/perl -w -I ..
+#
+# Internet Mail Access Protocol (IMAP) Server Tests via check_imap
+#
+#
+
+use strict;
+use Test::More tests => 7;
+use NPTest;
+
+my $host_tcp_smtp = getTestParameter("NP_HOST_TCP_SMTP", "A host providing an STMP Service (a mail server)", "mailhost");
+my $host_tcp_imap = getTestParameter("NP_HOST_TCP_IMAP", "A host providing an IMAP Service (a mail server)", $host_tcp_smtp);
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+
+my $t;
+
+$t = NPTest->testCmd( "./check_imap $host_tcp_imap" );
+cmp_ok( $t->return_code, '==', 0, "Contacted imap" );
+
+$t = NPTest->testCmd( "./check_imap -H $host_tcp_imap -p 143 -w 9 -c 9 -to 10 -e '* OK'" );
+cmp_ok( $t->return_code, '==', 0, "Got right response" );
+
+$t = NPTest->testCmd( "./check_imap $host_tcp_imap -p 143 -wt 9 -ct 9 -to 10 -e '* OK'" );
+cmp_ok( $t->return_code, '==', 0, "Check old parameter options" );
+
+$t = NPTest->testCmd( "./check_imap $host_nonresponsive" );
+cmp_ok( $t->return_code, '==', 2, "Get error with non responsive host" );
+
+$t = NPTest->testCmd( "./check_imap $hostname_invalid" );
+cmp_ok( $t->return_code, '==', 2, "Invalid hostname" );
+
+$t = NPTest->testCmd( "./check_imap -H $host_tcp_imap -e unlikely_string");
+cmp_ok( $t->return_code, '==', 1, "Got warning with bad response" );
+
+$t = NPTest->testCmd( "./check_imap -H $host_tcp_imap -e unlikely_string -M crit");
+cmp_ok( $t->return_code, '==', 2, "Got critical error with bad response" );
+
diff --git a/plugins/t/check_jabber.t b/plugins/t/check_jabber.t
new file mode 100644
index 0000000..fcdae17
--- /dev/null
+++ b/plugins/t/check_jabber.t
@@ -0,0 +1,50 @@
+#! /usr/bin/perl -w -I ..
+#
+# Jabber Server Tests via check_jabber
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+plan tests => 10;
+
+my $host_tcp_jabber = getTestParameter("NP_HOST_TCP_JABBER", "A host providing the Jabber Service", "jabber.de");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+
+
+my $jabberOK = '/JABBER OK\s-\s\d+\.\d+\ssecond response time on '.$host_tcp_jabber.' port 5222/';
+
+my $jabberUnresponsive = '/CRITICAL\s-\sSocket timeout after\s\d+\sseconds/';
+
+my $jabberInvalid = '/JABBER CRITICAL - Invalid hostname, address or socket:\s.+/';
+
+my $r;
+
+SKIP: {
+ skip "No jabber server defined", 6 unless $host_tcp_jabber;
+
+ $r = NPTest->testCmd( "./check_jabber -H $host_tcp_jabber" );
+ is( $r->return_code, 0, "Connected okay");
+ like( $r->output, $jabberOK, "Output as expected" );
+
+ $r = NPTest->testCmd( "./check_jabber -H $host_tcp_jabber -w 9 -c 9 -t 10" );
+ is( $r->return_code, 0, "Connected okay, within limits" );
+ like( $r->output, $jabberOK, "Output as expected" );
+
+ $r = NPTest->testCmd( "./check_jabber -H $host_tcp_jabber -wt 9 -ct 9 -to 10" );
+ is( $r->return_code, 0, "Old syntax okay" );
+ like( $r->output, $jabberOK, "Output as expected" );
+
+}
+
+$r = NPTest->testCmd( "./check_jabber $host_nonresponsive" );
+is( $r->return_code, 2, "Unresponsive host gives critical" );
+like( $r->output, $jabberUnresponsive );
+
+$r = NPTest->testCmd( "./check_jabber $hostname_invalid" );
+is( $r->return_code, 2, "Invalid hostname gives critical" );
+like( $r->output, $jabberInvalid );
+
diff --git a/plugins/t/check_ldap.t b/plugins/t/check_ldap.t
new file mode 100644
index 0000000..b8a4a76
--- /dev/null
+++ b/plugins/t/check_ldap.t
@@ -0,0 +1,71 @@
+#!/usr/bin/env perl -I ..
+#
+# Lightweight Directory Access Protocol (LDAP) Test via check_ldap
+#
+#
+
+use strict;
+use warnings;
+use Test::More;
+use NPTest;
+
+my $host_tcp_ldap = getTestParameter("NP_HOST_TCP_LDAP", "A host providing the LDAP Service", "localhost");
+my $ldap_base_dn = getTestParameter("NP_LDAP_BASE_DN", "A base dn for the LDAP Service", "cn=admin");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+
+my($result, $cmd);
+my $command = './check_ldap';
+
+plan tests => 16;
+
+SKIP: {
+ skip "NP_HOST_NONRESPONSIVE not set", 2 if ! $host_nonresponsive;
+
+ $result = NPTest->testCmd("$command -H $host_nonresponsive -b ou=blah -t 2 -w 1 -c 1");
+ is( $result->return_code, 2, "$command -H $host_nonresponsive -b ou=blah -t 5 -w 2 -c 3" );
+ is( $result->output, 'CRITICAL - Socket timeout after 2 seconds', "output ok" );
+};
+
+SKIP: {
+ skip "NP_HOSTNAME_INVALID not set", 2 if ! $hostname_invalid;
+
+ $result = NPTest->testCmd("$command -H $hostname_invalid -b ou=blah -t 5");
+ is( $result->return_code, 2, "$command -H $hostname_invalid -b ou=blah -t 5" );
+ is( $result->output, 'Could not bind to the LDAP server', "output ok" );
+};
+
+SKIP: {
+ skip "NP_HOST_TCP_LDAP not set", 12 if ! $host_tcp_ldap;
+ skip "NP_LDAP_BASE_DN not set", 12 if ! $ldap_base_dn;
+
+ $cmd = "$command -H $host_tcp_ldap -b $ldap_base_dn -t 5 -w 2 -c 3 -3";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 0, $cmd );
+ like( $result->output, '/^LDAP OK - \d+.\d+ seconds response time\|time=\d+\.\d+s;2\.0+;3\.0+;0\.0+$/', "output ok" );
+
+ $cmd = "$command -H $host_tcp_ldap -b $ldap_base_dn -t 5 -w 2 -c 3 -3 -W 10000000 -C 10000001";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 0, $cmd );
+ like( $result->output, '/^LDAP OK - found \d+ entries in \d+\.\d+ seconds\|time=\d\.\d+s;2\.0+;3\.0+;0\.0+ entries=\d+\.0+;10000000;10000001;0\.0+$/', "output ok" );
+
+ $cmd = "$command -H $host_tcp_ldap -b $ldap_base_dn -t 5 -w 2 -c 3 -3 -W 10000000: -C 10000001:";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 2, $cmd );
+ like( $result->output, '/^LDAP CRITICAL - found \d+ entries in \d+\.\d+ seconds\|time=\d\.\d+s;2\.0+;3\.0+;0\.0+ entries=\d+\.0+;10000000:;10000001:;0\.0+$/', "output ok" );
+
+ $cmd = "$command -H $host_tcp_ldap -b $ldap_base_dn -t 5 -w 2 -c 3 -3 -W 0 -C 0";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 2, $cmd );
+ like( $result->output, '/^LDAP CRITICAL - found \d+ entries in \d+\.\d+ seconds\|time=\d\.\d+s;2\.0+;3\.0+;0\.0+ entries=\d+\.0+;0;0;0\.0+$/', "output ok" );
+
+ $cmd = "$command -H $host_tcp_ldap -b $ldap_base_dn -t 5 -w 2 -c 3 -3 -W 10000000: -C 10000001";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 1, $cmd );
+ like( $result->output, '/^LDAP WARNING - found \d+ entries in \d+\.\d+ seconds\|time=\d\.\d+s;2\.0+;3\.0+;0\.0+ entries=\d+\.0+;10000000:;10000001;0\.0+$/', "output ok" );
+
+ $cmd = "$command -H $host_tcp_ldap -b $ldap_base_dn -t 5 -w 2 -c 3 -3 -C 10000001";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 0, $cmd );
+ like( $result->output, '/^LDAP OK - found \d+ entries in \d+\.\d+ seconds\|time=\d\.\d+s;2\.0+;3\.0+;0\.0+ entries=\d+\.0+;;10000001;0\.0+$/', "output ok" );
+};
diff --git a/plugins/t/check_load.t b/plugins/t/check_load.t
new file mode 100644
index 0000000..bba8947
--- /dev/null
+++ b/plugins/t/check_load.t
@@ -0,0 +1,43 @@
+#! /usr/bin/perl -w -I ..
+#
+# Load Average Tests via check_load
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $res;
+
+my $loadValue = "[0-9]+\.?[0-9]+";
+my $successOutput = "/^LOAD OK - total load average: $loadValue, $loadValue, $loadValue/";
+my $successScaledOutput = "/^LOAD OK - scaled load average: $loadValue, $loadValue, $loadValue - total load average: $loadValue, $loadValue, $loadValue/";
+my $failureOutput = "/^LOAD CRITICAL - total load average: $loadValue, $loadValue, $loadValue/";
+my $failurScaledOutput = "/^LOAD CRITICAL - scaled load average: $loadValue, $loadValue, $loadValue - total load average: $loadValue, $loadValue, $loadValue/";
+
+plan tests => 13;
+
+$res = NPTest->testCmd( "./check_load -w 100,100,100 -c 100,100,100" );
+cmp_ok( $res->return_code, 'eq', 0, "load not over 100");
+like( $res->output, $successOutput, "Output OK");
+
+$res = NPTest->testCmd( "./check_load -w 0,0,0 -c 0,0,0" );
+cmp_ok( $res->return_code, 'eq', 2, "Load over 0");
+like( $res->output, $failureOutput, "Output OK");
+
+$res = NPTest->testCmd( "./check_load -r -w 0,0,0 -c 0,0,0" );
+cmp_ok( $res->return_code, 'eq', 2, "Load over 0 with per cpu division");
+like( $res->output, $failurScaledOutput, "Output OK");
+
+$res = NPTest->testCmd( "./check_load -w 100 -c 100,110" );
+cmp_ok( $res->return_code, 'eq', 0, "Plugin can handle non-triplet-arguments");
+like( $res->output, $successOutput, "Output OK");
+like( $res->perf_output, "/load1=$loadValue;100.000;100.000/", "Test handling of non triplet thresholds (load1)");
+like( $res->perf_output, "/load5=$loadValue;100.000;110.000/", "Test handling of non triplet thresholds (load5)");
+like( $res->perf_output, "/load15=$loadValue;100.000;110.000/", "Test handling of non triplet thresholds (load15)");
+
+
+$res = NPTest->testCmd( "./check_load -w 100,100,100 -c 100,100,100 -r" );
+cmp_ok( $res->return_code, 'eq', 0, "load not over 100");
+like( $res->output, $successScaledOutput, "Output OK");
diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t
new file mode 100644
index 0000000..baf3acc
--- /dev/null
+++ b/plugins/t/check_mysql.t
@@ -0,0 +1,74 @@
+#! /usr/bin/perl -w -I ..
+#
+# MySQL Database Server Tests via check_mysql
+#
+#
+#
+# These are the database permissions required for this test:
+# GRANT SELECT ON $db.* TO $user@$host IDENTIFIED BY '$password';
+# GRANT SUPER, REPLICATION CLIENT ON *.* TO $user@$host;
+# Check with:
+# mysql -u$user -p$password -h$host $db
+
+use strict;
+use Test::More;
+use NPTest;
+
+use vars qw($tests);
+
+plan skip_all => "check_mysql not compiled" unless (-x "check_mysql");
+
+plan tests => 15;
+
+my $bad_login_output = '/Access denied for user /';
+my $mysqlserver = getTestParameter("NP_MYSQL_SERVER", "A MySQL Server hostname or IP with no slaves setup");
+my $mysqlsocket = getTestParameter("NP_MYSQL_SOCKET", "Full path to a MySQL Server socket with no slaves setup");
+my $mysql_login_details = getTestParameter("NP_MYSQL_LOGIN_DETAILS", "Command line parameters to specify login access (requires REPLICATION CLIENT privileges)", "-u test -ptest");
+my $with_slave = getTestParameter("NP_MYSQL_WITH_SLAVE", "MySQL server with slaves setup");
+my $with_slave_login = getTestParameter("NP_MYSQL_WITH_SLAVE_LOGIN", "Login details for server with slave (requires REPLICATION CLIENT privileges)", $mysql_login_details || "-u test -ptest");
+
+my $result;
+
+SKIP: {
+ skip "No mysql server defined", 5 unless $mysqlserver;
+ $result = NPTest->testCmd("./check_mysql -H $mysqlserver $mysql_login_details");
+ cmp_ok( $result->return_code, '==', 0, "Login okay");
+
+ $result = NPTest->testCmd("./check_mysql -H $mysqlserver -u dummy -pdummy");
+ cmp_ok( $result->return_code, '==', 2, "Login failure");
+ like( $result->output, $bad_login_output, "Expected login failure message");
+
+ $result = NPTest->testCmd("./check_mysql -S -H $mysqlserver $mysql_login_details");
+ cmp_ok( $result->return_code, "==", 1, "No slaves defined" );
+ like( $result->output, "/No slaves defined/", "Correct error message");
+}
+
+SKIP: {
+ skip "No mysql socket defined", 5 unless $mysqlsocket;
+ $result = NPTest->testCmd("./check_mysql -s $mysqlsocket $mysql_login_details");
+ cmp_ok( $result->return_code, '==', 0, "Login okay");
+
+ $result = NPTest->testCmd("./check_mysql -s $mysqlsocket -u dummy -pdummy");
+ cmp_ok( $result->return_code, '==', 2, "Login failure");
+ like( $result->output, $bad_login_output, "Expected login failure message");
+
+ $result = NPTest->testCmd("./check_mysql -S -s $mysqlsocket $mysql_login_details");
+ cmp_ok( $result->return_code, "==", 1, "No slaves defined" );
+ like( $result->output, "/No slaves defined/", "Correct error message");
+}
+
+SKIP: {
+ skip "No mysql server with slaves defined", 5 unless $with_slave;
+ $result = NPTest->testCmd("./check_mysql -H $with_slave $with_slave_login");
+ cmp_ok( $result->return_code, '==', 0, "Login okay");
+
+ $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login");
+ cmp_ok( $result->return_code, "==", 0, "Slaves okay" );
+
+ $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60");
+ cmp_ok( $result->return_code, '==', 0, 'Slaves are not > 60 seconds behind');
+
+ $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60:");
+ cmp_ok( $result->return_code, '==', 1, 'Alert warning if < 60 seconds behind');
+ like( $result->output, "/^SLOW_SLAVE WARNING:/", "Output okay");
+}
diff --git a/plugins/t/check_mysql_query.t b/plugins/t/check_mysql_query.t
new file mode 100644
index 0000000..c30245b
--- /dev/null
+++ b/plugins/t/check_mysql_query.t
@@ -0,0 +1,58 @@
+#! /usr/bin/perl -w -I ..
+#
+# MySQL Database Server Tests via check_mysql
+#
+#
+#
+# These are the database permissions required for this test:
+# GRANT SELECT ON $db.* TO $user@$host IDENTIFIED BY '$password';
+# Check with:
+# mysql -u$user -p$password -h$host $db
+
+use strict;
+use Test::More;
+use NPTest;
+
+use vars qw($tests);
+
+plan skip_all => "check_mysql_query not compiled" unless (-x "check_mysql_query");
+
+my $mysqlserver = getTestParameter("NP_MYSQL_SERVER", "A MySQL Server with no slaves setup");
+my $mysql_login_details = getTestParameter("NP_MYSQL_LOGIN_DETAILS", "Command line parameters to specify login access", "-u user -ppw -d db");
+my $result;
+
+if (! $mysqlserver) {
+ plan skip_all => "No mysql server defined";
+} else {
+ plan tests => 13;
+}
+
+$result = NPTest->testCmd("./check_mysql_query -q 'SELECT 1+1' -H $mysqlserver $mysql_login_details");
+cmp_ok( $result->return_code, '==', 0, "Can run query");
+
+$result = NPTest->testCmd("./check_mysql_query -H $mysqlserver $mysql_login_details");
+cmp_ok( $result->return_code, '==', 3, "Missing query parameter");
+like( $result->output, "/Must specify a SQL query to run/", "Missing query error message");
+
+$result = NPTest->testCmd("./check_mysql_query -q 'SELECT 1+1' -H $mysqlserver -u dummy -d mysql");
+cmp_ok( $result->return_code, '==', 2, "Login failure");
+like( $result->output, "/Access denied for user /", "Expected login failure message");
+
+$result = NPTest->testCmd("./check_mysql_query -q 'SELECT PI()' -w 3 -c 4 -H $mysqlserver $mysql_login_details");
+cmp_ok( $result->return_code, '==', 1, "Got warning");
+
+$result = NPTest->testCmd("./check_mysql_query -q 'SELECT PI()*2' -w 3 -c 4 -H $mysqlserver $mysql_login_details");
+cmp_ok( $result->return_code, '==', 2, "Got critical");
+
+$result = NPTest->testCmd("./check_mysql_query -q 'SELECT * FROM adsf' -H $mysqlserver $mysql_login_details");
+cmp_ok( $result->return_code, '==', 2, "Bad query");
+like( $result->output, "/Error with query/", "Bad query error message");
+
+$result = NPTest->testCmd("./check_mysql_query -q 'SHOW VARIABLES LIKE \"bob\"' -H $mysqlserver $mysql_login_details");
+cmp_ok( $result->return_code, '==', 1, "No rows");
+like( $result->output, "/No rows returned/", "No rows error message");
+
+$result = NPTest->testCmd("./check_mysql_query -q 'SHOW VARIABLES' -H $mysqlserver $mysql_login_details");
+cmp_ok( $result->return_code, '==', 2, "Data not numeric");
+like( $result->output, "/Is not a numeric/", "Data not numeric error message");
+
diff --git a/plugins/t/check_nagios.nagios1.status.log b/plugins/t/check_nagios.nagios1.status.log
new file mode 100644
index 0000000..64d9ce7
--- /dev/null
+++ b/plugins/t/check_nagios.nagios1.status.log
@@ -0,0 +1,5 @@
+# Nagios 1.2 Status File
+[1133537544] PROGRAM;1133537484;21980;1;1133537534;0;1;1;1;1;0;1;1;1
+[1133537544] HOST;ADSL;PENDING;0;0;0;0;0;0;0;0;1;1;1;1;0;0.0;0;1;1;(Not enough data to determine host status yet)
+[1133537544] HOST;Internet;UP;1133537486;1132135282;0;1402203;0;0;0;0;1;1;1;1;0;0.00;0;1;1;(Host assumed to be up)
+[1133537544] SERVICE;Internet;TCP/IP;OK;1/3;HARD;1133537486;1133537786;ACTIVE;1;1;1;1132135282;0;OK;1402203;0;0;0;0;0;1;0;4;1;0;0.00;0;1;1;0;PING OK - Packet loss = 0%, RTA = 0.09 ms
diff --git a/plugins/t/check_nagios.nagios2.status.dat b/plugins/t/check_nagios.nagios2.status.dat
new file mode 100644
index 0000000..6f62bac
--- /dev/null
+++ b/plugins/t/check_nagios.nagios2.status.dat
@@ -0,0 +1,127 @@
+########################################
+# NAGIOS STATUS FILE
+#
+# THIS FILE IS AUTOMATICALLY GENERATED
+# BY NAGIOS. DO NOT MODIFY THIS FILE!
+########################################
+
+info {
+ created=1133537302
+ version=2.0b5
+ }
+
+program {
+ modified_host_attributes=0
+ modified_service_attributes=0
+ nagios_pid=2750
+ daemon_mode=1
+ program_start=1133537167
+ last_command_check=1133537297
+ last_log_rotation=0
+ enable_notifications=1
+ active_service_checks_enabled=1
+ passive_service_checks_enabled=1
+ active_host_checks_enabled=1
+ passive_host_checks_enabled=1
+ enable_event_handlers=1
+ obsess_over_services=0
+ obsess_over_hosts=0
+ check_service_freshness=1
+ check_host_freshness=0
+ enable_flap_detection=1
+ enable_failure_prediction=1
+ process_performance_data=0
+ global_host_event_handler=
+ global_service_event_handler=
+ }
+
+host {
+ host_name=ADSL-derby-office
+ modified_attributes=0
+ check_command=check_host_alive_ping
+ event_handler=
+ has_been_checked=0
+ should_be_scheduled=0
+ check_execution_time=0.000
+ check_latency=0.000
+ check_type=0
+ current_state=0
+ last_hard_state=0
+ plugin_output=
+ performance_data=
+ last_check=0
+ next_check=0
+ current_attempt=1
+ max_attempts=3
+ state_type=1
+ last_state_change=0
+ last_hard_state_change=0
+ last_time_up=0
+ last_time_down=0
+ last_time_unreachable=0
+ last_notification=0
+ next_notification=0
+ no_more_notifications=0
+ current_notification_number=0
+ notifications_enabled=1
+ problem_has_been_acknowledged=0
+ acknowledgement_type=0
+ active_checks_enabled=1
+ passive_checks_enabled=1
+ event_handler_enabled=1
+ flap_detection_enabled=1
+ failure_prediction_enabled=1
+ process_performance_data=1
+ obsess_over_host=1
+ last_update=1133537302
+ is_flapping=0
+ percent_state_change=0.00
+ scheduled_downtime_depth=0
+ }
+
+service {
+ host_name=ADSL-derby-office
+ service_description=TCP/IP
+ modified_attributes=0
+ check_command=host5_service23_check_ping
+ event_handler=
+ has_been_checked=0
+ should_be_scheduled=1
+ check_execution_time=0.000
+ check_latency=0.000
+ check_type=0
+ current_state=0
+ last_hard_state=0
+ current_attempt=1
+ max_attempts=3
+ state_type=1
+ last_state_change=0
+ last_hard_state_change=0
+ last_time_ok=0
+ last_time_warning=0
+ last_time_unknown=0
+ last_time_critical=0
+ plugin_output=(Service assumed to be ok)
+ performance_data=
+ last_check=0
+ next_check=1133537317
+ current_notification_number=0
+ last_notification=0
+ next_notification=0
+ no_more_notifications=0
+ notifications_enabled=0
+ active_checks_enabled=1
+ passive_checks_enabled=1
+ event_handler_enabled=1
+ problem_has_been_acknowledged=0
+ acknowledgement_type=0
+ flap_detection_enabled=1
+ failure_prediction_enabled=1
+ process_performance_data=1
+ obsess_over_service=0
+ last_update=1133537302
+ is_flapping=0
+ percent_state_change=0.00
+ scheduled_downtime_depth=0
+ }
+
diff --git a/plugins/t/check_nagios.t b/plugins/t/check_nagios.t
new file mode 100644
index 0000000..f38f5e9
--- /dev/null
+++ b/plugins/t/check_nagios.t
@@ -0,0 +1,92 @@
+#! /usr/bin/perl -w -I ..
+#
+# check_nagios tests
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+if (`uname -s` eq "SunOS\n") {
+ plan skip_all => "Ignoring tests on solaris because of pst3";
+} else {
+ plan tests => 13;
+}
+
+my $successOutput = '/^NAGIOS OK: /';
+my $warningOutput = '/^NAGIOS WARNING: /';
+my $failureOutput = '/^NAGIOS CRITICAL: /';
+
+my $nagios1 = "t/check_nagios.nagios1.status.log";
+my $nagios2 = "t/check_nagios.nagios2.status.dat";
+
+my $result;
+
+# Did use init, but MacOSX 10.4 replaces init with launchd
+# Alternative is to insist that nagios is running to run this test
+# Reasonable to expect cron because build servers will
+# invoke cron to run a build
+my $procname = "cron";
+
+$result = NPTest->testCmd(
+ "./check_nagios -F $nagios1 -e 5 -C $procname"
+ );
+cmp_ok( $result->return_code, '==', 1, "Log over 5 minutes old" );
+like ( $result->output, $warningOutput, "Output for warning correct" );
+
+my $now = time;
+# This substitution is dependent on the testcase
+system( "perl -pe 's/1133537544/$now/' $nagios1 > $nagios1.tmp" ) == 0 or die "Problem with munging $nagios1";
+
+$result = NPTest->testCmd(
+ "./check_nagios -F $nagios1.tmp -e 1 -C $procname"
+ );
+cmp_ok( $result->return_code, "==", 0, "Log up to date" );
+like ( $result->output, $successOutput, "Output for success correct" );
+
+my $later = $now - 61;
+system( "perl -pe 's/1133537544/$later/' $nagios1 > $nagios1.tmp" ) == 0 or die "Problem with munging $nagios1";
+
+$result = NPTest->testCmd(
+ "./check_nagios -F $nagios1.tmp -e 1 -C $procname"
+ );
+cmp_ok( $result->return_code, "==", 1, "Log correctly seen as over 1 minute old" );
+my ($age) = ($_ = $result->output) =~ /status log updated (\d+) seconds ago/;
+like( $age, '/^6[0-9]$/', "Log correctly seen as between 60-69 seconds old" );
+
+$result = NPTest->testCmd(
+ "./check_nagios -F $nagios1.tmp -e 5 -C unlikely_command_string"
+ );
+cmp_ok( $result->return_code, "==", 2, "Nagios command not found" );
+like ( $result->output, $failureOutput, "Output for failure correct" );
+
+$result = NPTest->testCmd(
+ "./check_nagios -F $nagios2 -e 5 -C $procname"
+ );
+cmp_ok( $result->return_code, "==", 1, "Nagios2 for logfile over 5 mins old" );
+
+$now = time;
+system( "perl -pe 's/1133537302/$now/' $nagios2 > $nagios2.tmp" ) == 0 or die "Problem with munging $nagios2";
+
+$result = NPTest->testCmd(
+ "./check_nagios -F $nagios2.tmp -e 1 -C $procname"
+ );
+cmp_ok( $result->return_code, "==", 0, "Nagios2 log up to date" );
+
+$later = $now - 61;
+system( "perl -pe 's/1133537302/$later/' $nagios2 > $nagios2.tmp" ) == 0 or die "Problem with munging $nagios2";
+
+$result = NPTest->testCmd(
+ "./check_nagios -F $nagios2.tmp -e 1 -C $procname"
+ );
+cmp_ok( $result->return_code, "==", 1, "Nagios2 log correctly seen as over 1 minute old" );
+($age) = ($_ = $result->output) =~ /status log updated (\d+) seconds ago/;
+like( $age, '/^6[0-9]$/', "Log correctly seen as between 60-69 seconds old" );
+
+$result = NPTest->testCmd(
+ "./check_nagios -F t/check_nagios.t -e 1 -C $procname"
+ );
+cmp_ok( $result->return_code, "==", 2, "Invalid log file" );
+
+
diff --git a/plugins/t/check_ntp.t b/plugins/t/check_ntp.t
new file mode 100644
index 0000000..b8fc8fd
--- /dev/null
+++ b/plugins/t/check_ntp.t
@@ -0,0 +1,110 @@
+#! /usr/bin/perl -w -I ..
+#
+# Testing NTP
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my @PLUGINS1 = ('check_ntp', 'check_ntp_peer', 'check_ntp_time');
+my @PLUGINS2 = ('check_ntp_peer');
+
+plan tests => (12 * scalar(@PLUGINS1)) + (6 * scalar(@PLUGINS2));
+
+my $res;
+
+my $ntp_service = getTestParameter( "NP_GOOD_NTP_SERVICE",
+ "A host providing NTP service",
+ "pool.ntp.org");
+
+my $no_ntp_service = getTestParameter( "NP_NO_NTP_SERVICE",
+ "A host NOT providing the NTP service",
+ "localhost" );
+
+my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests",
+ "10.0.0.1" );
+
+my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost");
+
+my $ntp_okmatch1 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/';
+my $ntp_warnmatch1 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/';
+my $ntp_critmatch1 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs/';
+my $ntp_okmatch2 = '/^NTP\sOK:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2},\struechimers=[0-9]+/';
+my $ntp_warnmatch2 = '/^NTP\sWARNING:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+,\sstratum=[0-9]{1,2}\s\(WARNING\),\struechimers=[0-9]+/';
+my $ntp_critmatch2 = '/^NTP\sCRITICAL:\sOffset\s-?[0-9]+(\.[0-9]+)?(e-[0-9]{2})?\ssecs,\sjitter=[0-9]+\.[0-9]+\s\(CRITICAL\),\sstratum=[0-9]{1,2},\struechimers=[0-9]+/';
+my $ntp_noresponse = '/^(CRITICAL - Socket timeout after 3 seconds)|(NTP CRITICAL: No response from NTP server)$/';
+my $ntp_nosuchhost = '/^check_ntp.*: Invalid hostname/address - ' . $hostname_invalid . '/';
+
+
+foreach my $plugin (@PLUGINS1) {
+ SKIP: {
+ skip "No NTP server defined", 6 unless $ntp_service;
+ $res = NPTest->testCmd(
+ "./$plugin -H $ntp_service -w 1000 -c 2000"
+ );
+ cmp_ok( $res->return_code, '==', 0, "$plugin: Good NTP result (simple check)" );
+ like( $res->output, $ntp_okmatch1, "$plugin: Output match OK (simple check)" );
+
+ $res = NPTest->testCmd(
+ "./$plugin -H $ntp_service -w 1000: -c 2000"
+ );
+ cmp_ok( $res->return_code, '==', 1, "$plugin: Warning NTP result (simple check)" );
+ like( $res->output, $ntp_warnmatch1, "$plugin: Output match WARNING (simple check)" );
+
+ $res = NPTest->testCmd(
+ "./$plugin -H $ntp_service -w 1000 -c 2000:"
+ );
+ cmp_ok( $res->return_code, '==', 2, "$plugin: Critical NTP result (simple check)" );
+ like( $res->output, $ntp_critmatch1, "$plugin: Output match CRITICAL (simple check)" );
+ }
+
+ SKIP: {
+ skip "No bad NTP server defined", 1 unless $no_ntp_service;
+ $res = NPTest->testCmd(
+ "./$plugin -H $no_ntp_service -t 3"
+ );
+ cmp_ok( $res->return_code, '==', 2, "$plugin: No NTP service" );
+ like( $res->output, $ntp_noresponse, "$plugin: Output match no NTP service" );
+ }
+
+ $res = NPTest->testCmd(
+ "./$plugin -H $host_nonresponsive -t 3"
+ );
+ cmp_ok( $res->return_code, '==', 2, "$plugin: Server not responding" );
+ like( $res->output, $ntp_noresponse, "$plugin: Output match non-responsive" );
+
+ $res = NPTest->testCmd(
+ "./$plugin -H $hostname_invalid"
+ );
+ cmp_ok( $res->return_code, '==', 3, "$plugin: Invalid hostname/address" );
+ like( $res->output, $ntp_nosuchhost, "$plugin: Output match invalid hostname/address" );
+
+}
+
+foreach my $plugin (@PLUGINS2) {
+ SKIP: {
+ skip "No NTP server defined", 6 unless $ntp_service;
+ $res = NPTest->testCmd(
+ "./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k 200000 -m 1: -n 0:"
+ );
+ cmp_ok( $res->return_code, '==', 0, "$plugin: Good NTP result with jitter, stratum, and truechimers check" );
+ like( $res->output, $ntp_okmatch2, "$plugin: Output match OK with jitter, stratum, and truechimers" );
+
+ $res = NPTest->testCmd(
+ "./$plugin -H $ntp_service -w 1000 -c 2000 -W \\~:-1 -C 21 -j 100000 -k 200000 -m 1: -n 0:"
+ );
+ cmp_ok( $res->return_code, '==', 1, "$plugin: Warning NTP result with jitter, stratum, and truechimers check" );
+ like( $res->output, $ntp_warnmatch2, "$plugin: Output match WARNING with jitter, stratum, and truechimers" );
+
+ $res = NPTest->testCmd(
+ "./$plugin -H $ntp_service -w 1000 -c 2000 -W 20 -C 21 -j 100000 -k \\~:-1 -m 1: -n 0:"
+ );
+ cmp_ok( $res->return_code, '==', 2, "$plugin: Critical NTP result with jitter, stratum, and truechimers check" );
+ like( $res->output, $ntp_critmatch2, "$plugin: Output match CRITICAL with jitter, stratum, and truechimers" );
+ }
+}
diff --git a/plugins/t/check_ping.t b/plugins/t/check_ping.t
new file mode 100644
index 0000000..1604f8f
--- /dev/null
+++ b/plugins/t/check_ping.t
@@ -0,0 +1,109 @@
+#! /usr/bin/perl -w -I ..
+#
+# Ping Response Tests via check_ping
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+plan tests => 20;
+
+my $successOutput = '/PING (ok|OK) - Packet loss = +[0-9]{1,2}\%, +RTA = [\.0-9]+ ms/';
+my $failureOutput = '/Packet loss = +[0-9]{1,2}\%, +RTA = [\.0-9]+ ms/';
+
+my $host_responsive = getTestParameter( "NP_HOST_RESPONSIVE",
+ "The hostname of system responsive to network requests",
+ "localhost" );
+
+my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests",
+ "10.0.0.1" );
+
+my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost" );
+
+my $res;
+
+$res = NPTest->testCmd(
+ "./check_ping -H $host_responsive -w 10,100% -c 10,100% -p 1"
+ );
+is( $res->return_code, 0, "Syntax ok" );
+like( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "./check_ping -H $host_responsive -w 0,0% -c 10,100% -p 1"
+ );
+is( $res->return_code, 1, "Syntax ok, with forced warning" );
+like( $res->output, $failureOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "./check_ping -H $host_responsive -w 0,0% -c 0,0% -p 1"
+ );
+is( $res->return_code, 2, "Syntax ok, with forced critical" );
+like( $res->output, $failureOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "./check_ping $host_responsive 100 100 1000 1000 -p 1"
+ );
+is( $res->return_code, 0, "Old syntax ok" );
+like( $res->output, $successOutput, "Output OK" );
+
+$res = NPTest->testCmd(
+ "./check_ping $host_responsive 0 0 0 0 -p 1"
+ );
+is( $res->return_code, 2, "Old syntax, with forced critical" );
+like( $res->output, $failureOutput, "Output OK" );
+
+
+# check_ping results will depend on whether the ping command discovered by
+# ./configure has a timeout option. If it does, then the timeout will
+# be set, so check_ping will always get a response. If it doesn't
+# then check_ping will timeout. We do 2 tests for check_ping's timeout
+# - 1 second
+# - 15 seconds
+# The latter should be higher than normal ping timeouts, so should always give a packet loss result
+open(F, "../config.h") or die "Cannot open ../config.h";
+@_ = grep /define PING_HAS_TIMEOUT 1|define PING_PACKETS_FIRST 1/, <F>;
+my $has_timeout;
+$has_timeout = 1 if (scalar @_ == 2); # Need both defined
+close F;
+$res = NPTest->testCmd(
+ "./check_ping -H $host_nonresponsive -w 10,100% -c 10,100% -p 1 -t 1"
+ );
+is( $res->return_code, 2, "Timeout 1 second - host nonresponsive" );
+if ($has_timeout) {
+ like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" );
+} else {
+ like( $res->output, '/timed out/', "Error contains 'timed out' string" );
+}
+
+$res = NPTest->testCmd(
+ "./check_ping -H $host_nonresponsive -w 10,100% -c 10,100% -p 1 -t 15"
+ );
+is( $res->return_code, 2, "Timeout 15 seconds - host nonresponsive" );
+like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" );
+
+
+
+
+$res = NPTest->testCmd(
+ "./check_ping $host_nonresponsive -p 1 -t 15 100 100 1000 10000"
+ );
+is( $res->return_code, 2, "Old syntax: Timeout - host nonresponsive" );
+like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" );
+
+$res = NPTest->testCmd(
+ "./check_ping $hostname_invalid 0 0 0 0 -p 1 -t 1"
+ );
+is( $res->return_code, 3, "Invalid hostname" );
+like( $res->output, '/invalid hostname/i', "Error contains 'invalid hostname' string");
+
+$res = NPTest->testCmd(
+ "./check_ping -w 100,10% -c 200,20%"
+ );
+is( $res->return_code, 3, "No hostname" );
+like( $res->output, '/You must specify a server address or host name/', "Output with appropriate error message");
+
diff --git a/plugins/t/check_pop.t b/plugins/t/check_pop.t
new file mode 100644
index 0000000..62352fd
--- /dev/null
+++ b/plugins/t/check_pop.t
@@ -0,0 +1,55 @@
+#! /usr/bin/perl -w -I ..
+#
+# Post Office Protocol (POP) Server Tests via check_pop
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+plan tests => 5;
+
+my $host_tcp_smtp = getTestParameter(
+ "NP_HOST_TCP_SMTP",
+ "A host providing an STMP Service (a mail server)",
+ "mailhost"
+ );
+
+my $host_tcp_pop = getTestParameter(
+ "NP_HOST_TCP_POP",
+ "A host providing a POP Service (a mail server)",
+ $host_tcp_smtp
+ );
+
+my $host_nonresponsive = getTestParameter(
+ "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests",
+ "10.0.0.1",
+ );
+
+my $hostname_invalid = getTestParameter(
+ "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname",
+ "nosuchhost",
+ );
+
+my %exceptions = ( 2 => "No POP Server present?" );
+
+my $t;
+my $res;
+
+$res = NPTest->testCmd( "./check_pop $host_tcp_pop" );
+cmp_ok( $res->return_code, '==', 0, "POP server ok");
+
+$res = NPTest->testCmd( "./check_pop -H $host_tcp_pop -p 110 -w 9 -c 9 -t 10 -e '+OK'");
+cmp_ok( $res->return_code, '==', 0, "POP server returned +OK");
+
+$res = NPTest->testCmd( "./check_pop $host_tcp_pop -p 110 -wt 9 -ct 9 -to 10 -e '+OK'");
+cmp_ok( $res->return_code, '==', 0, "Old syntax");
+
+$res = NPTest->testCmd( "./check_pop $host_nonresponsive" );
+cmp_ok( $res->return_code, '==', 2, "Non responsive host");
+
+$res = NPTest->testCmd( "./check_pop $hostname_invalid" );
+cmp_ok( $res->return_code, '==', 2, "Invalid host");
diff --git a/plugins/t/check_procs.t b/plugins/t/check_procs.t
new file mode 100644
index 0000000..abe7284
--- /dev/null
+++ b/plugins/t/check_procs.t
@@ -0,0 +1,49 @@
+#! /usr/bin/perl -w -I ..
+#
+# Process Tests via check_procs
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $t;
+
+if (`uname -s` eq "SunOS\n" && ! -x "/usr/local/nagios/libexec/pst3") {
+ plan skip_all => "Ignoring tests on solaris because of pst3";
+} else {
+ plan tests => 14;
+}
+
+my $result;
+
+$result = NPTest->testCmd( "./check_procs -w 100000 -c 100000" );
+is( $result->return_code, 0, "Checking less than 10000 processes" );
+like( $result->output, '/^PROCS OK: [0-9]+ process(es)? | procs=[0-9]+;100000;100000;0;$/', "Output correct" );
+
+$result = NPTest->testCmd( "./check_procs -w 100000 -c 100000 -s Z" );
+is( $result->return_code, 0, "Checking less than 100000 zombie processes" );
+like( $result->output, '/^PROCS OK: [0-9]+ process(es)? with /', "Output correct" );
+
+if(fork() == 0) { exec("sleep 7"); } else { sleep(1) } # fork a test process in child and give child time to fork in parent
+$result = NPTest->testCmd( "./check_procs -a 'sleep 7'" );
+is( $result->return_code, 0, "Parent process is ignored" );
+like( $result->output, '/^PROCS OK: 1 process?/', "Output correct" );
+
+$result = NPTest->testCmd( "./check_procs -w 0 -c 100000" );
+is( $result->return_code, 1, "Checking warning if processes > 0" );
+like( $result->output, '/^PROCS WARNING: [0-9]+ process(es)? | procs=[0-9]+;0;100000;0;$/', "Output correct" );
+
+$result = NPTest->testCmd( "./check_procs -w 0 -c 0" );
+is( $result->return_code, 2, "Checking critical if processes > 0" );
+like( $result->output, '/^PROCS CRITICAL: [0-9]+ process(es)? | procs=[0-9]+;0;0;0;$/', "Output correct" );
+
+$result = NPTest->testCmd( "./check_procs -w 0 -c 0 -s Ss" );
+is( $result->return_code, 2, "Checking critical if sleeping processes" );
+like( $result->output, '/^PROCS CRITICAL: [0-9]+ process(es)? with /', "Output correct" );
+
+$result = NPTest->testCmd( "./check_procs -w 0 -c 100000 -p 1" );
+is( $result->return_code, 1, "Checking warning for processes by parentid = 1" );
+like( $result->output, '/^PROCS WARNING: [0-9]+ process(es)? with PPID = 1/', "Output correct" );
+
diff --git a/plugins/t/check_smtp.t b/plugins/t/check_smtp.t
new file mode 100644
index 0000000..1a1ebe3
--- /dev/null
+++ b/plugins/t/check_smtp.t
@@ -0,0 +1,84 @@
+#! /usr/bin/perl -w -I ..
+#
+# Simple Mail Transfer Protocol (SMTP) Test via check_smtp
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $host_tcp_smtp = getTestParameter( "NP_HOST_TCP_SMTP",
+ "A host providing an SMTP Service (a mail server)", "mailhost");
+my $host_tcp_smtp_starttls = getTestParameter( "NP_HOST_TCP_SMTP_STARTTLS",
+ "A host providing SMTP with STARTTLS", $host_tcp_smtp);
+my $host_tcp_smtp_nostarttls = getTestParameter( "NP_HOST_TCP_SMTP_NOSTARTTLS",
+ "A host providing SMTP without STARTTLS", "");
+my $host_tcp_smtp_tls = getTestParameter( "NP_HOST_TCP_SMTP_TLS",
+ "A host providing SMTP with TLS", $host_tcp_smtp);
+
+my $host_nonresponsive = getTestParameter( "NP_HOST_NONRESPONSIVE",
+ "The hostname of system not responsive to network requests", "10.0.0.1" );
+
+my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID",
+ "An invalid (not known to DNS) hostname", "nosuchhost" );
+my $res;
+
+plan tests => 16;
+
+SKIP: {
+ skip "No SMTP server defined", 4 unless $host_tcp_smtp;
+ $res = NPTest->testCmd( "./check_smtp $host_tcp_smtp" );
+ is ($res->return_code, 0, "OK");
+
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp -p 25 -w 9 -c 9 -t 10 -e 220" );
+ is ($res->return_code, 0, "OK, within 9 second response");
+
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp -p 25 -wt 9 -ct 9 -to 10 -e 220" );
+ is ($res->return_code, 0, "OK, old syntax");
+
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp -e 221" );
+ is ($res->return_code, 1, "WARNING - got correct error when expecting 221 instead of 220" );
+
+ TODO: {
+ local $TODO = "Output is over two lines";
+ like ( $res->output, qr/^SMTP WARNING/, "Correct error message" );
+ }
+
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp --ssl -p 25" );
+ is ($res->return_code, 2, "Check rc of connecting to $host_tcp_smtp with TLS on standard SMTP port" );
+ like ($res->output, qr/^CRITICAL - Cannot make SSL connection\./, "Check output of connecting to $host_tcp_smtp with TLS on standard SMTP port");
+}
+
+SKIP: {
+ skip "No SMTP server with STARTTLS defined", 1 unless $host_tcp_smtp_starttls;
+ # SSL connection for STARTTLS
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp_starttls -p 25 -S" );
+ is ($res->return_code, 0, "OK, with STARTTLS" );
+}
+
+SKIP: {
+ skip "No SMTP server without STARTTLS defined", 2 unless $host_tcp_smtp_nostarttls;
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp_nostarttls -p 25 -S" );
+ is ($res->return_code, 1, "OK, got warning from server without STARTTLS");
+ is ($res->output, "WARNING - TLS not supported by server", "Right error message" );
+}
+
+SKIP: {
+ skip "No SMTP server with TLS defined", 1 unless $host_tcp_smtp_tls;
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp_tls --ssl" );
+ is ($res->return_code, 0, "Check rc of connecting to $host_tcp_smtp_tls with TLS" );
+ like ($res->output, qr/^SMTP OK - /, "Check output of connecting to $host_tcp_smtp_tls with TLS" );
+
+ my $unused_port = 4465;
+ $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp_tls -p $unused_port --ssl" );
+ is ($res->return_code, 2, "Check rc of connecting to $host_tcp_smtp_tls with TLS on unused port $unused_port" );
+ like ($res->output, qr/^connect to address $host_tcp_smtp_tls and port $unused_port: Connection refused/, "Check output of connecting to $host_tcp_smtp_tls with TLS on unused port $unused_port");
+}
+
+$res = NPTest->testCmd( "./check_smtp $host_nonresponsive" );
+is ($res->return_code, 2, "CRITICAL - host non responding" );
+
+$res = NPTest->testCmd( "./check_smtp $hostname_invalid" );
+is ($res->return_code, 3, "UNKNOWN - hostname invalid" );
+
diff --git a/plugins/t/check_snmp.t b/plugins/t/check_snmp.t
new file mode 100644
index 0000000..576cc50
--- /dev/null
+++ b/plugins/t/check_snmp.t
@@ -0,0 +1,176 @@
+#! /usr/bin/perl -w -I ..
+#
+# Simple Network Management Protocol (SNMP) Test via check_snmp
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+BEGIN {
+ plan skip_all => 'check_snmp is not compiled' unless -x "./check_snmp";
+ plan tests => 63;
+}
+
+my $res;
+
+my $host_snmp = getTestParameter("NP_HOST_SNMP", "A host providing an SNMP Service", "localhost");
+my $snmp_community = getTestParameter("NP_SNMP_COMMUNITY", "The SNMP Community string for SNMP Testing (assumes snmp v1)", "public");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+my $user_snmp = getTestParameter("NP_SNMP_USER", "An SNMP user", "auth_md5");
+
+
+$res = NPTest->testCmd( "./check_snmp -t 1" );
+is( $res->return_code, 3, "No host name" );
+is( $res->output, "No host specified" );
+
+$res = NPTest->testCmd( "./check_snmp -H fakehostname --ignore-mib-parsing-errors" );
+is( $res->return_code, 3, "No OIDs specified" );
+is( $res->output, "No OIDs specified" );
+
+$res = NPTest->testCmd( "./check_snmp -H fakehost --ignore-mib-parsing-errors -o oids -P 3 -U not_a_user --seclevel=rubbish" );
+is( $res->return_code, 3, "Invalid seclevel" );
+like( $res->output, "/check_snmp: Invalid seclevel - rubbish/" );
+
+$res = NPTest->testCmd( "./check_snmp -H fakehost --ignore-mib-parsing-errors -o oids -P 3c" );
+is( $res->return_code, 3, "Invalid protocol" );
+like( $res->output, "/check_snmp: Invalid SNMP version - 3c/" );
+
+SKIP: {
+ skip "no snmp host defined", 50 if ( ! $host_snmp );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -w 1: -c 1:");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK when querying uptime" );
+ like($res->output, '/^SNMP OK - (\d+)/', "String contains SNMP OK");
+ $res->output =~ /^SNMP OK - (\d+)/;
+ my $value = $1;
+ cmp_ok( $value, ">", 0, "Got a time value" );
+ like($res->perf_output, "/sysUpTime.*$1/", "Got perfdata with value '$1' in it");
+
+
+ # some more threshold tests
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -c 1");
+ cmp_ok( $res->return_code, '==', 2, "Threshold test -c 1" );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -c 1:");
+ cmp_ok( $res->return_code, '==', 0, "Threshold test -c 1:" );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -c ~:1");
+ cmp_ok( $res->return_code, '==', 2, "Threshold test -c ~:1" );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -c 1:10");
+ cmp_ok( $res->return_code, '==', 2, "Threshold test -c 1:10" );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -c \@1:10");
+ cmp_ok( $res->return_code, '==', 0, "Threshold test -c \@1:10" );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -c 10:1");
+ cmp_ok( $res->return_code, '==', 0, "Threshold test -c 10:1" );
+
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o .1.3.6.1.2.1.1.3.0 -w 1: -c 1:");
+ cmp_ok( $res->return_code, '==', 0, "Test with numeric OID (no mibs loaded)" );
+ like($res->output, '/^SNMP OK - \d+/', "String contains SNMP OK");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysDescr.0");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK when querying sysDescr" );
+ unlike($res->perf_output, '/sysDescr/', "Perfdata doesn't contain string values");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysDescr.0,system.sysDescr.0");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK when querying two string OIDs, comma-separated" );
+ like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysDescr.0 -o system.sysDescr.0");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK when querying two string OIDs, repeated option" );
+ like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w 1:1 -c 1:1");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK when querying hrSWRunIndex.1" );
+ like($res->output, '/^SNMP OK - 1\s.*$/', "String fits SNMP OK and output format");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w 0 -c 1:");
+ cmp_ok( $res->return_code, '==', 1, "Exit WARNING when querying hrSWRunIndex.1 and warn-th doesn't apply " );
+ like($res->output, '/^SNMP WARNING - \*1\*\s.*$/', "String matches SNMP WARNING and output format");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w :0 -c 0");
+ cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL when querying hrSWRunIndex.1 and crit-th doesn't apply" );
+ like($res->output, '/^SNMP CRITICAL - \*1\*\s.*$/', "String matches SNMP CRITICAL and output format");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o ifIndex.2,ifIndex.1 -w 1:2 -c 1:2");
+ cmp_ok( $res->return_code, '==', 0, "Checking two OIDs at once" );
+ like($res->output, "/^SNMP OK - 2 1/", "Got two values back" );
+ like( $res->perf_output, "/ifIndex.2=2/", "Got 1st perf data" );
+ like( $res->perf_output, "/ifIndex.1=1/", "Got 2nd perf data" );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o ifIndex.2,ifIndex.1 -w 1:2,1:2 -c 2:2,2:2");
+ cmp_ok( $res->return_code, '==', 2, "Checking critical threshold is passed if any one value crosses" );
+ like($res->output, "/^SNMP CRITICAL - 2 *1*/", "Got two values back" );
+ like( $res->perf_output, "/ifIndex.2=2/", "Got 1st perf data" );
+ like( $res->perf_output, "/ifIndex.1=1/", "Got 2nd perf data" );
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrStorage.hrMemorySize.0,host.hrSystem.hrSystemProcesses.0 -w 1:,1: -c 1:,1:");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK when querying hrMemorySize and hrSystemProcesses");
+ like($res->output, '/^SNMP OK - \d+ \d+/', "String contains hrMemorySize and hrSystemProcesses");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w \@:0 -c \@0");
+ cmp_ok( $res->return_code, '==', 0, "Exit OK with inside-range thresholds");
+ like($res->output, '/^SNMP OK - 1\s.*$/', "String matches SNMP OK and output format");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o enterprises.ucdavis.laTable.laEntry.laLoad.3");
+ $res->output =~ m/^SNMP OK - (\d+\.\d{2})\s.*$/;
+ my $lower = $1 - 0.05;
+ my $higher = $1 + 0.05;
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o enterprises.ucdavis.laTable.laEntry.laLoad.3 -w $lower -c $higher");
+ cmp_ok( $res->return_code, '==', 1, "Exit WARNING with fractionnal arguments");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0,host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w ,:0 -c ,:2");
+ cmp_ok( $res->return_code, '==', 1, "Exit WARNING on 2nd threshold");
+ like($res->output, '/^SNMP WARNING - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s+\*1\*\s.*$/', "First OID returned as string, 2nd checked for thresholds");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w '' -c ''");
+ cmp_ok( $res->return_code, '==', 0, "Empty thresholds doesn't crash");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrStorage.hrMemorySize.0,host.hrSystem.hrSystemProcesses.0 -w ,,1 -c ,,2");
+ cmp_ok( $res->return_code, '==', 0, "Skipping first two thresholds on 2 OID check");
+ like($res->output, '/^SNMP OK - \d+ \w+ \d+\s.*$/', "Skipping first two thresholds, result printed rather than parsed");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o host.hrStorage.hrMemorySize.0,host.hrSystem.hrSystemProcesses.0 -w ,, -c ,,");
+ cmp_ok( $res->return_code, '==', 0, "Skipping all thresholds");
+ like($res->output, '/^SNMP OK - \d+ \w+ \d+\s.*$/', "Skipping all thresholds, result printed rather than parsed");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0 -c 1000000000000: -u '1/100 sec'");
+ cmp_ok( $res->return_code, '==', 2, "Timetick used as a threshold");
+ like($res->output, '/^SNMP CRITICAL - \*\d+\* 1\/100 sec.*$/', "Timetick used as a threshold, parsed as numeric");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o system.sysUpTime.0");
+ cmp_ok( $res->return_code, '==', 0, "Timetick used as a string");
+ like($res->output, '/^SNMP OK - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s.*$/', "Timetick used as a string, result printed rather than parsed");
+
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -C $snmp_community -o HOST-RESOURCES-MIB::hrSWRunName.1");
+ cmp_ok( $res->return_code, '==', 0, "snmp response without datatype");
+ like( $res->output, '/^SNMP OK - "(systemd|init)" \| $/', "snmp response without datatype" );
+}
+
+SKIP: {
+ skip "no SNMP user defined", 1 if ( ! $user_snmp );
+ $res = NPTest->testCmd( "./check_snmp -H $host_snmp --ignore-mib-parsing-errors -o HOST-RESOURCES-MIB::hrSystemUptime.0 -P 3 -U $user_snmp -L noAuthNoPriv");
+ like( $res->output, '/^SNMP OK - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s.*$/', "noAuthNoPriv security level works properly" );
+}
+
+# These checks need a complete command line. An invalid community is used so
+# the tests can run on hosts w/o snmp host/community in NPTest.cache. Execution will fail anyway
+SKIP: {
+ skip "no non responsive host defined", 2 if ( ! $host_nonresponsive );
+ $res = NPTest->testCmd( "./check_snmp -H $host_nonresponsive --ignore-mib-parsing-errors -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:");
+ cmp_ok( $res->return_code, '==', 2, "Exit CRITICAL with non responsive host" );
+ like($res->output, '/Plugin timed out while executing system call/', "String matches timeout problem");
+}
+
+SKIP: {
+ skip "no non invalid host defined", 2 if ( ! $hostname_invalid );
+ $res = NPTest->testCmd( "./check_snmp -H $hostname_invalid --ignore-mib-parsing-errors -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:");
+ cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" );
+ like($res->output, '/External command error: .*(nosuchhost|Name or service not known|Unknown host).*/s', "String matches invalid host");
+}
diff --git a/plugins/t/check_ssh.t b/plugins/t/check_ssh.t
new file mode 100644
index 0000000..a5cd23c
--- /dev/null
+++ b/plugins/t/check_ssh.t
@@ -0,0 +1,41 @@
+#! /usr/bin/perl -w -I ..
+#
+# check_ssh tests
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+# Required parameters
+my $ssh_host = getTestParameter("NP_SSH_HOST", "A host providing SSH service", "localhost");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1" );
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost" );
+
+
+plan skip_all => "SSH_HOST must be defined" unless $ssh_host;
+plan tests => 6;
+
+
+my $result = NPTest->testCmd(
+ "./check_ssh -H $ssh_host"
+ );
+cmp_ok($result->return_code, '==', 0, "Exit with return code 0 (OK)");
+like($result->output, '/^SSH OK - /', "Status text if command returned none (OK)");
+
+
+$result = NPTest->testCmd(
+ "./check_ssh -H $host_nonresponsive -t 2"
+ );
+cmp_ok($result->return_code, '==', 2, "Exit with return code 0 (OK)");
+like($result->output, '/^CRITICAL - Socket timeout after 2 seconds/', "Status text if command returned none (OK)");
+
+
+
+$result = NPTest->testCmd(
+ "./check_ssh -H $hostname_invalid -t 2"
+ );
+cmp_ok($result->return_code, '==', 3, "Exit with return code 0 (OK)");
+like($result->output, '/^check_ssh: Invalid hostname/', "Status text if command returned none (OK)");
+
diff --git a/plugins/t/check_swap.t b/plugins/t/check_swap.t
new file mode 100644
index 0000000..de9e0f0
--- /dev/null
+++ b/plugins/t/check_swap.t
@@ -0,0 +1,31 @@
+#! /usr/bin/perl -w -I ..
+#
+# Swap Space Tests via check_swap
+#
+#
+
+use strict;
+use Test::More tests => 8;
+use NPTest;
+
+my $successOutput = '/^SWAP OK - [0-9]+\% free \([0-9]+MB out of [0-9]+MB\)/';
+my $failureOutput = '/^SWAP CRITICAL - [0-9]+\% free \([0-9]+MB out of [0-9]+MB\)/';
+my $warnOutput = '/^SWAP WARNING - [0-9]+\% free \([0-9]+MB out of [0-9]+MB\)/';
+
+my $result;
+
+$result = NPTest->testCmd( "./check_swap -w 1048576 -c 1048576" ); # 1 MB free
+cmp_ok( $result->return_code, "==", 0, "At least 1MB free" );
+like( $result->output, $successOutput, "Right output" );
+
+$result = NPTest->testCmd( "./check_swap -w 1% -c 1%" ); # 1% free
+cmp_ok( $result->return_code, "==", 0, 'At least 1% free' );
+like( $result->output, $successOutput, "Right output" );
+
+$result = NPTest->testCmd( "./check_swap -w 100% -c 100%" ); # 100% (always critical)
+cmp_ok( $result->return_code, "==", 2, 'Get critical because not 100% free' );
+like( $result->output, $failureOutput, "Right output" );
+
+$result = NPTest->testCmd( "./check_swap -w 100% -c 1%" ); # 100% (always warn)
+cmp_ok( $result->return_code, "==", 1, 'Get warning because not 100% free' );
+like( $result->output, $warnOutput, "Right output" );
diff --git a/plugins/t/check_tcp.t b/plugins/t/check_tcp.t
new file mode 100644
index 0000000..cb4de53
--- /dev/null
+++ b/plugins/t/check_tcp.t
@@ -0,0 +1,55 @@
+#! /usr/bin/perl -w -I ..
+#
+# TCP Connection Based Tests via check_tcp
+#
+#
+
+use strict;
+use Test;
+
+use vars qw($tests $has_ipv6);
+BEGIN {
+ use NPTest;
+ $has_ipv6 = NPTest::has_ipv6();
+ $tests = $has_ipv6 ? 14 : 11;
+}
+
+
+my $host_tcp_http = getTestParameter("NP_HOST_TCP_HTTP", "A host providing the HTTP Service (a web server)", "localhost");
+my $host_tls_http = getTestParameter("NP_HOST_TLS_HTTP", "A host providing the HTTPS Service (a tls web server)", "localhost");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+my $internet_access = getTestParameter("NP_INTERNET_ACCESS", "Is this system directly connected to the internet?", "yes");
+
+my $successOutput = '/^TCP OK\s-\s+[0-9]?\.?[0-9]+ second response time on port [0-9]+/';
+
+my $failedExpect = '/^TCP WARNING\s-\sUnexpected response from host/socket on port [0-9]+/';
+
+my $t;
+
+$tests = $tests - 4 if $internet_access eq "no";
+plan tests => $tests;
+
+$t += checkCmd( "./check_tcp $host_tcp_http -p 80 -wt 300 -ct 600", 0, $successOutput );
+$t += checkCmd( "./check_tcp $host_tcp_http -p 81 -wt 0 -ct 0 -to 1", 2 ); # use invalid port for this test
+$t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt 0 -ct 0 -to 1", 2 );
+$t += checkCmd( "./check_tcp $hostname_invalid -p 80 -wt 0 -ct 0 -to 1", 2 );
+if($internet_access ne "no") {
+ $t += checkCmd( "./check_tcp -S -D 1 -H $host_tls_http -p 443", 0 );
+ $t += checkCmd( "./check_tcp -S -D 9000,1 -H $host_tls_http -p 443", 1 );
+ $t += checkCmd( "./check_tcp -S -D 9000 -H $host_tls_http -p 443", 1 );
+ $t += checkCmd( "./check_tcp -S -D 9000,8999 -H $host_tls_http -p 443", 2 );
+}
+
+# Need the \r\n to make it more standards compliant with web servers. Need the various quotes
+# so that perl doesn't interpret the \r\n and is passed onto command line correctly
+$t += checkCmd( "./check_tcp $host_tcp_http -p 80 -E -s ".'"GET / HTTP/1.1\r\n\r\n"'." -e 'ThisShouldntMatch' -j", 1, $failedExpect );
+
+# IPv6 checks
+if($has_ipv6) {
+ $t += checkCmd( "./check_tcp $host_tcp_http -p 80 -wt 300 -ct 600 -6 ", 0, $successOutput );
+ $t += checkCmd( "./check_tcp -6 -p 80 www.heise.de", 0 );
+}
+
+exit(0) if defined($Test::Harness::VERSION);
+exit($tests - $t);
diff --git a/plugins/t/check_time.t b/plugins/t/check_time.t
new file mode 100644
index 0000000..92c2f89
--- /dev/null
+++ b/plugins/t/check_time.t
@@ -0,0 +1,36 @@
+#! /usr/bin/perl -w -I ..
+#
+# System Time Tests via check_time
+#
+#
+
+use strict;
+use Test;
+use NPTest;
+
+use vars qw($tests);
+BEGIN {$tests = 8; plan tests => $tests}
+
+my $host_udp_time = getTestParameter("NP_HOST_UDP_TIME", "A host providing the UDP Time Service", "localhost");
+my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname of system not responsive to network requests", "10.0.0.1");
+my $hostname_invalid = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
+
+my $successOutput = '/^TIME OK - [0-9]+ second time difference/';
+
+my %exceptions = ( 3 => "No time server present?");
+
+my $t;
+
+# standard mode
+$t += checkCmd( "./check_time -H $host_udp_time -w 999999,59 -c 999999,59 -t 60", 0, $successOutput, %exceptions );
+$t += checkCmd( "./check_time -H $host_udp_time -w 999999 -W 59 -c 999999 -C 59 -t 60", 0, $successOutput, %exceptions );
+
+# reverse compatibility mode
+$t += checkCmd( "./check_time $host_udp_time -wt 59 -ct 59 -cd 999999 -wd 999999 -to 60", 0, $successOutput, %exceptions );
+
+# failure mode
+$t += checkCmd( "./check_time -H $host_nonresponsive -t 1", 2 );
+$t += checkCmd( "./check_time -H $hostname_invalid -t 1", 3 );
+
+exit(0) if defined($Test::Harness::VERSION);
+exit($tests - $t);
diff --git a/plugins/t/check_udp.t b/plugins/t/check_udp.t
new file mode 100644
index 0000000..6c47d09
--- /dev/null
+++ b/plugins/t/check_udp.t
@@ -0,0 +1,71 @@
+#! /usr/bin/perl -w -I ..
+#
+# UDP Connection Based Tests via check_udp
+#
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+my $res;
+
+alarm(120); # make sure tests don't hang
+
+plan tests => 14;
+
+$res = NPTest->testCmd( "./check_udp -H localhost -p 3333" );
+cmp_ok( $res->return_code, '==', 3, "Need send/expect string");
+like ( $res->output, '/With UDP checks, a send/expect string must be specified./', "Output OK");
+
+$res = NPTest->testCmd( "./check_udp -H localhost -p 3333 -s send" );
+cmp_ok( $res->return_code, '==', 3, "Need expect string");
+like ( $res->output, '/With UDP checks, a send/expect string must be specified./', "Output OK");
+
+$res = NPTest->testCmd( "./check_udp -H localhost -p 3333 -e expect" );
+cmp_ok( $res->return_code, '==', 3, "Need send string");
+like ( $res->output, '/With UDP checks, a send/expect string must be specified./', "Output OK");
+
+$res = NPTest->testCmd( "./check_udp -H localhost -p 3333 -s foo -e bar" );
+cmp_ok( $res->return_code, '==', 2, "Errors correctly because no udp service running" );
+like ( $res->output, '/No data received from host/', "Output OK");
+
+my $nc;
+if(system("which nc.traditional >/dev/null 2>&1") == 0) {
+ $nc = 'nc.traditional -w 3 -l -u -p 3333';
+}
+elsif(system("which nc >/dev/null 2>&1") == 0) {
+ $nc = 'nc -w 3 -l -u -4 localhost 3333';
+}
+elsif(system("which netcat >/dev/null 2>&1") == 0) {
+ $nc = 'netcat -w 3 -l -u -p 3333';
+}
+
+SKIP: {
+ skip "solaris netcat does not listen to udp", 6 if $^O eq 'solaris';
+ skip "No netcat available", 6 unless $nc;
+ open (NC, "echo 'barbar' | $nc |");
+ sleep 1;
+ $res = NPTest->testCmd( "./check_udp -H localhost -p 3333 -s '' -e barbar -4" );
+ cmp_ok( $res->return_code, '==', 0, "Got barbar response back" );
+ like ( $res->output, '/\[barbar\]/', "Output OK");
+ close NC;
+
+ # Start up a udp server listening on port 3333, quit after 3 seconds
+ # Otherwise will hang at close
+ my $pid = open(NC, "$nc </dev/null |");
+ sleep 1; # Allow nc to startup
+
+ my $start = time;
+ $res = NPTest->testCmd( "./check_udp -H localhost -p 3333 -s foofoo -e barbar -t 5 -4" );
+ my $duration = time - $start;
+ cmp_ok( $res->return_code, '==', '2', "Hung waiting for response");
+ like ( $res->output, '/Socket timeout after 5 seconds/', "Timeout message");
+ like ( $duration, '/^[56]$/', "Timeout after 5 (possibly 6) seconds");
+ my $read_nc = <NC> || '';
+ close NC;
+ cmp_ok( $read_nc, 'eq', "foofoo", "Data received correctly" );
+}
+
+
+alarm(0); # disable alarm
diff --git a/plugins/t/check_users.t b/plugins/t/check_users.t
new file mode 100644
index 0000000..9ebc2fc
--- /dev/null
+++ b/plugins/t/check_users.t
@@ -0,0 +1,30 @@
+#! /usr/bin/perl -w -I ..
+#
+# Logged in Users Tests via check_users
+#
+# Trick: This check requires at least 1 user logged in. These commands should
+# leave a session open forever in the background:
+#
+# $ ssh -tt localhost </dev/null >/dev/null 2>/dev/null &
+# $ disown %1
+
+use strict;
+use Test;
+use NPTest;
+
+use vars qw($tests);
+BEGIN {$tests = 8; plan tests => $tests}
+
+my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/';
+my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/';
+
+my $t;
+
+$t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
+$t += checkCmd( "./check_users 0 0", 2, $failureOutput );
+$t += checkCmd( "./check_users -w 0:1000 -c 0:1000", 0, $successOutput );
+$t += checkCmd( "./check_users -w 0:0 -c 0:0", 2, $failureOutput );
+
+exit(0) if defined($Test::Harness::VERSION);
+exit($tests - $t);
+
diff --git a/plugins/t/negate.t b/plugins/t/negate.t
new file mode 100644
index 0000000..5ec1c84
--- /dev/null
+++ b/plugins/t/negate.t
@@ -0,0 +1,90 @@
+#! /usr/bin/perl -w -I ..
+#
+# negate checks
+# Need check_dummy to work for testing
+#
+
+use strict;
+use Test::More;
+use Cwd;
+use NPTest;
+
+# 15 tests in the first part, 9 in timeout tests and 2 * 32 in the last loops
+plan tests => 88;
+
+my $res;
+
+my $PWD = getcwd();
+
+$res = NPTest->testCmd( "./negate" );
+is( $res->return_code, 3, "Not enough parameters");
+like( $res->output, "/Could not parse arguments/", "Could not parse arguments");
+
+$res = NPTest->testCmd( "./negate bobthebuilder" );
+is( $res->return_code, 3, "Require full path" );
+like( $res->output, "/Require path to command/", "Appropriate error message");
+
+$res = NPTest->testCmd( "./negate $PWD/check_dummy 0 'a dummy okay'" );
+is( $res->return_code, 2, "OK changed to CRITICAL" );
+is( $res->output, "OK: a dummy okay", "Output as expected" );
+
+$res = NPTest->testCmd( "./negate '$PWD/check_dummy 0 redsweaterblog'");
+is( $res->return_code, 2, "OK => CRIT with a single quote for command to run" );
+is( $res->output, "OK: redsweaterblog", "Output as expected" );
+
+$res = NPTest->testCmd( "./negate $PWD/check_dummy 1 'a warn a day keeps the managers at bay'" );
+is( $res->return_code, 1, "WARN stays same" );
+
+$res = NPTest->testCmd( "./negate $PWD/check_dummy 3 mysterious");
+is( $res->return_code, 3, "UNKNOWN stays same" );
+
+$res = NPTest->testCmd( "./negate \"$PWD/check_dummy 0 'a dummy okay'\"" );
+is( $res->output, "OK: a dummy okay", "Checking slashed quotes - the single quotes are re-evaluated at shell" );
+
+# Output is "OK: a" because check_dummy only returns the first arg
+$res = NPTest->testCmd( "./negate $PWD/check_dummy 0 a dummy okay" );
+is( $res->output, "OK: a", "Multiple args passed as arrays" );
+
+$res = NPTest->testCmd( "./negate $PWD/check_dummy 0 'a dummy okay'" );
+is( $res->output, "OK: a dummy okay", "The quoted string is passed through to subcommand correctly" );
+
+$res = NPTest->testCmd( "./negate '$PWD/check_dummy 0' 'a dummy okay'" );
+is( $res->output, "No data returned from command", "Bad command, as expected (trying to execute './check_dummy 0')");
+
+$res = NPTest->testCmd( './negate '.$PWD.'/check_dummy 0 \'$$ a dummy okay\'' );
+is( $res->output, 'OK: $$ a dummy okay', 'Proves that $$ is not being expanded again' );
+
+my %state = (
+ ok => 0,
+ warning => 1,
+ critical => 2,
+ unknown => 3,
+ );
+
+# Timeout tests
+$res = NPTest->testCmd( "./negate -t 2 /bin/sh -c 'sleep 5'" );
+is( $res->output, 'CRITICAL - Plugin timed out after 2 seconds' );
+
+foreach my $state (keys(%state)) {
+ $res = NPTest->testCmd( "./negate -t 2 -T $state /bin/sh -c 'sleep 5'" );
+ is( $res->return_code, $state{$state}, "Got timeout state $state" );
+ is( $res->output, uc($state)." - Plugin timed out after 2 seconds", "Timeout state $state output");
+}
+
+foreach my $current_state (keys(%state)) {
+ foreach my $new_state (keys(%state)) {
+ $res = NPTest->testCmd( "./negate --$current_state=$new_state ./check_dummy ".$state{$current_state}." 'Fake $new_state'" );
+ is( $res->return_code, $state{$new_state}, "Got fake $new_state" );
+ is( $res->output, uc($current_state).": Fake $new_state", "Fake $new_state output");
+ }
+}
+
+# Same as above with substitute
+foreach my $current_state (keys(%state)) {
+ foreach my $new_state (keys(%state)) {
+ $res = NPTest->testCmd( "./negate -s --$current_state=$new_state ./check_dummy ".$state{$current_state}." 'Fake $new_state'" );
+ is( $res->return_code, $state{$new_state}, "Got fake $new_state (with substitute)" );
+ is( $res->output, uc($new_state).": Fake $new_state", "Substituted fake $new_state output");
+ }
+}
+
diff --git a/plugins/tests/certs/.gitignore b/plugins/tests/certs/.gitignore
new file mode 100644
index 0000000..79acaaa
--- /dev/null
+++ b/plugins/tests/certs/.gitignore
@@ -0,0 +1,2 @@
+/*.csr
+/*.srl
diff --git a/plugins/tests/certs/client-cert.pem b/plugins/tests/certs/client-cert.pem
new file mode 100644
index 0000000..5709750
--- /dev/null
+++ b/plugins/tests/certs/client-cert.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDtDCCApwCAQIwDQYJKoZIhvcNAQELBQAwgaAxCzAJBgNVBAYTAkRFMRAwDgYD
+VQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZNdW5pY2gxGzAZBgNVBAoMEk1vbml0b3Jp
+bmcgUGx1Z2luczEkMCIGA1UEAwwbTW9uaXRvcmluZyBQbHVnaW5zIENsaWVudENB
+MSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9yaW5nLXBsdWdpbnMub3JnMB4X
+DTIxMDIyODIxMDIxMloXDTMwMTEyODIxMDIxMlowgZ4xCzAJBgNVBAYTAkRFMRAw
+DgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZNdW5pY2gxGzAZBgNVBAoMEk1vbml0
+b3JpbmcgUGx1Z2luczEiMCAGA1UEAwwZTW9uaXRvcmluZyBQbHVnaW5zIENsaWVu
+dDErMCkGCSqGSIb3DQEJARYcZGV2ZWxAbW9uaXRvcmluZy1wbHVnaW5zLm9yZzCC
+ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM3EiqfFPomm5dZQPGYG5SrF
+rPvyqseXTzCkwUIUzGf+Sfm3s13zx7e3ije/04yKhTXgK59EQ793q7E2aWhSOz3s
+hwKKdylFkOIyc5jgbAfF1/pLZMK209rLt/mMRksXCRXYrHdTjRMx1ev4C2407+8Y
+8qkf77DuYQmUqCQe7DPOvqLeagdw9JcLGmQNTKHg3fl6wyRl5K1Bsy+qXu2XvEjZ
+0Ng7n8LHjOUkTqUEJndOxci9gL5cHU5ttul/GW34dKOtTuMU/pQX6/ywYusOGVOx
+RYI76OolRqj5BqbNctDIB/obe2RLo+UVx74/0jAxtH4XS23pYjO7NUpJcytsVG8C
+AwEAATANBgkqhkiG9w0BAQsFAAOCAQEAYfaY5n4pCq0NWPCdeVVRr4nr+GAfv1TC
+/PKcGuEoJZKt7TQT+OOA5yeZMZb53OvtA49D1r9aoJzWe946KElWOEBqxDRi5Cdr
+wkqpwGcPT2RfAqA3/cvQZ1XsquboXrCf7ajdl5OC64bs2jkqCFh9gnxuI140g8Ar
+Njol8BFxRPaYWOnwuQwmh/2t0FJqr3WSD85HrNqtxUSNGbTdSsvCfgF0v7QVkvLG
+3/cbx6z5hxzj2JUjhMnCvn+EbasoJt4xyBFvg67Q2229SMwu9YNqS63GVoKUqhCB
+4Gl5v31qx8dAFKuRvnez3ze/6oohwmakZkst4hcQdgZocHhzesvKlg==
+-----END CERTIFICATE-----
diff --git a/plugins/tests/certs/client-key.pem b/plugins/tests/certs/client-key.pem
new file mode 100644
index 0000000..09b6761
--- /dev/null
+++ b/plugins/tests/certs/client-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDNxIqnxT6JpuXW
+UDxmBuUqxaz78qrHl08wpMFCFMxn/kn5t7Nd88e3t4o3v9OMioU14CufREO/d6ux
+NmloUjs97IcCincpRZDiMnOY4GwHxdf6S2TCttPay7f5jEZLFwkV2Kx3U40TMdXr
++AtuNO/vGPKpH++w7mEJlKgkHuwzzr6i3moHcPSXCxpkDUyh4N35esMkZeStQbMv
+ql7tl7xI2dDYO5/Cx4zlJE6lBCZ3TsXIvYC+XB1Obbbpfxlt+HSjrU7jFP6UF+v8
+sGLrDhlTsUWCO+jqJUao+QamzXLQyAf6G3tkS6PlFce+P9IwMbR+F0tt6WIzuzVK
+SXMrbFRvAgMBAAECggEBALtc2pB3p0E6KpAiEU0pvCRdSO1FgsIpAd+eNadRPur2
+fi+XWQkUwGeGBaJL1npja3aqP65PP40pj7nWfNaUAgOZyznCEU0QXiPJor6yo0vU
+l5v+aKpwRao107i0RRF80TYGTMx+1LeEqnCqNOZN56gERHlBbkTiWpOZvBzf1143
+oegTcyM6+Ee6+FYNhHaDyIYD0md1S2wGR+IBPet6HwWiakLNKahFPa7lOLIKfmmD
+iTtifcbf4724wSe44a0uTeP4JrquZSeIKakm8MEmffmYqpycnaakYefd0Xc5UEsH
++VbhKpOWGY3d8FKHqUsTa+6QyXb2uFPo6A+yWm0pdJECgYEA7Prd5sbWACvXOcHT
+ONDBAgyfAVDQwOXi3D4dk6D5mg+/jxl5ZQY5slszJrwsLFtoEzXtYpNfTy3cpNOp
+JLbBDZYnqty+5tD8t3/Zv2IBXCAgvuk5CgfJWP5FNAfiyUEE6Vbp6J/5/vAnODsa
+fxZryN5UsH0X8ew7AlbfcVNyj4kCgYEA3khetIgn+GR6sv9jFRdCT6aJbp0xMsms
+6F4v3L5FG4Kp+SwDHL1bVOhieJ5g8odYp9hDbgTEEqbJfNmyCOu9+OQmZ/mztku7
+6reU8HhYBIvi+hFeJmvqKpdIgU0Zveg4Bst5QordmhPk8AHjBC4xvQ++uh7rwYKd
+WVsS08bGDjcCgYEAlAuNARUKsASzakOqHv5a9VrJIttH7povBYRQmd+gzxwzgcRa
+UEB5XvEWnYZE2lkoRYgVCtYiXqa6BsasDmGVbVV25okNQckhd8mJUMR7MQBpNJsi
+pR+EK/J9bSnYBf52gQdpDYiTdy60ca6KuQZaw5wRsEgV426+1pFK+dM16HECgYBY
+cTsdYb9lmbUoW201CxgbUQwFsw3MQ2pE2pT4o8wjcg3nUpe6a61XT08+5uV0Gl4w
+CmBp+gN52Fr7DjNEUWg5C64sWLIkqmWOspTUSU3cITyiex6W8wEtCRyUNfU0Fp2U
+Nol87HvXvmqtBFMraqXnr8gXjg4H5MxurUoEcWaEaQKBgCT4iIGZwW0Qf2rkFC7B
+xObzVGefivVVbaf8/c/LRO8TMLdnExkShMOmCzHeHV4mMEZDLbMOusHCI7xm10EX
+l3L1I1Kyqnhm1RH3e7TVWgkTmIDW3V5Fgrhm1jx5Iz6et4sb4Uh+bZq9tTLyqfZY
+8s0yJUrfpjRggfk7eUs5s7aY
+-----END PRIVATE KEY-----
diff --git a/plugins/tests/certs/clientca-cert.pem b/plugins/tests/certs/clientca-cert.pem
new file mode 100644
index 0000000..9ce7cd7
--- /dev/null
+++ b/plugins/tests/certs/clientca-cert.pem
@@ -0,0 +1,25 @@
+-----BEGIN CERTIFICATE-----
+MIIEIzCCAwugAwIBAgIUL9Jfp5zv5B29NgDsNEFU2OM/UHswDQYJKoZIhvcNAQEL
+BQAwgaAxCzAJBgNVBAYTAkRFMRAwDgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZN
+dW5pY2gxGzAZBgNVBAoMEk1vbml0b3JpbmcgUGx1Z2luczEkMCIGA1UEAwwbTW9u
+aXRvcmluZyBQbHVnaW5zIENsaWVudENBMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBt
+b25pdG9yaW5nLXBsdWdpbnMub3JnMB4XDTIxMDIyODIxMDIxMVoXDTMwMTEyODIx
+MDIxMVowgaAxCzAJBgNVBAYTAkRFMRAwDgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQH
+DAZNdW5pY2gxGzAZBgNVBAoMEk1vbml0b3JpbmcgUGx1Z2luczEkMCIGA1UEAwwb
+TW9uaXRvcmluZyBQbHVnaW5zIENsaWVudENBMSswKQYJKoZIhvcNAQkBFhxkZXZl
+bEBtb25pdG9yaW5nLXBsdWdpbnMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+MIIBCgKCAQEAyxiWsGrsJFHw3VR0pqHviXUfbfKMw8LaCxI5EQZfInsMVkBIGWEW
+tFW6qDuAOsMdzsrKOnQRNNt852ts/0Uz++z8zysoauAGpc4JnCZuM5A1DU5CFXBx
+w6Ax+1ft3UsTt8C6kfLfs8mPCbtNVqAHrMrIqDxsNSRRxQSqkzp1vD8rwSKcbB1h
+u2+lut1bEqMe7dp89jKOtc6G/1tHUFQuLAGFoX/qk9yPscmQNzL6YbLP4m9r/416
+PsxWsAfyY97hmoYo6mSCue5LmeanOsjf4Kzq90hIJRwrpiUGmxGjW+tPLEhQBZw6
+C2wHyN74YIJYX2xREz2ijT0mgsqdhO5ZxwIDAQABo1MwUTAdBgNVHQ4EFgQUtsP9
+Z3fKkhmFp97Kh/cW/UqHMIMwHwYDVR0jBBgwFoAUtsP9Z3fKkhmFp97Kh/cW/UqH
+MIMwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEApO5o+YECwTEv
+s+elDJZQ20UYwDSiU9Lpf4EcdnRv6FAb5UlhfRTH3ZdKCc/HX7kcKuy3PsF+b8Pw
+EusoKito9OlNEOF5HYAI9/J54/qceqn+SC0INsISeE19PvT0dma7lBSj4OvBv0IS
+GYbdztVaKLWqYgYs0mcEzteUc4MZcy1/C+Ru1i1Kp2s9/vIeAw2PV2+kpWtw88Pb
+FRJomGngP/hQdwniayCltG/Q1smS4iFEHNI5ayLZj1qJGMHwzqGiRr4KknJKfHzv
+fl4NQaFyMY31s1FRIS6QVIRFHVzUAlKZTdzwqEJygg3fUS9n9uDBnyDI/sW7DQuj
+yjSmYRS1hw==
+-----END CERTIFICATE-----
diff --git a/plugins/tests/certs/clientca-key.pem b/plugins/tests/certs/clientca-key.pem
new file mode 100644
index 0000000..a939f03
--- /dev/null
+++ b/plugins/tests/certs/clientca-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDLGJawauwkUfDd
+VHSmoe+JdR9t8ozDwtoLEjkRBl8iewxWQEgZYRa0VbqoO4A6wx3Oyso6dBE023zn
+a2z/RTP77PzPKyhq4AalzgmcJm4zkDUNTkIVcHHDoDH7V+3dSxO3wLqR8t+zyY8J
+u01WoAesysioPGw1JFHFBKqTOnW8PyvBIpxsHWG7b6W63VsSox7t2nz2Mo61zob/
+W0dQVC4sAYWhf+qT3I+xyZA3Mvphss/ib2v/jXo+zFawB/Jj3uGahijqZIK57kuZ
+5qc6yN/grOr3SEglHCumJQabEaNb608sSFAFnDoLbAfI3vhgglhfbFETPaKNPSaC
+yp2E7lnHAgMBAAECggEAJqAWiJbNMlsjI/Tb+pTxqYLM52wpuVFlhpWApOxBS517
+SywOikUcvE9RoI0wZfyVvq5yp4tLenID3z9fC21t5Yu8yOm8VhclLINy8G+epc/X
+RyCLEOjBuiLNXq/qXRvaNChDU16NjPPYcFFe9AqbaxFl+BkFu1Wc94tbpYSIv7Qt
+L6iBxUTXdgvLM5doa9AazIQzJx+jUsVCgRVQQf3zsLqtp9hH0Pfq+KWFIy5TA+bG
+0NFmYyQndRjtT0ihWGuNU7D8AXa+z7abzk+HydIlx4D//vGgdNq92QYPdnu2BBya
+5Fs6LkmkUonX/I8FbkLbRKkQWNPMt+Ks21t3xcVBgQKBgQDn4HuHVCPwxgU6Mv+5
+0sHJXYBq1fDzrUt0+iTtYkRqViX+9Mp4sUpYgXext/wXFLcKzQQp5B0g1dLYLSRS
+KwhsdiN0J7ZcoP1GMStw8zsayRTf8C3WRU6aACqyFiylYbyh56XomfYgwhja/7l9
+pzpVJD9ecG+mLVAyAkJtK2JolQKBgQDgOZfvrQj0L4QG+9E5VmFc3PE+6k3g+zDO
+MWqTSh0fOHqdTEyet4bMC4DogXGVsvw0/UKwbrGHOk0+ltA5VyKUtK/whSutr/+S
+nhCHljhV0XUN/I3OFcvezFjM3g0oC4uy1cL30hoM4IfeHM1d3EYse9N1Y/Op+mR6
+Sx+fEku16wKBgQC0KQ7RjuZ95N2a4pUe5En9EtD8MU4Nhs/iC5k1d+yAUn8jIT9P
+lzCUo8NEKheMN2Qg2Dor8jlPkdNIc4qM7TKWUxQo49IlFlCzgPCnydRac3HsrMhw
+e1ke/pIt3FzEArR1d27I0xcRTL3TKm4M2ynPjWJPFj0peHue33KNL/A+IQKBgEpL
+awd0Sxo1wEZcG9gmwf32C01wbzuTn3lCsHB7Ryj4GtCR3nVclCJ50U24zjzu4Fhi
+bj1tgA8xhzSs3fOR5phlQkKsrWtQfJtFGm8CnEn7LBDlVMsrN7Dr/qRrEuro4HHy
+GDbq+8y2fO5glr955BqLMOadprf0imRnDeQ0OLffAoGBAJio+X+xpglgMOC4BeH9
+9LcYi9nUEw8MDJNGo9/3e0XKA7spd3HShLDvt8YZhFJ2m168qBpGfezuw0+jpWxy
+PV9q0dokAgDx4pvCzIKaptZ1D30CWXJZHq25VK1tA41PCUIOh8JD5+R0MpxA5rn2
+DbqL4Vq7K7K0imGENYhHdyM+
+-----END PRIVATE KEY-----
diff --git a/plugins/tests/certs/clientchain-cert.pem b/plugins/tests/certs/clientchain-cert.pem
new file mode 100644
index 0000000..acd1e3e
--- /dev/null
+++ b/plugins/tests/certs/clientchain-cert.pem
@@ -0,0 +1,45 @@
+-----BEGIN CERTIFICATE-----
+MIIDuTCCAqECAQQwDQYJKoZIhvcNAQELBQAwgaAxCzAJBgNVBAYTAkRFMRAwDgYD
+VQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZNdW5pY2gxGzAZBgNVBAoMEk1vbml0b3Jp
+bmcgUGx1Z2luczEkMCIGA1UEAwwbTW9uaXRvcmluZyBQbHVnaW5zIENsaWVudENB
+MSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9yaW5nLXBsdWdpbnMub3JnMB4X
+DTIxMDIyODIxMDIxMloXDTMwMTEyODIxMDIxMlowgaMxCzAJBgNVBAYTAkRFMRAw
+DgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZNdW5pY2gxGzAZBgNVBAoMEk1vbml0
+b3JpbmcgUGx1Z2luczEnMCUGA1UEAwweTW9uaXRvcmluZyBQbHVnaW5zIENsaWVu
+dENoYWluMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9yaW5nLXBsdWdpbnMu
+b3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAphvoJBbi/rDvm3+X
+8xok0sLCJvCRuUpSbU5wEmREQlkoOGmWK4l6r1JyOphKRBo8+n2MxPiCMvAmTrqx
+VlBmkcmyrwWj392Nga+2SLWTziASk5nFrrhV6U79PkgXnETV2Wk1/FNVIFkB8N+B
+undsTce8LLiCs7hfA5CK7ctJg8fqsAsmgKBNGzBRWwkbvxZPd6xlY6foIJeD7PQ2
+elvTmrD6WXSZq7GshFpDEkL3AifqrPMdsTnbBpyGgJ/fBM1b2dx9k53e25mgEQmn
+iSuYQxn08BsUT0FOvav8ksZLBQz859fuqCtwhikpODO635fD9zK5YkBPlVl+/5xo
+SvKOywIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBh4zeSKjENfY+VDLtPssaNQz2a
+R1ioY40lZ0WoihDSrfG32dqTK/R2YsLKBABjJ7uRYS1NIBMrtS2OktK8BWD5IUTF
+FuGuWilu6IWiTKZrLiZh1rsilNDVqwhorRPxDnbF+qVt9EMIvzKnKdJLGF+CWHN9
+yYJDeTD8MK5uR7zUJR3PsgW4ve5pFTi7z2UJ/xRvgOds6bmeeQnvaWDEL7k2+hrr
+0G899A086NL3htzaOnIllg0xo2D1o4ToncAJn+cUQVJmHZSg9HYiD4Lg3z8uXPAl
+rt/MX7dBm4dnImLXbSg7N3e8FdUtz+kZT9z+beKAeIe9JTbpxtsVUTzUZBBA
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID2jCCAsKgAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBoDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgMB0JhdmFyaWExDzANBgNVBAcMBk11bmljaDEbMBkGA1UECgwSTW9u
+aXRvcmluZyBQbHVnaW5zMSQwIgYDVQQDDBtNb25pdG9yaW5nIFBsdWdpbnMgQ2xp
+ZW50Q0ExKzApBgkqhkiG9w0BCQEWHGRldmVsQG1vbml0b3JpbmctcGx1Z2lucy5v
+cmcwHhcNMjEwMjI4MjEwMjEyWhcNMzAxMTI4MjEwMjEyWjCBqjELMAkGA1UEBhMC
+REUxEDAOBgNVBAgMB0JhdmFyaWExDzANBgNVBAcMBk11bmljaDEbMBkGA1UECgwS
+TW9uaXRvcmluZyBQbHVnaW5zMS4wLAYDVQQDDCVNb25pdG9yaW5nIFBsdWdpbnMg
+Q2xpZW50SW50ZXJtZWRpYXRlMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9y
+aW5nLXBsdWdpbnMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
+6rUgOZ9pAOxrcgeeOT3Vmu1YmY2O/C9tXhpKzDzjTaWUzcdDg00KdsjXfgbDzSiV
+uvMzjX63aKpmqeFG+05D2VzQGit3knqerUgl10FnTotiJGF5CU5/gY1aPxTJ7rj2
+tD6LINBkJcPTyQ4MoJT19pssvCax9erY1RxoXxLblJ+31C+VvrftdmBP4nVKXK26
+4anb1oUQhkgpXpJimJBmF+v7NbDs1Wh21Be80KXUh9SKgePhSQblr2QlRcA7jLgJ
+4PMjZ+KYF+da+4RB7s+DvTXVDMn9AL84E1w5Ut1E8XZV+u4RjWPvNdhK/7GnuxOR
+C9SdxonqkPQ8hiI7thP9bQIDAQABoxMwETAPBgNVHRMBAf8EBTADAQH/MA0GCSqG
+SIb3DQEBCwUAA4IBAQDKQeiDbyr0/7sEhX33MmTDv84GeWgKl9qqHecx+d/0vImb
+c8XHK0PDa4lVqo/BW4P1hjKzpt2DW35kbOhuqGqM0lasIczef43aCDDEBLwstAe6
+qMoyWGVGoAQbpwT3li2pMrsIYoPwMvoSGNUphjrkdpviff2POkLly7a5RrR1X3qt
+Dai6eYbeMCr9NdgW7AZ5++/sKlFoe+zVk/Ed31s4D2lh3awrApZhVgcoquPmEwpt
+gm+OgRmHw50U4SF3ZaJPwDyLMbx+clH/bgUg0+Za9e53Br1NtGKmw7hh/7CG/hy0
+yxeLd930pH4vZu7s0XM56N/ckkfUzRkAH8dSmhH4
+-----END CERTIFICATE-----
diff --git a/plugins/tests/certs/clientchain-key.pem b/plugins/tests/certs/clientchain-key.pem
new file mode 100644
index 0000000..0263604
--- /dev/null
+++ b/plugins/tests/certs/clientchain-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCmG+gkFuL+sO+b
+f5fzGiTSwsIm8JG5SlJtTnASZERCWSg4aZYriXqvUnI6mEpEGjz6fYzE+IIy8CZO
+urFWUGaRybKvBaPf3Y2Br7ZItZPOIBKTmcWuuFXpTv0+SBecRNXZaTX8U1UgWQHw
+34G6d2xNx7wsuIKzuF8DkIrty0mDx+qwCyaAoE0bMFFbCRu/Fk93rGVjp+ggl4Ps
+9DZ6W9OasPpZdJmrsayEWkMSQvcCJ+qs8x2xOdsGnIaAn98EzVvZ3H2Tnd7bmaAR
+CaeJK5hDGfTwGxRPQU69q/ySxksFDPzn1+6oK3CGKSk4M7rfl8P3MrliQE+VWX7/
+nGhK8o7LAgMBAAECggEAAfTqMyKh4eYrrGVAYPi53lG0/8htrwUVG3yFDXJo628p
+biCwSCsCavZJqi8JEOxOM5UvB1L2FauGh/7i/+VKkAUUOcOTPpvZguGTACBDcXYn
+Qd3Z2kkJmgn4Kbenr4uQCVOX8zT4F710rGW1nYCyoefsa4pw37UYSW52dH6kiwzW
+9k4X251nDMl/twBdOcjZbL768IEa5l4nySLpUNwfrVbSb1NzBoH0dVioh3DTLjt6
+gaShW4eIpaKczht1U97n6/7WNLl6vHX/mR99k/py8OhzhR1ccYpd2IfSHAWyQT0M
+K8BoNnkjICrr9oc0FCr2BVJa3IzKHlhukF4GTZiGYQKBgQDWCHTwAmwL4FFEBVhj
+pZne/sjaZc8TzPPxA8SkmxwDIZrM7tSu7qUuYgWTM432jZbLILWTyGfXf2PpqyF6
+wOpoBJj1ETkre8ZfRmYvsSvS5vtjF3Drszol+XvZnOclfB5VG3m5P2vYkQ8wI9OE
+Y5jUBgDj0RsCNd8QnrC1u54U/wKBgQDGrd5y8S9kUT0P0lkZit7bYjSPJExtClXt
+V7YNTjELrVCdc0jranxBWaub8NP3e6TGTi9HiQWvk2eOAS2qyccqlK4+YAK5XO3D
+EpFUNNcClq8CErw2POuCAKajrPuSp6vd6q8h4lTzDExVctQS4R9fRKKFBKkPUV5G
+UiKFllnKNQKBgQDBGIQXfLfpxwjKK2BhFihKDOc8UhmOrZtvV4zzTJTrJkg4l0f+
+QoN34ytQcHSleXwP6oSmvWkh/GYxjBj6XE2eZndwsYc4ecSwdB0A7gCxl345Gg7g
+NqRBWmGoJGxNXzsmYVFiFZvAmK5xKgFMMWbR8lCfOCn7xopmviSC8K9gFQKBgFRb
+KmH/SbH8VELNews/TVQ0pEBKlzCM/OLjJOcNVgGxOtM/Say677sHibeST0168AFK
+3QQwh3t+yK8gjPVA6xGHQ1w0g7OUY1c6IP5x2QC+XdwxfDxDLXNrN1WzcrVX/78f
+j/CBGrR/ekGlmanSb/GRQLfdvLJGSBLveLzjk4gpAoGBANN9RUm/aRz3dDBWex46
+kJ15xKJfLZiUeyDvY5+5d7YF4/tw5LU4XmKQNhiojHecykrTzPUMaGyMrbMPNn32
+WFW9CKMjuBEwWpMDJJb1/5NLEvpwu++sr7bUPZkQl76ot6OqgNHodbP8ATqrNr80
+5b8FrEN1LyfkTbabxNyAWcA0
+-----END PRIVATE KEY-----
diff --git a/plugins/tests/certs/clientintermediate-cert.pem b/plugins/tests/certs/clientintermediate-cert.pem
new file mode 100644
index 0000000..608a8fa
--- /dev/null
+++ b/plugins/tests/certs/clientintermediate-cert.pem
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----
+MIID2jCCAsKgAwIBAgIBAzANBgkqhkiG9w0BAQsFADCBoDELMAkGA1UEBhMCREUx
+EDAOBgNVBAgMB0JhdmFyaWExDzANBgNVBAcMBk11bmljaDEbMBkGA1UECgwSTW9u
+aXRvcmluZyBQbHVnaW5zMSQwIgYDVQQDDBtNb25pdG9yaW5nIFBsdWdpbnMgQ2xp
+ZW50Q0ExKzApBgkqhkiG9w0BCQEWHGRldmVsQG1vbml0b3JpbmctcGx1Z2lucy5v
+cmcwHhcNMjEwMjI4MjEwMjEyWhcNMzAxMTI4MjEwMjEyWjCBqjELMAkGA1UEBhMC
+REUxEDAOBgNVBAgMB0JhdmFyaWExDzANBgNVBAcMBk11bmljaDEbMBkGA1UECgwS
+TW9uaXRvcmluZyBQbHVnaW5zMS4wLAYDVQQDDCVNb25pdG9yaW5nIFBsdWdpbnMg
+Q2xpZW50SW50ZXJtZWRpYXRlMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9y
+aW5nLXBsdWdpbnMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
+6rUgOZ9pAOxrcgeeOT3Vmu1YmY2O/C9tXhpKzDzjTaWUzcdDg00KdsjXfgbDzSiV
+uvMzjX63aKpmqeFG+05D2VzQGit3knqerUgl10FnTotiJGF5CU5/gY1aPxTJ7rj2
+tD6LINBkJcPTyQ4MoJT19pssvCax9erY1RxoXxLblJ+31C+VvrftdmBP4nVKXK26
+4anb1oUQhkgpXpJimJBmF+v7NbDs1Wh21Be80KXUh9SKgePhSQblr2QlRcA7jLgJ
+4PMjZ+KYF+da+4RB7s+DvTXVDMn9AL84E1w5Ut1E8XZV+u4RjWPvNdhK/7GnuxOR
+C9SdxonqkPQ8hiI7thP9bQIDAQABoxMwETAPBgNVHRMBAf8EBTADAQH/MA0GCSqG
+SIb3DQEBCwUAA4IBAQDKQeiDbyr0/7sEhX33MmTDv84GeWgKl9qqHecx+d/0vImb
+c8XHK0PDa4lVqo/BW4P1hjKzpt2DW35kbOhuqGqM0lasIczef43aCDDEBLwstAe6
+qMoyWGVGoAQbpwT3li2pMrsIYoPwMvoSGNUphjrkdpviff2POkLly7a5RrR1X3qt
+Dai6eYbeMCr9NdgW7AZ5++/sKlFoe+zVk/Ed31s4D2lh3awrApZhVgcoquPmEwpt
+gm+OgRmHw50U4SF3ZaJPwDyLMbx+clH/bgUg0+Za9e53Br1NtGKmw7hh/7CG/hy0
+yxeLd930pH4vZu7s0XM56N/ckkfUzRkAH8dSmhH4
+-----END CERTIFICATE-----
diff --git a/plugins/tests/certs/clientintermediate-key.pem b/plugins/tests/certs/clientintermediate-key.pem
new file mode 100644
index 0000000..13f6887
--- /dev/null
+++ b/plugins/tests/certs/clientintermediate-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDqtSA5n2kA7Gty
+B545PdWa7ViZjY78L21eGkrMPONNpZTNx0ODTQp2yNd+BsPNKJW68zONfrdoqmap
+4Ub7TkPZXNAaK3eSep6tSCXXQWdOi2IkYXkJTn+BjVo/FMnuuPa0Posg0GQlw9PJ
+DgyglPX2myy8JrH16tjVHGhfEtuUn7fUL5W+t+12YE/idUpcrbrhqdvWhRCGSCle
+kmKYkGYX6/s1sOzVaHbUF7zQpdSH1IqB4+FJBuWvZCVFwDuMuAng8yNn4pgX51r7
+hEHuz4O9NdUMyf0AvzgTXDlS3UTxdlX67hGNY+812Er/sae7E5EL1J3GieqQ9DyG
+Iju2E/1tAgMBAAECggEACyYJXtNUoIeaXvM/r8ZhJBfMEpcnyJDUKBklnmfyABky
+ZUfmzBDXw2as3b6ihFc+LYAp3bm8KouVjtI1lfBUxrli5StVZa7PZLm9mmjv6Eo0
+ojfDEQ8afWPieoaZRO6iQVOLNkbPyv9vSuiQ7vvEZy9dw54u69h47j6IMqPprDiG
+ropUNeGAvTnh1Vf9/8aCHEvHUNHcc4zjzGiQ+E60JgnbpGVeJKoeiMgrQE0yjweo
+KyKA47Y6vqP6+AxAaPplXtmrx2UCbMjktHNvLvg42+2UlLS5roiwmJYEN9c6iT6t
+y82MJrjEFGZyLG2u6ZQANSJiIWaCnOyT1o2deJ8NoQKBgQD7UxivDTuljQD0so+E
+JX9UaFZ9PgS+8LC9v56PciL4XQ7bcCVP5vVgZZPABiQ9i989Wq7qI042Jrfu5qtE
+SthlOAu80GvAQV+Oujwo7ZzM6ciQtjMsj63r2uayWXnmQ07QcIg7x7y161Pt9Bqr
+LIDrqHziIj/lzT7+6QKZaQwFaQKBgQDvEuSC14CBlMhy2jji71kB/3Ya3c+8dP+A
+kQZL9wEWK4a4dm8IaTS8jl1/luhQUzFRMyh2rWaTqqigSe3dvs5DRblhE5NPwTSI
+9TO7t1EnzjW3R8LxZZsySyiSFnZ/8mR0empxq0Mov37OdXBj0tXuuzREf/hwijWh
+WuLxJUSjZQKBgAIDZ2Y3l+u6lnBfYdDwL/XwJAk6zvTsnq3WdCG4C1mr/St62YGr
+WvnbtnRKWE356d7m9BHCGKVMaBrM1EBmzRb6fPWVQde3blmJWmQFi0UE9mtaWkyY
+Fg+WoFR7bQOQNHhs/lpkPjnC2dhFJVWLtLiuj9mL5rEjlMab/T5XXhZJAoGBAMEP
+FZ8fXbPGrTQqSwPfWpZFcF9zvbynEmkFM/uGRMddcNZnNXSqWJ7nrFNLTuEGvW2g
+DU4A6zPV/YQrDz4hRjmHBZOCFlSyZbUvpY4yFAQ7/p66AY+kiHZNwT5vi1P5Luvs
+qyaNsZcnRMR+i7rg2EeHv0aNvNdMlNBvL5KikNINAoGAU2P/phdwJOUcqgHavQcQ
+ureTEyZ5i5AeNomNeHSj0slG24V9nxOqEL7D00JKln7oAPovYBUWocEnF39uBJe0
+p0Hy7fCCK6EI8/0QyiQuuZmJfDEEvjQqE6irONNH63r2UwDEpDNGFvGsZNuWHLZc
+SXADu5oSNu6o6IydiyOx528=
+-----END PRIVATE KEY-----
diff --git a/plugins/tests/certs/expired-cert.pem b/plugins/tests/certs/expired-cert.pem
new file mode 100644
index 0000000..87fc8e4
--- /dev/null
+++ b/plugins/tests/certs/expired-cert.pem
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEETCCAvmgAwIBAgIUVDKkhcUoYFnjYCw12tScPIqQzqIwDQYJKoZIhvcNAQEL
+BQAwgZcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZN
+dW5pY2gxGzAZBgNVBAoMEk1vbml0b3JpbmcgUGx1Z2luczEbMBkGA1UEAwwSTW9u
+aXRvcmluZyBQbHVnaW5zMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9yaW5n
+LXBsdWdpbnMub3JnMB4XDTA4MDEwMTEyMDAwMFoXDTA4MDEwMjEyMDAwMFowgZcx
+CzAJBgNVBAYTAkRFMRAwDgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZNdW5pY2gx
+GzAZBgNVBAoMEk1vbml0b3JpbmcgUGx1Z2luczEbMBkGA1UEAwwSTW9uaXRvcmlu
+ZyBQbHVnaW5zMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9yaW5nLXBsdWdp
+bnMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwg1dmGT3rVqM
+beVWWLy8EAiq9re07AF8sTERy9oIYF5EUq9f0xO53mwwqIWV77O9mF99/kDFGQuQ
+NOnICMSHXNtMXEXzfBaMighw0uyCh1o/VCejNQ5x/HU8aLh930g5DIcOJQ3fZ4v9
+8kBaie7+aPgRMVDM1vIrILfedq9Kt56zvPizkXhDeqxjKyIZdrdoBlX5zAfftWtY
+HpQ+lkThSSXqQnchN6S2JFejmRtsNnceDVOBBdvlzmH0NlfwjynLK3/EJooTsINy
+i9dXD8/Oe8r+UA+nokWvnWC2IAUJjpxW+XAyTG/NofGwX+PwquT0YD5cSlODIwZA
+WAimygWLqQIDAQABo1MwUTAdBgNVHQ4EFgQUsKyJAwR9OXWEcSZMQz73GfpxCJIw
+HwYDVR0jBBgwFoAUsKyJAwR9OXWEcSZMQz73GfpxCJIwDwYDVR0TAQH/BAUwAwEB
+/zANBgkqhkiG9w0BAQsFAAOCAQEAYKFGX7J3Fc/T9s278w61E2dSsY4DS/mjSDik
+fMWvod6eKw0fE3wJOnkWxjEH3VywTY6CmHd/oiJOaD8lr/Vk+BJfYNVBaVNmguyg
+4LXoWz9Benx0bAIeuDbNAhOvA4H4aIz8UrD9lKFvKdRp42gPMLtMEbzbLcBdT95D
+6BX7EhYm7vTnpitLPgFxVCsJ1JFqv2AQfUm+IkqQkezPs5x0tWLyrvCDNRGJ0kfv
+UuowpUZXDOh3k1vB+xaSOFviieLaCW8TSdd5FZgI2HQj4e6vCKsMGuKKZXrMUTI/
+qtrFlUfsOuwourfC5LMHtCyYo5B3uvAWT1eTXxhrGqyleSlxJQ==
+-----END CERTIFICATE-----
diff --git a/plugins/tests/certs/expired-key.pem b/plugins/tests/certs/expired-key.pem
new file mode 100644
index 0000000..c5bba56
--- /dev/null
+++ b/plugins/tests/certs/expired-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDCDV2YZPetWoxt
+5VZYvLwQCKr2t7TsAXyxMRHL2ghgXkRSr1/TE7nebDCohZXvs72YX33+QMUZC5A0
+6cgIxIdc20xcRfN8FoyKCHDS7IKHWj9UJ6M1DnH8dTxouH3fSDkMhw4lDd9ni/3y
+QFqJ7v5o+BExUMzW8isgt952r0q3nrO8+LOReEN6rGMrIhl2t2gGVfnMB9+1a1ge
+lD6WROFJJepCdyE3pLYkV6OZG2w2dx4NU4EF2+XOYfQ2V/CPKcsrf8QmihOwg3KL
+11cPz857yv5QD6eiRa+dYLYgBQmOnFb5cDJMb82h8bBf4/Cq5PRgPlxKU4MjBkBY
+CKbKBYupAgMBAAECggEBAJ2mdCKJ7LoWdT4W8pZ3BqZUFGkKCF8wOhhOUDH3+ZQp
+IYK3XbdDMF7mMIXIuW4a7W4sLlTwU/Ar98U1JMESwRIMS7YvUke+ngDKKLcDVGwY
+Qpjg9vP0v2Al8qT1NbW/nDF0S2aJJbWfAvnblHK5ClFHL9iL107NQYJ8PqzXbnFL
+gCQRiZxVHlrbn/73ZUMHPGEoU0711U9hSjrsqrRuSAMC+V38s4HxOomZWutlVAHF
+HwClNZBqRO+a2njPyUuV9DM/rl5Tm9IQ89iFo3/QEORICK77HjJYhi+UzdfI5F35
+UntRJt+WLaiAP+K6Vt6oxHSm58qXnOkeLzaAunTTie0CgYEA6OLYfme8xe5zYXWX
+rqmKNYdcVfMkvL+vUfVT475o/piRtE54JC1LYWEFAN8paxEWHD5HZMy0+ONNXfGm
+zyNNTN/Lagz4WcpdFzKQmhfdro7DzRiDfdvwSLmaZDyE41PPPVVvfrI9IeDiUNY4
+nWLSb3sWo96Iuns+RoMqeA9wkqsCgYEA1U/UqeVQVTPlrWyiB2VXoI1xvFCCJTf8
+4NC0gcisxLRrtINk0BwrUJrRy0x1OLpJWiKwUl/W1GgvPPfhbYcUOb669JNtTIjY
+FeIZblCTjz9GzKKmXeDciXvccyEdCJVUlPO3/e2JiJ4mCDjULprifq0a2gcQevFS
+PfqVULhBOvsCgYB5KfS7J1vGmv36ucSWAe0/VlKLATqe3RfpCzt/JQTZWSWNaroF
+EG/ElUaWIoUZCEW5oglg/0Q0rYYGF4DTCingkhrx7ReVF70BIbSsBzi15d8nKNbY
+t4I3RCF4fyggYe1TmsysXS2DH85/gkToVY7oo2CvF0uJwi8vXnTNDDNkiwKBgHKs
+mAc94BHt9GtnGzQepx0I7TvvjAe2MZwqlt+uojKdS8mfWXMHscGDeYVxdRMqEoUC
+YQfnvfYyjDKaj/XxyE3C237gQsICTyh0hHdpmepIeidIyWdumyDOFZVPF+ylWvM4
+kpFQQb/QRWHmKyti2KCBLw5G/fUaBryLGfprE6ZBAoGBANy5rr41A679UQZ0abev
+bOZb7YWOHYp/wReJaQbvLAyR30os3aEY/0ht9S+OWdrgGMezPKvsx2Sqr/CwoFXI
+esiklpknr11maEPxnQJYi4FYiXS1a3NCg7yBvKzFEgx2XnMAC3s6zhuZXaFq4zNu
+pm5Btrq/NZqtVXovS+UhGLvJ
+-----END PRIVATE KEY-----
diff --git a/plugins/tests/certs/ext.cnf b/plugins/tests/certs/ext.cnf
new file mode 100644
index 0000000..d09cee1
--- /dev/null
+++ b/plugins/tests/certs/ext.cnf
@@ -0,0 +1,2 @@
+[ client_ca ]
+basicConstraints = critical, CA:true
diff --git a/plugins/tests/certs/generate-certs.sh b/plugins/tests/certs/generate-certs.sh
new file mode 100755
index 0000000..78660a2
--- /dev/null
+++ b/plugins/tests/certs/generate-certs.sh
@@ -0,0 +1,63 @@
+#!/bin/sh -e
+#
+# Recreates the https server certificates
+#
+# Set the GEN_EXPIRED environment variable to also regenerate
+# the expired certificate.
+
+cd "$(dirname "$0")"
+trap 'rm -f *.csr; rm -f clientca-cert.srl' EXIT
+
+subj() {
+ c="DE"
+ st="Bavaria"
+ l="Munich"
+ o="Monitoring Plugins"
+ cn="Monitoring Plugins"
+ emailAddress="devel@monitoring-plugins.org"
+
+ if [ -n "$1" ]; then
+ # Add to CN
+ cn="$cn $1"
+ fi
+
+ printf "/C=%s/ST=%s/L=%s/O=%s/CN=%s/emailAddress=%s" \
+ "$c" "$st" "$l" "$o" "$cn" "$emailAddress"
+}
+
+# server
+openssl req -new -x509 -days 3560 -nodes \
+ -keyout server-key.pem -out server-cert.pem \
+ -subj "$(subj)"
+# server, expired
+# there is generally no need to regenerate this, as it will stay epxired
+[ -n "$GEN_EXPIRED" ] && TZ=UTC faketime -f '2008-01-01 12:00:00' \
+ openssl req -new -x509 -days 1 -nodes \
+ -keyout expired-key.pem -out expired-cert.pem \
+ -subj "$(subj)"
+
+# client, ca
+openssl req -new -x509 -days 3560 -nodes \
+ -keyout clientca-key.pem -out clientca-cert.pem \
+ -subj "$(subj ClientCA)"
+echo "01" >clientca-cert.srl
+# client
+openssl req -new -nodes \
+ -keyout client-key.pem -out client-cert.csr \
+ -subj "$(subj Client)"
+openssl x509 -days 3560 -req -CA clientca-cert.pem -CAkey clientca-key.pem \
+ -in client-cert.csr -out client-cert.pem
+# client, intermediate
+openssl req -new -nodes \
+ -keyout clientintermediate-key.pem -out clientintermediate-cert.csr \
+ -subj "$(subj ClientIntermediate)"
+openssl x509 -days 3560 -req -CA clientca-cert.pem -CAkey clientca-key.pem \
+ -extfile ext.cnf -extensions client_ca \
+ -in clientintermediate-cert.csr -out clientintermediate-cert.pem
+# client, chain
+openssl req -new -nodes \
+ -keyout clientchain-key.pem -out clientchain-cert.csr \
+ -subj "$(subj ClientChain)"
+openssl x509 -days 3560 -req -CA clientca-cert.pem -CAkey clientca-key.pem \
+ -in clientchain-cert.csr -out clientchain-cert.pem
+cat clientintermediate-cert.pem >>clientchain-cert.pem
diff --git a/plugins/tests/certs/server-cert.pem b/plugins/tests/certs/server-cert.pem
new file mode 100644
index 0000000..d1249ef
--- /dev/null
+++ b/plugins/tests/certs/server-cert.pem
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIIEETCCAvmgAwIBAgIUZwOhY4myaCUaPek3NM+MxbLG9vwwDQYJKoZIhvcNAQEL
+BQAwgZcxCzAJBgNVBAYTAkRFMRAwDgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZN
+dW5pY2gxGzAZBgNVBAoMEk1vbml0b3JpbmcgUGx1Z2luczEbMBkGA1UEAwwSTW9u
+aXRvcmluZyBQbHVnaW5zMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9yaW5n
+LXBsdWdpbnMub3JnMB4XDTIxMDIyODIxMDIxMVoXDTMwMTEyODIxMDIxMVowgZcx
+CzAJBgNVBAYTAkRFMRAwDgYDVQQIDAdCYXZhcmlhMQ8wDQYDVQQHDAZNdW5pY2gx
+GzAZBgNVBAoMEk1vbml0b3JpbmcgUGx1Z2luczEbMBkGA1UEAwwSTW9uaXRvcmlu
+ZyBQbHVnaW5zMSswKQYJKoZIhvcNAQkBFhxkZXZlbEBtb25pdG9yaW5nLXBsdWdp
+bnMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2/3eBA4WG6xz
+LfM6xcWywxThb1Rp7XAW3ewQd9/PdoWXEe8BJWlLfyYi1drLMcsDywhLkKmW4Vp9
+1R4PAkiljjrB/ZaUMDLJ1ri3dwX4RvXG7crsU3QWFWCBOrf5V2FTRQ2m/H/KyB/6
+rVZANsU47HqTFSPiUm2j7P3wx/wtHeYC+qmNG7zZTjAYPYxfKiod0lytTSmb+h54
+6lxn3+VPEXZAQZlLvPnm/58JnXGrUv7B2yocf5MhKkLJOrGxH2hfwKISfaj2gpOV
+m4PUVYiDzCSpq1fPvwbUxIvdO27xprx+mrGOFM6f2UCEOc35w8FSmYiR2yQTnEJK
+pbSQD6t1jQIDAQABo1MwUTAdBgNVHQ4EFgQUMeYgglT2aWDlF8KEeF2376AlTGYw
+HwYDVR0jBBgwFoAUMeYgglT2aWDlF8KEeF2376AlTGYwDwYDVR0TAQH/BAUwAwEB
+/zANBgkqhkiG9w0BAQsFAAOCAQEAFcEg83rTJdgkp7JLYqK0j8JogSHNlDYchr/r
+VxKBgQwfnjSp5A8d5+uTQ9s3QDabw8v7YeSrzYXbbjuWZ61mnl84tzOQ8LMeESnC
+CBXRCxB8Ow22WsVTVJq279SGYT+cZrdsmqGVWDi1A0C5kH+XTLAioG5CZmmxemD/
+S92ZoRxGyYfg33r+3X6EMcEYtHKGxCUa3EPcPOL4dq2F3nOnyjiWPZm3786H3NY2
+nsYwrEhAdUFtbYSsV5O0c/Zlc33fmTfh654ab35io1DtwmFo7q8J532dUE007EN0
+mIQmhdrjNJJHIftgSt0fuN5m48oLOnX7vvkz+X0WLWfVTtMr0w==
+-----END CERTIFICATE-----
diff --git a/plugins/tests/certs/server-key.pem b/plugins/tests/certs/server-key.pem
new file mode 100644
index 0000000..0de63f8
--- /dev/null
+++ b/plugins/tests/certs/server-key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDb/d4EDhYbrHMt
+8zrFxbLDFOFvVGntcBbd7BB33892hZcR7wElaUt/JiLV2ssxywPLCEuQqZbhWn3V
+Hg8CSKWOOsH9lpQwMsnWuLd3BfhG9cbtyuxTdBYVYIE6t/lXYVNFDab8f8rIH/qt
+VkA2xTjsepMVI+JSbaPs/fDH/C0d5gL6qY0bvNlOMBg9jF8qKh3SXK1NKZv6Hnjq
+XGff5U8RdkBBmUu8+eb/nwmdcatS/sHbKhx/kyEqQsk6sbEfaF/AohJ9qPaCk5Wb
+g9RViIPMJKmrV8+/BtTEi907bvGmvH6asY4Uzp/ZQIQ5zfnDwVKZiJHbJBOcQkql
+tJAPq3WNAgMBAAECggEBAIvJDUjQVpXxByL8eazviT5SR0jBf6mC3tTWykQRb7ck
+/bBEiRrnhDRf3CS9KP4TvO5G8BUU3a2GHYzM08akuKXeiiODidfyfbQ1nUZBAdi9
+FVFF7tK8YcflkVfpTMOMMSggm6m33fc58sQvmQ/0U85XuJvnOEkeJ9pQJa49e8GR
+lpCQImF7ygltHPEz4o8qOtNMuPxiHOxpc517+ozQULZk153NTfGok1XctDFFZ3YX
+8okLSfcqZ28mdHYSvI9xf60Cm7cT9tunXHwZ0f1esTFiVYpAp+oTJqtdYxr/fYlL
+oO8G8iIQ7LjdJfgo84PscpKdSRCq3BfnmER1Eyg6hrUCgYEA/0hL5Y/haz/2jYGy
+aa8yZSuD1ZcWtj7pLKrBQnHPHIHsjSBggWhopvonCFvCjgSS1pOFOUAwMGc0T+Dw
+rWo3w8cEUyECl3Bw8gbCWtRXaigzU9TPgCWyx1j5dTopQhLObzS/m7fJFElnYNru
+jqhsUfWS+NKk8a5+A7i9lv4iBLMCgYEA3Jws3Lfj/Xs7LljrvryTMpPthvUGBcyt
+U9Qmf1Hmur90RP5V1rx4FqPQzIeaGQyZDNIUnkhBSqQZNCts3Rzay7N4uQzk8OEg
+S8Llnw76wLwi0SJ4okDtT5tpTR6fcS0M9lGN+zvvfUB4+ul8oub0pMcyme/pywEz
+ap+x3xAQPL8CgYEAiYOBVtTNof9fqdRurh1w8SyipKDx3BRBeQ02c7tozLt0GIWT
+VsJOdXwVIJyFTglKrAnlXvSjwL8nX8wU+eVYyr5fJwSGJ9urC8T2VwVBXW7wTz04
+1Zf5GQdlwW8mIHCPATqR6Kj0yVfNN1BX50L0rqWxmRWnQoUzXn/aqQaWfp8CgYAW
+9693/zEeR8EejyVkAy/z+RCml0XcPrXg31pusPErihkpwazgIVkDSmTHlmqFpxkc
+C5cX73/UrIbvNoIr9wAUawfrhBsltNpu6MiNKbsTa8LYMRWMFuReAFkTLVf+KWmL
+D2yPtmq1iIvP25UdRJw9t3teKWsWtnZK6HtVNM/r8wKBgQDKlqUpy8r4KK+S2w80
+H7rAQJo1DgXsYrgSa2gfppSKro4lm3ltyAfVIrKQKP7uCo9xTGKVQAUPttMs2+17
+nwbwvt7/nG7G1Dk/C/t6b7SJ80VY5b9ZZKIJ0wOjajLufSjPNCe0ZTRn32XusZUn
+nYGB5/QXYr5WGV9YhAkRsFJYgA==
+-----END PRIVATE KEY-----
diff --git a/plugins/tests/check_curl.t b/plugins/tests/check_curl.t
new file mode 100755
index 0000000..3c91483
--- /dev/null
+++ b/plugins/tests/check_curl.t
@@ -0,0 +1,526 @@
+#! /usr/bin/perl -w -I ..
+#
+# Test check_http by having an actual HTTP server running
+#
+# To create the https server certificate:
+# openssl req -new -x509 -keyout server-key.pem -out server-cert.pem -days 3650 -nodes
+# to create a new expired certificate:
+# faketime '2008-01-01 12:00:00' openssl req -new -x509 -keyout expired-key.pem -out expired-cert.pem -days 1 -nodes
+# Country Name (2 letter code) [AU]:DE
+# State or Province Name (full name) [Some-State]:Bavaria
+# Locality Name (eg, city) []:Munich
+# Organization Name (eg, company) [Internet Widgets Pty Ltd]:Monitoring Plugins
+# Organizational Unit Name (eg, section) []:
+# Common Name (e.g. server FQDN or YOUR name) []:Monitoring Plugins
+# Email Address []:devel@monitoring-plugins.org
+
+use strict;
+use Test::More;
+use NPTest;
+use FindBin qw($Bin);
+
+$ENV{'LC_TIME'} = "C";
+
+my $common_tests = 73;
+my $ssl_only_tests = 8;
+# Check that all dependent modules are available
+eval "use HTTP::Daemon 6.01;";
+plan skip_all => 'HTTP::Daemon >= 6.01 required' if $@;
+eval {
+ require HTTP::Status;
+ require HTTP::Response;
+};
+
+my $plugin = 'check_http';
+$plugin = 'check_curl' if $0 =~ m/check_curl/mx;
+
+# look for libcurl version to see if some advanced checks are possible (>= 7.49.0)
+my $advanced_checks = 12;
+my $use_advanced_checks = 0;
+my $required_version = '7.49.0';
+my $virtual_host = 'www.somefunnyhost.com';
+my $virtual_port = 42;
+my $curl_version = '';
+open (my $fh, '-|', "./$plugin --version") or die;
+while (<$fh>) {
+ if (m{libcurl/([\d.]+)\s}) {
+ $curl_version = $1;
+ last;
+ }
+}
+close ($fh);
+if ($curl_version) {
+ my ($major, $minor, $release) = split (/\./, $curl_version);
+ my ($req_major, $req_minor, $req_release) = split (/\./, $required_version);
+ my $check = ($major <=> $req_major or $minor <=> $req_minor or $release <=> $req_release);
+ if ($check >= 0) {
+ $use_advanced_checks = 1;
+ print "Found libcurl $major.$minor.$release. Using advanced checks\n";
+ }
+}
+
+if ($@) {
+ plan skip_all => "Missing required module for test: $@";
+} else {
+ if (-x "./$plugin") {
+ plan tests => $common_tests * 2 + $ssl_only_tests + $advanced_checks;
+ } else {
+ plan skip_all => "No $plugin compiled";
+ }
+}
+
+my $servers = { http => 0 }; # HTTP::Daemon should always be available
+eval { require HTTP::Daemon::SSL };
+if ($@) {
+ diag "Cannot load HTTP::Daemon::SSL: $@";
+} else {
+ $servers->{https} = 0;
+}
+
+# set a fixed version, so the header size doesn't vary
+$HTTP::Daemon::VERSION = "1.00";
+
+my $port_http = 50000 + int(rand(1000));
+my $port_https = $port_http + 1;
+my $port_https_expired = $port_http + 2;
+
+# This array keeps sockets around for implementing timeouts
+my @persist;
+
+# Start up all servers
+my @pids;
+my $pid = fork();
+if ($pid) {
+ # Parent
+ push @pids, $pid;
+ if (exists $servers->{https}) {
+ # Fork a normal HTTPS server
+ $pid = fork();
+ if ($pid) {
+ # Parent
+ push @pids, $pid;
+ # Fork an expired cert server
+ $pid = fork();
+ if ($pid) {
+ push @pids, $pid;
+ } else {
+ my $d = HTTP::Daemon::SSL->new(
+ LocalPort => $port_https_expired,
+ LocalAddr => "127.0.0.1",
+ SSL_cert_file => "$Bin/certs/expired-cert.pem",
+ SSL_key_file => "$Bin/certs/expired-key.pem",
+ ) || die;
+ print "Please contact https expired at: <URL:", $d->url, ">\n";
+ run_server( $d );
+ exit;
+ }
+ } else {
+ my $d = HTTP::Daemon::SSL->new(
+ LocalPort => $port_https,
+ LocalAddr => "127.0.0.1",
+ SSL_cert_file => "$Bin/certs/server-cert.pem",
+ SSL_key_file => "$Bin/certs/server-key.pem",
+ ) || die;
+ print "Please contact https at: <URL:", $d->url, ">\n";
+ run_server( $d );
+ exit;
+ }
+ }
+} else {
+ # Child
+ #print "child\n";
+ my $d = HTTP::Daemon->new(
+ LocalPort => $port_http,
+ LocalAddr => "127.0.0.1",
+ ) || die;
+ print "Please contact http at: <URL:", $d->url, ">\n";
+ run_server( $d );
+ exit;
+}
+
+# give our webservers some time to startup
+sleep(3);
+
+# Run the same server on http and https
+sub run_server {
+ my $d = shift;
+ MAINLOOP: while (my $c = $d->accept ) {
+ while (my $r = $c->get_request) {
+ if ($r->method eq "GET" and $r->url->path =~ m^/statuscode/(\d+)^) {
+ $c->send_basic_header($1);
+ $c->send_crlf;
+ } elsif ($r->method eq "GET" and $r->url->path =~ m^/file/(.*)^) {
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_file_response("$Bin/var/$1");
+ } elsif ($r->method eq "GET" and $r->url->path eq "/slow") {
+ $c->send_basic_header;
+ $c->send_crlf;
+ sleep 1;
+ $c->send_response("slow");
+ } elsif ($r->url->path eq "/method") {
+ if ($r->method eq "DELETE") {
+ $c->send_error(HTTP::Status->RC_METHOD_NOT_ALLOWED);
+ } elsif ($r->method eq "foo") {
+ $c->send_error(HTTP::Status->RC_NOT_IMPLEMENTED);
+ } else {
+ $c->send_status_line(200, $r->method);
+ }
+ } elsif ($r->url->path eq "/postdata") {
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_response($r->method.":".$r->content);
+ } elsif ($r->url->path eq "/redirect") {
+ $c->send_redirect( "/redirect2" );
+ } elsif ($r->url->path eq "/redir_external") {
+ $c->send_redirect(($d->isa('HTTP::Daemon::SSL') ? "https" : "http") . "://169.254.169.254/redirect2" );
+ } elsif ($r->url->path eq "/redirect2") {
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' ));
+ } elsif ($r->url->path eq "/redir_timeout") {
+ $c->send_redirect( "/timeout" );
+ } elsif ($r->url->path eq "/timeout") {
+ # Keep $c from being destroyed, but prevent severe leaks
+ unshift @persist, $c;
+ delete($persist[1000]);
+ next MAINLOOP;
+ } elsif ($r->url->path eq "/header_check") {
+ $c->send_basic_header;
+ $c->send_header('foo');
+ $c->send_crlf;
+ } elsif ($r->url->path eq "/header_broken_check") {
+ $c->send_basic_header;
+ $c->send_header('foo');
+ print $c "Test1:: broken\n";
+ print $c " Test2: leading whitespace\n";
+ $c->send_crlf;
+ } elsif ($r->url->path eq "/virtual_port") {
+ # return sent Host header
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_response(HTTP::Response->new( 200, 'OK', undef, $r->header ('Host')));
+ } elsif ($r->url->path eq "/chunked") {
+ my $chunks = ["chunked", "encoding", "test\n"];
+ $c->send_response(HTTP::Response->new( 200, 'OK', undef, sub {
+ my $chunk = shift @{$chunks};
+ return unless $chunk;
+ sleep(1);
+ return($chunk);
+ }));
+ } else {
+ $c->send_error(HTTP::Status->RC_FORBIDDEN);
+ }
+ $c->close;
+ }
+ }
+}
+
+END {
+ foreach my $pid (@pids) {
+ if ($pid) { print "Killing $pid\n"; kill "INT", $pid }
+ }
+};
+
+if ($ARGV[0] && $ARGV[0] eq "-d") {
+ while (1) {
+ sleep 100;
+ }
+}
+
+my $result;
+my $command = "./$plugin -H 127.0.0.1";
+
+run_common_tests( { command => "$command -p $port_http" } );
+SKIP: {
+ skip "HTTP::Daemon::SSL not installed", $common_tests + $ssl_only_tests if ! exists $servers->{https};
+ run_common_tests( { command => "$command -p $port_https", ssl => 1 } );
+
+ my $expiry = "Thu Nov 28 21:02:11 2030 +0000";
+
+ $result = NPTest->testCmd( "$command -p $port_https -S -C 14" );
+ is( $result->return_code, 0, "$command -p $port_https -S -C 14" );
+ is( $result->output, "OK - Certificate 'Monitoring Plugins' will expire on $expiry.", "output ok" );
+
+ $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" );
+ is( $result->return_code, 1, "$command -p $port_https -S -C 14000" );
+ like( $result->output, '/WARNING - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(' . quotemeta($expiry) . '\)./', "output ok" );
+
+ # Expired cert tests
+ $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" );
+ is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" );
+ like( $result->output, '/CRITICAL - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(' . quotemeta($expiry) . '\)./', "output ok" );
+
+ $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
+ is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );
+ is( $result->output,
+ 'CRITICAL - Certificate \'Monitoring Plugins\' expired on Wed Jan 2 12:00:00 2008 +0000.',
+ "output ok" );
+
+}
+
+my $cmd;
+
+# advanced checks with virtual hostname and virtual port
+SKIP: {
+ skip "libcurl version is smaller than $required_version", 6 unless $use_advanced_checks;
+
+ # http without virtual port
+ $cmd = "./$plugin -H $virtual_host -I 127.0.0.1 -p $port_http -u /virtual_port -r ^$virtual_host:$port_http\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # http with virtual port (!= 80)
+ $cmd = "./$plugin -H $virtual_host:$virtual_port -I 127.0.0.1 -p $port_http -u /virtual_port -r ^$virtual_host:$virtual_port\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # http with virtual port (80)
+ $cmd = "./$plugin -H $virtual_host:80 -I 127.0.0.1 -p $port_http -u /virtual_port -r ^$virtual_host\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+}
+
+# and the same for SSL
+SKIP: {
+ skip "libcurl version is smaller than $required_version and/or HTTP::Daemon::SSL not installed", 6 if ! exists $servers->{https} or not $use_advanced_checks;
+ # https without virtual port
+ $cmd = "./$plugin -H $virtual_host -I 127.0.0.1 -p $port_https --ssl -u /virtual_port -r ^$virtual_host:$port_https\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # https with virtual port (!= 443)
+ $cmd = "./$plugin -H $virtual_host:$virtual_port -I 127.0.0.1 -p $port_https --ssl -u /virtual_port -r ^$virtual_host:$virtual_port\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # https with virtual port (443)
+ $cmd = "./$plugin -H $virtual_host:443 -I 127.0.0.1 -p $port_https --ssl -u /virtual_port -r ^$virtual_host\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+}
+
+
+sub run_common_tests {
+ my ($opts) = @_;
+ my $command = $opts->{command};
+ if ($opts->{ssl}) {
+ $command .= " --ssl";
+ }
+
+ $result = NPTest->testCmd( "$command -u /file/root" );
+ is( $result->return_code, 0, "/file/root");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u /file/root -s Root" );
+ is( $result->return_code, 0, "/file/root search for string");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u /file/root -s NonRoot" );
+ is( $result->return_code, 2, "Missing string check");
+ like( $result->output, qr%^HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRoot' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location");
+
+ $result = NPTest->testCmd( "$command -u /file/root -s NonRootWithOver30charsAndMoreFunThanAWetFish" );
+ is( $result->return_code, 2, "Missing string check");
+ like( $result->output, qr%HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRootWithOver30charsAndM...' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location");
+
+ $result = NPTest->testCmd( "$command -u /header_check -d foo" );
+ is( $result->return_code, 0, "header_check search for string");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 96 bytes in [\d\.]+ second/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u /header_check -d bar" );
+ is( $result->return_code, 2, "Missing header string check");
+ like( $result->output, qr%^HTTP CRITICAL: HTTP/1\.1 200 OK - header 'bar' not found on 'https?://127\.0\.0\.1:\d+/header_check'%, "Shows search string and location");
+
+ $result = NPTest->testCmd( "$command -u /header_broken_check" );
+ is( $result->return_code, 0, "header_check search for string");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 138 bytes in [\d\.]+ second/', "Output correct" );
+
+ my $cmd;
+ $cmd = "$command -u /slow";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, "$cmd");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+ $result->output =~ /in ([\d\.]+) second/;
+ cmp_ok( $1, ">", 1, "Time is > 1 second" );
+
+ $cmd = "$command -u /statuscode/200";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/200 -e 200";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - Status line output matched "200" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 201 Created - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201 -e 201";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 201 Created - Status line output matched "201" - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201 -e 200";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 2, $cmd);
+ like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port \d+: HTTP/1.1 201 Created/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/200 -e 200,201,202";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201 -e 200,201,202";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 201 Created - Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/203 -e 200,201,202";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 2, $cmd);
+ like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port (\d+): HTTP/1.1 203 Non-Authoritative Information/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j HEAD -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 HEAD - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j POST -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 POST - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j GET -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 GET - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 GET - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -P foo -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 POST - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j DELETE -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 1, $cmd);
+ like( $result->output, '/^HTTP WARNING: HTTP/1.1 405 Method Not Allowed/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j foo -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 2, $cmd);
+ like( $result->output, '/^HTTP CRITICAL: HTTP/1.1 501 Not Implemented/', "Output correct: ".$result->output );
+
+ $cmd = "$command -P stufftoinclude -u /postdata -s POST:stufftoinclude";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j PUT -P stufftoinclude -u /postdata -s PUT:stufftoinclude";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # To confirm that the free doesn't segfault
+ $cmd = "$command -P stufftoinclude -j PUT -u /postdata -s PUT:stufftoinclude";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /redirect";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 301 Moved Permanently - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f follow -u /redirect";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 301 Moved Permanently - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f follow -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f sticky -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f stickyport -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # These tests may block
+ print "ALRM\n";
+
+ # stickyport - on full urlS port is set back to 80 otherwise
+ $cmd = "$command -f stickyport -u /redir_external -t 5 -s redirected";
+ eval {
+ local $SIG{ALRM} = sub { die "alarm\n" };
+ alarm(2);
+ $result = NPTest->testCmd( $cmd );
+ };
+ alarm(0);
+ isnt( $@, "alarm\n", $cmd );
+ is( $result->return_code, 0, $cmd );
+
+ # Let's hope there won't be any web server on :80 returning "redirected"!
+ $cmd = "$command -f sticky -u /redir_external -t 5 -s redirected";
+ eval {
+ local $SIG{ALRM} = sub { die "alarm\n" };
+ alarm(2);
+ $result = NPTest->testCmd( $cmd );
+ };
+ alarm(0);
+ isnt( $@, "alarm\n", $cmd );
+ isnt( $result->return_code, 0, $cmd );
+
+ # Test an external address - timeout
+ SKIP: {
+ skip "This doesn't seem to work all the time", 1 unless ($ENV{HTTP_EXTERNAL});
+ $cmd = "$command -f follow -u /redir_external -t 5";
+ eval {
+ $result = NPTest->testCmd( $cmd, 2 );
+ };
+ like( $@, "/timeout in command: $cmd/", $cmd );
+ }
+
+ $cmd = "$command -u /timeout -t 5";
+ eval {
+ $result = NPTest->testCmd( $cmd, 2 );
+ };
+ like( $@, "/timeout in command: $cmd/", $cmd );
+
+ $cmd = "$command -f follow -u /redir_timeout -t 2";
+ eval {
+ $result = NPTest->testCmd( $cmd, 5 );
+ };
+ is( $@, "", $cmd );
+
+ $cmd = "$command -u /chunked -s 'chunkedencodingtest' -d 'Transfer-Encoding: chunked'";
+ eval {
+ $result = NPTest->testCmd( $cmd, 5 );
+ };
+ is( $@, "", $cmd );
+}
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t
new file mode 100755
index 0000000..6078b27
--- /dev/null
+++ b/plugins/tests/check_http.t
@@ -0,0 +1,581 @@
+#! /usr/bin/perl -w -I ..
+#
+# Test check_http by having an actual HTTP server running
+#
+# To create the https server certificate:
+# ./certs/generate-certs.sh
+
+use strict;
+use Test::More;
+use NPTest;
+use FindBin qw($Bin);
+use IO::Socket::INET;
+
+$ENV{'LC_TIME'} = "C";
+
+my $common_tests = 71;
+my $virtual_port_tests = 8;
+my $ssl_only_tests = 12;
+my $chunked_encoding_special_tests = 1;
+# Check that all dependent modules are available
+eval "use HTTP::Daemon 6.01;";
+plan skip_all => 'HTTP::Daemon >= 6.01 required' if $@;
+eval {
+ require HTTP::Status;
+ require HTTP::Response;
+};
+
+my $plugin = 'check_http';
+$plugin = 'check_curl' if $0 =~ m/check_curl/mx;
+
+if ($@) {
+ plan skip_all => "Missing required module for test: $@";
+} else {
+ if (-x "./$plugin") {
+ plan tests => $common_tests * 2 + $ssl_only_tests + $virtual_port_tests + $chunked_encoding_special_tests;
+ } else {
+ plan skip_all => "No $plugin compiled";
+ }
+}
+
+my $servers = { http => 0 }; # HTTP::Daemon should always be available
+eval { require HTTP::Daemon::SSL };
+if ($@) {
+ diag "Cannot load HTTP::Daemon::SSL: $@";
+} else {
+ $servers->{https} = 0;
+}
+
+# set a fixed version, so the header size doesn't vary
+$HTTP::Daemon::VERSION = "1.00";
+
+my $port_http = 50000 + int(rand(1000));
+my $port_https = $port_http + 1;
+my $port_https_expired = $port_http + 2;
+my $port_https_clientcert = $port_http + 3;
+my $port_hacked_http = $port_http + 4;
+
+# This array keeps sockets around for implementing timeouts
+my @persist;
+
+# Start up all servers
+my @pids;
+# Fork a HTTP server
+my $pid = fork;
+defined $pid or die "Failed to fork";
+if (!$pid) {
+ undef @pids;
+ my $d = HTTP::Daemon->new(
+ LocalPort => $port_http,
+ LocalAddr => "127.0.0.1",
+ ) || die;
+ print "Please contact http at: <URL:", $d->url, ">\n";
+ run_server( $d );
+ die "webserver stopped";
+}
+push @pids, $pid;
+
+# Fork the hacked HTTP server
+undef $pid;
+$pid = fork;
+defined $pid or die "Failed to fork";
+if (!$pid) {
+ # this is the fork
+ undef @pids;
+ my $socket = new IO::Socket::INET (
+ LocalHost => '0.0.0.0',
+ LocalPort => $port_hacked_http,
+ Proto => 'tcp',
+ Listen => 5,
+ Reuse => 1
+ );
+ die "cannot create socket $!n" unless $socket;
+ my $local_sock = $socket->sockport();
+ print "server waiting for client connection on port $local_sock\n";
+ run_hacked_http_server ( $socket );
+ die "hacked http server stopped";
+}
+push @pids, $pid;
+
+if (exists $servers->{https}) {
+ # Fork a normal HTTPS server
+ $pid = fork;
+ defined $pid or die "Failed to fork";
+ if (!$pid) {
+ undef @pids;
+ # closing the connection after -C cert checks make the daemon exit with a sigpipe otherwise
+ local $SIG{'PIPE'} = 'IGNORE';
+ my $d = HTTP::Daemon::SSL->new(
+ LocalPort => $port_https,
+ LocalAddr => "127.0.0.1",
+ SSL_cert_file => "$Bin/certs/server-cert.pem",
+ SSL_key_file => "$Bin/certs/server-key.pem",
+ ) || die;
+ print "Please contact https at: <URL:", $d->url, ">\n";
+ run_server( $d );
+ die "webserver stopped";
+ }
+ push @pids, $pid;
+
+ # Fork an expired cert server
+ $pid = fork;
+ defined $pid or die "Failed to fork";
+ if (!$pid) {
+ undef @pids;
+ # closing the connection after -C cert checks make the daemon exit with a sigpipe otherwise
+ local $SIG{'PIPE'} = 'IGNORE';
+ my $d = HTTP::Daemon::SSL->new(
+ LocalPort => $port_https_expired,
+ LocalAddr => "127.0.0.1",
+ SSL_cert_file => "$Bin/certs/expired-cert.pem",
+ SSL_key_file => "$Bin/certs/expired-key.pem",
+ ) || die;
+ print "Please contact https expired at: <URL:", $d->url, ">\n";
+ run_server( $d );
+ die "webserver stopped";
+ }
+ push @pids, $pid;
+
+ # Fork an client cert expecting server
+ $pid = fork;
+ defined $pid or die "Failed to fork";
+ if (!$pid) {
+ undef @pids;
+ # closing the connection after -C cert checks make the daemon exit with a sigpipe otherwise
+ local $SIG{'PIPE'} = 'IGNORE';
+ my $d = HTTP::Daemon::SSL->new(
+ LocalPort => $port_https_clientcert,
+ LocalAddr => "127.0.0.1",
+ SSL_cert_file => "$Bin/certs/server-cert.pem",
+ SSL_key_file => "$Bin/certs/server-key.pem",
+ SSL_verify_mode => IO::Socket::SSL->SSL_VERIFY_PEER | IO::Socket::SSL->SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
+ SSL_ca_file => "$Bin/certs/clientca-cert.pem",
+ ) || die;
+ print "Please contact https client cert at: <URL:", $d->url, ">\n";
+ run_server( $d );
+ die "webserver stopped";
+ }
+ push @pids, $pid;
+}
+
+# give our webservers some time to startup
+sleep(3);
+
+# Run the same server on http and https
+sub run_server {
+ my $d = shift;
+ while (1) {
+ MAINLOOP: while (my $c = $d->accept) {
+ while (my $r = $c->get_request) {
+ if ($r->method eq "GET" and $r->url->path =~ m^/statuscode/(\d+)^) {
+ $c->send_basic_header($1);
+ $c->send_crlf;
+ } elsif ($r->method eq "GET" and $r->url->path =~ m^/file/(.*)^) {
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_file_response("$Bin/var/$1");
+ } elsif ($r->method eq "GET" and $r->url->path eq "/slow") {
+ $c->send_basic_header;
+ $c->send_crlf;
+ sleep 1;
+ $c->send_response("slow");
+ } elsif ($r->url->path eq "/method") {
+ if ($r->method eq "DELETE") {
+ $c->send_error(HTTP::Status->RC_METHOD_NOT_ALLOWED);
+ } elsif ($r->method eq "foo") {
+ $c->send_error(HTTP::Status->RC_NOT_IMPLEMENTED);
+ } else {
+ $c->send_status_line(200, $r->method);
+ }
+ } elsif ($r->url->path eq "/postdata") {
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_response($r->method.":".$r->content);
+ } elsif ($r->url->path eq "/redirect") {
+ $c->send_redirect( "/redirect2" );
+ } elsif ($r->url->path eq "/redir_external") {
+ $c->send_redirect(($d->isa('HTTP::Daemon::SSL') ? "https" : "http") . "://169.254.169.254/redirect2" );
+ } elsif ($r->url->path eq "/redirect2") {
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_response(HTTP::Response->new( 200, 'OK', undef, 'redirected' ));
+ } elsif ($r->url->path eq "/redir_timeout") {
+ $c->send_redirect( "/timeout" );
+ } elsif ($r->url->path eq "/timeout") {
+ # Keep $c from being destroyed, but prevent severe leaks
+ unshift @persist, $c;
+ delete($persist[1000]);
+ next MAINLOOP;
+ } elsif ($r->url->path eq "/header_check") {
+ $c->send_basic_header;
+ $c->send_header('foo');
+ $c->send_crlf;
+ } elsif ($r->url->path eq "/virtual_port") {
+ # return sent Host header
+ $c->send_basic_header;
+ $c->send_crlf;
+ $c->send_response(HTTP::Response->new( 200, 'OK', undef, $r->header ('Host')));
+ } elsif ($r->url->path eq "/chunked") {
+ my $chunks = ["chunked", "encoding", "test\n"];
+ $c->send_response(HTTP::Response->new( 200, 'OK', undef, sub {
+ my $chunk = shift @{$chunks};
+ return unless $chunk;
+ sleep(1);
+ return($chunk);
+ }));
+ } else {
+ $c->send_error(HTTP::Status->RC_FORBIDDEN);
+ }
+ $c->close;
+ }
+ }
+ }
+}
+
+sub run_hacked_http_server {
+ my $socket = shift;
+
+ # auto-flush on socket
+ $| = 1;
+
+
+ while(1)
+ {
+ # waiting for a new client connection
+ my $client_socket = $socket->accept();
+
+ # get information about a newly connected client
+ my $client_address = $client_socket->peerhost();
+ my $client_portn = $client_socket->peerport();
+ print "connection from $client_address:$client_portn";
+
+ # read up to 1024 characters from the connected client
+ my $data = "";
+ $client_socket->recv($data, 1024);
+ print "received data: $data";
+
+ # write response data to the connected client
+ $data = "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n";
+ $client_socket->send($data);
+
+ # notify client that response has been sent
+ shutdown($client_socket, 1);
+ }
+}
+
+END {
+ foreach my $pid (@pids) {
+ if ($pid) { print "Killing $pid\n"; kill "INT", $pid }
+ }
+};
+
+if ($ARGV[0] && $ARGV[0] eq "-d") {
+ while (1) {
+ sleep 100;
+ }
+}
+
+my $result;
+my $command = "./$plugin -H 127.0.0.1";
+
+run_chunked_encoding_special_test( {command => "$command -p $port_hacked_http"});
+run_common_tests( { command => "$command -p $port_http" } );
+SKIP: {
+ skip "HTTP::Daemon::SSL not installed", $common_tests + $ssl_only_tests if ! exists $servers->{https};
+ run_common_tests( { command => "$command -p $port_https", ssl => 1 } );
+
+ my $expiry = "Thu Nov 28 21:02:11 2030 +0000";
+
+ $result = NPTest->testCmd( "$command -p $port_https -S -C 14" );
+ is( $result->return_code, 0, "$command -p $port_https -S -C 14" );
+ is( $result->output, "OK - Certificate 'Monitoring Plugins' will expire on $expiry.", "output ok" );
+
+ $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" );
+ is( $result->return_code, 1, "$command -p $port_https -S -C 14000" );
+ like( $result->output, '/WARNING - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(' . quotemeta($expiry) . '\)./', "output ok" );
+
+ # Expired cert tests
+ $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" );
+ is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" );
+ like( $result->output, '/CRITICAL - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(' . quotemeta($expiry) . '\)./', "output ok" );
+
+ $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
+ is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );
+ is( $result->output,
+ 'CRITICAL - Certificate \'Monitoring Plugins\' expired on Wed Jan 2 12:00:00 2008 +0000.',
+ "output ok" );
+
+ # client cert tests
+ my $cmd;
+ $cmd = "$command -p $port_https_clientcert"
+ . " -J \"$Bin/certs/client-cert.pem\""
+ . " -K \"$Bin/certs/client-key.pem\""
+ . " -u /statuscode/200";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -p $port_https_clientcert"
+ . " -J \"$Bin/certs/clientchain-cert.pem\""
+ . " -K \"$Bin/certs/clientchain-key.pem\""
+ . " -u /statuscode/200";
+ $result = NPTest->testCmd($cmd);
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+}
+
+my $cmd;
+# check virtual port behaviour
+#
+# http without virtual port
+$cmd = "$command -p $port_http -u /virtual_port -r ^127.0.0.1:$port_http\$";
+$result = NPTest->testCmd( $cmd );
+is( $result->return_code, 0, $cmd);
+like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+# http with virtual port
+$cmd = "$command:80 -p $port_http -u /virtual_port -r ^127.0.0.1\$";
+$result = NPTest->testCmd( $cmd );
+is( $result->return_code, 0, $cmd);
+like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+SKIP: {
+ skip "HTTP::Daemon::SSL not installed", 4 if ! exists $servers->{https};
+ # https without virtual port
+ $cmd = "$command -p $port_https --ssl -u /virtual_port -r ^127.0.0.1:$port_https\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # https with virtual port
+ $cmd = "$command:443 -p $port_https --ssl -u /virtual_port -r ^127.0.0.1\$";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+}
+
+
+sub run_common_tests {
+ my ($opts) = @_;
+ my $command = $opts->{command};
+ if ($opts->{ssl}) {
+ $command .= " --ssl";
+ }
+
+ $result = NPTest->testCmd( "$command -u /file/root" );
+ is( $result->return_code, 0, "/file/root");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u /file/root -s Root" );
+ is( $result->return_code, 0, "/file/root search for string");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 274 bytes in [\d\.]+ second/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u /file/root -s NonRoot" );
+ is( $result->return_code, 2, "Missing string check");
+ like( $result->output, qr%^HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRoot' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location");
+
+ $result = NPTest->testCmd( "$command -u /file/root -s NonRootWithOver30charsAndMoreFunThanAWetFish" );
+ is( $result->return_code, 2, "Missing string check");
+ like( $result->output, qr%HTTP CRITICAL: HTTP/1\.1 200 OK - string 'NonRootWithOver30charsAndM...' not found on 'https?://127\.0\.0\.1:\d+/file/root'%, "Shows search string and location");
+
+ $result = NPTest->testCmd( "$command -u /header_check -d foo" );
+ is( $result->return_code, 0, "header_check search for string");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - 96 bytes in [\d\.]+ second/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u /header_check -d bar" );
+ is( $result->return_code, 2, "Missing header string check");
+ like( $result->output, qr%^HTTP CRITICAL: HTTP/1\.1 200 OK - header 'bar' not found on 'https?://127\.0\.0\.1:\d+/header_check'%, "Shows search string and location");
+
+ my $cmd;
+ $cmd = "$command -u /slow";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, "$cmd");
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+ $result->output =~ /in ([\d\.]+) second/;
+ cmp_ok( $1, ">", 1, "Time is > 1 second" );
+
+ $cmd = "$command -u /statuscode/200";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/200 -e 200";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: Status line output matched "200" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 201 Created - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201 -e 201";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: Status line output matched "201" - \d+ bytes in [\d\.]+ second /', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201 -e 200";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 2, $cmd);
+ like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port \d+: HTTP/1.1 201 Created/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/200 -e 200,201,202";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/201 -e 200,201,202";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: Status line output matched "200,201,202" - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /statuscode/203 -e 200,201,202";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 2, $cmd);
+ like( $result->output, '/^HTTP CRITICAL - Invalid HTTP response received from host on port (\d+): HTTP/1.1 203 Non-Authoritative Information/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j HEAD -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 HEAD - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j POST -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 POST - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j GET -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 GET - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 GET - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -P foo -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 POST - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j DELETE -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 1, $cmd);
+ like( $result->output, '/^HTTP WARNING: HTTP/1.1 405 Method Not Allowed/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j foo -u /method";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 2, $cmd);
+ like( $result->output, '/^HTTP CRITICAL: HTTP/1.1 501 Not Implemented/', "Output correct: ".$result->output );
+
+ $cmd = "$command -P stufftoinclude -u /postdata -s POST:stufftoinclude";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -j PUT -P stufftoinclude -u /postdata -s PUT:stufftoinclude";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # To confirm that the free doesn't segfault
+ $cmd = "$command -P stufftoinclude -j PUT -u /postdata -s PUT:stufftoinclude";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /redirect";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 301 Moved Permanently - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f follow -u /redirect";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 301 Moved Permanently - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f follow -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f sticky -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ $cmd = "$command -f stickyport -u /redirect -k 'follow: me'";
+ $result = NPTest->testCmd( $cmd );
+ is( $result->return_code, 0, $cmd);
+ like( $result->output, '/^HTTP OK: HTTP/1.1 200 OK - \d+ bytes in [\d\.]+ second/', "Output correct: ".$result->output );
+
+ # These tests may block
+ print "ALRM\n";
+
+ # stickyport - on full urlS port is set back to 80 otherwise
+ $cmd = "$command -f stickyport -u /redir_external -t 5 -s redirected";
+ alarm(2);
+ eval {
+ local $SIG{ALRM} = sub { die "alarm\n" };
+ $result = NPTest->testCmd( $cmd );
+ };
+ isnt( $@, "alarm\n", $cmd );
+ alarm(0);
+ is( $result->return_code, 0, $cmd );
+
+ # Let's hope there won't be any web server on :80 returning "redirected"!
+ $cmd = "$command -f sticky -u /redir_external -t 5 -s redirected";
+ alarm(2);
+ eval {
+ local $SIG{ALRM} = sub { die "alarm\n" };
+ $result = NPTest->testCmd( $cmd );
+ };
+ isnt( $@, "alarm\n", $cmd );
+ alarm(0);
+ isnt( $result->return_code, 0, $cmd );
+
+ # Test an external address - timeout
+ SKIP: {
+ skip "This doesn't seem to work all the time", 1 unless ($ENV{HTTP_EXTERNAL});
+ $cmd = "$command -f follow -u /redir_external -t 5";
+ eval {
+ $result = NPTest->testCmd( $cmd, 2 );
+ };
+ like( $@, "/timeout in command: $cmd/", $cmd );
+ }
+
+ $cmd = "$command -u /timeout -t 5";
+ eval {
+ $result = NPTest->testCmd( $cmd, 2 );
+ };
+ like( $@, "/timeout in command: $cmd/", $cmd );
+
+ $cmd = "$command -f follow -u /redir_timeout -t 2";
+ eval {
+ $result = NPTest->testCmd( $cmd, 5 );
+ };
+ is( $@, "", $cmd );
+
+ $cmd = "$command -u /chunked -s 'chunkedencodingtest' -d 'Transfer-Encoding: chunked'";
+ eval {
+ $result = NPTest->testCmd( $cmd, 5 );
+ };
+ is( $@, "", $cmd );
+}
+
+sub run_chunked_encoding_special_test {
+ my ($opts) = @_;
+ my $command = $opts->{command};
+
+ $cmd = "$command -u / -s 'ChunkedEncodingSpecialTest'";
+ eval {
+ $result = NPTest->testCmd( $cmd, 5 );
+ };
+ is( $@, "", $cmd );
+}
diff --git a/plugins/tests/check_nt.t b/plugins/tests/check_nt.t
new file mode 100755
index 0000000..223d493
--- /dev/null
+++ b/plugins/tests/check_nt.t
@@ -0,0 +1,80 @@
+#! /usr/bin/perl -w -I ..
+#
+# Test check_nt by having a stub check_nt daemon
+#
+
+use strict;
+use Test::More;
+use NPTest;
+use FindBin qw($Bin);
+
+use IO::Socket;
+use IO::Select;
+use POSIX;
+
+my $port = 50000 + int(rand(1000));
+
+my $pid = fork();
+if ($pid) {
+ # Parent
+ #print "parent\n";
+ # give our webserver some time to startup
+ sleep(1);
+} else {
+ # Child
+ #print "child\n";
+
+ my $server = IO::Socket::INET->new(
+ LocalPort => $port,
+ Type => SOCK_STREAM,
+ Reuse => 1,
+ Proto => "tcp",
+ Listen => 10,
+ ) or die "Cannot be a tcp server on port $port: $@";
+
+ $server->autoflush(1);
+
+ print "Please contact me at port $port\n";
+ while (my $client = $server->accept ) {
+ my $data = "";
+ my $rv = $client->recv($data, POSIX::BUFSIZ, 0);
+
+ my ($password, $command, $arg) = split('&', $data);
+
+ if ($command eq "4") {
+ if ($arg eq "c") {
+ print $client "930000000&1000000000";
+ } elsif ($arg eq "d") {
+ print $client "UNKNOWN: Drive is not a fixed drive";
+ }
+ }
+ }
+ exit;
+}
+
+END { if ($pid) { print "Killing $pid\n"; kill "INT", $pid } };
+
+if ($ARGV[0] && $ARGV[0] eq "-d") {
+ sleep 1000;
+}
+
+if (-x "./check_nt") {
+ plan tests => 5;
+} else {
+ plan skip_all => "No check_nt compiled";
+}
+
+my $result;
+my $command = "./check_nt -H 127.0.0.1 -p $port";
+
+$result = NPTest->testCmd( "$command -v USEDDISKSPACE -l c" );
+is( $result->return_code, 0, "USEDDISKSPACE c");
+is( $result->output, q{c:\ - total: 0.93 Gb - used: 0.07 Gb (7%) - free 0.87 Gb (93%) | 'c:\ Used Space'=0.07Gb;0.00;0.00;0.00;0.93}, "Output right" );
+
+$result = NPTest->testCmd( "$command -v USEDDISKSPACE -l d" );
+is( $result->return_code, 3, "USEDDISKSPACE d - invalid");
+is( $result->output, "Free disk space : Invalid drive", "Output right" );
+
+$result = NPTest->testCmd( "./check_nt -v USEDDISKSPACE -l d" );
+is( $result->return_code, 3, "Fail if -H missing");
+
diff --git a/plugins/tests/check_procs.t b/plugins/tests/check_procs.t
new file mode 100755
index 0000000..b3a0a30
--- /dev/null
+++ b/plugins/tests/check_procs.t
@@ -0,0 +1,148 @@
+#! /usr/bin/perl -w -I ..
+#
+# Test check_procs using input files
+#
+
+use strict;
+use Test::More;
+use NPTest;
+
+if (-x "./check_procs") {
+ plan tests => 54;
+} else {
+ plan skip_all => "No check_procs compiled";
+}
+
+my $result;
+my $command = "./check_procs --input-file=tests/var/ps-axwo.darwin";
+my $cmd_etime = "./check_procs --input-file=tests/var/ps-axwo.debian";
+
+$result = NPTest->testCmd( "$command" );
+is( $result->return_code, 0, "Run with no options" );
+is( $result->output, "PROCS OK: 95 processes | procs=95;;;0;", "Output correct" );
+
+$result = NPTest->testCmd( "$command -w 5" );
+is( $result->return_code, 1, "Checking > 5 processes" );
+is( $result->output, "PROCS WARNING: 95 processes | procs=95;5;;0;", "Output correct" );
+
+$result = NPTest->testCmd( "$command -w 4 -c 44" );
+is( $result->return_code, 2, "Checking critical" );
+is( $result->output, "PROCS CRITICAL: 95 processes | procs=95;4;44;0;", "Output correct" );
+
+$result = NPTest->testCmd( "$command -w 100 -c 200" );
+is( $result->return_code, 0, "Checking no threshold breeched" );
+is( $result->output, "PROCS OK: 95 processes | procs=95;100;200;0;", "Output correct" );
+
+$result = NPTest->testCmd( "$command -C launchd -c 5" );
+is( $result->return_code, 2, "Checking processes matched by command name" );
+is( $result->output, "PROCS CRITICAL: 6 processes with command name 'launchd' | procs=6;;5;0;", "Output correct" );
+
+$result = NPTest->testCmd( "$command -X bash -c 5" );
+is( $result->return_code, 2, "Checking processes excluded by command name" );
+is( $result->output, "PROCS CRITICAL: 95 processes with exclude progs 'bash' | procs=95;;5;0;", "Output correct" );
+
+SKIP: {
+ skip 'user with uid 501 required', 4 unless getpwuid(501);
+
+ $result = NPTest->testCmd( "$command -u 501 -w 39 -c 41" );
+ is( $result->return_code, 1, "Checking processes filtered by userid" );
+ like( $result->output, '/^PROCS WARNING: 40 processes with UID = 501 (.*)$/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -C launchd -u 501" );
+ is( $result->return_code, 0, "Checking processes filtered by command name and userid" );
+ like( $result->output, '/^PROCS OK: 1 process with command name \'launchd\', UID = 501 (.*)$/', "Output correct" );
+}
+
+SKIP: {
+ skip 'user with uid -2 required', 8 unless getpwuid(-2);
+ skip 'uid -2 must have name "nobody"', 8 unless getpwuid(-2) eq 'nobody';
+
+ $result = NPTest->testCmd( "$command -u -2 -w 2:2" );
+ is( $result->return_code, 1, "Checking processes with userid=-2" );
+ like( $result->output, '/^PROCS WARNING: 3 processes with UID = -2 \(nobody\)$/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u -2 -w 3:3" );
+ is( $result->return_code, 0, "Checking processes with userid=-2 past threshold" );
+ like( $result->output, '/^PROCS OK: 3 processes with UID = -2 \(nobody\)$/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u -2 -a usb" );
+ is( $result->return_code, 0, "Checking processes with userid=-2 and usb in arguments" );
+ like( $result->output, '/^PROCS OK: 1 process with UID = -2 \(nobody\), args \'usb\'/', "Output correct" );
+
+ $result = NPTest->testCmd( "$command -u -2 -a UsB" );
+ is( $result->return_code, 0, "Checking case sensitivity of args" );
+ like( $result->output, '/^PROCS OK: 0 processes with UID = -2 \(nobody\), args \'UsB\'/', "Output correct" );
+};
+
+SKIP: {
+ skip 'check_procs is compiled with etime format support', 2 if `$command -vvv` =~ m/etime/mx;
+
+ $result = NPTest->testCmd( "$command --ereg-argument-array='mdworker.*501'" );
+ is( $result->return_code, 0, "Checking regexp search of arguments" );
+ is( $result->output, "PROCS OK: 1 process with regex args 'mdworker.*501' | procs=1;;;0;", "Output correct" );
+}
+
+SKIP: {
+ skip 'check_procs is compiled without etime format support', 2 if `$cmd_etime -vvv` !~ m/etime/mx;
+
+ $result = NPTest->testCmd( "$cmd_etime -m ELAPSED -C apache2 -w 1000 -c 2000" );
+ is( $result->return_code, 2, "Checking elapsed time threshold" );
+ is( $result->output, "ELAPSED CRITICAL: 10 crit, 0 warn out of 10 processes with command name 'apache2' | procs=10;;;0; procs_warn=0;;;0; procs_crit=10;;;0;", "Output correct" );
+}
+
+$result = NPTest->testCmd( "$command --vsz 1000000" );
+is( $result->return_code, 0, "Checking filter by VSZ" );
+is( $result->output, 'PROCS OK: 24 processes with VSZ >= 1000000 | procs=24;;;0;', "Output correct" );
+
+$result = NPTest->testCmd( "$command --rss 100000" );
+is( $result->return_code, 0, "Checking filter by RSS" );
+is( $result->output, 'PROCS OK: 3 processes with RSS >= 100000 | procs=3;;;0;', "Output correct" );
+
+$result = NPTest->testCmd( "$command -s S" );
+is( $result->return_code, 0, "Checking filter for sleeping processes" );
+like( $result->output, '/^PROCS OK: 88 processes with STATE = S/', "Output correct" );
+
+$result = NPTest->testCmd( "$command -s Z" );
+is( $result->return_code, 0, "Checking filter for zombies" );
+like( $result->output, '/^PROCS OK: 1 process with STATE = Z/', "Output correct" );
+
+$result = NPTest->testCmd( "$command -p 1 -c 30" );
+is( $result->return_code, 2, "Checking filter for parent id = 1" );
+like( $result->output, '/^PROCS CRITICAL: 39 processes with PPID = 1/', "Output correct" );
+
+$result = NPTest->testCmd( "$command -P 0.71" );
+is( $result->return_code, 0, "Checking filter for percentage cpu > 0.71" );
+is( $result->output, 'PROCS OK: 7 processes with PCPU >= 0.71 | procs=7;;;0;', "Output correct" );
+
+$result = NPTest->testCmd( "$command -P 0.70" );
+is( $result->return_code, 0, "Checking filter for percentage cpu > 0.70" );
+is( $result->output, 'PROCS OK: 8 processes with PCPU >= 0.70 | procs=8;;;0;', "Output correct" );
+
+$result = NPTest->testCmd( "$command --metric=CPU -w 8" );
+is( $result->return_code, 1, "Checking against metric of CPU > 8" );
+is( $result->output, 'CPU WARNING: 1 warn out of 95 processes | procs=95;;;0; procs_warn=1;;;0; procs_crit=0;;;0;', "Output correct" );
+
+# TODO: Because of a conversion to int, if CPU is 1.45%, will not alert, but 2.01% will.
+SKIP: {
+ skip 'user with uid 501 required', 2 unless getpwuid(501);
+
+ $result = NPTest->testCmd( "$command --metric=CPU -w 1 -u 501 -v" );
+ is( $result->return_code, 1, "Checking against metric of CPU > 1 with uid=501 - TODO" );
+ is( $result->output, 'CPU WARNING: 2 warn out of 40 processes with UID = 501 (tonvoon) [Skype, PubSubAgent]', "Output correct" );
+};
+
+$result = NPTest->testCmd( "$command --metric=VSZ -w 1200000 -v" );
+is( $result->return_code, 1, "Checking against VSZ > 1.2GB" );
+is( $result->output, 'VSZ WARNING: 4 warn out of 95 processes [WindowServer, Safari, Mail, Skype] | procs=95;;;0; procs_warn=4;;;0; procs_crit=0;;;0;', "Output correct" );
+
+$result = NPTest->testCmd( "$command --metric=VSZ -w 1200000 -v" );
+is( $result->return_code, 1, "Checking against VSZ > 1.2GB" );
+is( $result->output, 'VSZ WARNING: 4 warn out of 95 processes [WindowServer, Safari, Mail, Skype] | procs=95;;;0; procs_warn=4;;;0; procs_crit=0;;;0;', "Output correct" );
+
+$result = NPTest->testCmd( "$command --metric=RSS -c 70000 -v" );
+is( $result->return_code, 2, "Checking against RSS > 70MB" );
+is( $result->output, 'RSS CRITICAL: 5 crit, 0 warn out of 95 processes [WindowServer, SystemUIServer, Safari, Mail, Safari] | procs=95;;;0; procs_warn=0;;;0; procs_crit=5;;;0;', "Output correct" );
+
+$result = NPTest->testCmd( "$command --ereg-argument-array='(nosuchname|nosuch2name)'" );
+is( $result->return_code, 0, "Checking no pipe symbol in output" );
+is( $result->output, "PROCS OK: 0 processes with regex args '(nosuchname,nosuch2name)' | procs=0;;;0;", "Output correct" );
diff --git a/plugins/tests/check_snmp.t b/plugins/tests/check_snmp.t
new file mode 100755
index 0000000..bfe42e1
--- /dev/null
+++ b/plugins/tests/check_snmp.t
@@ -0,0 +1,286 @@
+#! /usr/bin/perl -w -I ..
+#
+# Test check_snmp by having an actual SNMP agent running
+#
+
+use strict;
+use Test::More;
+use NPTest;
+use FindBin qw($Bin);
+use POSIX qw/strftime/;
+
+my $tests = 81;
+# Check that all dependent modules are available
+eval {
+ require NetSNMP::OID;
+ require NetSNMP::agent;
+ require NetSNMP::ASN;
+};
+
+if ($@) {
+ plan skip_all => "Missing required module for test: $@";
+} else {
+ if (-x "./check_snmp") {
+ # check if snmpd has perl support
+ my $test = `snmpd -c tests/conf/snmpd.conf -C -r -H 2>&1`;
+ if(!defined $test) {
+ plan skip_all => "snmpd required";
+ }
+ elsif($test =~ m/Warning: Unknown token: perl/) {
+ plan skip_all => "snmpd has no perl support";
+ } else {
+ plan tests => $tests;
+ }
+ } else {
+ plan skip_all => "No check_snmp compiled";
+ }
+}
+
+my $port_snmp = 16100 + int(rand(100));
+
+my $faketime = -x '/usr/bin/faketime' ? 1 : 0;
+
+# Start up server
+my @pids;
+my $pid = fork();
+if ($pid) {
+ # Parent
+ push @pids, $pid;
+ # give our agent some time to startup
+ sleep(1);
+} else {
+ # Child
+ #print "child\n";
+
+ print "Please contact SNMP at: $port_snmp\n";
+ close(STDERR); # Comment out to debug snmpd problems (most errors sent there are OK)
+ exec("snmpd -c tests/conf/snmpd.conf -C -f -r udp:$port_snmp");
+}
+
+END {
+ foreach my $pid (@pids) {
+ if ($pid) { print "Killing $pid\n"; kill "INT", $pid }
+ }
+};
+
+if ($ARGV[0] && $ARGV[0] eq "-d") {
+ while (1) {
+ sleep 100;
+ }
+}
+
+# We should merge that with $ENV{'NPTEST_CACHE'}, use one dir for all test data
+$ENV{'MP_STATE_PATH'} ||= "/var/tmp";
+
+my $res;
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.0");
+cmp_ok( $res->return_code, '==', 0, "Exit OK when querying a multi-line string" );
+like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
+like($res->output, '/'.quotemeta('SNMP OK - Cisco Internetwork Operating System Software |
+.1.3.6.1.4.1.8072.3.2.67.0:
+"Cisco Internetwork Operating System Software
+IOS (tm) Catalyst 4000 \"L3\" Switch Software (cat4000-I9K91S-M), Version
+12.2(20)EWA, RELEASE SOFTWARE (fc1)
+Technical Support: http://www.cisco.com/techsupport
+Copyright (c) 1986-2004 by cisco Systems, Inc.
+"').'/m', "String contains all lines");
+
+# sysContact.0 is "Alice" (from our snmpd.conf)
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.0 -o sysContact.0 -o .1.3.6.1.4.1.8072.3.2.67.1");
+cmp_ok( $res->return_code, '==', 0, "Exit OK when querying multi-line OIDs" );
+like($res->output, '/^SNMP OK - /', "String contains SNMP OK");
+like($res->output, '/'.quotemeta('SNMP OK - Cisco Internetwork Operating System Software ').'"?Alice"?'.quotemeta(' Kisco Outernetwork Oserating Gystem Totware |
+.1.3.6.1.4.1.8072.3.2.67.0:
+"Cisco Internetwork Operating System Software
+IOS (tm) Catalyst 4000 \"L3\" Switch Software (cat4000-I9K91S-M), Version
+12.2(20)EWA, RELEASE SOFTWARE (fc1)
+Technical Support: http://www.cisco.com/techsupport
+Copyright (c) 1986-2004 by cisco Systems, Inc.
+"
+.1.3.6.1.4.1.8072.3.2.67.1:
+"Kisco Outernetwork Oserating Gystem Totware
+Copyleft (c) 2400-2689 by kisco Systrems, Inc."').'/m', "String contains all lines with multiple OIDs");
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.2");
+like($res->output, '/'.quotemeta('SNMP OK - This should not confuse check_snmp \"parser\" |
+.1.3.6.1.4.1.8072.3.2.67.2:
+"This should not confuse check_snmp \"parser\"
+into thinking there is no 2nd line"').'/m', "Attempt to confuse parser No.1");
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.3");
+like($res->output, '/'.quotemeta('SNMP OK - It\'s getting even harder if the line |
+.1.3.6.1.4.1.8072.3.2.67.3:
+"It\'s getting even harder if the line
+ends with with this: C:\\\\"').'/m', "Attempt to confuse parser No.2");
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.4");
+like($res->output, '/'.quotemeta('SNMP OK - And now have fun with with this: \"C:\\\\\" |
+.1.3.6.1.4.1.8072.3.2.67.4:
+"And now have fun with with this: \"C:\\\\\"
+because we\'re not done yet!"').'/m', "Attempt to confuse parser No.3");
+
+system("rm -f ".$ENV{'MP_STATE_PATH'}."/*/check_snmp/*");
+
+# run rate checks with faketime. rate checks depend on the exact amount of time spend between the
+# plugin runs which may fail on busy machines.
+# using faketime removes this race condition and also saves all the sleeps in between.
+SKIP: {
+ skip "No faketime binary found", 28 if !$faketime;
+
+ my $ts = time();
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
+ is($res->return_code, 0, "Returns OK");
+ is($res->output, "No previous data to calculate rate - assume okay");
+
+ # test rate 1 second later
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts+1))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
+ is($res->return_code, 1, "WARNING - due to going above rate calculation" );
+ is($res->output, "SNMP RATE WARNING - *666* | iso.3.6.1.4.1.8072.3.2.67.10=666;600 ");
+
+ # test rate with same time
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts+1))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -w 600" );
+ is($res->return_code, 3, "UNKNOWN - basically the divide by zero error" );
+ is($res->output, "Time duration between plugin calls is invalid");
+
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets" );
+ is($res->return_code, 0, "OK for first call" );
+ is($res->output, "No previous data to calculate rate - assume okay" );
+
+ # test rate 1 second later
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts+1))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP RATE OK - inoctets 666 | inoctets=666 ", "Check label");
+
+ # test rate 3 seconds later
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts+3))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP RATE OK - inoctets 333 | inoctets=333 ", "Check rate decreases due to longer interval");
+
+
+ # label performance data check
+ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l test" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP OK - test 67996 | test=67996c ", "Check label");
+
+ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l \"test'test\"" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP OK - test'test 68662 | \"test'test\"=68662c ", "Check label");
+
+ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l 'test\"test'" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP OK - test\"test 69328 | 'test\"test'=69328c ", "Check label");
+
+ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l test -O" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP OK - test 69994 | iso.3.6.1.4.1.8072.3.2.67.10=69994c ", "Check label");
+
+ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP OK - 70660 | iso.3.6.1.4.1.8072.3.2.67.10=70660c ", "Check label");
+
+ $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 -l 'test test'" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP OK - test test 71326 | 'test test'=71326c ", "Check label");
+
+
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets_per_minute --rate-multiplier=60" );
+ is($res->return_code, 0, "OK for first call" );
+ is($res->output, "No previous data to calculate rate - assume okay" );
+
+ # test 1 second later
+ $res = NPTest->testCmd("LC_TIME=C TZ=UTC faketime -f '".strftime("%Y-%m-%d %H:%M:%S", localtime($ts+1))."' ./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10 --rate -l inoctets_per_minute --rate-multiplier=60" );
+ is($res->return_code, 0, "OK as no thresholds" );
+ is($res->output, "SNMP RATE OK - inoctets_per_minute 39960 | inoctets_per_minute=39960 ", "Checking multiplier");
+};
+
+
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 -s '\"stringtests\"'" );
+is($res->return_code, 0, "OK as string matches" );
+is($res->output, 'SNMP OK - "stringtests" | ', "Good string match" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 -s ring" );
+is($res->return_code, 2, "CRITICAL as string doesn't match (though is a substring)" );
+is($res->output, 'SNMP CRITICAL - *"stringtests"* | ', "Failed string match" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 --invert-search -s '\"stringtests\"'" );
+is($res->return_code, 2, "CRITICAL as string matches but inverted" );
+is($res->output, 'SNMP CRITICAL - *"stringtests"* | ', "Inverted string match" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.11 --invert-search -s ring" );
+is($res->return_code, 0, "OK as string doesn't match but inverted" );
+is($res->output, 'SNMP OK - "stringtests" | ', "OK as inverted string no match" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.12 -w 4:5" );
+is($res->return_code, 1, "Numeric in string test" );
+is($res->output, 'SNMP WARNING - *3.5* | iso.3.6.1.4.1.8072.3.2.67.12=3.5;4:5 ', "WARNING threshold checks for string masquerading as number" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.13" );
+is($res->return_code, 0, "Not really numeric test" );
+is($res->output, 'SNMP OK - "87.4startswithnumberbutshouldbestring" | ', "Check string with numeric start is still string" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.14" );
+is($res->return_code, 0, "Not really numeric test (trying best to fool it)" );
+is($res->output, 'SNMP OK - "555\"I said\"" | ', "Check string with a double quote following is still a string (looks like the perl routine will always escape though)" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.15 -r 'CUSTOM CHECK OK'" );
+is($res->return_code, 0, "String check should check whole string, not a parsed number" );
+is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check with numbers returns whole string");
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.16 -w -2: -c -3:" );
+is($res->return_code, 0, "Negative integer check OK" );
+is($res->output, 'SNMP OK - -2 | iso.3.6.1.4.1.8072.3.2.67.16=-2;-2:;-3: ', "Negative integer check OK output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.16 -w -2: -c -3:" );
+is($res->return_code, 1, "Negative integer check WARNING" );
+is($res->output, 'SNMP WARNING - *-3* | iso.3.6.1.4.1.8072.3.2.67.16=-3;-2:;-3: ', "Negative integer check WARNING output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.16 -w -2: -c -3:" );
+is($res->return_code, 2, "Negative integer check CRITICAL" );
+is($res->output, 'SNMP CRITICAL - *-4* | iso.3.6.1.4.1.8072.3.2.67.16=-4;-2:;-3: ', "Negative integer check CRITICAL output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.17 -w -3: -c -6:" );
+is($res->return_code, 1, "Negative integer as string, WARNING" );
+is($res->output, 'SNMP WARNING - *-4* | iso.3.6.1.4.1.8072.3.2.67.17=-4;-3:;-6: ', "Negative integer as string, WARNING output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.17 -w -2: -c -3:" );
+is($res->return_code, 2, "Negative integer as string, CRITICAL" );
+is($res->output, 'SNMP CRITICAL - *-4* | iso.3.6.1.4.1.8072.3.2.67.17=-4;-2:;-3: ', "Negative integer as string, CRITICAL output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.18 -c '~:-6.5'" );
+is($res->return_code, 0, "Negative float OK" );
+is($res->output, 'SNMP OK - -6.6 | iso.3.6.1.4.1.8072.3.2.67.18=-6.6;;@-6.5:~ ', "Negative float OK output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.18 -w '~:-6.65' -c '~:-6.55'" );
+is($res->return_code, 1, "Negative float WARNING" );
+is($res->output, 'SNMP WARNING - *-6.6* | iso.3.6.1.4.1.8072.3.2.67.18=-6.6;@-6.65:~;@-6.55:~ ', "Negative float WARNING output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10,.1.3.6.1.4.1.8072.3.2.67.17 -w '1:100000,-10:20' -c '2:200000,-20:30'" );
+is($res->return_code, 0, "Multiple OIDs with thresholds" );
+like($res->output, '/SNMP OK - \d+ -4 | iso.3.6.1.4.1.8072.3.2.67.10=\d+c;1:100000;2:200000 iso.3.6.1.4.1.8072.3.2.67.17=-4;-10:20;-20:30/', "Multiple OIDs with thresholds output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10,.1.3.6.1.4.1.8072.3.2.67.17 -w '1:100000,-1:2' -c '2:200000,-20:30'" );
+is($res->return_code, 1, "Multiple OIDs with thresholds" );
+like($res->output, '/SNMP WARNING - \d+ \*-4\* | iso.3.6.1.4.1.8072.3.2.67.10=\d+c;1:100000;2:200000 iso.3.6.1.4.1.8072.3.2.67.17=-4;-10:20;-20:30/', "Multiple OIDs with thresholds output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.10,.1.3.6.1.4.1.8072.3.2.67.17 -w 1,2 -c 1" );
+is($res->return_code, 2, "Multiple OIDs with some thresholds" );
+like($res->output, '/SNMP CRITICAL - \*\d+\* \*-4\* | iso.3.6.1.4.1.8072.3.2.67.10=\d+c;1;2 iso.3.6.1.4.1.8072.3.2.67.17=-4;;/', "Multiple OIDs with thresholds output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.19");
+is($res->return_code, 0, "Test plain .1.3.6.1.4.1.8072.3.2.67.6 RC" );
+is($res->output,'SNMP OK - 42 | iso.3.6.1.4.1.8072.3.2.67.19=42 ', "Test plain value of .1.3.6.1.4.1.8072.3.2.67.1" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.19 -M .1");
+is($res->return_code, 0, "Test multiply RC" );
+is($res->output,'SNMP OK - 4.200000 | iso.3.6.1.4.1.8072.3.2.67.19=4.200000 ' , "Test multiply .1 output" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.19 --multiplier=.1 -f '%.2f' ");
+is($res->return_code, 0, "Test multiply RC + format" );
+is($res->output, 'SNMP OK - 4.20 | iso.3.6.1.4.1.8072.3.2.67.19=4.20 ', "Test multiply .1 output + format" );
+
+$res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.19 --multiplier=.1 -f '%.2f' -w 1");
+is($res->return_code, 1, "Test multiply RC + format + thresholds" );
+is($res->output, 'SNMP WARNING - *4.20* | iso.3.6.1.4.1.8072.3.2.67.19=4.20;1 ', "Test multiply .1 output + format + thresholds" );
diff --git a/plugins/tests/check_snmp_agent.pl b/plugins/tests/check_snmp_agent.pl
new file mode 100644
index 0000000..38912e9
--- /dev/null
+++ b/plugins/tests/check_snmp_agent.pl
@@ -0,0 +1,111 @@
+#! /usr/bin/perl -w -I ..
+#
+# Subagent for testing check_snmp
+#
+
+#use strict; # Doesn't work
+use NetSNMP::OID qw(:all);
+use NetSNMP::agent;
+use NetSNMP::ASN qw(ASN_OCTET_STR ASN_COUNTER ASN_COUNTER64 ASN_INTEGER ASN_INTEGER64 ASN_UNSIGNED ASN_UNSIGNED64);
+#use Math::Int64 qw(uint64); # Skip that module while we don't need it
+sub uint64 { return $_ }
+
+if (!$agent) {
+ print "This program must run as an embedded NetSNMP agent\n";
+ exit 1;
+}
+
+my $baseoid = '.1.3.6.1.4.1.8072.3.2.67';
+my $multiline = 'Cisco Internetwork Operating System Software
+IOS (tm) Catalyst 4000 "L3" Switch Software (cat4000-I9K91S-M), Version
+12.2(20)EWA, RELEASE SOFTWARE (fc1)
+Technical Support: http://www.cisco.com/techsupport
+Copyright (c) 1986-2004 by cisco Systems, Inc.
+';
+my $multilin2 = "Kisco Outernetwork Oserating Gystem Totware
+Copyleft (c) 2400-2689 by kisco Systrems, Inc.";
+my $multilin3 = 'This should not confuse check_snmp "parser"
+into thinking there is no 2nd line';
+my $multilin4 = 'It\'s getting even harder if the line
+ends with with this: C:\\';
+my $multilin5 = 'And now have fun with with this: "C:\\"
+because we\'re not done yet!';
+
+# Next are arrays of indexes (Type, initial value and increments)
+# 0..19 <---- please update comment when adding/removing fields
+my @fields = (ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_UNSIGNED, ASN_UNSIGNED, ASN_COUNTER, ASN_COUNTER64, ASN_UNSIGNED, ASN_COUNTER, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_OCTET_STR, ASN_INTEGER, ASN_OCTET_STR, ASN_OCTET_STR, ASN_INTEGER );
+my @values = ($multiline, $multilin2, $multilin3, $multilin4, $multilin5, 4294965296, 1000, 4294965296, uint64("18446744073709351616"), int(rand(2**32)), 64000, "stringtests", "3.5", "87.4startswithnumberbutshouldbestring", '555"I said"', 'CUSTOM CHECK OK: foo is 12345', -2, '-4', '-6.6', 42 );
+# undef increments are randomized
+my @incrts = (undef, undef, undef, undef, undef, 1000, -500, 1000, 100000, undef, 666, undef, undef, undef, undef, undef, -1, undef, undef, 0 );
+
+# Number of elements in our OID
+my $oidelts;
+{
+ my @oid = split(/\./, $baseoid);
+ $oidelts = scalar(@oid);
+}
+
+my $regoid = new NetSNMP::OID($baseoid);
+$agent->register('check_snmp_agent', $regoid, \&my_snmp_handler);
+
+sub my_snmp_handler {
+ my ($handler, $registration_info, $request_info, $requests) = @_;
+
+ for (my $request = $requests; $request; $request = $request->next) {
+ my $oid = $request->getOID();
+ my $index;
+ my $next_index;
+
+ # Validate the OID
+ my @numarray = $oid->to_array();
+ if (@numarray != $oidelts) {
+ if ($request_info->getMode() == MODE_GETNEXT && @numarray == ($oidelts - 1)) {
+ # GETNEXT for the base oid; set it to the first index
+ push(@numarray, 0);
+ $next_index = 0;
+ } else {
+ # We got a request for the base OID or with extra elements
+ $request->setError($request_info, SNMP_ERR_NOERROR);
+ next;
+ }
+ }
+
+ $index = pop(@numarray);
+ if ($index >= scalar(@fields)) {
+ # Index is out of bounds
+ $request->setError($request_info, SNMP_ERR_NOERROR);
+ next;
+ }
+
+ # Handle the request
+ if ($request_info->getMode() == MODE_GETNEXT) {
+ if (++$index >= scalar(@fields)) {
+ # Index will grow out of bounds
+ $request->setError($request_info, SNMP_ERR_NOERROR);
+ next;
+ }
+ $index = (defined($next_index) ? $next_index : $index);
+ $request->setOID("$baseoid.$index");
+ } elsif ($request_info->getMode() != MODE_GET) {
+ # Everything else is write-related modes
+ $request->setError($request_info, SNMP_ERR_READONLY);
+ next;
+ }
+
+ # Set the response... setValue is a bit touchy about the data type, but accepts plain strings.
+ my $value = sprintf("%s", $values[$index]);
+ $request->setValue($fields[$index], $value);
+
+ # And update the value
+ if (defined($incrts[$index])) {
+ $values[$index] += $incrts[$index];
+ } elsif ($fields[$index] != ASN_OCTET_STR) {
+ my $minus = int(rand(2))*-1;
+ $minus = 1 unless ($minus);
+ my $exp = 32;
+ $exp = 64 if ($fields[$index] == ASN_COUNTER64 || $fields[$index] == ASN_INTEGER64 || $fields[$index] == ASN_UNSIGNED64);
+ $values[$index] = int(rand(2**$exp));
+ }
+ }
+}
+
diff --git a/plugins/tests/conf/snmpd.conf b/plugins/tests/conf/snmpd.conf
new file mode 100644
index 0000000..eff5b0b
--- /dev/null
+++ b/plugins/tests/conf/snmpd.conf
@@ -0,0 +1,23 @@
+###############################################################################
+# Access Control
+###############################################################################
+
+com2sec readonly localhost public
+
+group MyROGroup v1 readonly
+group MyROGroup v2c readonly
+
+view all included .1 80
+
+access MyROGroup "" any noauth exact all none none
+
+syslocation Wonderland
+syscontact Alice
+
+
+###############################################################################
+# Embedded Subagents
+###############################################################################
+
+perl do "tests/check_snmp_agent.pl";
+
diff --git a/plugins/tests/var/ps-axwo.darwin b/plugins/tests/var/ps-axwo.darwin
new file mode 100644
index 0000000..b71d834
--- /dev/null
+++ b/plugins/tests/var/ps-axwo.darwin
@@ -0,0 +1,96 @@
+STAT UID PID PPID VSZ RSS %CPU UCOMM COMMAND
+Ss 0 1 0 603456 976 0.0 launchd /sbin/launchd
+Ss 0 10 1 612820 3608 0.0 kextd /usr/libexec/kextd
+Ss 0 11 1 632980 8680 0.0 DirectoryService /usr/sbin/DirectoryService
+Ss 0 12 1 602832 720 0.0 notifyd /usr/sbin/notifyd
+Ss 0 13 1 603916 1136 0.0 syslogd /usr/sbin/syslogd
+Ss 0 14 1 614928 4928 0.0 configd /usr/sbin/configd
+Ss 65 15 1 615496 5616 0.0 mDNSResponder /usr/sbin/mDNSResponder -launchd
+Ss 1 16 1 608960 2212 0.0 distnoted /usr/sbin/distnoted
+Ss 65 18 1 602432 504 0.0 launchd /sbin/launchd
+Ss 0 20 1 614836 5844 0.3 securityd /usr/sbin/securityd -i
+Ss 0 24 1 610536 2704 0.0 ntpd /usr/sbin/ntpd -n -g -p /var/run/ntpd.pid -f /var/db/ntp.drift
+Ss 0 25 1 602228 496 0.0 update /usr/sbin/update
+Ss 0 26 1 609900 2320 0.0 SystemStarter /sbin/SystemStarter
+Ss 0 30 1 834352 36264 0.3 mds /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds
+Ss 501 31 1 1110572 23948 0.0 loginwindow /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow console
+Ss 0 32 1 609448 2616 0.0 KernelEventAgent /usr/sbin/KernelEventAgent
+Ss 0 34 1 609892 2204 0.0 hidd /usr/libexec/hidd
+Ss 0 35 1 624704 4284 0.0 fseventsd /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Support/fseventsd
+Ss 0 36 1 610256 2876 0.0 dynamic_pager /sbin/dynamic_pager -F /private/var/vm/swapfile
+Ss 0 39 1 613408 4140 0.0 diskarbitrationd /usr/sbin/diskarbitrationd
+Ss 0 43 1 665708 8024 0.0 blued /usr/sbin/blued
+Ss 0 44 1 609408 2828 0.0 autofsd autofsd
+Ss 0 45 1 654084 9600 0.0 socketfilterfw /usr/libexec/ApplicationFirewall/socketfilterfw
+Ss 0 46 1 704764 12788 0.0 ccc_helper /Applications/Carbon Copy Cloner.app/Contents/Resources/ccc_helper.app/Contents/MacOS/ccc_helper 3231BC22-F30F-45D8-BDE8-47A098D57ABD
+Ss 0 54 1 667956 19212 0.0 coreservicesd /System/Library/CoreServices/coreservicesd
+Ss 88 56 1 1205840 85700 1.6 WindowServer /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/WindowServer -daemon
+Ss 0 67 1 602992 612 0.0 llipd /Library/StartupItems/ParallelsTransporter/llipd
+S 0 83 1 613352 2312 0.0 pvsnatd /Library/StartupItems/Parallels/pvsnatd
+Ss 0 94 1 712036 15056 0.0 coreaudiod /usr/sbin/coreaudiod
+Ss 501 102 1 602432 1040 0.0 launchd /sbin/launchd
+S 501 109 102 1176668 28068 0.0 Spotlight /System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight
+S 501 110 102 941796 10988 0.0 UserEventAgent /usr/sbin/UserEventAgent -l Aqua
+S 501 112 102 610028 2056 0.0 pboard /usr/sbin/pboard
+S 501 114 102 1090056 29196 1.3 Dock /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock -psn_0_24582
+S 501 115 102 685360 14048 0.0 ATSServer /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Support/ATSServer
+S 501 117 102 1121904 94432 0.1 SystemUIServer /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer -psn_0_32776
+S 501 118 102 1110388 42064 1.4 Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -psn_0_36873
+S 501 123 102 718264 34752 0.0 FileSyncAgent /System/Library/CoreServices/FileSyncAgent.app/Contents/MacOS/FileSyncAgent -launchedByLaunchd
+S 501 127 102 1048388 25344 0.0 smcFanControl /Applications/smcFanControl.app/Contents/MacOS/smcFanControl -psn_0_53261
+S 501 128 102 970912 12924 0.0 iTunesHelper /Applications/iTunes.app/Contents/Resources/iTunesHelper.app/Contents/MacOS/iTunesHelper -psn_0_57358
+S 501 129 102 1095920 23364 1.4 Activity Monitor /Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor -psn_0_61455
+S 501 132 102 657212 8356 0.0 dmnotifyd /System/Library/PrivateFrameworks/DMNotification.framework/Versions/Current/Resources/dmnotifyd
+Ss -2 133 1 610464 2328 0.0 usbmuxd /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/Resources/usbmuxd -launchd
+Ss 0 136 129 637456 6340 10.6 pmTool /Applications/Utilities/Activity Monitor.app/Contents/Resources/pmTool
+Ss 501 142 1 676652 8984 0.1 diskimages-helpe /System/Library/PrivateFrameworks/DiskImages.framework/Resources/diskimages-helper -uuid F2225770-5EFF-467C-91FD-C990F056B22F -post-exec
+Ss 0 147 1 627640 5928 0.0 hdiejectd /System/Library/PrivateFrameworks/DiskImages.framework/Resources/hdiejectd
+S 501 157 102 1045492 27480 0.0 GrowlHelperApp /Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/Contents/MacOS/GrowlHelperApp -psn_0_81940
+U 501 158 102 1878012 388136 0.7 Safari /Applications/Safari.app/Contents/MacOS/Safari -psn_0_86037
+S 501 172 102 645560 11344 0.0 AppleSpell /System/Library/Services/AppleSpell.service/Contents/MacOS/AppleSpell -psn_0_98328
+S 501 175 102 1055412 33396 0.0 Terminal /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_102425
+Z 501 186 158 0 0 0.0 Meeting Manager (Meeting Manager)
+S 501 214 102 616988 3808 0.0 ssh-agent /usr/bin/ssh-agent -l
+Ss 502 217 1 602432 1016 0.0 launchd /sbin/launchd
+S 501 499 102 1313808 130396 0.3 Mail /Applications/Mail.app/Contents/MacOS/Mail -psn_0_180268
+S 501 502 102 1091652 52168 0.0 NetNewsWire Lite /Applications/NetNewsWire Lite.app/Contents/MacOS/NetNewsWire Lite -psn_0_184365
+Ss 502 572 56 818908 20988 0.0 loginwindow /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
+S 502 585 217 741824 19056 0.0 Spotlight /System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight
+S 502 586 217 941900 11044 0.0 UserEventAgent /usr/sbin/UserEventAgent -l Aqua
+S 502 588 217 757320 18080 0.0 Dock /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock -psn_0_237626
+S 502 590 217 610072 2068 0.0 pboard /usr/sbin/pboard
+S 502 592 217 794140 25456 0.0 SystemUIServer /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer -psn_0_245820
+S 502 593 217 845552 30596 0.0 Finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -psn_0_249917
+S 502 594 217 671780 7872 0.0 ATSServer /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Support/ATSServer
+U 502 605 217 938844 64964 0.0 Pages /Applications/iWork '08/Pages.app/Contents/MacOS/Pages -psn_0_266305
+S 502 609 217 644432 10828 0.0 AppleSpell /System/Library/Services/AppleSpell.service/Contents/MacOS/AppleSpell -psn_0_270402
+S 502 610 217 638552 5216 0.0 AppleSpell /System/Library/Services/AppleSpell.service/Contents/MacOS/AppleSpell -psn_0_274499
+U 502 710 217 1029148 223312 0.0 Safari /Applications/Safari.app/Contents/MacOS/Safari -psn_0_331857
+S 502 712 217 904056 62928 0.3 Mail /Applications/Mail.app/Contents/MacOS/Mail -psn_0_335954
+U 501 998 102 1068272 26532 0.0 Address Book /Applications/Address Book.app/Contents/MacOS/Address Book -psn_0_417894
+S 502 2228 217 820940 30600 0.0 TextEdit /Applications/TextEdit.app/Contents/MacOS/TextEdit -psn_0_729266
+S 501 2431 102 1067868 43492 0.0 iCal /Applications/iCal.app/Contents/MacOS/iCal -psn_0_803012
+S 501 2531 102 1250108 68792 2.4 Skype /Applications/Skype.app/Contents/MacOS/Skype -psn_0_823497
+Ss 92 3143 1 602432 828 0.0 launchd /sbin/launchd
+S 501 3491 102 1048620 31256 0.0 TextEdit /Applications/TextEdit.app/Contents/MacOS/TextEdit -psn_0_962795
+S 501 3536 102 1073340 30524 0.0 Preview /Applications/Preview.app/Contents/MacOS/Preview -psn_0_983280
+S 501 4045 102 1041544 29168 0.0 PasswordWallet /Applications/PasswordWallet.app/Contents/MacOS/PasswordWallet -psn_0_1138966
+S 501 4892 114 1064948 43488 0.0 DashboardClient /System/Library/CoreServices/Dock.app/Contents/Resources/DashboardClient.app/Contents/MacOS/DashboardClient
+S 501 6806 102 1163836 67356 0.0 Colloquy /Applications/Colloquy.app/Contents/MacOS/Colloquy -psn_0_2220574
+U 501 6969 102 1156804 58764 0.0 Adium /Applications/Adium.app/Contents/MacOS/Adium -psn_0_2294320
+S 501 7530 102 671612 17440 0.0 helpdatad /System/Library/PrivateFrameworks/HelpData.framework/Versions/A/Resources/helpdatad
+Ss -2 38255 1 602432 952 0.0 launchd /sbin/launchd
+S 501 40569 102 1160664 49484 0.0 Dictionary /Applications/Dictionary.app/Contents/MacOS/Dictionary -psn_0_4387887
+SNs 501 42683 1 744096 21084 0.0 mdworker /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker MDSImporterWorker com.apple.Spotlight.ImporterWorker.501
+S 501 62225 102 711004 18040 0.0 SyncServer /System/Library/Frameworks/SyncServices.framework/Versions/Current/Resources/SyncServer.app/Contents/MacOS/SyncServer
+SNs -2 62284 1 671812 10880 0.0 mdworker /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker MDSImporterWorker com.apple.Spotlight.ImporterWorker.-2
+Ss 0 62285 1 617056 5472 0.0 cupsd /usr/sbin/cupsd -l
+S 502 62287 217 632360 10044 0.0 PubSubAgent /System/Library/Frameworks/PubSub.framework/Versions/A/Resources/PubSubAgent.app/Contents/MacOS/PubSubAgent
+SNs 502 62288 1 668876 10440 0.0 mdworker /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker MDSImporterWorker com.apple.Spotlight.ImporterWorker.502
+S 501 62296 102 643688 11980 2.2 PubSubAgent /System/Library/Frameworks/PubSub.framework/Versions/A/Resources/PubSubAgent.app/Contents/MacOS/PubSubAgent
+Ss 0 4558 175 630816 6960 0.0 login login -pf tonvoon
+S 501 4559 4558 603600 1736 0.0 bash -bash
+R+ 0 62297 4559 602388 852 0.0 ps /bin/ps -axwo stat
+Ss 0 7301 175 630816 6960 0.0 login login -pf tonvoon
+S 501 7302 7301 603600 1584 0.0 bash -bash
+S+ 501 41381 7302 615408 4196 0.0 ssh ssh dev.net.altinity
diff --git a/plugins/tests/var/ps-axwo.debian b/plugins/tests/var/ps-axwo.debian
new file mode 100644
index 0000000..5889e9a
--- /dev/null
+++ b/plugins/tests/var/ps-axwo.debian
@@ -0,0 +1,219 @@
+STAT UID PID PPID VSZ RSS %CPU ELAPSED COMMAND COMMAND
+Ss 0 1 0 167244 7144 0.1 26-03:07:26 systemd /lib/systemd/systemd --system --deserialize 17
+S 0 2 0 0 0 0.0 26-03:07:26 kthreadd [kthreadd]
+I< 0 3 2 0 0 0.0 26-03:07:26 rcu_gp [rcu_gp]
+I< 0 4 2 0 0 0.0 26-03:07:26 rcu_par_gp [rcu_par_gp]
+I< 0 6 2 0 0 0.0 26-03:07:26 kworker/0:0H-ev [kworker/0:0H-events_highpri]
+I< 0 9 2 0 0 0.0 26-03:07:26 mm_percpu_wq [mm_percpu_wq]
+S 0 10 2 0 0 0.0 26-03:07:26 rcu_tasks_rude_ [rcu_tasks_rude_]
+S 0 11 2 0 0 0.0 26-03:07:26 rcu_tasks_trace [rcu_tasks_trace]
+S 0 12 2 0 0 0.0 26-03:07:26 ksoftirqd/0 [ksoftirqd/0]
+I 0 13 2 0 0 0.0 26-03:07:26 rcu_sched [rcu_sched]
+S 0 14 2 0 0 0.0 26-03:07:26 migration/0 [migration/0]
+S 0 15 2 0 0 0.0 26-03:07:26 cpuhp/0 [cpuhp/0]
+S 0 16 2 0 0 0.0 26-03:07:26 cpuhp/1 [cpuhp/1]
+S 0 17 2 0 0 0.0 26-03:07:26 migration/1 [migration/1]
+S 0 18 2 0 0 0.0 26-03:07:26 ksoftirqd/1 [ksoftirqd/1]
+I< 0 20 2 0 0 0.0 26-03:07:26 kworker/1:0H-ev [kworker/1:0H-events_highpri]
+S 0 21 2 0 0 0.0 26-03:07:26 cpuhp/2 [cpuhp/2]
+S 0 22 2 0 0 0.0 26-03:07:26 migration/2 [migration/2]
+S 0 23 2 0 0 0.0 26-03:07:26 ksoftirqd/2 [ksoftirqd/2]
+I< 0 25 2 0 0 0.0 26-03:07:26 kworker/2:0H-ev [kworker/2:0H-events_highpri]
+S 0 26 2 0 0 0.0 26-03:07:26 cpuhp/3 [cpuhp/3]
+S 0 27 2 0 0 0.0 26-03:07:26 migration/3 [migration/3]
+S 0 28 2 0 0 0.0 26-03:07:26 ksoftirqd/3 [ksoftirqd/3]
+I< 0 30 2 0 0 0.0 26-03:07:26 kworker/3:0H-ev [kworker/3:0H-events_highpri]
+S 0 35 2 0 0 0.0 26-03:07:26 kdevtmpfs [kdevtmpfs]
+I< 0 36 2 0 0 0.0 26-03:07:26 netns [netns]
+S 0 37 2 0 0 0.0 26-03:07:26 kauditd [kauditd]
+S 0 38 2 0 0 0.0 26-03:07:26 khungtaskd [khungtaskd]
+S 0 39 2 0 0 0.0 26-03:07:26 oom_reaper [oom_reaper]
+I< 0 40 2 0 0 0.0 26-03:07:26 writeback [writeback]
+S 0 41 2 0 0 0.0 26-03:07:26 kcompactd0 [kcompactd0]
+SN 0 42 2 0 0 0.0 26-03:07:26 ksmd [ksmd]
+SN 0 43 2 0 0 0.0 26-03:07:26 khugepaged [khugepaged]
+I< 0 62 2 0 0 0.0 26-03:07:26 kintegrityd [kintegrityd]
+I< 0 63 2 0 0 0.0 26-03:07:26 kblockd [kblockd]
+I< 0 64 2 0 0 0.0 26-03:07:26 blkcg_punt_bio [blkcg_punt_bio]
+I< 0 65 2 0 0 0.0 26-03:07:26 edac-poller [edac-poller]
+I< 0 66 2 0 0 0.0 26-03:07:26 devfreq_wq [devfreq_wq]
+I< 0 67 2 0 0 0.0 26-03:07:26 kworker/2:1H-ev [kworker/2:1H-events_highpri]
+S 0 70 2 0 0 0.3 26-03:07:25 kswapd0 [kswapd0]
+I< 0 71 2 0 0 0.0 26-03:07:25 kthrotld [kthrotld]
+I< 0 72 2 0 0 0.0 26-03:07:25 acpi_thermal_pm [acpi_thermal_pm]
+I< 0 74 2 0 0 0.0 26-03:07:25 ipv6_addrconf [ipv6_addrconf]
+I< 0 80 2 0 0 0.0 26-03:07:25 kworker/3:1H-ev [kworker/3:1H-events_highpri]
+I< 0 84 2 0 0 0.0 26-03:07:25 kstrp [kstrp]
+I< 0 87 2 0 0 0.0 26-03:07:25 zswap-shrink [zswap-shrink]
+I< 0 110 2 0 0 0.0 26-03:07:25 kworker/0:1H-ev [kworker/0:1H-events_highpri]
+I< 0 141 2 0 0 0.0 26-03:07:25 ata_sff [ata_sff]
+S 0 143 2 0 0 0.0 26-03:07:25 scsi_eh_0 [scsi_eh_0]
+I< 0 144 2 0 0 0.0 26-03:07:25 scsi_tmf_0 [scsi_tmf_0]
+S 0 145 2 0 0 0.0 26-03:07:25 scsi_eh_1 [scsi_eh_1]
+I< 0 146 2 0 0 0.0 26-03:07:25 scsi_tmf_1 [scsi_tmf_1]
+S 0 147 2 0 0 0.0 26-03:07:25 scsi_eh_2 [scsi_eh_2]
+I< 0 148 2 0 0 0.0 26-03:07:25 scsi_tmf_2 [scsi_tmf_2]
+S 0 149 2 0 0 0.0 26-03:07:25 scsi_eh_3 [scsi_eh_3]
+I< 0 150 2 0 0 0.0 26-03:07:25 scsi_tmf_3 [scsi_tmf_3]
+S 0 151 2 0 0 0.0 26-03:07:25 scsi_eh_4 [scsi_eh_4]
+I< 0 152 2 0 0 0.0 26-03:07:25 scsi_tmf_4 [scsi_tmf_4]
+S 0 153 2 0 0 0.0 26-03:07:25 scsi_eh_5 [scsi_eh_5]
+I< 0 154 2 0 0 0.0 26-03:07:25 scsi_tmf_5 [scsi_tmf_5]
+S 0 158 2 0 0 0.0 26-03:07:25 card0-crtc0 [card0-crtc0]
+S 0 159 2 0 0 0.0 26-03:07:25 card0-crtc1 [card0-crtc1]
+S 0 160 2 0 0 0.0 26-03:07:25 card0-crtc2 [card0-crtc2]
+I< 0 162 2 0 0 0.0 26-03:07:25 kworker/1:1H-ev [kworker/1:1H-events_highpri]
+S 0 163 2 0 0 0.0 26-03:07:25 scsi_eh_6 [scsi_eh_6]
+I< 0 164 2 0 0 0.0 26-03:07:25 scsi_tmf_6 [scsi_tmf_6]
+S 0 165 2 0 0 0.0 26-03:07:25 usb-storage [usb-storage]
+I< 0 167 2 0 0 0.0 26-03:07:25 uas [uas]
+I< 0 176 2 0 0 0.0 26-03:07:25 kdmflush [kdmflush]
+I< 0 177 2 0 0 0.0 26-03:07:25 kdmflush [kdmflush]
+S 0 202 2 0 0 0.0 26-03:07:24 scsi_eh_7 [scsi_eh_7]
+I< 0 203 2 0 0 0.0 26-03:07:24 scsi_tmf_7 [scsi_tmf_7]
+S 0 204 2 0 0 0.0 26-03:07:24 usb-storage [usb-storage]
+I< 0 232 2 0 0 0.0 26-03:07:23 btrfs-worker [btrfs-worker]
+I< 0 233 2 0 0 0.0 26-03:07:23 btrfs-worker-hi [btrfs-worker-hi]
+I< 0 234 2 0 0 0.0 26-03:07:23 btrfs-delalloc [btrfs-delalloc]
+I< 0 235 2 0 0 0.0 26-03:07:23 btrfs-flush_del [btrfs-flush_del]
+I< 0 236 2 0 0 0.0 26-03:07:23 btrfs-cache [btrfs-cache]
+I< 0 237 2 0 0 0.0 26-03:07:23 btrfs-fixup [btrfs-fixup]
+I< 0 238 2 0 0 0.0 26-03:07:23 btrfs-endio [btrfs-endio]
+I< 0 239 2 0 0 0.0 26-03:07:23 btrfs-endio-met [btrfs-endio-met]
+I< 0 240 2 0 0 0.0 26-03:07:23 btrfs-endio-met [btrfs-endio-met]
+I< 0 241 2 0 0 0.0 26-03:07:23 btrfs-endio-rai [btrfs-endio-rai]
+I< 0 242 2 0 0 0.0 26-03:07:23 btrfs-rmw [btrfs-rmw]
+I< 0 243 2 0 0 0.0 26-03:07:23 btrfs-endio-wri [btrfs-endio-wri]
+I< 0 244 2 0 0 0.0 26-03:07:23 btrfs-freespace [btrfs-freespace]
+I< 0 245 2 0 0 0.0 26-03:07:23 btrfs-delayed-m [btrfs-delayed-m]
+I< 0 246 2 0 0 0.0 26-03:07:23 btrfs-readahead [btrfs-readahead]
+I< 0 247 2 0 0 0.0 26-03:07:23 btrfs-qgroup-re [btrfs-qgroup-re]
+S 0 248 2 0 0 0.0 26-03:07:23 btrfs-cleaner [btrfs-cleaner]
+S 0 249 2 0 0 0.2 26-03:07:23 btrfs-transacti [btrfs-transacti]
+I< 0 317 2 0 0 0.0 26-03:07:22 rpciod [rpciod]
+I< 0 322 2 0 0 0.0 26-03:07:22 xprtiod [xprtiod]
+S 0 381 2 0 0 0.0 26-03:07:22 irq/133-mei_me [irq/133-mei_me]
+S 0 422 2 0 0 0.0 26-03:07:22 watchdogd [watchdogd]
+I< 0 523 2 0 0 0.0 26-03:07:22 led_workqueue [led_workqueue]
+I< 0 583 2 0 0 0.0 26-03:07:22 cryptd [cryptd]
+I< 0 590 2 0 0 0.0 26-03:07:22 ext4-rsv-conver [ext4-rsv-conver]
+Ss 104 693 1 12324 4292 0.5 26-03:07:21 dbus-daemon /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
+Ss 0 731 1 575120 1368 0.0 26-03:07:21 systemd-logind /lib/systemd/systemd-logind
+Ssl 0 1111 1 121248 732 0.0 26-03:07:18 unattended-upgr /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
+S 0 1141 2 0 0 0.0 26-03:07:18 lockd [lockd]
+I< 0 1459 2 0 0 0.0 26-03:07:16 nfsiod [nfsiod]
+S 0 1621 2 0 0 0.0 26-03:07:15 NFSv4 callback [NFSv4 callback]
+Ssl 0 1771 1 1548340 676 0.0 26-03:07:13 libvirtd /usr/sbin/libvirtd
+I< 0 24315 2 0 0 0.0 26-02:49:02 cifsiod [cifsiod]
+I< 0 24316 2 0 0 0.0 26-02:49:02 smb3decryptd [smb3decryptd]
+I< 0 24317 2 0 0 0.0 26-02:49:02 cifsfileinfoput [cifsfileinfoput]
+I< 0 24318 2 0 0 0.0 26-02:49:02 cifsoplockd [cifsoplockd]
+I< 0 24319 2 0 0 0.0 26-02:49:02 cifs-dfscache [cifs-dfscache]
+S 0 24322 2 0 0 0.0 26-02:49:02 cifsd [cifsd]
+I< 0 24413 2 0 0 0.0 26-02:48:57 btrfs-worker [btrfs-worker]
+I< 0 24414 2 0 0 0.0 26-02:48:57 btrfs-worker-hi [btrfs-worker-hi]
+I< 0 24415 2 0 0 0.0 26-02:48:57 btrfs-delalloc [btrfs-delalloc]
+I< 0 24416 2 0 0 0.0 26-02:48:57 btrfs-flush_del [btrfs-flush_del]
+I< 0 24418 2 0 0 0.0 26-02:48:57 btrfs-cache [btrfs-cache]
+I< 0 24419 2 0 0 0.0 26-02:48:57 btrfs-fixup [btrfs-fixup]
+I< 0 24420 2 0 0 0.0 26-02:48:57 btrfs-endio [btrfs-endio]
+I< 0 24421 2 0 0 0.0 26-02:48:57 btrfs-endio-met [btrfs-endio-met]
+I< 0 24422 2 0 0 0.0 26-02:48:57 btrfs-endio-met [btrfs-endio-met]
+I< 0 24423 2 0 0 0.0 26-02:48:57 btrfs-endio-rai [btrfs-endio-rai]
+I< 0 24424 2 0 0 0.0 26-02:48:57 btrfs-rmw [btrfs-rmw]
+I< 0 24425 2 0 0 0.0 26-02:48:57 btrfs-endio-wri [btrfs-endio-wri]
+I< 0 24426 2 0 0 0.0 26-02:48:57 btrfs-freespace [btrfs-freespace]
+I< 0 24427 2 0 0 0.0 26-02:48:57 btrfs-delayed-m [btrfs-delayed-m]
+I< 0 24428 2 0 0 0.0 26-02:48:57 btrfs-readahead [btrfs-readahead]
+I< 0 24429 2 0 0 0.0 26-02:48:57 btrfs-qgroup-re [btrfs-qgroup-re]
+S 0 24450 2 0 0 0.0 26-02:48:53 btrfs-cleaner [btrfs-cleaner]
+S 0 24451 2 0 0 0.0 26-02:48:53 btrfs-transacti [btrfs-transacti]
+I< 0 747708 2 0 0 0.0 16-21:06:20 xfsalloc [xfsalloc]
+I< 0 747709 2 0 0 0.0 16-21:06:20 xfs_mru_cache [xfs_mru_cache]
+S 0 747713 2 0 0 0.0 16-21:06:20 jfsIO [jfsIO]
+S 0 747714 2 0 0 0.0 16-21:06:20 jfsCommit [jfsCommit]
+S 0 747715 2 0 0 0.0 16-21:06:20 jfsCommit [jfsCommit]
+S 0 747716 2 0 0 0.0 16-21:06:20 jfsCommit [jfsCommit]
+S 0 747717 2 0 0 0.0 16-21:06:20 jfsCommit [jfsCommit]
+S 0 747718 2 0 0 0.0 16-21:06:20 jfsSync [jfsSync]
+Ss 0 1071687 1 105976 28304 0.0 3-03:12:31 systemd-journal /lib/systemd/systemd-journald
+Ss 0 1934146 1 25672 4704 0.0 11:19:31 cupsd /usr/sbin/cupsd -l
+Ssl 0 1934148 1 182868 8540 0.0 11:19:31 cups-browsed /usr/sbin/cups-browsed
+S 13 1934155 3392655 5752 88 0.0 11:19:31 pinger (pinger)
+S< 33 1934166 3393034 57996 5460 0.0 11:19:31 apache2 /usr/sbin/apache2 -k start
+S< 33 1934167 3393034 216944 13892 0.0 11:19:30 apache2 /usr/sbin/apache2 -k start
+S< 33 1934168 3393034 216944 13756 0.0 11:19:30 apache2 /usr/sbin/apache2 -k start
+S< 33 1934169 3393034 216936 13732 0.0 11:19:30 apache2 /usr/sbin/apache2 -k start
+S< 33 1934170 3393034 216944 13888 0.0 11:19:30 apache2 /usr/sbin/apache2 -k start
+S< 33 1934172 3393034 216944 15388 0.0 11:19:30 apache2 /usr/sbin/apache2 -k start
+S< 33 1934701 3393034 216936 13736 0.0 11:19:29 apache2 /usr/sbin/apache2 -k start
+S< 33 1935056 3393034 216920 13724 0.0 11:19:28 apache2 /usr/sbin/apache2 -k start
+S 7 1936834 1934146 16652 832 0.0 11:18:12 dbus /usr/lib/cups/notifier/dbus dbus://
+S< 33 1955909 3393034 216928 13792 0.0 11:00:25 apache2 /usr/sbin/apache2 -k start
+I< 0 2531464 2 0 0 0.0 06:35:47 kworker/u9:0-i9 [kworker/u9:0-i915_flip]
+I 0 2570506 2 0 0 0.0 06:27:41 kworker/1:0-cgr [kworker/1:0-cgroup_destroy]
+I 0 2596195 2 0 0 0.0 06:21:52 kworker/1:1-eve [kworker/1:1-events]
+I 0 2785341 2 0 0 0.0 03:34:16 kworker/u8:8-bt [kworker/u8:8-btrfs-endio-write]
+I 0 2785520 2 0 0 0.0 03:33:50 kworker/3:0-eve [kworker/3:0-events]
+I 0 2798669 2 0 0 0.0 03:21:09 kworker/u8:5-bt [kworker/u8:5-btrfs-endio-write]
+Ss 0 2803015 1 5616 3108 0.0 03:17:54 cron /usr/sbin/cron -f
+I 0 2845483 2 0 0 0.0 02:38:11 kworker/0:3-eve [kworker/0:3-events]
+I 0 2939490 2 0 0 0.1 01:10:32 kworker/0:0-eve [kworker/0:0-events]
+I 0 2939754 2 0 0 0.0 01:10:26 kworker/u8:1-i9 [kworker/u8:1-i915]
+I 0 2942040 2 0 0 0.0 01:08:02 kworker/u8:7-bt [kworker/u8:7-btrfs-endio-meta]
+S 117 2954268 3392551 40044 5772 0.0 56:37 pickup pickup -l -t unix -u -c
+I 0 2965195 2 0 0 0.0 46:00 kworker/u8:0-bt [kworker/u8:0-btrfs-worker]
+I 0 2977972 2 0 0 0.0 33:54 kworker/u8:2-bt [kworker/u8:2-btrfs-endio-write]
+I 0 2985488 2 0 0 0.0 27:02 kworker/u8:3-bl [kworker/u8:3-blkcg_punt_bio]
+I 0 2987519 2 0 0 1.0 25:15 kworker/2:1-eve [kworker/2:1-events]
+I 0 2987601 2 0 0 0.0 25:03 kworker/u8:9-i9 [kworker/u8:9-i915]
+I< 0 2995218 2 0 0 0.0 18:41 kworker/u9:2-xp [kworker/u9:2-xprtiod]
+I 0 2997170 2 0 0 0.0 16:41 kworker/3:1-rcu [kworker/3:1-rcu_gp]
+I 0 3001264 2 0 0 0.0 13:01 kworker/u8:4-bt [kworker/u8:4-btrfs-endio-write]
+I 0 3004697 2 0 0 0.7 09:41 kworker/2:0-eve [kworker/2:0-events]
+I 0 3010619 2 0 0 1.0 04:29 kworker/2:2-eve [kworker/2:2-events]
+I 0 3014612 2 0 0 0.0 00:41 kworker/3:2-eve [kworker/3:2-events]
+S 0 3015082 2803015 6716 3028 0.0 00:30 cron /usr/sbin/CRON -f
+I 0 3015382 2 0 0 0.0 00:00 kworker/u8:6-bt [kworker/u8:6-btrfs-endio-meta]
+Ss 1 3392068 1 5592 504 0.0 15-02:34:39 atd /usr/sbin/atd -f
+Ssl 0 3392072 1 235796 1740 0.0 15-02:34:39 accounts-daemon /usr/libexec/accounts-daemon
+Ssl 106 3392076 1 315708 6128 0.0 15-02:34:39 colord /usr/libexec/colord
+Ss 0 3392083 1 8120 720 0.0 15-02:34:39 haveged /usr/sbin/haveged --Foreground --verbose=1
+Ss 0 3392090 1 5168 132 0.0 15-02:34:39 blkmapd /usr/sbin/blkmapd
+SNsl 111 3392094 1 155648 440 0.0 15-02:34:39 rtkit-daemon /usr/libexec/rtkit-daemon
+Ssl 0 3392097 1 290168 1352 0.0 15-02:34:39 packagekitd /usr/libexec/packagekitd
+Ss 128 3392100 1 7960 448 0.0 15-02:34:39 rpcbind /sbin/rpcbind -f -w
+Ss 0 3392114 1 13432 616 0.0 15-02:34:39 systemd-machine /lib/systemd/systemd-machined
+Ss 0 3392118 1 13316 848 0.0 15-02:34:39 sshd sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
+Ssl 0 3392124 1 244072 2456 0.0 15-02:34:39 upowerd /usr/libexec/upowerd
+Ssl 0 3392138 1 1634748 10684 0.0 15-02:34:39 containerd /usr/bin/containerd
+Ssl 0 3392139 1 222768 1784 0.0 15-02:34:39 rsyslogd /usr/sbin/rsyslogd -n -iNONE
+Ss 13 3392140 1 3344 152 0.0 15-02:34:39 polipo /usr/bin/polipo -c /etc/polipo/config pidFile=/var/run/polipo/polipo.pid daemonise=true
+Ssl 119 3392156 1 76472 1688 0.0 15-02:34:39 ntpd /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 119:126
+Ss 120 3392168 1 4656 276 0.0 15-02:34:39 rpc.statd /sbin/rpc.statd --no-notify
+Ss 0 3392171 1 5072 432 0.0 15-02:34:39 rpc.mountd /usr/sbin/rpc.mountd --manage-gids
+Ss 0 3392176 1 5008 288 0.0 15-02:34:39 rpc.idmapd /usr/sbin/rpc.idmapd
+Ss 105 3392184 1 15544 6816 3.5 15-02:34:39 avahi-daemon avahi-daemon: running [tsui.local]
+Ss 0 3392186 1 25288 3860 0.0 15-02:34:39 systemd-udevd /lib/systemd/systemd-udevd
+S 105 3392190 3392184 8788 52 0.0 15-02:34:39 avahi-daemon avahi-daemon: chroot helper
+Ssl 0 3392197 1 396120 4188 0.0 15-02:34:39 udisksd /usr/libexec/udisks2/udisksd
+Ssl 0 3392214 1 237504 6632 0.0 15-02:34:39 polkitd /usr/libexec/polkitd --no-debug
+Ss 0 3392284 1 9684 560 0.0 15-02:34:38 xinetd /usr/sbin/xinetd -pidfile /run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6
+Ssl 0 3392285 1 314840 1352 0.0 15-02:34:38 ModemManager /usr/sbin/ModemManager
+Ss 0 3392317 1 2352 140 0.0 15-02:34:38 acpid /usr/sbin/acpid
+S 0 3392400 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+S 0 3392401 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+S 0 3392402 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+S 0 3392403 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+S 0 3392404 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+S 0 3392405 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+S 0 3392407 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+S 0 3392410 2 0 0 0.0 15-02:34:38 nfsd [nfsd]
+Ss 0 3392551 1 40092 1304 0.0 15-02:34:37 master /usr/lib/postfix/sbin/master -w
+S 117 3392553 3392551 40156 568 0.0 15-02:34:37 qmgr qmgr -l -t unix -u
+Ss 0 3392650 1 63652 4 0.0 15-02:34:36 squid /usr/sbin/squid --foreground -sYC
+Ssl 116 3392652 1 1675196 93848 0.0 15-02:34:36 mariadbd /usr/sbin/mariadbd
+S 13 3392655 3392650 81776 21232 0.0 15-02:34:36 squid (squid-1) --kid squid-1 --foreground -sYC
+S 13 3392657 3392655 5572 68 0.0 15-02:34:36 log_file_daemon (logfile-daemon) /var/log/squid/access.log
+S<s 0 3393034 1 216648 7560 0.0 15-02:34:34 apache2 /usr/sbin/apache2 -k start
+Ss 33 3393037 1 3432 180 0.0 15-02:34:34 htcacheclean /usr/bin/htcacheclean -d 120 -p /var/cache/apache2/mod_cache_disk -l 300M -n
diff --git a/plugins/tests/var/root b/plugins/tests/var/root
new file mode 100644
index 0000000..9339e13
--- /dev/null
+++ b/plugins/tests/var/root
@@ -0,0 +1 @@
+Root
diff --git a/plugins/urlize.c b/plugins/urlize.c
new file mode 100644
index 0000000..6fda72d
--- /dev/null
+++ b/plugins/urlize.c
@@ -0,0 +1,198 @@
+/*****************************************************************************
+*
+* Monitoring urlize plugin
+*
+* License: GPL
+* Copyright (c) 2000-2007 Monitoring Plugins Development Team
+*
+* Description:
+*
+* This file contains the urlize plugin
+*
+* This plugin wraps the text output of another command (plugin) in HTML <A>
+* tags. This plugin returns the status of the invoked plugin.
+*
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+const char *progname = "urlize";
+const char *copyright = "2000-2006";
+const char *email = "devel@monitoring-plugins.org";
+
+#include "common.h"
+#include "utils.h"
+#include "popen.h"
+
+#define PERF_CHARACTER "|"
+#define NEWLINE_CHARACTER '\n'
+
+void print_help (void);
+void print_usage (void);
+
+int
+main (int argc, char **argv)
+{
+ int found = 0, result = STATE_UNKNOWN;
+ char *url = NULL;
+ char *cmd;
+ char *buf;
+ char *nstr;
+ char tstr[MAX_INPUT_BUFFER];
+
+ int c;
+ int option = 0;
+ static struct option longopts[] = {
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"url", required_argument, 0, 'u'},
+ {0, 0, 0, 0}
+ };
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Need at least 2 args */
+ if (argc < 3) {
+ print_help();
+ exit (STATE_UNKNOWN);
+ }
+
+ while (1) {
+ c = getopt_long (argc, argv, "+hVu:", longopts, &option);
+
+ if (c == -1 || c == EOF)
+ break;
+
+ switch (c) {
+ case 'h': /* help */
+ print_help ();
+ exit (EXIT_SUCCESS);
+ break;
+ case 'V': /* version */
+ print_revision (progname, NP_VERSION);
+ exit (EXIT_SUCCESS);
+ break;
+ case 'u':
+ url = strdup (argv[optind]);
+ break;
+ case '?':
+ default:
+ usage5 ();
+ }
+ }
+
+ if (url == NULL)
+ url = strdup (argv[optind++]);
+
+ cmd = strdup (argv[optind++]);
+ for (c = optind; c < argc; c++) {
+ xasprintf (&cmd, "%s %s", cmd, argv[c]);
+ }
+
+ child_process = spopen (cmd);
+ if (child_process == NULL) {
+ printf (_("Could not open pipe: %s\n"), cmd);
+ exit (STATE_UNKNOWN);
+ }
+
+ child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
+ if (child_stderr == NULL) {
+ printf (_("Could not open stderr for %s\n"), cmd);
+ }
+
+ bzero(tstr, sizeof(tstr));
+ buf = malloc(MAX_INPUT_BUFFER);
+ printf ("<A href=\"%s\">", argv[1]);
+ while (fgets (buf, MAX_INPUT_BUFFER - 1, child_process)) {
+ found++;
+ /* Collect the string in temp str so we can tokenize */
+ strcat(tstr, buf);
+ }
+
+ if (!found)
+ die (STATE_UNKNOWN,
+ _("%s UNKNOWN - No data received from host\nCMD: %s</A>\n"),
+ argv[0], cmd);
+
+
+ /* chop the newline character */
+ if ((nstr = strchr(tstr, NEWLINE_CHARACTER)) != NULL)
+ *nstr = '\0';
+
+ /* tokenize the string for Perfdata if there is some */
+ nstr = strtok(tstr, PERF_CHARACTER);
+ printf ("%s", nstr);
+ printf ("</A>");
+ nstr = strtok(NULL, PERF_CHARACTER);
+ if (nstr != NULL)
+ printf (" | %s", nstr);
+
+ /* close the pipe */
+ result = spclose (child_process);
+
+ /* WARNING if output found on stderr */
+ if (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr))
+ result = max_state (result, STATE_WARNING);
+
+ /* close stderr */
+ (void) fclose (child_stderr);
+
+ return result;
+}
+
+
+
+void
+print_help (void)
+{
+ print_revision (progname, NP_VERSION);
+
+ printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n");
+ printf (COPYRIGHT, copyright, email);
+
+ printf ("%s\n", _("This plugin wraps the text output of another command (plugin) in HTML <A>"));
+ printf ("%s\n", _("tags, thus displaying the child plugin's output as a clickable link in compatible"));
+ printf ("%s\n", _("monitoring status screen. This plugin returns the status of the invoked plugin."));
+
+ printf ("\n\n");
+
+ print_usage ();
+
+ printf (UT_HELP_VRSN);
+
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf ("%s\n", _("Pay close attention to quoting to ensure that the shell passes the expected"));
+ printf ("%s\n\n", _("data to the plugin. For example, in:"));
+ printf (" %s\n\n", _("urlize http://example.com/ check_http -H example.com -r 'two words'"));
+ printf (" %s\n", _("the shell will remove the single quotes and urlize will see:"));
+ printf (" %s\n\n", _("urlize http://example.com/ check_http -H example.com -r two words"));
+ printf (" %s\n\n", _("You probably want:"));
+ printf (" %s\n", _("urlize http://example.com/ \"check_http -H example.com -r 'two words'\""));
+
+ printf (UT_SUPPORT);
+}
+
+
+
+void
+print_usage (void)
+{
+ printf ("%s\n", _("Usage:"));
+ printf ("%s <url> <plugin> <arg1> ... <argN>\n", progname);
+}
diff --git a/plugins/utils.c b/plugins/utils.c
new file mode 100644
index 0000000..71c0bdd
--- /dev/null
+++ b/plugins/utils.c
@@ -0,0 +1,806 @@
+/*****************************************************************************
+*
+* Library of useful functions for plugins
+*
+* License: GPL
+* Copyright (c) 2000 Karl DeBisschop (karl@debisschop.net)
+* Copyright (c) 2002-2007 Monitoring Plugins Development Team
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
+
+#include "common.h"
+#include "utils.h"
+#include "utils_base.h"
+#include <stdarg.h>
+#include <limits.h>
+#include <string.h>
+#include <errno.h>
+
+#include <arpa/inet.h>
+
+extern void print_usage (void);
+extern const char *progname;
+
+#define STRLEN 64
+#define TXTBLK 128
+
+time_t start_time, end_time;
+
+/* **************************************************************************
+ * max_state(STATE_x, STATE_y)
+ * compares STATE_x to STATE_y and returns result based on the following
+ * STATE_UNKNOWN < STATE_OK < STATE_WARNING < STATE_CRITICAL
+ *
+ * Note that numerically the above does not hold
+ ****************************************************************************/
+
+int
+max_state (int a, int b)
+{
+ if (a == STATE_CRITICAL || b == STATE_CRITICAL)
+ return STATE_CRITICAL;
+ else if (a == STATE_WARNING || b == STATE_WARNING)
+ return STATE_WARNING;
+ else if (a == STATE_OK || b == STATE_OK)
+ return STATE_OK;
+ else if (a == STATE_UNKNOWN || b == STATE_UNKNOWN)
+ return STATE_UNKNOWN;
+ else if (a == STATE_DEPENDENT || b == STATE_DEPENDENT)
+ return STATE_DEPENDENT;
+ else
+ return max (a, b);
+}
+
+/* **************************************************************************
+ * max_state_alt(STATE_x, STATE_y)
+ * compares STATE_x to STATE_y and returns result based on the following
+ * STATE_OK < STATE_DEPENDENT < STATE_UNKNOWN < STATE_WARNING < STATE_CRITICAL
+ *
+ * The main difference between max_state_alt and max_state it that it doesn't
+ * allow setting a default to UNKNOWN. It will instead prioritixe any valid
+ * non-OK state.
+ ****************************************************************************/
+
+int
+max_state_alt (int a, int b)
+{
+ if (a == STATE_CRITICAL || b == STATE_CRITICAL)
+ return STATE_CRITICAL;
+ else if (a == STATE_WARNING || b == STATE_WARNING)
+ return STATE_WARNING;
+ else if (a == STATE_UNKNOWN || b == STATE_UNKNOWN)
+ return STATE_UNKNOWN;
+ else if (a == STATE_DEPENDENT || b == STATE_DEPENDENT)
+ return STATE_DEPENDENT;
+ else if (a == STATE_OK || b == STATE_OK)
+ return STATE_OK;
+ else
+ return max (a, b);
+}
+
+void usage (const char *msg)
+{
+ printf ("%s\n", msg);
+ print_usage ();
+ exit (STATE_UNKNOWN);
+}
+
+void usage_va (const char *fmt, ...)
+{
+ va_list ap;
+ printf("%s: ", progname);
+ va_start(ap, fmt);
+ vprintf(fmt, ap);
+ va_end(ap);
+ printf("\n");
+ exit (STATE_UNKNOWN);
+}
+
+void usage2(const char *msg, const char *arg)
+{
+ printf ("%s: %s - %s\n", progname, msg, arg?arg:"(null)" );
+ print_usage ();
+ exit (STATE_UNKNOWN);
+}
+
+void
+usage3 (const char *msg, int arg)
+{
+ printf ("%s: %s - %c\n", progname, msg, arg);
+ print_usage();
+ exit (STATE_UNKNOWN);
+}
+
+void
+usage4 (const char *msg)
+{
+ printf ("%s: %s\n", progname, msg);
+ print_usage();
+ exit (STATE_UNKNOWN);
+}
+
+void
+usage5 (void)
+{
+ print_usage();
+ exit (STATE_UNKNOWN);
+}
+
+void
+print_revision (const char *command_name, const char *revision)
+{
+ printf ("%s v%s (%s %s)\n",
+ command_name, revision, PACKAGE, VERSION);
+}
+
+int
+is_numeric (char *number)
+{
+ char tmp[1];
+ float x;
+
+ if (!number)
+ return FALSE;
+ else if (sscanf (number, "%f%c", &x, tmp) == 1)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_positive (char *number)
+{
+ if (is_numeric (number) && atof (number) > 0.0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_negative (char *number)
+{
+ if (is_numeric (number) && atof (number) < 0.0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_nonnegative (char *number)
+{
+ if (is_numeric (number) && atof (number) >= 0.0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_percentage (char *number)
+{
+ int x;
+ if (is_numeric (number) && (x = atof (number)) >= 0 && x <= 100)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_integer (char *number)
+{
+ long int n;
+
+ if (!number || (strspn (number, "-0123456789 ") != strlen (number)))
+ return FALSE;
+
+ n = strtol (number, NULL, 10);
+
+ if (errno != ERANGE && n >= INT_MIN && n <= INT_MAX)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_intpos (char *number)
+{
+ if (is_integer (number) && atoi (number) > 0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_intneg (char *number)
+{
+ if (is_integer (number) && atoi (number) < 0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_intnonneg (char *number)
+{
+ if (is_integer (number) && atoi (number) >= 0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+/*
+ * Checks whether the number in the string _number_ can be put inside a int64_t
+ * On success the number will be written to the _target_ address, if _target_ is not set
+ * to NULL.
+ */
+int is_int64(char *number, int64_t *target) {
+ errno = 0;
+ uint64_t tmp = strtoll(number, NULL, 10);
+ if (errno != 0) {
+ return 0;
+ }
+ if (tmp < INT64_MIN || tmp > INT64_MAX) {
+ return 0;
+ }
+ if (target != NULL) {
+ *target = tmp;
+ }
+ return 1;
+}
+
+/*
+ * Checks whether the number in the string _number_ can be put inside a uint64_t
+ * On success the number will be written to the _target_ address, if _target_ is not set
+ * to NULL.
+ */
+int is_uint64(char *number, uint64_t *target) {
+ errno = 0;
+ uint64_t tmp = strtoll(number, NULL, 10);
+ if (errno != 0) {
+ return 0;
+ }
+ if (tmp < 0 || tmp > UINT64_MAX) {
+ return 0;
+ }
+ if (target != NULL) {
+ *target = tmp;
+ }
+ return 1;
+}
+
+int
+is_intpercent (char *number)
+{
+ int i;
+ if (is_integer (number) && (i = atoi (number)) >= 0 && i <= 100)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+int
+is_option (char *str)
+{
+ if (!str)
+ return FALSE;
+ else if (strspn (str, "-") == 1 || strspn (str, "-") == 2)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+#ifdef NEED_GETTIMEOFDAY
+int
+gettimeofday (struct timeval *tv, struct timezone *tz)
+{
+ tv->tv_usec = 0;
+ tv->tv_sec = (long) time ((time_t) 0);
+}
+#endif
+
+
+
+double
+delta_time (struct timeval tv)
+{
+ struct timeval now;
+
+ gettimeofday (&now, NULL);
+ return ((double)(now.tv_sec - tv.tv_sec) + (double)(now.tv_usec - tv.tv_usec) / (double)1000000);
+}
+
+
+
+long
+deltime (struct timeval tv)
+{
+ struct timeval now;
+ gettimeofday (&now, NULL);
+ return (now.tv_sec - tv.tv_sec)*1000000 + now.tv_usec - tv.tv_usec;
+}
+
+
+
+
+void
+strip (char *buffer)
+{
+ size_t x;
+ int i;
+
+ for (x = strlen (buffer); x >= 1; x--) {
+ i = x - 1;
+ if (buffer[i] == ' ' ||
+ buffer[i] == '\r' || buffer[i] == '\n' || buffer[i] == '\t')
+ buffer[i] = '\0';
+ else
+ break;
+ }
+ return;
+}
+
+
+/******************************************************************************
+ *
+ * Copies one string to another. Any previously existing data in
+ * the destination string is lost.
+ *
+ * Example:
+ *
+ * char *str=NULL;
+ * str = strscpy("This is a line of text with no trailing newline");
+ *
+ *****************************************************************************/
+
+char *
+strscpy (char *dest, const char *src)
+{
+ if (src == NULL)
+ return NULL;
+
+ xasprintf (&dest, "%s", src);
+
+ return dest;
+}
+
+
+
+/******************************************************************************
+ *
+ * Returns a pointer to the next line of a multiline string buffer
+ *
+ * Given a pointer string, find the text following the next sequence
+ * of \r and \n characters. This has the effect of skipping blank
+ * lines as well
+ *
+ * Example:
+ *
+ * Given text as follows:
+ *
+ * ==============================
+ * This
+ * is
+ * a
+ *
+ * multiline string buffer
+ * ==============================
+ *
+ * int i=0;
+ * char *str=NULL;
+ * char *ptr=NULL;
+ * str = strscpy(str,"This\nis\r\na\n\nmultiline string buffer\n");
+ * ptr = str;
+ * while (ptr) {
+ * printf("%d %s",i++,firstword(ptr));
+ * ptr = strnl(ptr);
+ * }
+ *
+ * Produces the following:
+ *
+ * 1 This
+ * 2 is
+ * 3 a
+ * 4 multiline
+ *
+ * NOTE: The 'firstword()' function is conceptual only and does not
+ * exist in this package.
+ *
+ * NOTE: Although the second 'ptr' variable is not strictly needed in
+ * this example, it is good practice with these utilities. Once
+ * the * pointer is advance in this manner, it may no longer be
+ * handled with * realloc(). So at the end of the code fragment
+ * above, * strscpy(str,"foo") work perfectly fine, but
+ * strscpy(ptr,"foo") will * cause the the program to crash with
+ * a segmentation fault.
+ *
+ *****************************************************************************/
+
+char *
+strnl (char *str)
+{
+ size_t len;
+ if (str == NULL)
+ return NULL;
+ str = strpbrk (str, "\r\n");
+ if (str == NULL)
+ return NULL;
+ len = strspn (str, "\r\n");
+ if (str[len] == '\0')
+ return NULL;
+ str += len;
+ if (strlen (str) == 0)
+ return NULL;
+ return str;
+}
+
+
+/******************************************************************************
+ *
+ * Like strscpy, except only the portion of the source string up to
+ * the provided delimiter is copied.
+ *
+ * Example:
+ *
+ * str = strpcpy(str,"This is a line of text with no trailing newline","x");
+ * printf("%s\n",str);
+ *
+ * Produces:
+ *
+ *This is a line of te
+ *
+ *****************************************************************************/
+
+char *
+strpcpy (char *dest, const char *src, const char *str)
+{
+ size_t len;
+
+ if (src)
+ len = strcspn (src, str);
+ else
+ return NULL;
+
+ if (dest == NULL || strlen (dest) < len)
+ dest = realloc (dest, len + 1);
+ if (dest == NULL)
+ die (STATE_UNKNOWN, _("failed realloc in strpcpy\n"));
+
+ strncpy (dest, src, len);
+ dest[len] = '\0';
+
+ return dest;
+}
+
+
+
+/******************************************************************************
+ *
+ * Like strscat, except only the portion of the source string up to
+ * the provided delimiter is copied.
+ *
+ * str = strpcpy(str,"This is a line of text with no trailing newline","x");
+ * str = strpcat(str,"This is a line of text with no trailing newline","x");
+ * printf("%s\n",str);
+ *
+ *This is a line of texThis is a line of tex
+ *
+ *****************************************************************************/
+
+char *
+strpcat (char *dest, const char *src, const char *str)
+{
+ size_t len, l2;
+
+ if (dest)
+ len = strlen (dest);
+ else
+ len = 0;
+
+ if (src) {
+ l2 = strcspn (src, str);
+ }
+ else {
+ return dest;
+ }
+
+ dest = realloc (dest, len + l2 + 1);
+ if (dest == NULL)
+ die (STATE_UNKNOWN, _("failed malloc in strscat\n"));
+
+ strncpy (dest + len, src, l2);
+ dest[len + l2] = '\0';
+
+ return dest;
+}
+
+
+/******************************************************************************
+ *
+ * asprintf, but die on failure
+ *
+ ******************************************************************************/
+
+int
+xvasprintf (char **strp, const char *fmt, va_list ap)
+{
+ int result = vasprintf (strp, fmt, ap);
+ if (result == -1 || *strp == NULL)
+ die (STATE_UNKNOWN, _("failed malloc in xvasprintf\n"));
+ return result;
+}
+
+int
+xasprintf (char **strp, const char *fmt, ...)
+{
+ va_list ap;
+ int result;
+ va_start (ap, fmt);
+ result = xvasprintf (strp, fmt, ap);
+ va_end (ap);
+ return result;
+}
+
+/******************************************************************************
+ *
+ * Print perfdata in a standard format
+ *
+ ******************************************************************************/
+
+char *perfdata (const char *label,
+ long int val,
+ const char *uom,
+ int warnp,
+ long int warn,
+ int critp,
+ long int crit,
+ int minp,
+ long int minv,
+ int maxp,
+ long int maxv)
+{
+ char *data = NULL;
+
+ if (strpbrk (label, "'= "))
+ xasprintf (&data, "'%s'=%ld%s;", label, val, uom);
+ else
+ xasprintf (&data, "%s=%ld%s;", label, val, uom);
+
+ if (warnp)
+ xasprintf (&data, "%s%ld;", data, warn);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (critp)
+ xasprintf (&data, "%s%ld;", data, crit);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (minp)
+ xasprintf (&data, "%s%ld;", data, minv);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (maxp)
+ xasprintf (&data, "%s%ld", data, maxv);
+
+ return data;
+}
+
+
+char *perfdata_uint64 (const char *label,
+ uint64_t val,
+ const char *uom,
+ int warnp, /* Warning present */
+ uint64_t warn,
+ int critp, /* Critical present */
+ uint64_t crit,
+ int minp, /* Minimum present */
+ uint64_t minv,
+ int maxp, /* Maximum present */
+ uint64_t maxv)
+{
+ char *data = NULL;
+
+ if (strpbrk (label, "'= "))
+ xasprintf (&data, "'%s'=%" PRIu64 "%s;", label, val, uom);
+ else
+ xasprintf (&data, "%s=%" PRIu64 "%s;", label, val, uom);
+
+ if (warnp)
+ xasprintf (&data, "%s%" PRIu64 ";", data, warn);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (critp)
+ xasprintf (&data, "%s%" PRIu64 ";", data, crit);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (minp)
+ xasprintf (&data, "%s%" PRIu64 ";", data, minv);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (maxp)
+ xasprintf (&data, "%s%" PRIu64, data, maxv);
+
+ return data;
+}
+
+
+char *perfdata_int64 (const char *label,
+ int64_t val,
+ const char *uom,
+ int warnp, /* Warning present */
+ int64_t warn,
+ int critp, /* Critical present */
+ int64_t crit,
+ int minp, /* Minimum present */
+ int64_t minv,
+ int maxp, /* Maximum present */
+ int64_t maxv)
+{
+ char *data = NULL;
+
+ if (strpbrk (label, "'= "))
+ xasprintf (&data, "'%s'=%" PRId64 "%s;", label, val, uom);
+ else
+ xasprintf (&data, "%s=%" PRId64 "%s;", label, val, uom);
+
+ if (warnp)
+ xasprintf (&data, "%s%" PRId64 ";", data, warn);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (critp)
+ xasprintf (&data, "%s%" PRId64 ";", data, crit);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (minp)
+ xasprintf (&data, "%s%" PRId64 ";", data, minv);
+ else
+ xasprintf (&data, "%s;", data);
+
+ if (maxp)
+ xasprintf (&data, "%s%" PRId64, data, maxv);
+
+ return data;
+}
+
+
+char *fperfdata (const char *label,
+ double val,
+ const char *uom,
+ int warnp,
+ double warn,
+ int critp,
+ double crit,
+ int minp,
+ double minv,
+ int maxp,
+ double maxv)
+{
+ char *data = NULL;
+
+ if (strpbrk (label, "'= "))
+ xasprintf (&data, "'%s'=", label);
+ else
+ xasprintf (&data, "%s=", label);
+
+ xasprintf (&data, "%s%f", data, val);
+ xasprintf (&data, "%s%s;", data, uom);
+
+ if (warnp)
+ xasprintf (&data, "%s%f", data, warn);
+
+ xasprintf (&data, "%s;", data);
+
+ if (critp)
+ xasprintf (&data, "%s%f", data, crit);
+
+ xasprintf (&data, "%s;", data);
+
+ if (minp)
+ xasprintf (&data, "%s%f", data, minv);
+
+ if (maxp) {
+ xasprintf (&data, "%s;", data);
+ xasprintf (&data, "%s%f", data, maxv);
+ }
+
+ return data;
+}
+
+char *sperfdata (const char *label,
+ double val,
+ const char *uom,
+ char *warn,
+ char *crit,
+ int minp,
+ double minv,
+ int maxp,
+ double maxv)
+{
+ char *data = NULL;
+ if (strpbrk (label, "'= "))
+ xasprintf (&data, "'%s'=", label);
+ else
+ xasprintf (&data, "%s=", label);
+
+ xasprintf (&data, "%s%f", data, val);
+ xasprintf (&data, "%s%s;", data, uom);
+
+ if (warn!=NULL)
+ xasprintf (&data, "%s%s", data, warn);
+
+ xasprintf (&data, "%s;", data);
+
+ if (crit!=NULL)
+ xasprintf (&data, "%s%s", data, crit);
+
+ xasprintf (&data, "%s;", data);
+
+ if (minp)
+ xasprintf (&data, "%s%f", data, minv);
+
+ if (maxp) {
+ xasprintf (&data, "%s;", data);
+ xasprintf (&data, "%s%f", data, maxv);
+ }
+
+ return data;
+}
+
+char *sperfdata_int (const char *label,
+ int val,
+ const char *uom,
+ char *warn,
+ char *crit,
+ int minp,
+ int minv,
+ int maxp,
+ int maxv)
+{
+ char *data = NULL;
+ if (strpbrk (label, "'= "))
+ xasprintf (&data, "'%s'=", label);
+ else
+ xasprintf (&data, "%s=", label);
+
+ xasprintf (&data, "%s%d", data, val);
+ xasprintf (&data, "%s%s;", data, uom);
+
+ if (warn!=NULL)
+ xasprintf (&data, "%s%s", data, warn);
+
+ xasprintf (&data, "%s;", data);
+
+ if (crit!=NULL)
+ xasprintf (&data, "%s%s", data, crit);
+
+ xasprintf (&data, "%s;", data);
+
+ if (minp)
+ xasprintf (&data, "%s%d", data, minv);
+
+ if (maxp) {
+ xasprintf (&data, "%s;", data);
+ xasprintf (&data, "%s%d", data, maxv);
+ }
+
+ return data;
+}
diff --git a/plugins/utils.h b/plugins/utils.h
new file mode 100644
index 0000000..cb979ce
--- /dev/null
+++ b/plugins/utils.h
@@ -0,0 +1,198 @@
+#ifndef NP_UTILS_H
+#define NP_UTILS_H
+/* Header file for Monitoring Plugins utils.c */
+
+/* This file should be included in all plugins */
+
+/* The purpose of this package is to provide safer alternatives to C
+functions that might otherwise be vulnerable to hacking. This
+currently includes a standard suite of validation routines to be sure
+that an string argument actually converts to its intended type and a
+suite of string handling routine that do their own memory management
+in order to resist overflow attacks. In addition, a few functions are
+provided to standardize version and error reporting across the entire
+suite of plugins. */
+
+/* now some functions etc are being defined in ../lib/utils_base.c */
+#include "utils_base.h"
+
+
+#ifdef NP_EXTRA_OPTS
+/* Include extra-opts functions if compiled in */
+#include "extra_opts.h"
+#else
+/* else, fake np_extra_opts */
+#define np_extra_opts(acptr,av,pr) av
+#endif
+
+/* Standardize version information, termination */
+
+void support (void);
+void print_revision (const char *, const char *);
+
+extern time_t start_time, end_time;
+
+/* Test input types */
+
+int is_integer (char *);
+int is_intpos (char *);
+int is_intneg (char *);
+int is_intnonneg (char *);
+int is_intpercent (char *);
+int is_uint64(char *number, uint64_t *target);
+int is_int64(char *number, int64_t *target);
+
+int is_numeric (char *);
+int is_positive (char *);
+int is_negative (char *);
+int is_nonnegative (char *);
+int is_percentage (char *);
+
+int is_option (char *);
+
+/* Generalized timer that will do milliseconds if available */
+#ifndef HAVE_STRUCT_TIMEVAL
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* microseconds */
+};
+#endif
+
+#ifndef HAVE_GETTIMEOFDAY
+int gettimeofday(struct timeval *, struct timezone *);
+#endif
+
+double delta_time (struct timeval tv);
+long deltime (struct timeval tv);
+
+/* Handle strings safely */
+
+void strip (char *);
+char *strscpy (char *, const char *);
+char *strnl (char *);
+char *strpcpy (char *, const char *, const char *);
+char *strpcat (char *, const char *, const char *);
+int xvasprintf (char **strp, const char *fmt, va_list ap);
+int xasprintf (char **strp, const char *fmt, ...);
+
+int max_state (int a, int b);
+int max_state_alt (int a, int b);
+
+void usage (const char *) __attribute__((noreturn));
+void usage2(const char *, const char *) __attribute__((noreturn));
+void usage3(const char *, int) __attribute__((noreturn));
+void usage4(const char *) __attribute__((noreturn));
+void usage5(void) __attribute__((noreturn));
+void usage_va(const char *fmt, ...) __attribute__((noreturn));
+
+#define max(a,b) (((a)>(b))?(a):(b))
+#define min(a,b) (((a)<(b))?(a):(b))
+
+char *perfdata (const char *, long int, const char *, int, long int,
+ int, long int, int, long int, int, long int);
+
+char *perfdata_uint64 (const char *, uint64_t , const char *, int, uint64_t,
+ int, uint64_t, int, uint64_t, int, uint64_t);
+
+char *perfdata_int64 (const char *, int64_t, const char *, int, int64_t,
+ int, int64_t, int, int64_t, int, int64_t);
+
+char *fperfdata (const char *, double, const char *, int, double,
+ int, double, int, double, int, double);
+
+char *sperfdata (const char *, double, const char *, char *, char *,
+ int, double, int, double);
+
+char *sperfdata_int (const char *, int, const char *, char *, char *,
+ int, int, int, int);
+
+/* The idea here is that, although not every plugin will use all of these,
+ most will or should. Therefore, for consistency, these very common
+ options should have only these meanings throughout the overall suite */
+
+#define STD_LONG_OPTS \
+{"version",no_argument,0,'V'},\
+{"verbose",no_argument,0,'v'},\
+{"help",no_argument,0,'h'},\
+{"timeout",required_argument,0,'t'},\
+{"critical",required_argument,0,'c'},\
+{"warning",required_argument,0,'w'},\
+{"hostname",required_argument,0,'H'}
+
+#define COPYRIGHT "Copyright (c) %s Monitoring Plugins Development Team\n\
+\t<%s>\n\n"
+
+#define UT_HLP_VRS _("\
+ %s (-h | --help) for detailed help\n\
+ %s (-V | --version) for version information\n")
+
+#define UT_HELP_VRSN _("\
+\nOptions:\n\
+ -h, --help\n\
+ Print detailed help screen\n\
+ -V, --version\n\
+ Print version information\n")
+
+#define UT_HOST_PORT _("\
+ -H, --hostname=ADDRESS\n\
+ Host name, IP Address, or unix socket (must be an absolute path)\n\
+ -%c, --port=INTEGER\n\
+ Port number (default: %s)\n")
+
+#define UT_IPv46 _("\
+ -4, --use-ipv4\n\
+ Use IPv4 connection\n\
+ -6, --use-ipv6\n\
+ Use IPv6 connection\n")
+
+#define UT_VERBOSE _("\
+ -v, --verbose\n\
+ Show details for command-line debugging (output may be truncated by\n\
+ the monitoring system)\n")
+
+#define UT_WARN_CRIT _("\
+ -w, --warning=DOUBLE\n\
+ Response time to result in warning status (seconds)\n\
+ -c, --critical=DOUBLE\n\
+ Response time to result in critical status (seconds)\n")
+
+#define UT_WARN_CRIT_RANGE _("\
+ -w, --warning=RANGE\n\
+ Warning range (format: start:end). Alert if outside this range\n\
+ -c, --critical=RANGE\n\
+ Critical range\n")
+
+#define UT_CONN_TIMEOUT _("\
+ -t, --timeout=INTEGER\n\
+ Seconds before connection times out (default: %d)\n")
+
+#define UT_PLUG_TIMEOUT _("\
+ -t, --timeout=INTEGER\n\
+ Seconds before plugin times out (default: %d)\n")
+
+#ifdef NP_EXTRA_OPTS
+#define UT_EXTRA_OPTS _("\
+ --extra-opts=[section][@file]\n\
+ Read options from an ini file. See\n\
+ https://www.monitoring-plugins.org/doc/extra-opts.html\n\
+ for usage and examples.\n")
+#else
+#define UT_EXTRA_OPTS " \b"
+#endif
+
+#define UT_THRESHOLDS_NOTES _("\
+ See:\n\
+ https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n\
+ for THRESHOLD format and examples.\n")
+
+#define UT_SUPPORT _("\n\
+Send email to help@monitoring-plugins.org if you have questions regarding\n\
+use of this software. To submit patches or suggest improvements, send email\n\
+to devel@monitoring-plugins.org\n\n")
+
+#define UT_NOWARRANTY _("\n\
+The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n\
+copies of the plugins under the terms of the GNU General Public License.\n\
+For more information about these matters, see the file named COPYING.\n")
+
+#endif /* NP_UTILS_H */
diff --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644
index 0000000..1074102
--- /dev/null
+++ b/po/ChangeLog
@@ -0,0 +1,11 @@
+2003-07-02 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: New file, from gettext-0.11.4.
+ * boldquot.sed: New file, from gettext-0.11.4.
+ * en@boldquot.header: New file, from gettext-0.11.4.
+ * en@quot.header: New file, from gettext-0.11.4.
+ * insert-header.sin: New file, from gettext-0.11.4.
+ * quot.sed: New file, from gettext-0.11.4.
+ * remove-potcdate.sin: New file, from gettext-0.11.4.
+ * Rules-quot: New file, from gettext-0.11.4.
+
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..1ce0c39
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,2 @@
+fr de
+
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..82864b2
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,395 @@
+# -*- buffer-read-only: t -*- vi: set ro:
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.15
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+mkinstalldirs = $(SHELL) @install_sh@ -d
+mkdir_p = @MKDIR_P@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address="$$msgid_bugs_address"
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(srcdir)/$(DOMAIN).pot
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ $(mkdir_p) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ $(mkdir_p) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && $(SHELL) ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..b35f5ad
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,29 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --flag=error:3:c-format --flag=error_at_line:5:c-format --flag=asprintf:2:c-format --flag=vasprintf:2:c-format --no-location
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Monitoring Plugins Development Team
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# Email address were to send bug report for the .po translation files
+PACKAGE_BUGREPORT = devel@monitoring-plugins.org
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..6e491d7
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,44 @@
+plugins/check_by_ssh.c
+plugins/check_cluster.c
+plugins/check_dig.c
+plugins/check_disk.c
+plugins/check_dns.c
+plugins/check_dummy.c
+plugins/check_fping.c
+plugins/check_game.c
+plugins/check_hpjd.c
+plugins/check_http.c
+plugins/check_ldap.c
+plugins/check_load.c
+plugins/check_mrtg.c
+plugins/check_mrtgtraf.c
+plugins/check_mysql.c
+plugins/check_nagios.c
+plugins/check_nt.c
+plugins/check_ntp.c
+plugins/check_ntp_peer.c
+plugins/check_ntp_time.c
+plugins/check_nwstat.c
+plugins/check_overcr.c
+plugins/check_pgsql.c
+plugins/check_ping.c
+plugins/check_procs.c
+plugins/check_radius.c
+plugins/check_real.c
+plugins/check_smtp.c
+plugins/check_snmp.c
+plugins/check_ssh.c
+plugins/check_swap.c
+plugins/check_tcp.c
+plugins/check_time.c
+plugins/check_ups.c
+plugins/check_users.c
+plugins/check_ide_smart.c
+plugins/negate.c
+plugins/netutils.c
+plugins/popen.c
+plugins/urlize.c
+plugins/utils.c
+plugins/utils.h
+plugins-root/check_dhcp.c
+plugins-root/check_icmp.c
diff --git a/po/de.gmo b/po/de.gmo
new file mode 100644
index 0000000..8617038
--- /dev/null
+++ b/po/de.gmo
Binary files differ
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..1b666f4
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,5447 @@
+# translation of de.po to
+# German Language Translation File.
+# This file is distributed under the same license as the nagios-plugins package.
+# Copyright (C) 2023 Nagios Plugin Development Group.
+# Karl DeBisschop <kdebisschop@users.sourceforge.net>, 2003, 2004.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: devel@monitoring-plugins.org\n"
+"POT-Creation-Date: 2023-10-01 15:10+0200\n"
+"PO-Revision-Date: 2004-12-23 17:46+0100\n"
+"Last-Translator: \n"
+"Language-Team: Monitoring Plugin Development Team <devel@monitoring-plugins."
+"org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: KBabel 1.3.1\n"
+
+msgid "Could not parse arguments"
+msgstr "Argumente konnten nicht ausgewertet werden"
+
+msgid "Cannot catch SIGALRM"
+msgstr "Konnte SIGALRM nicht erhalten"
+
+#, c-format
+msgid "SSH connection failed: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Remote command execution failed: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s - check_by_ssh: Remote command '%s' returned status %d\n"
+msgstr ""
+
+#, c-format
+msgid "SSH WARNING: could not open %s\n"
+msgstr "SSH WARNING: Konnte %s nicht öffnen\n"
+
+#, c-format
+msgid "%s: Error parsing output\n"
+msgstr ""
+
+msgid "Timeout interval must be a positive integer"
+msgstr "Timeout interval muss ein positiver Integer sein"
+
+msgid "Port must be a positive integer"
+msgstr "Port muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "skip-stdout argument must be an integer"
+msgstr "skip-stdout argument muss ein Integer sein"
+
+#, fuzzy
+msgid "skip-stderr argument must be an integer"
+msgstr "skip-stderr argument muss ein Integer sein"
+
+#, c-format
+msgid "%s: You must provide a host name\n"
+msgstr "%s: Hostname muss angegeben werden\n"
+
+msgid "No remotecmd"
+msgstr "Kein remotecm"
+
+#, c-format
+msgid "%s: Argument limit of %d exceeded\n"
+msgstr ""
+
+#, fuzzy
+msgid "Can not (re)allocate 'commargv' buffer\n"
+msgstr "Konnte·url·nicht·zuweisen\n"
+
+#, c-format
+msgid ""
+"%s: In passive mode, you must provide a service name for each command.\n"
+msgstr ""
+"%s: Im passive mode muss ein Servicename für jeden Befehl angegeben werden.\n"
+
+#, fuzzy, c-format
+msgid ""
+"%s: In passive mode, you must provide the host short name from the "
+"monitoring configs.\n"
+msgstr ""
+"%s: Im passive mode muss der \"host short name\" aus der Nagios "
+"Konfiguration angegeben werden\n"
+
+#, fuzzy, c-format
+msgid "This plugin uses SSH to execute commands on a remote host"
+msgstr ""
+"Dieses Plugin nutzt SSH um Befehle auf dem entfernten Rechner auszuführen\n"
+"\n"
+
+msgid "tell ssh to use Protocol 1 [optional]"
+msgstr ""
+
+msgid "tell ssh to use Protocol 2 [optional]"
+msgstr ""
+
+msgid "Ignore all or (if specified) first n lines on STDOUT [optional]"
+msgstr ""
+
+msgid "Ignore all or (if specified) first n lines on STDERR [optional]"
+msgstr ""
+
+msgid "Exit with an warning, if there is an output on STDERR"
+msgstr ""
+
+msgid ""
+"tells ssh to fork rather than create a tty [optional]. This will always "
+"return OK if ssh is executed"
+msgstr ""
+
+msgid "command to execute on the remote machine"
+msgstr ""
+
+msgid "SSH user name on remote host [optional]"
+msgstr ""
+
+msgid "identity of an authorized key [optional]"
+msgstr ""
+
+msgid "external command file for monitoring [optional]"
+msgstr ""
+
+msgid "list of monitoring service names, separated by ':' [optional]"
+msgstr ""
+
+msgid "short name of host in the monitoring configuration [optional]"
+msgstr ""
+
+msgid "Call ssh with '-o OPTION' (may be used multiple times) [optional]"
+msgstr ""
+
+msgid "Tell ssh to use this configfile [optional]"
+msgstr ""
+
+msgid "Tell ssh to suppress warning and diagnostic messages [optional]"
+msgstr ""
+
+msgid "Make connection problems return UNKNOWN instead of CRITICAL"
+msgstr ""
+
+msgid "The most common mode of use is to refer to a local identity file with"
+msgstr ""
+
+msgid "the '-i' option. In this mode, the identity pair should have a null"
+msgstr ""
+
+msgid "passphrase and the public key should be listed in the authorized_keys"
+msgstr ""
+
+msgid "file of the remote host. Usually the key will be restricted to running"
+msgstr ""
+
+msgid "only one command on the remote server. If the remote SSH server tracks"
+msgstr ""
+
+msgid "invocation arguments, the one remote program may be an agent that can"
+msgstr ""
+
+msgid "execute additional commands as proxy"
+msgstr ""
+
+msgid "To use passive mode, provide multiple '-C' options, and provide"
+msgstr ""
+
+msgid ""
+"all of -O, -s, and -n options (servicelist order must match '-C'options)"
+msgstr ""
+
+msgid "Examples:"
+msgstr ""
+
+msgid "Usage:"
+msgstr ""
+
+#, c-format
+msgid "Host/Service Cluster Plugin for Monitoring"
+msgstr ""
+
+msgid "Options:"
+msgstr ""
+
+msgid "Check service cluster status"
+msgstr ""
+
+msgid "Check host cluster status"
+msgstr ""
+
+msgid "Optional prepended text output (i.e. \"Host cluster\")"
+msgstr ""
+
+msgid "Specifies the range of hosts or services in cluster that must be in a"
+msgstr ""
+
+msgid "non-OK state in order to return a WARNING status level"
+msgstr ""
+
+msgid "non-OK state in order to return a CRITICAL status level"
+msgstr ""
+
+msgid "The status codes of the hosts or services in the cluster, separated by"
+msgstr ""
+
+msgid "commas"
+msgstr ""
+
+msgid "Notes:"
+msgstr ""
+
+msgid ""
+"Will alert critical if there are 3 or more service data points in a non-OK"
+msgstr ""
+
+msgid "state."
+msgstr ""
+
+#, c-format
+msgid "Looking for: '%s'\n"
+msgstr ""
+
+msgid "dig returned an error status"
+msgstr "dig hat einen Fehler zurückgegeben"
+
+msgid "Server not found in ANSWER SECTION"
+msgstr "Server nicht gefunden in ANSWER SECTION"
+
+msgid "No ANSWER SECTION found"
+msgstr "Keine ANSWER SECTION gefunden"
+
+#, fuzzy
+msgid "Probably a non-existent host/domain"
+msgstr "nicht existierender Host/Domain"
+
+#, fuzzy, c-format
+msgid "Port must be a positive integer - %s"
+msgstr "Port muss ein positiver Integer sein - %s"
+
+#, fuzzy, c-format
+msgid "Warning interval must be a positive integer - %s"
+msgstr "Warning interval muss ein positiver Integer sein - %s"
+
+#, fuzzy, c-format
+msgid "Critical interval must be a positive integer - %s"
+msgstr "Critical interval muss ein positiver Integer sein - %s"
+
+#, fuzzy, c-format
+msgid "Timeout interval must be a positive integer - %s"
+msgstr "Timeout interval muss ein positiver Integer sein - %s"
+
+#, fuzzy, c-format
+msgid "This plugin tests the DNS service on the specified host using dig"
+msgstr "Testet den DNS Dienst auf dem angegebenen Host mit dig"
+
+msgid "Force dig to only use IPv4 query transport"
+msgstr ""
+
+msgid "Force dig to only use IPv6 query transport"
+msgstr ""
+
+#, fuzzy
+msgid "Machine name to lookup"
+msgstr "zu prüfender Hostname"
+
+#, fuzzy
+msgid "Record type to lookup (default: A)"
+msgstr "abzufragender Datensatztyp (Default: A)"
+
+#, fuzzy
+msgid ""
+"An address expected to be in the answer section. If not set, uses whatever"
+msgstr ""
+"Adresse die in der ANSWER SECTION erwartet wird.wenn nicht gesetzt, "
+"ubernommen aus -l"
+
+msgid "was in -l"
+msgstr ""
+
+msgid "Pass STRING as argument(s) to dig"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "DISK %s: %s not found\n"
+msgstr "%s [%s nicht gefunden]"
+
+#, c-format
+msgid "CRITICAL"
+msgstr "CRITICAL"
+
+#, c-format
+msgid "unit type %s not known\n"
+msgstr "unbekannter unit type: %s\n"
+
+#, c-format
+msgid "failed allocating storage for '%s'\n"
+msgstr "konnte keinen Speicher für '%s' reservieren\n"
+
+#, c-format
+msgid "UNKNOWN"
+msgstr "UNKNOWN"
+
+msgid "Must set a threshold value before using -p\n"
+msgstr ""
+
+msgid "Could not compile regular expression"
+msgstr ""
+
+msgid "Must set -E before selecting paths\n"
+msgstr ""
+
+msgid "Must set group value before selecting paths\n"
+msgstr ""
+
+msgid ""
+"Paths need to be selected before using -i/-I. Use -A to select all paths "
+"explicitly"
+msgstr ""
+
+msgid ""
+"Must set a threshold value before using -r/-R/-A (--ereg-path/--eregi-path/--"
+"all)\n"
+msgstr ""
+
+msgid "Regular expression did not match any path or disk"
+msgstr ""
+
+#, fuzzy
+msgid "Unknown argument"
+msgstr "Unbekanntes Argument"
+
+#, c-format
+msgid " for %s\n"
+msgstr ""
+
+#, fuzzy
+msgid ""
+"This plugin checks the amount of used disk space on a mounted file system"
+msgstr ""
+"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem"
+
+#, fuzzy
+msgid ""
+"and generates an alert if free space is less than one of the threshold values"
+msgstr ""
+"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
+"unterschritten wird."
+
+msgid "Exit with WARNING status if less than INTEGER units of disk are free"
+msgstr ""
+
+msgid "Exit with WARNING status if less than PERCENT of disk space is free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than INTEGER units of disk are free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than PERCENT of disk space is free"
+msgstr ""
+
+msgid "Exit with WARNING status if less than PERCENT of inode space is free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than PERCENT of inode space is free"
+msgstr ""
+
+msgid ""
+"Mount point or block device as emitted by the mount(8) command (may be "
+"repeated)"
+msgstr ""
+
+msgid "Ignore device (only works if -p unspecified)"
+msgstr ""
+
+msgid "Clear thresholds"
+msgstr ""
+
+msgid "For paths or partitions specified with -p, only check for exact paths"
+msgstr ""
+
+msgid "Display only devices/mountpoints with errors"
+msgstr ""
+
+msgid "Don't account root-reserved blocks into freespace in perfdata"
+msgstr ""
+
+msgid "Display inode usage in perfdata"
+msgstr ""
+
+msgid ""
+"Group paths. Thresholds apply to (free-)space of all partitions together"
+msgstr ""
+
+msgid "Same as '--units kB'"
+msgstr ""
+
+msgid "Only check local filesystems"
+msgstr ""
+
+msgid ""
+"Only check local filesystems against thresholds. Yet call stat on remote "
+"filesystems"
+msgstr ""
+
+msgid "to test if they are accessible (e.g. to detect Stale NFS Handles)"
+msgstr ""
+
+msgid "Display the (block) device instead of the mount point"
+msgstr ""
+
+msgid "Same as '--units MB'"
+msgstr ""
+
+msgid "Explicitly select all paths. This is equivalent to -R '.*'"
+msgstr ""
+
+msgid ""
+"Case insensitive regular expression for path/partition (may be repeated)"
+msgstr ""
+
+msgid "Regular expression for path or partition (may be repeated)"
+msgstr ""
+
+msgid ""
+"Regular expression to ignore selected path/partition (case insensitive) (may "
+"be repeated)"
+msgstr ""
+
+msgid ""
+"Regular expression to ignore selected path or partition (may be repeated)"
+msgstr ""
+
+msgid ""
+"Return OK if no filesystem matches, filesystem does not exist or is "
+"inaccessible."
+msgstr ""
+
+msgid "(Provide this option before -p / -r / --ereg-path if used)"
+msgstr ""
+
+msgid "Choose bytes, kB, MB, GB, TB (default: MB)"
+msgstr ""
+
+msgid ""
+"Ignore all filesystems of types matching given regex(7) (may be repeated)"
+msgstr ""
+
+msgid ""
+"Check only filesystems where the type matches this given regex(7) (may be "
+"repeated)"
+msgstr ""
+
+msgid "General usage hints:"
+msgstr "Allgemeine Nutzungshinweise:"
+
+msgid ""
+"- Arguments are positional! \"-w 5 -c 1 -p /foo -w6 -c2 -p /bar\" is not the "
+"same as"
+msgstr ""
+
+msgid "\"-w 5 -c 1 -p /bar w6 -c2 -p /foo\"."
+msgstr ""
+
+msgid ""
+"- The syntax is broadly: \"{thresholds a} {paths a} -C {thresholds b} "
+"{thresholds b} ...\""
+msgstr ""
+
+msgid "Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"
+msgstr ""
+
+msgid ""
+"Checks all filesystems not matching -r at 100M and 50M. The fs matching the -"
+"r regex"
+msgstr ""
+
+msgid ""
+"are grouped which means the freespace thresholds are applied to all disks "
+"together"
+msgstr ""
+
+msgid ""
+"Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use "
+"100M/50M"
+msgstr ""
+
+#, c-format
+msgid "%s %s: %s\n"
+msgstr ""
+
+msgid "is not accessible"
+msgstr ""
+
+#, fuzzy
+msgid "nslookup returned an error status"
+msgstr "nslookup hat einen Fehler zurückgegeben"
+
+msgid "Warning plugin error"
+msgstr "Warnung Plugin Fehler"
+
+#, fuzzy, c-format
+msgid "DNS CRITICAL - '%s' returned empty server string\n"
+msgstr "DNS CRITICAL - '%s' hat einen leeren Hostnamen zurückgegeben\n"
+
+#, fuzzy, c-format
+msgid "DNS CRITICAL - No response from DNS %s\n"
+msgstr "Keine Antwort von DNS %s\n"
+
+#, c-format
+msgid "DNS CRITICAL - '%s' returned empty host name string\n"
+msgstr "DNS CRITICAL - '%s' hat einen leeren Hostnamen zurückgegeben\n"
+
+msgid "Non-authoritative answer:"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Domain '%s' was not found by the server\n"
+msgstr "Domäne %s wurde vom Server nicht gefunden\n"
+
+#, fuzzy, c-format
+msgid "DNS CRITICAL - '%s' msg parsing exited with no address\n"
+msgstr "DNS CRITICAL - '%s' Ausgabeverarbeitung hat keine Adresse ergeben\n"
+
+#, fuzzy, c-format
+msgid "expected '%s' but got '%s'"
+msgstr "Erwartet: %s aber: %s erhalten"
+
+#, fuzzy, c-format
+msgid "Domain '%s' was found by the server: '%s'\n"
+msgstr "Domäne %s wurde vom Server nicht gefunden\n"
+
+#, c-format
+msgid "server %s is not authoritative for %s"
+msgstr "Server %s ist nicht autoritativ für %s"
+
+#, c-format
+msgid "OK"
+msgstr "OK"
+
+#, c-format
+msgid "WARNING"
+msgstr "WARNING"
+
+#, fuzzy, c-format
+msgid "%.3f second response time"
+msgid_plural "%.3f seconds response time"
+msgstr[0] "%.3f Sekunden Antwortzeit "
+msgstr[1] "%.3f Sekunden Antwortzeit "
+
+#, fuzzy, c-format
+msgid ". %s returns %s"
+msgstr "%s hat %s zurückgegeben"
+
+#, c-format
+msgid "DNS WARNING - %s\n"
+msgstr "DNS WARNING - %s\n"
+
+msgid " Probably a non-existent host/domain"
+msgstr "nicht existierender Host/Domain"
+
+#, c-format
+msgid "DNS CRITICAL - %s\n"
+msgstr "DNS CRITICAL - %s\n"
+
+#, fuzzy, c-format
+msgid "DNS UNKNOWN - %s\n"
+msgstr "DNS UNKNOWN - %s\n"
+
+msgid "Note: nslookup is deprecated and may be removed from future releases."
+msgstr ""
+
+msgid "Consider using the `dig' or `host' programs instead. Run nslookup with"
+msgstr ""
+
+msgid "the `-sil[ent]' option to prevent this message from appearing."
+msgstr ""
+
+#, c-format
+msgid "No response from DNS %s\n"
+msgstr "Keine Antwort von DNS %s\n"
+
+#, c-format
+msgid "DNS %s has no records\n"
+msgstr "Nameserver %s hat keine Datensätze\n"
+
+#, c-format
+msgid "Connection to DNS %s was refused\n"
+msgstr "Verbindung zum Nameserver %s wurde verweigert\n"
+
+#, c-format
+msgid "Query was refused by DNS server at %s\n"
+msgstr ""
+
+#, c-format
+msgid "No information returned by DNS server at %s\n"
+msgstr ""
+
+msgid "Network is unreachable\n"
+msgstr "Netzwerk nicht erreichbar\n"
+
+#, c-format
+msgid "DNS failure for %s\n"
+msgstr "DNS Fehler für %s\n"
+
+msgid "Input buffer overflow\n"
+msgstr "Eingabe-Pufferüberlauf\n"
+
+msgid ""
+"This plugin uses the nslookup program to obtain the IP address for the given "
+"host/domain query."
+msgstr ""
+
+msgid "An optional DNS server to use may be specified."
+msgstr ""
+
+msgid ""
+"If no DNS server is specified, the default server(s) specified in /etc/"
+"resolv.conf will be used."
+msgstr ""
+
+msgid "The name or address you want to query"
+msgstr ""
+
+msgid "Optional DNS server you want to use for the lookup"
+msgstr ""
+
+msgid ""
+"Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end"
+msgstr ""
+
+msgid ""
+"with a dot (.). This option can be repeated multiple times (Returns OK if any"
+msgstr ""
+
+msgid "value matches)."
+msgstr ""
+
+msgid ""
+"Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)"
+msgstr ""
+
+msgid "Cannot be used together with -a"
+msgstr ""
+
+msgid "Optionally expect the DNS server to be authoritative for the lookup"
+msgstr ""
+
+msgid "Return warning if elapsed time exceeds value. Default off"
+msgstr ""
+
+msgid "Return critical if elapsed time exceeds value. Default off"
+msgstr ""
+
+msgid ""
+"Return critical if the list of expected addresses does not match all "
+"addresses"
+msgstr ""
+
+msgid "returned. Default off"
+msgstr ""
+
+msgid "Arguments to check_dummy must be an integer"
+msgstr "Argument für check_dummy muss ein Integer sein"
+
+#, c-format
+msgid "Status %d is not a supported error state\n"
+msgstr "Status %d ist kein bekannter Fehlerstatus\n"
+
+msgid ""
+"This plugin will simply return the state corresponding to the numeric value"
+msgstr ""
+
+msgid "of the <state> argument with optional text"
+msgstr ""
+
+#, c-format
+msgid "Could not open pipe: %s\n"
+msgstr "Pipe: %s konnte nicht geöffnet werden\n"
+
+#, c-format
+msgid "Could not open stderr for %s\n"
+msgstr "Konnte stderr nicht öffnen für: %s\n"
+
+#, fuzzy
+msgid "FPING UNKNOWN - IP address not found\n"
+msgstr "FPING UNKNOWN - %s nicht gefunden\n"
+
+msgid "FPING UNKNOWN - invalid commandline argument\n"
+msgstr ""
+
+#, fuzzy
+msgid "FPING UNKNOWN - failed system call\n"
+msgstr "FPING UNKNOWN - %s nicht gefunden\n"
+
+#, fuzzy, c-format
+msgid "FPING %s - %s (rta=%f ms)|%s\n"
+msgstr "FPING %s - %s (verloren=%.0f%% )|%s\n"
+
+#, c-format
+msgid "FPING UNKNOWN - %s not found\n"
+msgstr "FPING UNKNOWN - %s nicht gefunden\n"
+
+#, c-format
+msgid "FPING CRITICAL - %s is unreachable\n"
+msgstr "FPING CRITICAL - %s ist nicht erreichbar\n"
+
+#, fuzzy, c-format
+msgid "FPING UNKNOWN - %s parameter error\n"
+msgstr "FPING UNKNOWN - %s nicht gefunden\n"
+
+#, c-format
+msgid "FPING CRITICAL - %s is down\n"
+msgstr "FPING CRITICAL - %s ist down\n"
+
+#, c-format
+msgid "FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"
+msgstr "FPING %s - %s (verloren=%.0f%%, rta=%f ms)|%s %s\n"
+
+#, c-format
+msgid "FPING %s - %s (loss=%.0f%% )|%s\n"
+msgstr "FPING %s - %s (verloren=%.0f%% )|%s\n"
+
+msgid "Invalid hostname/address"
+msgstr "Ungültige(r) Hostname/Adresse"
+
+msgid "IPv6 support not available\n"
+msgstr ""
+
+msgid "Packet size must be a positive integer"
+msgstr "Paketgröße muss ein positiver Integer sein"
+
+msgid "Packet count must be a positive integer"
+msgstr "Paketanzahl muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "Target timeout must be a positive integer"
+msgstr "Warnung time muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "Interval must be a positive integer"
+msgstr "Timeout interval muss ein positiver Integer sein"
+
+msgid "Hostname was not supplied"
+msgstr ""
+
+#, c-format
+msgid "%s: Only one threshold may be packet loss (%s)\n"
+msgstr "%s: Nur ein Wert darf für packet loss angegeben werden (%s)\n"
+
+#, c-format
+msgid "%s: Only one threshold must be packet loss (%s)\n"
+msgstr "%s: Nur ein Wert darf für packet loss angegeben werden (%s)\n"
+
+msgid ""
+"This plugin will use the fping command to ping the specified host for a fast "
+"check"
+msgstr ""
+
+msgid "Note that it is necessary to set the suid flag on fping."
+msgstr ""
+
+msgid ""
+"name or IP Address of host to ping (IP Address bypasses name lookup, "
+"reducing system load)"
+msgstr ""
+
+#, fuzzy
+msgid "warning threshold pair"
+msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+msgid "critical threshold pair"
+msgstr "Critical threshold muss ein Integer sein"
+
+msgid "Return OK after first successful reply"
+msgstr ""
+
+msgid "size of ICMP packet"
+msgstr ""
+
+msgid "number of ICMP packets to send"
+msgstr ""
+
+msgid "Target timeout (ms)"
+msgstr ""
+
+msgid "Interval (ms) between sending packets"
+msgstr ""
+
+msgid "name or IP Address of sourceip"
+msgstr ""
+
+msgid "source interface name"
+msgstr ""
+
+#, c-format
+msgid ""
+"THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time "
+"(ms)"
+msgstr ""
+
+msgid ""
+"which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"
+msgstr ""
+
+msgid "packet loss to trigger an alarm state."
+msgstr ""
+
+msgid "IPv4 is used by default. Specify -6 to use IPv6."
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Host type parameter incorrect!\n"
+msgstr "CRITICAL - Host type parameter unkorrekt!\n"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Host not found\n"
+msgstr "CRITICAL - Text nicht gefunden%s|%s %s\n"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Game server down or unavailable\n"
+msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Game server timeout\n"
+msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
+
+#, c-format
+msgid "This plugin tests game server connections with the specified host."
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid "Optional port of which to connect"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains game name"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains map name"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains ping time"
+msgstr ""
+
+#, fuzzy
+msgid ""
+"This plugin uses the 'qstat' command, the popular game server status query "
+"tool."
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid ""
+"If you don't have the package installed, you will need to download it from"
+msgstr ""
+
+msgid "https://github.com/multiplay/qstat before you can use this plugin."
+msgstr ""
+
+msgid "Paper Jam"
+msgstr "Papierstau"
+
+msgid "Out of Paper"
+msgstr "Kein Papier"
+
+msgid "Printer Offline"
+msgstr "Drucker ausgeschaltet"
+
+msgid "Peripheral Error"
+msgstr "Peripheriefehler"
+
+msgid "Intervention Required"
+msgstr "Eingriff benötigt"
+
+msgid "Toner Low"
+msgstr "Wenig Toner"
+
+msgid "Insufficient Memory"
+msgstr "Nicht genügend Speicher"
+
+msgid "A Door is Open"
+msgstr "Eine Abdeckung ist offen"
+
+msgid "Output Tray is Full"
+msgstr "Ausgabeschacht ist voll"
+
+msgid "Data too Slow for Engine"
+msgstr ""
+
+msgid "Unknown Paper Error"
+msgstr "Papierfehler"
+
+#, c-format
+msgid "Printer ok - (%s)\n"
+msgstr "Printer ok - (%s)\n"
+
+#, fuzzy
+msgid "Port must be a positive short integer"
+msgstr "Port muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "This plugin tests the STATUS of an HP printer with a JetDirect card."
+msgstr ""
+"Dieses Plugin testet den STATUS eines HP Druckers mit einer JetDirect "
+"Karte.\n"
+"Net-snmp muss auf dem ausführenden Computer installiert sein.\n"
+"\n"
+
+#, fuzzy
+msgid "Net-snmp must be installed on the computer running the plugin."
+msgstr ""
+"Dieses Plugin testet den STATUS eines HP Druckers mit einer JetDirect "
+"Karte.\n"
+"Net-snmp muss auf dem ausführenden Computer installiert sein.\n"
+"\n"
+
+msgid "The SNMP community name "
+msgstr ""
+
+#, c-format
+msgid "(default=%s)"
+msgstr ""
+
+msgid "Specify the port to check "
+msgstr ""
+
+msgid "Disable paper check "
+msgstr ""
+
+msgid "file does not exist or is not readable"
+msgstr ""
+
+msgid "Invalid certificate expiration period"
+msgstr "Ungültiger Zertifikatsablauftermin"
+
+msgid ""
+"Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional "
+"'+' suffix)"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid option - SSL is not available"
+msgstr "Ungültige Option - SSL ist nicht verfügbar\n"
+
+msgid "Invalid max_redirs count"
+msgstr ""
+
+msgid "Invalid onredirect option"
+msgstr ""
+
+#, c-format
+msgid "option f:%d \n"
+msgstr "Option f:%d \n"
+
+msgid "Invalid port number"
+msgstr "Ungültige Portnummer"
+
+#, c-format
+msgid "Could Not Compile Regular Expression: %s"
+msgstr ""
+
+msgid "IPv6 support not available"
+msgstr "IPv6 Unterstützung nicht vorhanden"
+
+msgid "You must specify a server address or host name"
+msgstr "Hostname oder Serveradresse muss angegeben werden"
+
+msgid ""
+"If you use a client certificate you must also specify a private key file"
+msgstr ""
+
+#, fuzzy
+msgid "HTTP UNKNOWN - Memory allocation error\n"
+msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
+
+#, fuzzy, c-format
+msgid "%sServer date unknown, "
+msgstr "HTTP UNKNOWN - Serverdatum unbekannt\n"
+
+#, fuzzy, c-format
+msgid "%sDocument modification date unknown, "
+msgstr "HTTP CRITICAL - Datum der letzten Änderung unbekannt\n"
+
+#, fuzzy, c-format
+msgid "%sServer date \"%100s\" unparsable, "
+msgstr "HTTP CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
+
+#, fuzzy, c-format
+msgid "%sDocument date \"%100s\" unparsable, "
+msgstr ""
+"HTTP CRITICAL - Dokumentendatum \"%100s\" konnte nicht verarbeitet werden"
+
+#, fuzzy, c-format
+msgid "%sDocument is %d seconds in the future, "
+msgstr "HTTP CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
+
+#, fuzzy, c-format
+msgid "%sLast modified %.1f days ago, "
+msgstr "HTTP CRITICAL - Letzte Änderung vor %.1f Tagen\n"
+
+#, fuzzy, c-format
+msgid "%sLast modified %d:%02d:%02d ago, "
+msgstr "HTTP CRITICAL - Letzte Änderung vor %d:%02d:%02d \n"
+
+msgid "HTTP CRITICAL - Unable to open TCP socket\n"
+msgstr "HTTP CRITICAL - Konnte TCP socket nicht öffnen\n"
+
+#, fuzzy
+msgid "HTTP UNKNOWN - Could not allocate memory for full_page\n"
+msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
+
+msgid "HTTP CRITICAL - Error on receive\n"
+msgstr "HTTP CRITICAL - Fehler beim Empfangen\n"
+
+#, fuzzy
+msgid "HTTP CRITICAL - No data received from host\n"
+msgstr "HTTP CRITICAL - Keine Daten empfangen\n"
+
+#, fuzzy, c-format
+msgid "Invalid HTTP response received from host: %s\n"
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+#, fuzzy, c-format
+msgid "Invalid HTTP response received from host on port %d: %s\n"
+msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
+
+#, c-format
+msgid ""
+"%s\n"
+"%s"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Status line output matched \"%s\" - "
+msgstr "HTTP OK: Statusausgabe passt auf \"%s\"\n"
+
+#, c-format
+msgid "HTTP CRITICAL: Invalid Status Line (%s)\n"
+msgstr "HTTP CRITICAL: Ungültige Statusmeldung (%s)\n"
+
+#, c-format
+msgid "HTTP CRITICAL: Invalid Status (%s)\n"
+msgstr "HTTP CRITICAL: Ungültiger Status (%s)\n"
+
+#, c-format
+msgid "%s - "
+msgstr ""
+
+#, fuzzy, c-format
+msgid "%sheader '%s' not found on '%s://%s:%d%s', "
+msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
+
+#, fuzzy, c-format
+msgid "%sstring '%s' not found on '%s://%s:%d%s', "
+msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
+
+#, fuzzy, c-format
+msgid "%spattern not found, "
+msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
+
+#, fuzzy, c-format
+msgid "%spattern found, "
+msgstr "CRITICAL - Muster nicht gefunden%s|%s %s\n"
+
+#, fuzzy, c-format
+msgid "%sExecute Error: %s, "
+msgstr "HTTP CRITICAL - Fehler: %s\n"
+
+#, fuzzy, c-format
+msgid "%spage size %d too large, "
+msgstr "HTTP WARNING: Seitengröße %d zu klein%s|%s\n"
+
+#, fuzzy, c-format
+msgid "%spage size %d too small, "
+msgstr "HTTP WARNING: Seitengröße %d zu klein%s|%s\n"
+
+#, fuzzy, c-format
+msgid "%s - %d bytes in %.3f second response time %s|%s %s %s %s %s %s %s"
+msgstr " - %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
+
+#, fuzzy, c-format
+msgid "%s - %d bytes in %.3f second response time %s|%s %s"
+msgstr " - %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
+
+msgid "HTTP UNKNOWN - Could not allocate addr\n"
+msgstr "HTTP UNKNOWN - Konnte addr nicht zuweisen\n"
+
+#, fuzzy
+msgid "HTTP UNKNOWN - Could not allocate URL\n"
+msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
+
+#, c-format
+msgid "HTTP UNKNOWN - Could not find redirect location - %s%s\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "HTTP UNKNOWN - Empty redirect location%s\n"
+msgstr "HTTP UNKNOWN - Serverdatum unbekannt\n"
+
+#, c-format
+msgid "HTTP UNKNOWN - Could not parse redirect location - %s%s\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "HTTP WARNING - maximum redirection depth %d exceeded - %s://%s:%d%s%s\n"
+msgstr "HTTP WARNING - Umleitung verursacht eine Schleife - %s://%s:%d%s%s\n"
+
+#, fuzzy, c-format
+msgid "HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"
+msgstr "HTTP WARNING - Umleitung verursacht eine Schleife - %s://%s:%d%s%s\n"
+
+#, fuzzy, c-format
+msgid "HTTP UNKNOWN - Redirection to port above %d - %s://%s:%d%s%s\n"
+msgstr "HTTP WARNING - Umleitung verursacht eine Schleife - %s://%s:%d%s%s\n"
+
+#, c-format
+msgid "Redirection to %s://%s:%d%s\n"
+msgstr ""
+
+#, fuzzy
+msgid "This plugin tests the HTTP service on the specified host. It can test"
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "normal (http) and secure (https) servers, follow redirects, search for"
+msgstr ""
+
+msgid "strings and regular expressions, check connection times, and report on"
+msgstr ""
+
+#, fuzzy
+msgid "certificate expiration times."
+msgstr "Clientzertifikat benötigt\n"
+
+#, c-format
+msgid "In the first form, make an HTTP request."
+msgstr ""
+
+#, c-format
+msgid ""
+"In the second form, connect to the server and check the TLS certificate."
+msgstr ""
+
+#, c-format
+msgid "NOTE: One or both of -H and -I must be specified"
+msgstr ""
+
+msgid "Host name argument for servers using host headers (virtual host)"
+msgstr ""
+
+msgid "Append a port to include it in the header (eg: example.com:5000)"
+msgstr ""
+
+msgid ""
+"IP address or name (use numeric address if possible to bypass DNS lookup)."
+msgstr ""
+
+msgid "Port number (default: "
+msgstr ""
+
+msgid ""
+"Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"
+msgstr ""
+
+msgid "auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"
+msgstr ""
+
+msgid "1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted."
+msgstr ""
+
+msgid "Enable SSL/TLS hostname extension support (SNI)"
+msgstr ""
+
+msgid ""
+"Minimum number of days a certificate has to be valid. Port defaults to 443"
+msgstr ""
+
+msgid ""
+"(when this option is used the URL is not checked by default. You can use"
+msgstr ""
+
+msgid " --continue-after-certificate to override this behavior)"
+msgstr ""
+
+msgid ""
+"Allows the HTTP check to continue after performing the certificate check."
+msgstr ""
+
+msgid "Does nothing unless -C is used."
+msgstr ""
+
+msgid "Name of file that contains the client certificate (PEM format)"
+msgstr ""
+
+msgid "to be used in establishing the SSL session"
+msgstr ""
+
+msgid "Name of file containing the private key (PEM format)"
+msgstr ""
+
+msgid "matching the client certificate"
+msgstr ""
+
+msgid "Comma-delimited list of strings, at least one of them is expected in"
+msgstr ""
+
+msgid "the first (status) line of the server response (default: "
+msgstr ""
+
+msgid ""
+"If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"
+msgstr ""
+
+msgid "String to expect in the response headers"
+msgstr ""
+
+msgid "String to expect in the content"
+msgstr ""
+
+msgid "URL to GET or POST (default: /)"
+msgstr ""
+
+msgid "URL encoded http POST data"
+msgstr ""
+
+msgid "Set HTTP method."
+msgstr ""
+
+msgid "Don't wait for document body: stop reading after headers."
+msgstr ""
+
+msgid "(Note that this still does an HTTP GET or POST, not a HEAD.)"
+msgstr ""
+
+msgid "Warn if document is more than SECONDS old. the number can also be of"
+msgstr ""
+
+msgid "the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."
+msgstr ""
+
+msgid "specify Content-Type header media type when POSTing\n"
+msgstr ""
+
+msgid "Allow regex to span newlines (must precede -r or -R)"
+msgstr ""
+
+msgid "Search page for regex STRING"
+msgstr ""
+
+msgid "Search page for case-insensitive regex STRING"
+msgstr ""
+
+msgid "Return CRITICAL if found, OK if not\n"
+msgstr ""
+
+msgid "Username:password on sites with basic authentication"
+msgstr ""
+
+msgid "Username:password on proxy-servers with basic authentication"
+msgstr ""
+
+msgid "String to be sent in http header as \"User Agent\""
+msgstr ""
+
+msgid ""
+"Any other tags to be sent in http header. Use multiple times for additional "
+"headers"
+msgstr ""
+
+msgid "Print additional performance data"
+msgstr ""
+
+msgid "Print body content below status line"
+msgstr ""
+
+msgid "Wrap output in HTML link (obsoleted by urlize)"
+msgstr ""
+
+msgid "How to handle redirected pages. sticky is like follow but stick to the"
+msgstr ""
+
+msgid "specified IP address. stickyport also ensures port stays the same."
+msgstr ""
+
+#, fuzzy
+msgid "Maximal number of redirects (default: "
+msgstr "Ungültige Portnummer"
+
+msgid "Minimum page size required (bytes) : Maximum page size required (bytes)"
+msgstr ""
+
+#, fuzzy
+msgid "This plugin will attempt to open an HTTP connection with the host."
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid ""
+"Successful connects return STATE_OK, refusals and timeouts return "
+"STATE_CRITICAL"
+msgstr ""
+
+msgid ""
+"other errors return STATE_UNKNOWN. Successful connects, but incorrect "
+"response"
+msgstr ""
+
+msgid ""
+"messages from the host result in STATE_WARNING return values. If you are"
+msgstr ""
+
+msgid ""
+"checking a virtual server that uses 'host headers' you must supply the FQDN"
+msgstr ""
+
+msgid "(fully qualified domain name) as the [host_name] argument."
+msgstr ""
+
+msgid "This plugin can also check whether an SSL enabled web server is able to"
+msgstr ""
+
+msgid "serve content (optionally within a specified time) or whether the X509 "
+msgstr ""
+
+msgid "certificate is still valid for the specified number of days."
+msgstr ""
+
+#, fuzzy
+msgid "Please note that this plugin does not check if the presented server"
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "certificate matches the hostname of the server, or if the certificate"
+msgstr ""
+
+msgid "has a valid chain of trust to one of the locally installed CAs."
+msgstr ""
+
+msgid ""
+"When the 'www.verisign.com' server returns its content within 5 seconds,"
+msgstr ""
+
+msgid ""
+"a STATE_OK will be returned. When the server returns its content but exceeds"
+msgstr ""
+
+msgid ""
+"the 5-second threshold, a STATE_WARNING will be returned. When an error "
+"occurs,"
+msgstr ""
+
+msgid "a STATE_CRITICAL will be returned."
+msgstr ""
+
+msgid ""
+"When the certificate of 'www.verisign.com' is valid for more than 14 days,"
+msgstr ""
+
+msgid ""
+"a STATE_OK is returned. When the certificate is still valid, but for less "
+"than"
+msgstr ""
+
+msgid ""
+"14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"
+msgstr ""
+
+#, fuzzy
+msgid "the certificate is expired."
+msgstr "Clientzertifikat benötigt\n"
+
+msgid ""
+"When the certificate of 'www.verisign.com' is valid for more than 30 days,"
+msgstr ""
+
+msgid "30 days, but more than 14 days, a STATE_WARNING is returned."
+msgstr ""
+
+msgid ""
+"A STATE_CRITICAL will be returned when certificate expires in less than 14 "
+"days"
+msgstr ""
+
+msgid ""
+"check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j "
+"CONNECT -H www.verisign.com "
+msgstr ""
+
+msgid ""
+"all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -"
+"S(sl) -j CONNECT -H <webserver>"
+msgstr ""
+
+msgid ""
+"a STATE_CRITICAL will be returned. By adding a colon to the method you can "
+"set the method used"
+msgstr ""
+
+msgid "inside the proxied connection: -j CONNECT:POST"
+msgstr ""
+
+#, c-format
+msgid "Could not connect to the server at port %i\n"
+msgstr ""
+
+#, c-format
+msgid "Could not set protocol version %d\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Could not init TLS at port %i!\n"
+msgstr "Konnte stderr nicht öffnen für: %s\n"
+
+#, c-format
+msgid "TLS not supported by the libraries!\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Could not init startTLS at port %i!\n"
+msgstr "Konnte stderr nicht öffnen für: %s\n"
+
+#, c-format
+msgid "startTLS not supported by the library, needs LDAPv3!\n"
+msgstr ""
+
+#, c-format
+msgid "Could not bind to the LDAP server\n"
+msgstr ""
+
+#, c-format
+msgid "Could not search/find objectclasses in %s\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "LDAP %s - found %d entries in %.3f seconds|%s %s\n"
+msgstr "HTTP OK %s - %.3f Sekunde Antwortzeit %s%s|%s %s\n"
+
+#, c-format
+msgid "LDAP %s - %.3f seconds response time|%s\n"
+msgstr ""
+
+#, c-format
+msgid "%s cannot be combined with %s"
+msgstr ""
+
+msgid "Please specify the host name\n"
+msgstr ""
+
+msgid "Please specify the LDAP base\n"
+msgstr ""
+
+msgid "ldap attribute to search (default: \"(objectclass=*)\""
+msgstr ""
+
+msgid "ldap base (eg. ou=my unit, o=my org, c=at"
+msgstr ""
+
+msgid "ldap bind DN (if required)"
+msgstr ""
+
+msgid ""
+"ldap password (if required, or set the password through environment variable "
+"'LDAP_PASSWORD')"
+msgstr ""
+
+msgid "use starttls mechanism introduced in protocol version 3"
+msgstr ""
+
+msgid "use ldaps (ldap v2 ssl method). this also sets the default port to"
+msgstr ""
+
+msgid "use ldap protocol version 2"
+msgstr ""
+
+msgid "use ldap protocol version 3"
+msgstr ""
+
+msgid "default protocol version:"
+msgstr ""
+
+msgid "Number of found entries to result in warning status"
+msgstr ""
+
+msgid "Number of found entries to result in critical status"
+msgstr ""
+
+msgid "If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"
+msgstr ""
+
+#, c-format
+msgid ""
+" implied (using default port %i) unless --port=636 is specified. In that "
+"case\n"
+msgstr ""
+
+msgid "'SSL on connect' will be used no matter how the plugin was called."
+msgstr ""
+
+msgid ""
+"This detection is deprecated, please use 'check_ldap' with the '--starttls' "
+"or '--ssl' flags"
+msgstr ""
+
+msgid "to define the behaviour explicitly instead."
+msgstr ""
+
+msgid "The parameters --warn-entries and --crit-entries are optional."
+msgstr ""
+
+msgid "Warning threshold must be float or float triplet!\n"
+msgstr ""
+
+#, c-format
+msgid "Error opening %s\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "could not parse load from uptime %s: %d\n"
+msgstr "Argumente konnten nicht ausgewertet werden"
+
+#, c-format
+msgid "Error code %d returned in %s\n"
+msgstr ""
+
+#, c-format
+msgid "Error in getloadavg()\n"
+msgstr ""
+
+#, c-format
+msgid "Error processing %s\n"
+msgstr ""
+
+#, c-format
+msgid "load average: %.2f, %.2f, %.2f"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Critical threshold for %d-minute load average is not specified\n"
+msgstr "Critical threshold muss ein positiver Integer sein\n"
+
+#, fuzzy, c-format
+msgid "Warning threshold for %d-minute load average is not specified\n"
+msgstr "Warning threshold muss ein positiver Integer sein\n"
+
+#, c-format
+msgid ""
+"Parameter inconsistency: %d-minute \"warning load\" is greater than "
+"\"critical load\"\n"
+msgstr ""
+
+#, c-format
+msgid "This plugin tests the current system load average."
+msgstr ""
+
+msgid "Exit with WARNING status if load average exceeds WLOADn"
+msgstr ""
+
+msgid "Exit with CRITICAL status if load average exceed CLOADn"
+msgstr ""
+
+msgid "the load average format is the same used by \"uptime\" and \"w\""
+msgstr ""
+
+msgid "Divide the load averages by the number of CPUs (when possible)"
+msgstr ""
+
+msgid "Number of processes to show when printing the top consuming processes."
+msgstr ""
+
+msgid "NUMBER_OF_PROCS=0 disables this feature. Default value is 0"
+msgstr ""
+
+#, c-format
+msgid "'%s' exited with non-zero status.\n"
+msgstr ""
+
+#, c-format
+msgid "some error occurred getting procs list.\n"
+msgstr ""
+
+msgid "Could not parse arguments\n"
+msgstr ""
+
+#, c-format
+msgid "Unable to open MRTG log file\n"
+msgstr ""
+
+#, c-format
+msgid "Unable to process MRTG log file\n"
+msgstr ""
+
+#, c-format
+msgid "MRTG data has expired (%d minutes old)\n"
+msgstr ""
+
+msgid "Avg"
+msgstr ""
+
+msgid "Max"
+msgstr ""
+
+msgid "Invalid variable number"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s is not a valid expiration time\n"
+"Use '%s -h' for additional help\n"
+msgstr ""
+
+msgid "Invalid variable number\n"
+msgstr ""
+
+msgid "You must supply the variable number"
+msgstr ""
+
+msgid ""
+"This plugin will check either the average or maximum value of one of the"
+msgstr ""
+
+#, fuzzy
+msgid "two variables recorded in an MRTG log file."
+msgstr "Konnte MRTG Logfile nicht öffnen"
+
+msgid "The MRTG log file containing the data you want to monitor"
+msgstr ""
+
+msgid "Minutes before MRTG data is considered to be too old"
+msgstr ""
+
+msgid "Should we check average or maximum values?"
+msgstr ""
+
+msgid "Which variable set should we inspect? (1 or 2)"
+msgstr ""
+
+msgid "Threshold value for data to result in WARNING status"
+msgstr ""
+
+msgid "Threshold value for data to result in CRITICAL status"
+msgstr ""
+
+msgid "Type label for data (Examples: Conns, \"Processor Load\", In, Out)"
+msgstr ""
+
+msgid "Option units label for data (Example: Packets/Sec, Errors/Sec,"
+msgstr ""
+
+#, c-format
+msgid "\"Bytes Per Second\", \"%% Utilization\")"
+msgstr ""
+
+msgid ""
+"If the value exceeds the <vwl> threshold, a WARNING status is returned. If"
+msgstr ""
+
+msgid ""
+"the value exceeds the <vcl> threshold, a CRITICAL status is returned. If"
+msgstr ""
+
+msgid "the data in the log file is older than <expire_minutes> old, a WARNING"
+msgstr ""
+
+msgid "status is returned and a warning message is printed."
+msgstr ""
+
+msgid ""
+"This plugin is useful for monitoring MRTG data that does not correspond to"
+msgstr ""
+
+msgid ""
+"bandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth)."
+msgstr ""
+
+msgid ""
+"It can be used to monitor any kind of data that MRTG is monitoring - errors,"
+msgstr ""
+
+msgid ""
+"packets/sec, etc. I use MRTG in conjunction with the Novell NLM that allows"
+msgstr ""
+
+msgid ""
+"me to track processor utilization, user connections, drive space, etc and"
+msgstr ""
+
+msgid "this plugin works well for monitoring that kind of data as well."
+msgstr ""
+
+msgid ""
+"- This plugin only monitors one of the two variables stored in the MRTG log"
+msgstr ""
+
+msgid "file. If you want to monitor both values you will have to define two"
+msgstr ""
+
+msgid "commands with different values for the <variable> argument. Of course,"
+msgstr ""
+
+msgid "you can always hack the code to make this plugin work for you..."
+msgstr ""
+
+msgid ""
+"- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded "
+"from"
+msgstr ""
+
+msgid "Unable to open MRTG log file"
+msgstr "Konnte MRTG Logfile nicht öffnen"
+
+msgid "Unable to process MRTG log file"
+msgstr ""
+
+#, c-format
+msgid "%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"
+msgstr ""
+
+#, c-format
+msgid "Traffic %s - %s\n"
+msgstr ""
+
+msgid ""
+"This plugin will check the incoming/outgoing transfer rates of a router,"
+msgstr ""
+
+msgid "switch, etc recorded in an MRTG log. If the newest log entry is older"
+msgstr ""
+
+msgid "than <expire_minutes>, a WARNING status is returned. If either the"
+msgstr ""
+
+msgid "incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"
+msgstr ""
+
+msgid "Bytes/sec), a CRITICAL status results. If either of the rates exceed"
+msgstr ""
+
+msgid "the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."
+msgstr ""
+
+msgid "File to read log from"
+msgstr ""
+
+msgid "Minutes after which log expires"
+msgstr ""
+
+msgid "Test average or maximum"
+msgstr ""
+
+#, fuzzy
+msgid "Warning threshold pair <incoming>,<outgoing>"
+msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+msgid "Critical threshold pair <incoming>,<outgoing>"
+msgstr "Critical threshold muss ein Integer sein"
+
+msgid ""
+"- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"
+msgstr ""
+
+msgid "- While MRTG can monitor things other than traffic rates, this"
+msgstr ""
+
+msgid " plugin probably won't work with much else without modification."
+msgstr ""
+
+msgid "- The calculated i/o rates are a little off from what MRTG actually"
+msgstr ""
+
+msgid " reports. I'm not sure why this is right now, but will look into it"
+msgstr ""
+
+msgid " for future enhancements of this plugin."
+msgstr ""
+
+#, c-format
+msgid "Usage"
+msgstr ""
+
+#, c-format
+msgid "status store_result error: %s\n"
+msgstr ""
+
+#, c-format
+msgid "slave query error: %s\n"
+msgstr ""
+
+#, c-format
+msgid "slave store_result error: %s\n"
+msgstr ""
+
+msgid "No slaves defined"
+msgstr ""
+
+#, c-format
+msgid "slave fetch row error: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Slave running: %s"
+msgstr ""
+
+msgid "This program tests connections to a MySQL server"
+msgstr ""
+
+msgid "Ignore authentication failure and check for mysql connectivity only"
+msgstr ""
+
+msgid "Use the specified socket (has no effect if -H is used)"
+msgstr ""
+
+msgid "Check database with indicated name"
+msgstr ""
+
+msgid "Read from the specified client options file"
+msgstr ""
+
+msgid "Use a client options group"
+msgstr ""
+
+msgid "Connect using the indicated username"
+msgstr ""
+
+msgid "Use the indicated password to authenticate the connection"
+msgstr ""
+
+msgid "IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"
+msgstr ""
+
+msgid "Your clear-text password could be visible as a process table entry"
+msgstr ""
+
+msgid "Check if the slave thread is running properly."
+msgstr ""
+
+msgid "Exit with WARNING status if slave server is more than INTEGER seconds"
+msgstr ""
+
+msgid "behind master"
+msgstr ""
+
+msgid "Exit with CRITICAL status if slave server is more then INTEGER seconds"
+msgstr ""
+
+msgid "Use ssl encryption"
+msgstr ""
+
+msgid "Path to CA signing the cert"
+msgstr ""
+
+msgid "Path to SSL certificate"
+msgstr ""
+
+msgid "Path to private SSL key"
+msgstr ""
+
+msgid "Path to CA directory"
+msgstr ""
+
+msgid "List of valid SSL ciphers"
+msgstr ""
+
+msgid ""
+"There are no required arguments. By default, the local database is checked"
+msgstr ""
+
+msgid ""
+"using the default unix socket. You can force TCP on localhost by using an"
+msgstr ""
+
+msgid "IP address or FQDN ('localhost' will use the socket as well)."
+msgstr ""
+
+msgid "You must specify -p with an empty string to force an empty password,"
+msgstr ""
+
+msgid "overriding any my.cnf settings."
+msgstr ""
+
+msgid "Cannot open status log for reading!"
+msgstr ""
+
+#, c-format
+msgid "Found process: %s %s\n"
+msgstr ""
+
+msgid "Could not locate a running Nagios process!"
+msgstr ""
+
+msgid "Cannot parse Nagios log file for valid time"
+msgstr ""
+
+#, c-format
+msgid "%d process"
+msgid_plural "%d processes"
+msgstr[0] ""
+msgstr[1] ""
+
+#, c-format
+msgid "status log updated %d second ago"
+msgid_plural "status log updated %d seconds ago"
+msgstr[0] ""
+msgstr[1] ""
+
+#, fuzzy
+msgid "Expiration time must be an integer (seconds)\n"
+msgstr "skip lines muss ein Integer sein"
+
+#, fuzzy
+msgid "Timeout must be an integer (seconds)\n"
+msgstr "skip lines muss ein Integer sein"
+
+#, fuzzy
+msgid "You must provide the status_log\n"
+msgstr "%s: Hostname muss angegeben werden\n"
+
+#, fuzzy
+msgid "You must provide a process string\n"
+msgstr "%s: Hostname muss angegeben werden\n"
+
+#, fuzzy
+msgid ""
+"This plugin checks the status of the Nagios process on the local machine"
+msgstr ""
+"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem\n"
+"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
+"unterschritten wird.\n"
+"\n"
+
+msgid ""
+"The plugin will check to make sure the Nagios status log is no older than"
+msgstr ""
+
+msgid "the number of minutes specified by the expires option."
+msgstr ""
+
+msgid ""
+"It also checks the process table for a process matching the command argument."
+msgstr ""
+
+msgid "Name of the log file to check"
+msgstr ""
+
+msgid "Minutes aging after which logfile is considered stale"
+msgstr ""
+
+msgid "Substring to search for in process arguments"
+msgstr ""
+
+msgid "Timeout for the plugin in seconds"
+msgstr ""
+
+#, c-format
+msgid "Wrong client version - running: %s, required: %s"
+msgstr ""
+
+msgid "missing -l parameters"
+msgstr ""
+
+msgid "wrong -l parameter."
+msgstr ""
+
+msgid "CPU Load"
+msgstr ""
+
+#, c-format
+msgid " %lu%% (%lu min average)"
+msgstr ""
+
+#, c-format
+msgid " '%lu min avg Load'=%lu%%;%lu;%lu;0;100"
+msgstr ""
+
+msgid "not enough values for -l parameters"
+msgstr ""
+
+msgid "wrong -l argument"
+msgstr ""
+
+#, c-format
+msgid "System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"
+msgstr ""
+
+#, c-format
+msgid "%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"
+msgstr ""
+
+#, c-format
+msgid "'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"
+msgstr ""
+
+msgid "Free disk space : Invalid drive"
+msgstr ""
+
+msgid "No service/process specified"
+msgstr ""
+
+msgid "could not fetch information from server\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Memory usage: total:%.2f MB - used: %.2f MB (%.0f%%) - free: %.2f MB (%.0f%%)"
+msgstr ""
+
+#, c-format
+msgid "'Memory usage'=%.2fMB;%.2f;%.2f;0.00;%.2f"
+msgstr ""
+
+msgid "No counter specified"
+msgstr ""
+
+msgid "Minimum value contains non-numbers"
+msgstr ""
+
+msgid "Maximum value contains non-numbers"
+msgstr ""
+
+msgid "No unit counter specified"
+msgstr ""
+
+msgid "Please specify a variable to check"
+msgstr ""
+
+#, fuzzy
+msgid "Server port must be an integer\n"
+msgstr "skip lines muss ein Integer sein"
+
+#, fuzzy
+msgid "You must provide a server address or host name"
+msgstr "Hostname oder Serveradresse muss angegeben werden"
+
+msgid "None"
+msgstr ""
+
+msgid "This plugin collects data from the NSClient service running on a"
+msgstr ""
+
+msgid "Windows NT/2000/XP/2003 server."
+msgstr ""
+
+msgid "Name of the host to check"
+msgstr ""
+
+#, fuzzy
+msgid "Optional port number (default: "
+msgstr "Ungültige Portnummer"
+
+msgid "Password needed for the request"
+msgstr ""
+
+msgid "Threshold which will result in a warning status"
+msgstr ""
+
+msgid "Threshold which will result in a critical status"
+msgstr ""
+
+msgid "Seconds before connection attempt times out (default: "
+msgstr ""
+
+msgid "Parameters passed to specified check (see below)"
+msgstr ""
+
+msgid "Display options (currently only SHOWALL works)"
+msgstr ""
+
+msgid "Return UNKNOWN on timeouts"
+msgstr ""
+
+msgid "Print this help screen"
+msgstr ""
+
+msgid "Print version information"
+msgstr ""
+
+msgid "Variable to check"
+msgstr ""
+
+msgid "Valid variables are:"
+msgstr ""
+
+msgid "Get the NSClient version"
+msgstr ""
+
+msgid "If -l <version> is specified, will return warning if versions differ."
+msgstr ""
+
+msgid "Average CPU load on last x minutes."
+msgstr ""
+
+msgid "Request a -l parameter with the following syntax:"
+msgstr ""
+
+msgid "-l <minutes range>,<warning threshold>,<critical threshold>."
+msgstr ""
+
+msgid "<minute range> should be less than 24*60."
+msgstr ""
+
+msgid ""
+"Thresholds are percentage and up to 10 requests can be done in one shot."
+msgstr ""
+
+msgid "Get the uptime of the machine."
+msgstr ""
+
+msgid "-l <unit> "
+msgstr ""
+
+msgid "<unit> = seconds, minutes, hours, or days. (default: minutes)"
+msgstr ""
+
+#, fuzzy
+msgid "Thresholds will use the unit specified above."
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "Size and percentage of disk use."
+msgstr ""
+
+msgid "Request a -l parameter containing the drive letter only."
+msgstr ""
+
+msgid "Warning and critical thresholds can be specified with -w and -c."
+msgstr ""
+
+msgid "Memory use."
+msgstr ""
+
+msgid "Check the state of one or several services."
+msgstr ""
+
+msgid "Request a -l parameters with the following syntax:"
+msgstr ""
+
+msgid "-l <service1>,<service2>,<service3>,..."
+msgstr ""
+
+msgid "You can specify -d SHOWALL in case you want to see working services"
+msgstr ""
+
+msgid "in the returned string."
+msgstr ""
+
+msgid "Check if one or several process are running."
+msgstr ""
+
+msgid "Same syntax as SERVICESTATE."
+msgstr ""
+
+msgid "Check any performance counter of Windows NT/2000."
+msgstr ""
+
+msgid "-l \"\\\\<performance object>\\\\counter\",\"<description>"
+msgstr ""
+
+msgid "The <description> parameter is optional and is given to a printf "
+msgstr ""
+
+msgid "output command which requires a float parameter."
+msgstr ""
+
+#, c-format
+msgid "If <description> does not include \"%%\", it is used as a label."
+msgstr ""
+
+msgid "Some examples:"
+msgstr ""
+
+msgid "Check any performance counter object of Windows NT/2000."
+msgstr ""
+
+msgid ""
+"Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>"
+msgstr ""
+
+msgid "<counter object> is a Windows Perfmon Counter object (eg. Process),"
+msgstr ""
+
+msgid "if it is two words, it should be enclosed in quotes"
+msgstr ""
+
+msgid "The returned results will be a comma-separated list of instances on "
+msgstr ""
+
+msgid " the selected computer for that object."
+msgstr ""
+
+msgid ""
+"The purpose of this is to be run from command line to determine what "
+"instances"
+msgstr ""
+
+msgid ""
+" are available for monitoring without having to log onto the Windows server"
+msgstr ""
+
+msgid " to run Perfmon directly."
+msgstr ""
+
+msgid ""
+"It can also be used in scripts that automatically create the monitoring "
+"service"
+msgstr ""
+
+msgid " configuration files."
+msgstr ""
+
+msgid "check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process"
+msgstr ""
+
+msgid ""
+"- The NSClient service should be running on the server to get any information"
+msgstr ""
+
+msgid "- Critical thresholds should be lower than warning thresholds"
+msgstr ""
+
+msgid "- Default port 1248 is sometimes in use by other services. The error"
+msgstr ""
+
+msgid ""
+"output when this happens contains \"Cannot map xxxxx to protocol number\"."
+msgstr ""
+
+msgid "One fix for this is to change the port to something else on check_nt "
+msgstr ""
+
+msgid "and on the client service it's connecting to."
+msgstr ""
+
+#, c-format
+msgid "jitter response too large (%lu bytes)\n"
+msgstr ""
+
+msgid "NTP CRITICAL:"
+msgstr "NTP CRITICAL:"
+
+msgid "NTP WARNING:"
+msgstr "NTP WARNING:"
+
+msgid "NTP OK:"
+msgstr "NTP OK:"
+
+msgid "NTP UNKNOWN:"
+msgstr "NTP UNKNOWN:"
+
+msgid "Offset unknown"
+msgstr ""
+
+msgid "Offset"
+msgstr ""
+
+#, fuzzy
+msgid "This plugin checks the selected ntp server"
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "Offset to result in warning status (seconds)"
+msgstr ""
+
+msgid "Offset to result in critical status (seconds)"
+msgstr ""
+
+#, fuzzy
+msgid "Warning threshold for jitter"
+msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+msgid "Critical threshold for jitter"
+msgstr "Critical threshold muss ein Integer sein"
+
+msgid "Normal offset check:"
+msgstr ""
+
+msgid ""
+"Check jitter too, avoiding critical notifications if jitter isn't available"
+msgstr ""
+
+msgid "(See Notes above for more details on thresholds formats):"
+msgstr ""
+
+msgid "WARNING: check_ntp is deprecated. Please use check_ntp_peer or"
+msgstr ""
+
+msgid "check_ntp_time instead."
+msgstr ""
+
+msgid "Server not synchronized"
+msgstr ""
+
+msgid "Server has the LI_ALARM bit set"
+msgstr ""
+
+msgid ""
+"Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"
+msgstr ""
+
+#, fuzzy
+msgid "Warning threshold for stratum of server's synchronization peer"
+msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+msgid "Critical threshold for stratum of server's synchronization peer"
+msgstr "Critical threshold muss ein Integer sein"
+
+#, fuzzy
+msgid "Warning threshold for number of usable time sources (\"truechimers\")"
+msgstr "Warning threshold muss ein positiver Integer sein\n"
+
+#, fuzzy
+msgid "Critical threshold for number of usable time sources (\"truechimers\")"
+msgstr "Critical threshold muss ein positiver Integer sein\n"
+
+msgid "This plugin checks an NTP server independent of any commandline"
+msgstr ""
+
+msgid "programs or external libraries."
+msgstr ""
+
+#, fuzzy
+msgid "Use this plugin to check the health of an NTP server. It supports"
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "checking the offset with the sync peer, the jitter and stratum. This"
+msgstr ""
+
+msgid "plugin will not check the clock offset between the local host and NTP"
+msgstr ""
+
+msgid "server; please use check_ntp_time for that purpose."
+msgstr ""
+
+msgid "Simple NTP server check:"
+msgstr ""
+
+msgid "Only check the number of usable time sources (\"truechimers\"):"
+msgstr ""
+
+msgid "Check only stratum:"
+msgstr ""
+
+#, fuzzy
+msgid "This plugin checks the clock offset with the ntp server"
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "Returns UNKNOWN instead of CRITICAL if offset cannot be found"
+msgstr ""
+
+msgid "Expected offset of the ntp server relative to local server (seconds)"
+msgstr ""
+
+#, fuzzy
+msgid "This plugin checks the clock offset between the local host and a"
+msgstr ""
+"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem\n"
+"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
+"unterschritten wird.\n"
+"\n"
+
+msgid "remote NTP server. It is independent of any commandline programs or"
+msgstr ""
+
+msgid "external libraries."
+msgstr ""
+
+msgid "If you'd rather want to monitor an NTP server, please use"
+msgstr ""
+
+msgid "check_ntp_peer."
+msgstr ""
+
+msgid "--time-offset is useful for compensating for servers with known"
+msgstr ""
+
+msgid "and expected clock skew."
+msgstr ""
+
+#, c-format
+msgid "NetWare %s: "
+msgstr ""
+
+#, c-format
+msgid "Up %s,"
+msgstr ""
+
+#, c-format
+msgid "Load %s - %s %s-min load average = %lu%%|load%s=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "Conns %s - %lu current connections|Conns=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s: Long term cache hits = %lu%%"
+msgstr ""
+
+#, c-format
+msgid "%s: Total cache buffers = %lu|Cachebuffers=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s: Dirty cache buffers = %lu|Dirty-Cache-Buffers=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s: LRU sitting time = %lu minutes"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Volume '%s' does not exist!"
+msgstr ""
+
+#, c-format
+msgid "%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"
+msgstr ""
+
+msgid "Only "
+msgstr ""
+
+#, c-format
+msgid "%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid ""
+"%lu MB (%lu%%) free on volume %s - total %lu MB|FreeMB%s=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "Directory Services Database is %s (DS version %s)"
+msgstr ""
+
+#, c-format
+msgid "Logins are %s"
+msgstr ""
+
+msgid "enabled"
+msgstr ""
+
+msgid "disabled"
+msgstr ""
+
+#, fuzzy
+msgid "CRITICAL - NRM Status is bad!"
+msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
+
+msgid "Warning - NRM Status is suspect!"
+msgstr ""
+
+msgid "OK - NRM Status is good!"
+msgstr ""
+
+#, c-format
+msgid "%lu of %lu (%lu%%) packet receive buffers used"
+msgstr ""
+
+#, c-format
+msgid "%lu entries in SAP table"
+msgstr ""
+
+#, c-format
+msgid "%lu entries in SAP table for SAP type %d"
+msgstr ""
+
+#, c-format
+msgid "%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "%s%lu KB not yet purgeable on volume %s"
+msgstr ""
+
+#, c-format
+msgid "%lu MB (%lu%%) not yet purgeable on volume %s"
+msgstr ""
+
+#, c-format
+msgid "%lu open files|Openfiles=%lu;%lu;%lu;0,0"
+msgstr ""
+
+#, c-format
+msgid "%lu abended threads|Abends=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%lu current service processes (%lu max)|Processes=%lu;%lu;%lu;0;%lu"
+msgstr ""
+
+msgid "CRITICAL - Time not in sync with network!"
+msgstr ""
+
+msgid "OK - Time in sync with network!"
+msgstr ""
+
+#, c-format
+msgid "LRU sitting time = %lu seconds"
+msgstr ""
+
+#, c-format
+msgid "Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "NDS Version %s"
+msgstr ""
+
+#, c-format
+msgid "Up %s"
+msgstr ""
+
+#, c-format
+msgid "Module %s version %s is loaded"
+msgstr ""
+
+#, c-format
+msgid "Module %s is not loaded"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "CRITICAL - Value '%s' does not exist!"
+msgstr "%s [%s nicht gefunden]"
+
+#, c-format
+msgid "%s is %lu|%s=%lu;%lu;%lu;;"
+msgstr ""
+
+msgid "Nothing to check!\n"
+msgstr ""
+
+#, fuzzy
+msgid "Server port an integer\n"
+msgstr "skip lines muss ein Integer sein"
+
+msgid "This plugin attempts to contact the MRTGEXT NLM running on a"
+msgstr ""
+
+msgid "Novell server to gather the requested system information."
+msgstr ""
+
+msgid "Variable to check. Valid variables include:"
+msgstr ""
+
+msgid "LOAD1 = 1 minute average CPU load"
+msgstr ""
+
+msgid "LOAD5 = 5 minute average CPU load"
+msgstr ""
+
+msgid "LOAD15 = 15 minute average CPU load"
+msgstr ""
+
+msgid "CSPROCS = number of current service processes (NW 5.x only)"
+msgstr ""
+
+msgid "ABENDS = number of abended threads (NW 5.x only)"
+msgstr ""
+
+msgid "UPTIME = server uptime"
+msgstr ""
+
+msgid "LTCH = percent long term cache hits"
+msgstr ""
+
+msgid "CBUFF = current number of cache buffers"
+msgstr ""
+
+msgid "CDBUFF = current number of dirty cache buffers"
+msgstr ""
+
+msgid "DCB = dirty cache buffers as a percentage of the total"
+msgstr ""
+
+msgid "TCB = dirty cache buffers as a percentage of the original"
+msgstr ""
+
+msgid "OFILES = number of open files"
+msgstr ""
+
+msgid " VMF<vol> = MB of free space on Volume <vol>"
+msgstr ""
+
+msgid " VMU<vol> = MB used space on Volume <vol>"
+msgstr ""
+
+msgid " VMP<vol> = MB of purgeable space on Volume <vol>"
+msgstr ""
+
+msgid " VPF<vol> = percent free space on volume <vol>"
+msgstr ""
+
+msgid " VKF<vol> = KB of free space on volume <vol>"
+msgstr ""
+
+msgid " VPP<vol> = percent purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VKP<vol> = KB of purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VPNP<vol> = percent not yet purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VKNP<vol> = KB of not yet purgeable space on volume <vol>"
+msgstr ""
+
+msgid " LRUM = LRU sitting time in minutes"
+msgstr ""
+
+msgid " LRUS = LRU sitting time in seconds"
+msgstr ""
+
+msgid " DSDB = check to see if DS Database is open"
+msgstr ""
+
+msgid " DSVER = NDS version"
+msgstr ""
+
+msgid " UPRB = used packet receive buffers"
+msgstr ""
+
+msgid " PUPRB = percent (of max) used packet receive buffers"
+msgstr ""
+
+msgid " SAPENTRIES = number of entries in the SAP table"
+msgstr ""
+
+msgid " SAPENTRIES<n> = number of entries in the SAP table for SAP type <n>"
+msgstr ""
+
+msgid " TSYNC = timesync status"
+msgstr ""
+
+msgid " LOGINS = check to see if logins are enabled"
+msgstr ""
+
+msgid " CONNS = number of currently licensed connections"
+msgstr ""
+
+msgid " NRMH\t= NRM Summary Status"
+msgstr ""
+
+msgid " NRMP<stat> = Returns the current value for a NRM health item"
+msgstr ""
+
+msgid " NRMM<stat> = Returns the current memory stats from NRM"
+msgstr ""
+
+msgid " NRMS<stat> = Returns the current Swapfile stats from NRM"
+msgstr ""
+
+msgid " NSS1<stat> = Statistics from _Admin:Manage_NSS\\GeneralStats.xml"
+msgstr ""
+
+msgid " NSS3<stat> = Statistics from _Admin:Manage_NSS\\NameCache.xml"
+msgstr ""
+
+msgid " NSS4<stat> = Statistics from _Admin:Manage_NSS\\FileStats.xml"
+msgstr ""
+
+msgid " NSS5<stat> = Statistics from _Admin:Manage_NSS\\ObjectCache.xml"
+msgstr ""
+
+msgid " NSS6<stat> = Statistics from _Admin:Manage_NSS\\Thread.xml"
+msgstr ""
+
+msgid ""
+" NSS7<stat> = Statistics from _Admin:Manage_NSS\\AuthorizationCache.xml"
+msgstr ""
+
+msgid " NLM:<nlm> = check if NLM is loaded and report version"
+msgstr ""
+
+msgid " (e.g. NLM:TSANDS.NLM)"
+msgstr ""
+
+msgid "Include server version string in results"
+msgstr ""
+
+msgid "- This plugin requires that the MRTGEXT.NLM file from James Drews' MRTG"
+msgstr ""
+
+msgid ""
+" extension for NetWare be loaded on the Novell servers you wish to check."
+msgstr ""
+
+msgid " (available from http://www.engr.wisc.edu/~drews/mrtg/)"
+msgstr ""
+
+msgid ""
+"- Values for critical thresholds should be lower than warning thresholds"
+msgstr ""
+
+msgid ""
+" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "
+msgstr ""
+
+msgid " TCB, LRUS and LRUM."
+msgstr ""
+
+msgid "Unknown error fetching load data\n"
+msgstr ""
+
+msgid "Invalid response from server - no load information\n"
+msgstr ""
+
+msgid "Invalid response from server after load 1\n"
+msgstr ""
+
+msgid "Invalid response from server after load 5\n"
+msgstr ""
+
+#, c-format
+msgid "Load %s - %s-min load average = %0.2f"
+msgstr ""
+
+msgid "Unknown error fetching disk data\n"
+msgstr ""
+
+msgid "Invalid response from server\n"
+msgstr ""
+
+msgid "Unknown error fetching network status\n"
+msgstr ""
+
+#, c-format
+msgid "Net %s - %d connection%s on port %d"
+msgstr ""
+
+msgid "Unknown error fetching process status\n"
+msgstr ""
+
+#, c-format
+msgid "Process %s - %d instance%s of %s running"
+msgstr ""
+
+#, c-format
+msgid "Uptime %s - Up %d days %d hours %d minutes"
+msgstr ""
+
+msgid ""
+"This plugin attempts to contact the Over-CR collector daemon running on the"
+msgstr ""
+
+msgid "remote UNIX server in order to gather the requested system information."
+msgstr ""
+
+msgid "LOAD1 = 1 minute average CPU load"
+msgstr ""
+
+msgid "LOAD5 = 5 minute average CPU load"
+msgstr ""
+
+msgid "LOAD15 = 15 minute average CPU load"
+msgstr ""
+
+msgid "DPU<filesys> = percent used disk space on filesystem <filesys>"
+msgstr ""
+
+msgid "PROC<process> = number of running processes with name <process>"
+msgstr ""
+
+msgid "NET<port> = number of active connections on TCP port <port>"
+msgstr ""
+
+msgid "UPTIME = system uptime in seconds"
+msgstr ""
+
+msgid "This plugin requires that Eric Molitors' Over-CR collector daemon be"
+msgstr ""
+
+msgid "running on the remote server."
+msgstr ""
+
+msgid "Over-CR can be downloaded from http://www.molitor.org/overcr"
+msgstr ""
+
+msgid "This plugin was tested with version 0.99.53 of the Over-CR collector"
+msgstr ""
+
+msgid ""
+"For the available options, the critical threshold value should always be"
+msgstr ""
+
+msgid ""
+"higher than the warning threshold value, EXCEPT with the uptime variable"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - no connection to '%s' (%s).\n"
+msgstr ""
+
+#, c-format
+msgid " %s - database %s (%f sec.)|%s\n"
+msgstr ""
+
+msgid "Critical threshold must be a positive integer"
+msgstr "Critical threshold muss ein positiver Integer sein"
+
+msgid "Warning threshold must be a positive integer"
+msgstr "Warning threshold muss ein positiver Integer sein"
+
+msgid "Database name exceeds the maximum length"
+msgstr ""
+
+msgid "User name is not valid"
+msgstr ""
+
+#, c-format
+msgid "Test whether a PostgreSQL Database is accepting connections."
+msgstr ""
+
+msgid "Database to check "
+msgstr ""
+
+#, c-format
+msgid "(default: %s)\n"
+msgstr ""
+
+msgid "Login name of user"
+msgstr ""
+
+msgid "Password (BIG SECURITY ISSUE)"
+msgstr ""
+
+msgid "Connection parameters (keyword = value), see below"
+msgstr ""
+
+msgid "SQL query to run. Only first column in first row will be read"
+msgstr ""
+
+msgid "A name for the query, this string is used instead of the query"
+msgstr ""
+
+msgid "in the long output of the plugin"
+msgstr ""
+
+msgid "SQL query value to result in warning status (double)"
+msgstr ""
+
+msgid "SQL query value to result in critical status (double)"
+msgstr ""
+
+msgid "All parameters are optional."
+msgstr ""
+
+msgid ""
+"This plugin tests a PostgreSQL DBMS to determine whether it is active and"
+msgstr ""
+
+msgid "accepting queries. In its current operation, it simply connects to the"
+msgstr ""
+
+msgid ""
+"specified database, and then disconnects. If no database is specified, it"
+msgstr ""
+
+msgid ""
+"connects to the template1 database, which is present in every functioning"
+msgstr ""
+
+msgid "PostgreSQL DBMS."
+msgstr ""
+
+msgid "If a query is specified using the -q option, it will be executed after"
+msgstr ""
+
+msgid "connecting to the server. The result from the query has to be numeric."
+msgstr ""
+
+msgid ""
+"Multiple SQL commands, separated by semicolon, are allowed but the result "
+msgstr ""
+
+msgid "of the last command is taken into account only. The value of the first"
+msgstr ""
+
+msgid ""
+"column in the first row is used as the check result. If a second column is"
+msgstr ""
+
+msgid "present in the result set, this is added to the plugin output with a"
+msgstr ""
+
+msgid ""
+"prefix of \"Extra Info:\". This information can be displayed in the system"
+msgstr ""
+
+msgid "executing the plugin."
+msgstr ""
+
+msgid ""
+"See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"
+msgstr ""
+
+msgid ""
+"for details about how to access internal statistics of the database server."
+msgstr ""
+
+msgid ""
+"For a list of available connection parameters which may be used with the -o"
+msgstr ""
+
+msgid ""
+"command line option, see the documentation for PQconnectdb() in the chapter"
+msgstr ""
+
+msgid ""
+"\"libpq - C Library\" of the PostgreSQL manual. For example, this may be"
+msgstr ""
+
+msgid ""
+"used to specify a service name in pg_service.conf to be used for additional"
+msgstr ""
+
+msgid "connection parameters: -o 'service=<name>' or to specify the SSL mode:"
+msgstr ""
+
+msgid "-o 'sslmode=require'."
+msgstr ""
+
+msgid ""
+"The plugin will connect to a local postmaster if no host is specified. To"
+msgstr ""
+
+msgid ""
+"connect to a remote host, be sure that the remote postmaster accepts TCP/IP"
+msgstr ""
+
+msgid "connections (start the postmaster with the -i option)."
+msgstr ""
+
+msgid ""
+"Typically, the monitoring user (unless the --logname option is used) should "
+"be"
+msgstr ""
+
+msgid ""
+"able to connect to the database without a password. The plugin can also send"
+msgstr ""
+
+msgid "a password, but no effort is made to obscure or encrypt the password."
+msgstr ""
+
+#, c-format
+msgid "QUERY %s - %s: %s.\n"
+msgstr ""
+
+msgid "Error with query"
+msgstr ""
+
+msgid "No rows returned"
+msgstr ""
+
+msgid "No columns returned"
+msgstr ""
+
+#, fuzzy
+msgid "No data returned"
+msgstr "Keine Daten empfangen %s\n"
+
+msgid "Is not a numeric"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "%s returned %f"
+msgstr "%s hat %s zurückgegeben"
+
+#, fuzzy, c-format
+msgid "'%s' returned %f"
+msgstr "%s hat %s zurückgegeben"
+
+msgid "CRITICAL - Could not interpret output from ping command\n"
+msgstr ""
+
+#, c-format
+msgid "PING %s - %sPacket loss = %d%%"
+msgstr ""
+
+#, c-format
+msgid "PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"
+msgstr ""
+
+msgid "Could not realloc() addresses\n"
+msgstr ""
+
+#, c-format
+msgid "<max_packets> (%s) must be a non-negative number\n"
+msgstr ""
+
+#, c-format
+msgid "<wpl> (%s) must be an integer percentage\n"
+msgstr ""
+
+#, c-format
+msgid "<cpl> (%s) must be an integer percentage\n"
+msgstr ""
+
+#, c-format
+msgid "<wrta> (%s) must be a non-negative number\n"
+msgstr ""
+
+#, c-format
+msgid "<crta> (%s) must be a non-negative number\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Warning threshold must be integer or percentage!\n"
+"\n"
+msgstr ""
+
+#, c-format
+msgid "<wrta> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<crta> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<wpl> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<cpl> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<wrta> (%f) cannot be larger than <crta> (%f)\n"
+msgstr ""
+
+#, c-format
+msgid "<wpl> (%d) cannot be larger than <cpl> (%d)\n"
+msgstr ""
+
+#, c-format
+msgid "Cannot open stderr for %s\n"
+msgstr ""
+
+msgid "System call sent warnings to stderr "
+msgstr ""
+
+#, fuzzy, c-format
+msgid "CRITICAL - Network Unreachable (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Host Unreachable (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Network Prohibited (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Host Prohibited (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Packet Filtered (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Host not found (%s)\n"
+msgstr "CRITICAL - Text nicht gefunden%s|%s %s\n"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Time to live exceeded (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Destination Unreachable (%s)\n"
+msgstr "CRITICAL - Netzwerk nicht erreichbar (%s)"
+
+msgid "Unable to realloc warn_text\n"
+msgstr ""
+
+#, c-format
+msgid "Use ping to check connection statistics for a remote host."
+msgstr ""
+
+msgid "host to ping"
+msgstr ""
+
+msgid "number of ICMP ECHO packets to send"
+msgstr ""
+
+#, c-format
+msgid "(Default: %d)\n"
+msgstr ""
+
+msgid "show HTML in the plugin output (obsoleted by urlize)"
+msgstr ""
+
+msgid "THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"
+msgstr ""
+
+msgid "time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"
+msgstr ""
+
+msgid "percentage of packet loss to trigger an alarm state."
+msgstr ""
+
+#, fuzzy
+msgid ""
+"This plugin uses the ping command to probe the specified host for packet loss"
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid ""
+"(percentage) and round trip average (milliseconds). It can produce HTML "
+"output"
+msgstr ""
+
+msgid ""
+"linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"
+msgstr ""
+
+msgid "the contrib area of the downloads section at http://www.nagios.org/"
+msgstr ""
+
+#, c-format
+msgid "CMD: %s\n"
+msgstr ""
+
+msgid "System call sent warnings to stderr"
+msgstr ""
+
+#, c-format
+msgid "Not parseable: %s"
+msgstr ""
+
+#, c-format
+msgid "Unable to read output\n"
+msgstr ""
+
+#, c-format
+msgid "%d warn out of "
+msgstr ""
+
+#, c-format
+msgid "%d crit, %d warn out of "
+msgstr ""
+
+#, c-format
+msgid " with %s"
+msgstr ""
+
+#, fuzzy
+msgid "Parent Process ID must be an integer!"
+msgstr "Argument für check_dummy muss ein Integer sein"
+
+#, c-format
+msgid "%s%sSTATE = %s"
+msgstr ""
+
+#, fuzzy
+msgid "UID was not found"
+msgstr "%s [%s nicht gefunden]"
+
+#, fuzzy
+msgid "User name was not found"
+msgstr "%s [%s nicht gefunden]"
+
+#, c-format
+msgid "%s%scommand name '%s'"
+msgstr ""
+
+#, c-format
+msgid "%s%sexclude progs '%s'"
+msgstr ""
+
+#, fuzzy
+msgid "RSS must be an integer!"
+msgstr "skip lines muss ein Integer sein"
+
+#, fuzzy
+msgid "VSZ must be an integer!"
+msgstr "skip lines muss ein Integer sein"
+
+msgid "PCPU must be a float!"
+msgstr ""
+
+msgid "Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"
+msgstr ""
+
+msgid ""
+"Checks all processes and generates WARNING or CRITICAL states if the "
+"specified"
+msgstr ""
+
+msgid ""
+"metric is outside the required threshold ranges. The metric defaults to "
+"number"
+msgstr ""
+
+msgid ""
+"of processes. Search filters can be applied to limit the processes to check."
+msgstr ""
+
+msgid "Generate warning state if metric is outside this range"
+msgstr ""
+
+msgid "Generate critical state if metric is outside this range"
+msgstr ""
+
+msgid "Check thresholds against metric. Valid types:"
+msgstr ""
+
+msgid "PROCS - number of processes (default)"
+msgstr ""
+
+msgid "VSZ - virtual memory size"
+msgstr ""
+
+msgid "RSS - resident set memory size"
+msgstr ""
+
+msgid "CPU - percentage CPU"
+msgstr ""
+
+msgid "ELAPSED - time elapsed in seconds"
+msgstr ""
+
+msgid "Extra information. Up to 3 verbosity levels"
+msgstr ""
+
+msgid "Filter own process the traditional way by PID instead of /proc/pid/exe"
+msgstr ""
+
+msgid "Only scan for processes that have, in the output of `ps`, one or"
+msgstr ""
+
+msgid "more of the status flags you specify (for example R, Z, S, RS,"
+msgstr ""
+
+msgid "RSZDT, plus others based on the output of your 'ps' command)."
+msgstr ""
+
+msgid "Only scan for children of the parent process ID indicated."
+msgstr ""
+
+msgid "Only scan for processes with VSZ higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with RSS higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with PCPU higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with user name or ID indicated."
+msgstr ""
+
+msgid "Only scan for processes with args that contain STRING."
+msgstr ""
+
+msgid "Only scan for processes with args that contain the regex STRING."
+msgstr ""
+
+msgid "Only scan for exact matches of COMMAND (without path)."
+msgstr ""
+
+msgid "Exclude processes which match this comma separated list"
+msgstr ""
+
+msgid "Only scan for non kernel threads (works on Linux only)."
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n"
+"specified 'max:min', a warning status will be generated if the\n"
+"count is inside the specified range\n"
+"\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"This plugin checks the number of currently running processes and\n"
+"generates WARNING or CRITICAL states if the process count is outside\n"
+"the specified threshold ranges. The process count can be filtered by\n"
+"process owner, parent process PID, current state (e.g., 'Z'), or may\n"
+"be the total number of running processes\n"
+"\n"
+msgstr ""
+
+msgid "Warning if not two processes with command name portsentry."
+msgstr ""
+
+msgid "Critical if < 2 or > 1024 processes"
+msgstr ""
+
+msgid "Critical if not at least 1 process with command sshd"
+msgstr ""
+
+msgid "Warning if > 1024 processes with command name sshd."
+msgstr ""
+
+msgid "Critical if < 1 processes with command name sshd."
+msgstr ""
+
+msgid "Warning alert if > 10 processes with command arguments containing"
+msgstr ""
+
+msgid "'/usr/local/bin/perl' and owned by root"
+msgstr ""
+
+msgid "Alert if VSZ of any processes over 50K or 100K"
+msgstr ""
+
+msgid "Alert if CPU of any processes over 10% or 20%"
+msgstr ""
+
+msgid "Config file error\n"
+msgstr ""
+
+#, fuzzy
+msgid "Out of Memory?\n"
+msgstr "Kein Papier"
+
+#, fuzzy
+msgid "Invalid NAS-Identifier\n"
+msgstr "Ungültige(r) Hostname/Adresse"
+
+#, c-format
+msgid "gethostname() failed!\n"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid NAS-IP-Address\n"
+msgstr "Ungültige(r) Hostname/Adresse"
+
+msgid "Timeout\n"
+msgstr ""
+
+msgid "Auth Error\n"
+msgstr ""
+
+#, fuzzy
+msgid "Auth Failed\n"
+msgstr "Fehlgeschlagen"
+
+msgid "Bad Response\n"
+msgstr ""
+
+msgid "Auth OK\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Unexpected result code %d"
+msgstr "Erwartet: %s aber: %s erhalten"
+
+msgid "Number of retries must be a positive integer"
+msgstr ""
+
+msgid "User not specified"
+msgstr ""
+
+msgid "Password not specified"
+msgstr ""
+
+msgid "Configuration file not specified"
+msgstr ""
+
+#, fuzzy
+msgid "Tests to see if a RADIUS server is accepting connections."
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid "The user to authenticate"
+msgstr ""
+
+msgid "Password for authentication (SECURITY RISK)"
+msgstr ""
+
+msgid "NAS identifier"
+msgstr ""
+
+msgid "NAS IP Address"
+msgstr ""
+
+msgid "Configuration file"
+msgstr ""
+
+msgid "Response string to expect from the server"
+msgstr ""
+
+msgid "Number of times to retry a failed connection"
+msgstr ""
+
+#, fuzzy
+msgid ""
+"This plugin tests a RADIUS server to see if it is accepting connections."
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid ""
+"The server to test must be specified in the invocation, as well as a user"
+msgstr ""
+
+msgid "name and password. A configuration file must be present. The format of"
+msgstr ""
+
+msgid ""
+"the configuration file is described in the radiusclient library sources."
+msgstr ""
+
+msgid "The password option presents a substantial security issue because the"
+msgstr ""
+
+msgid ""
+"password can possibly be determined by careful watching of the command line"
+msgstr ""
+
+msgid "in a process listing. This risk is exacerbated because the plugin will"
+msgstr ""
+
+msgid ""
+"typically be executed at regular predictable intervals. Please be sure that"
+msgstr ""
+
+msgid "the password used does not allow access to sensitive system resources."
+msgstr ""
+
+#, c-format
+msgid "Unable to connect to %s on port %d\n"
+msgstr ""
+
+#, c-format
+msgid "No data received from %s\n"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid REAL response received from host"
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+#, c-format
+msgid "Invalid REAL response received from host on port %d\n"
+msgstr ""
+
+#, c-format
+msgid "No data received from host\n"
+msgstr ""
+
+#, c-format
+msgid "REAL %s - %d second response time\n"
+msgstr ""
+
+msgid "Warning time must be a positive integer"
+msgstr "Warnung time muss ein positiver Integer sein"
+
+msgid "Critical time must be a positive integer"
+msgstr "Critical time muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "You must provide a server to check"
+msgstr "%s: Hostname muss angegeben werden\n"
+
+#, fuzzy
+msgid "This plugin tests the REAL service on the specified host."
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "Connect to this url"
+msgstr ""
+
+#, c-format
+msgid "String to expect in first line of server response (default: %s)\n"
+msgstr ""
+
+#, fuzzy
+msgid "This plugin will attempt to open an RTSP connection with the host."
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid "Successful connects return STATE_OK, refusals and timeouts return"
+msgstr ""
+
+msgid ""
+"STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,"
+msgstr ""
+
+msgid ""
+"but incorrect response messages from the host result in STATE_WARNING return"
+msgstr ""
+
+msgid "values."
+msgstr ""
+
+#, c-format
+msgid "malloc() failed!\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Cannot create SSL context.\n"
+msgstr ""
+
+#, c-format
+msgid "recv() failed\n"
+msgstr ""
+
+#, c-format
+msgid "WARNING - TLS not supported by server\n"
+msgstr ""
+
+#, c-format
+msgid "Server does not support STARTTLS\n"
+msgstr ""
+
+msgid "SMTP UNKNOWN - Cannot send EHLO command via TLS."
+msgstr ""
+
+#, c-format
+msgid "sent %s"
+msgstr ""
+
+msgid "SMTP UNKNOWN - Cannot read EHLO response via TLS."
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Invalid SMTP response received from host: %s\n"
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+#, fuzzy, c-format
+msgid "Invalid SMTP response received from host on port %d: %s\n"
+msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
+
+#, c-format
+msgid "Could Not Compile Regular Expression"
+msgstr ""
+
+#, c-format
+msgid "SMTP %s - Invalid response '%s' to command '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Execute Error: %s\n"
+msgstr ""
+
+msgid "no authuser specified, "
+msgstr ""
+
+msgid "no authpass specified, "
+msgstr ""
+
+#, c-format
+msgid "sent %s\n"
+msgstr ""
+
+#, fuzzy
+msgid "recv() failed after AUTH LOGIN, "
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+#, fuzzy, c-format
+msgid "received %s\n"
+msgstr "Keine Daten empfangen %s\n"
+
+#, fuzzy
+msgid "invalid response received after AUTH LOGIN, "
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+msgid "recv() failed after sending authuser, "
+msgstr ""
+
+#, fuzzy
+msgid "invalid response received after authuser, "
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+msgid "recv() failed after sending authpass, "
+msgstr ""
+
+#, fuzzy
+msgid "invalid response received after authpass, "
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+msgid "only authtype LOGIN is supported, "
+msgstr ""
+
+#, fuzzy, c-format
+msgid "SMTP %s - %s%.3f sec. response time%s%s|%s\n"
+msgstr " - %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
+
+#, c-format
+msgid "Could not realloc() units [%d]\n"
+msgstr ""
+
+#, fuzzy
+msgid "Critical time must be a positive"
+msgstr "Critical time muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "Warning time must be a positive"
+msgstr "Warnung time muss ein positiver Integer sein"
+
+msgid "SSL support not available - install OpenSSL and recompile"
+msgstr ""
+
+msgid "Set either -s/--ssl/--tls or -S/--starttls"
+msgstr "Setze entweder -s/--ssl/--tls oder -S/--starttls"
+
+#, c-format
+msgid "Connection closed by server before sending QUIT command\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "recv() failed after QUIT."
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+#, c-format
+msgid "Connection reset by peer."
+msgstr ""
+
+#, fuzzy
+msgid "This plugin will attempt to open an SMTP connection with the host."
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+#, c-format
+msgid " String to expect in first line of server response (default: '%s')\n"
+msgstr ""
+
+msgid "SMTP command (may be used repeatedly)"
+msgstr ""
+
+msgid "Expected response to command (may be used repeatedly)"
+msgstr ""
+
+msgid "FROM-address to include in MAIL command, required by Exchange 2000"
+msgstr ""
+
+msgid "FQDN used for HELO"
+msgstr ""
+
+msgid "Use PROXY protocol prefix for the connection."
+msgstr "Benutze PROXY-Protokoll-Präfix für die Verbindung."
+
+msgid "Minimum number of days a certificate has to be valid."
+msgstr ""
+
+#, fuzzy
+msgid "Use SSL/TLS for the connection."
+msgstr "Benutze SSL/TLS für die Verbindung."
+
+#, c-format
+msgid " Sets default port to %d.\n"
+msgstr " Setze den Default-Port auf %d.\n"
+
+msgid "Use STARTTLS for the connection."
+msgstr "Benutze STARTTLS für die Verbindung."
+
+msgid "SMTP AUTH type to check (default none, only LOGIN supported)"
+msgstr ""
+
+msgid "SMTP AUTH username"
+msgstr ""
+
+msgid "SMTP AUTH password"
+msgstr ""
+
+msgid "Send LHLO instead of HELO/EHLO"
+msgstr ""
+
+msgid "Ignore failure when sending QUIT command to server"
+msgstr ""
+
+msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful"
+msgstr ""
+
+msgid "connects, but incorrect response messages from the host result in"
+msgstr ""
+
+msgid "STATE_WARNING return values."
+msgstr ""
+
+msgid "Cannot malloc"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "External command error: %s\n"
+msgstr "Papierfehler"
+
+#, c-format
+msgid "External command error with no output (return code: %d)\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "No valid data returned (%s)\n"
+msgstr "Keine Daten empfangen %s\n"
+
+msgid "Time duration between plugin calls is invalid"
+msgstr ""
+
+msgid "Cannot asprintf()"
+msgstr ""
+
+msgid "Cannot realloc()"
+msgstr ""
+
+msgid "No previous data to calculate rate - assume okay"
+msgstr ""
+
+#, fuzzy
+msgid "Retries interval must be a positive integer"
+msgstr "Time interval muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "Exit status must be a positive integer"
+msgstr "Maxbytes muss ein positiver Integer sein"
+
+#, fuzzy, c-format
+msgid "Could not reallocate labels[%d]"
+msgstr "Konnte addr nicht zuweisen\n"
+
+#, fuzzy
+msgid "Could not reallocate labels\n"
+msgstr "Konnte·url·nicht·zuweisen\n"
+
+#, fuzzy, c-format
+msgid "Could not reallocate units [%d]\n"
+msgstr "Konnte·url·nicht·zuweisen\n"
+
+msgid "Could not realloc() units\n"
+msgstr ""
+
+#, fuzzy
+msgid "Rate multiplier must be a positive integer"
+msgstr "Paketgröße muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "No host specified\n"
+msgstr ""
+"Kein Hostname angegeben\n"
+"\n"
+
+#, fuzzy
+msgid "No OIDs specified\n"
+msgstr ""
+"Kein Hostname angegeben\n"
+"\n"
+
+#, c-format
+msgid "Required parameter: %s\n"
+msgstr ""
+
+msgid "Invalid seclevel"
+msgstr ""
+
+msgid "Invalid SNMP version"
+msgstr ""
+
+msgid "Unbalanced quotes\n"
+msgstr ""
+
+#, c-format
+msgid "multiplier set (%.1f), but input is not a number: %s"
+msgstr ""
+
+msgid "Check status of remote machines and obtain system information via SNMP"
+msgstr ""
+
+msgid "Use SNMP GETNEXT instead of SNMP GET"
+msgstr ""
+
+msgid "SNMP protocol version"
+msgstr ""
+
+msgid "SNMPv3 context"
+msgstr ""
+
+msgid "SNMPv3 securityLevel"
+msgstr ""
+
+msgid "SNMPv3 auth proto"
+msgstr ""
+
+msgid "SNMPv3 priv proto (default DES)"
+msgstr ""
+
+msgid "Optional community string for SNMP communication"
+msgstr ""
+
+msgid "default is"
+msgstr ""
+
+msgid "SNMPv3 username"
+msgstr ""
+
+msgid "SNMPv3 authentication password"
+msgstr ""
+
+msgid "SNMPv3 privacy password"
+msgstr ""
+
+msgid "Object identifier(s) or SNMP variables whose value you wish to query"
+msgstr ""
+
+msgid ""
+"List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'"
+msgstr ""
+
+msgid "for symbolic OIDs.)"
+msgstr ""
+
+msgid "Delimiter to use when parsing returned data. Default is"
+msgstr ""
+
+msgid "Any data on the right hand side of the delimiter is considered"
+msgstr ""
+
+msgid "to be the data that should be used in the evaluation."
+msgstr ""
+
+msgid "If the check returns a 0 length string or NULL value"
+msgstr ""
+
+msgid "This option allows you to choose what status you want it to exit"
+msgstr ""
+
+msgid "Excluding this option renders the default exit of 3(STATE_UNKNOWN)"
+msgstr ""
+
+msgid "0 = OK"
+msgstr ""
+
+#, fuzzy
+msgid "1 = WARNING"
+msgstr "WARNING"
+
+#, fuzzy
+msgid "2 = CRITICAL"
+msgstr "CRITICAL"
+
+#, fuzzy
+msgid "3 = UNKNOWN"
+msgstr "UNKNOWN"
+
+#, fuzzy
+msgid "Warning threshold range(s)"
+msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+msgid "Critical threshold range(s)"
+msgstr "Critical threshold muss ein Integer sein"
+
+msgid "Enable rate calculation. See 'Rate Calculation' below"
+msgstr ""
+
+msgid ""
+"Converts rate per second. For example, set to 60 to convert to per minute"
+msgstr ""
+
+msgid "Add/subtract the specified OFFSET to numeric sensor data"
+msgstr ""
+
+msgid "Return OK state (for that OID) if STRING is an exact match"
+msgstr ""
+
+msgid ""
+"Return OK state (for that OID) if extended regular expression REGEX matches"
+msgstr ""
+
+msgid ""
+"Return OK state (for that OID) if case-insensitive extended REGEX matches"
+msgstr ""
+
+msgid "Invert search result (CRITICAL if found)"
+msgstr ""
+
+msgid "Prefix label for output from plugin"
+msgstr ""
+
+msgid "Units label(s) for output data (e.g., 'sec.')."
+msgstr ""
+
+msgid "Separates output on multiple OID requests"
+msgstr ""
+
+msgid "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
+msgstr ""
+
+msgid "C-style format string for float values (see option -M)"
+msgstr ""
+
+msgid ""
+"NOTE the final timeout value is calculated using this formula: "
+"timeout_interval * retries + 5"
+msgstr ""
+
+msgid "Number of retries to be used in the requests, default: "
+msgstr ""
+
+msgid "Label performance data with OIDs instead of --label's"
+msgstr ""
+
+msgid "Tell snmpget to not print errors encountered when parsing MIB files"
+msgstr ""
+
+msgid ""
+"This plugin uses the 'snmpget' command included with the NET-SNMP package."
+msgstr ""
+
+msgid ""
+"if you don't have the package installed, you will need to download it from"
+msgstr ""
+
+msgid "http://net-snmp.sourceforge.net before you can use this plugin."
+msgstr ""
+
+msgid ""
+"- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "
+msgstr ""
+
+msgid "list (lists with internal spaces must be quoted)."
+msgstr ""
+
+msgid ""
+"- When checking multiple OIDs, separate ranges by commas like '-w "
+"1:10,1:,:20'"
+msgstr ""
+
+msgid "- Note that only one string and one regex may be checked at present"
+msgstr ""
+
+msgid ""
+"- All evaluation methods other than PR, STR, and SUBSTR expect that the value"
+msgstr ""
+
+msgid "returned from the SNMP query is an unsigned integer."
+msgstr ""
+
+msgid "Rate Calculation:"
+msgstr ""
+
+msgid "In many places, SNMP returns counters that are only meaningful when"
+msgstr ""
+
+msgid "calculating the counter difference since the last check. check_snmp"
+msgstr ""
+
+msgid "saves the last state information in a file so that the rate per second"
+msgstr ""
+
+msgid "can be calculated. Use the --rate option to save state information."
+msgstr ""
+
+msgid ""
+"On the first run, there will be no prior state - this will return with OK."
+msgstr ""
+
+msgid "The state is uniquely determined by the arguments to the plugin, so"
+msgstr ""
+
+msgid "changing the arguments will create a new state file."
+msgstr ""
+
+#, fuzzy
+msgid "Port number must be a positive integer"
+msgstr "Port muss ein positiver Integer sein"
+
+#, c-format
+msgid "Server answer: %s"
+msgstr ""
+
+#, c-format
+msgid "SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "SSH OK - %s (protocol %s) | %s\n"
+msgstr ""
+
+msgid "Try to connect to an SSH server at specified server and port"
+msgstr ""
+
+msgid ""
+"Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"
+msgstr ""
+
+msgid "Alert if protocol doesn't match expected protocol version (ex: 2.0)"
+msgstr ""
+
+#, c-format
+msgid "Command: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Format: %s\n"
+msgstr ""
+
+#, c-format
+msgid "total=%.0f, used=%.0f, free=%.0f\n"
+msgstr ""
+
+#, c-format
+msgid "total=%.0f, free=%.0f\n"
+msgstr ""
+
+msgid "Error getting swap devices\n"
+msgstr ""
+
+msgid "SWAP OK: No swap devices defined\n"
+msgstr ""
+
+msgid "swapctl failed: "
+msgstr ""
+
+msgid "Error in swapctl call\n"
+msgstr ""
+
+#, c-format
+msgid "SWAP %s - %d%% free (%dMB out of %dMB) %s|"
+msgstr ""
+
+#, fuzzy
+msgid "Warning threshold percentage must be <= 100!"
+msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+msgid "Warning threshold be positive integer or percentage!"
+msgstr "Warning threshold muss ein Integer oder ein Prozentwert sein"
+
+#, fuzzy
+msgid "Critical threshold percentage must be <= 100!"
+msgstr "Critical threshold muss ein Integer sein"
+
+#, fuzzy
+msgid "Critical threshold be positive integer or percentage!"
+msgstr "Critical threshold muss ein Integer oder ein Prozentwert sein!"
+
+msgid ""
+"no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
+"or integer (0-3)."
+msgstr ""
+
+#, fuzzy
+msgid "Warning should be more than critical"
+msgstr "Warning threshold muss ein Integer oder ein Prozentwert sein"
+
+msgid "Check swap space on local machine."
+msgstr ""
+
+msgid ""
+"Exit with WARNING status if less than INTEGER bytes of swap space are free"
+msgstr ""
+
+msgid "Exit with WARNING status if less than PERCENT of swap space is free"
+msgstr ""
+
+msgid ""
+"Exit with CRITICAL status if less than INTEGER bytes of swap space are free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than PERCENT of swap space is free"
+msgstr ""
+
+msgid "Conduct comparisons for all swap partitions, one by one"
+msgstr ""
+
+msgid ""
+"Resulting state when there is no swap regardless of thresholds. Default:"
+msgstr ""
+
+msgid ""
+"Both INTEGER and PERCENT thresholds can be specified, they are all checked."
+msgstr ""
+
+msgid "On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."
+msgstr ""
+
+msgid "CRITICAL - Generic check_tcp called with unknown service\n"
+msgstr ""
+
+msgid "With UDP checks, a send/expect string must be specified."
+msgstr ""
+
+msgid "No arguments found"
+msgstr ""
+
+msgid "Maxbytes must be a positive integer"
+msgstr "Maxbytes muss ein positiver Integer sein"
+
+msgid "Refuse must be one of ok, warn, crit"
+msgstr ""
+
+msgid "Mismatch must be one of ok, warn, crit"
+msgstr ""
+
+msgid "Delay must be a positive integer"
+msgstr "Delay muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "You must provide a server address"
+msgstr "%s: Hostname muss angegeben werden\n"
+
+#, fuzzy
+msgid "Invalid hostname, address or socket"
+msgstr "Ungültige(r) Hostname/Adresse"
+
+#, fuzzy, c-format
+msgid ""
+"This plugin tests %s connections with the specified host (or unix socket).\n"
+"\n"
+msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host."
+
+msgid ""
+"Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send "
+"or quit option"
+msgstr ""
+
+msgid "Default: nothing added to send, \\r\\n added to end of quit"
+msgstr ""
+
+msgid "String to send to the server"
+msgstr ""
+
+msgid "String to expect in server response"
+msgstr ""
+
+msgid "(may be repeated)"
+msgstr ""
+
+msgid "All expect strings need to occur in server response. Default is any"
+msgstr ""
+
+msgid "String to send server to initiate a clean close of the connection"
+msgstr ""
+
+msgid "Accept TCP refusals with states ok, warn, crit (default: crit)"
+msgstr ""
+
+msgid ""
+"Accept expected string mismatches with states ok, warn, crit (default: warn)"
+msgstr ""
+
+#, fuzzy
+msgid "Hide output from TCP socket"
+msgstr "Konnte TCP socket nicht öffnen\n"
+
+msgid "Close connection once more than this number of bytes are received"
+msgstr ""
+
+msgid "Seconds to wait between sending string and polling for response"
+msgstr ""
+
+msgid "1st is #days for warning, 2nd is critical (if not specified - 0)."
+msgstr ""
+
+msgid "Use SSL for the connection."
+msgstr ""
+
+msgid "SSL server_name"
+msgstr ""
+
+#, c-format
+msgid "TIME UNKNOWN - could not connect to server %s, port %d\n"
+msgstr ""
+
+#, c-format
+msgid "TIME UNKNOWN - could not send UDP request to server %s, port %d\n"
+msgstr ""
+
+#, c-format
+msgid "TIME UNKNOWN - no data received from server %s, port %d\n"
+msgstr ""
+
+#, c-format
+msgid "TIME %s - %d second response time|%s\n"
+msgstr ""
+
+#, c-format
+msgid "TIME %s - %lu second time difference|%s %s\n"
+msgstr ""
+
+msgid "Warning thresholds must be a positive integer"
+msgstr "Warning thresholds muss ein positiver Integer sein"
+
+msgid "Critical thresholds must be a positive integer"
+msgstr "Critical thresholds muss ein positiver Integer sein"
+
+#, fuzzy
+msgid "This plugin will check the time on the specified host."
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "Use UDP to connect, not TCP"
+msgstr ""
+
+msgid "Time difference (sec.) necessary to result in a warning status"
+msgstr ""
+
+msgid "Time difference (sec.) necessary to result in a critical status"
+msgstr ""
+
+msgid "Response time (sec.) necessary to result in warning status"
+msgstr ""
+
+msgid "Response time (sec.) necessary to result in critical status"
+msgstr ""
+
+msgid "On Battery, Low Battery"
+msgstr ""
+
+msgid "Online"
+msgstr ""
+
+msgid "On Battery"
+msgstr ""
+
+msgid ", Low Battery"
+msgstr ""
+
+msgid ", Calibrating"
+msgstr ""
+
+msgid ", Replace Battery"
+msgstr ""
+
+msgid ", On Bypass"
+msgstr ""
+
+msgid ", Overload"
+msgstr ""
+
+msgid ", Trimming"
+msgstr ""
+
+msgid ", Boosting"
+msgstr ""
+
+msgid ", Charging"
+msgstr ""
+
+msgid ", Discharging"
+msgstr ""
+
+msgid ", Unknown"
+msgstr ""
+
+#, fuzzy
+msgid "UPS does not support any available options\n"
+msgstr "IPv6 Unterstützung nicht vorhanden"
+
+#, fuzzy
+msgid "Invalid response received from host"
+msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+msgid "UPS name to long for buffer"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "CRITICAL - no such UPS '%s' on that host\n"
+msgstr "%s [%s nicht gefunden]"
+
+#, fuzzy
+msgid "CRITICAL - UPS data is stale"
+msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
+
+#, fuzzy, c-format
+msgid "Unknown error: %s\n"
+msgstr "Papierfehler"
+
+msgid "Error: unable to parse variable"
+msgstr ""
+
+msgid "Unrecognized UPS variable"
+msgstr ""
+
+msgid "Error : no UPS indicated"
+msgstr ""
+
+#, fuzzy
+msgid ""
+"This plugin tests the UPS service on the specified host. Network UPS Tools"
+msgstr ""
+"Testet den DNS Dienst auf dem angegebenen Host mit dig\n"
+"\n"
+
+msgid "from www.networkupstools.org must be running for this plugin to work."
+msgstr ""
+
+msgid "Name of UPS"
+msgstr ""
+
+msgid "Output of temperatures in Celsius"
+msgstr ""
+
+msgid "Valid values for STRING are"
+msgstr ""
+
+msgid ""
+"This plugin attempts to determine the status of a UPS (Uninterruptible Power"
+msgstr ""
+
+msgid ""
+"Supply) on a local or remote host. If the UPS is online or calibrating, the"
+msgstr ""
+
+msgid ""
+"plugin will return an OK state. If the battery is on it will return a WARNING"
+msgstr ""
+
+msgid ""
+"state. If the UPS is off or has a low battery the plugin will return a "
+"CRITICAL"
+msgstr ""
+
+msgid ""
+"You may also specify a variable to check (such as temperature, utility "
+"voltage,"
+msgstr ""
+
+msgid ""
+"battery load, etc.) as well as warning and critical thresholds for the value"
+msgstr ""
+
+msgid ""
+"of that variable. If the remote host has multiple UPS that are being "
+"monitored"
+msgstr ""
+
+msgid "you will have to use the --ups option to specify which UPS to check."
+msgstr ""
+
+msgid ""
+"This plugin requires that the UPSD daemon distributed with Russell Kroll's"
+msgstr ""
+
+msgid ""
+"Network UPS Tools be installed on the remote host. If you do not have the"
+msgstr ""
+
+msgid "package installed on your system, you can download it from"
+msgstr ""
+
+msgid "http://www.networkupstools.org"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Could not enumerate RD sessions: %d\n"
+msgstr "Konnte·url·nicht·zuweisen\n"
+
+#, c-format
+msgid "# users=%d"
+msgstr ""
+
+msgid "Unable to read output"
+msgstr ""
+
+#, c-format
+msgid "USERS %s - %d users currently logged in |%s\n"
+msgstr ""
+
+#, fuzzy
+msgid "This plugin checks the number of users currently logged in on the local"
+msgstr ""
+"Dieses Plugin prüft den freien Speicher auf einem gemounteten Filesystem\n"
+"und erzeugt einen Alarm wenn einer der angegebenen Schwellwerte "
+"unterschritten wird.\n"
+"\n"
+
+msgid ""
+"system and generates an error if the number exceeds the thresholds specified."
+msgstr ""
+
+msgid "Set WARNING status if more than INTEGER users are logged in"
+msgstr ""
+
+msgid "Set CRITICAL status if more than INTEGER users are logged in"
+msgstr ""
+
+msgid ""
+"DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\"."
+msgstr ""
+
+msgid "Nagios-compatible output is now always returned."
+msgstr ""
+
+msgid "SMART commands are broken and have been disabled (See Notes in --help)."
+msgstr ""
+
+msgid ""
+"DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the"
+msgstr ""
+
+msgid "default and will be removed from future releases."
+msgstr ""
+
+#, fuzzy, c-format
+msgid "CRITICAL - Couldn't open device %s: %s\n"
+msgstr "CRITICAL - Device konnte nicht geöffnet werden: %s\n"
+
+#, c-format
+msgid "CRITICAL - SMART_CMD_ENABLE\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - SMART_READ_VALUES: %s\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"
+msgstr ""
+
+#, c-format
+msgid "WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"
+msgstr ""
+
+#, c-format
+msgid "OK - Operational (%d/%d tests passed)\n"
+msgstr ""
+
+#, c-format
+msgid "ERROR - Status '%d' unknown. %d/%d tests passed\n"
+msgstr ""
+
+#, c-format
+msgid "OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"
+msgstr ""
+
+#, c-format
+msgid "OffLineCapability=%d {%s %s %s}\n"
+msgstr ""
+
+#, c-format
+msgid "SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "OK - Command sent (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - SMART_READ_THRESHOLDS: %s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"This plugin checks a local hard drive with the (Linux specific) SMART "
+"interface [http://smartlinux.sourceforge.net/smart/index.php]."
+msgstr ""
+
+msgid "Select device DEVICE"
+msgstr ""
+
+msgid ""
+"Note: if the device is specified without this option, any further option will"
+msgstr ""
+
+msgid "be ignored."
+msgstr ""
+
+msgid ""
+"The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were"
+msgstr ""
+
+msgid ""
+"broken in an underhand manner and have been disabled. You can use smartctl"
+msgstr ""
+
+msgid "instead:"
+msgstr ""
+
+msgid "-0/--auto-off: use \"smartctl --offlineauto=off\""
+msgstr ""
+
+msgid "-1/--auto-on: use \"smartctl --offlineauto=on\""
+msgstr ""
+
+msgid "-i/--immediate: use \"smartctl --test=offline\""
+msgstr ""
+
+#, fuzzy
+msgid "No data returned from command\n"
+msgstr "Keine Daten empfangen %s\n"
+
+msgid ""
+"Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
+"or integer (0-3)."
+msgstr ""
+
+msgid ""
+"Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer "
+"(0-3)."
+msgstr ""
+
+msgid ""
+"Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+
+msgid ""
+"Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+
+msgid ""
+"Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+
+msgid "Require path to command"
+msgstr ""
+
+msgid ""
+"Negates the status of a plugin (returns OK for CRITICAL and vice-versa)."
+msgstr ""
+
+msgid "Additional switches can be used to control which state becomes what."
+msgstr ""
+
+msgid "Keep timeout longer than the plugin timeout to retain CRITICAL status."
+msgstr ""
+
+msgid "Custom result on Negate timeouts; see below for STATUS definition\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" quotes. Numeric values are accepted. If nothing is specified, permutes\n"
+msgstr ""
+
+#, c-format
+msgid " OK and CRITICAL.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" Substitute output text as well. Will only substitute text in CAPITALS\n"
+msgstr ""
+
+msgid "Run check_ping and invert result. Must use full path to plugin"
+msgstr ""
+
+msgid "This will return OK instead of WARNING and UNKNOWN instead of CRITICAL"
+msgstr ""
+
+msgid ""
+"This plugin is a wrapper to take the output of another plugin and invert it."
+msgstr ""
+
+msgid "The full path of the plugin must be provided."
+msgstr ""
+
+msgid "If the wrapped plugin returns OK, the wrapper will return CRITICAL."
+msgstr ""
+
+msgid "If the wrapped plugin returns CRITICAL, the wrapper will return OK."
+msgstr ""
+
+msgid "Otherwise, the output state of the wrapped plugin is unchanged."
+msgstr ""
+
+msgid ""
+"Using timeout-result, it is possible to override the timeout behaviour or a"
+msgstr ""
+
+msgid "plugin by setting the negate timeout a bit lower."
+msgstr ""
+
+#, fuzzy, c-format
+msgid "%s - Socket timeout after %d seconds\n"
+msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
+
+#, fuzzy, c-format
+msgid "%s - Abnormal timeout after %d seconds\n"
+msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
+
+msgid "Send failed"
+msgstr ""
+
+#, fuzzy
+msgid "No data was received from host!"
+msgstr "Keine Daten empfangen %s\n"
+
+msgid "Socket creation failed"
+msgstr ""
+
+msgid "Supplied path too long unix domain socket"
+msgstr ""
+
+msgid "Receive failed"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Invalid hostname/address - %s"
+msgstr ""
+"Ungültige(r) Name/Adresse: %s\n"
+"\n"
+
+#, fuzzy
+msgid "Could not malloc argv array in popen()"
+msgstr "Konnte addr nicht zuweisen\n"
+
+#, fuzzy
+msgid "CRITICAL - You need more args!!!"
+msgstr "CRITICAL - Fehler: %s\n"
+
+#, fuzzy
+msgid "Cannot catch SIGCHLD"
+msgstr "Konnte SIGALRM nicht erhalten"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Plugin timed out after %d seconds\n"
+msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
+
+msgid "CRITICAL - popen timeout received, but no child process"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s UNKNOWN - No data received from host\n"
+"CMD: %s</A>\n"
+msgstr ""
+
+msgid ""
+"This plugin wraps the text output of another command (plugin) in HTML <A>"
+msgstr ""
+
+msgid ""
+"tags, thus displaying the child plugin's output as a clickable link in "
+"compatible"
+msgstr ""
+
+msgid ""
+"monitoring status screen. This plugin returns the status of the invoked "
+"plugin."
+msgstr ""
+
+msgid ""
+"Pay close attention to quoting to ensure that the shell passes the expected"
+msgstr ""
+
+msgid "data to the plugin. For example, in:"
+msgstr ""
+
+msgid "urlize http://example.com/ check_http -H example.com -r 'two words'"
+msgstr ""
+
+msgid "the shell will remove the single quotes and urlize will see:"
+msgstr ""
+
+msgid "urlize http://example.com/ check_http -H example.com -r two words"
+msgstr ""
+
+msgid "You probably want:"
+msgstr ""
+
+msgid "urlize http://example.com/ \"check_http -H example.com -r 'two words'\""
+msgstr ""
+
+#, fuzzy
+msgid "failed realloc in strpcpy\n"
+msgstr "konnte keinen Speicher für '%s' reservieren\n"
+
+#, fuzzy
+msgid "failed malloc in strscat\n"
+msgstr "konnte keinen Speicher für '%s' reservieren\n"
+
+#, fuzzy
+msgid "failed malloc in xvasprintf\n"
+msgstr "konnte keinen Speicher für '%s' reservieren\n"
+
+#, c-format
+msgid ""
+" %s (-h | --help) for detailed help\n"
+" %s (-V | --version) for version information\n"
+msgstr ""
+
+msgid ""
+"\n"
+"Options:\n"
+" -h, --help\n"
+" Print detailed help screen\n"
+" -V, --version\n"
+" Print version information\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" -H, --hostname=ADDRESS\n"
+" Host name, IP Address, or unix socket (must be an absolute path)\n"
+" -%c, --port=INTEGER\n"
+" Port number (default: %s)\n"
+msgstr ""
+
+msgid ""
+" -4, --use-ipv4\n"
+" Use IPv4 connection\n"
+" -6, --use-ipv6\n"
+" Use IPv6 connection\n"
+msgstr ""
+
+msgid ""
+" -v, --verbose\n"
+" Show details for command-line debugging (output may be truncated by\n"
+" the monitoring system)\n"
+msgstr ""
+
+msgid ""
+" -w, --warning=DOUBLE\n"
+" Response time to result in warning status (seconds)\n"
+" -c, --critical=DOUBLE\n"
+" Response time to result in critical status (seconds)\n"
+msgstr ""
+
+msgid ""
+" -w, --warning=RANGE\n"
+" Warning range (format: start:end). Alert if outside this range\n"
+" -c, --critical=RANGE\n"
+" Critical range\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" -t, --timeout=INTEGER\n"
+" Seconds before connection times out (default: %d)\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" -t, --timeout=INTEGER\n"
+" Seconds before plugin times out (default: %d)\n"
+msgstr ""
+
+msgid ""
+" --extra-opts=[section][@file]\n"
+" Read options from an ini file. See\n"
+" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
+" for usage and examples.\n"
+msgstr ""
+
+msgid ""
+" See:\n"
+" https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n"
+" for THRESHOLD format and examples.\n"
+msgstr ""
+
+msgid ""
+"\n"
+"Send email to help@monitoring-plugins.org if you have questions regarding\n"
+"use of this software. To submit patches or suggest improvements, send email\n"
+"to devel@monitoring-plugins.org\n"
+"\n"
+msgstr ""
+
+msgid ""
+"\n"
+"The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may "
+"redistribute\n"
+"copies of the plugins under the terms of the GNU General Public License.\n"
+"For more information about these matters, see the file named COPYING.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not get hardware address of interface '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Error: if_nametoindex error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: can't find unit number in interface_name (%s) - expecting TypeNumber "
+"eg lnc0.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: can't read MAC address from DLPI streams interface for device %s unit "
+"%d.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: can't get MAC address for this architecture. Use the --mac option.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Cannot determine IP address of interface %s\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Cannot get interface IP address on this platform.\n"
+msgstr ""
+
+#, c-format
+msgid "Pretending to be relay client %s\n"
+msgstr ""
+
+#, c-format
+msgid "DHCPDISCOVER to %s port %d\n"
+msgstr ""
+
+#, c-format
+msgid "Result=ERROR\n"
+msgstr ""
+
+#, c-format
+msgid "Result=OK\n"
+msgstr ""
+
+#, c-format
+msgid "DHCPOFFER from IP address %s"
+msgstr ""
+
+#, c-format
+msgid " via %s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"
+msgstr ""
+
+#, c-format
+msgid "DHCPOFFER hardware address did not match our own - ignoring packet\n"
+msgstr ""
+
+#, c-format
+msgid "Total responses seen on the wire: %d\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Valid responses for this machine: %d\n"
+msgstr "Keine Antwort vom Host \n"
+
+#, c-format
+msgid "send_dhcp_packet result: %d\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "No (more) data received (nfound: %d)\n"
+msgstr "Keine Daten empfangen %s\n"
+
+#, c-format
+msgid "recvfrom() failed, "
+msgstr ""
+
+#, c-format
+msgid "receive_dhcp_packet() result: %d\n"
+msgstr ""
+
+#, c-format
+msgid "receive_dhcp_packet() source: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not create socket!\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not set reuse address option on DHCP socket!\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not set broadcast option on DHCP socket!\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: Could not bind socket to interface %s. Check your privileges...\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"
+msgstr ""
+
+#, c-format
+msgid "Requested server address: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Lease Time: Infinite\n"
+msgstr ""
+
+#, c-format
+msgid "Lease Time: %lu seconds\n"
+msgstr ""
+
+#, c-format
+msgid "Renewal Time: Infinite\n"
+msgstr ""
+
+#, c-format
+msgid "Renewal Time: %lu seconds\n"
+msgstr ""
+
+#, c-format
+msgid "Rebinding Time: Infinite\n"
+msgstr ""
+
+#, c-format
+msgid "Rebinding Time: %lu seconds\n"
+msgstr ""
+
+#, c-format
+msgid "Added offer from server @ %s"
+msgstr ""
+
+#, c-format
+msgid " of IP address %s\n"
+msgstr ""
+
+#, c-format
+msgid "DHCP Server Match: Offerer=%s"
+msgstr ""
+
+#, c-format
+msgid " Requested=%s"
+msgstr ""
+
+#, c-format
+msgid " (duplicate)"
+msgstr ""
+
+#, c-format
+msgid "\n"
+msgstr ""
+
+#, c-format
+msgid "No DHCPOFFERs were received.\n"
+msgstr ""
+
+#, c-format
+msgid "Received %d DHCPOFFER(s)"
+msgstr ""
+
+#, c-format
+msgid ", Rogue DHCP Server detected! Server %s"
+msgstr ""
+
+#, c-format
+msgid " offered %s \n"
+msgstr ""
+
+#, c-format
+msgid ", %s%d of %d requested servers responded"
+msgstr ""
+
+#, c-format
+msgid ", requested address (%s) was %soffered"
+msgstr ""
+
+msgid "not "
+msgstr ""
+
+#, c-format
+msgid ", max lease time = "
+msgstr ""
+
+#, c-format
+msgid "Infinity"
+msgstr ""
+
+msgid "Got unexpected non-option argument"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Hardware address: "
+msgstr ""
+
+msgid "This plugin tests the availability of DHCP servers on a network."
+msgstr ""
+
+msgid "IP address of DHCP server that we must hear from"
+msgstr ""
+
+msgid "IP address that should be offered by at least one DHCP server"
+msgstr ""
+
+msgid "Seconds to wait for DHCPOFFER before timeout occurs"
+msgstr ""
+
+msgid "Interface to to use for listening (i.e. eth0)"
+msgstr ""
+
+msgid "MAC address to use in the DHCP request"
+msgstr ""
+
+msgid "Unicast testing: mimic a DHCP relay, requires -s"
+msgstr ""
+
+msgid ""
+"Only requested DHCP server may response (rogue DHCP server detection), "
+"requires -s"
+msgstr ""
+
+msgid "specify a target"
+msgstr ""
+
+msgid "Use IPv4 (default) or IPv6 to communicate with the targets"
+msgstr ""
+
+#, fuzzy
+msgid "warning threshold (currently "
+msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+msgid "critical threshold (currently "
+msgstr "Critical threshold muss ein Integer sein"
+
+msgid ""
+"RTA, round trip average, mode warning,critical, ex. 100ms,200ms unit in ms"
+msgstr ""
+
+msgid "packet loss mode, ex. 40%,50% , unit in %"
+msgstr ""
+
+msgid "jitter mode warning,critical, ex. 40.000ms,50.000ms , unit in ms "
+msgstr ""
+
+msgid "MOS mode, between 0 and 4.4 warning,critical, ex. 3.5,3.0"
+msgstr ""
+
+msgid "score mode, max value 100 warning,critical, ex. 80,70 "
+msgstr ""
+
+msgid "detect out of order ICMP packts "
+msgstr ""
+
+#, fuzzy
+msgid "specify a source IP address or device name"
+msgstr "Hostname oder Serveradresse muss angegeben werden"
+
+msgid "number of packets to send (currently "
+msgstr ""
+
+msgid "max packet interval (currently "
+msgstr ""
+
+msgid "max target interval (currently "
+msgstr ""
+
+msgid "number of alive hosts required for success"
+msgstr ""
+
+msgid "TTL on outgoing packets (currently "
+msgstr ""
+
+msgid "timeout value (seconds, currently "
+msgstr ""
+
+msgid "Number of icmp data bytes to send"
+msgstr ""
+
+msgid "Packet size will be data bytes + icmp header (currently"
+msgstr ""
+
+msgid "verbose"
+msgstr ""
+
+msgid "If none of R,P,J,M,S or O is specified, default behavior is -R -P"
+msgstr ""
+
+msgid "The -H switch is optional. Naming a host (or several) to check is not."
+msgstr ""
+
+msgid ""
+"Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"
+msgstr ""
+
+msgid "packet loss. The default values should work well for most users."
+msgstr ""
+
+msgid ""
+"You can specify different RTA factors using the standardized abbreviations"
+msgstr ""
+
+msgid ""
+"us (microseconds), ms (milliseconds, default) or just plain s for seconds."
+msgstr ""
+
+msgid "The -v switch can be specified several times for increased verbosity."
+msgstr ""
+
+#, fuzzy, c-format
+#~ msgid "%s - Plugin timed out after %d seconds\n"
+#~ msgstr "CRITICAL - Dokumentendatum ist %d Sekunden in der Zukunft\n"
+
+#, fuzzy
+#~ msgid "Critical Process Count must be an integer!"
+#~ msgstr "Critical threshold muss ein Integer sein"
+
+#, fuzzy
+#~ msgid "Warning Process Count must be an integer!"
+#~ msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+#~ msgid "CRITICAL - Cannot retrieve server certificate."
+#~ msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
+
+#~ msgid "CRITICAL - Cannot retrieve server certificate.\n"
+#~ msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
+
+#~ msgid "Invalid HTTP response received from host\n"
+#~ msgstr "Ungültige HTTP Antwort von Host empfangen\n"
+
+#~ msgid "Invalid HTTP response received from host on port %d\n"
+#~ msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
+
+#~ msgid "HTTP CRITICAL: %s\n"
+#~ msgstr "HTTP CRITICAL: %s\n"
+
+#~ msgid "HTTP WARNING: %s\n"
+#~ msgstr "HTTP WARNING: %s\n"
+
+#~ msgid "HTTP UNKNOWN"
+#~ msgstr "HTTP UNKNOWN"
+
+#~ msgid "HTTP OK"
+#~ msgstr "HTTP OK"
+
+#~ msgid "HTTP WARNING"
+#~ msgstr "HTTP WARNING"
+
+#~ msgid "HTTP CRITICAL"
+#~ msgstr "HTTP CRITICAL"
+
+#, fuzzy
+#~ msgid "HTTP OK %s - %.3f second response time %s|%s %s\n"
+#~ msgstr "HTTP OK %s - %.3f Sekunde Antwortzeit %s%s|%s %s\n"
+
+#~ msgid "HTTP CRITICAL - string not found%s|%s %s\n"
+#~ msgstr "HTTP CRITICAL - Text nicht gefunden%s|%s %s\n"
+
+#, fuzzy
+#~ msgid "HTTP UNKNOWN - could not allocate url\n"
+#~ msgstr "HTTP UNKNOWN - Konnte·url·nicht·zuweisen\n"
+
+#, fuzzy
+#~ msgid "snmpget returned an error status"
+#~ msgstr "dig hat einen Fehler zurückgegeben"
+
+#, fuzzy
+#~ msgid "Invalid critical threshold"
+#~ msgstr "Critical threshold muss ein Integer sein"
+
+#, fuzzy
+#~ msgid "Invalid warning threshold"
+#~ msgstr "Warning threshold Integer sein"
+
+#, fuzzy
+#~ msgid "HTTP WARNING: %s - %.3f second response time %s|%s %s\n"
+#~ msgstr "HTTP WARNING: %s - %.3f Sekunden Antwortzeit %s%s|%s %s\n"
+
+#, fuzzy
+#~ msgid "%s does not exist\n"
+#~ msgstr "%s [%s nicht gefunden]"
+
+#, fuzzy
+#~ msgid "Unknown error"
+#~ msgstr "Papierfehler"
+
+#, fuzzy
+#~ msgid "Unknown argument - %s"
+#~ msgstr ""
+#~ "%s: Unbekanntes Argument: %s\n"
+#~ "\n"
+
+#~ msgid ""
+#~ " -1, --proto1\n"
+#~ " tell ssh to use Protocol 1\n"
+#~ " -2, --proto2\n"
+#~ " tell ssh to use Protocol 2\n"
+#~ " -S, --skiplines=n\n"
+#~ " Ignore first n lines on STDERR (to suppress a logon banner)\n"
+#~ " -f\n"
+#~ " tells ssh to fork rather than create a tty\n"
+#~ msgstr ""
+#~ " -1, --proto1\n"
+#~ " ssh anweisen Protokoll 1 zu verwenden\n"
+#~ " -2, --proto2\n"
+#~ " ssh anweisen Protokoll 2 zu verwenden\n"
+#~ " -S, --skiplines=n\n"
+#~ " Ignoriere die ersten n Zeilen auf STDERR (um Logon Banner zu "
+#~ "unterdrücken)\n"
+#~ " -f\n"
+#~ " ssh anweisen fork zu nutzen statt ein tty zu erzeugen\n"
+
+#~ msgid ""
+#~ " -C, --command='COMMAND STRING'\n"
+#~ " command to execute on the remote machine\n"
+#~ " -l, --logname=USERNAME\n"
+#~ " SSH user name on remote host [optional]\n"
+#~ " -i, --identity=KEYFILE\n"
+#~ " identity of an authorized key [optional]\n"
+#~ " -O, --output=FILE\n"
+#~ " external command file for nagios [optional]\n"
+#~ " -s, --services=LIST\n"
+#~ " list of nagios service names, separated by ':' [optional]\n"
+#~ " -n, --name=NAME\n"
+#~ " short name of host in nagios configuration [optional]\n"
+#~ msgstr ""
+#~ " -C, --command='COMMAND STRING'\n"
+#~ " Befehl der auf der entfernten Maschine ausgeführt werden soll\n"
+#~ " -l, --logname=USERNAME\n"
+#~ " SSH user name auf dem entfernten Host [optional]\n"
+#~ " -i, --identity=KEYFILE\n"
+#~ " zu verwendende Schlüsseldatei [optional]\n"
+#~ " -O, --output=FILE\n"
+#~ " externe Befehlsdatei für nagios [optional]\n"
+#~ " -s, --services=LIST\n"
+#~ " Liste von nagios Servicenamen, getrennt durch ':' [optional]\n"
+#~ " -n, --name=NAME\n"
+#~ " Shortname des Hosts in der nagios Konfiguration [optional]\n"
+
+#, fuzzy
+#~ msgid "Warning inode threshold must be percentage!\n"
+#~ msgstr "Warning threshold muss ein Integer oder ein Prozentwert sein!\n"
+
+#, fuzzy
+#~ msgid "Critical inode threshold must be percentage!\n"
+#~ msgstr "Critical threshold muss ein Integer oder ein Prozentwert sein!\n"
+
+#~ msgid "INPUT ERROR: No thresholds specified"
+#~ msgstr "FEHLER: Kein Schwellwert angegeben"
+
+#~ msgid ""
+#~ "INPUT ERROR: C_DFP (%f) should be less than W_DFP (%.1f) and both should "
+#~ "be between zero and 100 percent, inclusive"
+#~ msgstr ""
+#~ "INPUT ERROR: C_DFP (%f) sollte kleiner sein als W_DFP (%.1f) und beide "
+#~ "sollten zwischen 0 und 100 Prozent liegen"
+
+#, fuzzy
+#~ msgid ""
+#~ "INPUT ERROR: C_IDFP (%f) should be less than W_IDFP (%.1f) and both "
+#~ "should be between zero and 100 percent, inclusive"
+#~ msgstr ""
+#~ "INPUT ERROR: C_DFP (%f) sollte kleiner sein als W_DFP (%.1f) und beide "
+#~ "sollten zwischen 0 und 100 Prozent liegen"
+
+#~ msgid ""
+#~ "INPUT ERROR: C_DF (%lu) should be less than W_DF (%lu) and both should be "
+#~ "greater than zero"
+#~ msgstr ""
+#~ "INPUT ERROR: C_DF (%lu) sollte kleiner sein als W_DF (%lu) und beide "
+#~ "sollten größer als 0 sein"
+
+#, fuzzy
+#~ msgid "No response from host on port %d\n"
+#~ msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
+
+#, fuzzy
+#~ msgid "Invalid response received from host on port %d\n"
+#~ msgstr "Ungültige HTTP Antwort von Host erhalten auf Port %d\n"
+
+#~ msgid "%.3f seconds response time (%s)"
+#~ msgstr "%.3f Sekunden Antwortzeit (%s)"
+
+#~ msgid ""
+#~ " -w, --warning=INTEGER\n"
+#~ " Exit with WARNING status if less than INTEGER --units of disk are "
+#~ "free\n"
+#~ " -w, --warning=PERCENT%%\n"
+#~ " Exit with WARNING status if less than PERCENT of disk space is free\n"
+#~ " -c, --critical=INTEGER\n"
+#~ " Exit with CRITICAL status if less than INTEGER --units of disk are "
+#~ "free\n"
+#~ " -c, --critical=PERCENT%%\n"
+#~ " Exit with CRITICAL status if less than PERCENT of disk space is free\n"
+#~ " -C, --clear\n"
+#~ " Clear thresholds\n"
+#~ msgstr ""
+#~ " -w, --warning=INTEGER\n"
+#~ " meldet Status WARNING, wenn weniger als INTEGER --Einheiten frei\n"
+#~ " -w, --warning=PERCENT%%\n"
+#~ " meldet Status WARNING, wenn weniger als PERCENT --Plattenplatz frei\n"
+#~ " -c, --critical=INTEGER\n"
+#~ " meldet Status CRITICAL, wenn weniger als INTEGER --Einheiten frei\n"
+#~ " -c, --critical=PERCENT%%\n"
+#~ " meldet Status CRITICAL, wenn weniger als PERCENT --Plattenplatz frei\n"
+#~ " -C, --clear\n"
+#~ " Schwellwerte löschen\n"
+
+#~ msgid ""
+#~ "Examples:\n"
+#~ " check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n"
+#~ " Checks /tmp and /var at 10%,5% and / at 100MB, 50MB\n"
+#~ msgstr ""
+#~ "Beispiel:\n"
+#~ " check_disk -w 10% -c 5% -p /tmp -p /var -C -w 100000 -c 50000 -p /\n"
+#~ " Prüft /tmp und /var mit 10%,5% und / mit 100MB, 50MB\n"
+
+#~ msgid ""
+#~ "This plugin uses the nslookup program to obtain the IP address\n"
+#~ "for the given host/domain query. A optional DNS server to use may\n"
+#~ "be specified. If no DNS server is specified, the default server(s)\n"
+#~ "specified in /etc/resolv.conf will be used.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "Dieses Plugin nutzt nslookup, um die IP-Adresse des angegebenen\n"
+#~ "Hosts zu erfragen. Optional kann ein DNS-Server angegeben werden\n"
+#~ "Wenn kein DNS-Server angegeben wird, so wird der Standardserver aus\n"
+#~ "/etc/resolv.conf genutzt.\n"
+#~ "\n"
+
+#~ msgid "HTTP CRITICAL - Could not make SSL connection\n"
+#~ msgstr "HTTP CRITICAL - Konnte keine SSL Verbindung herstellen\n"
+
+#~ msgid "Client Certificate Required\n"
+#~ msgstr "Clientzertifikat benötigt\n"
+
+#~ msgid "CRITICAL - Cannot create SSL context.\n"
+#~ msgstr "CRITICAL - Konnte SSL Kontext nicht erzeugen.\n"
+
+#~ msgid "CRITICAL - Cannot initiate SSL handshake.\n"
+#~ msgstr "CRITICAL - Konnte SSL Handshake nicht starten.\n"
+
+#, fuzzy
+#~ msgid "Failed to allocate memory for hostname"
+#~ msgstr "konnte keinen Speicher für '%s' reservieren\n"
+
+#, fuzzy
+#~ msgid "CRITICAL - %d of %d hosts are alive\n"
+#~ msgstr "CRITICAL - Serverdatum \"%100s\" konnte nicht verarbeitet werden"
+
+#, fuzzy
+#~ msgid "%s has no address data\n"
+#~ msgstr "Nameserver %s hat keine Datensätze\n"
+
+#, fuzzy
+#~ msgid "CRITICAL - Could not make SSL connection\n"
+#~ msgstr "HTTP CRITICAL - Konnte keine SSL Verbindung herstellen\n"
+
+#, fuzzy
+#~ msgid "Unexpected response from host: %s\n"
+#~ msgstr "Keine Antwort vom Host \n"
+
+#, fuzzy
+#~ msgid "Certificate expires today (%s).\n"
+#~ msgstr "Clientzertifikat benötigt\n"
+
+#, fuzzy
+#~ msgid "ERROR: Cannot create SSL context.\n"
+#~ msgstr "CRITICAL - Konnte SSL Kontext nicht erzeugen.\n"
+
+#, fuzzy
+#~ msgid "ERROR: Cannot retrieve server certificate.\n"
+#~ msgstr "CRITICAL - Konnte kein Serverzertifikat erhalten\n"
+
+#, fuzzy
+#~ msgid "ERROR: Cannot initiate SSL handshake.\n"
+#~ msgstr "CRITICAL - Konnte SSL Handshake nicht starten.\n"
+
+#~ msgid ""
+#~ "%s: Unknown argument: %s\n"
+#~ "\n"
+#~ msgstr ""
+#~ "%s: Unbekanntes Argument: %s\n"
+#~ "\n"
+
+#~ msgid "Critical time must be a nonnegative integer"
+#~ msgstr "Critical time muss ein positiver Integer sein"
+
+#~ msgid "Time interval must be a nonnegative integer"
+#~ msgstr "Time interval muss ein positiver Integer sein"
+
+#~ msgid "check_http: invalid option - SSL is not available\n"
+#~ msgstr "check_http: ungültige Option - SSL ist nicht verfügbar\n"
+
+#~ msgid "invalid hostname/address"
+#~ msgstr "Ungültige(r) Hostname/Adresse"
diff --git a/po/fr.gmo b/po/fr.gmo
new file mode 100644
index 0000000..d59d6cf
--- /dev/null
+++ b/po/fr.gmo
Binary files differ
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..40fbb67
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,5445 @@
+# translation of fr.po to
+# Messages français pour Nagios Plugins
+# Copyright (C) 2003-2023 Nagios Plugin Development Group
+# This file is distributed under the same license as the nagiosplug package.
+#
+# Karl DeBisschop <kdebisschop@users.sourceforge.net>, 2003.
+# Benoit Mortier <benoit.mortier@opensides.be>, 2004, 2006, 2007.
+# Thomas Guyot-Sionnest <dermoth@aei.ca>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: devel@monitoring-plugins.org\n"
+"POT-Creation-Date: 2023-10-01 15:10+0200\n"
+"PO-Revision-Date: 2010-04-21 23:38-0400\n"
+"Last-Translator: \n"
+"Language-Team: Monitoring Plugin Development Team <devel@monitoring-plugins."
+"org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: KBabel 1.11.4\n"
+
+msgid "Could not parse arguments"
+msgstr "Impossible de décomposer les arguments"
+
+msgid "Cannot catch SIGALRM"
+msgstr "Impossible d'obtenir le signal SIGALRM"
+
+#, fuzzy, c-format
+msgid "SSH connection failed: %s\n"
+msgstr "L'exécution de la commande à distance %s à échoué\n"
+
+#, c-format
+msgid "Remote command execution failed: %s\n"
+msgstr "L'exécution de la commande à distance %s à échoué\n"
+
+#, c-format
+msgid "%s - check_by_ssh: Remote command '%s' returned status %d\n"
+msgstr ""
+
+#, c-format
+msgid "SSH WARNING: could not open %s\n"
+msgstr "SSH AVERTISSEMENT: impossible d'ouvrir %s\n"
+
+#, c-format
+msgid "%s: Error parsing output\n"
+msgstr "%s: Erreur d'analyse du résultat\n"
+
+msgid "Timeout interval must be a positive integer"
+msgstr "Le délai d'attente doit être un entier positif"
+
+msgid "Port must be a positive integer"
+msgstr "Le numéro du port doit être un entier positif"
+
+msgid "skip-stdout argument must be an integer"
+msgstr "Le nombres de lignes à sauter (skip-stdout) doit être un entier"
+
+msgid "skip-stderr argument must be an integer"
+msgstr "Le nombres de lignes à sauter (skip-stderr) doit être un entier"
+
+#, c-format
+msgid "%s: You must provide a host name\n"
+msgstr "%s: Vous devez fournir un nom d'hôte\n"
+
+msgid "No remotecmd"
+msgstr "Pas de commande distante"
+
+#, c-format
+msgid "%s: Argument limit of %d exceeded\n"
+msgstr ""
+
+msgid "Can not (re)allocate 'commargv' buffer\n"
+msgstr "Impossible de réallouer le tampon 'commargv'\n"
+
+#, c-format
+msgid ""
+"%s: In passive mode, you must provide a service name for each command.\n"
+msgstr ""
+"%s: En mode passif, vous devez fournir un service pour chaque commande.\n"
+
+#, fuzzy, c-format
+msgid ""
+"%s: In passive mode, you must provide the host short name from the "
+"monitoring configs.\n"
+msgstr ""
+"%s: En mode passif, vous devez fournir le nom court du hôte mentionné dans "
+"la configuration de nagios.\n"
+
+#, c-format
+msgid "This plugin uses SSH to execute commands on a remote host"
+msgstr "Ce plugin utilise SSH pour exécuter des commandes sur un hôte distant"
+
+msgid "tell ssh to use Protocol 1 [optional]"
+msgstr "dire à ssh d'utiliser le protocole version 1 [optionnel]"
+
+msgid "tell ssh to use Protocol 2 [optional]"
+msgstr "dire à ssh d'utiliser le protocole 2 [optionnel]"
+
+msgid "Ignore all or (if specified) first n lines on STDOUT [optional]"
+msgstr ""
+
+msgid "Ignore all or (if specified) first n lines on STDERR [optional]"
+msgstr ""
+
+msgid "Exit with an warning, if there is an output on STDERR"
+msgstr ""
+
+msgid ""
+"tells ssh to fork rather than create a tty [optional]. This will always "
+"return OK if ssh is executed"
+msgstr ""
+
+msgid "command to execute on the remote machine"
+msgstr "commande à exécuter sur la machine distante"
+
+msgid "SSH user name on remote host [optional]"
+msgstr "Nom d'utilisateur ssh sur la machine distante [optionnel]"
+
+msgid "identity of an authorized key [optional]"
+msgstr "Identité de la clé autorisée [optionnel]"
+
+#, fuzzy
+msgid "external command file for monitoring [optional]"
+msgstr "commande externe pour nagios [optionnel]"
+
+#, fuzzy
+msgid "list of monitoring service names, separated by ':' [optional]"
+msgstr "liste des services nagios, séparés par ':' [optionnel] "
+
+#, fuzzy
+msgid "short name of host in the monitoring configuration [optional]"
+msgstr "nom court de l'hôte dans la configuration nagios [optionnel]"
+
+msgid "Call ssh with '-o OPTION' (may be used multiple times) [optional]"
+msgstr ""
+"appelle ssh avec '-o OPTION' (peut être utilisé plusieurs fois) [optionnel]"
+
+#, fuzzy
+msgid "Tell ssh to use this configfile [optional]"
+msgstr "dire à ssh d'utiliser le protocole version 1 [optionnel]"
+
+msgid "Tell ssh to suppress warning and diagnostic messages [optional]"
+msgstr ""
+"dire à ssh de supprimer les messages d'erreurs et de diagnostic [optionnel]"
+
+msgid "Make connection problems return UNKNOWN instead of CRITICAL"
+msgstr ""
+
+msgid "The most common mode of use is to refer to a local identity file with"
+msgstr ""
+
+msgid "the '-i' option. In this mode, the identity pair should have a null"
+msgstr ""
+
+msgid "passphrase and the public key should be listed in the authorized_keys"
+msgstr ""
+
+msgid "file of the remote host. Usually the key will be restricted to running"
+msgstr ""
+
+msgid "only one command on the remote server. If the remote SSH server tracks"
+msgstr ""
+
+msgid "invocation arguments, the one remote program may be an agent that can"
+msgstr ""
+
+msgid "execute additional commands as proxy"
+msgstr ""
+
+msgid "To use passive mode, provide multiple '-C' options, and provide"
+msgstr "Pour utiliser le mode passif, utilisez plusieurs fois l'option '-C',et"
+
+msgid ""
+"all of -O, -s, and -n options (servicelist order must match '-C'options)"
+msgstr ""
+"et les options -O, -s, n (l'ordre des services doit correspondre aux "
+"multiples options '-C)"
+
+msgid "Examples:"
+msgstr "Exemples:"
+
+msgid "Usage:"
+msgstr "Utilisation:"
+
+#, fuzzy, c-format
+msgid "Host/Service Cluster Plugin for Monitoring"
+msgstr "Plugin de Cluster d'Hôte/Service pour Nagios 2"
+
+msgid "Options:"
+msgstr "Options:"
+
+msgid "Check service cluster status"
+msgstr "Vérifie l'état d'un cluster de services"
+
+msgid "Check host cluster status"
+msgstr "Vérifie l'état d'un cluster d'hôtes"
+
+msgid "Optional prepended text output (i.e. \"Host cluster\")"
+msgstr "Texte optionnel accolé à la sortie (i.e. \"Cluster d'hôtes\")"
+
+msgid "Specifies the range of hosts or services in cluster that must be in a"
+msgstr "Défini le nombre d'hôtes ou de services du cluster qui doivent être"
+
+msgid "non-OK state in order to return a WARNING status level"
+msgstr "dans un état non-OK pour retourner un état AVERTISSEMENT"
+
+msgid "non-OK state in order to return a CRITICAL status level"
+msgstr "dans un état non-OK pour retourner un état CRITIQUE"
+
+msgid "The status codes of the hosts or services in the cluster, separated by"
+msgstr "Les codes d'état des hôtes ou des services du cluster, séparés par des"
+
+msgid "commas"
+msgstr "virgules"
+
+msgid "Notes:"
+msgstr "Notes:"
+
+msgid ""
+"Will alert critical if there are 3 or more service data points in a non-OK"
+msgstr ""
+
+msgid "state."
+msgstr ""
+
+#, c-format
+msgid "Looking for: '%s'\n"
+msgstr "Recherche de: '%s'\n"
+
+msgid "dig returned an error status"
+msgstr "dig à renvoyé un état d'erreur"
+
+msgid "Server not found in ANSWER SECTION"
+msgstr "Le serveur n'a pas été trouvé dans l'ANSWER SECTION"
+
+msgid "No ANSWER SECTION found"
+msgstr "Pas d' ANSWER SECTION trouvé"
+
+msgid "Probably a non-existent host/domain"
+msgstr "Probablement un hôte/domaine inexistant"
+
+#, c-format
+msgid "Port must be a positive integer - %s"
+msgstr "Le numéro du port doit être un entier positif - %s"
+
+#, c-format
+msgid "Warning interval must be a positive integer - %s"
+msgstr "Le seuil d'avertissement doit être un entier positif - %s"
+
+#, c-format
+msgid "Critical interval must be a positive integer - %s"
+msgstr "Le seuil critique doit être un entier positif - %s"
+
+#, c-format
+msgid "Timeout interval must be a positive integer - %s"
+msgstr "Le délai d'attente doit être un entier positif - %s"
+
+#, fuzzy, c-format
+msgid "This plugin tests the DNS service on the specified host using dig"
+msgstr "Ce plugin teste le service DNS sur l'hôte spécifié en utilisant dig"
+
+msgid "Force dig to only use IPv4 query transport"
+msgstr ""
+
+msgid "Force dig to only use IPv6 query transport"
+msgstr ""
+
+msgid "Machine name to lookup"
+msgstr "Nom de machine à rechercher"
+
+msgid "Record type to lookup (default: A)"
+msgstr "Type d'enregistrement à rechercher (par défaut: A)"
+
+msgid ""
+"An address expected to be in the answer section. If not set, uses whatever"
+msgstr ""
+"Une adresse qui devrait se trouver dans la section réponce. Si omit, utilise"
+
+msgid "was in -l"
+msgstr "ce qui est passé au paramètre -l"
+
+msgid "Pass STRING as argument(s) to dig"
+msgstr ""
+
+#, c-format
+msgid "DISK %s: %s not found\n"
+msgstr "DISK %s: %s non trouvé\n"
+
+#, c-format
+msgid "CRITICAL"
+msgstr "CRITIQUE"
+
+#, c-format
+msgid "unit type %s not known\n"
+msgstr "unité de type %s inconnue\n"
+
+#, c-format
+msgid "failed allocating storage for '%s'\n"
+msgstr "Impossible d'allouer de l'espace pour '%s'\n"
+
+#, c-format
+msgid "UNKNOWN"
+msgstr "INCONNU"
+
+msgid "Must set a threshold value before using -p\n"
+msgstr ""
+
+msgid "Could not compile regular expression"
+msgstr "Impossible de compiler l'expression rationnelle"
+
+msgid "Must set -E before selecting paths\n"
+msgstr ""
+
+msgid "Must set group value before selecting paths\n"
+msgstr ""
+
+msgid ""
+"Paths need to be selected before using -i/-I. Use -A to select all paths "
+"explicitly"
+msgstr ""
+
+msgid ""
+"Must set a threshold value before using -r/-R/-A (--ereg-path/--eregi-path/--"
+"all)\n"
+msgstr ""
+
+msgid "Regular expression did not match any path or disk"
+msgstr ""
+
+msgid "Unknown argument"
+msgstr "Argument inconnu"
+
+#, c-format
+msgid " for %s\n"
+msgstr " pour %s\n"
+
+msgid ""
+"This plugin checks the amount of used disk space on a mounted file system"
+msgstr "Ce plugin vérifie la place utilisé sur un système de fichier monté"
+
+msgid ""
+"and generates an alert if free space is less than one of the threshold values"
+msgstr ""
+"et génère une alerte si la place disponible est plus petite qu'un des seuils "
+"fourni"
+
+msgid "Exit with WARNING status if less than INTEGER units of disk are free"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si moins de X unités de disques sont "
+"libres"
+
+msgid "Exit with WARNING status if less than PERCENT of disk space is free"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si moins de X pour-cent du disque est "
+"libre"
+
+msgid "Exit with CRITICAL status if less than INTEGER units of disk are free"
+msgstr ""
+"Sortir avec un résultat CRITIQUE si moins de X unités du disque sont libres"
+
+#, fuzzy
+msgid "Exit with CRITICAL status if less than PERCENT of disk space is free"
+msgstr ""
+"Sortir avec un résultat CRITIQUE si moins de X pour-cent du disque est libre"
+
+msgid "Exit with WARNING status if less than PERCENT of inode space is free"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si moins de X pour-cent des inodes "
+"sont libres"
+
+msgid "Exit with CRITICAL status if less than PERCENT of inode space is free"
+msgstr ""
+"Sortir avec un résultat CRITIQUE si moins de X pour-cent des inodes sont "
+"libres"
+
+msgid ""
+"Mount point or block device as emitted by the mount(8) command (may be "
+"repeated)"
+msgstr ""
+
+msgid "Ignore device (only works if -p unspecified)"
+msgstr "Ignorer le périphérique (marche seulement lorsque -p est utilisé)"
+
+msgid "Clear thresholds"
+msgstr "Effacer les seuils"
+
+msgid "For paths or partitions specified with -p, only check for exact paths"
+msgstr ""
+
+msgid "Display only devices/mountpoints with errors"
+msgstr "Afficher seulement les périphériques/point de montage avec des erreurs"
+
+msgid "Don't account root-reserved blocks into freespace in perfdata"
+msgstr ""
+
+msgid "Display inode usage in perfdata"
+msgstr ""
+
+msgid ""
+"Group paths. Thresholds apply to (free-)space of all partitions together"
+msgstr ""
+
+msgid "Same as '--units kB'"
+msgstr "Pareil à '--units kB'"
+
+msgid "Only check local filesystems"
+msgstr "Vérifier seulement les systèmes de fichiers locaux"
+
+msgid ""
+"Only check local filesystems against thresholds. Yet call stat on remote "
+"filesystems"
+msgstr ""
+
+msgid "to test if they are accessible (e.g. to detect Stale NFS Handles)"
+msgstr ""
+
+#, fuzzy
+msgid "Display the (block) device instead of the mount point"
+msgstr "Afficher le point de montage au lieu de la partition"
+
+msgid "Same as '--units MB'"
+msgstr "Pareil à '--units MB'"
+
+msgid "Explicitly select all paths. This is equivalent to -R '.*'"
+msgstr ""
+
+msgid ""
+"Case insensitive regular expression for path/partition (may be repeated)"
+msgstr ""
+"Expression rationnelle indépendante de la case pour un répertoire ou une "
+"partition (peut être utilisé plusieurs fois)"
+
+msgid "Regular expression for path or partition (may be repeated)"
+msgstr ""
+"Expression rationnelle pour un répertoire ou une partition (peut être "
+"utilisé plusieurs fois)"
+
+msgid ""
+"Regular expression to ignore selected path/partition (case insensitive) (may "
+"be repeated)"
+msgstr ""
+"Expression rationnelle pour ignorer un répertoire ou une partition (peut "
+"être utilisé plusieurs fois)"
+
+msgid ""
+"Regular expression to ignore selected path or partition (may be repeated)"
+msgstr ""
+"Expression rationnelle pour ignorer un répertoire ou une partition (peut "
+"être utilisé plusieurs fois)"
+
+msgid ""
+"Return OK if no filesystem matches, filesystem does not exist or is "
+"inaccessible."
+msgstr ""
+
+msgid "(Provide this option before -p / -r / --ereg-path if used)"
+msgstr ""
+
+msgid "Choose bytes, kB, MB, GB, TB (default: MB)"
+msgstr "Choisissez octets, kb, MB, GB, TB (par défaut: MB)"
+
+#, fuzzy
+msgid ""
+"Ignore all filesystems of types matching given regex(7) (may be repeated)"
+msgstr ""
+"Ignorer tout les systèmes de fichiers qui correspondent au type indiqué "
+"(peut être utilisé plusieurs fois)"
+
+#, fuzzy
+msgid ""
+"Check only filesystems where the type matches this given regex(7) (may be "
+"repeated)"
+msgstr ""
+"Ignorer tout les systèmes de fichiers qui correspondent au type indiqué "
+"(peut être utilisé plusieurs fois)"
+
+msgid "General usage hints:"
+msgstr ""
+
+msgid ""
+"- Arguments are positional! \"-w 5 -c 1 -p /foo -w6 -c2 -p /bar\" is not the "
+"same as"
+msgstr ""
+
+msgid "\"-w 5 -c 1 -p /bar w6 -c2 -p /foo\"."
+msgstr ""
+
+msgid ""
+"- The syntax is broadly: \"{thresholds a} {paths a} -C {thresholds b} "
+"{thresholds b} ...\""
+msgstr ""
+
+msgid "Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"
+msgstr "Vérifie /tmp à 10% et /var à 5% et / à 100MB et 50MB"
+
+msgid ""
+"Checks all filesystems not matching -r at 100M and 50M. The fs matching the -"
+"r regex"
+msgstr ""
+
+msgid ""
+"are grouped which means the freespace thresholds are applied to all disks "
+"together"
+msgstr ""
+
+msgid ""
+"Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use "
+"100M/50M"
+msgstr ""
+
+#, c-format
+msgid "%s %s: %s\n"
+msgstr ""
+
+msgid "is not accessible"
+msgstr ""
+
+msgid "nslookup returned an error status"
+msgstr "nslookup à retourné un code d'erreur"
+
+msgid "Warning plugin error"
+msgstr "Alerte erreur de plugin"
+
+#, fuzzy, c-format
+msgid "DNS CRITICAL - '%s' returned empty server string\n"
+msgstr "DNS CRITIQUE - '%s' à retourné un nom d'hôte vide\n"
+
+#, fuzzy, c-format
+msgid "DNS CRITICAL - No response from DNS %s\n"
+msgstr "Pas de réponse du DNS %s\n"
+
+#, c-format
+msgid "DNS CRITICAL - '%s' returned empty host name string\n"
+msgstr "DNS CRITIQUE - '%s' à retourné un nom d'hôte vide\n"
+
+msgid "Non-authoritative answer:"
+msgstr "Réponse non autoritative:"
+
+#, fuzzy, c-format
+msgid "Domain '%s' was not found by the server\n"
+msgstr "Le domaine %s n'a pas été trouvé par le serveur\n"
+
+#, c-format
+msgid "DNS CRITICAL - '%s' msg parsing exited with no address\n"
+msgstr "DNS CRITIQUE - '%s' n'a pas retourné d'adresse\n"
+
+#, c-format
+msgid "expected '%s' but got '%s'"
+msgstr "j'attendais '%s' mais j'ai reçu '%s'"
+
+#, fuzzy, c-format
+msgid "Domain '%s' was found by the server: '%s'\n"
+msgstr "Le domaine %s n'a pas été trouvé par le serveur\n"
+
+#, c-format
+msgid "server %s is not authoritative for %s"
+msgstr "serveur %s n'est pas autoritaire pour %s"
+
+#, c-format
+msgid "OK"
+msgstr "OK"
+
+#, c-format
+msgid "WARNING"
+msgstr "AVERTISSEMENT"
+
+#, c-format
+msgid "%.3f second response time"
+msgid_plural "%.3f seconds response time"
+msgstr[0] "%.3f secondes de temps de réponse "
+msgstr[1] "%.3f secondes de temps de réponse "
+
+#, c-format
+msgid ". %s returns %s"
+msgstr ". %s renvoie %s"
+
+#, c-format
+msgid "DNS WARNING - %s\n"
+msgstr "DNS AVERTISSEMENT - %s\n"
+
+msgid " Probably a non-existent host/domain"
+msgstr " Probablement un hôte/domaine inexistant"
+
+#, c-format
+msgid "DNS CRITICAL - %s\n"
+msgstr "DNS CRITIQUE - %s\n"
+
+#, c-format
+msgid "DNS UNKNOWN - %s\n"
+msgstr "DNS INCONNU - %s\n"
+
+msgid "Note: nslookup is deprecated and may be removed from future releases."
+msgstr ""
+"Note: nslookup est obsolète et pourra être retiré dans les prochaines "
+"versions."
+
+msgid "Consider using the `dig' or `host' programs instead. Run nslookup with"
+msgstr ""
+"Veuillez utiliser le programme 'dig' ou 'host' à la place. Faire fonctionner "
+"nslookup avec"
+
+msgid "the `-sil[ent]' option to prevent this message from appearing."
+msgstr "L'option '-sil[ent]' empêche l'apparition de ce message."
+
+#, c-format
+msgid "No response from DNS %s\n"
+msgstr "Pas de réponse du DNS %s\n"
+
+#, c-format
+msgid "DNS %s has no records\n"
+msgstr "Le DNS %s n'a pas d'enregistrements\n"
+
+#, c-format
+msgid "Connection to DNS %s was refused\n"
+msgstr "La connexion au DNS %s à été refusée\n"
+
+#, c-format
+msgid "Query was refused by DNS server at %s\n"
+msgstr "La requête à été refusée par le serveur DNS %s\n"
+
+#, c-format
+msgid "No information returned by DNS server at %s\n"
+msgstr "Pas d'information renvoyée par le serveur DNS %s\n"
+
+msgid "Network is unreachable\n"
+msgstr "Le réseau est inaccessible\n"
+
+#, c-format
+msgid "DNS failure for %s\n"
+msgstr "DNS à échoué pour %s\n"
+
+msgid "Input buffer overflow\n"
+msgstr "Le tampon d'entrée a débordé\n"
+
+msgid ""
+"This plugin uses the nslookup program to obtain the IP address for the given "
+"host/domain query."
+msgstr ""
+"Ce plugin utilise le programme nslookup pour obtenir l'adresse IP de l'hôte/"
+"domaine à interroger."
+
+msgid "An optional DNS server to use may be specified."
+msgstr "Un serveur DNS à utiliser peut être indiqué."
+
+msgid ""
+"If no DNS server is specified, the default server(s) specified in /etc/"
+"resolv.conf will be used."
+msgstr ""
+"Si aucun serveur DNS n'est spécifié, les serveurs spécifiés dans /etc/resolv."
+"conf seront utilisé."
+
+msgid "The name or address you want to query"
+msgstr "Le nom ou l'adresse que vous voulez interroger"
+
+msgid "Optional DNS server you want to use for the lookup"
+msgstr "Serveur DNS que vous voulez utiliser pour la recherche"
+
+#, fuzzy
+msgid ""
+"Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end"
+msgstr ""
+"Adresse IP que le serveur DNS doit retourner. Les hôtes doivent se terminer "
+
+#, fuzzy
+msgid ""
+"with a dot (.). This option can be repeated multiple times (Returns OK if any"
+msgstr "avec un point (.). Cette option peut être répétée (Retourne OK si une"
+
+msgid "value matches)."
+msgstr ""
+
+msgid ""
+"Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)"
+msgstr ""
+
+msgid "Cannot be used together with -a"
+msgstr ""
+
+msgid "Optionally expect the DNS server to be authoritative for the lookup"
+msgstr "Serveur DNS qui doit normalement être autoritaire pour la recherche"
+
+msgid "Return warning if elapsed time exceeds value. Default off"
+msgstr ""
+"Renvoie une alerte si le temps écoulé dépasse la valeur indiquée. Désactivé "
+"par défaut"
+
+msgid "Return critical if elapsed time exceeds value. Default off"
+msgstr ""
+"Renvoie critique si le temps utilisé dépasse la valeur indiquée. Désactivé "
+"par défaut"
+
+msgid ""
+"Return critical if the list of expected addresses does not match all "
+"addresses"
+msgstr ""
+
+msgid "returned. Default off"
+msgstr ""
+
+msgid "Arguments to check_dummy must be an integer"
+msgstr "Les arguments pour check_dummy doivent être des entiers"
+
+#, c-format
+msgid "Status %d is not a supported error state\n"
+msgstr "Le résultat %d n'est pas un résultat supporté\n"
+
+msgid ""
+"This plugin will simply return the state corresponding to the numeric value"
+msgstr ""
+"Ce plugin renverra simplement l'état correspondant à la valeur numérique"
+
+msgid "of the <state> argument with optional text"
+msgstr "du paramètre <state> avec un texte optionnel"
+
+#, c-format
+msgid "Could not open pipe: %s\n"
+msgstr "Impossible d'ouvrir le pipe: %s\n"
+
+#, c-format
+msgid "Could not open stderr for %s\n"
+msgstr "Impossible d'ouvrir la sortie d'erreur standard pour %s\n"
+
+#, fuzzy
+msgid "FPING UNKNOWN - IP address not found\n"
+msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
+
+msgid "FPING UNKNOWN - invalid commandline argument\n"
+msgstr ""
+
+#, fuzzy
+msgid "FPING UNKNOWN - failed system call\n"
+msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
+
+#, fuzzy, c-format
+msgid "FPING %s - %s (rta=%f ms)|%s\n"
+msgstr "FPING %s - %s (perte=%.0f%% )|%s\n"
+
+#, c-format
+msgid "FPING UNKNOWN - %s not found\n"
+msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
+
+#, c-format
+msgid "FPING CRITICAL - %s is unreachable\n"
+msgstr "PING CRITIQUE - Hôte inaccessible (%s)\n"
+
+#, fuzzy, c-format
+msgid "FPING UNKNOWN - %s parameter error\n"
+msgstr "PING INCONNU - Hôte non trouvé (%s)\n"
+
+#, c-format
+msgid "FPING CRITICAL - %s is down\n"
+msgstr "FPING CRITIQUE - %s est en panne\n"
+
+#, c-format
+msgid "FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"
+msgstr "FPING %s - %s (perte=%.0f%%, rta=%f ms)|%s %s\n"
+
+#, c-format
+msgid "FPING %s - %s (loss=%.0f%% )|%s\n"
+msgstr "FPING %s - %s (perte=%.0f%% )|%s\n"
+
+msgid "Invalid hostname/address"
+msgstr "Adresse/Nom d'hôte invalide"
+
+msgid "IPv6 support not available\n"
+msgstr "Support IPv6 non disponible\n"
+
+msgid "Packet size must be a positive integer"
+msgstr "La taille du paquet doit être un entier positif"
+
+msgid "Packet count must be a positive integer"
+msgstr "Le nombre de paquets doit être un entier positif"
+
+msgid "Target timeout must be a positive integer"
+msgstr "Le seuil d'avertissement doit être un entier positif"
+
+msgid "Interval must be a positive integer"
+msgstr "Le délai d'attente doit être un entier positif"
+
+msgid "Hostname was not supplied"
+msgstr "Le nom de l'hôte n'a pas été spécifié"
+
+#, c-format
+msgid "%s: Only one threshold may be packet loss (%s)\n"
+msgstr ""
+"%s: Seulement un seuil peut être utilisé pour les pertes de paquets (%s)\n"
+
+#, c-format
+msgid "%s: Only one threshold must be packet loss (%s)\n"
+msgstr ""
+"%s: Seulement un seuil doit être utilisé pour les pertes de paquets (%s)\n"
+
+msgid ""
+"This plugin will use the fping command to ping the specified host for a fast "
+"check"
+msgstr ""
+"Ce plugin va utiliser la commande fping pour pinger l'hôte de manière rapide."
+
+msgid "Note that it is necessary to set the suid flag on fping."
+msgstr ""
+"Veuillez noter qu'il est nécessaire de mettre le bit suid sur le programme "
+"fping."
+
+msgid ""
+"name or IP Address of host to ping (IP Address bypasses name lookup, "
+"reducing system load)"
+msgstr ""
+"nom ou adresse IP des hôtes à pinger (l'indication d'un adresse IP évite une "
+"recherche sur le nom, ce qui réduit la charge système)"
+
+msgid "warning threshold pair"
+msgstr "Valeurs pour le seuil d'avertissement"
+
+msgid "critical threshold pair"
+msgstr "Valeurs pour le seuil critique"
+
+msgid "Return OK after first successful reply"
+msgstr ""
+
+msgid "size of ICMP packet"
+msgstr "taille du paquet ICMP"
+
+msgid "number of ICMP packets to send"
+msgstr "nombre de paquets ICMP à envoyer"
+
+msgid "Target timeout (ms)"
+msgstr ""
+
+msgid "Interval (ms) between sending packets"
+msgstr ""
+
+msgid "name or IP Address of sourceip"
+msgstr ""
+
+msgid "source interface name"
+msgstr ""
+
+#, c-format
+msgid ""
+"THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time "
+"(ms)"
+msgstr ""
+"Le seuil est <rta>,<pl>%% ou <rta> est le temps moyen pour l'aller retour "
+"(ms)"
+
+msgid ""
+"which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"
+msgstr ""
+"qui déclenche résultat AVERTISSEMENT ou CRITIQUE, et <pl> est le pourcentage "
+"de"
+
+msgid "packet loss to trigger an alarm state."
+msgstr "paquets perdu pour déclencher une alarme."
+
+msgid "IPv4 is used by default. Specify -6 to use IPv6."
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Host type parameter incorrect!\n"
+msgstr "CRITIQUE - Argument de type hôte incorrect!\n"
+
+#, c-format
+msgid "CRITICAL - Host not found\n"
+msgstr "CRITIQUE - Hôte non trouvé\n"
+
+#, c-format
+msgid "CRITICAL - Game server down or unavailable\n"
+msgstr "CRITIQUE - Serveur de jeux en panne ou non disponible\n"
+
+#, c-format
+msgid "CRITICAL - Game server timeout\n"
+msgstr "CRITIQUE - Temps d'attente pour le serveur de jeux dépassé\n"
+
+#, c-format
+msgid "This plugin tests game server connections with the specified host."
+msgstr "Le plugin teste la connexion au serveur de jeux avec l'hôte spécifié."
+
+msgid "Optional port of which to connect"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains game name"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains map name"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains ping time"
+msgstr ""
+
+msgid ""
+"This plugin uses the 'qstat' command, the popular game server status query "
+"tool."
+msgstr ""
+"Ce plugin utilise la commande 'qstat', un programme répandu pour questioner "
+"les serveurs de jeux."
+
+msgid ""
+"If you don't have the package installed, you will need to download it from"
+msgstr ""
+"Si vous n'avez pas le programme installé, vous devrez le télécharger depuis"
+
+#, fuzzy
+msgid "https://github.com/multiplay/qstat before you can use this plugin."
+msgstr ""
+"http://www.activesw.com/people/steve/qstat.html avant de pouvoir utiliser ce "
+"plugin."
+
+msgid "Paper Jam"
+msgstr "Bourrage Papier"
+
+msgid "Out of Paper"
+msgstr "Plus de Papier"
+
+msgid "Printer Offline"
+msgstr "Imprimante hors ligne"
+
+msgid "Peripheral Error"
+msgstr "Erreur du périphérique"
+
+msgid "Intervention Required"
+msgstr "Intervention Requise"
+
+msgid "Toner Low"
+msgstr "Toner Faible"
+
+msgid "Insufficient Memory"
+msgstr "Mémoire Insuffisante"
+
+msgid "A Door is Open"
+msgstr "Une porte est ouverte"
+
+msgid "Output Tray is Full"
+msgstr "Le bac de sortie est plein"
+
+msgid "Data too Slow for Engine"
+msgstr "Le données arrivent trop lentement pour l'imprimante"
+
+msgid "Unknown Paper Error"
+msgstr "Erreur de papier inconnue"
+
+#, c-format
+msgid "Printer ok - (%s)\n"
+msgstr "Imprimante ok - (%s)\n"
+
+#, fuzzy
+msgid "Port must be a positive short integer"
+msgstr "Le numéro du port doit être un entier positif"
+
+msgid "This plugin tests the STATUS of an HP printer with a JetDirect card."
+msgstr "Ce plugin teste l'état d'une imprimante HP avec une carte JetDirect."
+
+msgid "Net-snmp must be installed on the computer running the plugin."
+msgstr "Net-snmp doit être installé sur l'ordinateur qui exécute le plugin."
+
+msgid "The SNMP community name "
+msgstr "Le nom de la communauté SNMP "
+
+#, c-format
+msgid "(default=%s)"
+msgstr "(défaut=%s)"
+
+#, fuzzy
+msgid "Specify the port to check "
+msgstr "Nom de l'hôte à vérifier"
+
+#, fuzzy
+msgid "Disable paper check "
+msgstr "Variable a vérifier"
+
+msgid "file does not exist or is not readable"
+msgstr ""
+
+msgid "Invalid certificate expiration period"
+msgstr "Période d'expiration du certificat invalide"
+
+msgid ""
+"Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional "
+"'+' suffix)"
+msgstr ""
+
+msgid "Invalid option - SSL is not available"
+msgstr "Option invalide - SSL n'est pas disponible"
+
+msgid "Invalid max_redirs count"
+msgstr ""
+
+msgid "Invalid onredirect option"
+msgstr ""
+
+#, c-format
+msgid "option f:%d \n"
+msgstr "option f:%d \n"
+
+msgid "Invalid port number"
+msgstr "Numéro de port invalide"
+
+#, c-format
+msgid "Could Not Compile Regular Expression: %s"
+msgstr "Impossible de compiler l'expression rationnelle: %s"
+
+msgid "IPv6 support not available"
+msgstr "Support IPv6 non disponible"
+
+msgid "You must specify a server address or host name"
+msgstr "Vous devez spécifier une adresse ou un nom d'hôte"
+
+msgid ""
+"If you use a client certificate you must also specify a private key file"
+msgstr ""
+
+msgid "HTTP UNKNOWN - Memory allocation error\n"
+msgstr "HTTP INCONNU - Impossible d'allouer la mémoire\n"
+
+#, c-format
+msgid "%sServer date unknown, "
+msgstr "%sDate du serveur inconnue, "
+
+#, c-format
+msgid "%sDocument modification date unknown, "
+msgstr "%sDate de modification du document inconnue, "
+
+#, c-format
+msgid "%sServer date \"%100s\" unparsable, "
+msgstr "%sDate du serveur \"%100s\" illisible, "
+
+#, c-format
+msgid "%sDocument date \"%100s\" unparsable, "
+msgstr "%sDate du document \"%100s\" illisible, "
+
+#, c-format
+msgid "%sDocument is %d seconds in the future, "
+msgstr "%sLa date du document est %d secondes dans le futur, "
+
+#, c-format
+msgid "%sLast modified %.1f days ago, "
+msgstr "%sDernière modification %.1f jours auparavant, "
+
+#, c-format
+msgid "%sLast modified %d:%02d:%02d ago, "
+msgstr "%sDernière modification %d:%02d:%02d auparavant, "
+
+msgid "HTTP CRITICAL - Unable to open TCP socket\n"
+msgstr "HTTP CRITIQUE - Impossible d'ouvrir un socket TCP\n"
+
+#, fuzzy
+msgid "HTTP UNKNOWN - Could not allocate memory for full_page\n"
+msgstr "HTTP INCONNU - Impossible d'allouer une adresse\n"
+
+msgid "HTTP CRITICAL - Error on receive\n"
+msgstr "HTTP CRITIQUE - Erreur dans la réception\n"
+
+msgid "HTTP CRITICAL - No data received from host\n"
+msgstr "HTTP CRITIQUE - Pas de données reçues de l'hôte\n"
+
+#, c-format
+msgid "Invalid HTTP response received from host: %s\n"
+msgstr "Réponse HTTP reçue de l'hôte invalide: %s\n"
+
+#, c-format
+msgid "Invalid HTTP response received from host on port %d: %s\n"
+msgstr "Réponse HTTP reçue de l'hôte sur le port %d invalide: %s\n"
+
+#, c-format
+msgid ""
+"%s\n"
+"%s"
+msgstr ""
+
+#, c-format
+msgid "Status line output matched \"%s\" - "
+msgstr "La ligne d'état correspond à \"%s\" - "
+
+#, c-format
+msgid "HTTP CRITICAL: Invalid Status Line (%s)\n"
+msgstr "HTTP CRITIQUE: Ligne d'état non valide (%s)\n"
+
+#, c-format
+msgid "HTTP CRITICAL: Invalid Status (%s)\n"
+msgstr "HTTP CRITIQUE: Etat Invalide (%s)\n"
+
+#, c-format
+msgid "%s - "
+msgstr ""
+
+#, fuzzy, c-format
+msgid "%sheader '%s' not found on '%s://%s:%d%s', "
+msgstr "%schaîne non trouvée, "
+
+#, fuzzy, c-format
+msgid "%sstring '%s' not found on '%s://%s:%d%s', "
+msgstr "%schaîne non trouvée, "
+
+#, c-format
+msgid "%spattern not found, "
+msgstr "%sexpression non trouvée, "
+
+#, c-format
+msgid "%spattern found, "
+msgstr "%sexpression trouvée, "
+
+#, c-format
+msgid "%sExecute Error: %s, "
+msgstr "%sErreur d'exécution: %s, "
+
+#, c-format
+msgid "%spage size %d too large, "
+msgstr "%sla taille de la page est trop grande (%d), "
+
+#, c-format
+msgid "%spage size %d too small, "
+msgstr "%sla taille de la page est trop petite (%d), "
+
+#, fuzzy, c-format
+msgid "%s - %d bytes in %.3f second response time %s|%s %s %s %s %s %s %s"
+msgstr "%s - %d octets en %.3f secondes de temps de réponse %s|%s %s"
+
+#, c-format
+msgid "%s - %d bytes in %.3f second response time %s|%s %s"
+msgstr "%s - %d octets en %.3f secondes de temps de réponse %s|%s %s"
+
+msgid "HTTP UNKNOWN - Could not allocate addr\n"
+msgstr "HTTP INCONNU - Impossible d'allouer une adresse\n"
+
+msgid "HTTP UNKNOWN - Could not allocate URL\n"
+msgstr "HTTP INCONNU - Impossible d'allouer l'URL\n"
+
+#, c-format
+msgid "HTTP UNKNOWN - Could not find redirect location - %s%s\n"
+msgstr ""
+"HTTP INCONNU - Impossible de trouver l'endroit de la redirection - %s%s\n"
+
+#, c-format
+msgid "HTTP UNKNOWN - Empty redirect location%s\n"
+msgstr "HTTP INCONNU - endroit de redirection vide%s\n"
+
+#, c-format
+msgid "HTTP UNKNOWN - Could not parse redirect location - %s%s\n"
+msgstr ""
+"HTTP INCONNU - Impossible de définir l'endroit de la redirection - %s%s\n"
+
+#, c-format
+msgid "HTTP WARNING - maximum redirection depth %d exceeded - %s://%s:%d%s%s\n"
+msgstr ""
+"HTTP AVERTISSEMENT - le niveau maximum de redirection %d à été dépassé - "
+"%s://%s:%d%s%s\n"
+
+#, fuzzy, c-format
+msgid "HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"
+msgstr ""
+"HTTP AVERTISSEMENT - la redirection crée une boucle infinie - %s://%s:%d%s"
+"%s\n"
+
+#, c-format
+msgid "HTTP UNKNOWN - Redirection to port above %d - %s://%s:%d%s%s\n"
+msgstr "HTTP INCONNU - Redirection à un port supérieur à %d - %s://%s:%d%s%s\n"
+
+#, c-format
+msgid "Redirection to %s://%s:%d%s\n"
+msgstr "Redirection vers %s://%s:%d%s\n"
+
+msgid "This plugin tests the HTTP service on the specified host. It can test"
+msgstr ""
+"Ce plugin teste le service HTTP sur l'hôte spécifié. Il peut tester les"
+
+msgid "normal (http) and secure (https) servers, follow redirects, search for"
+msgstr ""
+"serveurs normaux (http) et sécurisés (https), suivre les redirections, "
+"rechercher des"
+
+msgid "strings and regular expressions, check connection times, and report on"
+msgstr ""
+"chaînes de caractères et expressions rationnelles, vérifier le temps de "
+"réponse"
+
+msgid "certificate expiration times."
+msgstr "et rapporter la date d'expiration du certificat."
+
+#, c-format
+msgid "In the first form, make an HTTP request."
+msgstr ""
+
+#, c-format
+msgid ""
+"In the second form, connect to the server and check the TLS certificate."
+msgstr ""
+
+#, c-format
+msgid "NOTE: One or both of -H and -I must be specified"
+msgstr "NOTE: les paramètres -H et -I peuvent être spécifiés"
+
+msgid "Host name argument for servers using host headers (virtual host)"
+msgstr ""
+
+msgid "Append a port to include it in the header (eg: example.com:5000)"
+msgstr ""
+
+msgid ""
+"IP address or name (use numeric address if possible to bypass DNS lookup)."
+msgstr ""
+
+msgid "Port number (default: "
+msgstr "Numéro du port (défaut: "
+
+msgid ""
+"Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"
+msgstr ""
+
+msgid "auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"
+msgstr ""
+
+msgid "1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted."
+msgstr ""
+
+msgid "Enable SSL/TLS hostname extension support (SNI)"
+msgstr ""
+
+msgid ""
+"Minimum number of days a certificate has to be valid. Port defaults to 443"
+msgstr ""
+"Nombre de jours minimum pour que le certificat soit valide. Port par défaut "
+"443"
+
+msgid ""
+"(when this option is used the URL is not checked by default. You can use"
+msgstr ""
+
+msgid " --continue-after-certificate to override this behavior)"
+msgstr ""
+
+msgid ""
+"Allows the HTTP check to continue after performing the certificate check."
+msgstr ""
+
+msgid "Does nothing unless -C is used."
+msgstr ""
+
+msgid "Name of file that contains the client certificate (PEM format)"
+msgstr ""
+
+msgid "to be used in establishing the SSL session"
+msgstr ""
+
+msgid "Name of file containing the private key (PEM format)"
+msgstr ""
+
+msgid "matching the client certificate"
+msgstr ""
+
+msgid "Comma-delimited list of strings, at least one of them is expected in"
+msgstr ""
+"Liste the chaines de charactères séparées par des virgules, au moins une "
+"d'elles"
+
+msgid "the first (status) line of the server response (default: "
+msgstr "est attendue dans la première ligne de réponse du serveur (défaut: "
+
+msgid ""
+"If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"
+msgstr ""
+"Si spécifié, surpasse toute autre logique de status (ex: 3xx, 4xx, 5xx)"
+
+#, fuzzy
+msgid "String to expect in the response headers"
+msgstr "Chaîne de caractères à attendre en réponse"
+
+msgid "String to expect in the content"
+msgstr "Chaîne de caractère attendue dans le contenu"
+
+msgid "URL to GET or POST (default: /)"
+msgstr "URL pour le GET ou le POST (défaut: /)"
+
+msgid "URL encoded http POST data"
+msgstr ""
+
+msgid "Set HTTP method."
+msgstr ""
+
+msgid "Don't wait for document body: stop reading after headers."
+msgstr ""
+"Ne pas attendre pour le corps du document: arrêter de lire après les entêtes"
+
+msgid "(Note that this still does an HTTP GET or POST, not a HEAD.)"
+msgstr "(Veuillez noter qu'un HTTP GET ou POST est effectué, pas un HEAD.)"
+
+msgid "Warn if document is more than SECONDS old. the number can also be of"
+msgstr ""
+
+msgid "the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."
+msgstr ""
+
+msgid "specify Content-Type header media type when POSTing\n"
+msgstr ""
+
+msgid "Allow regex to span newlines (must precede -r or -R)"
+msgstr ""
+
+msgid "Search page for regex STRING"
+msgstr ""
+
+msgid "Search page for case-insensitive regex STRING"
+msgstr ""
+
+msgid "Return CRITICAL if found, OK if not\n"
+msgstr ""
+
+msgid "Username:password on sites with basic authentication"
+msgstr ""
+
+msgid "Username:password on proxy-servers with basic authentication"
+msgstr ""
+
+msgid "String to be sent in http header as \"User Agent\""
+msgstr ""
+
+msgid ""
+"Any other tags to be sent in http header. Use multiple times for additional "
+"headers"
+msgstr ""
+
+msgid "Print additional performance data"
+msgstr ""
+
+msgid "Print body content below status line"
+msgstr ""
+
+msgid "Wrap output in HTML link (obsoleted by urlize)"
+msgstr ""
+
+msgid "How to handle redirected pages. sticky is like follow but stick to the"
+msgstr ""
+
+msgid "specified IP address. stickyport also ensures port stays the same."
+msgstr ""
+
+#, fuzzy
+msgid "Maximal number of redirects (default: "
+msgstr "PROCS - nombre de processus (défaut)"
+
+msgid "Minimum page size required (bytes) : Maximum page size required (bytes)"
+msgstr ""
+
+msgid "This plugin will attempt to open an HTTP connection with the host."
+msgstr "Ce plugin va essayer d'ouvrir un connexion SMTP avec l'hôte."
+
+msgid ""
+"Successful connects return STATE_OK, refusals and timeouts return "
+"STATE_CRITICAL"
+msgstr ""
+
+msgid ""
+"other errors return STATE_UNKNOWN. Successful connects, but incorrect "
+"response"
+msgstr ""
+
+msgid ""
+"messages from the host result in STATE_WARNING return values. If you are"
+msgstr ""
+
+msgid ""
+"checking a virtual server that uses 'host headers' you must supply the FQDN"
+msgstr ""
+
+msgid "(fully qualified domain name) as the [host_name] argument."
+msgstr ""
+
+msgid "This plugin can also check whether an SSL enabled web server is able to"
+msgstr ""
+
+msgid "serve content (optionally within a specified time) or whether the X509 "
+msgstr ""
+
+msgid "certificate is still valid for the specified number of days."
+msgstr ""
+
+#, fuzzy
+msgid "Please note that this plugin does not check if the presented server"
+msgstr "Ce plugin vérifie le service ntp sur l'hôte"
+
+msgid "certificate matches the hostname of the server, or if the certificate"
+msgstr ""
+
+msgid "has a valid chain of trust to one of the locally installed CAs."
+msgstr ""
+
+msgid ""
+"When the 'www.verisign.com' server returns its content within 5 seconds,"
+msgstr ""
+
+msgid ""
+"a STATE_OK will be returned. When the server returns its content but exceeds"
+msgstr ""
+
+msgid ""
+"the 5-second threshold, a STATE_WARNING will be returned. When an error "
+"occurs,"
+msgstr ""
+
+msgid "a STATE_CRITICAL will be returned."
+msgstr ""
+
+msgid ""
+"When the certificate of 'www.verisign.com' is valid for more than 14 days,"
+msgstr ""
+
+msgid ""
+"a STATE_OK is returned. When the certificate is still valid, but for less "
+"than"
+msgstr ""
+
+msgid ""
+"14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"
+msgstr ""
+
+msgid "the certificate is expired."
+msgstr "le certificat est expiré."
+
+msgid ""
+"When the certificate of 'www.verisign.com' is valid for more than 30 days,"
+msgstr ""
+
+msgid "30 days, but more than 14 days, a STATE_WARNING is returned."
+msgstr ""
+
+msgid ""
+"A STATE_CRITICAL will be returned when certificate expires in less than 14 "
+"days"
+msgstr ""
+
+msgid ""
+"check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j "
+"CONNECT -H www.verisign.com "
+msgstr ""
+
+msgid ""
+"all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -"
+"S(sl) -j CONNECT -H <webserver>"
+msgstr ""
+
+msgid ""
+"a STATE_CRITICAL will be returned. By adding a colon to the method you can "
+"set the method used"
+msgstr ""
+
+msgid "inside the proxied connection: -j CONNECT:POST"
+msgstr ""
+
+#, c-format
+msgid "Could not connect to the server at port %i\n"
+msgstr "Impossible de se connecter au serveur port %i\n"
+
+#, c-format
+msgid "Could not set protocol version %d\n"
+msgstr "Impossible d'utiliser le protocole version %d\n"
+
+#, c-format
+msgid "Could not init TLS at port %i!\n"
+msgstr "Impossible d'initialiser TLS sur le port %i!\n"
+
+#, c-format
+msgid "TLS not supported by the libraries!\n"
+msgstr "TLS n'est pas supporté!\n"
+
+#, c-format
+msgid "Could not init startTLS at port %i!\n"
+msgstr "Impossible d'initialiser startTLS sur le port %i!\n"
+
+#, c-format
+msgid "startTLS not supported by the library, needs LDAPv3!\n"
+msgstr ""
+"startTLS n'est pas supporté par la librairie LDAP, j'ai besoin de LDAPv3!\n"
+
+#, c-format
+msgid "Could not bind to the LDAP server\n"
+msgstr "Impossible de se connecter au serveur LDAP\n"
+
+#, c-format
+msgid "Could not search/find objectclasses in %s\n"
+msgstr "Impossible de chercher/trouver les objectclasses dans %s\n"
+
+#, fuzzy, c-format
+msgid "LDAP %s - found %d entries in %.3f seconds|%s %s\n"
+msgstr "%s - %d octets en %.3f secondes de temps de réponse %s|%s %s"
+
+#, c-format
+msgid "LDAP %s - %.3f seconds response time|%s\n"
+msgstr "LDAP %s - %.3f secondes de temps de réponse|%s\n"
+
+#, c-format
+msgid "%s cannot be combined with %s"
+msgstr ""
+
+msgid "Please specify the host name\n"
+msgstr "Veuillez spécifier le nom de l'hôte\n"
+
+msgid "Please specify the LDAP base\n"
+msgstr "Veuillez spécifier la base LDAP\n"
+
+msgid "ldap attribute to search (default: \"(objectclass=*)\""
+msgstr ""
+
+msgid "ldap base (eg. ou=my unit, o=my org, c=at"
+msgstr ""
+
+msgid "ldap bind DN (if required)"
+msgstr ""
+
+msgid ""
+"ldap password (if required, or set the password through environment variable "
+"'LDAP_PASSWORD')"
+msgstr ""
+
+msgid "use starttls mechanism introduced in protocol version 3"
+msgstr "utiliser le fonctionnement starttls du protocole version 3"
+
+msgid "use ldaps (ldap v2 ssl method). this also sets the default port to"
+msgstr ""
+
+msgid "use ldap protocol version 2"
+msgstr "utiliser le protocole ldap version 2"
+
+msgid "use ldap protocol version 3"
+msgstr "utiliser le protocole ldap version 3"
+
+msgid "default protocol version:"
+msgstr "version du protocole par défaut:"
+
+#, fuzzy
+msgid "Number of found entries to result in warning status"
+msgstr "Décalage résultant en un avertissement (secondes)"
+
+#, fuzzy
+msgid "Number of found entries to result in critical status"
+msgstr "Décalage résultant en un état critique (secondes)"
+
+msgid "If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"
+msgstr ""
+
+#, c-format
+msgid ""
+" implied (using default port %i) unless --port=636 is specified. In that "
+"case\n"
+msgstr ""
+
+msgid "'SSL on connect' will be used no matter how the plugin was called."
+msgstr ""
+
+msgid ""
+"This detection is deprecated, please use 'check_ldap' with the '--starttls' "
+"or '--ssl' flags"
+msgstr ""
+
+msgid "to define the behaviour explicitly instead."
+msgstr ""
+
+msgid "The parameters --warn-entries and --crit-entries are optional."
+msgstr ""
+
+msgid "Warning threshold must be float or float triplet!\n"
+msgstr "Le seuil d'alerte doit être un nombre à virgule flottante!\n"
+
+#, c-format
+msgid "Error opening %s\n"
+msgstr "Erreur à l'ouverture de %s\n"
+
+#, fuzzy, c-format
+msgid "could not parse load from uptime %s: %d\n"
+msgstr "Lecture des arguments impossible\n"
+
+#, c-format
+msgid "Error code %d returned in %s\n"
+msgstr "Le code erreur %d à été retourné par %s\n"
+
+#, c-format
+msgid "Error in getloadavg()\n"
+msgstr "Erreur dans la fonction getloadavg()\n"
+
+#, c-format
+msgid "Error processing %s\n"
+msgstr "Erreur lors de l'utilisation de %s\n"
+
+#, c-format
+msgid "load average: %.2f, %.2f, %.2f"
+msgstr "Charge moyenne: %.2f, %.2f, %.2f"
+
+#, c-format
+msgid "Critical threshold for %d-minute load average is not specified\n"
+msgstr ""
+"Le seuil critique pour la charge système après %d minutes n'est pas "
+"spécifié\n"
+
+#, c-format
+msgid "Warning threshold for %d-minute load average is not specified\n"
+msgstr ""
+"Le seuil d'avertissement pour la charge système après %d minutes n'est pas "
+"spécifié\n"
+
+#, c-format
+msgid ""
+"Parameter inconsistency: %d-minute \"warning load\" is greater than "
+"\"critical load\"\n"
+msgstr ""
+"Arguments Incorrects: %d-minute \"alerte charge système\" est plus grand que "
+"\"alerte critique charge système\"\n"
+
+#, c-format
+msgid "This plugin tests the current system load average."
+msgstr "Ce plugin teste la charge système actuelle."
+
+msgid "Exit with WARNING status if load average exceeds WLOADn"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si la charge moyenne dépasse WLOAD"
+
+msgid "Exit with CRITICAL status if load average exceed CLOADn"
+msgstr "Sortir avec un résultat CRITIQUE si la charge moyenne excède CLOAD"
+
+msgid "the load average format is the same used by \"uptime\" and \"w\""
+msgstr ""
+
+msgid "Divide the load averages by the number of CPUs (when possible)"
+msgstr ""
+
+msgid "Number of processes to show when printing the top consuming processes."
+msgstr ""
+
+msgid "NUMBER_OF_PROCS=0 disables this feature. Default value is 0"
+msgstr ""
+
+#, c-format
+msgid "'%s' exited with non-zero status.\n"
+msgstr ""
+
+#, c-format
+msgid "some error occurred getting procs list.\n"
+msgstr ""
+
+msgid "Could not parse arguments\n"
+msgstr "Lecture des arguments impossible\n"
+
+#, c-format
+msgid "Unable to open MRTG log file\n"
+msgstr "Impossible d'ouvrir le fichier de log de MRTG\n"
+
+#, c-format
+msgid "Unable to process MRTG log file\n"
+msgstr "Impossible de traiter le fichier de log de MRTG\n"
+
+#, c-format
+msgid "MRTG data has expired (%d minutes old)\n"
+msgstr "Les données de MRTG on expirées (vieilles de %d minutes)\n"
+
+msgid "Avg"
+msgstr "Moyenne"
+
+msgid "Max"
+msgstr "Max"
+
+msgid "Invalid variable number"
+msgstr "Numéro de la variable invalide"
+
+#, c-format
+msgid ""
+"%s is not a valid expiration time\n"
+"Use '%s -h' for additional help\n"
+msgstr ""
+"%s n'est pas un temps d'expiration valide\n"
+"Utilisez '%s -h' pour de l'aide supplémentaire\n"
+
+msgid "Invalid variable number\n"
+msgstr "Numéro de la variable invalide\n"
+
+msgid "You must supply the variable number"
+msgstr "Vous devez fournir le numéro de la variable"
+
+msgid ""
+"This plugin will check either the average or maximum value of one of the"
+msgstr "Ce plugin va vérifier la moyenne ou le maximum d'une "
+
+msgid "two variables recorded in an MRTG log file."
+msgstr "deux variables du fichier de log de MRTG."
+
+msgid "The MRTG log file containing the data you want to monitor"
+msgstr ""
+
+msgid "Minutes before MRTG data is considered to be too old"
+msgstr ""
+
+msgid "Should we check average or maximum values?"
+msgstr ""
+
+msgid "Which variable set should we inspect? (1 or 2)"
+msgstr ""
+
+msgid "Threshold value for data to result in WARNING status"
+msgstr ""
+
+msgid "Threshold value for data to result in CRITICAL status"
+msgstr ""
+
+msgid "Type label for data (Examples: Conns, \"Processor Load\", In, Out)"
+msgstr ""
+
+msgid "Option units label for data (Example: Packets/Sec, Errors/Sec,"
+msgstr ""
+
+#, c-format
+msgid "\"Bytes Per Second\", \"%% Utilization\")"
+msgstr ""
+
+msgid ""
+"If the value exceeds the <vwl> threshold, a WARNING status is returned. If"
+msgstr ""
+
+msgid ""
+"the value exceeds the <vcl> threshold, a CRITICAL status is returned. If"
+msgstr ""
+
+msgid "the data in the log file is older than <expire_minutes> old, a WARNING"
+msgstr ""
+
+msgid "status is returned and a warning message is printed."
+msgstr ""
+
+msgid ""
+"This plugin is useful for monitoring MRTG data that does not correspond to"
+msgstr ""
+
+msgid ""
+"bandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth)."
+msgstr ""
+
+msgid ""
+"It can be used to monitor any kind of data that MRTG is monitoring - errors,"
+msgstr ""
+
+msgid ""
+"packets/sec, etc. I use MRTG in conjunction with the Novell NLM that allows"
+msgstr ""
+
+msgid ""
+"me to track processor utilization, user connections, drive space, etc and"
+msgstr ""
+
+msgid "this plugin works well for monitoring that kind of data as well."
+msgstr ""
+
+msgid ""
+"- This plugin only monitors one of the two variables stored in the MRTG log"
+msgstr ""
+"- Ce plugin vérifie seulement une ou deux variables écrites dans un fichier "
+"de log MRTG"
+
+msgid "file. If you want to monitor both values you will have to define two"
+msgstr ""
+
+msgid "commands with different values for the <variable> argument. Of course,"
+msgstr ""
+
+msgid "you can always hack the code to make this plugin work for you..."
+msgstr ""
+
+msgid ""
+"- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded "
+"from"
+msgstr ""
+
+msgid "Unable to open MRTG log file"
+msgstr "Impossible d'ouvrir le fichier de log de MRTG"
+
+msgid "Unable to process MRTG log file"
+msgstr "Impossible de traiter le fichier de log de MRTG"
+
+#, fuzzy, c-format
+msgid "%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"
+msgstr "%s. Entrée = %0.1f %s, %s. Sortie = %0.1f %s|%s %s\n"
+
+#, c-format
+msgid "Traffic %s - %s\n"
+msgstr "Trafic %s - %s\n"
+
+msgid ""
+"This plugin will check the incoming/outgoing transfer rates of a router,"
+msgstr ""
+"Ce plugin va vérifier le taux de transfert en entrée/sortie d'un routeur,"
+
+msgid "switch, etc recorded in an MRTG log. If the newest log entry is older"
+msgstr ""
+
+msgid "than <expire_minutes>, a WARNING status is returned. If either the"
+msgstr ""
+
+msgid "incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"
+msgstr ""
+
+msgid "Bytes/sec), a CRITICAL status results. If either of the rates exceed"
+msgstr ""
+
+msgid "the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."
+msgstr ""
+
+msgid "File to read log from"
+msgstr ""
+
+msgid "Minutes after which log expires"
+msgstr ""
+
+msgid "Test average or maximum"
+msgstr ""
+
+msgid "Warning threshold pair <incoming>,<outgoing>"
+msgstr "Paire de seuils d'avertissement <entrant>,<sortant>"
+
+msgid "Critical threshold pair <incoming>,<outgoing>"
+msgstr "Paire de seuils critique <entrant>,<sortant>"
+
+msgid ""
+"- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"
+msgstr ""
+
+msgid "- While MRTG can monitor things other than traffic rates, this"
+msgstr ""
+
+msgid " plugin probably won't work with much else without modification."
+msgstr ""
+
+msgid "- The calculated i/o rates are a little off from what MRTG actually"
+msgstr ""
+
+msgid " reports. I'm not sure why this is right now, but will look into it"
+msgstr ""
+
+msgid " for future enhancements of this plugin."
+msgstr ""
+
+#, c-format
+msgid "Usage"
+msgstr "Utilisation"
+
+#, fuzzy, c-format
+msgid "status store_result error: %s\n"
+msgstr "erreur slave store_result: %s\n"
+
+#, c-format
+msgid "slave query error: %s\n"
+msgstr "erreur de requête de l'esclave: %s\n"
+
+#, c-format
+msgid "slave store_result error: %s\n"
+msgstr "erreur slave store_result: %s\n"
+
+msgid "No slaves defined"
+msgstr "Pas d'esclave spécifié"
+
+#, c-format
+msgid "slave fetch row error: %s\n"
+msgstr "erreur esclave lecture d'une ligne: %s\n"
+
+#, c-format
+msgid "Slave running: %s"
+msgstr "L'esclave fonctionne: %s"
+
+msgid "This program tests connections to a MySQL server"
+msgstr "Ce plugin teste une connexion vers un serveur MySQL"
+
+msgid "Ignore authentication failure and check for mysql connectivity only"
+msgstr ""
+
+msgid "Use the specified socket (has no effect if -H is used)"
+msgstr ""
+
+msgid "Check database with indicated name"
+msgstr ""
+
+msgid "Read from the specified client options file"
+msgstr ""
+
+msgid "Use a client options group"
+msgstr ""
+
+msgid "Connect using the indicated username"
+msgstr ""
+
+msgid "Use the indicated password to authenticate the connection"
+msgstr ""
+
+msgid "IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"
+msgstr ""
+
+msgid "Your clear-text password could be visible as a process table entry"
+msgstr ""
+
+msgid "Check if the slave thread is running properly."
+msgstr ""
+
+msgid "Exit with WARNING status if slave server is more than INTEGER seconds"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si le serveur esclave est plus de X "
+
+msgid "behind master"
+msgstr "secondes en retard sur le maître"
+
+msgid "Exit with CRITICAL status if slave server is more then INTEGER seconds"
+msgstr "Sortir avec un résultat CRITIQUE si le serveur esclave est plus de X "
+
+msgid "Use ssl encryption"
+msgstr ""
+
+msgid "Path to CA signing the cert"
+msgstr ""
+
+msgid "Path to SSL certificate"
+msgstr ""
+
+msgid "Path to private SSL key"
+msgstr ""
+
+msgid "Path to CA directory"
+msgstr ""
+
+msgid "List of valid SSL ciphers"
+msgstr ""
+
+msgid ""
+"There are no required arguments. By default, the local database is checked"
+msgstr ""
+"Il n'y a pas d'arguments nécessaires. Par défaut la base de donnée locale "
+"est testée"
+
+msgid ""
+"using the default unix socket. You can force TCP on localhost by using an"
+msgstr ""
+
+msgid "IP address or FQDN ('localhost' will use the socket as well)."
+msgstr ""
+
+msgid "You must specify -p with an empty string to force an empty password,"
+msgstr ""
+
+msgid "overriding any my.cnf settings."
+msgstr ""
+
+msgid "Cannot open status log for reading!"
+msgstr "Impossible d'ouvrir le fichier status log en lecture!"
+
+#, c-format
+msgid "Found process: %s %s\n"
+msgstr "Processus trouvé: %s %s\n"
+
+msgid "Could not locate a running Nagios process!"
+msgstr "Impossible de trouver un processus Nagios actif!"
+
+msgid "Cannot parse Nagios log file for valid time"
+msgstr ""
+"Impossible de trouver une date/heure valide dans le fichier de log de Nagios"
+
+#, c-format
+msgid "%d process"
+msgid_plural "%d processes"
+msgstr[0] "%d processus"
+msgstr[1] "%d processus"
+
+#, c-format
+msgid "status log updated %d second ago"
+msgid_plural "status log updated %d seconds ago"
+msgstr[0] "status log mis à jour %d secondes auparavant"
+msgstr[1] "status log mis à jour %d secondes auparavant"
+
+msgid "Expiration time must be an integer (seconds)\n"
+msgstr "Le délai d'expiration doit être un entier (en secondes)\n"
+
+#, fuzzy
+msgid "Timeout must be an integer (seconds)\n"
+msgstr "Le délai d'expiration doit être un entier (en secondes)\n"
+
+msgid "You must provide the status_log\n"
+msgstr "Vous devez fournir le status_log\n"
+
+msgid "You must provide a process string\n"
+msgstr "Vous devez fournir un nom de processus\n"
+
+msgid ""
+"This plugin checks the status of the Nagios process on the local machine"
+msgstr "Ce plugin vérifie l'état du processus Nagios sur la machine locale."
+
+msgid ""
+"The plugin will check to make sure the Nagios status log is no older than"
+msgstr "Ce plugin vérifie que le status log de Nagios n'est pas plus vieux que"
+
+msgid "the number of minutes specified by the expires option."
+msgstr "le nombre de minutes spécifies par l'option expire."
+
+msgid ""
+"It also checks the process table for a process matching the command argument."
+msgstr ""
+
+msgid "Name of the log file to check"
+msgstr "Nom du fichier log à vérifier"
+
+msgid "Minutes aging after which logfile is considered stale"
+msgstr ""
+
+msgid "Substring to search for in process arguments"
+msgstr ""
+
+msgid "Timeout for the plugin in seconds"
+msgstr ""
+
+#, c-format
+msgid "Wrong client version - running: %s, required: %s"
+msgstr "Mauvaise version du client utilisée: %s, nécessaire: %s"
+
+msgid "missing -l parameters"
+msgstr "Arguments -l manquants"
+
+msgid "wrong -l parameter."
+msgstr "Arguments -l erronés."
+
+msgid "CPU Load"
+msgstr "Charge CPU"
+
+#, c-format
+msgid " %lu%% (%lu min average)"
+msgstr " %lu%% (%lu moyenne minimale)"
+
+#, c-format
+msgid " '%lu min avg Load'=%lu%%;%lu;%lu;0;100"
+msgstr " '%lu Charge moyenne minimale'=%lu%%;%lu;%lu;0;100"
+
+msgid "not enough values for -l parameters"
+msgstr "pas assez de valeur pour l'argument -l"
+
+msgid "wrong -l argument"
+msgstr "Argument -l erroné"
+
+#, fuzzy, c-format
+msgid "System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"
+msgstr "Système démarré - %u jour(s) %u heure(s) %u minute(s)"
+
+#, c-format
+msgid "%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"
+msgstr ""
+"%s:\\ - total: %.2f Gb - utilisé: %.2f Gb (%.0f%%) - libre %.2f Gb (%.0f%%)"
+
+#, c-format
+msgid "'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"
+msgstr "'%s:\\ Espace Utilisé'=%.2fGb;%.2f;%.2f;0.00;%.2f"
+
+msgid "Free disk space : Invalid drive"
+msgstr "Espace disque libre : Lecteur invalide"
+
+msgid "No service/process specified"
+msgstr "Pas de service/processus spécifié"
+
+msgid "could not fetch information from server\n"
+msgstr "Impossible d'obtenir l'information depuis le serveur\n"
+
+#, fuzzy, c-format
+msgid ""
+"Memory usage: total:%.2f MB - used: %.2f MB (%.0f%%) - free: %.2f MB (%.0f%%)"
+msgstr ""
+"Mémoire utilisée: total:%.2f Mb - utilisée: %.2f Mb (%.0f%%) - libre: %.2f "
+"Mb (%.0f%%)"
+
+#, fuzzy, c-format
+msgid "'Memory usage'=%.2fMB;%.2f;%.2f;0.00;%.2f"
+msgstr "'Mémoire utilisée'=%.2fMb;%.2f;%.2f;0.00;%.2f"
+
+msgid "No counter specified"
+msgstr "Pas de compteur spécifié"
+
+msgid "Minimum value contains non-numbers"
+msgstr "La valeur minimum contient des caractères non numériques"
+
+msgid "Maximum value contains non-numbers"
+msgstr "La valeur maximum contient des caractères non numériques"
+
+msgid "No unit counter specified"
+msgstr "Pas de compteur spécifié"
+
+msgid "Please specify a variable to check"
+msgstr "Veuillez préciser une variable a vérifier"
+
+msgid "Server port must be an integer\n"
+msgstr "Le port du serveur doit être un nombre entier\n"
+
+msgid "You must provide a server address or host name"
+msgstr "Vous devez spécifier une adresse ou un nom d'hôte"
+
+msgid "None"
+msgstr "Aucun"
+
+msgid "This plugin collects data from the NSClient service running on a"
+msgstr ""
+"Ce plugin collecte les données depuis le service NSClient tournant sur un"
+
+msgid "Windows NT/2000/XP/2003 server."
+msgstr "Serveur Windows NT/2000/XP/2003."
+
+msgid "Name of the host to check"
+msgstr "Nom de l'hôte à vérifier"
+
+msgid "Optional port number (default: "
+msgstr "Numéro de port optionnel (défaut: "
+
+msgid "Password needed for the request"
+msgstr "Mot de passe nécessaire pour la requête"
+
+msgid "Threshold which will result in a warning status"
+msgstr ""
+
+msgid "Threshold which will result in a critical status"
+msgstr ""
+
+msgid "Seconds before connection attempt times out (default: "
+msgstr ""
+
+msgid "Parameters passed to specified check (see below)"
+msgstr ""
+
+msgid "Display options (currently only SHOWALL works)"
+msgstr ""
+
+msgid "Return UNKNOWN on timeouts"
+msgstr ""
+
+msgid "Print this help screen"
+msgstr "Afficher l'écran d'aide"
+
+msgid "Print version information"
+msgstr "Afficher la version"
+
+msgid "Variable to check"
+msgstr "Variable a vérifier"
+
+msgid "Valid variables are:"
+msgstr "Les variables valides sont"
+
+msgid "Get the NSClient version"
+msgstr "Obtenir la version de NSClient"
+
+msgid "If -l <version> is specified, will return warning if versions differ."
+msgstr ""
+"si l'argument -l <version> est spécifié, une alerte AVERTISSEMENT sera "
+"renvoyée, si les versions sont différentes."
+
+msgid "Average CPU load on last x minutes."
+msgstr "Moyenne de la charge CPU sur les dernières x minutes."
+
+msgid "Request a -l parameter with the following syntax:"
+msgstr "Demande un paramètre -l avec la syntaxe suivante:"
+
+msgid "-l <minutes range>,<warning threshold>,<critical threshold>."
+msgstr "-l <plage de minutes>,<seuil d'avertissement>,<seuil critique>."
+
+msgid "<minute range> should be less than 24*60."
+msgstr "<plage de minutes> devrait être inférieur à 24*60."
+
+msgid ""
+"Thresholds are percentage and up to 10 requests can be done in one shot."
+msgstr ""
+"Les seuils sonts en pourcentage et un maximum de 10 requêtes peuvent être "
+"effectuées à la fois."
+
+msgid "Get the uptime of the machine."
+msgstr "Obtenir le temps de service de la machine."
+
+msgid "-l <unit> "
+msgstr ""
+
+msgid "<unit> = seconds, minutes, hours, or days. (default: minutes)"
+msgstr ""
+
+#, fuzzy
+msgid "Thresholds will use the unit specified above."
+msgstr "Ce plugin va vérifier l'heure sur l'hôte spécifié."
+
+msgid "Size and percentage of disk use."
+msgstr "Taille et pourcentage de l'utilisation disque."
+
+msgid "Request a -l parameter containing the drive letter only."
+msgstr "Demande un paramètre -l contennant uniquement la lettre du lecteur."
+
+msgid "Warning and critical thresholds can be specified with -w and -c."
+msgstr "Les seuils d'alerte et critiques peuvent être spécifiés avec -w et -c."
+
+msgid "Memory use."
+msgstr "Mémoire utilisée."
+
+msgid "Check the state of one or several services."
+msgstr "Vérifier l'état d'un ou plusieurs services."
+
+msgid "Request a -l parameters with the following syntax:"
+msgstr "Demande un paramètre -l avec la syntaxe suivante:"
+
+msgid "-l <service1>,<service2>,<service3>,..."
+msgstr "-l <service1>,<service2>,<service3>,..."
+
+msgid "You can specify -d SHOWALL in case you want to see working services"
+msgstr "Vous pouvez spécifier -d SHOWALL pour voir les services fonctionnant"
+
+msgid "in the returned string."
+msgstr "dans la chaîne de caractère renvoyée."
+
+msgid "Check if one or several process are running."
+msgstr "Vérifie si un ou plusieurs processus sont démarrés."
+
+msgid "Same syntax as SERVICESTATE."
+msgstr "Même syntaxe que SERVICESTATE."
+
+msgid "Check any performance counter of Windows NT/2000."
+msgstr "Vérifier n'importe quel compteur de performance sur Windows NT/2000."
+
+msgid "-l \"\\\\<performance object>\\\\counter\",\"<description>"
+msgstr "-l \"\\\\<catégorie>\\\\compteur\",\"<description>"
+
+msgid "The <description> parameter is optional and is given to a printf "
+msgstr "Le paramètre <description> est optionnel et est passé à la fonction "
+
+msgid "output command which requires a float parameter."
+msgstr "de sortie printf qui demande un paramètre de type float."
+
+#, c-format
+msgid "If <description> does not include \"%%\", it is used as a label."
+msgstr "Si <description> n'inclus pas \"%%\", il est utilisé comme étiquette."
+
+msgid "Some examples:"
+msgstr "Exemples:"
+
+msgid "Check any performance counter object of Windows NT/2000."
+msgstr "Vérifie n'importe quel compteur de performance de Windows NT/2000."
+
+msgid ""
+"Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>"
+msgstr ""
+
+msgid "<counter object> is a Windows Perfmon Counter object (eg. Process),"
+msgstr ""
+
+msgid "if it is two words, it should be enclosed in quotes"
+msgstr ""
+
+msgid "The returned results will be a comma-separated list of instances on "
+msgstr ""
+
+msgid " the selected computer for that object."
+msgstr ""
+
+msgid ""
+"The purpose of this is to be run from command line to determine what "
+"instances"
+msgstr ""
+
+msgid ""
+" are available for monitoring without having to log onto the Windows server"
+msgstr ""
+
+msgid " to run Perfmon directly."
+msgstr ""
+
+msgid ""
+"It can also be used in scripts that automatically create the monitoring "
+"service"
+msgstr ""
+
+msgid " configuration files."
+msgstr ""
+
+msgid "check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process"
+msgstr ""
+
+msgid ""
+"- The NSClient service should be running on the server to get any information"
+msgstr ""
+"- Le service NSClient doit rouler sur le serveur pour obtenir les "
+"informations"
+
+msgid "- Critical thresholds should be lower than warning thresholds"
+msgstr ""
+"- Les seuils critiques doivent être plus bas que les seuils d'avertissement"
+
+msgid "- Default port 1248 is sometimes in use by other services. The error"
+msgstr ""
+"- Le port par défaut 1248 est parfois utilisé par d'autres services. L'erreur"
+
+msgid ""
+"output when this happens contains \"Cannot map xxxxx to protocol number\"."
+msgstr "qui en résulte contiens \"Cannot map xxxxx to protocol number\"."
+
+msgid "One fix for this is to change the port to something else on check_nt "
+msgstr ""
+"Une possibilité pour corriger ce problème est de changer le port dans "
+"check_nt "
+
+msgid "and on the client service it's connecting to."
+msgstr "et dans le service auquel il se connecte."
+
+#, c-format
+msgid "jitter response too large (%lu bytes)\n"
+msgstr ""
+
+msgid "NTP CRITICAL:"
+msgstr "NTP CRITIQUE:"
+
+msgid "NTP WARNING:"
+msgstr "NTP AVERTISSEMENT:"
+
+msgid "NTP OK:"
+msgstr "NTP OK:"
+
+msgid "NTP UNKNOWN:"
+msgstr "NTP INCONNU:"
+
+msgid "Offset unknown"
+msgstr "Décalage inconnu"
+
+msgid "Offset"
+msgstr "Décalage"
+
+msgid "This plugin checks the selected ntp server"
+msgstr "Ce plugin vérifie le service ntp sur l'hôte"
+
+msgid "Offset to result in warning status (seconds)"
+msgstr "Décalage résultant en un avertissement (secondes)"
+
+msgid "Offset to result in critical status (seconds)"
+msgstr "Décalage résultant en un état critique (secondes)"
+
+msgid "Warning threshold for jitter"
+msgstr "Seuil d'avertissement pour la variation (jitter)"
+
+msgid "Critical threshold for jitter"
+msgstr "Seuil critique pour la variation (jitter)"
+
+msgid "Normal offset check:"
+msgstr "Vérification normale du décalage:"
+
+msgid ""
+"Check jitter too, avoiding critical notifications if jitter isn't available"
+msgstr ""
+"Vérifier aussi la variation (jitter) en évitant les notifications s'il n'est "
+"pas dispoible"
+
+msgid "(See Notes above for more details on thresholds formats):"
+msgstr ""
+"(Voir les Notes ci-dessus pour plus de détails sur le format des seuils)"
+
+msgid "WARNING: check_ntp is deprecated. Please use check_ntp_peer or"
+msgstr "ATTENTION: check_ntp est périmé, utilisez plutôt check_ntp_peer"
+
+msgid "check_ntp_time instead."
+msgstr "ou check_ntp_time."
+
+msgid "Server not synchronized"
+msgstr "Le serveur n'est pas synchronisé"
+
+msgid "Server has the LI_ALARM bit set"
+msgstr ""
+
+msgid ""
+"Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"
+msgstr ""
+"Retourne INCONNU au lieu de CRITIQUE ou AVERTISSEMENT si le serveur n'est "
+"pas synchronisé"
+
+#, fuzzy
+msgid "Warning threshold for stratum of server's synchronization peer"
+msgstr "Seuil d'avertissement pour le stratum"
+
+#, fuzzy
+msgid "Critical threshold for stratum of server's synchronization peer"
+msgstr "Seuil critique pour le stratum"
+
+msgid "Warning threshold for number of usable time sources (\"truechimers\")"
+msgstr ""
+"Seuil d'avertissement pour le nombre de sources de temps utilisable "
+"(\"truechimers\")"
+
+msgid "Critical threshold for number of usable time sources (\"truechimers\")"
+msgstr ""
+"Seuil critique pour le nombre de sources de temps utilisable (\"truechimers"
+"\")"
+
+msgid "This plugin checks an NTP server independent of any commandline"
+msgstr "Ce plugin vérifie un serveur NTP sans recours aux programmes de"
+
+msgid "programs or external libraries."
+msgstr "la ligne de commande ou libraries externes"
+
+msgid "Use this plugin to check the health of an NTP server. It supports"
+msgstr ""
+"Utilisez ce plugin pour vérifier le service NTP sur l'hôte. Il supporte la"
+
+msgid "checking the offset with the sync peer, the jitter and stratum. This"
+msgstr ""
+"vérification du décalage avec le pair se synchronisation, la variation "
+"(jitter) et le stratum."
+
+msgid "plugin will not check the clock offset between the local host and NTP"
+msgstr ""
+"Ce plugin ne vérifie pas le décalage entre le serveur local et le serveur"
+
+msgid "server; please use check_ntp_time for that purpose."
+msgstr "NTP; utilisez plutôt check_ntp_time à cette fin."
+
+msgid "Simple NTP server check:"
+msgstr "Vérification simple du serveur NTP:"
+
+msgid "Only check the number of usable time sources (\"truechimers\"):"
+msgstr ""
+
+msgid "Check only stratum:"
+msgstr "Vérification du stratum seulement:"
+
+msgid "This plugin checks the clock offset with the ntp server"
+msgstr "Ce plugin vérifie le décalage de l'horloge avec le serveur ntp"
+
+msgid "Returns UNKNOWN instead of CRITICAL if offset cannot be found"
+msgstr "Retourne INCONNU au lieu de CRITIQUE si le décalage est inconnu"
+
+msgid "Expected offset of the ntp server relative to local server (seconds)"
+msgstr ""
+
+msgid "This plugin checks the clock offset between the local host and a"
+msgstr "Ce plugin vérifie le décalage de l'horloge entre se serveur local et"
+
+msgid "remote NTP server. It is independent of any commandline programs or"
+msgstr "le serveur NTP distant. Il ne fait aucun recours aux programmes de"
+
+msgid "external libraries."
+msgstr "la ligne de commande ou libraries externes."
+
+msgid "If you'd rather want to monitor an NTP server, please use"
+msgstr "Si vous voulez plutôt surveiller un serveur NTP, veuillez"
+
+msgid "check_ntp_peer."
+msgstr "utiliser check_ntp_peer."
+
+msgid "--time-offset is useful for compensating for servers with known"
+msgstr ""
+
+msgid "and expected clock skew."
+msgstr ""
+
+#, c-format
+msgid "NetWare %s: "
+msgstr "NetWare %s: "
+
+#, c-format
+msgid "Up %s,"
+msgstr "Démarré %s,"
+
+#, c-format
+msgid "Load %s - %s %s-min load average = %lu%%|load%s=%lu;%lu;%lu;0;100"
+msgstr ""
+"Charge %s - %s %s charge système minimale = %lu%%|charge%s=%lu;%lu;%lu;0;100"
+
+#, c-format
+msgid "Conns %s - %lu current connections|Conns=%lu;%lu;%lu;;"
+msgstr "Conns %s - %lu connections actuelles|Conns=%lu;%lu;%lu;;"
+
+#, c-format
+msgid "%s: Long term cache hits = %lu%%"
+msgstr "%s: Accès cache longue durée = %lu%%"
+
+#, c-format
+msgid "%s: Total cache buffers = %lu|Cachebuffers=%lu;%lu;%lu;;"
+msgstr "%s: Total des caches tampons= %lu|Caches Tampons=%lu,%lu;%lu;;"
+
+#, c-format
+msgid "%s: Dirty cache buffers = %lu|Dirty-Cache-Buffers=%lu;%lu;%lu;;"
+msgstr "%s: cache tampons sales = %lu|caches tampons sales=%lu;%lu;%lu;;"
+
+#, c-format
+msgid "%s: LRU sitting time = %lu minutes"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Volume '%s' does not exist!"
+msgstr "CRITIQUE: Le volume '%s' n'existe pas!"
+
+#, c-format
+msgid "%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"
+msgstr "%s%lu KB libre sur le volume %s|KB libres%s=%lu;%lu;%lu;;"
+
+msgid "Only "
+msgstr "Seulement"
+
+#, c-format
+msgid "%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"
+msgstr "%s%lu MB libre sur le volume %s|MBlibre%s=%lu;%lu;%lu;;"
+
+#, c-format
+msgid "%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid ""
+"%lu MB (%lu%%) free on volume %s - total %lu MB|FreeMB%s=%lu;%lu;%lu;0;100"
+msgstr ""
+"%lu MB (%lu%%) libre sur le volume %s - total %lu MB|MBlibre%s=%lu;%lu;"
+"%lu;0;100"
+
+#, c-format
+msgid "Directory Services Database is %s (DS version %s)"
+msgstr "La base de données Directory Services est %s (DS version %s)"
+
+#, c-format
+msgid "Logins are %s"
+msgstr "Les logins sont %s"
+
+msgid "enabled"
+msgstr "activé"
+
+msgid "disabled"
+msgstr "désactivé"
+
+msgid "CRITICAL - NRM Status is bad!"
+msgstr "CRITIQUE - le statut NRM est mauvais!"
+
+msgid "Warning - NRM Status is suspect!"
+msgstr ""
+
+msgid "OK - NRM Status is good!"
+msgstr "OK - Le status du NRM est bon!"
+
+#, c-format
+msgid "%lu of %lu (%lu%%) packet receive buffers used"
+msgstr "%lu de %lu (%lu%%) paquets du tampon de réception utilisés"
+
+#, c-format
+msgid "%lu entries in SAP table"
+msgstr "%lu entrées dans la table SAP"
+
+#, c-format
+msgid "%lu entries in SAP table for SAP type %d"
+msgstr "%lu entrées dans la table SAP pour le type SAP %d"
+
+#, c-format
+msgid "%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
+msgstr "%s%lu KB effaçables sur le volume %s|Purge%s=%lu;%lu;%lu;;"
+
+#, c-format
+msgid "%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
+msgstr "%s%lu KB effaçables sur le volume %s|Purge%s=%lu;%lu;%lu;;"
+
+#, c-format
+msgid "%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"
+msgstr ""
+"%lu MB (%lu%%) effaçables sur le volume %s|Effacable%s=%lu;%lu;%lu;0;100"
+
+#, c-format
+msgid "%s%lu KB not yet purgeable on volume %s"
+msgstr "%s%lu KB pas encore effaçables sur le volume %s"
+
+#, c-format
+msgid "%lu MB (%lu%%) not yet purgeable on volume %s"
+msgstr "%lu MB (%lu%%) pas encore effaçables sur le volume %s"
+
+#, c-format
+msgid "%lu open files|Openfiles=%lu;%lu;%lu;0,0"
+msgstr ""
+
+#, c-format
+msgid "%lu abended threads|Abends=%lu;%lu;%lu;;"
+msgstr "%lu processus avortés|Avortés=%lu;%lu;%lu;;"
+
+#, c-format
+msgid "%lu current service processes (%lu max)|Processes=%lu;%lu;%lu;0;%lu"
+msgstr "%lu processus services actuels (%lu max)|Processus=%lu;%lu;%lu;0;%lu"
+
+msgid "CRITICAL - Time not in sync with network!"
+msgstr "CRITIQUE - Le temps n'est pas synchronisé avec le réseau!"
+
+msgid "OK - Time in sync with network!"
+msgstr "OK - Le temps est synchronisé avec le réseau!"
+
+#, c-format
+msgid "LRU sitting time = %lu seconds"
+msgstr "LRU temps d'attente = %lu secondes"
+
+#, c-format
+msgid "Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"
+msgstr "Buffers cache sales = %lu%% du total|DCB=%lu;%lu;%lu;0;100"
+
+#, c-format
+msgid "Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"
+msgstr "cache tampons totaux= %lu%% de l'original|TCB=%lu;%lu;%lu;0;100"
+
+#, c-format
+msgid "NDS Version %s"
+msgstr "Version NDS %s"
+
+#, c-format
+msgid "Up %s"
+msgstr "Démarré %s"
+
+#, c-format
+msgid "Module %s version %s is loaded"
+msgstr "Le Module %s version %s est chargé"
+
+#, c-format
+msgid "Module %s is not loaded"
+msgstr "Le Module %s n'est pas chargé"
+
+#, c-format
+msgid "CRITICAL - Value '%s' does not exist!"
+msgstr "CRITIQUE: Le valeur '%s' n'existe pas!"
+
+#, c-format
+msgid "%s is %lu|%s=%lu;%lu;%lu;;"
+msgstr "%s est %lu|%s=%lu;%lu;%lu;;"
+
+msgid "Nothing to check!\n"
+msgstr "Rien à vérifier!\n"
+
+msgid "Server port an integer\n"
+msgstr "Le port du serveur doit être un nombre entier\n"
+
+msgid "This plugin attempts to contact the MRTGEXT NLM running on a"
+msgstr "Ce plugin essaye de contacter le NLM MRTGEXT qui s'exécute sur"
+
+msgid "Novell server to gather the requested system information."
+msgstr "un serveur Novell pour récupérer l'information système demandée."
+
+msgid "Variable to check. Valid variables include:"
+msgstr "Variable à vérifier. Les variables valides sont:"
+
+msgid "LOAD1 = 1 minute average CPU load"
+msgstr ""
+
+msgid "LOAD5 = 5 minute average CPU load"
+msgstr ""
+
+msgid "LOAD15 = 15 minute average CPU load"
+msgstr ""
+
+msgid "CSPROCS = number of current service processes (NW 5.x only)"
+msgstr "CSPROCS = nombres de processus services actuels (NW 5.x seulement)"
+
+msgid "ABENDS = number of abended threads (NW 5.x only)"
+msgstr ""
+
+msgid "UPTIME = server uptime"
+msgstr ""
+
+msgid "LTCH = percent long term cache hits"
+msgstr ""
+
+msgid "CBUFF = current number of cache buffers"
+msgstr ""
+
+msgid "CDBUFF = current number of dirty cache buffers"
+msgstr ""
+
+msgid "DCB = dirty cache buffers as a percentage of the total"
+msgstr ""
+
+msgid "TCB = dirty cache buffers as a percentage of the original"
+msgstr ""
+
+msgid "OFILES = number of open files"
+msgstr ""
+
+msgid " VMF<vol> = MB of free space on Volume <vol>"
+msgstr ""
+
+msgid " VMU<vol> = MB used space on Volume <vol>"
+msgstr ""
+
+msgid " VMP<vol> = MB of purgeable space on Volume <vol>"
+msgstr ""
+
+msgid " VPF<vol> = percent free space on volume <vol>"
+msgstr ""
+
+msgid " VKF<vol> = KB of free space on volume <vol>"
+msgstr ""
+
+msgid " VPP<vol> = percent purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VKP<vol> = KB of purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VPNP<vol> = percent not yet purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VKNP<vol> = KB of not yet purgeable space on volume <vol>"
+msgstr ""
+
+msgid " LRUM = LRU sitting time in minutes"
+msgstr ""
+
+msgid " LRUS = LRU sitting time in seconds"
+msgstr " LRUS = LRU temps d'attente en secondes"
+
+msgid " DSDB = check to see if DS Database is open"
+msgstr ""
+
+msgid " DSVER = NDS version"
+msgstr ""
+
+msgid " UPRB = used packet receive buffers"
+msgstr " UPRB = paquets du tampon de réception utilisés"
+
+msgid " PUPRB = percent (of max) used packet receive buffers"
+msgstr ""
+
+msgid " SAPENTRIES = number of entries in the SAP table"
+msgstr ""
+
+msgid " SAPENTRIES<n> = number of entries in the SAP table for SAP type <n>"
+msgstr " SAPENTRIES<n> = entrées dans la table SAP pour le type SAP <n>"
+
+msgid " TSYNC = timesync status"
+msgstr ""
+
+msgid " LOGINS = check to see if logins are enabled"
+msgstr ""
+
+msgid " CONNS = number of currently licensed connections"
+msgstr ""
+
+msgid " NRMH\t= NRM Summary Status"
+msgstr ""
+
+msgid " NRMP<stat> = Returns the current value for a NRM health item"
+msgstr ""
+
+msgid " NRMM<stat> = Returns the current memory stats from NRM"
+msgstr ""
+
+msgid " NRMS<stat> = Returns the current Swapfile stats from NRM"
+msgstr ""
+
+msgid " NSS1<stat> = Statistics from _Admin:Manage_NSS\\GeneralStats.xml"
+msgstr ""
+
+msgid " NSS3<stat> = Statistics from _Admin:Manage_NSS\\NameCache.xml"
+msgstr ""
+
+msgid " NSS4<stat> = Statistics from _Admin:Manage_NSS\\FileStats.xml"
+msgstr ""
+
+msgid " NSS5<stat> = Statistics from _Admin:Manage_NSS\\ObjectCache.xml"
+msgstr ""
+
+msgid " NSS6<stat> = Statistics from _Admin:Manage_NSS\\Thread.xml"
+msgstr ""
+
+msgid ""
+" NSS7<stat> = Statistics from _Admin:Manage_NSS\\AuthorizationCache.xml"
+msgstr ""
+
+msgid " NLM:<nlm> = check if NLM is loaded and report version"
+msgstr ""
+
+msgid " (e.g. NLM:TSANDS.NLM)"
+msgstr ""
+
+msgid "Include server version string in results"
+msgstr ""
+
+msgid "- This plugin requires that the MRTGEXT.NLM file from James Drews' MRTG"
+msgstr ""
+
+msgid ""
+" extension for NetWare be loaded on the Novell servers you wish to check."
+msgstr ""
+
+msgid " (available from http://www.engr.wisc.edu/~drews/mrtg/)"
+msgstr " (disponible depuis http://www.engr.wisc.edu/~drews/mrtg/)"
+
+msgid ""
+"- Values for critical thresholds should be lower than warning thresholds"
+msgstr ""
+
+msgid ""
+" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "
+msgstr ""
+
+msgid " TCB, LRUS and LRUM."
+msgstr ""
+
+msgid "Unknown error fetching load data\n"
+msgstr ""
+"Erreur inconnue lors de la récupération des données de charge système\n"
+
+msgid "Invalid response from server - no load information\n"
+msgstr "Réponse invalide du serveur - pas d'information de charge système\n"
+
+msgid "Invalid response from server after load 1\n"
+msgstr "Réponse invalide du serveur après charge système à 1 minute\n"
+
+msgid "Invalid response from server after load 5\n"
+msgstr "Réponse invalide du serveur après charge système à 5 minute\n"
+
+#, c-format
+msgid "Load %s - %s-min load average = %0.2f"
+msgstr "Charge %s - %s-moyenne minimale de charge système = %0.2f"
+
+msgid "Unknown error fetching disk data\n"
+msgstr "Erreur inconnue en récupérant les données des disques\n"
+
+msgid "Invalid response from server\n"
+msgstr "Réponse invalide reçue du serveur\n"
+
+msgid "Unknown error fetching network status\n"
+msgstr "Erreur inconnue lors de la réception de l'état du réseau\n"
+
+#, c-format
+msgid "Net %s - %d connection%s on port %d"
+msgstr "Net %s - %d connections%s sur le port %d"
+
+msgid "Unknown error fetching process status\n"
+msgstr "Erreur inconnue en récupérant l'état des processus\n"
+
+#, c-format
+msgid "Process %s - %d instance%s of %s running"
+msgstr "Processus %s - %d instances%s de %s démarrées"
+
+#, c-format
+msgid "Uptime %s - Up %d days %d hours %d minutes"
+msgstr "Temps de fonctionnement %s - Up %d jours %d heures %d minutes"
+
+msgid ""
+"This plugin attempts to contact the Over-CR collector daemon running on the"
+msgstr ""
+"Ce plugin essaye de joindre le service Over CR tournant sur le serveur UNIX"
+
+msgid "remote UNIX server in order to gather the requested system information."
+msgstr "distant afin de récupérer les informations système demandées."
+
+msgid "LOAD1 = 1 minute average CPU load"
+msgstr ""
+
+msgid "LOAD5 = 5 minute average CPU load"
+msgstr ""
+
+msgid "LOAD15 = 15 minute average CPU load"
+msgstr ""
+
+msgid "DPU<filesys> = percent used disk space on filesystem <filesys>"
+msgstr ""
+
+msgid "PROC<process> = number of running processes with name <process>"
+msgstr ""
+
+msgid "NET<port> = number of active connections on TCP port <port>"
+msgstr ""
+
+msgid "UPTIME = system uptime in seconds"
+msgstr ""
+
+msgid "This plugin requires that Eric Molitors' Over-CR collector daemon be"
+msgstr "Ce plugin requiert que le daemon collecteur Over-CR d'Eric Molitors"
+
+msgid "running on the remote server."
+msgstr "soit fonctionnel sur le serveur distant"
+
+msgid "Over-CR can be downloaded from http://www.molitor.org/overcr"
+msgstr ""
+
+msgid "This plugin was tested with version 0.99.53 of the Over-CR collector"
+msgstr "Ce plugin a été testé avec la version 0.99.53 su collecteur Over-CR"
+
+msgid ""
+"For the available options, the critical threshold value should always be"
+msgstr ""
+"Pour toutes les options disponibles, le seuil critique doit toujours être"
+
+msgid ""
+"higher than the warning threshold value, EXCEPT with the uptime variable"
+msgstr "plus grand que le seuil d'alerte SAUF pour l'option uptime"
+
+#, c-format
+msgid "CRITICAL - no connection to '%s' (%s).\n"
+msgstr "CRITIQUE - pas de connexion à '%s' (%s).\n"
+
+#, fuzzy, c-format
+msgid " %s - database %s (%f sec.)|%s\n"
+msgstr " %s - base de données %s (%d sec.)|%s\n"
+
+msgid "Critical threshold must be a positive integer"
+msgstr "Le seuil critique doit être un entier positif"
+
+msgid "Warning threshold must be a positive integer"
+msgstr "Le seuil d'avertissement doit être un entier positif"
+
+#, fuzzy
+msgid "Database name exceeds the maximum length"
+msgstr "Le nom de la base de données est invalide"
+
+msgid "User name is not valid"
+msgstr "Le nom de l'utilisateur est invalide"
+
+#, c-format
+msgid "Test whether a PostgreSQL Database is accepting connections."
+msgstr "Teste si une base de données Postgresql accepte les connections."
+
+msgid "Database to check "
+msgstr ""
+
+#, fuzzy, c-format
+msgid "(default: %s)\n"
+msgstr "(Défaut: %d)\n"
+
+msgid "Login name of user"
+msgstr "Le nom d'un utilisateur"
+
+msgid "Password (BIG SECURITY ISSUE)"
+msgstr ""
+
+msgid "Connection parameters (keyword = value), see below"
+msgstr ""
+
+msgid "SQL query to run. Only first column in first row will be read"
+msgstr ""
+
+msgid "A name for the query, this string is used instead of the query"
+msgstr ""
+
+msgid "in the long output of the plugin"
+msgstr ""
+
+#, fuzzy
+msgid "SQL query value to result in warning status (double)"
+msgstr "Décalage résultant en un avertissement (secondes)"
+
+#, fuzzy
+msgid "SQL query value to result in critical status (double)"
+msgstr "Décalage résultant en un état critique (secondes)"
+
+msgid "All parameters are optional."
+msgstr ""
+
+msgid ""
+"This plugin tests a PostgreSQL DBMS to determine whether it is active and"
+msgstr ""
+
+msgid "accepting queries. In its current operation, it simply connects to the"
+msgstr ""
+
+msgid ""
+"specified database, and then disconnects. If no database is specified, it"
+msgstr ""
+
+msgid ""
+"connects to the template1 database, which is present in every functioning"
+msgstr ""
+
+msgid "PostgreSQL DBMS."
+msgstr ""
+
+msgid "If a query is specified using the -q option, it will be executed after"
+msgstr ""
+
+msgid "connecting to the server. The result from the query has to be numeric."
+msgstr ""
+
+msgid ""
+"Multiple SQL commands, separated by semicolon, are allowed but the result "
+msgstr ""
+
+msgid "of the last command is taken into account only. The value of the first"
+msgstr ""
+
+msgid ""
+"column in the first row is used as the check result. If a second column is"
+msgstr ""
+
+msgid "present in the result set, this is added to the plugin output with a"
+msgstr ""
+
+msgid ""
+"prefix of \"Extra Info:\". This information can be displayed in the system"
+msgstr ""
+
+msgid "executing the plugin."
+msgstr ""
+
+msgid ""
+"See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"
+msgstr ""
+
+msgid ""
+"for details about how to access internal statistics of the database server."
+msgstr ""
+
+msgid ""
+"For a list of available connection parameters which may be used with the -o"
+msgstr ""
+
+msgid ""
+"command line option, see the documentation for PQconnectdb() in the chapter"
+msgstr ""
+
+msgid ""
+"\"libpq - C Library\" of the PostgreSQL manual. For example, this may be"
+msgstr ""
+
+msgid ""
+"used to specify a service name in pg_service.conf to be used for additional"
+msgstr ""
+
+msgid "connection parameters: -o 'service=<name>' or to specify the SSL mode:"
+msgstr ""
+
+msgid "-o 'sslmode=require'."
+msgstr ""
+
+msgid ""
+"The plugin will connect to a local postmaster if no host is specified. To"
+msgstr ""
+"Ce plugin va se connecter sur un postmaster local si aucun hôte n'est "
+"spécifié."
+
+msgid ""
+"connect to a remote host, be sure that the remote postmaster accepts TCP/IP"
+msgstr ""
+
+msgid "connections (start the postmaster with the -i option)."
+msgstr ""
+
+msgid ""
+"Typically, the monitoring user (unless the --logname option is used) should "
+"be"
+msgstr ""
+
+msgid ""
+"able to connect to the database without a password. The plugin can also send"
+msgstr ""
+
+msgid "a password, but no effort is made to obscure or encrypt the password."
+msgstr ""
+
+#, c-format
+msgid "QUERY %s - %s: %s.\n"
+msgstr ""
+
+msgid "Error with query"
+msgstr ""
+
+#, fuzzy
+msgid "No rows returned"
+msgstr "Pas de données valides reçues"
+
+#, fuzzy
+msgid "No columns returned"
+msgstr "Pas de données valides reçues"
+
+#, fuzzy
+msgid "No data returned"
+msgstr "Pas de données valides reçues"
+
+msgid "Is not a numeric"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "%s returned %f"
+msgstr ". %s renvoie %s"
+
+#, fuzzy, c-format
+msgid "'%s' returned %f"
+msgstr ". %s renvoie %s"
+
+msgid "CRITICAL - Could not interpret output from ping command\n"
+msgstr "CRITIQUE - Impossible d'interpréter le réponse de la commande ping\n"
+
+#, c-format
+msgid "PING %s - %sPacket loss = %d%%"
+msgstr "PING %s - %s Paquets perdus = %d%%"
+
+#, c-format
+msgid "PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"
+msgstr "PING %s - %s Paquets perdus = %d%%, RTA = %2.2f ms"
+
+msgid "Could not realloc() addresses\n"
+msgstr "Impossible de réallouer les adresses\n"
+
+#, c-format
+msgid "<max_packets> (%s) must be a non-negative number\n"
+msgstr "<max_packets> (%s) doit être un nombre positif\n"
+
+#, c-format
+msgid "<wpl> (%s) must be an integer percentage\n"
+msgstr "<wpl> (%s) doit être un pourcentage entier\n"
+
+#, c-format
+msgid "<cpl> (%s) must be an integer percentage\n"
+msgstr "<cpl> (%s) doit être un pourcentage entier\n"
+
+#, c-format
+msgid "<wrta> (%s) must be a non-negative number\n"
+msgstr "<wrta> (%s) doit être un nombre positif\n"
+
+#, c-format
+msgid "<crta> (%s) must be a non-negative number\n"
+msgstr "<crta> (%s) doit être un nombre positif\n"
+
+#, c-format
+msgid ""
+"%s: Warning threshold must be integer or percentage!\n"
+"\n"
+msgstr "%s: Le seuil d'avertissement doit être un entier ou un pourcentage!\n"
+
+#, c-format
+msgid "<wrta> was not set\n"
+msgstr "<wrta> n'a pas été indiqué\n"
+
+#, c-format
+msgid "<crta> was not set\n"
+msgstr "<crta> n'a pas été indiqué\n"
+
+#, c-format
+msgid "<wpl> was not set\n"
+msgstr " <wpl> n'a pas été indiqué\n"
+
+#, c-format
+msgid "<cpl> was not set\n"
+msgstr "<cpl> n'a pas été indiqué\n"
+
+#, c-format
+msgid "<wrta> (%f) cannot be larger than <crta> (%f)\n"
+msgstr "<wrta> (%f) ne peut pas être plus large que <crta> (%f)\n"
+
+#, c-format
+msgid "<wpl> (%d) cannot be larger than <cpl> (%d)\n"
+msgstr "<wpl> (%d) ne peut pas être plus large que <cpl> (%d)\n"
+
+#, c-format
+msgid "Cannot open stderr for %s\n"
+msgstr "Impossible d'ouvrir le canal d'erreur standard pour %s\n"
+
+msgid "System call sent warnings to stderr "
+msgstr ""
+"Les appel système enverront leurs messages d'avertissement vers le canal "
+"d'erreur standard"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Network Unreachable (%s)\n"
+msgstr "CRITIQUE - Le réseau est inaccessible (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Host Unreachable (%s)\n"
+msgstr "CRITIQUE - Hôte inaccessible (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"
+msgstr "CRITIQUE - Paquet ICMP incorrect: Port inaccessible (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"
+msgstr "CRITIQUE - Paquet ICMP incorrect: Protocole inaccessible (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Network Prohibited (%s)\n"
+msgstr "CRITIQUE - L'accès au réseau est interdit (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Host Prohibited (%s)\n"
+msgstr "CRITIQUE - L'accès a l'hôte est interdit (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Packet Filtered (%s)\n"
+msgstr "CRITIQUE - Paquet filtré (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Host not found (%s)\n"
+msgstr "CRITIQUE - Hôte non trouvé (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Time to live exceeded (%s)\n"
+msgstr "CRITIQUE - La durée de vie du paquet est dépassée (%s)"
+
+#, fuzzy, c-format
+msgid "CRITICAL - Destination Unreachable (%s)\n"
+msgstr "CRITIQUE - Hôte inaccessible (%s)"
+
+#, fuzzy
+msgid "Unable to realloc warn_text\n"
+msgstr "Impossible de réattribuer le texte d'avertissement"
+
+#, c-format
+msgid "Use ping to check connection statistics for a remote host."
+msgstr ""
+"Utilise ping pour vérifier les statistiques de connections d'un hôte distant."
+
+msgid "host to ping"
+msgstr "hôte à tester"
+
+msgid "number of ICMP ECHO packets to send"
+msgstr "nombre de paquets ICMP à envoyer"
+
+#, c-format
+msgid "(Default: %d)\n"
+msgstr "(Défaut: %d)\n"
+
+msgid "show HTML in the plugin output (obsoleted by urlize)"
+msgstr ""
+
+msgid "THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"
+msgstr ""
+"Le seuil est <rta>,<pl>% où <rta> est le temps moyen pour l'aller retour (ms)"
+
+msgid "time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"
+msgstr "qui déclenche un résultat AVERTISSEMENT ou CRITIQUE, et <pl> est le "
+
+msgid "percentage of packet loss to trigger an alarm state."
+msgstr "pourcentage de paquets perdus pour déclencher une alarme."
+
+msgid ""
+"This plugin uses the ping command to probe the specified host for packet loss"
+msgstr ""
+"Ce plugin utilise la commande ping pour vérifier l'hôte spécifié pour les "
+"pertes de paquets"
+
+msgid ""
+"(percentage) and round trip average (milliseconds). It can produce HTML "
+"output"
+msgstr ""
+
+msgid ""
+"linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"
+msgstr ""
+
+msgid "the contrib area of the downloads section at http://www.nagios.org/"
+msgstr ""
+
+#, c-format
+msgid "CMD: %s\n"
+msgstr "Commande: %s\n"
+
+msgid "System call sent warnings to stderr"
+msgstr ""
+"L'appel système à retourné des avertissement vers le canal d'erreur standard"
+
+#, c-format
+msgid "Not parseable: %s"
+msgstr "Impossible de parcourir les arguments: %s"
+
+#, c-format
+msgid "Unable to read output\n"
+msgstr "Impossible de lire les données en entrée\n"
+
+#, c-format
+msgid "%d warn out of "
+msgstr "%d avertissements sur"
+
+#, c-format
+msgid "%d crit, %d warn out of "
+msgstr "%d crit, %d alertes sur "
+
+#, c-format
+msgid " with %s"
+msgstr " avec %s"
+
+msgid "Parent Process ID must be an integer!"
+msgstr "L'identifiant du processus parent doit être un entier!"
+
+#, c-format
+msgid "%s%sSTATE = %s"
+msgstr "%s%sETAT = %s"
+
+msgid "UID was not found"
+msgstr "L'UID n'a pas été trouvé"
+
+msgid "User name was not found"
+msgstr "L'utilisateur n'a pas été trouvé"
+
+#, c-format
+msgid "%s%scommand name '%s'"
+msgstr "%s%snom de la commande '%s'"
+
+#, c-format
+msgid "%s%sexclude progs '%s'"
+msgstr ""
+
+msgid "RSS must be an integer!"
+msgstr "RSS doit être un entier!"
+
+msgid "VSZ must be an integer!"
+msgstr "VSZ doit être un entier!"
+
+msgid "PCPU must be a float!"
+msgstr "PCPU doit être un nombre en virgule flottante!"
+
+msgid "Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"
+msgstr "Metric doit être l'un des PROCS, VSZ, RSS, CPU, ELAPSED!"
+
+msgid ""
+"Checks all processes and generates WARNING or CRITICAL states if the "
+"specified"
+msgstr ""
+
+msgid ""
+"metric is outside the required threshold ranges. The metric defaults to "
+"number"
+msgstr ""
+
+msgid ""
+"of processes. Search filters can be applied to limit the processes to check."
+msgstr ""
+
+msgid "Generate warning state if metric is outside this range"
+msgstr ""
+
+msgid "Generate critical state if metric is outside this range"
+msgstr ""
+
+msgid "Check thresholds against metric. Valid types:"
+msgstr ""
+
+msgid "PROCS - number of processes (default)"
+msgstr "PROCS - nombre de processus (défaut)"
+
+msgid "VSZ - virtual memory size"
+msgstr "VSZ - taille mémoire virtuelle"
+
+msgid "RSS - resident set memory size"
+msgstr ""
+
+msgid "CPU - percentage CPU"
+msgstr "CPU - pourcentage du processeur"
+
+msgid "ELAPSED - time elapsed in seconds"
+msgstr "ELAPSED - temps écoulé en secondes"
+
+msgid "Extra information. Up to 3 verbosity levels"
+msgstr "informations supplémentaires. Jusqu'à 3 niveaux de verbosité"
+
+msgid "Filter own process the traditional way by PID instead of /proc/pid/exe"
+msgstr ""
+
+msgid "Only scan for processes that have, in the output of `ps`, one or"
+msgstr ""
+
+msgid "more of the status flags you specify (for example R, Z, S, RS,"
+msgstr ""
+
+msgid "RSZDT, plus others based on the output of your 'ps' command)."
+msgstr ""
+
+msgid "Only scan for children of the parent process ID indicated."
+msgstr ""
+
+msgid "Only scan for processes with VSZ higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with RSS higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with PCPU higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with user name or ID indicated."
+msgstr ""
+
+msgid "Only scan for processes with args that contain STRING."
+msgstr ""
+
+msgid "Only scan for processes with args that contain the regex STRING."
+msgstr ""
+
+msgid "Only scan for exact matches of COMMAND (without path)."
+msgstr ""
+
+msgid "Exclude processes which match this comma separated list"
+msgstr ""
+
+msgid "Only scan for non kernel threads (works on Linux only)."
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n"
+"specified 'max:min', a warning status will be generated if the\n"
+"count is inside the specified range\n"
+"\n"
+msgstr ""
+"\n"
+"Les seuils sont spécifiés 'min:max' or 'min:' or ':max' (or 'max').\n"
+"Si spécifié 'max:min', un avertissement sera généré si le nombre\n"
+"est à l'intérieur du seuil\n"
+"\n"
+
+#, c-format
+msgid ""
+"This plugin checks the number of currently running processes and\n"
+"generates WARNING or CRITICAL states if the process count is outside\n"
+"the specified threshold ranges. The process count can be filtered by\n"
+"process owner, parent process PID, current state (e.g., 'Z'), or may\n"
+"be the total number of running processes\n"
+"\n"
+msgstr ""
+"Ce plugin vérifie le nombre de processus actifs et génère un résultat \n"
+"AVERTISSEMENT ou CRITIQUE si le nombre de processus est au dessus du seuil\n"
+"spécifié. Le total des processus peut être filtré par propriétaire, "
+"processus parent,\n"
+"état actuel (ex: 'Z'), ou par le nombre de processus en cours d'exécution\n"
+"\n"
+
+msgid "Warning if not two processes with command name portsentry."
+msgstr ""
+
+msgid "Critical if < 2 or > 1024 processes"
+msgstr ""
+
+msgid "Critical if not at least 1 process with command sshd"
+msgstr ""
+
+msgid "Warning if > 1024 processes with command name sshd."
+msgstr ""
+
+msgid "Critical if < 1 processes with command name sshd."
+msgstr ""
+
+msgid "Warning alert if > 10 processes with command arguments containing"
+msgstr ""
+
+msgid "'/usr/local/bin/perl' and owned by root"
+msgstr ""
+
+msgid "Alert if VSZ of any processes over 50K or 100K"
+msgstr ""
+
+msgid "Alert if CPU of any processes over 10% or 20%"
+msgstr ""
+
+#, fuzzy
+msgid "Config file error\n"
+msgstr "Erreur dans le fichier de configuration"
+
+#, fuzzy
+msgid "Out of Memory?\n"
+msgstr "Manque de Mémoire?"
+
+#, fuzzy
+msgid "Invalid NAS-Identifier\n"
+msgstr "NAS-Identifier invalide"
+
+#, c-format
+msgid "gethostname() failed!\n"
+msgstr "La commande gethostname() à échoué\n"
+
+#, fuzzy
+msgid "Invalid NAS-IP-Address\n"
+msgstr "NAS-IP-Address invalide"
+
+#, fuzzy
+msgid "Timeout\n"
+msgstr "Temps dépassé"
+
+#, fuzzy
+msgid "Auth Error\n"
+msgstr "Erreur d'authentification"
+
+#, fuzzy
+msgid "Auth Failed\n"
+msgstr "L'authentification à échoué"
+
+#, fuzzy
+msgid "Bad Response\n"
+msgstr "Réponse invalide"
+
+#, fuzzy
+msgid "Auth OK\n"
+msgstr "L'authentification à réussi"
+
+#, c-format
+msgid "Unexpected result code %d"
+msgstr "Résultat inattendu: %d"
+
+msgid "Number of retries must be a positive integer"
+msgstr "Le nombre d'essai doit être un entier positif"
+
+msgid "User not specified"
+msgstr "L'utilisateur n'a pas été spécifié"
+
+msgid "Password not specified"
+msgstr "Le mot de passe n'a pas été spécifié"
+
+msgid "Configuration file not specified"
+msgstr "Le fichier de configuration n'a pas été spécifié"
+
+msgid "Tests to see if a RADIUS server is accepting connections."
+msgstr "Teste si un serveur RADIUS accepte les connections."
+
+msgid "The user to authenticate"
+msgstr ""
+
+msgid "Password for authentication (SECURITY RISK)"
+msgstr ""
+
+msgid "NAS identifier"
+msgstr ""
+
+msgid "NAS IP Address"
+msgstr "Adresse IP NAS"
+
+msgid "Configuration file"
+msgstr "Fichier de configuration"
+
+msgid "Response string to expect from the server"
+msgstr ""
+
+msgid "Number of times to retry a failed connection"
+msgstr ""
+
+msgid ""
+"This plugin tests a RADIUS server to see if it is accepting connections."
+msgstr ""
+"Ce plugin teste un serveur RADIUS afin de vérifier si il accepte les "
+"connections."
+
+msgid ""
+"The server to test must be specified in the invocation, as well as a user"
+msgstr ""
+
+msgid "name and password. A configuration file must be present. The format of"
+msgstr ""
+
+msgid ""
+"the configuration file is described in the radiusclient library sources."
+msgstr ""
+
+msgid "The password option presents a substantial security issue because the"
+msgstr ""
+
+msgid ""
+"password can possibly be determined by careful watching of the command line"
+msgstr ""
+
+msgid "in a process listing. This risk is exacerbated because the plugin will"
+msgstr ""
+
+msgid ""
+"typically be executed at regular predictable intervals. Please be sure that"
+msgstr ""
+
+msgid "the password used does not allow access to sensitive system resources."
+msgstr ""
+
+#, c-format
+msgid "Unable to connect to %s on port %d\n"
+msgstr "Impossible de se connecter à %s sur le port %d\n"
+
+#, c-format
+msgid "No data received from %s\n"
+msgstr "Pas de données reçues de %s\n"
+
+msgid "Invalid REAL response received from host"
+msgstr "Réponses REAL invalide reçue de l'hôte"
+
+#, c-format
+msgid "Invalid REAL response received from host on port %d\n"
+msgstr "Réponses REAL invalide reçue de l'hôte sur le port %d\n"
+
+#, c-format
+msgid "No data received from host\n"
+msgstr "Pas de données reçues de l'hôte\n"
+
+#, c-format
+msgid "REAL %s - %d second response time\n"
+msgstr "REAL %s - %d secondes de temps de réponse\n"
+
+msgid "Warning time must be a positive integer"
+msgstr "Le seuil d'avertissement doit être un entier positif"
+
+msgid "Critical time must be a positive integer"
+msgstr "Le seuil critique doit être un entier positif"
+
+msgid "You must provide a server to check"
+msgstr "Vous devez fournir un serveur à vérifier"
+
+msgid "This plugin tests the REAL service on the specified host."
+msgstr "Ce plugin teste le service REAL sur l'hôte spécifié."
+
+msgid "Connect to this url"
+msgstr ""
+
+#, c-format
+msgid "String to expect in first line of server response (default: %s)\n"
+msgstr ""
+"Texte attendu dans la première ligne de réponse du serveur (défaut: %s)\n"
+
+msgid "This plugin will attempt to open an RTSP connection with the host."
+msgstr "Ce plugin va essayer d'ouvrir un connexion RTSP avec l'hôte."
+
+msgid "Successful connects return STATE_OK, refusals and timeouts return"
+msgstr ""
+
+msgid ""
+"STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,"
+msgstr ""
+
+msgid ""
+"but incorrect response messages from the host result in STATE_WARNING return"
+msgstr ""
+
+msgid "values."
+msgstr ""
+
+#, c-format
+msgid "malloc() failed!\n"
+msgstr "l'allocation mémoire à échoué!\n"
+
+#, c-format
+msgid "CRITICAL - Cannot create SSL context.\n"
+msgstr "CRITIQUE - Impossible de créer le contexte SSL.\n"
+
+#, c-format
+msgid "recv() failed\n"
+msgstr "La commande recv() à échoué\n"
+
+#, c-format
+msgid "WARNING - TLS not supported by server\n"
+msgstr "AVERTISSEMENT: - TLS n'est pas supporté par ce serveur\n"
+
+#, c-format
+msgid "Server does not support STARTTLS\n"
+msgstr "Le serveur ne supporte pas STARTTLS\n"
+
+msgid "SMTP UNKNOWN - Cannot send EHLO command via TLS."
+msgstr ""
+
+#, c-format
+msgid "sent %s"
+msgstr "envoyé %s"
+
+msgid "SMTP UNKNOWN - Cannot read EHLO response via TLS."
+msgstr ""
+
+#, c-format
+msgid "Invalid SMTP response received from host: %s\n"
+msgstr "Réponse SMTP reçue de l'hôte invalide: %s\n"
+
+#, c-format
+msgid "Invalid SMTP response received from host on port %d: %s\n"
+msgstr "Réponse SMTP reçue de l'hôte sur le port %d invalide: %s\n"
+
+#, c-format
+msgid "Could Not Compile Regular Expression"
+msgstr "Impossible de compiler l'expression rationnelle"
+
+#, c-format
+msgid "SMTP %s - Invalid response '%s' to command '%s'\n"
+msgstr "SMTP %s - réponse invalide de '%s' à la commande '%s'\n"
+
+#, c-format
+msgid "Execute Error: %s\n"
+msgstr "Erreur d'exécution: %s\n"
+
+msgid "no authuser specified, "
+msgstr "Pas d'utilisateur pour l'authentification spécifié, "
+
+msgid "no authpass specified, "
+msgstr "pas de mot de passe spécifié, "
+
+#, c-format
+msgid "sent %s\n"
+msgstr "envoyé %s\n"
+
+msgid "recv() failed after AUTH LOGIN, "
+msgstr "recv() à échoué après AUTH LOGIN, "
+
+#, c-format
+msgid "received %s\n"
+msgstr "reçu %s\n"
+
+msgid "invalid response received after AUTH LOGIN, "
+msgstr "Réponse invalide reçue après AUTH LOGIN, "
+
+msgid "recv() failed after sending authuser, "
+msgstr "La commande recv() a échoué après authuser, "
+
+msgid "invalid response received after authuser, "
+msgstr "Réponse invalide reçue après authuser, "
+
+msgid "recv() failed after sending authpass, "
+msgstr "la commande recv() à échoué après authpass, "
+
+msgid "invalid response received after authpass, "
+msgstr "Réponse invalide reçue après authpass, "
+
+msgid "only authtype LOGIN is supported, "
+msgstr "seul la méthode d'authentification LOGIN est supportée, "
+
+#, c-format
+msgid "SMTP %s - %s%.3f sec. response time%s%s|%s\n"
+msgstr "SMTP %s - %s%.3f sec. de temps de réponse%s%s|%s\n"
+
+#, c-format
+msgid "Could not realloc() units [%d]\n"
+msgstr "Impossible de réallouer des unités [%d]\n"
+
+#, fuzzy
+msgid "Critical time must be a positive"
+msgstr "Le seuil critique doit être un entier positif"
+
+#, fuzzy
+msgid "Warning time must be a positive"
+msgstr "Le seuil d'avertissement doit être un entier positif"
+
+msgid "SSL support not available - install OpenSSL and recompile"
+msgstr "SSL n'est pas disponible - installer OpenSSL et recompilez"
+
+msgid "Set either -s/--ssl/--tls or -S/--starttls"
+msgstr "Définissez -s/--ssl/--tls ou -S/--starttls"
+
+#, c-format
+msgid "Connection closed by server before sending QUIT command\n"
+msgstr ""
+
+#, c-format
+msgid "recv() failed after QUIT."
+msgstr "recv() à échoué après QUIT."
+
+#, c-format
+msgid "Connection reset by peer."
+msgstr ""
+
+msgid "This plugin will attempt to open an SMTP connection with the host."
+msgstr "Ce plugin va essayer d'ouvrir un connexion SMTP avec l'hôte."
+
+#, c-format
+msgid " String to expect in first line of server response (default: '%s')\n"
+msgstr ""
+" Texte attendu dans la première ligne de réponse du serveur (défaut: "
+"'%s')\n"
+
+msgid "SMTP command (may be used repeatedly)"
+msgstr "Commande SMTP (peut être utilisé plusieurs fois)"
+
+msgid "Expected response to command (may be used repeatedly)"
+msgstr ""
+
+msgid "FROM-address to include in MAIL command, required by Exchange 2000"
+msgstr ""
+
+msgid "FQDN used for HELO"
+msgstr ""
+
+msgid "Use PROXY protocol prefix for the connection."
+msgstr "Utiliser le préfixe du protocole PROXY pour la connexion."
+
+msgid "Minimum number of days a certificate has to be valid."
+msgstr "Nombre de jours minimum pour que le certificat soit valide."
+
+#, fuzzy
+msgid "Use SSL/TLS for the connection."
+msgstr "Utiliser SSL/TLS pour la connexion."
+
+#, c-format
+msgid " Sets default port to %d.\n"
+msgstr " Définit le port par défaut à %d.\n"
+
+msgid "Use STARTTLS for the connection."
+msgstr "Utiliser STARTTLS pour la connexion."
+
+msgid "SMTP AUTH type to check (default none, only LOGIN supported)"
+msgstr ""
+
+msgid "SMTP AUTH username"
+msgstr ""
+
+msgid "SMTP AUTH password"
+msgstr ""
+
+msgid "Send LHLO instead of HELO/EHLO"
+msgstr ""
+
+msgid "Ignore failure when sending QUIT command to server"
+msgstr ""
+
+msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful"
+msgstr ""
+
+msgid "connects, but incorrect response messages from the host result in"
+msgstr ""
+
+msgid "STATE_WARNING return values."
+msgstr ""
+
+msgid "Cannot malloc"
+msgstr ""
+
+#, c-format
+msgid "External command error: %s\n"
+msgstr "Erreur d'exécution de commande externe: %s\n"
+
+#, c-format
+msgid "External command error with no output (return code: %d)\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "No valid data returned (%s)\n"
+msgstr "Pas de données valides reçues"
+
+msgid "Time duration between plugin calls is invalid"
+msgstr ""
+
+msgid "Cannot asprintf()"
+msgstr ""
+
+#, fuzzy
+msgid "Cannot realloc()"
+msgstr "Impossible de réallouer des unités\n"
+
+msgid "No previous data to calculate rate - assume okay"
+msgstr ""
+
+msgid "Retries interval must be a positive integer"
+msgstr "L'intervalle pour les essais doit être un entier positif"
+
+#, fuzzy
+msgid "Exit status must be a positive integer"
+msgstr "Maxbytes doit être un entier positif"
+
+#, c-format
+msgid "Could not reallocate labels[%d]"
+msgstr "Impossible de réallouer des labels[%d]"
+
+msgid "Could not reallocate labels\n"
+msgstr "Impossible de réallouer des labels\n"
+
+#, c-format
+msgid "Could not reallocate units [%d]\n"
+msgstr "Impossible de réallouer des unités [%d]\n"
+
+msgid "Could not realloc() units\n"
+msgstr "Impossible de réallouer des unités\n"
+
+#, fuzzy
+msgid "Rate multiplier must be a positive integer"
+msgstr "La taille du paquet doit être un entier positif"
+
+msgid "No host specified\n"
+msgstr "Pas d'hôte spécifié\n"
+
+msgid "No OIDs specified\n"
+msgstr "Pas de compteur spécifié\n"
+
+#, c-format
+msgid "Required parameter: %s\n"
+msgstr ""
+
+msgid "Invalid seclevel"
+msgstr ""
+
+msgid "Invalid SNMP version"
+msgstr "Version de SNMP invalide"
+
+msgid "Unbalanced quotes\n"
+msgstr "Guillemets manquants\n"
+
+#, c-format
+msgid "multiplier set (%.1f), but input is not a number: %s"
+msgstr ""
+
+msgid "Check status of remote machines and obtain system information via SNMP"
+msgstr ""
+"Vérifie l'état des machines distantes et obtient l'information système via "
+"SNMP"
+
+msgid "Use SNMP GETNEXT instead of SNMP GET"
+msgstr "Utiliser SNMP GETNEXT au lieu de SNMP GET"
+
+msgid "SNMP protocol version"
+msgstr "Version du protocole SNMP"
+
+#, fuzzy
+msgid "SNMPv3 context"
+msgstr "Nom d'utilisateur SNMPv3"
+
+msgid "SNMPv3 securityLevel"
+msgstr "Niveau de sécurité SNMPv3 (securityLevel)"
+
+msgid "SNMPv3 auth proto"
+msgstr "Protocole d'authentification SNMPv3"
+
+msgid "SNMPv3 priv proto (default DES)"
+msgstr ""
+
+msgid "Optional community string for SNMP communication"
+msgstr "Communauté optionnelle pour la communication SNMP"
+
+msgid "default is"
+msgstr "défaut:"
+
+msgid "SNMPv3 username"
+msgstr "Nom d'utilisateur SNMPv3"
+
+msgid "SNMPv3 authentication password"
+msgstr "Mot de passe d'authentification SNMPv3"
+
+msgid "SNMPv3 privacy password"
+msgstr "Mot de passe de confidentialité SNMPv3"
+
+msgid "Object identifier(s) or SNMP variables whose value you wish to query"
+msgstr ""
+
+msgid ""
+"List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'"
+msgstr ""
+
+msgid "for symbolic OIDs.)"
+msgstr ""
+
+msgid "Delimiter to use when parsing returned data. Default is"
+msgstr ""
+
+msgid "Any data on the right hand side of the delimiter is considered"
+msgstr ""
+
+msgid "to be the data that should be used in the evaluation."
+msgstr ""
+
+msgid "If the check returns a 0 length string or NULL value"
+msgstr ""
+
+msgid "This option allows you to choose what status you want it to exit"
+msgstr ""
+
+msgid "Excluding this option renders the default exit of 3(STATE_UNKNOWN)"
+msgstr ""
+
+msgid "0 = OK"
+msgstr ""
+
+#, fuzzy
+msgid "1 = WARNING"
+msgstr "AVERTISSEMENT"
+
+#, fuzzy
+msgid "2 = CRITICAL"
+msgstr "CRITIQUE"
+
+#, fuzzy
+msgid "3 = UNKNOWN"
+msgstr "INCONNU"
+
+msgid "Warning threshold range(s)"
+msgstr "Valeurs pour le seuil d'avertissement"
+
+msgid "Critical threshold range(s)"
+msgstr "Valeurs pour le seuil critique"
+
+msgid "Enable rate calculation. See 'Rate Calculation' below"
+msgstr ""
+
+msgid ""
+"Converts rate per second. For example, set to 60 to convert to per minute"
+msgstr ""
+
+msgid "Add/subtract the specified OFFSET to numeric sensor data"
+msgstr ""
+
+msgid "Return OK state (for that OID) if STRING is an exact match"
+msgstr ""
+
+msgid ""
+"Return OK state (for that OID) if extended regular expression REGEX matches"
+msgstr ""
+
+msgid ""
+"Return OK state (for that OID) if case-insensitive extended REGEX matches"
+msgstr ""
+
+msgid "Invert search result (CRITICAL if found)"
+msgstr ""
+
+msgid "Prefix label for output from plugin"
+msgstr ""
+
+msgid "Units label(s) for output data (e.g., 'sec.')."
+msgstr ""
+
+msgid "Separates output on multiple OID requests"
+msgstr ""
+
+msgid "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
+msgstr ""
+
+msgid "C-style format string for float values (see option -M)"
+msgstr ""
+
+msgid ""
+"NOTE the final timeout value is calculated using this formula: "
+"timeout_interval * retries + 5"
+msgstr ""
+
+#, fuzzy
+msgid "Number of retries to be used in the requests, default: "
+msgstr "Le nombre d'essai pour les requêtes"
+
+msgid "Label performance data with OIDs instead of --label's"
+msgstr ""
+
+msgid "Tell snmpget to not print errors encountered when parsing MIB files"
+msgstr ""
+
+msgid ""
+"This plugin uses the 'snmpget' command included with the NET-SNMP package."
+msgstr ""
+
+msgid ""
+"if you don't have the package installed, you will need to download it from"
+msgstr ""
+"Si vous n'avez pas le programme installé, vous devrez le télécharger depuis"
+
+msgid "http://net-snmp.sourceforge.net before you can use this plugin."
+msgstr "http://net-snmp.sourceforge.net avant de pouvoir utiliser ce plugin."
+
+#, fuzzy
+msgid ""
+"- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "
+msgstr ""
+"- Des OIDs multiples peuvent être séparées par des virgules ou des espaces"
+
+#, fuzzy
+msgid "list (lists with internal spaces must be quoted)."
+msgstr "(Les liste avec espaces doivent être entre guillemets). Max:"
+
+msgid ""
+"- When checking multiple OIDs, separate ranges by commas like '-w "
+"1:10,1:,:20'"
+msgstr ""
+
+msgid "- Note that only one string and one regex may be checked at present"
+msgstr ""
+
+msgid ""
+"- All evaluation methods other than PR, STR, and SUBSTR expect that the value"
+msgstr ""
+
+msgid "returned from the SNMP query is an unsigned integer."
+msgstr ""
+
+msgid "Rate Calculation:"
+msgstr ""
+
+msgid "In many places, SNMP returns counters that are only meaningful when"
+msgstr ""
+
+msgid "calculating the counter difference since the last check. check_snmp"
+msgstr ""
+
+msgid "saves the last state information in a file so that the rate per second"
+msgstr ""
+
+msgid "can be calculated. Use the --rate option to save state information."
+msgstr ""
+
+msgid ""
+"On the first run, there will be no prior state - this will return with OK."
+msgstr ""
+
+msgid "The state is uniquely determined by the arguments to the plugin, so"
+msgstr ""
+
+msgid "changing the arguments will create a new state file."
+msgstr ""
+
+msgid "Port number must be a positive integer"
+msgstr "Le numéro du port doit être un nombre entier positif"
+
+#, c-format
+msgid "Server answer: %s"
+msgstr "Réponse du serveur: %s"
+
+#, fuzzy, c-format
+msgid "SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"
+msgstr ""
+"SSH AVERTISSEMENT - %s (protocole %s) différence de version, attendu'%s'\n"
+
+#, fuzzy, c-format
+msgid ""
+"SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"
+msgstr ""
+"SSH AVERTISSEMENT - %s (protocole %s) différence de version, attendu'%s'\n"
+
+#, fuzzy, c-format
+msgid "SSH OK - %s (protocol %s) | %s\n"
+msgstr "SSH OK - %s (protocole %s)\n"
+
+msgid "Try to connect to an SSH server at specified server and port"
+msgstr "Essaye de se connecter à un serveur SSH précisé à un port précis"
+
+#, fuzzy
+msgid ""
+"Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"
+msgstr ""
+"AVERTISSEMENT si la chaîne ne correspond pas à la version précisée (ex: "
+"OpenSSH_3.9p1)"
+
+#, fuzzy
+msgid "Alert if protocol doesn't match expected protocol version (ex: 2.0)"
+msgstr ""
+"AVERTISSEMENT si la chaîne ne correspond pas à la version précisée (ex: "
+"OpenSSH_3.9p1)"
+
+#, c-format
+msgid "Command: %s\n"
+msgstr "Commande: %s\n"
+
+#, c-format
+msgid "Format: %s\n"
+msgstr "Format: %s\n"
+
+#, c-format
+msgid "total=%.0f, used=%.0f, free=%.0f\n"
+msgstr "total=%.0f, utilisé=%.0f, libre=%.0ff\n"
+
+#, c-format
+msgid "total=%.0f, free=%.0f\n"
+msgstr "total=%.0f, libre=%.0f\n"
+
+msgid "Error getting swap devices\n"
+msgstr ""
+
+msgid "SWAP OK: No swap devices defined\n"
+msgstr "SWAP OK: Pas de périphériques swap définis\n"
+
+msgid "swapctl failed: "
+msgstr "swapctl à échoué:"
+
+msgid "Error in swapctl call\n"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "SWAP %s - %d%% free (%dMB out of %dMB) %s|"
+msgstr "SWAP %s - %d%% libre (%d MB sur un total de %d MB) %s|"
+
+#, fuzzy
+msgid "Warning threshold percentage must be <= 100!"
+msgstr "Le seuil d'avertissement doit être un entier positif"
+
+#, fuzzy
+msgid "Warning threshold be positive integer or percentage!"
+msgstr "Le seuil d'avertissement doit être un entier ou un pourcentage!"
+
+#, fuzzy
+msgid "Critical threshold percentage must be <= 100!"
+msgstr "le seuil critique doit être un entier positif"
+
+#, fuzzy
+msgid "Critical threshold be positive integer or percentage!"
+msgstr "Le seuil critique doit être un entier ou un pourcentage!"
+
+#, fuzzy
+msgid ""
+"no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
+"or integer (0-3)."
+msgstr ""
+"Le résultat de temps dépassé doit être un nom d'état valide (OK, WARNING, "
+"CRITICAL, UNKNOWN) ou un nombre entier (0-3)."
+
+#, fuzzy
+msgid "Warning should be more than critical"
+msgstr ""
+"Le pourcentage d'avertissement doit être plus important que le pourcentage "
+"critique"
+
+msgid "Check swap space on local machine."
+msgstr "Vérifie l'espace swap sur la machine locale."
+
+msgid ""
+"Exit with WARNING status if less than INTEGER bytes of swap space are free"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si moins de X octets de mémoire "
+"virtuelle sont libres"
+
+msgid "Exit with WARNING status if less than PERCENT of swap space is free"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si moins de X pour cent de mémoire "
+"virtuelle est libre"
+
+msgid ""
+"Exit with CRITICAL status if less than INTEGER bytes of swap space are free"
+msgstr ""
+"Sortir avec un résultat CRITIQUE si moins de X octets de mémoire virtuelle "
+"sont libres"
+
+msgid "Exit with CRITICAL status if less than PERCENT of swap space is free"
+msgstr ""
+"Sortir avec un résultat CRITIQUE si moins de X pour cent de mémoire "
+"virtuelle est libre"
+
+msgid "Conduct comparisons for all swap partitions, one by one"
+msgstr "Vérifier chacune des partitions de mémoire virtuelle séparément"
+
+msgid ""
+"Resulting state when there is no swap regardless of thresholds. Default:"
+msgstr ""
+
+#, fuzzy
+msgid ""
+"Both INTEGER and PERCENT thresholds can be specified, they are all checked."
+msgstr "Les seuils d'alerte et critiques peuvent être spécifiés avec -w et -c."
+
+msgid "On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."
+msgstr ""
+"Sur AIX, si -a est spécifié, le plugin utilise lsps -a, sinon il utilise "
+"lsps -s."
+
+msgid "CRITICAL - Generic check_tcp called with unknown service\n"
+msgstr ""
+"CRITIQUE -check_tcp version générique utilisé avec un service inconnu\n"
+
+msgid "With UDP checks, a send/expect string must be specified."
+msgstr ""
+"Avec la surveillance UDP, une chaîne d'envoi et un chaîne de réponse doit "
+"être spécifiée."
+
+msgid "No arguments found"
+msgstr "Pas de paramètres"
+
+msgid "Maxbytes must be a positive integer"
+msgstr "Maxbytes doit être un entier positif"
+
+msgid "Refuse must be one of ok, warn, crit"
+msgstr "Refuse doit être parmis ok, warn, crit"
+
+msgid "Mismatch must be one of ok, warn, crit"
+msgstr "Mismatch doit être parmis ok, warn, crit"
+
+msgid "Delay must be a positive integer"
+msgstr "Delay doit être un entier positif"
+
+msgid "You must provide a server address"
+msgstr "Vous devez fournir une adresse serveur"
+
+msgid "Invalid hostname, address or socket"
+msgstr "Adresse/Nom/Socket invalide"
+
+#, c-format
+msgid ""
+"This plugin tests %s connections with the specified host (or unix socket).\n"
+"\n"
+msgstr ""
+"Ce plugin teste %s connections avec l'hôte spécifié (ou socket unix).\n"
+"\n"
+
+#, fuzzy
+msgid ""
+"Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send "
+"or quit option"
+msgstr ""
+"Permet d'utiliser \\n, \\r, \\t ou \\ dans la chaîne de caractères send ou "
+"quit. Doit être placé avant ces dernières."
+
+msgid "Default: nothing added to send, \\r\\n added to end of quit"
+msgstr ""
+"Par défaut: Rien n'est ajouté à send, \\r\\n est ajouté à la fin de quit"
+
+msgid "String to send to the server"
+msgstr "Chaîne de caractères à envoyer au serveur"
+
+msgid "String to expect in server response"
+msgstr "Chaîne de caractères à attendre en réponse"
+
+msgid "(may be repeated)"
+msgstr "(peut être utilisé plusieurs fois)"
+
+msgid "All expect strings need to occur in server response. Default is any"
+msgstr ""
+"Toutes les chaînes attendus (expect) doivent être repérés dans la réponse. "
+"Par défaut, n'importe laquelle suffit."
+
+msgid "String to send server to initiate a clean close of the connection"
+msgstr "Chaîne de caractères à envoyer pour fermer gracieusement la connection"
+
+msgid "Accept TCP refusals with states ok, warn, crit (default: crit)"
+msgstr ""
+
+msgid ""
+"Accept expected string mismatches with states ok, warn, crit (default: warn)"
+msgstr ""
+
+msgid "Hide output from TCP socket"
+msgstr "Cacher la réponse provenant du socket TCP"
+
+msgid "Close connection once more than this number of bytes are received"
+msgstr ""
+
+msgid "Seconds to wait between sending string and polling for response"
+msgstr ""
+
+msgid "1st is #days for warning, 2nd is critical (if not specified - 0)."
+msgstr ""
+
+msgid "Use SSL for the connection."
+msgstr ""
+
+#, fuzzy
+msgid "SSL server_name"
+msgstr "Nom d'utilisateur SNMPv3"
+
+#, c-format
+msgid "TIME UNKNOWN - could not connect to server %s, port %d\n"
+msgstr "TEMPS INCONNU - impossible de se connecter au serveur %s, au port %d\n"
+
+#, c-format
+msgid "TIME UNKNOWN - could not send UDP request to server %s, port %d\n"
+msgstr ""
+"TEMPS INCONNU - impossible d'envoyer une requête UDP au serveur %s, au port "
+"%d\n"
+
+#, c-format
+msgid "TIME UNKNOWN - no data received from server %s, port %d\n"
+msgstr "TEMPS INCONNU - pas de données reçues du serveur %s, du port %d\n"
+
+#, c-format
+msgid "TIME %s - %d second response time|%s\n"
+msgstr "TEMPS %s - %d secondes de temps de réponse|%s\n"
+
+#, c-format
+msgid "TIME %s - %lu second time difference|%s %s\n"
+msgstr "TEMPS %s - %lu secondes de différence|%s %s\n"
+
+msgid "Warning thresholds must be a positive integer"
+msgstr "Les seuils d'avertissement doivent être un entier positif"
+
+msgid "Critical thresholds must be a positive integer"
+msgstr "Les seuils critiques doivent être un entier positif"
+
+msgid "This plugin will check the time on the specified host."
+msgstr "Ce plugin va vérifier l'heure sur l'hôte spécifié."
+
+msgid "Use UDP to connect, not TCP"
+msgstr ""
+
+msgid "Time difference (sec.) necessary to result in a warning status"
+msgstr ""
+
+msgid "Time difference (sec.) necessary to result in a critical status"
+msgstr ""
+
+msgid "Response time (sec.) necessary to result in warning status"
+msgstr ""
+
+msgid "Response time (sec.) necessary to result in critical status"
+msgstr ""
+
+msgid "On Battery, Low Battery"
+msgstr "Sur Batterie, Batterie faible"
+
+msgid "Online"
+msgstr "En marche"
+
+msgid "On Battery"
+msgstr "Sur Batterie"
+
+msgid ", Low Battery"
+msgstr ", Batterie faible"
+
+msgid ", Calibrating"
+msgstr ", Calibration"
+
+msgid ", Replace Battery"
+msgstr ", Remplacer la batterie"
+
+msgid ", On Bypass"
+msgstr ", Sur Secteur"
+
+msgid ", Overload"
+msgstr ", Surcharge"
+
+msgid ", Trimming"
+msgstr ", En Test"
+
+msgid ", Boosting"
+msgstr ""
+
+msgid ", Charging"
+msgstr ", En charge"
+
+msgid ", Discharging"
+msgstr ", Déchargement"
+
+msgid ", Unknown"
+msgstr ", Inconnu"
+
+msgid "UPS does not support any available options\n"
+msgstr "L'UPS ne supporte aucune des options disponibles\n"
+
+msgid "Invalid response received from host"
+msgstr "Réponse invalide reçue de l'hôte"
+
+msgid "UPS name to long for buffer"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - no such UPS '%s' on that host\n"
+msgstr "CRITIQUE - pas d'UPS '%s' sur cet hôte\n"
+
+msgid "CRITICAL - UPS data is stale"
+msgstr "CRITIQUE - les données de l'ups ne sont plus valables"
+
+#, c-format
+msgid "Unknown error: %s\n"
+msgstr "Erreur inconnue: %s\n"
+
+msgid "Error: unable to parse variable"
+msgstr "Erreur: impossible de lire la variable"
+
+msgid "Unrecognized UPS variable"
+msgstr "Variable d'UPS non reconnue"
+
+msgid "Error : no UPS indicated"
+msgstr "Erreur: pas d'UPS indiqué"
+
+msgid ""
+"This plugin tests the UPS service on the specified host. Network UPS Tools"
+msgstr "Ce plugin teste le service UPS sur l'hôte spécifié. Network UPS Tools"
+
+msgid "from www.networkupstools.org must be running for this plugin to work."
+msgstr ""
+"de www.networkupstools.org doit s'exécuter sur l'hôte pour que ce plugin "
+"fonctionne."
+
+msgid "Name of UPS"
+msgstr ""
+
+msgid "Output of temperatures in Celsius"
+msgstr "Affichage des températures en Celsius"
+
+msgid "Valid values for STRING are"
+msgstr "Les variables valides pour STRING sont"
+
+msgid ""
+"This plugin attempts to determine the status of a UPS (Uninterruptible Power"
+msgstr ""
+
+msgid ""
+"Supply) on a local or remote host. If the UPS is online or calibrating, the"
+msgstr ""
+
+msgid ""
+"plugin will return an OK state. If the battery is on it will return a WARNING"
+msgstr ""
+
+msgid ""
+"state. If the UPS is off or has a low battery the plugin will return a "
+"CRITICAL"
+msgstr ""
+
+msgid ""
+"You may also specify a variable to check (such as temperature, utility "
+"voltage,"
+msgstr ""
+
+msgid ""
+"battery load, etc.) as well as warning and critical thresholds for the value"
+msgstr ""
+
+msgid ""
+"of that variable. If the remote host has multiple UPS that are being "
+"monitored"
+msgstr ""
+
+msgid "you will have to use the --ups option to specify which UPS to check."
+msgstr ""
+
+msgid ""
+"This plugin requires that the UPSD daemon distributed with Russell Kroll's"
+msgstr ""
+
+msgid ""
+"Network UPS Tools be installed on the remote host. If you do not have the"
+msgstr ""
+
+msgid "package installed on your system, you can download it from"
+msgstr ""
+
+msgid "http://www.networkupstools.org"
+msgstr ""
+
+#, fuzzy, c-format
+msgid "Could not enumerate RD sessions: %d\n"
+msgstr "Impossible d'utiliser le protocole version %d\n"
+
+#, c-format
+msgid "# users=%d"
+msgstr "# utilisateurs=%d"
+
+msgid "Unable to read output"
+msgstr "Impossible de lire les données en entrée"
+
+#, c-format
+msgid "USERS %s - %d users currently logged in |%s\n"
+msgstr "UTILISATEURS %s - %d utilisateurs actuellement connectés sur |%s\n"
+
+msgid "This plugin checks the number of users currently logged in on the local"
+msgstr ""
+"Ce plugin vérifie le nombre d'utilisateurs actuellement connecté sur le "
+"système local"
+
+msgid ""
+"system and generates an error if the number exceeds the thresholds specified."
+msgstr "et génère une erreur si le nombre excède le seuil spécifié."
+
+msgid "Set WARNING status if more than INTEGER users are logged in"
+msgstr ""
+"Sortir avec un résultat AVERTISSEMENT si plus de INTEGER utilisateurs sont "
+"connectés"
+
+msgid "Set CRITICAL status if more than INTEGER users are logged in"
+msgstr ""
+"Sortir avec un résultat CRITIQUE si plus de INTEGER utilisateurs sont "
+"connectés"
+
+msgid ""
+"DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\"."
+msgstr ""
+
+msgid "Nagios-compatible output is now always returned."
+msgstr ""
+
+msgid "SMART commands are broken and have been disabled (See Notes in --help)."
+msgstr ""
+
+msgid ""
+"DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the"
+msgstr ""
+
+#, fuzzy
+msgid "default and will be removed from future releases."
+msgstr ""
+"Note: nslookup est obsolète et pourra être retiré dans les prochaines "
+"versions."
+
+#, c-format
+msgid "CRITICAL - Couldn't open device %s: %s\n"
+msgstr "Critique - Impossible d'ouvrir le périphérique %s: %s\n"
+
+#, c-format
+msgid "CRITICAL - SMART_CMD_ENABLE\n"
+msgstr "CRITIQUE - SMART_CMD_ENABLE\n"
+
+#, c-format
+msgid "CRITICAL - SMART_READ_VALUES: %s\n"
+msgstr "CRITIQUE - SMART_READ_VALUES: %s\n"
+
+#, c-format
+msgid "CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"
+msgstr ""
+"CRITIQUE - %d État de pré-panne %c Détecté! %d/%d les tests on échoués.\n"
+
+#, c-format
+msgid "WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"
+msgstr ""
+"AVERTISSEMENT - %d État de pré-panne %s Détecté! %d/%d les tests on "
+"échoués.\n"
+
+#, c-format
+msgid "OK - Operational (%d/%d tests passed)\n"
+msgstr "OK - En fonctionnement (%d/%d les tests on été réussi)\n"
+
+#, c-format
+msgid "ERROR - Status '%d' unknown. %d/%d tests passed\n"
+msgstr "ERREUR - État '%d' inconnu. %d/%d les tests on réussi\n"
+
+#, c-format
+msgid "OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"
+msgstr ""
+"Etat Hors Ligne=%d {%s}, Hors Ligne Auto=%s, Temps avant arrêt=%d minutes\n"
+
+#, c-format
+msgid "OffLineCapability=%d {%s %s %s}\n"
+msgstr "Capacité Hors Ligne=%d {%s %s %s}\n"
+
+#, c-format
+msgid "SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"
+msgstr "Révision Smart=%d, Somme de contrôle=%d, Capacité Smart=%d {%s %s}\n"
+
+#, c-format
+msgid "CRITICAL - %s: %s\n"
+msgstr "CRITIQUE - %s: %s\n"
+
+#, fuzzy, c-format
+msgid "OK - Command sent (%s)\n"
+msgstr "Commande: %s\n"
+
+#, c-format
+msgid "CRITICAL - SMART_READ_THRESHOLDS: %s\n"
+msgstr "CRITIQUE - SMART_READ_THRESHOLDS: %s\n"
+
+#, c-format
+msgid ""
+"This plugin checks a local hard drive with the (Linux specific) SMART "
+"interface [http://smartlinux.sourceforge.net/smart/index.php]."
+msgstr ""
+"Ce plugin vérifie un disque dur local à l'aide de l'interface SMART (pour "
+"Linux) [http://smartlinux.sourceforge.net/smart/index.php]."
+
+msgid "Select device DEVICE"
+msgstr ""
+
+msgid ""
+"Note: if the device is specified without this option, any further option will"
+msgstr ""
+
+msgid "be ignored."
+msgstr ""
+
+msgid ""
+"The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were"
+msgstr ""
+
+msgid ""
+"broken in an underhand manner and have been disabled. You can use smartctl"
+msgstr ""
+
+msgid "instead:"
+msgstr ""
+
+msgid "-0/--auto-off: use \"smartctl --offlineauto=off\""
+msgstr ""
+
+msgid "-1/--auto-on: use \"smartctl --offlineauto=on\""
+msgstr ""
+
+msgid "-i/--immediate: use \"smartctl --test=offline\""
+msgstr ""
+
+msgid "No data returned from command\n"
+msgstr "Pas de données reçues de la commande\n"
+
+msgid ""
+"Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
+"or integer (0-3)."
+msgstr ""
+"Le résultat de temps dépassé doit être un nom d'état valide (OK, WARNING, "
+"CRITICAL, UNKNOWN) ou un nombre entier (0-3)."
+
+msgid ""
+"Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer "
+"(0-3)."
+msgstr ""
+"Ok doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou un "
+"nombre entier (0-3)."
+
+msgid ""
+"Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+"Warning doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou "
+"un nombre entier (0-3)."
+
+msgid ""
+"Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+"Critical doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou "
+"un nombre entier (0-3)."
+
+msgid ""
+"Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+"Unknown doit être un nom d'état valide (OK, WARNING, CRITICAL, UNKNOWN) ou "
+"un nombre entier (0-3)."
+
+msgid "Require path to command"
+msgstr "Chemin vers la commande requis"
+
+msgid ""
+"Negates the status of a plugin (returns OK for CRITICAL and vice-versa)."
+msgstr ""
+"Inverse le statut d'un plugin (retourne OK pour CRITIQUE et vice-versa)."
+
+msgid "Additional switches can be used to control which state becomes what."
+msgstr ""
+"Des options additionnelles peuvent être utilisées pour contrôler quel état "
+"devient quoi."
+
+msgid "Keep timeout longer than the plugin timeout to retain CRITICAL status."
+msgstr ""
+"Utilisez un délai de réponse plus long que celui du plugin afin de conserver "
+"les résultats CRITIQUE"
+
+msgid "Custom result on Negate timeouts; see below for STATUS definition\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single\n"
+msgstr ""
+" STATUS peut être 'OK', 'WARNING', 'CRITICAL' ou 'UNKNOWN' sans les "
+"simple\n"
+
+#, c-format
+msgid ""
+" quotes. Numeric values are accepted. If nothing is specified, permutes\n"
+msgstr " quotes. Les valeurs numériques sont acceptées. Si rien n'est\n"
+
+#, c-format
+msgid " OK and CRITICAL.\n"
+msgstr " spécifié, inverse OK et CRITIQUE.\n"
+
+#, c-format
+msgid ""
+" Substitute output text as well. Will only substitute text in CAPITALS\n"
+msgstr ""
+
+msgid "Run check_ping and invert result. Must use full path to plugin"
+msgstr ""
+"Execute check_ping et inverse le résultat. Le chemin complet du plug-in doit "
+"être spécifié"
+
+msgid "This will return OK instead of WARNING and UNKNOWN instead of CRITICAL"
+msgstr ""
+"Ceci retournera OK au lieu de AVERTISSEMENT et INCONNU au lieu de CRITIQUE"
+
+msgid ""
+"This plugin is a wrapper to take the output of another plugin and invert it."
+msgstr ""
+"Ce plugin est un adaptateur qui prends l'état d'un autre plug-in et "
+"l'inverse."
+
+msgid "The full path of the plugin must be provided."
+msgstr "Le chemin complet du plugin doit être spécifié."
+
+msgid "If the wrapped plugin returns OK, the wrapper will return CRITICAL."
+msgstr "Si le plugin executé retourne OK, l'adaptateur retournera CRITIQUE."
+
+msgid "If the wrapped plugin returns CRITICAL, the wrapper will return OK."
+msgstr "Si le plugin executé retourne CRITIQUE, l'adaptateur retournera OK."
+
+msgid "Otherwise, the output state of the wrapped plugin is unchanged."
+msgstr "Autrement, l'état du plugin executé reste inchangé."
+
+msgid ""
+"Using timeout-result, it is possible to override the timeout behaviour or a"
+msgstr ""
+
+msgid "plugin by setting the negate timeout a bit lower."
+msgstr ""
+
+#, c-format
+msgid "%s - Socket timeout after %d seconds\n"
+msgstr "%s - Le socket n'a pas répondu dans les %d secondes\n"
+
+#, c-format
+msgid "%s - Abnormal timeout after %d seconds\n"
+msgstr "%s - Dépassement anormal du temps de réponse après %d secondes\n"
+
+msgid "Send failed"
+msgstr "L'envoi à échoué"
+
+msgid "No data was received from host!"
+msgstr "Pas de données reçues de l'hôte!"
+
+msgid "Socket creation failed"
+msgstr "La création du socket à échoué "
+
+msgid "Supplied path too long unix domain socket"
+msgstr "Le chemin fourni est trop long pour un socket unix"
+
+msgid "Receive failed"
+msgstr "La réception à échoué"
+
+#, c-format
+msgid "Invalid hostname/address - %s"
+msgstr "Adresse/Nom invalide - %s"
+
+msgid "Could not malloc argv array in popen()"
+msgstr "Impossible de réallouer un tableau pour les paramètres dans popen()"
+
+msgid "CRITICAL - You need more args!!!"
+msgstr "CRITIQUE - Vous devez spécifier plus d'arguments!!!"
+
+msgid "Cannot catch SIGCHLD"
+msgstr "impossible d'obtenir le signal SIGCHLD"
+
+#, c-format
+msgid "CRITICAL - Plugin timed out after %d seconds\n"
+msgstr "CRITIQUE - Le plugin n'as pas répondu dans les %d secondes\n"
+
+msgid "CRITICAL - popen timeout received, but no child process"
+msgstr ""
+"CRITIQUE - le temps d'attente à été dépassé dans la fonction popen, mais il "
+"n'y a pas de processus fils"
+
+#, c-format
+msgid ""
+"%s UNKNOWN - No data received from host\n"
+"CMD: %s</A>\n"
+msgstr ""
+"%s INCONNU - Pas de données reçues de l'hôte\n"
+"Commande: %s</A>\n"
+
+#, fuzzy
+msgid ""
+"This plugin wraps the text output of another command (plugin) in HTML <A>"
+msgstr ""
+"Ce plugin est un adaptateur qui prends l'état d'un autre plug-in et "
+"l'inverse."
+
+msgid ""
+"tags, thus displaying the child plugin's output as a clickable link in "
+"compatible"
+msgstr ""
+
+msgid ""
+"monitoring status screen. This plugin returns the status of the invoked "
+"plugin."
+msgstr ""
+
+msgid ""
+"Pay close attention to quoting to ensure that the shell passes the expected"
+msgstr ""
+
+msgid "data to the plugin. For example, in:"
+msgstr ""
+
+msgid "urlize http://example.com/ check_http -H example.com -r 'two words'"
+msgstr ""
+
+msgid "the shell will remove the single quotes and urlize will see:"
+msgstr ""
+
+msgid "urlize http://example.com/ check_http -H example.com -r two words"
+msgstr ""
+
+msgid "You probably want:"
+msgstr ""
+
+msgid "urlize http://example.com/ \"check_http -H example.com -r 'two words'\""
+msgstr ""
+
+msgid "failed realloc in strpcpy\n"
+msgstr "La fonction realloc à échoué dans strpcpy\n"
+
+msgid "failed malloc in strscat\n"
+msgstr "La fonction malloc à échoué dans strscat\n"
+
+#, fuzzy
+msgid "failed malloc in xvasprintf\n"
+msgstr "La fonction malloc à échoué dans strscat\n"
+
+#, c-format
+msgid ""
+" %s (-h | --help) for detailed help\n"
+" %s (-V | --version) for version information\n"
+msgstr ""
+" %s (-h | --help) pour l'aide détaillée\n"
+" %s (-V | --version) pour les informations relative à la version\n"
+
+msgid ""
+"\n"
+"Options:\n"
+" -h, --help\n"
+" Print detailed help screen\n"
+" -V, --version\n"
+" Print version information\n"
+msgstr ""
+"\n"
+"Options:\n"
+" -h, --help\n"
+" Afficher l'aide détaillée\n"
+" -V, --version\n"
+" Afficher les informations relative à la version\n"
+
+#, c-format
+msgid ""
+" -H, --hostname=ADDRESS\n"
+" Host name, IP Address, or unix socket (must be an absolute path)\n"
+" -%c, --port=INTEGER\n"
+" Port number (default: %s)\n"
+msgstr ""
+" -H, --hostname=ADDRESS\n"
+" Nom d'hôte, Adresse IP, ou socket UNIX (doit être un chemin absolu)\n"
+" -%c, --port=INTEGER\n"
+" Numéro de port (défaut: %s)\n"
+
+msgid ""
+" -4, --use-ipv4\n"
+" Use IPv4 connection\n"
+" -6, --use-ipv6\n"
+" Use IPv6 connection\n"
+msgstr ""
+" -4, --use-ipv4\n"
+" Utiliser une connection IPv4\n"
+" -6, --use-ipv6\n"
+" Utiliser une connection IPv6\n"
+
+#, fuzzy
+msgid ""
+" -v, --verbose\n"
+" Show details for command-line debugging (output may be truncated by\n"
+" the monitoring system)\n"
+msgstr ""
+" -v, --verbose\n"
+" Affiche les informations de déboguage en ligne de commande (Nagios peut "
+"tronquer la sortie)\n"
+
+msgid ""
+" -w, --warning=DOUBLE\n"
+" Response time to result in warning status (seconds)\n"
+" -c, --critical=DOUBLE\n"
+" Response time to result in critical status (seconds)\n"
+msgstr ""
+" -w, --warning=DOUBLE\n"
+" Temps de réponse résultant en un état d'avertissement (secondes)\n"
+" -c, --critical=DOUBLE\n"
+" Temps de réponse résultant en un état critique (secondes)\n"
+
+msgid ""
+" -w, --warning=RANGE\n"
+" Warning range (format: start:end). Alert if outside this range\n"
+" -c, --critical=RANGE\n"
+" Critical range\n"
+msgstr ""
+" -w, --warning=RANGE\n"
+" Seuil d'avertissement (format: début:fin). Alerte à l'extérieur de la "
+"plage\n"
+" -c, --critical=RANGE\n"
+" Seuil critique\n"
+
+#, c-format
+msgid ""
+" -t, --timeout=INTEGER\n"
+" Seconds before connection times out (default: %d)\n"
+msgstr ""
+" -t, --timeout=INTEGER\n"
+" Délais de connection en secondes (défaut: %d)\n"
+
+#, fuzzy, c-format
+msgid ""
+" -t, --timeout=INTEGER\n"
+" Seconds before plugin times out (default: %d)\n"
+msgstr ""
+" -t, --timeout=INTEGER\n"
+" Délais de connection en secondes (défaut: %d)\n"
+
+#, fuzzy
+msgid ""
+" --extra-opts=[section][@file]\n"
+" Read options from an ini file. See\n"
+" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
+" for usage and examples.\n"
+msgstr ""
+" --extra-opts=[section][@file]\n"
+" Lire les options d'un fichier ini. Voir\n"
+" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
+" pour les instructions et examples.\n"
+
+#, fuzzy
+msgid ""
+" See:\n"
+" https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n"
+" for THRESHOLD format and examples.\n"
+msgstr ""
+" Voir:\n"
+" https://www.monitoring-plugins.org/doc/guidelines.html."
+"html#THRESHOLDFORMAT\n"
+" pour le format et examples des seuils (THRESHOLD).\n"
+
+#, fuzzy
+msgid ""
+"\n"
+"Send email to help@monitoring-plugins.org if you have questions regarding\n"
+"use of this software. To submit patches or suggest improvements, send email\n"
+"to devel@monitoring-plugins.org\n"
+"\n"
+msgstr ""
+"\n"
+"Envoyez un email à help@monitoring-plugins.org si vous avez des questions\n"
+"reliées à l'utilisation de ce logiciel. Pour envoyer des patches ou suggérer "
+"des\n"
+"améliorations, envoyez un email à devel@monitoring-plugins.org\n"
+"\n"
+
+#, fuzzy
+msgid ""
+"\n"
+"The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may "
+"redistribute\n"
+"copies of the plugins under the terms of the GNU General Public License.\n"
+"For more information about these matters, see the file named COPYING.\n"
+msgstr ""
+"\n"
+"Les plugins de Nagios ne portent AUCUNE GARANTIE. Vous pouvez redistribuer\n"
+"des copies des plugins selon les termes de la GNU General Public License.\n"
+"Pour de plus ample informations, voir le fichier COPYING.\n"
+
+#, c-format
+msgid "Error: Could not get hardware address of interface '%s'\n"
+msgstr ""
+"Erreur: Impossible d'obtenir l'adresse matérielle pour l'interface '%s'\n"
+
+#, c-format
+msgid "Error: if_nametoindex error - %s.\n"
+msgstr "Erreur: if_nametoindex erreur - %s.\n"
+
+#, c-format
+msgid "Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"
+msgstr ""
+"Erreur: Impossible d'obtenir l'adresse matérielle depuis %s. erreur sysctl 1 "
+"- %s.\n"
+
+#, c-format
+msgid ""
+"Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"
+msgstr ""
+"Erreur: Impossible d'obtenir l'adresse matérielle depuis l'interface %s\n"
+" erreur malloc - %s.\n"
+
+#, c-format
+msgid "Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"
+msgstr ""
+"Erreur: Impossible d'obtenir l'adresse matérielle depuis %s erreur sysctl 2 "
+"- %s.\n"
+
+#, c-format
+msgid ""
+"Error: can't find unit number in interface_name (%s) - expecting TypeNumber "
+"eg lnc0.\n"
+msgstr ""
+"Erreur: impossible de trouver le numéro dans le nom de l'interface (%s).\n"
+"J'attendais le nom suivi du type ex lnc0.\n"
+
+#, c-format
+msgid ""
+"Error: can't read MAC address from DLPI streams interface for device %s unit "
+"%d.\n"
+msgstr ""
+"Erreur: impossible de lire l'adresse MAC depuis l'interface DLPI pour le \n"
+"périphérique %s numéro %d.\n"
+
+#, c-format
+msgid ""
+"Error: can't get MAC address for this architecture. Use the --mac option.\n"
+msgstr ""
+"Erreur: impossible d'obtenir l'adresse MAC sur cette architecture. Utilisez "
+"l'option --mac.\n"
+
+#, c-format
+msgid "Error: Cannot determine IP address of interface %s\n"
+msgstr "Erreur: Impossible d'obtenir l'adresse IP de l'interface %s\n"
+
+#, c-format
+msgid "Error: Cannot get interface IP address on this platform.\n"
+msgstr "Erreur: Impossible d'obtenir l'adresse IP sur cette architecture.\n"
+
+#, c-format
+msgid "Pretending to be relay client %s\n"
+msgstr ""
+
+#, c-format
+msgid "DHCPDISCOVER to %s port %d\n"
+msgstr "DHCPDISCOVER vers %s port %d\n"
+
+#, c-format
+msgid "Result=ERROR\n"
+msgstr "Résultat=ERREUR\n"
+
+#, c-format
+msgid "Result=OK\n"
+msgstr "Résultat=OK\n"
+
+#, c-format
+msgid "DHCPOFFER from IP address %s"
+msgstr "DHCPOFFER depuis l'adresse IP %s"
+
+#, c-format
+msgid " via %s\n"
+msgstr " depuis %s\n"
+
+#, c-format
+msgid ""
+"DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"
+msgstr ""
+"DHCPOFFER XID (%u) ne correspond pas au DHCPDISCOVER XID (%u) - paquet "
+"ignoré\n"
+
+#, c-format
+msgid "DHCPOFFER hardware address did not match our own - ignoring packet\n"
+msgstr ""
+"l'adresse matérielle du DHCPOFFER ne correspond pas à la notre paquet "
+"ignoré\n"
+
+#, c-format
+msgid "Total responses seen on the wire: %d\n"
+msgstr "Nombre total de réponses vues: %d\n"
+
+#, c-format
+msgid "Valid responses for this machine: %d\n"
+msgstr "Nombre de réponse valides pour cette machine: %d\n"
+
+#, c-format
+msgid "send_dhcp_packet result: %d\n"
+msgstr "résultat de send_dchp_packet: %d\n"
+
+#, c-format
+msgid "No (more) data received (nfound: %d)\n"
+msgstr "Plus de données reçues (nfound: %d)\n"
+
+#, c-format
+msgid "recvfrom() failed, "
+msgstr "recvfrom() a échoué, "
+
+#, c-format
+msgid "receive_dhcp_packet() result: %d\n"
+msgstr "résultat de receive_dchp_packet(): %d\n"
+
+#, c-format
+msgid "receive_dhcp_packet() source: %s\n"
+msgstr "source de receive_dchp_packet(): %s\n"
+
+#, c-format
+msgid "Error: Could not create socket!\n"
+msgstr "Erreur: Impossible de créer un socket!\n"
+
+#, c-format
+msgid "Error: Could not set reuse address option on DHCP socket!\n"
+msgstr ""
+"Erreur: Impossible de configurer l'option de réutilisation de l'adresse sur\n"
+"le socket DHCP!\n"
+
+#, c-format
+msgid "Error: Could not set broadcast option on DHCP socket!\n"
+msgstr ""
+"Erreur: Impossible de configurer l'option broadcast sur le socket DHCP!\n"
+
+#, c-format
+msgid ""
+"Error: Could not bind socket to interface %s. Check your privileges...\n"
+msgstr ""
+"Erreur: Impossible de connecter le socket à l'interface %s.\n"
+"Vérifiez vos droits...\n"
+
+#, c-format
+msgid ""
+"Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"
+msgstr ""
+"Erreur: Impossible de se connecter au socket (port %d)! Vérifiez vos "
+"droits..\n"
+
+#, c-format
+msgid "Requested server address: %s\n"
+msgstr "Adresse serveur demandée: %s\n"
+
+#, c-format
+msgid "Lease Time: Infinite\n"
+msgstr "Durée du Bail: Infini\n"
+
+#, c-format
+msgid "Lease Time: %lu seconds\n"
+msgstr "Durée du Bail: %lu secondes\n"
+
+#, c-format
+msgid "Renewal Time: Infinite\n"
+msgstr "Renouvellement du bail: Infini\n"
+
+#, c-format
+msgid "Renewal Time: %lu seconds\n"
+msgstr "Durée du renouvellement = %lu secondes\n"
+
+#, c-format
+msgid "Rebinding Time: Infinite\n"
+msgstr "Délai de nouvelle demande: Infini\n"
+
+#, c-format
+msgid "Rebinding Time: %lu seconds\n"
+msgstr "Délai de nouvelle demande: %lu secondes\n"
+
+#, c-format
+msgid "Added offer from server @ %s"
+msgstr "Rajouté offre du serveur @ %s"
+
+#, c-format
+msgid " of IP address %s\n"
+msgstr "de l'adresse IP %s\n"
+
+#, c-format
+msgid "DHCP Server Match: Offerer=%s"
+msgstr "Correspondance du serveur DHCP: Offrant=%s"
+
+#, c-format
+msgid " Requested=%s"
+msgstr " Demandé=%s"
+
+#, c-format
+msgid " (duplicate)"
+msgstr ""
+
+#, c-format
+msgid "\n"
+msgstr ""
+
+#, c-format
+msgid "No DHCPOFFERs were received.\n"
+msgstr "Pas de DHCPOFFERs reçus.\n"
+
+#, c-format
+msgid "Received %d DHCPOFFER(s)"
+msgstr "Reçu %d DHCPOFFER(s)"
+
+#, fuzzy, c-format
+msgid ", Rogue DHCP Server detected! Server %s"
+msgstr "Correspondance du serveur DHCP: Offrant=%s"
+
+#, c-format
+msgid " offered %s \n"
+msgstr ""
+
+#, c-format
+msgid ", %s%d of %d requested servers responded"
+msgstr ", %s%d de %d serveurs ont répondus"
+
+#, c-format
+msgid ", requested address (%s) was %soffered"
+msgstr ", l'adresse demandée (%s) %s été offerte"
+
+msgid "not "
+msgstr ""
+
+#, c-format
+msgid ", max lease time = "
+msgstr ", bail maximum = "
+
+#, c-format
+msgid "Infinity"
+msgstr "Infini"
+
+msgid "Got unexpected non-option argument"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"
+msgstr ""
+"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans check_ctrl: %s.\n"
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"
+msgstr ""
+"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans put_ctrl/putmsg(): "
+"%s.\n"
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"
+msgstr ""
+"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans put_both/putmsg().\n"
+
+#, c-format
+msgid ""
+"Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"
+msgstr ""
+"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans dl_attach_req/"
+"open(%s..): %s.\n"
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"
+msgstr ""
+"Erreur: Impossible d'obtenir la MAC par l'API DLPI dans dl_bind/"
+"check_ctrl(): %s.\n"
+
+#, c-format
+msgid "Hardware address: "
+msgstr "Adresse matérielle: "
+
+msgid "This plugin tests the availability of DHCP servers on a network."
+msgstr "Ce plugin teste la disponibilité de serveurs DHCP dans un réseau."
+
+msgid "IP address of DHCP server that we must hear from"
+msgstr ""
+
+msgid "IP address that should be offered by at least one DHCP server"
+msgstr ""
+
+msgid "Seconds to wait for DHCPOFFER before timeout occurs"
+msgstr ""
+
+msgid "Interface to to use for listening (i.e. eth0)"
+msgstr ""
+
+msgid "MAC address to use in the DHCP request"
+msgstr ""
+
+msgid "Unicast testing: mimic a DHCP relay, requires -s"
+msgstr ""
+
+msgid ""
+"Only requested DHCP server may response (rogue DHCP server detection), "
+"requires -s"
+msgstr ""
+
+msgid "specify a target"
+msgstr ""
+
+msgid "Use IPv4 (default) or IPv6 to communicate with the targets"
+msgstr ""
+
+msgid "warning threshold (currently "
+msgstr "Valeurs pour le seuil d'avertissement (actuellement "
+
+msgid "critical threshold (currently "
+msgstr "Valeurs pour le seuil critique (actuellement "
+
+msgid ""
+"RTA, round trip average, mode warning,critical, ex. 100ms,200ms unit in ms"
+msgstr ""
+
+msgid "packet loss mode, ex. 40%,50% , unit in %"
+msgstr ""
+
+msgid "jitter mode warning,critical, ex. 40.000ms,50.000ms , unit in ms "
+msgstr ""
+
+msgid "MOS mode, between 0 and 4.4 warning,critical, ex. 3.5,3.0"
+msgstr ""
+
+msgid "score mode, max value 100 warning,critical, ex. 80,70 "
+msgstr ""
+
+msgid "detect out of order ICMP packts "
+msgstr ""
+
+msgid "specify a source IP address or device name"
+msgstr "spécifiez une adresse ou un nom d'hôte"
+
+msgid "number of packets to send (currently "
+msgstr "nombre de paquets à envoyer (actuellement "
+
+msgid "max packet interval (currently "
+msgstr ""
+
+msgid "max target interval (currently "
+msgstr ""
+
+msgid "number of alive hosts required for success"
+msgstr "nombre d'hôtes vivants requis pour réussite"
+
+msgid "TTL on outgoing packets (currently "
+msgstr ""
+
+msgid "timeout value (seconds, currently "
+msgstr ""
+
+msgid "Number of icmp data bytes to send"
+msgstr "Nombre de paquets ICMP à envoyer"
+
+msgid "Packet size will be data bytes + icmp header (currently"
+msgstr ""
+
+msgid "verbose"
+msgstr ""
+
+msgid "If none of R,P,J,M,S or O is specified, default behavior is -R -P"
+msgstr ""
+
+msgid "The -H switch is optional. Naming a host (or several) to check is not."
+msgstr ""
+
+msgid ""
+"Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"
+msgstr ""
+
+msgid "packet loss. The default values should work well for most users."
+msgstr ""
+
+msgid ""
+"You can specify different RTA factors using the standardized abbreviations"
+msgstr ""
+
+msgid ""
+"us (microseconds), ms (milliseconds, default) or just plain s for seconds."
+msgstr ""
+
+msgid "The -v switch can be specified several times for increased verbosity."
+msgstr ""
+
+#, fuzzy
+#~ msgid "Check only filesystems of indicated type (may be repeated)"
+#~ msgstr ""
+#~ "Ignorer tout les systèmes de fichiers qui correspondent au type indiqué "
+#~ "(peut être utilisé plusieurs fois)"
+
+#~ msgid "Path or partition (may be repeated)"
+#~ msgstr "Répertoire ou partition (peut être utilisé plusieurs fois)"
+
+#~ msgid ""
+#~ "value match). If multiple addresses are returned at once, you have to "
+#~ "match"
+#~ msgstr ""
+#~ "valeur correspond). Si plusieurs adresses sont retournées en même temps,"
+
+#~ msgid ""
+#~ "the whole string of addresses separated with commas (sorted "
+#~ "alphabetically)."
+#~ msgstr ""
+#~ "vous devrez toutes les inscrire séparées pas des virgules (en ordre "
+#~ "alphabétique)"
+
+#~ msgid "No specific parameters. No warning or critical threshold"
+#~ msgstr "Pas d'argument spécifique. Pas de seuil d'avertissement ou critique"
+
+#~ msgid "Can't find local IP for NAS-IP-Address"
+#~ msgstr "Impossible de trouver une addresse IP locale pour le NAS-IP-Address"
+
+#~ msgid "Warning free space should be more than critical free space"
+#~ msgstr ""
+#~ "Le seuil d'avertissement pour la place libre doit être plus grand que le "
+#~ "seuil critique"
+
+#, c-format
+#~ msgid "%s - Plugin timed out after %d seconds\n"
+#~ msgstr "%s - Le plugin n'as pas répondu dans les %d secondes\n"
+
+#~ msgid "Critical Process Count must be an integer!"
+#~ msgstr "Critique Le total des processus doit être un nombre entier!"
+
+#~ msgid "Warning Process Count must be an integer!"
+#~ msgstr "Avertissement Le total des processus doit être un nombre entier!"
+
+#~ msgid "wmax (%d) cannot be greater than cmax (%d)\n"
+#~ msgstr "wmax (%d) ne peut pas être plus grand que cmax (%d)\n"
+
+#~ msgid "wmin (%d) cannot be less than cmin (%d)\n"
+#~ msgstr "wmin (%d) ne peut pas être plus petit que cmin (%d)\n"
+
+#~ msgid "CRITICAL - Cannot retrieve server certificate."
+#~ msgstr "CRITIQUE - Impossible d'obtenir le certificat du serveur"
+
+#~ msgid "OIDs."
+#~ msgstr "OIDs."
+
+#~ msgid "CRITICAL - Cannot retrieve server certificate.\n"
+#~ msgstr "CRITIQUE - Impossible d'obtenir le certificat du serveur.\n"
+
+#~ msgid "Usage: "
+#~ msgstr "Utilisation: "
+
+#~ msgid ""
+#~ " See: http://nagiosplugins.org/extra-opts for --extra-opts usage and "
+#~ "examples.\n"
+#~ msgstr ""
+#~ " Voir: http://nagiosplugins.org/extra-opts pour le format et examples de "
+#~ "--extra-opts.\n"
diff --git a/po/monitoring-plugins.pot b/po/monitoring-plugins.pot
new file mode 100644
index 0000000..6b63fd9
--- /dev/null
+++ b/po/monitoring-plugins.pot
@@ -0,0 +1,4982 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Monitoring Plugins Development Team
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: devel@monitoring-plugins.org\n"
+"POT-Creation-Date: 2023-10-01 15:10+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+msgid "Could not parse arguments"
+msgstr ""
+
+msgid "Cannot catch SIGALRM"
+msgstr ""
+
+#, c-format
+msgid "SSH connection failed: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Remote command execution failed: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s - check_by_ssh: Remote command '%s' returned status %d\n"
+msgstr ""
+
+#, c-format
+msgid "SSH WARNING: could not open %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Error parsing output\n"
+msgstr ""
+
+msgid "Timeout interval must be a positive integer"
+msgstr ""
+
+msgid "Port must be a positive integer"
+msgstr ""
+
+msgid "skip-stdout argument must be an integer"
+msgstr ""
+
+msgid "skip-stderr argument must be an integer"
+msgstr ""
+
+#, c-format
+msgid "%s: You must provide a host name\n"
+msgstr ""
+
+msgid "No remotecmd"
+msgstr ""
+
+#, c-format
+msgid "%s: Argument limit of %d exceeded\n"
+msgstr ""
+
+msgid "Can not (re)allocate 'commargv' buffer\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: In passive mode, you must provide a service name for each command.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: In passive mode, you must provide the host short name from the "
+"monitoring configs.\n"
+msgstr ""
+
+#, c-format
+msgid "This plugin uses SSH to execute commands on a remote host"
+msgstr ""
+
+msgid "tell ssh to use Protocol 1 [optional]"
+msgstr ""
+
+msgid "tell ssh to use Protocol 2 [optional]"
+msgstr ""
+
+msgid "Ignore all or (if specified) first n lines on STDOUT [optional]"
+msgstr ""
+
+msgid "Ignore all or (if specified) first n lines on STDERR [optional]"
+msgstr ""
+
+msgid "Exit with an warning, if there is an output on STDERR"
+msgstr ""
+
+msgid ""
+"tells ssh to fork rather than create a tty [optional]. This will always "
+"return OK if ssh is executed"
+msgstr ""
+
+msgid "command to execute on the remote machine"
+msgstr ""
+
+msgid "SSH user name on remote host [optional]"
+msgstr ""
+
+msgid "identity of an authorized key [optional]"
+msgstr ""
+
+msgid "external command file for monitoring [optional]"
+msgstr ""
+
+msgid "list of monitoring service names, separated by ':' [optional]"
+msgstr ""
+
+msgid "short name of host in the monitoring configuration [optional]"
+msgstr ""
+
+msgid "Call ssh with '-o OPTION' (may be used multiple times) [optional]"
+msgstr ""
+
+msgid "Tell ssh to use this configfile [optional]"
+msgstr ""
+
+msgid "Tell ssh to suppress warning and diagnostic messages [optional]"
+msgstr ""
+
+msgid "Make connection problems return UNKNOWN instead of CRITICAL"
+msgstr ""
+
+msgid "The most common mode of use is to refer to a local identity file with"
+msgstr ""
+
+msgid "the '-i' option. In this mode, the identity pair should have a null"
+msgstr ""
+
+msgid "passphrase and the public key should be listed in the authorized_keys"
+msgstr ""
+
+msgid "file of the remote host. Usually the key will be restricted to running"
+msgstr ""
+
+msgid "only one command on the remote server. If the remote SSH server tracks"
+msgstr ""
+
+msgid "invocation arguments, the one remote program may be an agent that can"
+msgstr ""
+
+msgid "execute additional commands as proxy"
+msgstr ""
+
+msgid "To use passive mode, provide multiple '-C' options, and provide"
+msgstr ""
+
+msgid ""
+"all of -O, -s, and -n options (servicelist order must match '-C'options)"
+msgstr ""
+
+msgid "Examples:"
+msgstr ""
+
+msgid "Usage:"
+msgstr ""
+
+#, c-format
+msgid "Host/Service Cluster Plugin for Monitoring"
+msgstr ""
+
+msgid "Options:"
+msgstr ""
+
+msgid "Check service cluster status"
+msgstr ""
+
+msgid "Check host cluster status"
+msgstr ""
+
+msgid "Optional prepended text output (i.e. \"Host cluster\")"
+msgstr ""
+
+msgid "Specifies the range of hosts or services in cluster that must be in a"
+msgstr ""
+
+msgid "non-OK state in order to return a WARNING status level"
+msgstr ""
+
+msgid "non-OK state in order to return a CRITICAL status level"
+msgstr ""
+
+msgid "The status codes of the hosts or services in the cluster, separated by"
+msgstr ""
+
+msgid "commas"
+msgstr ""
+
+msgid "Notes:"
+msgstr ""
+
+msgid ""
+"Will alert critical if there are 3 or more service data points in a non-OK"
+msgstr ""
+
+msgid "state."
+msgstr ""
+
+#, c-format
+msgid "Looking for: '%s'\n"
+msgstr ""
+
+msgid "dig returned an error status"
+msgstr ""
+
+msgid "Server not found in ANSWER SECTION"
+msgstr ""
+
+msgid "No ANSWER SECTION found"
+msgstr ""
+
+msgid "Probably a non-existent host/domain"
+msgstr ""
+
+#, c-format
+msgid "Port must be a positive integer - %s"
+msgstr ""
+
+#, c-format
+msgid "Warning interval must be a positive integer - %s"
+msgstr ""
+
+#, c-format
+msgid "Critical interval must be a positive integer - %s"
+msgstr ""
+
+#, c-format
+msgid "Timeout interval must be a positive integer - %s"
+msgstr ""
+
+#, c-format
+msgid "This plugin tests the DNS service on the specified host using dig"
+msgstr ""
+
+msgid "Force dig to only use IPv4 query transport"
+msgstr ""
+
+msgid "Force dig to only use IPv6 query transport"
+msgstr ""
+
+msgid "Machine name to lookup"
+msgstr ""
+
+msgid "Record type to lookup (default: A)"
+msgstr ""
+
+msgid ""
+"An address expected to be in the answer section. If not set, uses whatever"
+msgstr ""
+
+msgid "was in -l"
+msgstr ""
+
+msgid "Pass STRING as argument(s) to dig"
+msgstr ""
+
+#, c-format
+msgid "DISK %s: %s not found\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL"
+msgstr ""
+
+#, c-format
+msgid "unit type %s not known\n"
+msgstr ""
+
+#, c-format
+msgid "failed allocating storage for '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "UNKNOWN"
+msgstr ""
+
+msgid "Must set a threshold value before using -p\n"
+msgstr ""
+
+msgid "Could not compile regular expression"
+msgstr ""
+
+msgid "Must set -E before selecting paths\n"
+msgstr ""
+
+msgid "Must set group value before selecting paths\n"
+msgstr ""
+
+msgid ""
+"Paths need to be selected before using -i/-I. Use -A to select all paths "
+"explicitly"
+msgstr ""
+
+msgid ""
+"Must set a threshold value before using -r/-R/-A (--ereg-path/--eregi-path/--"
+"all)\n"
+msgstr ""
+
+msgid "Regular expression did not match any path or disk"
+msgstr ""
+
+msgid "Unknown argument"
+msgstr ""
+
+#, c-format
+msgid " for %s\n"
+msgstr ""
+
+msgid ""
+"This plugin checks the amount of used disk space on a mounted file system"
+msgstr ""
+
+msgid ""
+"and generates an alert if free space is less than one of the threshold values"
+msgstr ""
+
+msgid "Exit with WARNING status if less than INTEGER units of disk are free"
+msgstr ""
+
+msgid "Exit with WARNING status if less than PERCENT of disk space is free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than INTEGER units of disk are free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than PERCENT of disk space is free"
+msgstr ""
+
+msgid "Exit with WARNING status if less than PERCENT of inode space is free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than PERCENT of inode space is free"
+msgstr ""
+
+msgid ""
+"Mount point or block device as emitted by the mount(8) command (may be "
+"repeated)"
+msgstr ""
+
+msgid "Ignore device (only works if -p unspecified)"
+msgstr ""
+
+msgid "Clear thresholds"
+msgstr ""
+
+msgid "For paths or partitions specified with -p, only check for exact paths"
+msgstr ""
+
+msgid "Display only devices/mountpoints with errors"
+msgstr ""
+
+msgid "Don't account root-reserved blocks into freespace in perfdata"
+msgstr ""
+
+msgid "Display inode usage in perfdata"
+msgstr ""
+
+msgid ""
+"Group paths. Thresholds apply to (free-)space of all partitions together"
+msgstr ""
+
+msgid "Same as '--units kB'"
+msgstr ""
+
+msgid "Only check local filesystems"
+msgstr ""
+
+msgid ""
+"Only check local filesystems against thresholds. Yet call stat on remote "
+"filesystems"
+msgstr ""
+
+msgid "to test if they are accessible (e.g. to detect Stale NFS Handles)"
+msgstr ""
+
+msgid "Display the (block) device instead of the mount point"
+msgstr ""
+
+msgid "Same as '--units MB'"
+msgstr ""
+
+msgid "Explicitly select all paths. This is equivalent to -R '.*'"
+msgstr ""
+
+msgid ""
+"Case insensitive regular expression for path/partition (may be repeated)"
+msgstr ""
+
+msgid "Regular expression for path or partition (may be repeated)"
+msgstr ""
+
+msgid ""
+"Regular expression to ignore selected path/partition (case insensitive) (may "
+"be repeated)"
+msgstr ""
+
+msgid ""
+"Regular expression to ignore selected path or partition (may be repeated)"
+msgstr ""
+
+msgid ""
+"Return OK if no filesystem matches, filesystem does not exist or is "
+"inaccessible."
+msgstr ""
+
+msgid "(Provide this option before -p / -r / --ereg-path if used)"
+msgstr ""
+
+msgid "Choose bytes, kB, MB, GB, TB (default: MB)"
+msgstr ""
+
+msgid ""
+"Ignore all filesystems of types matching given regex(7) (may be repeated)"
+msgstr ""
+
+msgid ""
+"Check only filesystems where the type matches this given regex(7) (may be "
+"repeated)"
+msgstr ""
+
+msgid "General usage hints:"
+msgstr ""
+
+msgid ""
+"- Arguments are positional! \"-w 5 -c 1 -p /foo -w6 -c2 -p /bar\" is not the "
+"same as"
+msgstr ""
+
+msgid "\"-w 5 -c 1 -p /bar w6 -c2 -p /foo\"."
+msgstr ""
+
+msgid ""
+"- The syntax is broadly: \"{thresholds a} {paths a} -C {thresholds b} "
+"{thresholds b} ...\""
+msgstr ""
+
+msgid "Checks /tmp and /var at 10% and 5%, and / at 100MB and 50MB"
+msgstr ""
+
+msgid ""
+"Checks all filesystems not matching -r at 100M and 50M. The fs matching the -"
+"r regex"
+msgstr ""
+
+msgid ""
+"are grouped which means the freespace thresholds are applied to all disks "
+"together"
+msgstr ""
+
+msgid ""
+"Checks /foo for 1000M/500M and /bar for 5/3%. All remaining volumes use "
+"100M/50M"
+msgstr ""
+
+#, c-format
+msgid "%s %s: %s\n"
+msgstr ""
+
+msgid "is not accessible"
+msgstr ""
+
+msgid "nslookup returned an error status"
+msgstr ""
+
+msgid "Warning plugin error"
+msgstr ""
+
+#, c-format
+msgid "DNS CRITICAL - '%s' returned empty server string\n"
+msgstr ""
+
+#, c-format
+msgid "DNS CRITICAL - No response from DNS %s\n"
+msgstr ""
+
+#, c-format
+msgid "DNS CRITICAL - '%s' returned empty host name string\n"
+msgstr ""
+
+msgid "Non-authoritative answer:"
+msgstr ""
+
+#, c-format
+msgid "Domain '%s' was not found by the server\n"
+msgstr ""
+
+#, c-format
+msgid "DNS CRITICAL - '%s' msg parsing exited with no address\n"
+msgstr ""
+
+#, c-format
+msgid "expected '%s' but got '%s'"
+msgstr ""
+
+#, c-format
+msgid "Domain '%s' was found by the server: '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "server %s is not authoritative for %s"
+msgstr ""
+
+#, c-format
+msgid "OK"
+msgstr ""
+
+#, c-format
+msgid "WARNING"
+msgstr ""
+
+#, c-format
+msgid "%.3f second response time"
+msgid_plural "%.3f seconds response time"
+msgstr[0] ""
+msgstr[1] ""
+
+#, c-format
+msgid ". %s returns %s"
+msgstr ""
+
+#, c-format
+msgid "DNS WARNING - %s\n"
+msgstr ""
+
+msgid " Probably a non-existent host/domain"
+msgstr ""
+
+#, c-format
+msgid "DNS CRITICAL - %s\n"
+msgstr ""
+
+#, c-format
+msgid "DNS UNKNOWN - %s\n"
+msgstr ""
+
+msgid "Note: nslookup is deprecated and may be removed from future releases."
+msgstr ""
+
+msgid "Consider using the `dig' or `host' programs instead. Run nslookup with"
+msgstr ""
+
+msgid "the `-sil[ent]' option to prevent this message from appearing."
+msgstr ""
+
+#, c-format
+msgid "No response from DNS %s\n"
+msgstr ""
+
+#, c-format
+msgid "DNS %s has no records\n"
+msgstr ""
+
+#, c-format
+msgid "Connection to DNS %s was refused\n"
+msgstr ""
+
+#, c-format
+msgid "Query was refused by DNS server at %s\n"
+msgstr ""
+
+#, c-format
+msgid "No information returned by DNS server at %s\n"
+msgstr ""
+
+msgid "Network is unreachable\n"
+msgstr ""
+
+#, c-format
+msgid "DNS failure for %s\n"
+msgstr ""
+
+msgid "Input buffer overflow\n"
+msgstr ""
+
+msgid ""
+"This plugin uses the nslookup program to obtain the IP address for the given "
+"host/domain query."
+msgstr ""
+
+msgid "An optional DNS server to use may be specified."
+msgstr ""
+
+msgid ""
+"If no DNS server is specified, the default server(s) specified in /etc/"
+"resolv.conf will be used."
+msgstr ""
+
+msgid "The name or address you want to query"
+msgstr ""
+
+msgid "Optional DNS server you want to use for the lookup"
+msgstr ""
+
+msgid ""
+"Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end"
+msgstr ""
+
+msgid ""
+"with a dot (.). This option can be repeated multiple times (Returns OK if any"
+msgstr ""
+
+msgid "value matches)."
+msgstr ""
+
+msgid ""
+"Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)"
+msgstr ""
+
+msgid "Cannot be used together with -a"
+msgstr ""
+
+msgid "Optionally expect the DNS server to be authoritative for the lookup"
+msgstr ""
+
+msgid "Return warning if elapsed time exceeds value. Default off"
+msgstr ""
+
+msgid "Return critical if elapsed time exceeds value. Default off"
+msgstr ""
+
+msgid ""
+"Return critical if the list of expected addresses does not match all "
+"addresses"
+msgstr ""
+
+msgid "returned. Default off"
+msgstr ""
+
+msgid "Arguments to check_dummy must be an integer"
+msgstr ""
+
+#, c-format
+msgid "Status %d is not a supported error state\n"
+msgstr ""
+
+msgid ""
+"This plugin will simply return the state corresponding to the numeric value"
+msgstr ""
+
+msgid "of the <state> argument with optional text"
+msgstr ""
+
+#, c-format
+msgid "Could not open pipe: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Could not open stderr for %s\n"
+msgstr ""
+
+msgid "FPING UNKNOWN - IP address not found\n"
+msgstr ""
+
+msgid "FPING UNKNOWN - invalid commandline argument\n"
+msgstr ""
+
+msgid "FPING UNKNOWN - failed system call\n"
+msgstr ""
+
+#, c-format
+msgid "FPING %s - %s (rta=%f ms)|%s\n"
+msgstr ""
+
+#, c-format
+msgid "FPING UNKNOWN - %s not found\n"
+msgstr ""
+
+#, c-format
+msgid "FPING CRITICAL - %s is unreachable\n"
+msgstr ""
+
+#, c-format
+msgid "FPING UNKNOWN - %s parameter error\n"
+msgstr ""
+
+#, c-format
+msgid "FPING CRITICAL - %s is down\n"
+msgstr ""
+
+#, c-format
+msgid "FPING %s - %s (loss=%.0f%%, rta=%f ms)|%s %s\n"
+msgstr ""
+
+#, c-format
+msgid "FPING %s - %s (loss=%.0f%% )|%s\n"
+msgstr ""
+
+msgid "Invalid hostname/address"
+msgstr ""
+
+msgid "IPv6 support not available\n"
+msgstr ""
+
+msgid "Packet size must be a positive integer"
+msgstr ""
+
+msgid "Packet count must be a positive integer"
+msgstr ""
+
+msgid "Target timeout must be a positive integer"
+msgstr ""
+
+msgid "Interval must be a positive integer"
+msgstr ""
+
+msgid "Hostname was not supplied"
+msgstr ""
+
+#, c-format
+msgid "%s: Only one threshold may be packet loss (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Only one threshold must be packet loss (%s)\n"
+msgstr ""
+
+msgid ""
+"This plugin will use the fping command to ping the specified host for a fast "
+"check"
+msgstr ""
+
+msgid "Note that it is necessary to set the suid flag on fping."
+msgstr ""
+
+msgid ""
+"name or IP Address of host to ping (IP Address bypasses name lookup, "
+"reducing system load)"
+msgstr ""
+
+msgid "warning threshold pair"
+msgstr ""
+
+msgid "critical threshold pair"
+msgstr ""
+
+msgid "Return OK after first successful reply"
+msgstr ""
+
+msgid "size of ICMP packet"
+msgstr ""
+
+msgid "number of ICMP packets to send"
+msgstr ""
+
+msgid "Target timeout (ms)"
+msgstr ""
+
+msgid "Interval (ms) between sending packets"
+msgstr ""
+
+msgid "name or IP Address of sourceip"
+msgstr ""
+
+msgid "source interface name"
+msgstr ""
+
+#, c-format
+msgid ""
+"THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel time "
+"(ms)"
+msgstr ""
+
+msgid ""
+"which triggers a WARNING or CRITICAL state, and <pl> is the percentage of"
+msgstr ""
+
+msgid "packet loss to trigger an alarm state."
+msgstr ""
+
+msgid "IPv4 is used by default. Specify -6 to use IPv6."
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Host type parameter incorrect!\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Host not found\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Game server down or unavailable\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Game server timeout\n"
+msgstr ""
+
+#, c-format
+msgid "This plugin tests game server connections with the specified host."
+msgstr ""
+
+msgid "Optional port of which to connect"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains game name"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains map name"
+msgstr ""
+
+msgid "Field number in raw qstat output that contains ping time"
+msgstr ""
+
+msgid ""
+"This plugin uses the 'qstat' command, the popular game server status query "
+"tool."
+msgstr ""
+
+msgid ""
+"If you don't have the package installed, you will need to download it from"
+msgstr ""
+
+msgid "https://github.com/multiplay/qstat before you can use this plugin."
+msgstr ""
+
+msgid "Paper Jam"
+msgstr ""
+
+msgid "Out of Paper"
+msgstr ""
+
+msgid "Printer Offline"
+msgstr ""
+
+msgid "Peripheral Error"
+msgstr ""
+
+msgid "Intervention Required"
+msgstr ""
+
+msgid "Toner Low"
+msgstr ""
+
+msgid "Insufficient Memory"
+msgstr ""
+
+msgid "A Door is Open"
+msgstr ""
+
+msgid "Output Tray is Full"
+msgstr ""
+
+msgid "Data too Slow for Engine"
+msgstr ""
+
+msgid "Unknown Paper Error"
+msgstr ""
+
+#, c-format
+msgid "Printer ok - (%s)\n"
+msgstr ""
+
+msgid "Port must be a positive short integer"
+msgstr ""
+
+msgid "This plugin tests the STATUS of an HP printer with a JetDirect card."
+msgstr ""
+
+msgid "Net-snmp must be installed on the computer running the plugin."
+msgstr ""
+
+msgid "The SNMP community name "
+msgstr ""
+
+#, c-format
+msgid "(default=%s)"
+msgstr ""
+
+msgid "Specify the port to check "
+msgstr ""
+
+msgid "Disable paper check "
+msgstr ""
+
+msgid "file does not exist or is not readable"
+msgstr ""
+
+msgid "Invalid certificate expiration period"
+msgstr ""
+
+msgid ""
+"Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional "
+"'+' suffix)"
+msgstr ""
+
+msgid "Invalid option - SSL is not available"
+msgstr ""
+
+msgid "Invalid max_redirs count"
+msgstr ""
+
+msgid "Invalid onredirect option"
+msgstr ""
+
+#, c-format
+msgid "option f:%d \n"
+msgstr ""
+
+msgid "Invalid port number"
+msgstr ""
+
+#, c-format
+msgid "Could Not Compile Regular Expression: %s"
+msgstr ""
+
+msgid "IPv6 support not available"
+msgstr ""
+
+msgid "You must specify a server address or host name"
+msgstr ""
+
+msgid ""
+"If you use a client certificate you must also specify a private key file"
+msgstr ""
+
+msgid "HTTP UNKNOWN - Memory allocation error\n"
+msgstr ""
+
+#, c-format
+msgid "%sServer date unknown, "
+msgstr ""
+
+#, c-format
+msgid "%sDocument modification date unknown, "
+msgstr ""
+
+#, c-format
+msgid "%sServer date \"%100s\" unparsable, "
+msgstr ""
+
+#, c-format
+msgid "%sDocument date \"%100s\" unparsable, "
+msgstr ""
+
+#, c-format
+msgid "%sDocument is %d seconds in the future, "
+msgstr ""
+
+#, c-format
+msgid "%sLast modified %.1f days ago, "
+msgstr ""
+
+#, c-format
+msgid "%sLast modified %d:%02d:%02d ago, "
+msgstr ""
+
+msgid "HTTP CRITICAL - Unable to open TCP socket\n"
+msgstr ""
+
+msgid "HTTP UNKNOWN - Could not allocate memory for full_page\n"
+msgstr ""
+
+msgid "HTTP CRITICAL - Error on receive\n"
+msgstr ""
+
+msgid "HTTP CRITICAL - No data received from host\n"
+msgstr ""
+
+#, c-format
+msgid "Invalid HTTP response received from host: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Invalid HTTP response received from host on port %d: %s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s\n"
+"%s"
+msgstr ""
+
+#, c-format
+msgid "Status line output matched \"%s\" - "
+msgstr ""
+
+#, c-format
+msgid "HTTP CRITICAL: Invalid Status Line (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "HTTP CRITICAL: Invalid Status (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "%s - "
+msgstr ""
+
+#, c-format
+msgid "%sheader '%s' not found on '%s://%s:%d%s', "
+msgstr ""
+
+#, c-format
+msgid "%sstring '%s' not found on '%s://%s:%d%s', "
+msgstr ""
+
+#, c-format
+msgid "%spattern not found, "
+msgstr ""
+
+#, c-format
+msgid "%spattern found, "
+msgstr ""
+
+#, c-format
+msgid "%sExecute Error: %s, "
+msgstr ""
+
+#, c-format
+msgid "%spage size %d too large, "
+msgstr ""
+
+#, c-format
+msgid "%spage size %d too small, "
+msgstr ""
+
+#, c-format
+msgid "%s - %d bytes in %.3f second response time %s|%s %s %s %s %s %s %s"
+msgstr ""
+
+#, c-format
+msgid "%s - %d bytes in %.3f second response time %s|%s %s"
+msgstr ""
+
+msgid "HTTP UNKNOWN - Could not allocate addr\n"
+msgstr ""
+
+msgid "HTTP UNKNOWN - Could not allocate URL\n"
+msgstr ""
+
+#, c-format
+msgid "HTTP UNKNOWN - Could not find redirect location - %s%s\n"
+msgstr ""
+
+#, c-format
+msgid "HTTP UNKNOWN - Empty redirect location%s\n"
+msgstr ""
+
+#, c-format
+msgid "HTTP UNKNOWN - Could not parse redirect location - %s%s\n"
+msgstr ""
+
+#, c-format
+msgid "HTTP WARNING - maximum redirection depth %d exceeded - %s://%s:%d%s%s\n"
+msgstr ""
+
+#, c-format
+msgid "HTTP CRITICAL - redirection creates an infinite loop - %s://%s:%d%s%s\n"
+msgstr ""
+
+#, c-format
+msgid "HTTP UNKNOWN - Redirection to port above %d - %s://%s:%d%s%s\n"
+msgstr ""
+
+#, c-format
+msgid "Redirection to %s://%s:%d%s\n"
+msgstr ""
+
+msgid "This plugin tests the HTTP service on the specified host. It can test"
+msgstr ""
+
+msgid "normal (http) and secure (https) servers, follow redirects, search for"
+msgstr ""
+
+msgid "strings and regular expressions, check connection times, and report on"
+msgstr ""
+
+msgid "certificate expiration times."
+msgstr ""
+
+#, c-format
+msgid "In the first form, make an HTTP request."
+msgstr ""
+
+#, c-format
+msgid ""
+"In the second form, connect to the server and check the TLS certificate."
+msgstr ""
+
+#, c-format
+msgid "NOTE: One or both of -H and -I must be specified"
+msgstr ""
+
+msgid "Host name argument for servers using host headers (virtual host)"
+msgstr ""
+
+msgid "Append a port to include it in the header (eg: example.com:5000)"
+msgstr ""
+
+msgid ""
+"IP address or name (use numeric address if possible to bypass DNS lookup)."
+msgstr ""
+
+msgid "Port number (default: "
+msgstr ""
+
+msgid ""
+"Connect via SSL. Port defaults to 443. VERSION is optional, and prevents"
+msgstr ""
+
+msgid "auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,"
+msgstr ""
+
+msgid "1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted."
+msgstr ""
+
+msgid "Enable SSL/TLS hostname extension support (SNI)"
+msgstr ""
+
+msgid ""
+"Minimum number of days a certificate has to be valid. Port defaults to 443"
+msgstr ""
+
+msgid ""
+"(when this option is used the URL is not checked by default. You can use"
+msgstr ""
+
+msgid " --continue-after-certificate to override this behavior)"
+msgstr ""
+
+msgid ""
+"Allows the HTTP check to continue after performing the certificate check."
+msgstr ""
+
+msgid "Does nothing unless -C is used."
+msgstr ""
+
+msgid "Name of file that contains the client certificate (PEM format)"
+msgstr ""
+
+msgid "to be used in establishing the SSL session"
+msgstr ""
+
+msgid "Name of file containing the private key (PEM format)"
+msgstr ""
+
+msgid "matching the client certificate"
+msgstr ""
+
+msgid "Comma-delimited list of strings, at least one of them is expected in"
+msgstr ""
+
+msgid "the first (status) line of the server response (default: "
+msgstr ""
+
+msgid ""
+"If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)"
+msgstr ""
+
+msgid "String to expect in the response headers"
+msgstr ""
+
+msgid "String to expect in the content"
+msgstr ""
+
+msgid "URL to GET or POST (default: /)"
+msgstr ""
+
+msgid "URL encoded http POST data"
+msgstr ""
+
+msgid "Set HTTP method."
+msgstr ""
+
+msgid "Don't wait for document body: stop reading after headers."
+msgstr ""
+
+msgid "(Note that this still does an HTTP GET or POST, not a HEAD.)"
+msgstr ""
+
+msgid "Warn if document is more than SECONDS old. the number can also be of"
+msgstr ""
+
+msgid "the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."
+msgstr ""
+
+msgid "specify Content-Type header media type when POSTing\n"
+msgstr ""
+
+msgid "Allow regex to span newlines (must precede -r or -R)"
+msgstr ""
+
+msgid "Search page for regex STRING"
+msgstr ""
+
+msgid "Search page for case-insensitive regex STRING"
+msgstr ""
+
+msgid "Return CRITICAL if found, OK if not\n"
+msgstr ""
+
+msgid "Username:password on sites with basic authentication"
+msgstr ""
+
+msgid "Username:password on proxy-servers with basic authentication"
+msgstr ""
+
+msgid "String to be sent in http header as \"User Agent\""
+msgstr ""
+
+msgid ""
+"Any other tags to be sent in http header. Use multiple times for additional "
+"headers"
+msgstr ""
+
+msgid "Print additional performance data"
+msgstr ""
+
+msgid "Print body content below status line"
+msgstr ""
+
+msgid "Wrap output in HTML link (obsoleted by urlize)"
+msgstr ""
+
+msgid "How to handle redirected pages. sticky is like follow but stick to the"
+msgstr ""
+
+msgid "specified IP address. stickyport also ensures port stays the same."
+msgstr ""
+
+msgid "Maximal number of redirects (default: "
+msgstr ""
+
+msgid "Minimum page size required (bytes) : Maximum page size required (bytes)"
+msgstr ""
+
+msgid "This plugin will attempt to open an HTTP connection with the host."
+msgstr ""
+
+msgid ""
+"Successful connects return STATE_OK, refusals and timeouts return "
+"STATE_CRITICAL"
+msgstr ""
+
+msgid ""
+"other errors return STATE_UNKNOWN. Successful connects, but incorrect "
+"response"
+msgstr ""
+
+msgid ""
+"messages from the host result in STATE_WARNING return values. If you are"
+msgstr ""
+
+msgid ""
+"checking a virtual server that uses 'host headers' you must supply the FQDN"
+msgstr ""
+
+msgid "(fully qualified domain name) as the [host_name] argument."
+msgstr ""
+
+msgid "This plugin can also check whether an SSL enabled web server is able to"
+msgstr ""
+
+msgid "serve content (optionally within a specified time) or whether the X509 "
+msgstr ""
+
+msgid "certificate is still valid for the specified number of days."
+msgstr ""
+
+msgid "Please note that this plugin does not check if the presented server"
+msgstr ""
+
+msgid "certificate matches the hostname of the server, or if the certificate"
+msgstr ""
+
+msgid "has a valid chain of trust to one of the locally installed CAs."
+msgstr ""
+
+msgid ""
+"When the 'www.verisign.com' server returns its content within 5 seconds,"
+msgstr ""
+
+msgid ""
+"a STATE_OK will be returned. When the server returns its content but exceeds"
+msgstr ""
+
+msgid ""
+"the 5-second threshold, a STATE_WARNING will be returned. When an error "
+"occurs,"
+msgstr ""
+
+msgid "a STATE_CRITICAL will be returned."
+msgstr ""
+
+msgid ""
+"When the certificate of 'www.verisign.com' is valid for more than 14 days,"
+msgstr ""
+
+msgid ""
+"a STATE_OK is returned. When the certificate is still valid, but for less "
+"than"
+msgstr ""
+
+msgid ""
+"14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when"
+msgstr ""
+
+msgid "the certificate is expired."
+msgstr ""
+
+msgid ""
+"When the certificate of 'www.verisign.com' is valid for more than 30 days,"
+msgstr ""
+
+msgid "30 days, but more than 14 days, a STATE_WARNING is returned."
+msgstr ""
+
+msgid ""
+"A STATE_CRITICAL will be returned when certificate expires in less than 14 "
+"days"
+msgstr ""
+
+msgid ""
+"check_http -I 192.168.100.35 -p 80 -u https://www.verisign.com/ -S -j "
+"CONNECT -H www.verisign.com "
+msgstr ""
+
+msgid ""
+"all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> -"
+"S(sl) -j CONNECT -H <webserver>"
+msgstr ""
+
+msgid ""
+"a STATE_CRITICAL will be returned. By adding a colon to the method you can "
+"set the method used"
+msgstr ""
+
+msgid "inside the proxied connection: -j CONNECT:POST"
+msgstr ""
+
+#, c-format
+msgid "Could not connect to the server at port %i\n"
+msgstr ""
+
+#, c-format
+msgid "Could not set protocol version %d\n"
+msgstr ""
+
+#, c-format
+msgid "Could not init TLS at port %i!\n"
+msgstr ""
+
+#, c-format
+msgid "TLS not supported by the libraries!\n"
+msgstr ""
+
+#, c-format
+msgid "Could not init startTLS at port %i!\n"
+msgstr ""
+
+#, c-format
+msgid "startTLS not supported by the library, needs LDAPv3!\n"
+msgstr ""
+
+#, c-format
+msgid "Could not bind to the LDAP server\n"
+msgstr ""
+
+#, c-format
+msgid "Could not search/find objectclasses in %s\n"
+msgstr ""
+
+#, c-format
+msgid "LDAP %s - found %d entries in %.3f seconds|%s %s\n"
+msgstr ""
+
+#, c-format
+msgid "LDAP %s - %.3f seconds response time|%s\n"
+msgstr ""
+
+#, c-format
+msgid "%s cannot be combined with %s"
+msgstr ""
+
+msgid "Please specify the host name\n"
+msgstr ""
+
+msgid "Please specify the LDAP base\n"
+msgstr ""
+
+msgid "ldap attribute to search (default: \"(objectclass=*)\""
+msgstr ""
+
+msgid "ldap base (eg. ou=my unit, o=my org, c=at"
+msgstr ""
+
+msgid "ldap bind DN (if required)"
+msgstr ""
+
+msgid ""
+"ldap password (if required, or set the password through environment variable "
+"'LDAP_PASSWORD')"
+msgstr ""
+
+msgid "use starttls mechanism introduced in protocol version 3"
+msgstr ""
+
+msgid "use ldaps (ldap v2 ssl method). this also sets the default port to"
+msgstr ""
+
+msgid "use ldap protocol version 2"
+msgstr ""
+
+msgid "use ldap protocol version 3"
+msgstr ""
+
+msgid "default protocol version:"
+msgstr ""
+
+msgid "Number of found entries to result in warning status"
+msgstr ""
+
+msgid "Number of found entries to result in critical status"
+msgstr ""
+
+msgid "If this plugin is called via 'check_ldaps', method 'STARTTLS' will be"
+msgstr ""
+
+#, c-format
+msgid ""
+" implied (using default port %i) unless --port=636 is specified. In that "
+"case\n"
+msgstr ""
+
+msgid "'SSL on connect' will be used no matter how the plugin was called."
+msgstr ""
+
+msgid ""
+"This detection is deprecated, please use 'check_ldap' with the '--starttls' "
+"or '--ssl' flags"
+msgstr ""
+
+msgid "to define the behaviour explicitly instead."
+msgstr ""
+
+msgid "The parameters --warn-entries and --crit-entries are optional."
+msgstr ""
+
+msgid "Warning threshold must be float or float triplet!\n"
+msgstr ""
+
+#, c-format
+msgid "Error opening %s\n"
+msgstr ""
+
+#, c-format
+msgid "could not parse load from uptime %s: %d\n"
+msgstr ""
+
+#, c-format
+msgid "Error code %d returned in %s\n"
+msgstr ""
+
+#, c-format
+msgid "Error in getloadavg()\n"
+msgstr ""
+
+#, c-format
+msgid "Error processing %s\n"
+msgstr ""
+
+#, c-format
+msgid "load average: %.2f, %.2f, %.2f"
+msgstr ""
+
+#, c-format
+msgid "Critical threshold for %d-minute load average is not specified\n"
+msgstr ""
+
+#, c-format
+msgid "Warning threshold for %d-minute load average is not specified\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Parameter inconsistency: %d-minute \"warning load\" is greater than "
+"\"critical load\"\n"
+msgstr ""
+
+#, c-format
+msgid "This plugin tests the current system load average."
+msgstr ""
+
+msgid "Exit with WARNING status if load average exceeds WLOADn"
+msgstr ""
+
+msgid "Exit with CRITICAL status if load average exceed CLOADn"
+msgstr ""
+
+msgid "the load average format is the same used by \"uptime\" and \"w\""
+msgstr ""
+
+msgid "Divide the load averages by the number of CPUs (when possible)"
+msgstr ""
+
+msgid "Number of processes to show when printing the top consuming processes."
+msgstr ""
+
+msgid "NUMBER_OF_PROCS=0 disables this feature. Default value is 0"
+msgstr ""
+
+#, c-format
+msgid "'%s' exited with non-zero status.\n"
+msgstr ""
+
+#, c-format
+msgid "some error occurred getting procs list.\n"
+msgstr ""
+
+msgid "Could not parse arguments\n"
+msgstr ""
+
+#, c-format
+msgid "Unable to open MRTG log file\n"
+msgstr ""
+
+#, c-format
+msgid "Unable to process MRTG log file\n"
+msgstr ""
+
+#, c-format
+msgid "MRTG data has expired (%d minutes old)\n"
+msgstr ""
+
+msgid "Avg"
+msgstr ""
+
+msgid "Max"
+msgstr ""
+
+msgid "Invalid variable number"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s is not a valid expiration time\n"
+"Use '%s -h' for additional help\n"
+msgstr ""
+
+msgid "Invalid variable number\n"
+msgstr ""
+
+msgid "You must supply the variable number"
+msgstr ""
+
+msgid ""
+"This plugin will check either the average or maximum value of one of the"
+msgstr ""
+
+msgid "two variables recorded in an MRTG log file."
+msgstr ""
+
+msgid "The MRTG log file containing the data you want to monitor"
+msgstr ""
+
+msgid "Minutes before MRTG data is considered to be too old"
+msgstr ""
+
+msgid "Should we check average or maximum values?"
+msgstr ""
+
+msgid "Which variable set should we inspect? (1 or 2)"
+msgstr ""
+
+msgid "Threshold value for data to result in WARNING status"
+msgstr ""
+
+msgid "Threshold value for data to result in CRITICAL status"
+msgstr ""
+
+msgid "Type label for data (Examples: Conns, \"Processor Load\", In, Out)"
+msgstr ""
+
+msgid "Option units label for data (Example: Packets/Sec, Errors/Sec,"
+msgstr ""
+
+#, c-format
+msgid "\"Bytes Per Second\", \"%% Utilization\")"
+msgstr ""
+
+msgid ""
+"If the value exceeds the <vwl> threshold, a WARNING status is returned. If"
+msgstr ""
+
+msgid ""
+"the value exceeds the <vcl> threshold, a CRITICAL status is returned. If"
+msgstr ""
+
+msgid "the data in the log file is older than <expire_minutes> old, a WARNING"
+msgstr ""
+
+msgid "status is returned and a warning message is printed."
+msgstr ""
+
+msgid ""
+"This plugin is useful for monitoring MRTG data that does not correspond to"
+msgstr ""
+
+msgid ""
+"bandwidth usage. (Use the check_mrtgtraf plugin for monitoring bandwidth)."
+msgstr ""
+
+msgid ""
+"It can be used to monitor any kind of data that MRTG is monitoring - errors,"
+msgstr ""
+
+msgid ""
+"packets/sec, etc. I use MRTG in conjunction with the Novell NLM that allows"
+msgstr ""
+
+msgid ""
+"me to track processor utilization, user connections, drive space, etc and"
+msgstr ""
+
+msgid "this plugin works well for monitoring that kind of data as well."
+msgstr ""
+
+msgid ""
+"- This plugin only monitors one of the two variables stored in the MRTG log"
+msgstr ""
+
+msgid "file. If you want to monitor both values you will have to define two"
+msgstr ""
+
+msgid "commands with different values for the <variable> argument. Of course,"
+msgstr ""
+
+msgid "you can always hack the code to make this plugin work for you..."
+msgstr ""
+
+msgid ""
+"- MRTG stands for the Multi Router Traffic Grapher. It can be downloaded "
+"from"
+msgstr ""
+
+msgid "Unable to open MRTG log file"
+msgstr ""
+
+msgid "Unable to process MRTG log file"
+msgstr ""
+
+#, c-format
+msgid "%s. In = %0.1f %s/s, %s. Out = %0.1f %s/s|%s %s\n"
+msgstr ""
+
+#, c-format
+msgid "Traffic %s - %s\n"
+msgstr ""
+
+msgid ""
+"This plugin will check the incoming/outgoing transfer rates of a router,"
+msgstr ""
+
+msgid "switch, etc recorded in an MRTG log. If the newest log entry is older"
+msgstr ""
+
+msgid "than <expire_minutes>, a WARNING status is returned. If either the"
+msgstr ""
+
+msgid "incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in"
+msgstr ""
+
+msgid "Bytes/sec), a CRITICAL status results. If either of the rates exceed"
+msgstr ""
+
+msgid "the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results."
+msgstr ""
+
+msgid "File to read log from"
+msgstr ""
+
+msgid "Minutes after which log expires"
+msgstr ""
+
+msgid "Test average or maximum"
+msgstr ""
+
+msgid "Warning threshold pair <incoming>,<outgoing>"
+msgstr ""
+
+msgid "Critical threshold pair <incoming>,<outgoing>"
+msgstr ""
+
+msgid ""
+"- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from"
+msgstr ""
+
+msgid "- While MRTG can monitor things other than traffic rates, this"
+msgstr ""
+
+msgid " plugin probably won't work with much else without modification."
+msgstr ""
+
+msgid "- The calculated i/o rates are a little off from what MRTG actually"
+msgstr ""
+
+msgid " reports. I'm not sure why this is right now, but will look into it"
+msgstr ""
+
+msgid " for future enhancements of this plugin."
+msgstr ""
+
+#, c-format
+msgid "Usage"
+msgstr ""
+
+#, c-format
+msgid "status store_result error: %s\n"
+msgstr ""
+
+#, c-format
+msgid "slave query error: %s\n"
+msgstr ""
+
+#, c-format
+msgid "slave store_result error: %s\n"
+msgstr ""
+
+msgid "No slaves defined"
+msgstr ""
+
+#, c-format
+msgid "slave fetch row error: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Slave running: %s"
+msgstr ""
+
+msgid "This program tests connections to a MySQL server"
+msgstr ""
+
+msgid "Ignore authentication failure and check for mysql connectivity only"
+msgstr ""
+
+msgid "Use the specified socket (has no effect if -H is used)"
+msgstr ""
+
+msgid "Check database with indicated name"
+msgstr ""
+
+msgid "Read from the specified client options file"
+msgstr ""
+
+msgid "Use a client options group"
+msgstr ""
+
+msgid "Connect using the indicated username"
+msgstr ""
+
+msgid "Use the indicated password to authenticate the connection"
+msgstr ""
+
+msgid "IMPORTANT: THIS FORM OF AUTHENTICATION IS NOT SECURE!!!"
+msgstr ""
+
+msgid "Your clear-text password could be visible as a process table entry"
+msgstr ""
+
+msgid "Check if the slave thread is running properly."
+msgstr ""
+
+msgid "Exit with WARNING status if slave server is more than INTEGER seconds"
+msgstr ""
+
+msgid "behind master"
+msgstr ""
+
+msgid "Exit with CRITICAL status if slave server is more then INTEGER seconds"
+msgstr ""
+
+msgid "Use ssl encryption"
+msgstr ""
+
+msgid "Path to CA signing the cert"
+msgstr ""
+
+msgid "Path to SSL certificate"
+msgstr ""
+
+msgid "Path to private SSL key"
+msgstr ""
+
+msgid "Path to CA directory"
+msgstr ""
+
+msgid "List of valid SSL ciphers"
+msgstr ""
+
+msgid ""
+"There are no required arguments. By default, the local database is checked"
+msgstr ""
+
+msgid ""
+"using the default unix socket. You can force TCP on localhost by using an"
+msgstr ""
+
+msgid "IP address or FQDN ('localhost' will use the socket as well)."
+msgstr ""
+
+msgid "You must specify -p with an empty string to force an empty password,"
+msgstr ""
+
+msgid "overriding any my.cnf settings."
+msgstr ""
+
+msgid "Cannot open status log for reading!"
+msgstr ""
+
+#, c-format
+msgid "Found process: %s %s\n"
+msgstr ""
+
+msgid "Could not locate a running Nagios process!"
+msgstr ""
+
+msgid "Cannot parse Nagios log file for valid time"
+msgstr ""
+
+#, c-format
+msgid "%d process"
+msgid_plural "%d processes"
+msgstr[0] ""
+msgstr[1] ""
+
+#, c-format
+msgid "status log updated %d second ago"
+msgid_plural "status log updated %d seconds ago"
+msgstr[0] ""
+msgstr[1] ""
+
+msgid "Expiration time must be an integer (seconds)\n"
+msgstr ""
+
+msgid "Timeout must be an integer (seconds)\n"
+msgstr ""
+
+msgid "You must provide the status_log\n"
+msgstr ""
+
+msgid "You must provide a process string\n"
+msgstr ""
+
+msgid ""
+"This plugin checks the status of the Nagios process on the local machine"
+msgstr ""
+
+msgid ""
+"The plugin will check to make sure the Nagios status log is no older than"
+msgstr ""
+
+msgid "the number of minutes specified by the expires option."
+msgstr ""
+
+msgid ""
+"It also checks the process table for a process matching the command argument."
+msgstr ""
+
+msgid "Name of the log file to check"
+msgstr ""
+
+msgid "Minutes aging after which logfile is considered stale"
+msgstr ""
+
+msgid "Substring to search for in process arguments"
+msgstr ""
+
+msgid "Timeout for the plugin in seconds"
+msgstr ""
+
+#, c-format
+msgid "Wrong client version - running: %s, required: %s"
+msgstr ""
+
+msgid "missing -l parameters"
+msgstr ""
+
+msgid "wrong -l parameter."
+msgstr ""
+
+msgid "CPU Load"
+msgstr ""
+
+#, c-format
+msgid " %lu%% (%lu min average)"
+msgstr ""
+
+#, c-format
+msgid " '%lu min avg Load'=%lu%%;%lu;%lu;0;100"
+msgstr ""
+
+msgid "not enough values for -l parameters"
+msgstr ""
+
+msgid "wrong -l argument"
+msgstr ""
+
+#, c-format
+msgid "System Uptime - %u day(s) %u hour(s) %u minute(s) |uptime=%lu"
+msgstr ""
+
+#, c-format
+msgid "%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"
+msgstr ""
+
+#, c-format
+msgid "'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"
+msgstr ""
+
+msgid "Free disk space : Invalid drive"
+msgstr ""
+
+msgid "No service/process specified"
+msgstr ""
+
+msgid "could not fetch information from server\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Memory usage: total:%.2f MB - used: %.2f MB (%.0f%%) - free: %.2f MB (%.0f%%)"
+msgstr ""
+
+#, c-format
+msgid "'Memory usage'=%.2fMB;%.2f;%.2f;0.00;%.2f"
+msgstr ""
+
+msgid "No counter specified"
+msgstr ""
+
+msgid "Minimum value contains non-numbers"
+msgstr ""
+
+msgid "Maximum value contains non-numbers"
+msgstr ""
+
+msgid "No unit counter specified"
+msgstr ""
+
+msgid "Please specify a variable to check"
+msgstr ""
+
+msgid "Server port must be an integer\n"
+msgstr ""
+
+msgid "You must provide a server address or host name"
+msgstr ""
+
+msgid "None"
+msgstr ""
+
+msgid "This plugin collects data from the NSClient service running on a"
+msgstr ""
+
+msgid "Windows NT/2000/XP/2003 server."
+msgstr ""
+
+msgid "Name of the host to check"
+msgstr ""
+
+msgid "Optional port number (default: "
+msgstr ""
+
+msgid "Password needed for the request"
+msgstr ""
+
+msgid "Threshold which will result in a warning status"
+msgstr ""
+
+msgid "Threshold which will result in a critical status"
+msgstr ""
+
+msgid "Seconds before connection attempt times out (default: "
+msgstr ""
+
+msgid "Parameters passed to specified check (see below)"
+msgstr ""
+
+msgid "Display options (currently only SHOWALL works)"
+msgstr ""
+
+msgid "Return UNKNOWN on timeouts"
+msgstr ""
+
+msgid "Print this help screen"
+msgstr ""
+
+msgid "Print version information"
+msgstr ""
+
+msgid "Variable to check"
+msgstr ""
+
+msgid "Valid variables are:"
+msgstr ""
+
+msgid "Get the NSClient version"
+msgstr ""
+
+msgid "If -l <version> is specified, will return warning if versions differ."
+msgstr ""
+
+msgid "Average CPU load on last x minutes."
+msgstr ""
+
+msgid "Request a -l parameter with the following syntax:"
+msgstr ""
+
+msgid "-l <minutes range>,<warning threshold>,<critical threshold>."
+msgstr ""
+
+msgid "<minute range> should be less than 24*60."
+msgstr ""
+
+msgid ""
+"Thresholds are percentage and up to 10 requests can be done in one shot."
+msgstr ""
+
+msgid "Get the uptime of the machine."
+msgstr ""
+
+msgid "-l <unit> "
+msgstr ""
+
+msgid "<unit> = seconds, minutes, hours, or days. (default: minutes)"
+msgstr ""
+
+msgid "Thresholds will use the unit specified above."
+msgstr ""
+
+msgid "Size and percentage of disk use."
+msgstr ""
+
+msgid "Request a -l parameter containing the drive letter only."
+msgstr ""
+
+msgid "Warning and critical thresholds can be specified with -w and -c."
+msgstr ""
+
+msgid "Memory use."
+msgstr ""
+
+msgid "Check the state of one or several services."
+msgstr ""
+
+msgid "Request a -l parameters with the following syntax:"
+msgstr ""
+
+msgid "-l <service1>,<service2>,<service3>,..."
+msgstr ""
+
+msgid "You can specify -d SHOWALL in case you want to see working services"
+msgstr ""
+
+msgid "in the returned string."
+msgstr ""
+
+msgid "Check if one or several process are running."
+msgstr ""
+
+msgid "Same syntax as SERVICESTATE."
+msgstr ""
+
+msgid "Check any performance counter of Windows NT/2000."
+msgstr ""
+
+msgid "-l \"\\\\<performance object>\\\\counter\",\"<description>"
+msgstr ""
+
+msgid "The <description> parameter is optional and is given to a printf "
+msgstr ""
+
+msgid "output command which requires a float parameter."
+msgstr ""
+
+#, c-format
+msgid "If <description> does not include \"%%\", it is used as a label."
+msgstr ""
+
+msgid "Some examples:"
+msgstr ""
+
+msgid "Check any performance counter object of Windows NT/2000."
+msgstr ""
+
+msgid ""
+"Syntax: check_nt -H <hostname> -p <port> -v INSTANCES -l <counter object>"
+msgstr ""
+
+msgid "<counter object> is a Windows Perfmon Counter object (eg. Process),"
+msgstr ""
+
+msgid "if it is two words, it should be enclosed in quotes"
+msgstr ""
+
+msgid "The returned results will be a comma-separated list of instances on "
+msgstr ""
+
+msgid " the selected computer for that object."
+msgstr ""
+
+msgid ""
+"The purpose of this is to be run from command line to determine what "
+"instances"
+msgstr ""
+
+msgid ""
+" are available for monitoring without having to log onto the Windows server"
+msgstr ""
+
+msgid " to run Perfmon directly."
+msgstr ""
+
+msgid ""
+"It can also be used in scripts that automatically create the monitoring "
+"service"
+msgstr ""
+
+msgid " configuration files."
+msgstr ""
+
+msgid "check_nt -H 192.168.1.1 -p 1248 -v INSTANCES -l Process"
+msgstr ""
+
+msgid ""
+"- The NSClient service should be running on the server to get any information"
+msgstr ""
+
+msgid "- Critical thresholds should be lower than warning thresholds"
+msgstr ""
+
+msgid "- Default port 1248 is sometimes in use by other services. The error"
+msgstr ""
+
+msgid ""
+"output when this happens contains \"Cannot map xxxxx to protocol number\"."
+msgstr ""
+
+msgid "One fix for this is to change the port to something else on check_nt "
+msgstr ""
+
+msgid "and on the client service it's connecting to."
+msgstr ""
+
+#, c-format
+msgid "jitter response too large (%lu bytes)\n"
+msgstr ""
+
+msgid "NTP CRITICAL:"
+msgstr ""
+
+msgid "NTP WARNING:"
+msgstr ""
+
+msgid "NTP OK:"
+msgstr ""
+
+msgid "NTP UNKNOWN:"
+msgstr ""
+
+msgid "Offset unknown"
+msgstr ""
+
+msgid "Offset"
+msgstr ""
+
+msgid "This plugin checks the selected ntp server"
+msgstr ""
+
+msgid "Offset to result in warning status (seconds)"
+msgstr ""
+
+msgid "Offset to result in critical status (seconds)"
+msgstr ""
+
+msgid "Warning threshold for jitter"
+msgstr ""
+
+msgid "Critical threshold for jitter"
+msgstr ""
+
+msgid "Normal offset check:"
+msgstr ""
+
+msgid ""
+"Check jitter too, avoiding critical notifications if jitter isn't available"
+msgstr ""
+
+msgid "(See Notes above for more details on thresholds formats):"
+msgstr ""
+
+msgid "WARNING: check_ntp is deprecated. Please use check_ntp_peer or"
+msgstr ""
+
+msgid "check_ntp_time instead."
+msgstr ""
+
+msgid "Server not synchronized"
+msgstr ""
+
+msgid "Server has the LI_ALARM bit set"
+msgstr ""
+
+msgid ""
+"Returns UNKNOWN instead of CRITICAL or WARNING if server isn't synchronized"
+msgstr ""
+
+msgid "Warning threshold for stratum of server's synchronization peer"
+msgstr ""
+
+msgid "Critical threshold for stratum of server's synchronization peer"
+msgstr ""
+
+msgid "Warning threshold for number of usable time sources (\"truechimers\")"
+msgstr ""
+
+msgid "Critical threshold for number of usable time sources (\"truechimers\")"
+msgstr ""
+
+msgid "This plugin checks an NTP server independent of any commandline"
+msgstr ""
+
+msgid "programs or external libraries."
+msgstr ""
+
+msgid "Use this plugin to check the health of an NTP server. It supports"
+msgstr ""
+
+msgid "checking the offset with the sync peer, the jitter and stratum. This"
+msgstr ""
+
+msgid "plugin will not check the clock offset between the local host and NTP"
+msgstr ""
+
+msgid "server; please use check_ntp_time for that purpose."
+msgstr ""
+
+msgid "Simple NTP server check:"
+msgstr ""
+
+msgid "Only check the number of usable time sources (\"truechimers\"):"
+msgstr ""
+
+msgid "Check only stratum:"
+msgstr ""
+
+msgid "This plugin checks the clock offset with the ntp server"
+msgstr ""
+
+msgid "Returns UNKNOWN instead of CRITICAL if offset cannot be found"
+msgstr ""
+
+msgid "Expected offset of the ntp server relative to local server (seconds)"
+msgstr ""
+
+msgid "This plugin checks the clock offset between the local host and a"
+msgstr ""
+
+msgid "remote NTP server. It is independent of any commandline programs or"
+msgstr ""
+
+msgid "external libraries."
+msgstr ""
+
+msgid "If you'd rather want to monitor an NTP server, please use"
+msgstr ""
+
+msgid "check_ntp_peer."
+msgstr ""
+
+msgid "--time-offset is useful for compensating for servers with known"
+msgstr ""
+
+msgid "and expected clock skew."
+msgstr ""
+
+#, c-format
+msgid "NetWare %s: "
+msgstr ""
+
+#, c-format
+msgid "Up %s,"
+msgstr ""
+
+#, c-format
+msgid "Load %s - %s %s-min load average = %lu%%|load%s=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "Conns %s - %lu current connections|Conns=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s: Long term cache hits = %lu%%"
+msgstr ""
+
+#, c-format
+msgid "%s: Total cache buffers = %lu|Cachebuffers=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s: Dirty cache buffers = %lu|Dirty-Cache-Buffers=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s: LRU sitting time = %lu minutes"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Volume '%s' does not exist!"
+msgstr ""
+
+#, c-format
+msgid "%s%lu KB free on volume %s|KBFree%s=%lu;%lu;%lu;;"
+msgstr ""
+
+msgid "Only "
+msgstr ""
+
+#, c-format
+msgid "%s%lu MB free on volume %s|MBFree%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s%lu MB used on volume %s|MBUsed%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid ""
+"%lu MB (%lu%%) free on volume %s - total %lu MB|FreeMB%s=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "Directory Services Database is %s (DS version %s)"
+msgstr ""
+
+#, c-format
+msgid "Logins are %s"
+msgstr ""
+
+msgid "enabled"
+msgstr ""
+
+msgid "disabled"
+msgstr ""
+
+msgid "CRITICAL - NRM Status is bad!"
+msgstr ""
+
+msgid "Warning - NRM Status is suspect!"
+msgstr ""
+
+msgid "OK - NRM Status is good!"
+msgstr ""
+
+#, c-format
+msgid "%lu of %lu (%lu%%) packet receive buffers used"
+msgstr ""
+
+#, c-format
+msgid "%lu entries in SAP table"
+msgstr ""
+
+#, c-format
+msgid "%lu entries in SAP table for SAP type %d"
+msgstr ""
+
+#, c-format
+msgid "%s%lu KB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%s%lu MB purgeable on volume %s|Purge%s=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%lu MB (%lu%%) purgeable on volume %s|Purgeable%s=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "%s%lu KB not yet purgeable on volume %s"
+msgstr ""
+
+#, c-format
+msgid "%lu MB (%lu%%) not yet purgeable on volume %s"
+msgstr ""
+
+#, c-format
+msgid "%lu open files|Openfiles=%lu;%lu;%lu;0,0"
+msgstr ""
+
+#, c-format
+msgid "%lu abended threads|Abends=%lu;%lu;%lu;;"
+msgstr ""
+
+#, c-format
+msgid "%lu current service processes (%lu max)|Processes=%lu;%lu;%lu;0;%lu"
+msgstr ""
+
+msgid "CRITICAL - Time not in sync with network!"
+msgstr ""
+
+msgid "OK - Time in sync with network!"
+msgstr ""
+
+#, c-format
+msgid "LRU sitting time = %lu seconds"
+msgstr ""
+
+#, c-format
+msgid "Dirty cache buffers = %lu%% of the total|DCB=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "Total cache buffers = %lu%% of the original|TCB=%lu;%lu;%lu;0;100"
+msgstr ""
+
+#, c-format
+msgid "NDS Version %s"
+msgstr ""
+
+#, c-format
+msgid "Up %s"
+msgstr ""
+
+#, c-format
+msgid "Module %s version %s is loaded"
+msgstr ""
+
+#, c-format
+msgid "Module %s is not loaded"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Value '%s' does not exist!"
+msgstr ""
+
+#, c-format
+msgid "%s is %lu|%s=%lu;%lu;%lu;;"
+msgstr ""
+
+msgid "Nothing to check!\n"
+msgstr ""
+
+msgid "Server port an integer\n"
+msgstr ""
+
+msgid "This plugin attempts to contact the MRTGEXT NLM running on a"
+msgstr ""
+
+msgid "Novell server to gather the requested system information."
+msgstr ""
+
+msgid "Variable to check. Valid variables include:"
+msgstr ""
+
+msgid "LOAD1 = 1 minute average CPU load"
+msgstr ""
+
+msgid "LOAD5 = 5 minute average CPU load"
+msgstr ""
+
+msgid "LOAD15 = 15 minute average CPU load"
+msgstr ""
+
+msgid "CSPROCS = number of current service processes (NW 5.x only)"
+msgstr ""
+
+msgid "ABENDS = number of abended threads (NW 5.x only)"
+msgstr ""
+
+msgid "UPTIME = server uptime"
+msgstr ""
+
+msgid "LTCH = percent long term cache hits"
+msgstr ""
+
+msgid "CBUFF = current number of cache buffers"
+msgstr ""
+
+msgid "CDBUFF = current number of dirty cache buffers"
+msgstr ""
+
+msgid "DCB = dirty cache buffers as a percentage of the total"
+msgstr ""
+
+msgid "TCB = dirty cache buffers as a percentage of the original"
+msgstr ""
+
+msgid "OFILES = number of open files"
+msgstr ""
+
+msgid " VMF<vol> = MB of free space on Volume <vol>"
+msgstr ""
+
+msgid " VMU<vol> = MB used space on Volume <vol>"
+msgstr ""
+
+msgid " VMP<vol> = MB of purgeable space on Volume <vol>"
+msgstr ""
+
+msgid " VPF<vol> = percent free space on volume <vol>"
+msgstr ""
+
+msgid " VKF<vol> = KB of free space on volume <vol>"
+msgstr ""
+
+msgid " VPP<vol> = percent purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VKP<vol> = KB of purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VPNP<vol> = percent not yet purgeable space on volume <vol>"
+msgstr ""
+
+msgid " VKNP<vol> = KB of not yet purgeable space on volume <vol>"
+msgstr ""
+
+msgid " LRUM = LRU sitting time in minutes"
+msgstr ""
+
+msgid " LRUS = LRU sitting time in seconds"
+msgstr ""
+
+msgid " DSDB = check to see if DS Database is open"
+msgstr ""
+
+msgid " DSVER = NDS version"
+msgstr ""
+
+msgid " UPRB = used packet receive buffers"
+msgstr ""
+
+msgid " PUPRB = percent (of max) used packet receive buffers"
+msgstr ""
+
+msgid " SAPENTRIES = number of entries in the SAP table"
+msgstr ""
+
+msgid " SAPENTRIES<n> = number of entries in the SAP table for SAP type <n>"
+msgstr ""
+
+msgid " TSYNC = timesync status"
+msgstr ""
+
+msgid " LOGINS = check to see if logins are enabled"
+msgstr ""
+
+msgid " CONNS = number of currently licensed connections"
+msgstr ""
+
+msgid " NRMH\t= NRM Summary Status"
+msgstr ""
+
+msgid " NRMP<stat> = Returns the current value for a NRM health item"
+msgstr ""
+
+msgid " NRMM<stat> = Returns the current memory stats from NRM"
+msgstr ""
+
+msgid " NRMS<stat> = Returns the current Swapfile stats from NRM"
+msgstr ""
+
+msgid " NSS1<stat> = Statistics from _Admin:Manage_NSS\\GeneralStats.xml"
+msgstr ""
+
+msgid " NSS3<stat> = Statistics from _Admin:Manage_NSS\\NameCache.xml"
+msgstr ""
+
+msgid " NSS4<stat> = Statistics from _Admin:Manage_NSS\\FileStats.xml"
+msgstr ""
+
+msgid " NSS5<stat> = Statistics from _Admin:Manage_NSS\\ObjectCache.xml"
+msgstr ""
+
+msgid " NSS6<stat> = Statistics from _Admin:Manage_NSS\\Thread.xml"
+msgstr ""
+
+msgid ""
+" NSS7<stat> = Statistics from _Admin:Manage_NSS\\AuthorizationCache.xml"
+msgstr ""
+
+msgid " NLM:<nlm> = check if NLM is loaded and report version"
+msgstr ""
+
+msgid " (e.g. NLM:TSANDS.NLM)"
+msgstr ""
+
+msgid "Include server version string in results"
+msgstr ""
+
+msgid "- This plugin requires that the MRTGEXT.NLM file from James Drews' MRTG"
+msgstr ""
+
+msgid ""
+" extension for NetWare be loaded on the Novell servers you wish to check."
+msgstr ""
+
+msgid " (available from http://www.engr.wisc.edu/~drews/mrtg/)"
+msgstr ""
+
+msgid ""
+"- Values for critical thresholds should be lower than warning thresholds"
+msgstr ""
+
+msgid ""
+" when the following variables are checked: VPF, VKF, LTCH, CBUFF, DCB, "
+msgstr ""
+
+msgid " TCB, LRUS and LRUM."
+msgstr ""
+
+msgid "Unknown error fetching load data\n"
+msgstr ""
+
+msgid "Invalid response from server - no load information\n"
+msgstr ""
+
+msgid "Invalid response from server after load 1\n"
+msgstr ""
+
+msgid "Invalid response from server after load 5\n"
+msgstr ""
+
+#, c-format
+msgid "Load %s - %s-min load average = %0.2f"
+msgstr ""
+
+msgid "Unknown error fetching disk data\n"
+msgstr ""
+
+msgid "Invalid response from server\n"
+msgstr ""
+
+msgid "Unknown error fetching network status\n"
+msgstr ""
+
+#, c-format
+msgid "Net %s - %d connection%s on port %d"
+msgstr ""
+
+msgid "Unknown error fetching process status\n"
+msgstr ""
+
+#, c-format
+msgid "Process %s - %d instance%s of %s running"
+msgstr ""
+
+#, c-format
+msgid "Uptime %s - Up %d days %d hours %d minutes"
+msgstr ""
+
+msgid ""
+"This plugin attempts to contact the Over-CR collector daemon running on the"
+msgstr ""
+
+msgid "remote UNIX server in order to gather the requested system information."
+msgstr ""
+
+msgid "LOAD1 = 1 minute average CPU load"
+msgstr ""
+
+msgid "LOAD5 = 5 minute average CPU load"
+msgstr ""
+
+msgid "LOAD15 = 15 minute average CPU load"
+msgstr ""
+
+msgid "DPU<filesys> = percent used disk space on filesystem <filesys>"
+msgstr ""
+
+msgid "PROC<process> = number of running processes with name <process>"
+msgstr ""
+
+msgid "NET<port> = number of active connections on TCP port <port>"
+msgstr ""
+
+msgid "UPTIME = system uptime in seconds"
+msgstr ""
+
+msgid "This plugin requires that Eric Molitors' Over-CR collector daemon be"
+msgstr ""
+
+msgid "running on the remote server."
+msgstr ""
+
+msgid "Over-CR can be downloaded from http://www.molitor.org/overcr"
+msgstr ""
+
+msgid "This plugin was tested with version 0.99.53 of the Over-CR collector"
+msgstr ""
+
+msgid ""
+"For the available options, the critical threshold value should always be"
+msgstr ""
+
+msgid ""
+"higher than the warning threshold value, EXCEPT with the uptime variable"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - no connection to '%s' (%s).\n"
+msgstr ""
+
+#, c-format
+msgid " %s - database %s (%f sec.)|%s\n"
+msgstr ""
+
+msgid "Critical threshold must be a positive integer"
+msgstr ""
+
+msgid "Warning threshold must be a positive integer"
+msgstr ""
+
+msgid "Database name exceeds the maximum length"
+msgstr ""
+
+msgid "User name is not valid"
+msgstr ""
+
+#, c-format
+msgid "Test whether a PostgreSQL Database is accepting connections."
+msgstr ""
+
+msgid "Database to check "
+msgstr ""
+
+#, c-format
+msgid "(default: %s)\n"
+msgstr ""
+
+msgid "Login name of user"
+msgstr ""
+
+msgid "Password (BIG SECURITY ISSUE)"
+msgstr ""
+
+msgid "Connection parameters (keyword = value), see below"
+msgstr ""
+
+msgid "SQL query to run. Only first column in first row will be read"
+msgstr ""
+
+msgid "A name for the query, this string is used instead of the query"
+msgstr ""
+
+msgid "in the long output of the plugin"
+msgstr ""
+
+msgid "SQL query value to result in warning status (double)"
+msgstr ""
+
+msgid "SQL query value to result in critical status (double)"
+msgstr ""
+
+msgid "All parameters are optional."
+msgstr ""
+
+msgid ""
+"This plugin tests a PostgreSQL DBMS to determine whether it is active and"
+msgstr ""
+
+msgid "accepting queries. In its current operation, it simply connects to the"
+msgstr ""
+
+msgid ""
+"specified database, and then disconnects. If no database is specified, it"
+msgstr ""
+
+msgid ""
+"connects to the template1 database, which is present in every functioning"
+msgstr ""
+
+msgid "PostgreSQL DBMS."
+msgstr ""
+
+msgid "If a query is specified using the -q option, it will be executed after"
+msgstr ""
+
+msgid "connecting to the server. The result from the query has to be numeric."
+msgstr ""
+
+msgid ""
+"Multiple SQL commands, separated by semicolon, are allowed but the result "
+msgstr ""
+
+msgid "of the last command is taken into account only. The value of the first"
+msgstr ""
+
+msgid ""
+"column in the first row is used as the check result. If a second column is"
+msgstr ""
+
+msgid "present in the result set, this is added to the plugin output with a"
+msgstr ""
+
+msgid ""
+"prefix of \"Extra Info:\". This information can be displayed in the system"
+msgstr ""
+
+msgid "executing the plugin."
+msgstr ""
+
+msgid ""
+"See the chapter \"Monitoring Database Activity\" of the PostgreSQL manual"
+msgstr ""
+
+msgid ""
+"for details about how to access internal statistics of the database server."
+msgstr ""
+
+msgid ""
+"For a list of available connection parameters which may be used with the -o"
+msgstr ""
+
+msgid ""
+"command line option, see the documentation for PQconnectdb() in the chapter"
+msgstr ""
+
+msgid ""
+"\"libpq - C Library\" of the PostgreSQL manual. For example, this may be"
+msgstr ""
+
+msgid ""
+"used to specify a service name in pg_service.conf to be used for additional"
+msgstr ""
+
+msgid "connection parameters: -o 'service=<name>' or to specify the SSL mode:"
+msgstr ""
+
+msgid "-o 'sslmode=require'."
+msgstr ""
+
+msgid ""
+"The plugin will connect to a local postmaster if no host is specified. To"
+msgstr ""
+
+msgid ""
+"connect to a remote host, be sure that the remote postmaster accepts TCP/IP"
+msgstr ""
+
+msgid "connections (start the postmaster with the -i option)."
+msgstr ""
+
+msgid ""
+"Typically, the monitoring user (unless the --logname option is used) should "
+"be"
+msgstr ""
+
+msgid ""
+"able to connect to the database without a password. The plugin can also send"
+msgstr ""
+
+msgid "a password, but no effort is made to obscure or encrypt the password."
+msgstr ""
+
+#, c-format
+msgid "QUERY %s - %s: %s.\n"
+msgstr ""
+
+msgid "Error with query"
+msgstr ""
+
+msgid "No rows returned"
+msgstr ""
+
+msgid "No columns returned"
+msgstr ""
+
+msgid "No data returned"
+msgstr ""
+
+msgid "Is not a numeric"
+msgstr ""
+
+#, c-format
+msgid "%s returned %f"
+msgstr ""
+
+#, c-format
+msgid "'%s' returned %f"
+msgstr ""
+
+msgid "CRITICAL - Could not interpret output from ping command\n"
+msgstr ""
+
+#, c-format
+msgid "PING %s - %sPacket loss = %d%%"
+msgstr ""
+
+#, c-format
+msgid "PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"
+msgstr ""
+
+msgid "Could not realloc() addresses\n"
+msgstr ""
+
+#, c-format
+msgid "<max_packets> (%s) must be a non-negative number\n"
+msgstr ""
+
+#, c-format
+msgid "<wpl> (%s) must be an integer percentage\n"
+msgstr ""
+
+#, c-format
+msgid "<cpl> (%s) must be an integer percentage\n"
+msgstr ""
+
+#, c-format
+msgid "<wrta> (%s) must be a non-negative number\n"
+msgstr ""
+
+#, c-format
+msgid "<crta> (%s) must be a non-negative number\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Warning threshold must be integer or percentage!\n"
+"\n"
+msgstr ""
+
+#, c-format
+msgid "<wrta> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<crta> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<wpl> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<cpl> was not set\n"
+msgstr ""
+
+#, c-format
+msgid "<wrta> (%f) cannot be larger than <crta> (%f)\n"
+msgstr ""
+
+#, c-format
+msgid "<wpl> (%d) cannot be larger than <cpl> (%d)\n"
+msgstr ""
+
+#, c-format
+msgid "Cannot open stderr for %s\n"
+msgstr ""
+
+msgid "System call sent warnings to stderr "
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Network Unreachable (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Host Unreachable (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Bogus ICMP: Port Unreachable (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Bogus ICMP: Protocol Unreachable (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Network Prohibited (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Host Prohibited (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Packet Filtered (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Host not found (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Time to live exceeded (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Destination Unreachable (%s)\n"
+msgstr ""
+
+msgid "Unable to realloc warn_text\n"
+msgstr ""
+
+#, c-format
+msgid "Use ping to check connection statistics for a remote host."
+msgstr ""
+
+msgid "host to ping"
+msgstr ""
+
+msgid "number of ICMP ECHO packets to send"
+msgstr ""
+
+#, c-format
+msgid "(Default: %d)\n"
+msgstr ""
+
+msgid "show HTML in the plugin output (obsoleted by urlize)"
+msgstr ""
+
+msgid "THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"
+msgstr ""
+
+msgid "time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"
+msgstr ""
+
+msgid "percentage of packet loss to trigger an alarm state."
+msgstr ""
+
+msgid ""
+"This plugin uses the ping command to probe the specified host for packet loss"
+msgstr ""
+
+msgid ""
+"(percentage) and round trip average (milliseconds). It can produce HTML "
+"output"
+msgstr ""
+
+msgid ""
+"linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"
+msgstr ""
+
+msgid "the contrib area of the downloads section at http://www.nagios.org/"
+msgstr ""
+
+#, c-format
+msgid "CMD: %s\n"
+msgstr ""
+
+msgid "System call sent warnings to stderr"
+msgstr ""
+
+#, c-format
+msgid "Not parseable: %s"
+msgstr ""
+
+#, c-format
+msgid "Unable to read output\n"
+msgstr ""
+
+#, c-format
+msgid "%d warn out of "
+msgstr ""
+
+#, c-format
+msgid "%d crit, %d warn out of "
+msgstr ""
+
+#, c-format
+msgid " with %s"
+msgstr ""
+
+msgid "Parent Process ID must be an integer!"
+msgstr ""
+
+#, c-format
+msgid "%s%sSTATE = %s"
+msgstr ""
+
+msgid "UID was not found"
+msgstr ""
+
+msgid "User name was not found"
+msgstr ""
+
+#, c-format
+msgid "%s%scommand name '%s'"
+msgstr ""
+
+#, c-format
+msgid "%s%sexclude progs '%s'"
+msgstr ""
+
+msgid "RSS must be an integer!"
+msgstr ""
+
+msgid "VSZ must be an integer!"
+msgstr ""
+
+msgid "PCPU must be a float!"
+msgstr ""
+
+msgid "Metric must be one of PROCS, VSZ, RSS, CPU, ELAPSED!"
+msgstr ""
+
+msgid ""
+"Checks all processes and generates WARNING or CRITICAL states if the "
+"specified"
+msgstr ""
+
+msgid ""
+"metric is outside the required threshold ranges. The metric defaults to "
+"number"
+msgstr ""
+
+msgid ""
+"of processes. Search filters can be applied to limit the processes to check."
+msgstr ""
+
+msgid "Generate warning state if metric is outside this range"
+msgstr ""
+
+msgid "Generate critical state if metric is outside this range"
+msgstr ""
+
+msgid "Check thresholds against metric. Valid types:"
+msgstr ""
+
+msgid "PROCS - number of processes (default)"
+msgstr ""
+
+msgid "VSZ - virtual memory size"
+msgstr ""
+
+msgid "RSS - resident set memory size"
+msgstr ""
+
+msgid "CPU - percentage CPU"
+msgstr ""
+
+msgid "ELAPSED - time elapsed in seconds"
+msgstr ""
+
+msgid "Extra information. Up to 3 verbosity levels"
+msgstr ""
+
+msgid "Filter own process the traditional way by PID instead of /proc/pid/exe"
+msgstr ""
+
+msgid "Only scan for processes that have, in the output of `ps`, one or"
+msgstr ""
+
+msgid "more of the status flags you specify (for example R, Z, S, RS,"
+msgstr ""
+
+msgid "RSZDT, plus others based on the output of your 'ps' command)."
+msgstr ""
+
+msgid "Only scan for children of the parent process ID indicated."
+msgstr ""
+
+msgid "Only scan for processes with VSZ higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with RSS higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with PCPU higher than indicated."
+msgstr ""
+
+msgid "Only scan for processes with user name or ID indicated."
+msgstr ""
+
+msgid "Only scan for processes with args that contain STRING."
+msgstr ""
+
+msgid "Only scan for processes with args that contain the regex STRING."
+msgstr ""
+
+msgid "Only scan for exact matches of COMMAND (without path)."
+msgstr ""
+
+msgid "Exclude processes which match this comma separated list"
+msgstr ""
+
+msgid "Only scan for non kernel threads (works on Linux only)."
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"RANGEs are specified 'min:max' or 'min:' or ':max' (or 'max'). If\n"
+"specified 'max:min', a warning status will be generated if the\n"
+"count is inside the specified range\n"
+"\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"This plugin checks the number of currently running processes and\n"
+"generates WARNING or CRITICAL states if the process count is outside\n"
+"the specified threshold ranges. The process count can be filtered by\n"
+"process owner, parent process PID, current state (e.g., 'Z'), or may\n"
+"be the total number of running processes\n"
+"\n"
+msgstr ""
+
+msgid "Warning if not two processes with command name portsentry."
+msgstr ""
+
+msgid "Critical if < 2 or > 1024 processes"
+msgstr ""
+
+msgid "Critical if not at least 1 process with command sshd"
+msgstr ""
+
+msgid "Warning if > 1024 processes with command name sshd."
+msgstr ""
+
+msgid "Critical if < 1 processes with command name sshd."
+msgstr ""
+
+msgid "Warning alert if > 10 processes with command arguments containing"
+msgstr ""
+
+msgid "'/usr/local/bin/perl' and owned by root"
+msgstr ""
+
+msgid "Alert if VSZ of any processes over 50K or 100K"
+msgstr ""
+
+msgid "Alert if CPU of any processes over 10% or 20%"
+msgstr ""
+
+msgid "Config file error\n"
+msgstr ""
+
+msgid "Out of Memory?\n"
+msgstr ""
+
+msgid "Invalid NAS-Identifier\n"
+msgstr ""
+
+#, c-format
+msgid "gethostname() failed!\n"
+msgstr ""
+
+msgid "Invalid NAS-IP-Address\n"
+msgstr ""
+
+msgid "Timeout\n"
+msgstr ""
+
+msgid "Auth Error\n"
+msgstr ""
+
+msgid "Auth Failed\n"
+msgstr ""
+
+msgid "Bad Response\n"
+msgstr ""
+
+msgid "Auth OK\n"
+msgstr ""
+
+#, c-format
+msgid "Unexpected result code %d"
+msgstr ""
+
+msgid "Number of retries must be a positive integer"
+msgstr ""
+
+msgid "User not specified"
+msgstr ""
+
+msgid "Password not specified"
+msgstr ""
+
+msgid "Configuration file not specified"
+msgstr ""
+
+msgid "Tests to see if a RADIUS server is accepting connections."
+msgstr ""
+
+msgid "The user to authenticate"
+msgstr ""
+
+msgid "Password for authentication (SECURITY RISK)"
+msgstr ""
+
+msgid "NAS identifier"
+msgstr ""
+
+msgid "NAS IP Address"
+msgstr ""
+
+msgid "Configuration file"
+msgstr ""
+
+msgid "Response string to expect from the server"
+msgstr ""
+
+msgid "Number of times to retry a failed connection"
+msgstr ""
+
+msgid ""
+"This plugin tests a RADIUS server to see if it is accepting connections."
+msgstr ""
+
+msgid ""
+"The server to test must be specified in the invocation, as well as a user"
+msgstr ""
+
+msgid "name and password. A configuration file must be present. The format of"
+msgstr ""
+
+msgid ""
+"the configuration file is described in the radiusclient library sources."
+msgstr ""
+
+msgid "The password option presents a substantial security issue because the"
+msgstr ""
+
+msgid ""
+"password can possibly be determined by careful watching of the command line"
+msgstr ""
+
+msgid "in a process listing. This risk is exacerbated because the plugin will"
+msgstr ""
+
+msgid ""
+"typically be executed at regular predictable intervals. Please be sure that"
+msgstr ""
+
+msgid "the password used does not allow access to sensitive system resources."
+msgstr ""
+
+#, c-format
+msgid "Unable to connect to %s on port %d\n"
+msgstr ""
+
+#, c-format
+msgid "No data received from %s\n"
+msgstr ""
+
+msgid "Invalid REAL response received from host"
+msgstr ""
+
+#, c-format
+msgid "Invalid REAL response received from host on port %d\n"
+msgstr ""
+
+#, c-format
+msgid "No data received from host\n"
+msgstr ""
+
+#, c-format
+msgid "REAL %s - %d second response time\n"
+msgstr ""
+
+msgid "Warning time must be a positive integer"
+msgstr ""
+
+msgid "Critical time must be a positive integer"
+msgstr ""
+
+msgid "You must provide a server to check"
+msgstr ""
+
+msgid "This plugin tests the REAL service on the specified host."
+msgstr ""
+
+msgid "Connect to this url"
+msgstr ""
+
+#, c-format
+msgid "String to expect in first line of server response (default: %s)\n"
+msgstr ""
+
+msgid "This plugin will attempt to open an RTSP connection with the host."
+msgstr ""
+
+msgid "Successful connects return STATE_OK, refusals and timeouts return"
+msgstr ""
+
+msgid ""
+"STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,"
+msgstr ""
+
+msgid ""
+"but incorrect response messages from the host result in STATE_WARNING return"
+msgstr ""
+
+msgid "values."
+msgstr ""
+
+#, c-format
+msgid "malloc() failed!\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Cannot create SSL context.\n"
+msgstr ""
+
+#, c-format
+msgid "recv() failed\n"
+msgstr ""
+
+#, c-format
+msgid "WARNING - TLS not supported by server\n"
+msgstr ""
+
+#, c-format
+msgid "Server does not support STARTTLS\n"
+msgstr ""
+
+msgid "SMTP UNKNOWN - Cannot send EHLO command via TLS."
+msgstr ""
+
+#, c-format
+msgid "sent %s"
+msgstr ""
+
+msgid "SMTP UNKNOWN - Cannot read EHLO response via TLS."
+msgstr ""
+
+#, c-format
+msgid "Invalid SMTP response received from host: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Invalid SMTP response received from host on port %d: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Could Not Compile Regular Expression"
+msgstr ""
+
+#, c-format
+msgid "SMTP %s - Invalid response '%s' to command '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Execute Error: %s\n"
+msgstr ""
+
+msgid "no authuser specified, "
+msgstr ""
+
+msgid "no authpass specified, "
+msgstr ""
+
+#, c-format
+msgid "sent %s\n"
+msgstr ""
+
+msgid "recv() failed after AUTH LOGIN, "
+msgstr ""
+
+#, c-format
+msgid "received %s\n"
+msgstr ""
+
+msgid "invalid response received after AUTH LOGIN, "
+msgstr ""
+
+msgid "recv() failed after sending authuser, "
+msgstr ""
+
+msgid "invalid response received after authuser, "
+msgstr ""
+
+msgid "recv() failed after sending authpass, "
+msgstr ""
+
+msgid "invalid response received after authpass, "
+msgstr ""
+
+msgid "only authtype LOGIN is supported, "
+msgstr ""
+
+#, c-format
+msgid "SMTP %s - %s%.3f sec. response time%s%s|%s\n"
+msgstr ""
+
+#, c-format
+msgid "Could not realloc() units [%d]\n"
+msgstr ""
+
+msgid "Critical time must be a positive"
+msgstr ""
+
+msgid "Warning time must be a positive"
+msgstr ""
+
+msgid "SSL support not available - install OpenSSL and recompile"
+msgstr ""
+
+msgid "Set either -s/--ssl/--tls or -S/--starttls"
+msgstr ""
+
+#, c-format
+msgid "Connection closed by server before sending QUIT command\n"
+msgstr ""
+
+#, c-format
+msgid "recv() failed after QUIT."
+msgstr ""
+
+#, c-format
+msgid "Connection reset by peer."
+msgstr ""
+
+msgid "This plugin will attempt to open an SMTP connection with the host."
+msgstr ""
+
+#, c-format
+msgid " String to expect in first line of server response (default: '%s')\n"
+msgstr ""
+
+msgid "SMTP command (may be used repeatedly)"
+msgstr ""
+
+msgid "Expected response to command (may be used repeatedly)"
+msgstr ""
+
+msgid "FROM-address to include in MAIL command, required by Exchange 2000"
+msgstr ""
+
+msgid "FQDN used for HELO"
+msgstr ""
+
+msgid "Use PROXY protocol prefix for the connection."
+msgstr ""
+
+msgid "Minimum number of days a certificate has to be valid."
+msgstr ""
+
+msgid "Use SSL/TLS for the connection."
+msgstr ""
+
+#, c-format
+msgid " Sets default port to %d.\n"
+msgstr ""
+
+msgid "Use STARTTLS for the connection."
+msgstr ""
+
+msgid "SMTP AUTH type to check (default none, only LOGIN supported)"
+msgstr ""
+
+msgid "SMTP AUTH username"
+msgstr ""
+
+msgid "SMTP AUTH password"
+msgstr ""
+
+msgid "Send LHLO instead of HELO/EHLO"
+msgstr ""
+
+msgid "Ignore failure when sending QUIT command to server"
+msgstr ""
+
+msgid "STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful"
+msgstr ""
+
+msgid "connects, but incorrect response messages from the host result in"
+msgstr ""
+
+msgid "STATE_WARNING return values."
+msgstr ""
+
+msgid "Cannot malloc"
+msgstr ""
+
+#, c-format
+msgid "External command error: %s\n"
+msgstr ""
+
+#, c-format
+msgid "External command error with no output (return code: %d)\n"
+msgstr ""
+
+#, c-format
+msgid "No valid data returned (%s)\n"
+msgstr ""
+
+msgid "Time duration between plugin calls is invalid"
+msgstr ""
+
+msgid "Cannot asprintf()"
+msgstr ""
+
+msgid "Cannot realloc()"
+msgstr ""
+
+msgid "No previous data to calculate rate - assume okay"
+msgstr ""
+
+msgid "Retries interval must be a positive integer"
+msgstr ""
+
+msgid "Exit status must be a positive integer"
+msgstr ""
+
+#, c-format
+msgid "Could not reallocate labels[%d]"
+msgstr ""
+
+msgid "Could not reallocate labels\n"
+msgstr ""
+
+#, c-format
+msgid "Could not reallocate units [%d]\n"
+msgstr ""
+
+msgid "Could not realloc() units\n"
+msgstr ""
+
+msgid "Rate multiplier must be a positive integer"
+msgstr ""
+
+msgid "No host specified\n"
+msgstr ""
+
+msgid "No OIDs specified\n"
+msgstr ""
+
+#, c-format
+msgid "Required parameter: %s\n"
+msgstr ""
+
+msgid "Invalid seclevel"
+msgstr ""
+
+msgid "Invalid SNMP version"
+msgstr ""
+
+msgid "Unbalanced quotes\n"
+msgstr ""
+
+#, c-format
+msgid "multiplier set (%.1f), but input is not a number: %s"
+msgstr ""
+
+msgid "Check status of remote machines and obtain system information via SNMP"
+msgstr ""
+
+msgid "Use SNMP GETNEXT instead of SNMP GET"
+msgstr ""
+
+msgid "SNMP protocol version"
+msgstr ""
+
+msgid "SNMPv3 context"
+msgstr ""
+
+msgid "SNMPv3 securityLevel"
+msgstr ""
+
+msgid "SNMPv3 auth proto"
+msgstr ""
+
+msgid "SNMPv3 priv proto (default DES)"
+msgstr ""
+
+msgid "Optional community string for SNMP communication"
+msgstr ""
+
+msgid "default is"
+msgstr ""
+
+msgid "SNMPv3 username"
+msgstr ""
+
+msgid "SNMPv3 authentication password"
+msgstr ""
+
+msgid "SNMPv3 privacy password"
+msgstr ""
+
+msgid "Object identifier(s) or SNMP variables whose value you wish to query"
+msgstr ""
+
+msgid ""
+"List of MIBS to be loaded (default = none if using numeric OIDs or 'ALL'"
+msgstr ""
+
+msgid "for symbolic OIDs.)"
+msgstr ""
+
+msgid "Delimiter to use when parsing returned data. Default is"
+msgstr ""
+
+msgid "Any data on the right hand side of the delimiter is considered"
+msgstr ""
+
+msgid "to be the data that should be used in the evaluation."
+msgstr ""
+
+msgid "If the check returns a 0 length string or NULL value"
+msgstr ""
+
+msgid "This option allows you to choose what status you want it to exit"
+msgstr ""
+
+msgid "Excluding this option renders the default exit of 3(STATE_UNKNOWN)"
+msgstr ""
+
+msgid "0 = OK"
+msgstr ""
+
+msgid "1 = WARNING"
+msgstr ""
+
+msgid "2 = CRITICAL"
+msgstr ""
+
+msgid "3 = UNKNOWN"
+msgstr ""
+
+msgid "Warning threshold range(s)"
+msgstr ""
+
+msgid "Critical threshold range(s)"
+msgstr ""
+
+msgid "Enable rate calculation. See 'Rate Calculation' below"
+msgstr ""
+
+msgid ""
+"Converts rate per second. For example, set to 60 to convert to per minute"
+msgstr ""
+
+msgid "Add/subtract the specified OFFSET to numeric sensor data"
+msgstr ""
+
+msgid "Return OK state (for that OID) if STRING is an exact match"
+msgstr ""
+
+msgid ""
+"Return OK state (for that OID) if extended regular expression REGEX matches"
+msgstr ""
+
+msgid ""
+"Return OK state (for that OID) if case-insensitive extended REGEX matches"
+msgstr ""
+
+msgid "Invert search result (CRITICAL if found)"
+msgstr ""
+
+msgid "Prefix label for output from plugin"
+msgstr ""
+
+msgid "Units label(s) for output data (e.g., 'sec.')."
+msgstr ""
+
+msgid "Separates output on multiple OID requests"
+msgstr ""
+
+msgid "Multiplies current value, 0 < n < 1 works as divider, defaults to 1"
+msgstr ""
+
+msgid "C-style format string for float values (see option -M)"
+msgstr ""
+
+msgid ""
+"NOTE the final timeout value is calculated using this formula: "
+"timeout_interval * retries + 5"
+msgstr ""
+
+msgid "Number of retries to be used in the requests, default: "
+msgstr ""
+
+msgid "Label performance data with OIDs instead of --label's"
+msgstr ""
+
+msgid "Tell snmpget to not print errors encountered when parsing MIB files"
+msgstr ""
+
+msgid ""
+"This plugin uses the 'snmpget' command included with the NET-SNMP package."
+msgstr ""
+
+msgid ""
+"if you don't have the package installed, you will need to download it from"
+msgstr ""
+
+msgid "http://net-snmp.sourceforge.net before you can use this plugin."
+msgstr ""
+
+msgid ""
+"- Multiple OIDs (and labels) may be indicated by a comma or space-delimited "
+msgstr ""
+
+msgid "list (lists with internal spaces must be quoted)."
+msgstr ""
+
+msgid ""
+"- When checking multiple OIDs, separate ranges by commas like '-w "
+"1:10,1:,:20'"
+msgstr ""
+
+msgid "- Note that only one string and one regex may be checked at present"
+msgstr ""
+
+msgid ""
+"- All evaluation methods other than PR, STR, and SUBSTR expect that the value"
+msgstr ""
+
+msgid "returned from the SNMP query is an unsigned integer."
+msgstr ""
+
+msgid "Rate Calculation:"
+msgstr ""
+
+msgid "In many places, SNMP returns counters that are only meaningful when"
+msgstr ""
+
+msgid "calculating the counter difference since the last check. check_snmp"
+msgstr ""
+
+msgid "saves the last state information in a file so that the rate per second"
+msgstr ""
+
+msgid "can be calculated. Use the --rate option to save state information."
+msgstr ""
+
+msgid ""
+"On the first run, there will be no prior state - this will return with OK."
+msgstr ""
+
+msgid "The state is uniquely determined by the arguments to the plugin, so"
+msgstr ""
+
+msgid "changing the arguments will create a new state file."
+msgstr ""
+
+msgid "Port number must be a positive integer"
+msgstr ""
+
+#, c-format
+msgid "Server answer: %s"
+msgstr ""
+
+#, c-format
+msgid "SSH CRITICAL - %s (protocol %s) version mismatch, expected '%s'\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"SSH CRITICAL - %s (protocol %s) protocol version mismatch, expected '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "SSH OK - %s (protocol %s) | %s\n"
+msgstr ""
+
+msgid "Try to connect to an SSH server at specified server and port"
+msgstr ""
+
+msgid ""
+"Alert if string doesn't match expected server version (ex: OpenSSH_3.9p1)"
+msgstr ""
+
+msgid "Alert if protocol doesn't match expected protocol version (ex: 2.0)"
+msgstr ""
+
+#, c-format
+msgid "Command: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Format: %s\n"
+msgstr ""
+
+#, c-format
+msgid "total=%.0f, used=%.0f, free=%.0f\n"
+msgstr ""
+
+#, c-format
+msgid "total=%.0f, free=%.0f\n"
+msgstr ""
+
+msgid "Error getting swap devices\n"
+msgstr ""
+
+msgid "SWAP OK: No swap devices defined\n"
+msgstr ""
+
+msgid "swapctl failed: "
+msgstr ""
+
+msgid "Error in swapctl call\n"
+msgstr ""
+
+#, c-format
+msgid "SWAP %s - %d%% free (%dMB out of %dMB) %s|"
+msgstr ""
+
+msgid "Warning threshold percentage must be <= 100!"
+msgstr ""
+
+msgid "Warning threshold be positive integer or percentage!"
+msgstr ""
+
+msgid "Critical threshold percentage must be <= 100!"
+msgstr ""
+
+msgid "Critical threshold be positive integer or percentage!"
+msgstr ""
+
+msgid ""
+"no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
+"or integer (0-3)."
+msgstr ""
+
+msgid "Warning should be more than critical"
+msgstr ""
+
+msgid "Check swap space on local machine."
+msgstr ""
+
+msgid ""
+"Exit with WARNING status if less than INTEGER bytes of swap space are free"
+msgstr ""
+
+msgid "Exit with WARNING status if less than PERCENT of swap space is free"
+msgstr ""
+
+msgid ""
+"Exit with CRITICAL status if less than INTEGER bytes of swap space are free"
+msgstr ""
+
+msgid "Exit with CRITICAL status if less than PERCENT of swap space is free"
+msgstr ""
+
+msgid "Conduct comparisons for all swap partitions, one by one"
+msgstr ""
+
+msgid ""
+"Resulting state when there is no swap regardless of thresholds. Default:"
+msgstr ""
+
+msgid ""
+"Both INTEGER and PERCENT thresholds can be specified, they are all checked."
+msgstr ""
+
+msgid "On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s."
+msgstr ""
+
+msgid "CRITICAL - Generic check_tcp called with unknown service\n"
+msgstr ""
+
+msgid "With UDP checks, a send/expect string must be specified."
+msgstr ""
+
+msgid "No arguments found"
+msgstr ""
+
+msgid "Maxbytes must be a positive integer"
+msgstr ""
+
+msgid "Refuse must be one of ok, warn, crit"
+msgstr ""
+
+msgid "Mismatch must be one of ok, warn, crit"
+msgstr ""
+
+msgid "Delay must be a positive integer"
+msgstr ""
+
+msgid "You must provide a server address"
+msgstr ""
+
+msgid "Invalid hostname, address or socket"
+msgstr ""
+
+#, c-format
+msgid ""
+"This plugin tests %s connections with the specified host (or unix socket).\n"
+"\n"
+msgstr ""
+
+msgid ""
+"Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send "
+"or quit option"
+msgstr ""
+
+msgid "Default: nothing added to send, \\r\\n added to end of quit"
+msgstr ""
+
+msgid "String to send to the server"
+msgstr ""
+
+msgid "String to expect in server response"
+msgstr ""
+
+msgid "(may be repeated)"
+msgstr ""
+
+msgid "All expect strings need to occur in server response. Default is any"
+msgstr ""
+
+msgid "String to send server to initiate a clean close of the connection"
+msgstr ""
+
+msgid "Accept TCP refusals with states ok, warn, crit (default: crit)"
+msgstr ""
+
+msgid ""
+"Accept expected string mismatches with states ok, warn, crit (default: warn)"
+msgstr ""
+
+msgid "Hide output from TCP socket"
+msgstr ""
+
+msgid "Close connection once more than this number of bytes are received"
+msgstr ""
+
+msgid "Seconds to wait between sending string and polling for response"
+msgstr ""
+
+msgid "1st is #days for warning, 2nd is critical (if not specified - 0)."
+msgstr ""
+
+msgid "Use SSL for the connection."
+msgstr ""
+
+msgid "SSL server_name"
+msgstr ""
+
+#, c-format
+msgid "TIME UNKNOWN - could not connect to server %s, port %d\n"
+msgstr ""
+
+#, c-format
+msgid "TIME UNKNOWN - could not send UDP request to server %s, port %d\n"
+msgstr ""
+
+#, c-format
+msgid "TIME UNKNOWN - no data received from server %s, port %d\n"
+msgstr ""
+
+#, c-format
+msgid "TIME %s - %d second response time|%s\n"
+msgstr ""
+
+#, c-format
+msgid "TIME %s - %lu second time difference|%s %s\n"
+msgstr ""
+
+msgid "Warning thresholds must be a positive integer"
+msgstr ""
+
+msgid "Critical thresholds must be a positive integer"
+msgstr ""
+
+msgid "This plugin will check the time on the specified host."
+msgstr ""
+
+msgid "Use UDP to connect, not TCP"
+msgstr ""
+
+msgid "Time difference (sec.) necessary to result in a warning status"
+msgstr ""
+
+msgid "Time difference (sec.) necessary to result in a critical status"
+msgstr ""
+
+msgid "Response time (sec.) necessary to result in warning status"
+msgstr ""
+
+msgid "Response time (sec.) necessary to result in critical status"
+msgstr ""
+
+msgid "On Battery, Low Battery"
+msgstr ""
+
+msgid "Online"
+msgstr ""
+
+msgid "On Battery"
+msgstr ""
+
+msgid ", Low Battery"
+msgstr ""
+
+msgid ", Calibrating"
+msgstr ""
+
+msgid ", Replace Battery"
+msgstr ""
+
+msgid ", On Bypass"
+msgstr ""
+
+msgid ", Overload"
+msgstr ""
+
+msgid ", Trimming"
+msgstr ""
+
+msgid ", Boosting"
+msgstr ""
+
+msgid ", Charging"
+msgstr ""
+
+msgid ", Discharging"
+msgstr ""
+
+msgid ", Unknown"
+msgstr ""
+
+msgid "UPS does not support any available options\n"
+msgstr ""
+
+msgid "Invalid response received from host"
+msgstr ""
+
+msgid "UPS name to long for buffer"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - no such UPS '%s' on that host\n"
+msgstr ""
+
+msgid "CRITICAL - UPS data is stale"
+msgstr ""
+
+#, c-format
+msgid "Unknown error: %s\n"
+msgstr ""
+
+msgid "Error: unable to parse variable"
+msgstr ""
+
+msgid "Unrecognized UPS variable"
+msgstr ""
+
+msgid "Error : no UPS indicated"
+msgstr ""
+
+msgid ""
+"This plugin tests the UPS service on the specified host. Network UPS Tools"
+msgstr ""
+
+msgid "from www.networkupstools.org must be running for this plugin to work."
+msgstr ""
+
+msgid "Name of UPS"
+msgstr ""
+
+msgid "Output of temperatures in Celsius"
+msgstr ""
+
+msgid "Valid values for STRING are"
+msgstr ""
+
+msgid ""
+"This plugin attempts to determine the status of a UPS (Uninterruptible Power"
+msgstr ""
+
+msgid ""
+"Supply) on a local or remote host. If the UPS is online or calibrating, the"
+msgstr ""
+
+msgid ""
+"plugin will return an OK state. If the battery is on it will return a WARNING"
+msgstr ""
+
+msgid ""
+"state. If the UPS is off or has a low battery the plugin will return a "
+"CRITICAL"
+msgstr ""
+
+msgid ""
+"You may also specify a variable to check (such as temperature, utility "
+"voltage,"
+msgstr ""
+
+msgid ""
+"battery load, etc.) as well as warning and critical thresholds for the value"
+msgstr ""
+
+msgid ""
+"of that variable. If the remote host has multiple UPS that are being "
+"monitored"
+msgstr ""
+
+msgid "you will have to use the --ups option to specify which UPS to check."
+msgstr ""
+
+msgid ""
+"This plugin requires that the UPSD daemon distributed with Russell Kroll's"
+msgstr ""
+
+msgid ""
+"Network UPS Tools be installed on the remote host. If you do not have the"
+msgstr ""
+
+msgid "package installed on your system, you can download it from"
+msgstr ""
+
+msgid "http://www.networkupstools.org"
+msgstr ""
+
+#, c-format
+msgid "Could not enumerate RD sessions: %d\n"
+msgstr ""
+
+#, c-format
+msgid "# users=%d"
+msgstr ""
+
+msgid "Unable to read output"
+msgstr ""
+
+#, c-format
+msgid "USERS %s - %d users currently logged in |%s\n"
+msgstr ""
+
+msgid "This plugin checks the number of users currently logged in on the local"
+msgstr ""
+
+msgid ""
+"system and generates an error if the number exceeds the thresholds specified."
+msgstr ""
+
+msgid "Set WARNING status if more than INTEGER users are logged in"
+msgstr ""
+
+msgid "Set CRITICAL status if more than INTEGER users are logged in"
+msgstr ""
+
+msgid ""
+"DEPRECATION WARNING: the -q switch (quiet output) is no longer \"quiet\"."
+msgstr ""
+
+msgid "Nagios-compatible output is now always returned."
+msgstr ""
+
+msgid "SMART commands are broken and have been disabled (See Notes in --help)."
+msgstr ""
+
+msgid ""
+"DEPRECATION WARNING: the -n switch (Nagios-compatible output) is now the"
+msgstr ""
+
+msgid "default and will be removed from future releases."
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Couldn't open device %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - SMART_CMD_ENABLE\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - SMART_READ_VALUES: %s\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - %d Harddrive PreFailure%cDetected! %d/%d tests failed.\n"
+msgstr ""
+
+#, c-format
+msgid "WARNING - %d Harddrive Advisor%s Detected. %d/%d tests failed.\n"
+msgstr ""
+
+#, c-format
+msgid "OK - Operational (%d/%d tests passed)\n"
+msgstr ""
+
+#, c-format
+msgid "ERROR - Status '%d' unknown. %d/%d tests passed\n"
+msgstr ""
+
+#, c-format
+msgid "OffLineStatus=%d {%s}, AutoOffLine=%s, OffLineTimeout=%d minutes\n"
+msgstr ""
+
+#, c-format
+msgid "OffLineCapability=%d {%s %s %s}\n"
+msgstr ""
+
+#, c-format
+msgid "SmartRevision=%d, CheckSum=%d, SmartCapability=%d {%s %s}\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "OK - Command sent (%s)\n"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - SMART_READ_THRESHOLDS: %s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"This plugin checks a local hard drive with the (Linux specific) SMART "
+"interface [http://smartlinux.sourceforge.net/smart/index.php]."
+msgstr ""
+
+msgid "Select device DEVICE"
+msgstr ""
+
+msgid ""
+"Note: if the device is specified without this option, any further option will"
+msgstr ""
+
+msgid "be ignored."
+msgstr ""
+
+msgid ""
+"The SMART command modes (-i/--immediate, -0/--auto-off and -1/--auto-on) were"
+msgstr ""
+
+msgid ""
+"broken in an underhand manner and have been disabled. You can use smartctl"
+msgstr ""
+
+msgid "instead:"
+msgstr ""
+
+msgid "-0/--auto-off: use \"smartctl --offlineauto=off\""
+msgstr ""
+
+msgid "-1/--auto-on: use \"smartctl --offlineauto=on\""
+msgstr ""
+
+msgid "-i/--immediate: use \"smartctl --test=offline\""
+msgstr ""
+
+msgid "No data returned from command\n"
+msgstr ""
+
+msgid ""
+"Timeout result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) "
+"or integer (0-3)."
+msgstr ""
+
+msgid ""
+"Ok must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer "
+"(0-3)."
+msgstr ""
+
+msgid ""
+"Warning must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+
+msgid ""
+"Critical must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+
+msgid ""
+"Unknown must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or "
+"integer (0-3)."
+msgstr ""
+
+msgid "Require path to command"
+msgstr ""
+
+msgid ""
+"Negates the status of a plugin (returns OK for CRITICAL and vice-versa)."
+msgstr ""
+
+msgid "Additional switches can be used to control which state becomes what."
+msgstr ""
+
+msgid "Keep timeout longer than the plugin timeout to retain CRITICAL status."
+msgstr ""
+
+msgid "Custom result on Negate timeouts; see below for STATUS definition\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without single\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" quotes. Numeric values are accepted. If nothing is specified, permutes\n"
+msgstr ""
+
+#, c-format
+msgid " OK and CRITICAL.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" Substitute output text as well. Will only substitute text in CAPITALS\n"
+msgstr ""
+
+msgid "Run check_ping and invert result. Must use full path to plugin"
+msgstr ""
+
+msgid "This will return OK instead of WARNING and UNKNOWN instead of CRITICAL"
+msgstr ""
+
+msgid ""
+"This plugin is a wrapper to take the output of another plugin and invert it."
+msgstr ""
+
+msgid "The full path of the plugin must be provided."
+msgstr ""
+
+msgid "If the wrapped plugin returns OK, the wrapper will return CRITICAL."
+msgstr ""
+
+msgid "If the wrapped plugin returns CRITICAL, the wrapper will return OK."
+msgstr ""
+
+msgid "Otherwise, the output state of the wrapped plugin is unchanged."
+msgstr ""
+
+msgid ""
+"Using timeout-result, it is possible to override the timeout behaviour or a"
+msgstr ""
+
+msgid "plugin by setting the negate timeout a bit lower."
+msgstr ""
+
+#, c-format
+msgid "%s - Socket timeout after %d seconds\n"
+msgstr ""
+
+#, c-format
+msgid "%s - Abnormal timeout after %d seconds\n"
+msgstr ""
+
+msgid "Send failed"
+msgstr ""
+
+msgid "No data was received from host!"
+msgstr ""
+
+msgid "Socket creation failed"
+msgstr ""
+
+msgid "Supplied path too long unix domain socket"
+msgstr ""
+
+msgid "Receive failed"
+msgstr ""
+
+#, c-format
+msgid "Invalid hostname/address - %s"
+msgstr ""
+
+msgid "Could not malloc argv array in popen()"
+msgstr ""
+
+msgid "CRITICAL - You need more args!!!"
+msgstr ""
+
+msgid "Cannot catch SIGCHLD"
+msgstr ""
+
+#, c-format
+msgid "CRITICAL - Plugin timed out after %d seconds\n"
+msgstr ""
+
+msgid "CRITICAL - popen timeout received, but no child process"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s UNKNOWN - No data received from host\n"
+"CMD: %s</A>\n"
+msgstr ""
+
+msgid ""
+"This plugin wraps the text output of another command (plugin) in HTML <A>"
+msgstr ""
+
+msgid ""
+"tags, thus displaying the child plugin's output as a clickable link in "
+"compatible"
+msgstr ""
+
+msgid ""
+"monitoring status screen. This plugin returns the status of the invoked "
+"plugin."
+msgstr ""
+
+msgid ""
+"Pay close attention to quoting to ensure that the shell passes the expected"
+msgstr ""
+
+msgid "data to the plugin. For example, in:"
+msgstr ""
+
+msgid "urlize http://example.com/ check_http -H example.com -r 'two words'"
+msgstr ""
+
+msgid "the shell will remove the single quotes and urlize will see:"
+msgstr ""
+
+msgid "urlize http://example.com/ check_http -H example.com -r two words"
+msgstr ""
+
+msgid "You probably want:"
+msgstr ""
+
+msgid "urlize http://example.com/ \"check_http -H example.com -r 'two words'\""
+msgstr ""
+
+msgid "failed realloc in strpcpy\n"
+msgstr ""
+
+msgid "failed malloc in strscat\n"
+msgstr ""
+
+msgid "failed malloc in xvasprintf\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" %s (-h | --help) for detailed help\n"
+" %s (-V | --version) for version information\n"
+msgstr ""
+
+msgid ""
+"\n"
+"Options:\n"
+" -h, --help\n"
+" Print detailed help screen\n"
+" -V, --version\n"
+" Print version information\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" -H, --hostname=ADDRESS\n"
+" Host name, IP Address, or unix socket (must be an absolute path)\n"
+" -%c, --port=INTEGER\n"
+" Port number (default: %s)\n"
+msgstr ""
+
+msgid ""
+" -4, --use-ipv4\n"
+" Use IPv4 connection\n"
+" -6, --use-ipv6\n"
+" Use IPv6 connection\n"
+msgstr ""
+
+msgid ""
+" -v, --verbose\n"
+" Show details for command-line debugging (output may be truncated by\n"
+" the monitoring system)\n"
+msgstr ""
+
+msgid ""
+" -w, --warning=DOUBLE\n"
+" Response time to result in warning status (seconds)\n"
+" -c, --critical=DOUBLE\n"
+" Response time to result in critical status (seconds)\n"
+msgstr ""
+
+msgid ""
+" -w, --warning=RANGE\n"
+" Warning range (format: start:end). Alert if outside this range\n"
+" -c, --critical=RANGE\n"
+" Critical range\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" -t, --timeout=INTEGER\n"
+" Seconds before connection times out (default: %d)\n"
+msgstr ""
+
+#, c-format
+msgid ""
+" -t, --timeout=INTEGER\n"
+" Seconds before plugin times out (default: %d)\n"
+msgstr ""
+
+msgid ""
+" --extra-opts=[section][@file]\n"
+" Read options from an ini file. See\n"
+" https://www.monitoring-plugins.org/doc/extra-opts.html\n"
+" for usage and examples.\n"
+msgstr ""
+
+msgid ""
+" See:\n"
+" https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT\n"
+" for THRESHOLD format and examples.\n"
+msgstr ""
+
+msgid ""
+"\n"
+"Send email to help@monitoring-plugins.org if you have questions regarding\n"
+"use of this software. To submit patches or suggest improvements, send email\n"
+"to devel@monitoring-plugins.org\n"
+"\n"
+msgstr ""
+
+msgid ""
+"\n"
+"The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may "
+"redistribute\n"
+"copies of the plugins under the terms of the GNU General Public License.\n"
+"For more information about these matters, see the file named COPYING.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not get hardware address of interface '%s'\n"
+msgstr ""
+
+#, c-format
+msgid "Error: if_nametoindex error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Couldn't get hardware address from %s. sysctl 1 error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: Couldn't get hardware address from interface %s. malloc error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Couldn't get hardware address from %s. sysctl 2 error - %s.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: can't find unit number in interface_name (%s) - expecting TypeNumber "
+"eg lnc0.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: can't read MAC address from DLPI streams interface for device %s unit "
+"%d.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: can't get MAC address for this architecture. Use the --mac option.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Cannot determine IP address of interface %s\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Cannot get interface IP address on this platform.\n"
+msgstr ""
+
+#, c-format
+msgid "Pretending to be relay client %s\n"
+msgstr ""
+
+#, c-format
+msgid "DHCPDISCOVER to %s port %d\n"
+msgstr ""
+
+#, c-format
+msgid "Result=ERROR\n"
+msgstr ""
+
+#, c-format
+msgid "Result=OK\n"
+msgstr ""
+
+#, c-format
+msgid "DHCPOFFER from IP address %s"
+msgstr ""
+
+#, c-format
+msgid " via %s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"
+msgstr ""
+
+#, c-format
+msgid "DHCPOFFER hardware address did not match our own - ignoring packet\n"
+msgstr ""
+
+#, c-format
+msgid "Total responses seen on the wire: %d\n"
+msgstr ""
+
+#, c-format
+msgid "Valid responses for this machine: %d\n"
+msgstr ""
+
+#, c-format
+msgid "send_dhcp_packet result: %d\n"
+msgstr ""
+
+#, c-format
+msgid "No (more) data received (nfound: %d)\n"
+msgstr ""
+
+#, c-format
+msgid "recvfrom() failed, "
+msgstr ""
+
+#, c-format
+msgid "receive_dhcp_packet() result: %d\n"
+msgstr ""
+
+#, c-format
+msgid "receive_dhcp_packet() source: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not create socket!\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not set reuse address option on DHCP socket!\n"
+msgstr ""
+
+#, c-format
+msgid "Error: Could not set broadcast option on DHCP socket!\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: Could not bind socket to interface %s. Check your privileges...\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: Could not bind to DHCP socket (port %d)! Check your privileges...\n"
+msgstr ""
+
+#, c-format
+msgid "Requested server address: %s\n"
+msgstr ""
+
+#, c-format
+msgid "Lease Time: Infinite\n"
+msgstr ""
+
+#, c-format
+msgid "Lease Time: %lu seconds\n"
+msgstr ""
+
+#, c-format
+msgid "Renewal Time: Infinite\n"
+msgstr ""
+
+#, c-format
+msgid "Renewal Time: %lu seconds\n"
+msgstr ""
+
+#, c-format
+msgid "Rebinding Time: Infinite\n"
+msgstr ""
+
+#, c-format
+msgid "Rebinding Time: %lu seconds\n"
+msgstr ""
+
+#, c-format
+msgid "Added offer from server @ %s"
+msgstr ""
+
+#, c-format
+msgid " of IP address %s\n"
+msgstr ""
+
+#, c-format
+msgid "DHCP Server Match: Offerer=%s"
+msgstr ""
+
+#, c-format
+msgid " Requested=%s"
+msgstr ""
+
+#, c-format
+msgid " (duplicate)"
+msgstr ""
+
+#, c-format
+msgid "\n"
+msgstr ""
+
+#, c-format
+msgid "No DHCPOFFERs were received.\n"
+msgstr ""
+
+#, c-format
+msgid "Received %d DHCPOFFER(s)"
+msgstr ""
+
+#, c-format
+msgid ", Rogue DHCP Server detected! Server %s"
+msgstr ""
+
+#, c-format
+msgid " offered %s \n"
+msgstr ""
+
+#, c-format
+msgid ", %s%d of %d requested servers responded"
+msgstr ""
+
+#, c-format
+msgid ", requested address (%s) was %soffered"
+msgstr ""
+
+msgid "not "
+msgstr ""
+
+#, c-format
+msgid ", max lease time = "
+msgstr ""
+
+#, c-format
+msgid "Infinity"
+msgstr ""
+
+msgid "Got unexpected non-option argument"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in check_ctrl: %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in put_ctrl/putmsg(): %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in put_both/putmsg().\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Error: DLPI stream API failed to get MAC in dl_attach_req/open(%s..): %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Error: DLPI stream API failed to get MAC in dl_bind/check_ctrl(): %s.\n"
+msgstr ""
+
+#, c-format
+msgid "Hardware address: "
+msgstr ""
+
+msgid "This plugin tests the availability of DHCP servers on a network."
+msgstr ""
+
+msgid "IP address of DHCP server that we must hear from"
+msgstr ""
+
+msgid "IP address that should be offered by at least one DHCP server"
+msgstr ""
+
+msgid "Seconds to wait for DHCPOFFER before timeout occurs"
+msgstr ""
+
+msgid "Interface to to use for listening (i.e. eth0)"
+msgstr ""
+
+msgid "MAC address to use in the DHCP request"
+msgstr ""
+
+msgid "Unicast testing: mimic a DHCP relay, requires -s"
+msgstr ""
+
+msgid ""
+"Only requested DHCP server may response (rogue DHCP server detection), "
+"requires -s"
+msgstr ""
+
+msgid "specify a target"
+msgstr ""
+
+msgid "Use IPv4 (default) or IPv6 to communicate with the targets"
+msgstr ""
+
+msgid "warning threshold (currently "
+msgstr ""
+
+msgid "critical threshold (currently "
+msgstr ""
+
+msgid ""
+"RTA, round trip average, mode warning,critical, ex. 100ms,200ms unit in ms"
+msgstr ""
+
+msgid "packet loss mode, ex. 40%,50% , unit in %"
+msgstr ""
+
+msgid "jitter mode warning,critical, ex. 40.000ms,50.000ms , unit in ms "
+msgstr ""
+
+msgid "MOS mode, between 0 and 4.4 warning,critical, ex. 3.5,3.0"
+msgstr ""
+
+msgid "score mode, max value 100 warning,critical, ex. 80,70 "
+msgstr ""
+
+msgid "detect out of order ICMP packts "
+msgstr ""
+
+msgid "specify a source IP address or device name"
+msgstr ""
+
+msgid "number of packets to send (currently "
+msgstr ""
+
+msgid "max packet interval (currently "
+msgstr ""
+
+msgid "max target interval (currently "
+msgstr ""
+
+msgid "number of alive hosts required for success"
+msgstr ""
+
+msgid "TTL on outgoing packets (currently "
+msgstr ""
+
+msgid "timeout value (seconds, currently "
+msgstr ""
+
+msgid "Number of icmp data bytes to send"
+msgstr ""
+
+msgid "Packet size will be data bytes + icmp header (currently"
+msgstr ""
+
+msgid "verbose"
+msgstr ""
+
+msgid "If none of R,P,J,M,S or O is specified, default behavior is -R -P"
+msgstr ""
+
+msgid "The -H switch is optional. Naming a host (or several) to check is not."
+msgstr ""
+
+msgid ""
+"Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"
+msgstr ""
+
+msgid "packet loss. The default values should work well for most users."
+msgstr ""
+
+msgid ""
+"You can specify different RTA factors using the standardized abbreviations"
+msgstr ""
+
+msgid ""
+"us (microseconds), ms (milliseconds, default) or just plain s for seconds."
+msgstr ""
+
+msgid "The -v switch can be specified several times for increased verbosity."
+msgstr ""
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644
index 0000000..2436c49
--- /dev/null
+++ b/po/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/stamp-po b/po/stamp-po
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/po/stamp-po
@@ -0,0 +1 @@
+timestamp
diff --git a/release b/release
new file mode 100644
index 0000000..cc6c9a4
--- /dev/null
+++ b/release
@@ -0,0 +1 @@
+2.3.5
diff --git a/tap/Makefile.am b/tap/Makefile.am
new file mode 100644
index 0000000..86147c5
--- /dev/null
+++ b/tap/Makefile.am
@@ -0,0 +1,13 @@
+# Tap self-tests are not implemented (yet?)
+# SUBDIRS = tests
+
+if USE_LIBTAP_LOCAL
+noinst_LTLIBRARIES = libtap.la
+libtap_la_SOURCES = tap.c tap.h
+include_HEADERS = tap.h
+endif USE_LIBTAP_LOCAL
+
+# see top comment
+#prove:
+# prove -v -r
+
diff --git a/tap/Makefile.in b/tap/Makefile.in
new file mode 100644
index 0000000..281f3ce
--- /dev/null
+++ b/tap/Makefile.in
@@ -0,0 +1,2094 @@
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Tap self-tests are not implemented (yet?)
+# SUBDIRS = tests
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
+ $(top_srcdir)/m4/np_mysqlclient.m4 \
+ $(top_srcdir)/m4/uriparser.m4 $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/af_alg.m4 $(top_srcdir)/gl/m4/alloca.m4 \
+ $(top_srcdir)/gl/m4/arpa_inet_h.m4 \
+ $(top_srcdir)/gl/m4/assert_h.m4 $(top_srcdir)/gl/m4/base64.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/byteswap.m4 $(top_srcdir)/gl/m4/c-bool.m4 \
+ $(top_srcdir)/gl/m4/calloc.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup2.m4 $(top_srcdir)/gl/m4/eealloc.m4 \
+ $(top_srcdir)/gl/m4/environ.m4 $(top_srcdir)/gl/m4/errno_h.m4 \
+ $(top_srcdir)/gl/m4/error.m4 $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fcntl-o.m4 $(top_srcdir)/gl/m4/fcntl.m4 \
+ $(top_srcdir)/gl/m4/fcntl_h.m4 $(top_srcdir)/gl/m4/fflush.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/floorf.m4 \
+ $(top_srcdir)/gl/m4/fopen.m4 $(top_srcdir)/gl/m4/fpurge.m4 \
+ $(top_srcdir)/gl/m4/freading.m4 $(top_srcdir)/gl/m4/free.m4 \
+ $(top_srcdir)/gl/m4/fseek.m4 $(top_srcdir)/gl/m4/fseeko.m4 \
+ $(top_srcdir)/gl/m4/fstat.m4 $(top_srcdir)/gl/m4/fstypename.m4 \
+ $(top_srcdir)/gl/m4/fsusage.m4 $(top_srcdir)/gl/m4/ftell.m4 \
+ $(top_srcdir)/gl/m4/ftello.m4 \
+ $(top_srcdir)/gl/m4/getaddrinfo.m4 \
+ $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/gethostname.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 \
+ $(top_srcdir)/gl/m4/getloadavg.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gl-openssl.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/hostent.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/inet_ntop.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 $(top_srcdir)/gl/m4/lock.m4 \
+ $(top_srcdir)/gl/m4/lseek.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/math_h.m4 $(top_srcdir)/gl/m4/mbrtowc.m4 \
+ $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/minmax.m4 \
+ $(top_srcdir)/gl/m4/mktime.m4 $(top_srcdir)/gl/m4/mmap-anon.m4 \
+ $(top_srcdir)/gl/m4/mode_t.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/netdb_h.m4 \
+ $(top_srcdir)/gl/m4/netinet_in_h.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open-slash.m4 $(top_srcdir)/gl/m4/open.m4 \
+ $(top_srcdir)/gl/m4/pathmax.m4 $(top_srcdir)/gl/m4/pid_t.m4 \
+ $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 \
+ $(top_srcdir)/gl/m4/reallocarray.m4 \
+ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/servent.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 \
+ $(top_srcdir)/gl/m4/setlocale_null.m4 \
+ $(top_srcdir)/gl/m4/sha256.m4 $(top_srcdir)/gl/m4/size_max.m4 \
+ $(top_srcdir)/gl/m4/snprintf.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 \
+ $(top_srcdir)/gl/m4/stddef_h.m4 $(top_srcdir)/gl/m4/stdint.m4 \
+ $(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/stdio_h.m4 \
+ $(top_srcdir)/gl/m4/stdlib_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/strstr.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/time_r.m4 $(top_srcdir)/gl/m4/timegm.m4 \
+ $(top_srcdir)/gl/m4/ungetc.m4 $(top_srcdir)/gl/m4/unistd_h.m4 \
+ $(top_srcdir)/gl/m4/unlocked-io.m4 \
+ $(top_srcdir)/gl/m4/vararrays.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/visibility.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/wchar_h.m4 $(top_srcdir)/gl/m4/wchar_t.m4 \
+ $(top_srcdir)/gl/m4/wcrtomb.m4 $(top_srcdir)/gl/m4/wctype_h.m4 \
+ $(top_srcdir)/gl/m4/wint_t.m4 $(top_srcdir)/gl/m4/xalloc.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/zzgnulib.m4 \
+ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__include_HEADERS_DIST) \
+ $(am__DIST_COMMON)
+mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libtap_la_LIBADD =
+am__libtap_la_SOURCES_DIST = tap.c tap.h
+@USE_LIBTAP_LOCAL_TRUE@am_libtap_la_OBJECTS = tap.lo
+libtap_la_OBJECTS = $(am_libtap_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+@USE_LIBTAP_LOCAL_TRUE@am_libtap_la_rpath =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/tap.Plo
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libtap_la_SOURCES)
+DIST_SOURCES = $(am__libtap_la_SOURCES_DIST)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__include_HEADERS_DIST = tap.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(includedir)"
+HEADERS = $(include_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/mkinstalldirs README
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASSERT_H = @ASSERT_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASENAME = @BASENAME@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+BYTESWAP_H = @BYTESWAP_H@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBILIBS = @DBILIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DEPLIBS = @DEPLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+EXTRAS = @EXTRAS@
+EXTRAS_ROOT = @EXTRAS_ROOT@
+EXTRA_NETOBJS = @EXTRA_NETOBJS@
+EXTRA_TEST = @EXTRA_TEST@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FLOORF_LIBM = @FLOORF_LIBM@
+GETADDRINFO_LIB = @GETADDRINFO_LIB@
+GETHOSTNAME_LIB = @GETHOSTNAME_LIB@
+GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@
+GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@
+GL_GNULIB_ACCEPT = @GL_GNULIB_ACCEPT@
+GL_GNULIB_ACCEPT4 = @GL_GNULIB_ACCEPT4@
+GL_GNULIB_ACCESS = @GL_GNULIB_ACCESS@
+GL_GNULIB_ACOSF = @GL_GNULIB_ACOSF@
+GL_GNULIB_ACOSL = @GL_GNULIB_ACOSL@
+GL_GNULIB_ALIGNED_ALLOC = @GL_GNULIB_ALIGNED_ALLOC@
+GL_GNULIB_ASINF = @GL_GNULIB_ASINF@
+GL_GNULIB_ASINL = @GL_GNULIB_ASINL@
+GL_GNULIB_ATAN2F = @GL_GNULIB_ATAN2F@
+GL_GNULIB_ATANF = @GL_GNULIB_ATANF@
+GL_GNULIB_ATANL = @GL_GNULIB_ATANL@
+GL_GNULIB_ATOLL = @GL_GNULIB_ATOLL@
+GL_GNULIB_BIND = @GL_GNULIB_BIND@
+GL_GNULIB_BTOWC = @GL_GNULIB_BTOWC@
+GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@
+GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@
+GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@
+GL_GNULIB_CBRT = @GL_GNULIB_CBRT@
+GL_GNULIB_CBRTF = @GL_GNULIB_CBRTF@
+GL_GNULIB_CBRTL = @GL_GNULIB_CBRTL@
+GL_GNULIB_CEIL = @GL_GNULIB_CEIL@
+GL_GNULIB_CEILF = @GL_GNULIB_CEILF@
+GL_GNULIB_CEILL = @GL_GNULIB_CEILL@
+GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@
+GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@
+GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@
+GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@
+GL_GNULIB_CONNECT = @GL_GNULIB_CONNECT@
+GL_GNULIB_COPYSIGN = @GL_GNULIB_COPYSIGN@
+GL_GNULIB_COPYSIGNF = @GL_GNULIB_COPYSIGNF@
+GL_GNULIB_COPYSIGNL = @GL_GNULIB_COPYSIGNL@
+GL_GNULIB_COPY_FILE_RANGE = @GL_GNULIB_COPY_FILE_RANGE@
+GL_GNULIB_COSF = @GL_GNULIB_COSF@
+GL_GNULIB_COSHF = @GL_GNULIB_COSHF@
+GL_GNULIB_COSL = @GL_GNULIB_COSL@
+GL_GNULIB_CREAT = @GL_GNULIB_CREAT@
+GL_GNULIB_CTIME = @GL_GNULIB_CTIME@
+GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
+GL_GNULIB_DUP = @GL_GNULIB_DUP@
+GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
+GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DUPLOCALE = @GL_GNULIB_DUPLOCALE@
+GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
+GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
+GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
+GL_GNULIB_EXECLE = @GL_GNULIB_EXECLE@
+GL_GNULIB_EXECLP = @GL_GNULIB_EXECLP@
+GL_GNULIB_EXECV = @GL_GNULIB_EXECV@
+GL_GNULIB_EXECVE = @GL_GNULIB_EXECVE@
+GL_GNULIB_EXECVP = @GL_GNULIB_EXECVP@
+GL_GNULIB_EXECVPE = @GL_GNULIB_EXECVPE@
+GL_GNULIB_EXP2 = @GL_GNULIB_EXP2@
+GL_GNULIB_EXP2F = @GL_GNULIB_EXP2F@
+GL_GNULIB_EXP2L = @GL_GNULIB_EXP2L@
+GL_GNULIB_EXPF = @GL_GNULIB_EXPF@
+GL_GNULIB_EXPL = @GL_GNULIB_EXPL@
+GL_GNULIB_EXPLICIT_BZERO = @GL_GNULIB_EXPLICIT_BZERO@
+GL_GNULIB_EXPM1 = @GL_GNULIB_EXPM1@
+GL_GNULIB_EXPM1F = @GL_GNULIB_EXPM1F@
+GL_GNULIB_EXPM1L = @GL_GNULIB_EXPM1L@
+GL_GNULIB_FABSF = @GL_GNULIB_FABSF@
+GL_GNULIB_FABSL = @GL_GNULIB_FABSL@
+GL_GNULIB_FACCESSAT = @GL_GNULIB_FACCESSAT@
+GL_GNULIB_FCHDIR = @GL_GNULIB_FCHDIR@
+GL_GNULIB_FCHMODAT = @GL_GNULIB_FCHMODAT@
+GL_GNULIB_FCHOWNAT = @GL_GNULIB_FCHOWNAT@
+GL_GNULIB_FCLOSE = @GL_GNULIB_FCLOSE@
+GL_GNULIB_FCNTL = @GL_GNULIB_FCNTL@
+GL_GNULIB_FDATASYNC = @GL_GNULIB_FDATASYNC@
+GL_GNULIB_FDOPEN = @GL_GNULIB_FDOPEN@
+GL_GNULIB_FFLUSH = @GL_GNULIB_FFLUSH@
+GL_GNULIB_FFS = @GL_GNULIB_FFS@
+GL_GNULIB_FFSL = @GL_GNULIB_FFSL@
+GL_GNULIB_FFSLL = @GL_GNULIB_FFSLL@
+GL_GNULIB_FGETC = @GL_GNULIB_FGETC@
+GL_GNULIB_FGETS = @GL_GNULIB_FGETS@
+GL_GNULIB_FLOOR = @GL_GNULIB_FLOOR@
+GL_GNULIB_FLOORF = @GL_GNULIB_FLOORF@
+GL_GNULIB_FLOORL = @GL_GNULIB_FLOORL@
+GL_GNULIB_FMA = @GL_GNULIB_FMA@
+GL_GNULIB_FMAF = @GL_GNULIB_FMAF@
+GL_GNULIB_FMAL = @GL_GNULIB_FMAL@
+GL_GNULIB_FMOD = @GL_GNULIB_FMOD@
+GL_GNULIB_FMODF = @GL_GNULIB_FMODF@
+GL_GNULIB_FMODL = @GL_GNULIB_FMODL@
+GL_GNULIB_FOPEN = @GL_GNULIB_FOPEN@
+GL_GNULIB_FOPEN_GNU = @GL_GNULIB_FOPEN_GNU@
+GL_GNULIB_FPRINTF = @GL_GNULIB_FPRINTF@
+GL_GNULIB_FPRINTF_POSIX = @GL_GNULIB_FPRINTF_POSIX@
+GL_GNULIB_FPURGE = @GL_GNULIB_FPURGE@
+GL_GNULIB_FPUTC = @GL_GNULIB_FPUTC@
+GL_GNULIB_FPUTS = @GL_GNULIB_FPUTS@
+GL_GNULIB_FREAD = @GL_GNULIB_FREAD@
+GL_GNULIB_FREE_POSIX = @GL_GNULIB_FREE_POSIX@
+GL_GNULIB_FREOPEN = @GL_GNULIB_FREOPEN@
+GL_GNULIB_FREXP = @GL_GNULIB_FREXP@
+GL_GNULIB_FREXPF = @GL_GNULIB_FREXPF@
+GL_GNULIB_FREXPL = @GL_GNULIB_FREXPL@
+GL_GNULIB_FSCANF = @GL_GNULIB_FSCANF@
+GL_GNULIB_FSEEK = @GL_GNULIB_FSEEK@
+GL_GNULIB_FSEEKO = @GL_GNULIB_FSEEKO@
+GL_GNULIB_FSTAT = @GL_GNULIB_FSTAT@
+GL_GNULIB_FSTATAT = @GL_GNULIB_FSTATAT@
+GL_GNULIB_FSYNC = @GL_GNULIB_FSYNC@
+GL_GNULIB_FTELL = @GL_GNULIB_FTELL@
+GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
+GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
+GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
+GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_GETADDRINFO = @GL_GNULIB_GETADDRINFO@
+GL_GNULIB_GETC = @GL_GNULIB_GETC@
+GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
+GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
+GL_GNULIB_GETDELIM = @GL_GNULIB_GETDELIM@
+GL_GNULIB_GETDOMAINNAME = @GL_GNULIB_GETDOMAINNAME@
+GL_GNULIB_GETDTABLESIZE = @GL_GNULIB_GETDTABLESIZE@
+GL_GNULIB_GETENTROPY = @GL_GNULIB_GETENTROPY@
+GL_GNULIB_GETGROUPS = @GL_GNULIB_GETGROUPS@
+GL_GNULIB_GETHOSTNAME = @GL_GNULIB_GETHOSTNAME@
+GL_GNULIB_GETLINE = @GL_GNULIB_GETLINE@
+GL_GNULIB_GETLOADAVG = @GL_GNULIB_GETLOADAVG@
+GL_GNULIB_GETLOGIN = @GL_GNULIB_GETLOGIN@
+GL_GNULIB_GETLOGIN_R = @GL_GNULIB_GETLOGIN_R@
+GL_GNULIB_GETOPT_POSIX = @GL_GNULIB_GETOPT_POSIX@
+GL_GNULIB_GETPAGESIZE = @GL_GNULIB_GETPAGESIZE@
+GL_GNULIB_GETPASS = @GL_GNULIB_GETPASS@
+GL_GNULIB_GETPASS_GNU = @GL_GNULIB_GETPASS_GNU@
+GL_GNULIB_GETPEERNAME = @GL_GNULIB_GETPEERNAME@
+GL_GNULIB_GETSOCKNAME = @GL_GNULIB_GETSOCKNAME@
+GL_GNULIB_GETSOCKOPT = @GL_GNULIB_GETSOCKOPT@
+GL_GNULIB_GETSUBOPT = @GL_GNULIB_GETSUBOPT@
+GL_GNULIB_GETUMASK = @GL_GNULIB_GETUMASK@
+GL_GNULIB_GETUSERSHELL = @GL_GNULIB_GETUSERSHELL@
+GL_GNULIB_GRANTPT = @GL_GNULIB_GRANTPT@
+GL_GNULIB_GROUP_MEMBER = @GL_GNULIB_GROUP_MEMBER@
+GL_GNULIB_HYPOT = @GL_GNULIB_HYPOT@
+GL_GNULIB_HYPOTF = @GL_GNULIB_HYPOTF@
+GL_GNULIB_HYPOTL = @GL_GNULIB_HYPOTL@
+GL_GNULIB_ILOGB = @GL_GNULIB_ILOGB@
+GL_GNULIB_ILOGBF = @GL_GNULIB_ILOGBF@
+GL_GNULIB_ILOGBL = @GL_GNULIB_ILOGBL@
+GL_GNULIB_IMAXABS = @GL_GNULIB_IMAXABS@
+GL_GNULIB_IMAXDIV = @GL_GNULIB_IMAXDIV@
+GL_GNULIB_INET_NTOP = @GL_GNULIB_INET_NTOP@
+GL_GNULIB_INET_PTON = @GL_GNULIB_INET_PTON@
+GL_GNULIB_ISATTY = @GL_GNULIB_ISATTY@
+GL_GNULIB_ISFINITE = @GL_GNULIB_ISFINITE@
+GL_GNULIB_ISINF = @GL_GNULIB_ISINF@
+GL_GNULIB_ISNAN = @GL_GNULIB_ISNAN@
+GL_GNULIB_ISNAND = @GL_GNULIB_ISNAND@
+GL_GNULIB_ISNANF = @GL_GNULIB_ISNANF@
+GL_GNULIB_ISNANL = @GL_GNULIB_ISNANL@
+GL_GNULIB_ISWBLANK = @GL_GNULIB_ISWBLANK@
+GL_GNULIB_ISWCTYPE = @GL_GNULIB_ISWCTYPE@
+GL_GNULIB_ISWDIGIT = @GL_GNULIB_ISWDIGIT@
+GL_GNULIB_ISWXDIGIT = @GL_GNULIB_ISWXDIGIT@
+GL_GNULIB_LCHMOD = @GL_GNULIB_LCHMOD@
+GL_GNULIB_LCHOWN = @GL_GNULIB_LCHOWN@
+GL_GNULIB_LDEXPF = @GL_GNULIB_LDEXPF@
+GL_GNULIB_LDEXPL = @GL_GNULIB_LDEXPL@
+GL_GNULIB_LINK = @GL_GNULIB_LINK@
+GL_GNULIB_LINKAT = @GL_GNULIB_LINKAT@
+GL_GNULIB_LISTEN = @GL_GNULIB_LISTEN@
+GL_GNULIB_LOCALECONV = @GL_GNULIB_LOCALECONV@
+GL_GNULIB_LOCALENAME = @GL_GNULIB_LOCALENAME@
+GL_GNULIB_LOCALTIME = @GL_GNULIB_LOCALTIME@
+GL_GNULIB_LOG = @GL_GNULIB_LOG@
+GL_GNULIB_LOG10 = @GL_GNULIB_LOG10@
+GL_GNULIB_LOG10F = @GL_GNULIB_LOG10F@
+GL_GNULIB_LOG10L = @GL_GNULIB_LOG10L@
+GL_GNULIB_LOG1P = @GL_GNULIB_LOG1P@
+GL_GNULIB_LOG1PF = @GL_GNULIB_LOG1PF@
+GL_GNULIB_LOG1PL = @GL_GNULIB_LOG1PL@
+GL_GNULIB_LOG2 = @GL_GNULIB_LOG2@
+GL_GNULIB_LOG2F = @GL_GNULIB_LOG2F@
+GL_GNULIB_LOG2L = @GL_GNULIB_LOG2L@
+GL_GNULIB_LOGB = @GL_GNULIB_LOGB@
+GL_GNULIB_LOGBF = @GL_GNULIB_LOGBF@
+GL_GNULIB_LOGBL = @GL_GNULIB_LOGBL@
+GL_GNULIB_LOGF = @GL_GNULIB_LOGF@
+GL_GNULIB_LOGL = @GL_GNULIB_LOGL@
+GL_GNULIB_LSEEK = @GL_GNULIB_LSEEK@
+GL_GNULIB_LSTAT = @GL_GNULIB_LSTAT@
+GL_GNULIB_MALLOC_GNU = @GL_GNULIB_MALLOC_GNU@
+GL_GNULIB_MALLOC_POSIX = @GL_GNULIB_MALLOC_POSIX@
+GL_GNULIB_MBRLEN = @GL_GNULIB_MBRLEN@
+GL_GNULIB_MBRTOWC = @GL_GNULIB_MBRTOWC@
+GL_GNULIB_MBSCASECMP = @GL_GNULIB_MBSCASECMP@
+GL_GNULIB_MBSCASESTR = @GL_GNULIB_MBSCASESTR@
+GL_GNULIB_MBSCHR = @GL_GNULIB_MBSCHR@
+GL_GNULIB_MBSCSPN = @GL_GNULIB_MBSCSPN@
+GL_GNULIB_MBSINIT = @GL_GNULIB_MBSINIT@
+GL_GNULIB_MBSLEN = @GL_GNULIB_MBSLEN@
+GL_GNULIB_MBSNCASECMP = @GL_GNULIB_MBSNCASECMP@
+GL_GNULIB_MBSNLEN = @GL_GNULIB_MBSNLEN@
+GL_GNULIB_MBSNRTOWCS = @GL_GNULIB_MBSNRTOWCS@
+GL_GNULIB_MBSPBRK = @GL_GNULIB_MBSPBRK@
+GL_GNULIB_MBSPCASECMP = @GL_GNULIB_MBSPCASECMP@
+GL_GNULIB_MBSRCHR = @GL_GNULIB_MBSRCHR@
+GL_GNULIB_MBSRTOWCS = @GL_GNULIB_MBSRTOWCS@
+GL_GNULIB_MBSSEP = @GL_GNULIB_MBSSEP@
+GL_GNULIB_MBSSPN = @GL_GNULIB_MBSSPN@
+GL_GNULIB_MBSSTR = @GL_GNULIB_MBSSTR@
+GL_GNULIB_MBSTOK_R = @GL_GNULIB_MBSTOK_R@
+GL_GNULIB_MBTOWC = @GL_GNULIB_MBTOWC@
+GL_GNULIB_MDA_ACCESS = @GL_GNULIB_MDA_ACCESS@
+GL_GNULIB_MDA_CHDIR = @GL_GNULIB_MDA_CHDIR@
+GL_GNULIB_MDA_CHMOD = @GL_GNULIB_MDA_CHMOD@
+GL_GNULIB_MDA_CLOSE = @GL_GNULIB_MDA_CLOSE@
+GL_GNULIB_MDA_CREAT = @GL_GNULIB_MDA_CREAT@
+GL_GNULIB_MDA_DUP = @GL_GNULIB_MDA_DUP@
+GL_GNULIB_MDA_DUP2 = @GL_GNULIB_MDA_DUP2@
+GL_GNULIB_MDA_ECVT = @GL_GNULIB_MDA_ECVT@
+GL_GNULIB_MDA_EXECL = @GL_GNULIB_MDA_EXECL@
+GL_GNULIB_MDA_EXECLE = @GL_GNULIB_MDA_EXECLE@
+GL_GNULIB_MDA_EXECLP = @GL_GNULIB_MDA_EXECLP@
+GL_GNULIB_MDA_EXECV = @GL_GNULIB_MDA_EXECV@
+GL_GNULIB_MDA_EXECVE = @GL_GNULIB_MDA_EXECVE@
+GL_GNULIB_MDA_EXECVP = @GL_GNULIB_MDA_EXECVP@
+GL_GNULIB_MDA_EXECVPE = @GL_GNULIB_MDA_EXECVPE@
+GL_GNULIB_MDA_FCLOSEALL = @GL_GNULIB_MDA_FCLOSEALL@
+GL_GNULIB_MDA_FCVT = @GL_GNULIB_MDA_FCVT@
+GL_GNULIB_MDA_FDOPEN = @GL_GNULIB_MDA_FDOPEN@
+GL_GNULIB_MDA_FILENO = @GL_GNULIB_MDA_FILENO@
+GL_GNULIB_MDA_GCVT = @GL_GNULIB_MDA_GCVT@
+GL_GNULIB_MDA_GETCWD = @GL_GNULIB_MDA_GETCWD@
+GL_GNULIB_MDA_GETPID = @GL_GNULIB_MDA_GETPID@
+GL_GNULIB_MDA_GETW = @GL_GNULIB_MDA_GETW@
+GL_GNULIB_MDA_ISATTY = @GL_GNULIB_MDA_ISATTY@
+GL_GNULIB_MDA_J0 = @GL_GNULIB_MDA_J0@
+GL_GNULIB_MDA_J1 = @GL_GNULIB_MDA_J1@
+GL_GNULIB_MDA_JN = @GL_GNULIB_MDA_JN@
+GL_GNULIB_MDA_LSEEK = @GL_GNULIB_MDA_LSEEK@
+GL_GNULIB_MDA_MEMCCPY = @GL_GNULIB_MDA_MEMCCPY@
+GL_GNULIB_MDA_MKDIR = @GL_GNULIB_MDA_MKDIR@
+GL_GNULIB_MDA_MKTEMP = @GL_GNULIB_MDA_MKTEMP@
+GL_GNULIB_MDA_OPEN = @GL_GNULIB_MDA_OPEN@
+GL_GNULIB_MDA_PUTENV = @GL_GNULIB_MDA_PUTENV@
+GL_GNULIB_MDA_PUTW = @GL_GNULIB_MDA_PUTW@
+GL_GNULIB_MDA_READ = @GL_GNULIB_MDA_READ@
+GL_GNULIB_MDA_RMDIR = @GL_GNULIB_MDA_RMDIR@
+GL_GNULIB_MDA_STRDUP = @GL_GNULIB_MDA_STRDUP@
+GL_GNULIB_MDA_SWAB = @GL_GNULIB_MDA_SWAB@
+GL_GNULIB_MDA_TEMPNAM = @GL_GNULIB_MDA_TEMPNAM@
+GL_GNULIB_MDA_TZSET = @GL_GNULIB_MDA_TZSET@
+GL_GNULIB_MDA_UMASK = @GL_GNULIB_MDA_UMASK@
+GL_GNULIB_MDA_UNLINK = @GL_GNULIB_MDA_UNLINK@
+GL_GNULIB_MDA_WCSDUP = @GL_GNULIB_MDA_WCSDUP@
+GL_GNULIB_MDA_WRITE = @GL_GNULIB_MDA_WRITE@
+GL_GNULIB_MDA_Y0 = @GL_GNULIB_MDA_Y0@
+GL_GNULIB_MDA_Y1 = @GL_GNULIB_MDA_Y1@
+GL_GNULIB_MDA_YN = @GL_GNULIB_MDA_YN@
+GL_GNULIB_MEMCHR = @GL_GNULIB_MEMCHR@
+GL_GNULIB_MEMMEM = @GL_GNULIB_MEMMEM@
+GL_GNULIB_MEMPCPY = @GL_GNULIB_MEMPCPY@
+GL_GNULIB_MEMRCHR = @GL_GNULIB_MEMRCHR@
+GL_GNULIB_MEMSET_EXPLICIT = @GL_GNULIB_MEMSET_EXPLICIT@
+GL_GNULIB_MKDIR = @GL_GNULIB_MKDIR@
+GL_GNULIB_MKDIRAT = @GL_GNULIB_MKDIRAT@
+GL_GNULIB_MKDTEMP = @GL_GNULIB_MKDTEMP@
+GL_GNULIB_MKFIFO = @GL_GNULIB_MKFIFO@
+GL_GNULIB_MKFIFOAT = @GL_GNULIB_MKFIFOAT@
+GL_GNULIB_MKNOD = @GL_GNULIB_MKNOD@
+GL_GNULIB_MKNODAT = @GL_GNULIB_MKNODAT@
+GL_GNULIB_MKOSTEMP = @GL_GNULIB_MKOSTEMP@
+GL_GNULIB_MKOSTEMPS = @GL_GNULIB_MKOSTEMPS@
+GL_GNULIB_MKSTEMP = @GL_GNULIB_MKSTEMP@
+GL_GNULIB_MKSTEMPS = @GL_GNULIB_MKSTEMPS@
+GL_GNULIB_MKTIME = @GL_GNULIB_MKTIME@
+GL_GNULIB_MODF = @GL_GNULIB_MODF@
+GL_GNULIB_MODFF = @GL_GNULIB_MODFF@
+GL_GNULIB_MODFL = @GL_GNULIB_MODFL@
+GL_GNULIB_NANOSLEEP = @GL_GNULIB_NANOSLEEP@
+GL_GNULIB_NL_LANGINFO = @GL_GNULIB_NL_LANGINFO@
+GL_GNULIB_NONBLOCKING = @GL_GNULIB_NONBLOCKING@
+GL_GNULIB_OBSTACK_PRINTF = @GL_GNULIB_OBSTACK_PRINTF@
+GL_GNULIB_OBSTACK_PRINTF_POSIX = @GL_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_GNULIB_OPEN = @GL_GNULIB_OPEN@
+GL_GNULIB_OPENAT = @GL_GNULIB_OPENAT@
+GL_GNULIB_OVERRIDES_STRUCT_STAT = @GL_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_GNULIB_PCLOSE = @GL_GNULIB_PCLOSE@
+GL_GNULIB_PERROR = @GL_GNULIB_PERROR@
+GL_GNULIB_PIPE = @GL_GNULIB_PIPE@
+GL_GNULIB_PIPE2 = @GL_GNULIB_PIPE2@
+GL_GNULIB_POPEN = @GL_GNULIB_POPEN@
+GL_GNULIB_POSIX_MEMALIGN = @GL_GNULIB_POSIX_MEMALIGN@
+GL_GNULIB_POSIX_OPENPT = @GL_GNULIB_POSIX_OPENPT@
+GL_GNULIB_POWF = @GL_GNULIB_POWF@
+GL_GNULIB_PREAD = @GL_GNULIB_PREAD@
+GL_GNULIB_PRINTF = @GL_GNULIB_PRINTF@
+GL_GNULIB_PRINTF_POSIX = @GL_GNULIB_PRINTF_POSIX@
+GL_GNULIB_PTSNAME = @GL_GNULIB_PTSNAME@
+GL_GNULIB_PTSNAME_R = @GL_GNULIB_PTSNAME_R@
+GL_GNULIB_PUTC = @GL_GNULIB_PUTC@
+GL_GNULIB_PUTCHAR = @GL_GNULIB_PUTCHAR@
+GL_GNULIB_PUTENV = @GL_GNULIB_PUTENV@
+GL_GNULIB_PUTS = @GL_GNULIB_PUTS@
+GL_GNULIB_PWRITE = @GL_GNULIB_PWRITE@
+GL_GNULIB_QSORT_R = @GL_GNULIB_QSORT_R@
+GL_GNULIB_RANDOM = @GL_GNULIB_RANDOM@
+GL_GNULIB_RANDOM_R = @GL_GNULIB_RANDOM_R@
+GL_GNULIB_RAWMEMCHR = @GL_GNULIB_RAWMEMCHR@
+GL_GNULIB_READ = @GL_GNULIB_READ@
+GL_GNULIB_READLINK = @GL_GNULIB_READLINK@
+GL_GNULIB_READLINKAT = @GL_GNULIB_READLINKAT@
+GL_GNULIB_REALLOCARRAY = @GL_GNULIB_REALLOCARRAY@
+GL_GNULIB_REALLOC_GNU = @GL_GNULIB_REALLOC_GNU@
+GL_GNULIB_REALLOC_POSIX = @GL_GNULIB_REALLOC_POSIX@
+GL_GNULIB_REALPATH = @GL_GNULIB_REALPATH@
+GL_GNULIB_RECV = @GL_GNULIB_RECV@
+GL_GNULIB_RECVFROM = @GL_GNULIB_RECVFROM@
+GL_GNULIB_REMAINDER = @GL_GNULIB_REMAINDER@
+GL_GNULIB_REMAINDERF = @GL_GNULIB_REMAINDERF@
+GL_GNULIB_REMAINDERL = @GL_GNULIB_REMAINDERL@
+GL_GNULIB_REMOVE = @GL_GNULIB_REMOVE@
+GL_GNULIB_RENAME = @GL_GNULIB_RENAME@
+GL_GNULIB_RENAMEAT = @GL_GNULIB_RENAMEAT@
+GL_GNULIB_RINT = @GL_GNULIB_RINT@
+GL_GNULIB_RINTF = @GL_GNULIB_RINTF@
+GL_GNULIB_RINTL = @GL_GNULIB_RINTL@
+GL_GNULIB_RMDIR = @GL_GNULIB_RMDIR@
+GL_GNULIB_ROUND = @GL_GNULIB_ROUND@
+GL_GNULIB_ROUNDF = @GL_GNULIB_ROUNDF@
+GL_GNULIB_ROUNDL = @GL_GNULIB_ROUNDL@
+GL_GNULIB_RPMATCH = @GL_GNULIB_RPMATCH@
+GL_GNULIB_SCANF = @GL_GNULIB_SCANF@
+GL_GNULIB_SECURE_GETENV = @GL_GNULIB_SECURE_GETENV@
+GL_GNULIB_SEND = @GL_GNULIB_SEND@
+GL_GNULIB_SENDTO = @GL_GNULIB_SENDTO@
+GL_GNULIB_SETENV = @GL_GNULIB_SETENV@
+GL_GNULIB_SETHOSTNAME = @GL_GNULIB_SETHOSTNAME@
+GL_GNULIB_SETLOCALE = @GL_GNULIB_SETLOCALE@
+GL_GNULIB_SETLOCALE_NULL = @GL_GNULIB_SETLOCALE_NULL@
+GL_GNULIB_SETSOCKOPT = @GL_GNULIB_SETSOCKOPT@
+GL_GNULIB_SHUTDOWN = @GL_GNULIB_SHUTDOWN@
+GL_GNULIB_SIGABBREV_NP = @GL_GNULIB_SIGABBREV_NP@
+GL_GNULIB_SIGDESCR_NP = @GL_GNULIB_SIGDESCR_NP@
+GL_GNULIB_SIGNBIT = @GL_GNULIB_SIGNBIT@
+GL_GNULIB_SINF = @GL_GNULIB_SINF@
+GL_GNULIB_SINHF = @GL_GNULIB_SINHF@
+GL_GNULIB_SINL = @GL_GNULIB_SINL@
+GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
+GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SOCKET = @GL_GNULIB_SOCKET@
+GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
+GL_GNULIB_SQRTF = @GL_GNULIB_SQRTF@
+GL_GNULIB_SQRTL = @GL_GNULIB_SQRTL@
+GL_GNULIB_STAT = @GL_GNULIB_STAT@
+GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
+GL_GNULIB_STDIO_H_SIGPIPE = @GL_GNULIB_STDIO_H_SIGPIPE@
+GL_GNULIB_STPCPY = @GL_GNULIB_STPCPY@
+GL_GNULIB_STPNCPY = @GL_GNULIB_STPNCPY@
+GL_GNULIB_STRCASESTR = @GL_GNULIB_STRCASESTR@
+GL_GNULIB_STRCHRNUL = @GL_GNULIB_STRCHRNUL@
+GL_GNULIB_STRDUP = @GL_GNULIB_STRDUP@
+GL_GNULIB_STRERROR = @GL_GNULIB_STRERROR@
+GL_GNULIB_STRERRORNAME_NP = @GL_GNULIB_STRERRORNAME_NP@
+GL_GNULIB_STRERROR_R = @GL_GNULIB_STRERROR_R@
+GL_GNULIB_STRFTIME = @GL_GNULIB_STRFTIME@
+GL_GNULIB_STRNCAT = @GL_GNULIB_STRNCAT@
+GL_GNULIB_STRNDUP = @GL_GNULIB_STRNDUP@
+GL_GNULIB_STRNLEN = @GL_GNULIB_STRNLEN@
+GL_GNULIB_STRPBRK = @GL_GNULIB_STRPBRK@
+GL_GNULIB_STRPTIME = @GL_GNULIB_STRPTIME@
+GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@
+GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@
+GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@
+GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@
+GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@
+GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@
+GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@
+GL_GNULIB_STRTOLD = @GL_GNULIB_STRTOLD@
+GL_GNULIB_STRTOLL = @GL_GNULIB_STRTOLL@
+GL_GNULIB_STRTOUL = @GL_GNULIB_STRTOUL@
+GL_GNULIB_STRTOULL = @GL_GNULIB_STRTOULL@
+GL_GNULIB_STRTOUMAX = @GL_GNULIB_STRTOUMAX@
+GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
+GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
+GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
+GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_TANF = @GL_GNULIB_TANF@
+GL_GNULIB_TANHF = @GL_GNULIB_TANHF@
+GL_GNULIB_TANL = @GL_GNULIB_TANL@
+GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
+GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
+GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@
+GL_GNULIB_TIME_R = @GL_GNULIB_TIME_R@
+GL_GNULIB_TIME_RZ = @GL_GNULIB_TIME_RZ@
+GL_GNULIB_TMPFILE = @GL_GNULIB_TMPFILE@
+GL_GNULIB_TOWCTRANS = @GL_GNULIB_TOWCTRANS@
+GL_GNULIB_TRUNC = @GL_GNULIB_TRUNC@
+GL_GNULIB_TRUNCATE = @GL_GNULIB_TRUNCATE@
+GL_GNULIB_TRUNCF = @GL_GNULIB_TRUNCF@
+GL_GNULIB_TRUNCL = @GL_GNULIB_TRUNCL@
+GL_GNULIB_TTYNAME_R = @GL_GNULIB_TTYNAME_R@
+GL_GNULIB_TZSET = @GL_GNULIB_TZSET@
+GL_GNULIB_UNISTD_H_GETOPT = @GL_GNULIB_UNISTD_H_GETOPT@
+GL_GNULIB_UNISTD_H_NONBLOCKING = @GL_GNULIB_UNISTD_H_NONBLOCKING@
+GL_GNULIB_UNISTD_H_SIGPIPE = @GL_GNULIB_UNISTD_H_SIGPIPE@
+GL_GNULIB_UNLINK = @GL_GNULIB_UNLINK@
+GL_GNULIB_UNLINKAT = @GL_GNULIB_UNLINKAT@
+GL_GNULIB_UNLOCKPT = @GL_GNULIB_UNLOCKPT@
+GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
+GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
+GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
+GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
+GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
+GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
+GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
+GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
+GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
+GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
+GL_GNULIB_WCPCPY = @GL_GNULIB_WCPCPY@
+GL_GNULIB_WCPNCPY = @GL_GNULIB_WCPNCPY@
+GL_GNULIB_WCRTOMB = @GL_GNULIB_WCRTOMB@
+GL_GNULIB_WCSCASECMP = @GL_GNULIB_WCSCASECMP@
+GL_GNULIB_WCSCAT = @GL_GNULIB_WCSCAT@
+GL_GNULIB_WCSCHR = @GL_GNULIB_WCSCHR@
+GL_GNULIB_WCSCMP = @GL_GNULIB_WCSCMP@
+GL_GNULIB_WCSCOLL = @GL_GNULIB_WCSCOLL@
+GL_GNULIB_WCSCPY = @GL_GNULIB_WCSCPY@
+GL_GNULIB_WCSCSPN = @GL_GNULIB_WCSCSPN@
+GL_GNULIB_WCSDUP = @GL_GNULIB_WCSDUP@
+GL_GNULIB_WCSFTIME = @GL_GNULIB_WCSFTIME@
+GL_GNULIB_WCSLEN = @GL_GNULIB_WCSLEN@
+GL_GNULIB_WCSNCASECMP = @GL_GNULIB_WCSNCASECMP@
+GL_GNULIB_WCSNCAT = @GL_GNULIB_WCSNCAT@
+GL_GNULIB_WCSNCMP = @GL_GNULIB_WCSNCMP@
+GL_GNULIB_WCSNCPY = @GL_GNULIB_WCSNCPY@
+GL_GNULIB_WCSNLEN = @GL_GNULIB_WCSNLEN@
+GL_GNULIB_WCSNRTOMBS = @GL_GNULIB_WCSNRTOMBS@
+GL_GNULIB_WCSPBRK = @GL_GNULIB_WCSPBRK@
+GL_GNULIB_WCSRCHR = @GL_GNULIB_WCSRCHR@
+GL_GNULIB_WCSRTOMBS = @GL_GNULIB_WCSRTOMBS@
+GL_GNULIB_WCSSPN = @GL_GNULIB_WCSSPN@
+GL_GNULIB_WCSSTR = @GL_GNULIB_WCSSTR@
+GL_GNULIB_WCSTOK = @GL_GNULIB_WCSTOK@
+GL_GNULIB_WCSWIDTH = @GL_GNULIB_WCSWIDTH@
+GL_GNULIB_WCSXFRM = @GL_GNULIB_WCSXFRM@
+GL_GNULIB_WCTOB = @GL_GNULIB_WCTOB@
+GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
+GL_GNULIB_WCTRANS = @GL_GNULIB_WCTRANS@
+GL_GNULIB_WCTYPE = @GL_GNULIB_WCTYPE@
+GL_GNULIB_WCWIDTH = @GL_GNULIB_WCWIDTH@
+GL_GNULIB_WMEMCHR = @GL_GNULIB_WMEMCHR@
+GL_GNULIB_WMEMCMP = @GL_GNULIB_WMEMCMP@
+GL_GNULIB_WMEMCPY = @GL_GNULIB_WMEMCPY@
+GL_GNULIB_WMEMMOVE = @GL_GNULIB_WMEMMOVE@
+GL_GNULIB_WMEMPCPY = @GL_GNULIB_WMEMPCPY@
+GL_GNULIB_WMEMSET = @GL_GNULIB_WMEMSET@
+GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
+GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREEADDRINFO = @HAVE_DECL_FREEADDRINFO@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GAI_STRERROR = @HAVE_DECL_GAI_STRERROR@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
+HAVE_DECL_GETADDRINFO = @HAVE_DECL_GETADDRINFO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETNAMEINFO = @HAVE_DECL_GETNAMEINFO@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
+HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETUMASK = @HAVE_GETUMASK@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MBTOWC = @HAVE_MBTOWC@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MEMSET_EXPLICIT = @HAVE_MEMSET_EXPLICIT@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETDB_H = @HAVE_NETDB_H@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASECMP = @HAVE_STRCASECMP@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
+HAVE_STRINGS_H = @HAVE_STRINGS_H@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_ADDRINFO = @HAVE_STRUCT_ADDRINFO@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
+HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@
+HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__EXIT = @HAVE__EXIT@
+HOSTENT_LIB = @HOSTENT_LIB@
+HOSTNAME = @HOSTNAME@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_NTOP_LIB = @INET_NTOP_LIB@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
+INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+KRBINCLUDE = @KRBINCLUDE@
+LD = @LD@
+LDAPINCLUDE = @LDAPINCLUDE@
+LDAPLIBS = @LDAPLIBS@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURLCFLAGS = @LIBCURLCFLAGS@
+LIBCURLINCLUDE = @LIBCURLINCLUDE@
+LIBCURLLIBS = @LIBCURLLIBS@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
+LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CRYPTO = @LIB_CRYPTO@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
+LIMITS_H = @LIMITS_H@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATHLIBS = @MATHLIBS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
+MYSQLCFLAGS = @MYSQLCFLAGS@
+MYSQLINCLUDE = @MYSQLINCLUDE@
+MYSQLLIBS = @MYSQLLIBS@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_ASSERT_H = @NEXT_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETDB_H = @NEXT_AS_FIRST_DIRECTIVE_NETDB_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETDB_H = @NEXT_NETDB_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NP_RELEASE = @NP_RELEASE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_APTGET = @PATH_TO_APTGET@
+PATH_TO_DIG = @PATH_TO_DIG@
+PATH_TO_ENV = @PATH_TO_ENV@
+PATH_TO_FPING = @PATH_TO_FPING@
+PATH_TO_FPING6 = @PATH_TO_FPING6@
+PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
+PATH_TO_LSPS = @PATH_TO_LSPS@
+PATH_TO_MAILQ = @PATH_TO_MAILQ@
+PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
+PATH_TO_PING = @PATH_TO_PING@
+PATH_TO_PING6 = @PATH_TO_PING6@
+PATH_TO_PS = @PATH_TO_PS@
+PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
+PATH_TO_QSTAT = @PATH_TO_QSTAT@
+PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
+PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
+PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
+PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
+PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
+PATH_TO_SSH = @PATH_TO_SSH@
+PATH_TO_SUDO = @PATH_TO_SUDO@
+PATH_TO_SWAP = @PATH_TO_SWAP@
+PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
+PATH_TO_UPTIME = @PATH_TO_UPTIME@
+PATH_TO_WHO = @PATH_TO_WHO@
+PERL = @PERL@
+PERLMODS_DIR = @PERLMODS_DIR@
+PGINCLUDE = @PGINCLUDE@
+PGLIBS = @PGLIBS@
+PKGCONFIG = @PKGCONFIG@
+PKG_ARCH = @PKG_ARCH@
+PLUGIN_TEST = @PLUGIN_TEST@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PRIPTR_PREFIX = @PRIPTR_PREFIX@
+PST3CFLAGS = @PST3CFLAGS@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RADIUSLIBS = @RADIUSLIBS@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+REPLACE_ACCESS = @REPLACE_ACCESS@
+REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
+REPLACE_ASINF = @REPLACE_ASINF@
+REPLACE_ATAN2F = @REPLACE_ATAN2F@
+REPLACE_ATANF = @REPLACE_ATANF@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@
+REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHMOD = @REPLACE_CHMOD@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_COPY_FILE_RANGE = @REPLACE_COPY_FILE_RANGE@
+REPLACE_COSF = @REPLACE_COSF@
+REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FOPEN_FOR_FOPEN_GNU = @REPLACE_FOPEN_FOR_FOPEN_GNU@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GAI_STRERROR = @REPLACE_GAI_STRERROR@
+REPLACE_GETADDRINFO = @REPLACE_GETADDRINFO@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETPASS_FOR_GETPASS_GNU = @REPLACE_GETPASS_FOR_GETPASS_GNU@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME = @REPLACE_LOCALTIME@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC_FOR_MALLOC_GNU = @REPLACE_MALLOC_FOR_MALLOC_GNU@
+REPLACE_MALLOC_FOR_MALLOC_POSIX = @REPLACE_MALLOC_FOR_MALLOC_POSIX@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RANDOM = @REPLACE_RANDOM@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_READLINKAT = @REPLACE_READLINKAT@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
+REPLACE_REALLOC_FOR_REALLOC_GNU = @REPLACE_REALLOC_FOR_REALLOC_GNU@
+REPLACE_REALLOC_FOR_REALLOC_POSIX = @REPLACE_REALLOC_FOR_REALLOC_POSIX@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
+REPLACE_SINF = @REPLACE_SINF@
+REPLACE_SINHF = @REPLACE_SINHF@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTF = @REPLACE_SQRTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
+REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TANF = @REPLACE_TANF@
+REPLACE_TANHF = @REPLACE_TANHF@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+REV_DATESTAMP = @REV_DATESTAMP@
+REV_TIMESTAMP = @REV_TIMESTAMP@
+SCRIPT_TEST = @SCRIPT_TEST@
+SED = @SED@
+SERVENT_LIB = @SERVENT_LIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+SOCKETLIBS = @SOCKETLIBS@
+SSLINCLUDE = @SSLINCLUDE@
+SSLLIBS = @SSLLIBS@
+STDALIGN_H = @STDALIGN_H@
+STDCKDINT_H = @STDCKDINT_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SUPPORT = @SUPPORT@
+SYSTEMDINCLUDE = @SYSTEMDINCLUDE@
+SYSTEMDLIBS = @SYSTEMDLIBS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
+UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
+UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+URIPARSER = @URIPARSER@
+URIPARSERCFLAGS = @URIPARSERCFLAGS@
+URIPARSERINCLUDE = @URIPARSERINCLUDE@
+URIPARSERLIBS = @URIPARSERLIBS@
+URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARRANTY = @WARRANTY@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+WTSAPI32LIBS = @WTSAPI32LIBS@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+check_tcp_ssl = @check_tcp_ssl@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJDEPS = @gl_LIBOBJDEPS@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJDEPS = @gltests_LIBOBJDEPS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+np_mysql_config = @np_mysql_config@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_trusted_path = @with_trusted_path@
+@USE_LIBTAP_LOCAL_TRUE@noinst_LTLIBRARIES = libtap.la
+@USE_LIBTAP_LOCAL_TRUE@libtap_la_SOURCES = tap.c tap.h
+@USE_LIBTAP_LOCAL_TRUE@include_HEADERS = tap.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tap/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tap/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+libtap.la: $(libtap_la_OBJECTS) $(libtap_la_DEPENDENCIES) $(EXTRA_libtap_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(am_libtap_la_rpath) $(libtap_la_OBJECTS) $(libtap_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tap.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(includedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/tap.Plo
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/tap.Plo
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-includeHEADERS install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-includeHEADERS
+
+.PRECIOUS: Makefile
+
+
+# see top comment
+#prove:
+# prove -v -r
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tap/README b/tap/README
new file mode 100644
index 0000000..6c15be0
--- /dev/null
+++ b/tap/README
@@ -0,0 +1,11 @@
+NAME
+ tap -- write tests that implement the Test Anything Protocol
+
+SYNOPSIS
+ #include <tap.h>
+
+DESCRIPTION
+ The tap library provides functions for writing test scripts that produce
+ output consistent with the Test Anything Protocol. A test harness that
+ parses this protocol can run these tests and produce useful reports indi-
+ cating their success or failure.
diff --git a/tap/tap.c b/tap/tap.c
new file mode 100644
index 0000000..97c20e9
--- /dev/null
+++ b/tap/tap.c
@@ -0,0 +1,435 @@
+/*-
+ * Copyright (c) 2004 Nik Clayton
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "tap.h"
+
+static int no_plan = 0;
+static int skip_all = 0;
+static int have_plan = 0;
+static unsigned int test_count = 0; /* Number of tests that have been run */
+static unsigned int e_tests = 0; /* Expected number of tests to run */
+static unsigned int failures = 0; /* Number of tests that failed */
+static char *todo_msg = NULL;
+static char *todo_msg_fixed = "libtap malloc issue";
+static int todo = 0;
+static int test_died = 0;
+
+/* Encapsulate the pthread code in a conditional. In the absence of
+ libpthread the code does nothing */
+#ifdef HAVE_LIBPTHREAD
+#include <pthread.h>
+static pthread_mutex_t M = PTHREAD_MUTEX_INITIALIZER;
+# define LOCK pthread_mutex_lock(&M);
+# define UNLOCK pthread_mutex_unlock(&M);
+#else
+# define LOCK
+# define UNLOCK
+#endif
+
+static void _expected_tests(unsigned int);
+static void _tap_init(void);
+static void _cleanup(void);
+
+/*
+ * Generate a test result.
+ *
+ * ok -- boolean, indicates whether or not the test passed.
+ * test_name -- the name of the test, may be NULL
+ * test_comment -- a comment to print afterwards, may be NULL
+ */
+unsigned int
+_gen_result(int ok, const char *func, char *file, unsigned int line,
+ char *test_name, ...)
+{
+ va_list ap;
+ char *local_test_name = NULL;
+ char *c;
+ int name_is_digits;
+
+ LOCK;
+
+ test_count++;
+
+ /* Start by taking the test name and performing any printf()
+ expansions on it */
+ if(test_name != NULL) {
+ va_start(ap, test_name);
+ vasprintf(&local_test_name, test_name, ap);
+ va_end(ap);
+
+ /* Make sure the test name contains more than digits
+ and spaces. Emit an error message and exit if it
+ does */
+ if(local_test_name) {
+ name_is_digits = 1;
+ for(c = local_test_name; *c != '\0'; c++) {
+ if(!isdigit(*c) && !isspace(*c)) {
+ name_is_digits = 0;
+ break;
+ }
+ }
+
+ if(name_is_digits) {
+ diag(" You named your test '%s'. You shouldn't use numbers for your test names.", local_test_name);
+ diag(" Very confusing.");
+ }
+ }
+ }
+
+ if(!ok) {
+ printf("not ");
+ failures++;
+ }
+
+ printf("ok %d", test_count);
+
+ if(test_name != NULL) {
+ printf(" - ");
+
+ /* Print the test name, escaping any '#' characters it
+ might contain */
+ if(local_test_name != NULL) {
+ flockfile(stdout);
+ for(c = local_test_name; *c != '\0'; c++) {
+ if(*c == '#')
+ fputc('\\', stdout);
+ fputc((int)*c, stdout);
+ }
+ funlockfile(stdout);
+ } else { /* vasprintf() failed, use a fixed message */
+ printf("%s", todo_msg_fixed);
+ }
+ }
+
+ /* If we're in a todo_start() block then flag the test as being
+ TODO. todo_msg should contain the message to print at this
+ point. If it's NULL then asprintf() failed, and we should
+ use the fixed message.
+
+ This is not counted as a failure, so decrement the counter if
+ the test failed. */
+ if(todo) {
+ printf(" # TODO %s", todo_msg ? todo_msg : todo_msg_fixed);
+ if(!ok)
+ failures--;
+ }
+
+ printf("\n");
+
+ if(!ok)
+ diag(" Failed %stest (%s:%s() at line %d)",
+ todo ? "(TODO) " : "", file, func, line);
+
+ free(local_test_name);
+
+ UNLOCK;
+
+ /* We only care (when testing) that ok is positive, but here we
+ specifically only want to return 1 or 0 */
+ return ok ? 1 : 0;
+}
+
+/*
+ * Initialise the TAP library. Will only do so once, however many times it's
+ * called.
+ */
+void
+_tap_init(void)
+{
+ static int run_once = 0;
+
+ LOCK;
+
+ if(!run_once) {
+ atexit(_cleanup);
+
+ /* stdout needs to be unbuffered so that the output appears
+ in the same place relative to stderr output as it does
+ with Test::Harness */
+ setbuf(stdout, 0);
+ run_once = 1;
+ }
+
+ UNLOCK;
+}
+
+/*
+ * Note that there's no plan.
+ */
+int
+plan_no_plan(void)
+{
+
+ LOCK;
+
+ _tap_init();
+
+ if(have_plan != 0) {
+ fprintf(stderr, "You tried to plan twice!\n");
+ test_died = 1;
+ UNLOCK;
+ exit(255);
+ }
+
+ have_plan = 1;
+ no_plan = 1;
+
+ UNLOCK;
+
+ return 0;
+}
+
+/*
+ * Note that the plan is to skip all tests
+ */
+int
+plan_skip_all(char *reason)
+{
+
+ LOCK;
+
+ _tap_init();
+
+ skip_all = 1;
+
+ printf("1..0");
+
+ if(reason != NULL)
+ printf(" # Skip %s", reason);
+
+ printf("\n");
+
+ UNLOCK;
+
+ exit(0);
+}
+
+/*
+ * Note the number of tests that will be run.
+ */
+int
+plan_tests(unsigned int tests)
+{
+
+ LOCK;
+
+ _tap_init();
+
+ if(have_plan != 0) {
+ fprintf(stderr, "You tried to plan twice!\n");
+ test_died = 1;
+ UNLOCK;
+ exit(255);
+ }
+
+ if(tests == 0) {
+ fprintf(stderr, "You said to run 0 tests! You've got to run something.\n");
+ test_died = 1;
+ UNLOCK;
+ exit(255);
+ }
+
+ have_plan = 1;
+
+ _expected_tests(tests);
+
+ UNLOCK;
+
+ return 0;
+}
+
+unsigned int
+diag(char *fmt, ...)
+{
+ va_list ap;
+
+ LOCK;
+
+ fputs("# ", stderr);
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+
+ fputs("\n", stderr);
+
+ UNLOCK;
+
+ return 0;
+}
+
+void
+_expected_tests(unsigned int tests)
+{
+
+ LOCK;
+
+ printf("1..%d\n", tests);
+ e_tests = tests;
+
+ UNLOCK;
+}
+
+int
+skip(unsigned int n, char *fmt, ...)
+{
+ va_list ap;
+ char *skip_msg;
+
+ LOCK;
+
+ va_start(ap, fmt);
+ asprintf(&skip_msg, fmt, ap);
+ va_end(ap);
+
+ while(n-- > 0) {
+ test_count++;
+ printf("ok %d # skip %s\n", test_count,
+ skip_msg != NULL ?
+ skip_msg : "libtap():malloc() failed");
+ }
+
+ free(skip_msg);
+
+ UNLOCK;
+
+ return 1;
+}
+
+void
+todo_start(char *fmt, ...)
+{
+ va_list ap;
+
+ LOCK;
+
+ va_start(ap, fmt);
+ vasprintf(&todo_msg, fmt, ap);
+ va_end(ap);
+
+ todo = 1;
+
+ UNLOCK;
+}
+
+void
+todo_end(void)
+{
+
+ LOCK;
+
+ todo = 0;
+ free(todo_msg);
+
+ UNLOCK;
+}
+
+int
+exit_status(void)
+{
+ int r;
+
+ LOCK;
+
+ /* If there's no plan, just return the number of failures */
+ if(no_plan || !have_plan) {
+ UNLOCK;
+ return failures;
+ }
+
+ /* Ran too many tests? Return the number of tests that were run
+ that shouldn't have been */
+ if(e_tests < test_count) {
+ r = test_count - e_tests;
+ UNLOCK;
+ return r;
+ }
+
+ /* Return the number of tests that failed + the number of tests
+ that weren't run */
+ r = failures + e_tests - test_count;
+ UNLOCK;
+
+ return r;
+}
+
+/*
+ * Cleanup at the end of the run, produce any final output that might be
+ * required.
+ */
+void
+_cleanup(void)
+{
+
+ LOCK;
+
+ /* If plan_no_plan() wasn't called, and we don't have a plan,
+ and we're not skipping everything, then something happened
+ before we could produce any output */
+ if(!no_plan && !have_plan && !skip_all) {
+ diag("Looks like your test died before it could output anything.");
+ UNLOCK;
+ return;
+ }
+
+ if(test_died) {
+ diag("Looks like your test died just after %d.", test_count);
+ UNLOCK;
+ return;
+ }
+
+
+ /* No plan provided, but now we know how many tests were run, and can
+ print the header at the end */
+ if(!skip_all && (no_plan || !have_plan)) {
+ printf("1..%d\n", test_count);
+ }
+
+ if((have_plan && !no_plan) && e_tests < test_count) {
+ diag("Looks like you planned %d tests but ran %d extra.",
+ e_tests, test_count - e_tests);
+ UNLOCK;
+ return;
+ }
+
+ if((have_plan || !no_plan) && e_tests > test_count) {
+ diag("Looks like you planned %d tests but only ran %d.",
+ e_tests, test_count);
+ UNLOCK;
+ return;
+ }
+
+ if(failures)
+ diag("Looks like you failed %d tests of %d.",
+ failures, test_count);
+
+ UNLOCK;
+}
diff --git a/tap/tap.h b/tap/tap.h
new file mode 100644
index 0000000..8ee525c
--- /dev/null
+++ b/tap/tap.h
@@ -0,0 +1,91 @@
+/*-
+ * Copyright (c) 2004 Nik Clayton
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* '## __VA_ARGS__' is a gcc'ism. C99 doesn't allow the token pasting
+ and requires the caller to add the final comma if they've omitted
+ the optional arguments */
+#ifdef __GNUC__
+# define ok(e, test, ...) ((e) ? \
+ _gen_result(1, __func__, __FILE__, __LINE__, \
+ test, ## __VA_ARGS__) : \
+ _gen_result(0, __func__, __FILE__, __LINE__, \
+ test, ## __VA_ARGS__))
+
+# define ok1(e) ((e) ? \
+ _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
+ _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
+
+# define pass(test, ...) ok(1, test, ## __VA_ARGS__);
+# define fail(test, ...) ok(0, test, ## __VA_ARGS__);
+
+# define skip_start(test, n, fmt, ...) \
+ do { \
+ if((test)) { \
+ skip(n, fmt, ## __VA_ARGS__); \
+ continue; \
+ }
+#else /* __GNUC__ */
+/* The original tap.h used to test if __STDC_VERSION__ >= 199901L here. This
+ * doesn't seem to work on HP-UX even though the code compile fine. I'm not
+ * sure how to add an exception here for HP-UX so I just removed the check
+ * for now */
+# define ok(e, ...) ((e) ? \
+ _gen_result(1, __func__, __FILE__, __LINE__, \
+ __VA_ARGS__) : \
+ _gen_result(0, __func__, __FILE__, __LINE__, \
+ __VA_ARGS__))
+
+# define ok1(e) ((e) ? \
+ _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
+ _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
+
+# define pass(...) ok(1, __VA_ARGS__);
+# define fail(...) ok(0, __VA_ARGS__);
+
+# define skip_start(test, n, ...) \
+ do { \
+ if((test)) { \
+ skip(n, __VA_ARGS__); \
+ continue; \
+ }
+#endif /* __GNUC__ */
+
+# define skip_end } while(0);
+
+unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...);
+
+int plan_no_plan(void);
+int plan_skip_all(char *);
+int plan_tests(unsigned int);
+
+unsigned int diag(char *, ...);
+
+int skip(unsigned int, char *, ...);
+
+void todo_start(char *, ...);
+void todo_end(void);
+
+int exit_status(void);
diff --git a/test.pl.in b/test.pl.in
new file mode 100755
index 0000000..2f2c44f
--- /dev/null
+++ b/test.pl.in
@@ -0,0 +1,52 @@
+#!/usr/bin/perl -w -I .. -I ../..
+#
+# Wrapper for running the test harnesses
+#
+
+use strict;
+
+use Getopt::Long;
+
+use NPTest qw(DetermineTestHarnessDirectory TestsFrom);
+
+$ENV{LC_ALL} = 'C';
+
+my @tstdir;
+
+if ( ! GetOptions( "testdir:s" => \@tstdir ) )
+{
+ print "Usage: ${0} [--testdir=<directory>] [<test_harness.t> ...]\n";
+ exit 1;
+}
+
+my @tests;
+
+if ( scalar( @ARGV ) )
+{
+ @tests = @ARGV;
+}
+else
+{
+ my @directory = DetermineTestHarnessDirectory( @tstdir );
+
+ if ( @directory == 0 )
+ {
+ print STDERR "$0: Unable to determine the test harness directory - ABORTING\n";
+ exit 2;
+ }
+
+ for my $d ( @directory )
+ {
+ push (@tests, TestsFrom( $d, 1 ));
+ }
+}
+
+if ( ! scalar( @tests ) )
+{
+ print STDERR "$0: Unable to determine the test harnesses to run - ABORTING\n";
+ exit 3;
+}
+
+use Test::Harness;
+
+runtests( @tests );
diff --git a/tools/build_perl_modules b/tools/build_perl_modules
new file mode 100755
index 0000000..b8cd34c
--- /dev/null
+++ b/tools/build_perl_modules
@@ -0,0 +1,290 @@
+#!/usr/bin/perl
+# SYNTAX:
+# build_perl_modules -d dest_dir [-c] [-m] [-t] [-i] [-s <section>] tarball_dir
+#
+# DESCRIPTION:
+# Installs perl modules found in tarball_dir
+# Expects a file called install_order, containing one line per distribution name
+# Will take action against each distribution in turn
+# -d is a necessary destination directory for the perl mods
+# If -c is set, will remove the module build directories and exit
+# If -e is set, will extract module
+# If -m is set, will run perl Makefile.PL and make
+# If -t is set, will run make test
+# If -i is set, will run make install
+# If -s <section> specified will only work on that section in the
+# install_order file - defaults to first section only
+# Options are discrete. This is because an overall ./configure, make, make test, make install
+# are run in different invocations. Obviously, you can't run a -t without a -m, but there's no
+# checking here for that
+
+# Can only use base modules
+use warnings;
+use strict;
+use Config;
+use Getopt::Std;
+use Cwd;
+use File::Path;
+
+# remove host site_lib directories to ensure this is a 'full & clean' build of deps
+BEGIN: {
+ my @user_libs = split( /:/, $ENV{PERL5LIB} || "" );
+ chomp(@user_libs);
+
+ # clear out old PERL5LIB to avoid confusion with anything preinstalled
+ foreach my $lib (@INC) {
+ next if $lib eq ".";
+ foreach my $var (qw/ sitelib_stem sitelib sitearch sitearchexp /) {
+ foreach my $user_lib (@user_libs) {
+ $lib = '' if ( $lib =~ m/$user_lib/ );
+ }
+ $lib = ''
+ if ( ( $Config{$var} && $lib =~ m/^$Config{$var}/ )
+ || $lib =~ m/site_perl/ );
+ }
+ }
+}
+
+my $file_regexp = '(\.pm)?-v?([\d_]+\.?)*\.(?:tgz|tar\.gz)$';
+
+my $have_yaml = 0;
+my $have_module_build = 0;
+
+my $opts = {};
+getopts( 'd:cemtis:', $opts ) || die "Invalid options";
+my $moddir = shift @ARGV
+ or die "Must specify a directory where tarballs exist";
+
+my $prefix = $opts->{d};
+die "Must set a destination directory" unless $prefix;
+
+my $destdir = '';
+my $mm_destdir = '';
+my $mb_destdir = '';
+if ( $ENV{DESTDIR} ) {
+ $destdir = $ENV{DESTDIR};
+ $mm_destdir = 'DESTDIR=' . $destdir;
+ $mb_destdir = '--destdir ' . $destdir;
+}
+
+chdir $moddir or die "Cannot change to $moddir";
+open F, "install_order" or die "Cannot open install_order file";
+my @files = grep { !/^#/ && chop } <F>;
+close F;
+
+# Remove linux only perl module from Solaris systems
+if ( $^O eq "solaris" ) {
+ @files = grep { !/Sys-Statistics-Linux/ } @files;
+}
+
+my @filelist;
+opendir( DIR, "." );
+foreach my $found ( readdir(DIR) ) {
+ push( @filelist, $found )
+ if ( -f $found && $found =~ m/\.(?:tgz|tar\.gz)$/ );
+}
+close(DIR);
+
+my $tag = $opts->{s} || "default";
+my $in_section = 0;
+
+my @tarballs;
+foreach my $f (@files) {
+ next
+ if ( !$f || $f =~ m/^\s+$/ || $f =~ m/^\s*#/ ); # ignore all blank lines
+ $f =~ s/\s+//; # remove all whitespaces from line
+ $f =~ s/\s+#.*//; # remove all comments from the line
+
+ if ( $f =~ m/^(\w+):$/ ) {
+ if ( $tag && $1 ne $tag && $tag ne "all" ) {
+ $in_section = 0;
+ next;
+ }
+ $in_section = 1;
+ $tag = $1 if ( !$tag );
+ last if ( $1 ne $tag && $tag ne "all" );
+ next;
+ }
+
+ next if ( !$in_section );
+
+ # sort fully qualified names
+ #$f =~ s/(\.pm)?-v?(\d+\.?)*\.(?:tgz|tar\.gz)//;
+ #warn("b4 f=$f");
+ $f =~ s/$file_regexp//;
+
+ # Needs to be better. Also, what if there are two with same name?
+ #warn("f=$f");
+ my $tarball = ( grep( /^$f$file_regexp/, @filelist ) )[0];
+
+ #warn("got f=$f tarball=$tarball");
+ #eval '$tarball = <' . "$f" . '[-pmv0-9.]*.tar.gz>';
+ die("Couldn't find tarball for $f in $moddir\n")
+ unless ( $tarball && -f $tarball );
+ push @tarballs, $tarball;
+ ( my $dir = $tarball ) =~ s/\.(?:tgz|tar.gz)$//;
+
+ # Need to do cleaning before doing each module in turn
+ if ( $opts->{c} ) {
+ print "Cleaning $dir", $/;
+ rmtree($dir) if ($dir);
+ }
+}
+
+if ( $opts->{c} ) {
+ print "Finished cleaning", $/;
+ exit;
+}
+
+my $libs = "$destdir/$prefix/lib:$destdir/$prefix/lib/$Config{archname}";
+
+my $topdir = cwd();
+
+# set an initial value if there isn't one already
+# Need to use PERL5LIB to ensure we get pre-installed mods from earlier
+# tags in the install_order file
+$ENV{PERL5LIB} ||= q{};
+
+# Set Module::AutoInstall to ignore CPAN, to avoid trying to pull dependencies in
+$ENV{PERL_AUTOINSTALL} = "--skipdeps";
+
+# keep a record of how many times a module build is done. This is so they may
+# be built a second time to include optional prereq's that couldn't
+# previously be built due to circular dependencies
+my %built_modules;
+foreach my $tarball (@tarballs) {
+ ( my $dir = $tarball ) =~ s/\.(?:tgz|tar.gz)$//;
+
+ die if ( $dir eq "exit" );
+
+ if ( $opts->{e} ) {
+ unless ( -e $dir ) {
+ print 'Extracting ', $tarball, $/;
+ system("gunzip -c $tarball | tar -xf -") == 0
+ or die "Cannot extract $tarball";
+ }
+ next unless ( $opts->{m} || $opts->{t} || $opts->{i} );
+ }
+
+ # Need to add this so all modules is are for subsequent ones
+ # Done here to partial previous builds can be continued
+ $ENV{PERL5LIB} = "$topdir/$dir/blib/arch:" . $ENV{PERL5LIB}; # Required for IO-Compress, I think
+ $ENV{PERL5LIB} = "$topdir/$dir/blib/lib:" . $ENV{PERL5LIB};
+
+ # PathTools does something weird where it removes blib from @INC. We manually force ExtUtils::MakeMaker to be included
+ $ENV{PERL5LIB} = "$topdir/$dir/lib:" . $ENV{PERL5LIB} if ($dir =~/ExtUtils-MakeMaker/);
+
+ # warn("PERL5LIB=$ENV{PERL5LIB}");
+
+ if ( !$have_yaml ) {
+ $have_yaml = 0;
+ }
+
+ if ( !$have_module_build ) {
+ $have_module_build = check_for_module('Module::Build');
+ }
+
+ if ( $opts->{m} ) {
+
+ # Don't compile if already done - this is because of invocating this
+ # script at different stages
+ print "******************** $tarball\n";
+ if ( $built_modules{$dir} || !-f "$dir/Makefile" && !-f "$dir/Build" ) {
+ $built_modules{$dir}++;
+ my @missing;
+ chdir "$topdir/$dir" or die "Can't chdir into $dir";
+ warn("\nWorking in: $topdir/$dir\n\n");
+
+ # Another horrible hack. XML-Parser uses special Makefile variables, so we add these on here for Solaris only
+ my $extra_args = "";
+ if ( $^O eq "solaris" && $dir =~ /^XML-Parser-/ ) {
+ $extra_args = "EXPATLIBPATH=/usr/sfw/lib EXPATINCPATH=/usr/sfw/share/src/expat/lib/";
+ }
+
+ #warn("PERL5LIB=$ENV{PERL5LIB}\n");
+
+ if ( -f "Build.PL" && $have_module_build ) {
+ warn("Using Build.PL\n");
+ }
+ elsif ( -f 'Makefile.PL' ) {
+ warn("Using Makefile.PL\n");
+
+ # Horribly hacky - remove xdefine if this is Time-HiRes
+ # because the subsequent perl Makefile.PL will fail
+ if ( $dir =~ /Time-HiRes/ ) {
+ unlink "xdefine";
+ }
+ }
+ else {
+ die "No Makefile.PL nor Build.PL found";
+ }
+
+ my $command;
+ if ( -f "Build.PL" && $have_module_build ) {
+ open( CMD, "|-", "perl Build.PL $mb_destdir --install_base=$prefix --install_path lib=$prefix/lib --install_path arch=$prefix/lib/$Config{archname} --install_path bin=$prefix/bin --install_path script=$prefix/bin --install_path bindoc=$prefix/man/man1 --install_path libdoc=$prefix/man/man3" ) || die "Can't run perl Build.PL";
+ $command = "./Build";
+ }
+ elsif ( -f 'Makefile.PL' ) {
+ open( CMD, "|-", "perl Makefile.PL $mm_destdir INSTALL_BASE=$prefix INSTALLDIRS=site INSTALLSITELIB=$prefix/lib INSTALLSITEARCH=$prefix/lib/$Config{archname} $extra_args" ) || die "Can't run perl Makefile.PL";
+ $command = "make";
+ }
+ else {
+ die "No Makefile.PL nor Build.PL found";
+ }
+ close(CMD);
+ system($command) == 0
+ or die "Can't run $command. Please\n\trm -rf $topdir/$dir\nto remake from this point)";
+
+ chdir $topdir or die "Can't chdir to top";
+ }
+ }
+
+ chdir $dir or die "Can't chdir into $dir";
+
+ if ( $opts->{t} ) {
+ warn("****** Testing $dir ****** \n");
+ if ( -f "Build.PL" ) {
+ system("./Build test") == 0
+ or die "'Build test' failed in $dir: $!\n";
+ }
+ else {
+ system("make test") == 0
+ or die "'make test' failed in $dir: $!\n";
+ }
+ }
+ if ( $opts->{i} && !-f 'installed' ) {
+
+ # Need to set this so that XML::SAX will install ParserDetails.ini by finding the right XML::SAX copy
+ # Also makes sense to do this anyway, as I guess CPAN must be doing this for it to usually work
+ my $saved_PERL5LIB = $ENV{PERL5LIB};
+ $ENV{PERL5LIB} = "$destdir/$prefix/lib:$saved_PERL5LIB";
+ if ( -f "Build" ) {
+ system("./Build install") == 0
+ or die "Can't run make install: $!\n";
+ }
+ else {
+ system("make install") == 0
+ or die "Can't run make install: $!\n";
+ }
+ $ENV{PERL5LIB} = $saved_PERL5LIB;
+ open my $install_flag_file, '>', 'installed'
+ or die 'Unable to touch "installed": ', $!, $/;
+ close $install_flag_file
+ or die 'Unable to close "installed": ', $!, $/;
+ }
+ chdir $topdir or die "Can't go back to $topdir";
+}
+
+sub check_for_module {
+ my ($module) = @_;
+
+ warn 'Checking if ', $module, ' is available yet...', $/;
+ if ( system("$^X -M$module -e 0 2>/dev/null") == 0 ) {
+ warn '... yes!', $/;
+ return 1;
+ }
+
+ warn '... no!', $/;
+ return 0;
+
+}
diff --git a/tools/tinderbox_build b/tools/tinderbox_build
new file mode 100755
index 0000000..1a41f57
--- /dev/null
+++ b/tools/tinderbox_build
@@ -0,0 +1,290 @@
+#!/usr/bin/perl
+# tinderbox_build.pl
+# This script builds the monitoringplugins and then sends
+# logs back to the master tinderbox server
+#
+# This script is based on mozilla-unix.pl which comes with tinderbox2
+#
+# See http://tinderbox.altinity.org for more details
+
+require 5.000;
+
+use strict;
+use Sys::Hostname;
+use Cwd;
+use Time::Local;
+
+my $Version = `git describe --abbrev=4 HEAD`;
+
+my $myhost = hostname;
+chomp($myhost);
+my ($host, $junk) = split(/\./, $myhost);
+
+my $BuildAdministrator = $ENV{TINDERBOX_BUILD_ADMIN} || "$ENV{'USER'}\@$myhost";
+my $TmpDir = $ENV{TMPDIR} || "/tmp";
+
+#Default values of cmdline opts
+my $ReportStatus = 0; # Do not send results to server
+
+# Set these to what makes sense for your system
+
+# Set these proper values for your tinderbox server
+# Have the StrictHostKeyChecking=no so that a new host will automatically add hostkey without
+# prompting. If host key changes, then will get error, so this should still be secure
+my $Tinderbox_server = '-p 1022 -o StrictHostKeyChecking=no tinderbox2@tinderbox.opsera.com';
+
+# These shouldn't really need to be changed
+my $BuildTree = 'monitoringplug';
+my $BuildName = '';
+my $ConfigureArgs = $ENV{CONFIGURE_ARGS};
+
+my $OS = `uname -s`;
+my $OSVer = `uname -r`;
+
+chop($OS, $OSVer);
+
+if ( $OS eq 'AIX' ) {
+ $OSVer = `uname -v`;
+ chop($OSVer);
+ $OSVer = $OSVer . "." . `uname -r`;
+ chop($OSVer);
+}
+
+if ( $OS eq 'IRIX64' ) {
+ $OS = 'IRIX';
+}
+
+if ( $OS eq 'SCO_SV' ) {
+ $OS = 'SCOOS';
+ $OSVer = '5.0';
+}
+
+if ( "$host" ne "" ) {
+ $BuildName = $host . ' ';
+}
+$BuildName .= $OS . ' ' . $OSVer;
+$_ = $BuildName;
+s/ /_/g;
+
+my $logfile = "$_.log";
+
+sub BuildIt {
+ my ($fe, @felist, $EarlyExit, $LastTime);
+
+ my $StartDir = getcwd();
+ $LastTime = 0;
+
+ print "Starting dir is : $StartDir\n";
+
+ my $EarlyExit = 0;
+
+ chdir("$StartDir");
+
+ my $StartTime = time;
+ if (-e (my $file = "monitoring-plugins.spec")) {
+ open F, $file;
+ while (<F>) {
+ if (/^Version: trunk-(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
+ $StartTime = timegm(0, $5, $4, $3, ($2 - 1), ($1 - 1900));
+ last;
+ }
+ }
+ }
+
+ print "Start time is $StartTime",$/;
+
+ my $CurrentDir = getcwd();
+ if ( $CurrentDir ne $StartDir ) {
+ print "startdir: $StartDir, curdir $CurrentDir\n";
+ die "curdir != startdir";
+ }
+
+ unlink( "$logfile" );
+
+ print "opening $logfile\n";
+ open( LOG, ">$logfile" ) || print "can't open $?\n";
+ print LOG "current dir is -- $host:$CurrentDir\n";
+ print LOG "Build Administrator is $BuildAdministrator\n";
+ &PrintEnv;
+
+ my $BuildStatus;
+ if (&configure) {
+ if (&make) {
+ if (&maketest) {
+ $BuildStatus = "success";
+ } else {
+ $BuildStatus = "test_failed";
+ }
+ } else {
+ $BuildStatus = "build_failed";
+ }
+ } else {
+ $BuildStatus = "busted";
+ }
+
+ print LOG "\nBuild Status = $BuildStatus\n";
+
+ close(LOG);
+ chdir("$StartDir");
+
+# TV: Leaving this in, because process mail program probably has some
+# limitation retained
+
+# this fun line added on 2/5/98. do not remove. Translated to english,
+# that's "take any line longer than 1000 characters, and split it into less
+# than 1000 char lines. If any of the resulting lines is
+# a dot on a line by itself, replace that with a blank line."
+# This is to prevent cases where a <cr>.<cr> occurs in the log file. Sendmail
+# interprets that as the end of the mail, and truncates the log before
+# it gets to Tinderbox. (terry weismann, chris yeh)
+#
+# This was replaced by a perl 'port' of the above, written by
+# preed@netscape.com; good things: no need for system() call, and now it's
+# all in perl, so we don't have to do OS checking like before.
+
+ open(LOG, "$logfile") || die "Couldn't open logfile: $!\n";
+ open(OUTLOG, ">${logfile}.last") || die "Couldn't open logfile: $!\n";
+
+ print OUTLOG $/;
+ print OUTLOG "tinderbox: tree: $BuildTree\n";
+ print OUTLOG "tinderbox: builddate: $StartTime\n";
+ print OUTLOG "tinderbox: status: $BuildStatus\n";
+ print OUTLOG "tinderbox: build: $BuildName $fe\n";
+ print OUTLOG "tinderbox: errorparser: unix\n";
+ print OUTLOG "tinderbox: buildfamily: unix\n";
+ print OUTLOG "tinderbox: END\n";
+ print OUTLOG $/;
+
+ while (<LOG>) {
+ my $q = 0;
+
+ for (;;) {
+ my $val = $q * 1000;
+ my $Output = substr($_, $val, 1000);
+
+ last if $Output eq undef;
+
+ $Output =~ s/^\.$//g;
+ $Output =~ s/\n//g;
+ print OUTLOG "$Output\n";
+ $q++;
+ } #EndFor
+
+ } #EndWhile
+
+ close(LOG);
+ close(OUTLOG);
+
+ if ($ReportStatus) {
+ system( "ssh $Tinderbox_server tinderbox_receive < ${logfile}.last" )
+ } else {
+ print <<"EOF"
+Not sending logs to http://tinderbox.altinity.org
+If you have SSH keys setup on the tinderbox server, you can manually send
+with 'ssh $Tinderbox_server tinderbox_receive < ${logfile}.last'
+EOF
+ }
+
+ unlink("$logfile");
+ print "Finished building for tinderbox",$/;
+
+} #EndSub-BuildIt
+
+sub ParseArgs {
+ my($i);
+
+ $i = 0;
+ while( $i < @ARGV ) {
+ if ($ARGV[$i] eq '--version' || $ARGV[$i] eq '-v') {
+ die "$0: version $Version\n";
+ } elsif ($ARGV[$i] eq '-y') {
+ $ReportStatus = 1;
+ } else {
+ &PrintUsage;
+ }
+
+ $i++;
+ } #EndWhile
+
+} #EndSub-ParseArgs
+
+sub PrintUsage {
+ die "usage: $0 [-v | --version ] [-t do not send report to tinderbox server]\n";
+}
+
+sub PrintEnv {
+ my ($key);
+ foreach $key (keys %ENV) {
+ print LOG "$key = $ENV{$key}\n";
+ print "$key = $ENV{$key}\n";
+ }
+
+ # Print the NPTest variables
+ if (-e "/var/tmp/NPTest.cache") {
+ open F, "/var/tmp/NPTest.cache";
+ print LOG "NPTest variables:\n";
+ print LOG <F>;
+ close F;
+ }
+
+} #EndSub-PrintEnv
+
+sub SetupPath {
+ my($Path);
+ $Path = $ENV{PATH};
+ print "Path before: $Path\n";
+
+ # Don't alter path if we're building off a repository tree;
+ # SunOS make will be used only for snapshots and releases.
+ if ( $OS eq 'SunOS' && !( -e '.svn' || -e '.git' )) {
+ $ENV{'PATH'} = '/usr/ccs/bin:' . $ENV{'PATH'};
+ }
+
+ $Path = $ENV{PATH};
+ print "Path After: $Path\n";
+} #EndSub-SetupPath
+
+sub configure {
+ # Configure
+ print LOG "./configure --enable-extra-opts --enable-libtap $ConfigureArgs 2>&1\n";
+ open (CONFIGURE, "./configure --enable-extra-opts --enable-libtap $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
+ while (<CONFIGURE>) {
+ print $_;
+ print LOG $_;
+ }
+ close(CONFIGURE);
+ return ! $?;
+}
+
+sub make {
+ # Building
+ print LOG "make 2>&1\n";
+ open( MAKE, "make 2>&1 |");
+ while ( <MAKE> ) {
+ print $_;
+ print LOG $_;
+ }
+ close( MAKE);
+ return ! $?;
+}
+
+sub maketest {
+ # Tests
+ print LOG "LANG=C make test 2>&1 && make install DESTDIR=$TmpDir/tinderbox_build.$$ 2>&1 && make install-strip DESTDIR=$TmpDir/tinderbox_build2.$$ 2>&1\n";
+ open( MAKE, "LANG=C make test 2>&1 && make install DESTDIR=$TmpDir/tinderbox_build.$$ 2>&1 && make install-strip DESTDIR=$TmpDir/tinderbox_build2.$$ 2>&1 |");
+ while ( <MAKE> ) {
+ print $_;
+ print LOG $_;
+ }
+ close( MAKE);
+ my $rc = $?;
+ system("rm -fr $TmpDir/tinderbox_build.$$ $TmpDir/tinderbox_build2.$$");
+ return ! $rc;
+}
+
+# Main function
+&ParseArgs;
+&SetupPath;
+&BuildIt;
+
+1;